Bug 1474 – regression: const struct with an initializer not recognized as a valid alias template param

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2007-09-05T14:50:48Z
Last change time
2020-11-18T14:53:08Z
Assigned to
Walter Bright
Creator
Tomasz Stachowiak

Comments

Comment #0 by h3r3tic — 2007-09-05T14:50:48Z
template Foo(alias a) {} struct Bar {} const Bar bar = {}; alias Foo!(bar) baz; // ---- constaliasbug.d(6): template instance Foo!(Bar()) does not match any template declaration Works in dmd 1.020, works when the initializer is removed from "bar"'s declaration: 'const Bar bar;' (invalid in gdc, iirc), and works when 'bar' is not const. This bug breaks Bind, btw.
Comment #1 by braddr — 2007-10-20T04:08:41Z
Fixed in 1.022/2.005
Comment #2 by dlang-bot — 2020-01-03T05:30:04Z
dlang/dub pull request #1848 "Add a warning / workaround for issue 1474" was merged into master: - ac7858129fa24357558b3f197972c2498f915dcb by Geod24: Add a warning / workaround for issue 1474 https://github.com/dlang/dub/pull/1848
Comment #3 by dlang-bot — 2020-11-18T14:53:08Z
dlang/dub pull request #2035 "Fix Issue #1474 - Regenerate build settings after preGenerateCommands" was merged into master: - eee1f474a8e7a9a04c7b11ce4ecd4f5c49e50c35 by Ă–mer Faruk IRMAK: Revert "Add a warning / workaround for issue 1474" This reverts commit ac7858129fa24357558b3f197972c2498f915dcb. https://github.com/dlang/dub/pull/2035