www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6430] New: Overloaded auto-return functions each with a nested aggregate of the same name are conflated

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6430

           Summary: Overloaded auto-return functions each with a nested
                    aggregate of the same name are conflated
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: kennytm gmail.com



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'.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Aug 02 2011
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6430


SomeDude <lovelydear mailmetrash.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |lovelydear mailmetrash.com
           Platform|Other                       |All
         OS/Version|Mac OS X                    |All



PDT ---
Also seen on 2.059 Win32

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Apr 27 2012