Test case 1: ----------------------------- auto bug6430(int a) { static struct Result2 {} return 4; } auto bug6430(int a, int b) { static struct Result2 { int z; int y() { return z; } // <-- line 11 } auto t = Result2(1); // <-- line 13 return 5; } ----------------------------- x.d(11): Error: this for z needs to be type Result2 not type Result2 x.d(13): Error: more initializers than fields of Result2 ----------------------------- The same happens if we replace 'static struct' as 'class' or 'union' with or without 'static'.
Also seen on 2.059 Win32
Fixed in 2.062.
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/470def4e3573e16b0869a083820488457bee86c8 fix Issue 6430 - Overloaded auto-return functions each with a nested aggregate of the same name are conflated