May 25, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8149

           Summary: Possible forward reference mistake
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody@puremagic.com
        ReportedBy: bearophile_hugs@eml.cc


--- Comment #0 from bearophile_hugs@eml.cc 2012-05-25 13:25:50 PDT ---
import std.algorithm: map;
auto foo() {
    int spam(int) {
        if (true) {
            return 0;
        } else {
            [1].map!spam();
            int this_is_a_mistake;
            return 0;
        }
    }
    return &spam;
}
void main() {}


DMD 2.060alpha gives:

test.d(8): Error: variable this_is_a_mistake forward referenced
test.d(7): Error: template instance test.foo.map!(spam).map!(int[]) error
instantiating

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 16, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8149


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies@gmail.com
         Resolution|                            |WORKSFORME


--- Comment #1 from yebblies <yebblies@gmail.com> 2013-01-17 02:20:21 EST ---
No error with 2.062

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home