Bug 6539 – Incomprehensible error message with failed template instantiation

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2011-08-20T15:16:00Z
Last change time
2013-02-18T00:00:01Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
andrej.mitrovich

Comments

Comment #0 by andrej.mitrovich — 2011-08-20T15:16:05Z
foo.d: struct Rectangle(T) {} bar.d: bool Rectangle(bool, int, int, int, int); main.d: module main; import foo; import bar; void test(Rectangle rect) { } $ rdmd main.d main.d(6): Error: overloadset __anonymous is used as a type I've had this happen where I've used CairoD and WindowsAPI together. A templated struct and a function have the same name in different modules. My error is that I forgot to instantiate the template with a type, like so: void test(Rectangle!int rect) { } But the error message doesn't help one bit.
Comment #1 by k.hara.pg — 2013-02-15T00:25:27Z
Comment #2 by github-bugzilla — 2013-02-17T23:31:04Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/652c113648fccd075c029a2915cf349b5f72688c fix Issue 6539 - Incomprehensible error message with failed template instantiation https://github.com/D-Programming-Language/dmd/commit/bf14ab826f3ef60b856d8265e8a8cf3e55ea2f70 Merge pull request #1661 from 9rnsr/fix6539 Issue 6539 - Incomprehensible error message with failed template instantiation