Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aliasSeq naming conflict #10610

Closed
crazymonkyyy opened this issue Jan 4, 2025 · 3 comments
Closed

aliasSeq naming conflict #10610

crazymonkyyy opened this issue Jan 4, 2025 · 3 comments

Comments

@crazymonkyyy
Copy link

alias foo=AliasSeq!(float(13.37));
import std;

order matters

test.d(1): Error: `AliasSeq` matches conflicting symbols:
/home/monkyyy/bin/opend_/bin/../import/core/internal/traits.d(11):        template `core.internal.traits.AliasSeq(TList...)`
/home/monkyyy/bin/opend_/bin/../import/std/meta.d(89):        template `std.meta.AliasSeq(TList...)`
@0xEAB
Copy link
Member

0xEAB commented Jan 4, 2025

Reduced version:

alias foo=AliasSeq!(float(13.37));
public import std.datetime, std.meta;

@0xEAB
Copy link
Member

0xEAB commented Jan 5, 2025

The root cause appears to be a compiler bug: dlang/dmd#18223
The issue originates from druntime. (Where a selective import leaks the symbol core.internal.traits.AliasSeq through.)

While it is probably possible to work around this issue in Phobos, applying a workaround upstream in druntime would be much easier AFAICT.

diff --git a/druntime/src/core/time.d b/druntime/src/core/time.d
index dc79141efa..f14df5b66a 100644
--- a/druntime/src/core/time.d
+++ b/druntime/src/core/time.d
@@ -3925,7 +3925,10 @@ version (CoreUnittest) const(char)* numToStringz()(long value) @trusted pure not
 }
 
 
-import core.internal.traits : AliasSeq;
+// Workaround for <https://github.com/dlang/dmd/issues/18223>.
+// A selective import of `AliasSeq` happens to bleed through and causes symbol clashes downstream.
+// import.core.internal.traits : AliasSeq;
+import core.internal.traits;
 
 
 /+ An adjusted copy of std.exception.assertThrown. +/

0xEAB added a commit to 0xEAB/dmd that referenced this issue Jan 5, 2025
0xEAB added a commit to 0xEAB/dmd that referenced this issue Jan 5, 2025
0xEAB added a commit to 0xEAB/dmd that referenced this issue Jan 5, 2025
0xEAB added a commit to 0xEAB/dmd that referenced this issue Jan 5, 2025
0xEAB added a commit to 0xEAB/dmd that referenced this issue Jan 5, 2025
thewilsonator pushed a commit to dlang/dmd that referenced this issue Jan 5, 2025
@0xEAB
Copy link
Member

0xEAB commented Jan 7, 2025

Works for me since dlang/dmd@1a15d20.

@0xEAB 0xEAB closed this as completed Jan 7, 2025
kinke pushed a commit to ldc-developers/ldc that referenced this issue Jan 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants