Bug 6430 – Overloaded auto-return functions each with a nested aggregate of the same name are conflated

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-02T13:34:00Z
Last change time
2014-06-08T02:42:33Z
Keywords
rejects-valid
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2011-08-02T13:34:53Z
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'.
Comment #1 by lovelydear — 2012-04-27T07:42:11Z
Also seen on 2.059 Win32
Comment #2 by k.hara.pg — 2014-05-17T14:29:09Z
Fixed in 2.062.
Comment #3 by github-bugzilla — 2014-06-08T02:42:26Z
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