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

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Jan 7 11:14:43 PST 2013


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



--- Comment #2 from bearophile_hugs at eml.cc 2013-01-07 11:14:42 PST ---
(In reply to comment #1)
> 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.

The code the performs that rewriting should verify that the correctness
conditions are satisfied, and otherwise possibly rewrite the ^^ with something
that shows a good error message.

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