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

           Summary: Bad error message with missing math import for ^^
           Product: D
           Version: D2
          Platform: x86
        OS/Version: Windows
            Status: NEW
          Keywords: diagnostic
          Severity: minor
          Priority: P2
         Component: DMD
        AssignedTo: nob...@puremagic.com
        ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-09-09 12:46:42 PDT ---
This D2 program is OK (dmd 2.048), the math import is required to perform the
^^:


import std.conv: to;
import std.math;
int foo(int b, int e) {
    return b ^^ e;
}
void main() {
    foo(5, 3);
}



If I remove the math import the program doesn't compile:

import std.conv: to;
int foo(int b, int e) {
    return b ^^ e;
}
void main() {
    foo(5, 3);
}


But the given error message is bad:
test.d(3): Error: undefined identifier module test.std

An error message like this is better:
test.d(5): Error: must import std.math to use ^^ operator

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

Reply via email to