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
Comment #1 by k.hara.pg — 2015-07-21T15:35:54Z
Comment #2 by github-bugzilla — 2015-08-30T13:27:52Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/76c6ac64f25ac651c86837dd36056bc2c13b71f1 fix Issue 14818 - Unhelpful "does not match template overload set" error The returned OverloadSet object from Dsymbol::search should have the searched identifier. Also, the overload objects OverDeclaration and OverloadSet that is generated by AliasDeclaration should have the alias identifier. https://github.com/D-Programming-Language/dmd/commit/6f90c0d8abadf8f40ce1fdc3b4c3486049e82108 Merge pull request #4826 from 9rnsr/fix14818 Issue 14818 - Unhelpful "does not match template overload set" error
Comment #3 by github-bugzilla — 2017-08-02T08:07:20Z
Commit pushed to dmd-cxx at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3879c2efa369996cc3bc12fc29d4655036f85796 Issue 14818 - Unhelpful "does not match template overload set" error