Bug 24759 – Order-dependent failure to create an overload set with template function

Status
NEW
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2024-09-10T19:09:15Z
Last change time
2024-12-13T19:37:20Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Max Samukha
Moved to GitHub: dmd#20510 →

Comments

Comment #0 by maxsamukha — 2024-09-10T19:09:15Z
module b; void foo() {} ---- module a; import b; void foo(T)(T a) {} alias foo = b.foo; void main() { foo(); foo(1); } ---- a.d(6): Error: alias `a.foo` conflicts with template `a.foo(T)(T a)` at a.d(5) The test case compiles if the alias declaration preceeds the template declaration.
Comment #1 by maxsamukha — 2024-09-10T19:18:24Z
Another manifestation of likely the same bug: module a; import std.range.primitives; ref T front(T)(T* range) => range[0]; alias front = std.range.primitives.front; void main() { } ---- a.d(6): Deprecation: package std.range is not accessible here, perhaps add 'static import std.range;' a.d(6): Deprecation: module std.range.primitives is not accessible here, perhaps add 'static import std.range.primitives;' a.d(6): Deprecation: package std.range is not accessible here, perhaps add 'static import std.range;' a.d(6): Deprecation: module std.range.primitives is not accessible here, perhaps add 'static import std.range.primitives;'
Comment #2 by robert.schadek — 2024-12-13T19:37:20Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/20510 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB