[Issue 4845] New: Bad error message with missing math import for ^^

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Sep 9 12:47:06 PDT 2010


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: nobody at puremagic.com
        ReportedBy: bearophile_hugs at eml.cc


--- Comment #0 from bearophile_hugs at 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: -------


More information about the Digitalmars-d-bugs mailing list