Bug 7532 – DMD stripping imports in header files

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-02-17T08:18:00Z
Last change time
2012-06-07T05:42:20Z
Keywords
wrong-code
Assigned to
nobody
Creator
admin

Comments

Comment #0 by admin — 2012-02-17T08:18:24Z
DMD seems to strip the part following the ":" in the import statement in header-files (.di). This causes strange errors when e.g. import "std.math : sqrt" and "core.stdc.math : fmodf", since sqrt is also defined in core.stdc.math. Example: // linalg.di - Header private { import std.math; import std.conv; import std.traits; import std.string; import std.array; import std.algorithm; import gl3n.math; import gl3n.util; } // linalg.d - Source private { import std.math : isNaN, isInfinity, sqrt; import std.conv : to; import std.traits : isFloatingPoint, isStaticArray, isDynamicArray, isImplicitlyConvertible; import std.string : format, rightJustify; import std.array : join; import std.algorithm : max, min, reduce; import gl3n.math : clamp, PI, abs, sin, cos, acos, tan, asin, atan2; import gl3n.util : is_vector, is_matrix, is_quaternion; } gl3n.math imports "core.stdc.math : fmodf" publically which caused strange error messages: "Error: std.math.sqrt at MeinPfadZuD_Root\dmd2\windows\bin\..\..\src\phobos\std\math.d(874) conflicts with __anonymous at "
Comment #1 by k.hara.pg — 2012-06-07T05:42:20Z
*** This issue has been marked as a duplicate of issue 6591 ***