S a = {{}}; // fail S b = {{;}}; // fail S c = {{x=0;}}; // fail T d = {{return 0;}}; // fail void main(){ S x = {{}}; // ok S y = {{;}}; // fail S z = {{x=0;}}; // fail T w = {{return 0;}}; // fail } The program should compile. The inconsistency between x and y suggests that the issue is partly related to the parser.
Timon, fairly sure that's not the entire program. What's the definition of S?
(In reply to Vladimir Panteleev from comment #1) > Timon, fairly sure that's not the entire program. What's the definition of S? Oops. Thanks! The entire program: struct S{ void delegate() dg; } struct T{ int delegate() dg; } int x; S a = {{}}; // fail S b = {{;}}; // fail S c = {{x=0;}}; // fail T d = {{return 0;}}; // fail void main(){ S x = {{}}; // ok S y = {{;}}; // fail S z = {{x=0;}}; // fail T w = {{return 0;}}; // fail }
struct S{ void delegate() dg; } struct T{ int delegate() dg; } int x; S a = {{}}; // ok S b = {{;}}; // ok S c = {{x=0;}}; // ok T d = {{return 0;}}; // ok void main(){ int g; S x1 = {{}}; // ok S y = {{;}}; // ok S z = {{x=0;}}; // ok T w = {{return 0;}}; // ok }