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

           Summary: Some missing "import std.math to use ^^ operator"
                    error messages
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            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 2012-07-06 17:44:32 PDT ---
A wrong D2 program:

void main() {
    int x1 = 10;
    auto y1 = x1 ^^ 5;
}


It gives a correct error message:
test.d(3): Error: must import std.math to use ^^ operator

------------------------

But adding a second power it gives a wrong error message (dmd 2.060alpha):

void main() {
    int x1 = 10;
    auto y1 = x1 ^^ 5;
    double x2 = 10.5;
    auto y2 = x2 ^^ 5;
}


test.d(3): Error: must import std.math to use ^^ operator
test.d(5): Error: undefined identifier 'std'


Here I'd like the second power to give an error message similar to the first
one.

------------------------

Something similar happens if you import pow, this time for both powers:


import std.math: pow;
void main() {
    int x1 = 10;
    auto y1 = x1 ^^ 5;
    double x2 = 10.5;
    auto y2 = x2 ^^ 5;
}


test.d(4): Error: undefined identifier 'std'
test.d(6): Error: undefined identifier 'std'

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

Reply via email to