Bug 7352 – Poor error message when using variable as template type parameter

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-01-23T02:16:23Z
Last change time
2021-12-27T09:44:38Z
Keywords
bootcamp, diagnostic
Assigned to
No Owner
Creator
Don

Comments

Comment #0 by clugdbug — 2012-01-23T02:16:23Z
template Foo(X) { alias int Foo; } int m; alias Foo!(m) XXX; bug.d(7): Error: template instance Foo!(m) does not match template declaration Foo(X) It should say something like, "m is not a type".
Comment #1 by b2.temp — 2019-11-03T21:30:40Z
When no constraint is present indeed this could be an additional error message. There's an helper for that in the compiler. When there's a constraint this possibly new message should not be added since there's work to format them prettier.
Comment #2 by dlang-bot — 2021-03-19T13:43:58Z
@wolframw created dlang/dmd pull request #12289 "Issue 7352 - Poor error message when using variable as template type parameter" mentioning this issue: - Issue 7352 - Poor error message when using variable as template type parameter https://github.com/dlang/dmd/pull/12289
Comment #3 by dlang-bot — 2021-03-21T05:02:16Z
dlang/dmd pull request #12289 "Fix Issue 7352 - Poor error message when using variable as template type parameter" was merged into master: - 07a0fa610f90777ae52fd90332527e053586c1ce by wolframw: Issue 7352 - Poor error message when using variable as template type parameter https://github.com/dlang/dmd/pull/12289