Bug 13580 – alias missing in overloaded homonym template

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P3
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-10-06T19:33:05Z
Last change time
2023-10-16T08:55:00Z
Keywords
rejects-valid
Assigned to
No Owner
Creator
Martin Nowak

Comments

Comment #0 by code — 2014-10-06T19:33:05Z
cat > bug.d << CODE template memoize(alias fun) { alias Args = int; void memoize(Args args) {} } template memoize(alias fun, uint maxSize) { alias Args = int; void memoize(Args args) {} } void regex(string pattern) { memoize!(regex)(pattern); } CODE dmd -c bug ---- bug.d(4): Error: undefined identifier Args bug.d(10): Error: undefined identifier Args ----
Comment #1 by b2.temp — 2019-04-29T23:02:40Z
If someone comes with a fix then rather use this test case since the original is not supposed to compile even with the bug fixed. This one does: --- template memoize(alias fun) { alias Args = string; void memoize(Args args) {} } template memoize(alias fun) { alias Args = int; void memoize(Args args) {} } void main() { memoize!(a => a)(""); } ---
Comment #2 by b2.temp — 2023-10-16T08:55:00Z
*** This issue has been marked as a duplicate of issue 11662 ***