1 // REQUIRED_ARGS: -o- 2 // PERMUTE_ARGS: 3 foo()4void foo() {} 5 alias F = typeof(foo); 6 block_c()7const { void block_c() {} } block_i()8immutable { void block_i() {} } block_w()9inout { void block_w() {} } block_s()10shared { void block_s() {} } block_sc()11shared const { void block_sc() {} } block_sw()12shared inout { void block_sw() {} } 13 14 static assert(is(typeof(block_c) == F)); 15 static assert(is(typeof(block_i) == F)); 16 static assert(is(typeof(block_w) == F)); 17 static assert(is(typeof(block_s) == F)); 18 static assert(is(typeof(block_sc) == F)); 19 static assert(is(typeof(block_sw) == F)); 20 version(all)21version (all) { const: void label_c() {} } version(all)22version (all) { immutable: void label_i() {} } version(all)23version (all) { inout: void label_w() {} } version(all)24version (all) { shared: void label_s() {} } version(all)25version (all) { shared const: void label_sc() {} } version(all)26version (all) { shared inout: void label_sw() {} } 27 28 static assert(is(typeof(label_c) == F)); 29 static assert(is(typeof(label_i) == F)); 30 static assert(is(typeof(label_w) == F)); 31 static assert(is(typeof(label_s) == F)); 32 static assert(is(typeof(label_sc) == F)); 33 static assert(is(typeof(label_sw) == F)); 34 35 class C 36 { block_c()37 const { static void block_c() {} } block_i()38 immutable { static void block_i() {} } block_w()39 inout { static void block_w() {} } block_s()40 shared { static void block_s() {} } block_sc()41 shared const { static void block_sc() {} } block_sw()42 shared inout { static void block_sw() {} } 43 44 static assert(is(typeof(block_c) == F)); 45 static assert(is(typeof(block_i) == F)); 46 static assert(is(typeof(block_w) == F)); 47 static assert(is(typeof(block_s) == F)); 48 static assert(is(typeof(block_sc) == F)); 49 static assert(is(typeof(block_sw) == F)); 50 version(all)51 version (all) { const: static void label_c() {} } version(all)52 version (all) { immutable: static void label_i() {} } version(all)53 version (all) { inout: static void label_w() {} } version(all)54 version (all) { shared: static void label_s() {} } version(all)55 version (all) { shared const: static void label_sc() {} } version(all)56 version (all) { shared inout: static void label_sw() {} } 57 58 static assert(is(typeof(label_c) == F)); 59 static assert(is(typeof(label_i) == F)); 60 static assert(is(typeof(label_w) == F)); 61 static assert(is(typeof(label_s) == F)); 62 static assert(is(typeof(label_sc) == F)); 63 static assert(is(typeof(label_sw) == F)); 64 } 65