[Issue 4186] New: Forward reference error from static function with no return type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri May 14 04:59:21 PDT 2010


http://d.puremagic.com/issues/show_bug.cgi?id=4186

           Summary: Forward reference error from static function with no
                    return type
           Product: D
           Version: future
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at eml.cc 2010-05-14 04:59:19 PDT ---
This is D2 code:


static foo() {
    return 1.0;
}
enum double x = foo(); // line 4
void main() {}


dmd v2.045 shows at compile time:
test.d(4): Error: forward reference to foo


The error message is wrong in two ways:
- It doesn't show the error of the missing return type of foo at line 1
- There is a forward reference error that D isn't supposed to generate here

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


More information about the Digitalmars-d-bugs mailing list