[Issue 9047] Expression requiring std.math fails with function-local import

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 7 10:51:05 PST 2013


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


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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|diagnostic                  |rejects-valid
                 CC|                            |andrej.mitrovich at gmail.com
         AssignedTo|nobody at puremagic.com        |andrej.mitrovich at gmail.com
            Summary|Bad error message with      |Expression requiring
                   |power ^^ operator           |std.math fails with
                   |                            |function-local import
         OS/Version|Windows                     |All
           Severity|minor                       |normal


--- Comment #1 from Andrej Mitrovic <andrej.mitrovich at gmail.com> 2013-01-07 10:51:03 PST ---
I don't think this is a diagnostic bug, it's a problem where the compiler
rewrites the call to:

void main() {
    import std.math;
    auto f = (double a, double b) => .std.math.pow(a, b);
}

This is why you get a "undefined identifier std" message.

Using the .dot won't work here because the import is function-local.

-- 
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