Issue 9047 - Expression requiring std.math fails with local import #1438

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
5 participants
Member

yebblies commented May 9, 2013

I really hate this part of the compiler!

Member

ibuclaw commented May 9, 2013

You think you've got problems, I put in a further check to say "hey! looks like you haven't imported std.math, well that's no problem as I can handle it in the back end."

As opposed to the error emitted by dmd. :)

Member

yebblies commented May 9, 2013

I think it's time to look at moving std.math.pow to druntime...

Member

klickverbot commented May 9, 2013

Yes. Let's not pollute Scope with this nonsense.

Member

yebblies commented May 9, 2013

Where should pow go in druntime?

@ghost

ghost commented May 9, 2013

If we move it to druntime won't the code still need an import to the module where pow is defined?

Member

yebblies commented May 9, 2013

No. Many language features (eg ~ new throw) are lowered to druntime calls without requiring imports. It doesn't make any sense for a language feature to require an import to make it work - or for the compiler to depend on a supposedly optional standard library.

It may be worth merging this in the meantime though...

@ghost

ghost commented May 9, 2013

It may be worth merging this in the meantime though...

I'd rather we go ahead with putting it in druntime. I don't like this hack at all.

Owner

braddr commented May 9, 2013

This need's don's input. In the past, he's been against putting it in druntime.

Member

ibuclaw commented May 9, 2013

No. Many language features (eg ~ new throw) are lowered to druntime calls without requiring imports. It doesn't make any sense for a language feature to require an import to make it work - or for the compiler to depend on a supposedly optional standard library.

Actually, pow() is rather special in that it does require to be imported, as the function called is CTFE-able. There are several tests that depend on this.

@AndrejMitrovic AndrejMitrovic Fixes Issue 9047 - Expression requiring std.math fails with local import
Mark scoped symbol where std.math is imported to allow the
creation of a proper lookup expression to pow() function.
b581ce9
@ghost

ghost commented Apr 24, 2014

Well, it's been a year. Any fresh opinions?

ghost closed this Apr 24, 2014

This issue was closed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment