www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 4845] New: Bad error message with missing math import for ^^

reply d-bugmail puremagic.com writes:
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 puremagic.com
        ReportedBy: bearophile_hugs eml.cc


--- Comment #0 from bearophile_hugs 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: -------
Sep 09 2010
parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=4845


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |andrej.mitrovich gmail.com
         Resolution|                            |DUPLICATE


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2013-01-07
15:13:35 PST ---
The pull for 9047 fixes the error message.

*** This issue has been marked as a duplicate of issue 9047 ***

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