D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7352 - Poor error message when using variable as template type parameter
Summary: Poor error message when using variable as template type parameter
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: bootcamp, diagnostic
Depends on:
Blocks:
 
Reported: 2012-01-23 02:16 UTC by Don
Modified: 2021-12-27 09:44 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Don 2012-01-23 02:16:23 UTC
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 basile-z 2019-11-03 21:30:40 UTC
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 Dlang Bot 2021-03-19 13:43:58 UTC
@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 Dlang Bot 2021-03-21 05:02:16 UTC
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