Bug 4845 – Bad error message with missing math import for ^^

Status
RESOLVED
Resolution
DUPLICATE
Severity
minor
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Windows
Creation time
2010-09-09T12:46:00Z
Last change time
2013-01-07T15:13:35Z
Keywords
diagnostic
Assigned to
nobody
Creator
bearophile_hugs

Comments

Comment #0 by bearophile_hugs — 2010-09-09T12:46:42Z
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
Comment #1 by andrej.mitrovich — 2013-01-07T15:13:35Z
The pull for 9047 fixes the error message. *** This issue has been marked as a duplicate of issue 9047 ***