Bug 14818 – Unhelpful "does not match template overload set" error
Status
RESOLVED
Resolution
FIXED
Severity
minor
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-07-21T15:32:00Z
Last change time
2017-08-02T08:07:20Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
k.hara.pg
Comments
Comment #0 by k.hara.pg — 2015-07-21T15:32:03Z
Following incorrect program:
template Foo(T) if (is(T == int)) {}
template Bar(T) if (is(T == double)) {}
template Mix1() { alias X = Foo; }
template Mix2() { alias X = Bar; }
mixin Mix1;
mixin Mix2;
// in here, X is an OverloadSet
void main()
{
// Neither Foo nor Bar match
alias x = X!string; // line 13
}
Reports:
test.d(13): Error: template instance test.X!string does not match template overload set Bar
The diagnostic is not helpful. It should be:
test.d(13): Error: template instance test.X!string does not match template overload set X