Bug 13942 – [REG2.066] Bad template error message

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-01-05T23:05:00Z
Last change time
2015-01-18T14:21:28Z
Keywords
diagnostic, pull
Assigned to
nobody
Creator
code

Comments

Comment #0 by code — 2015-01-05T23:05:53Z
The following code: import std.conv; void main(string[] args) { auto t = to!double(); } Gives the error message when compiled with dmd 2.066: /usr/include/dlang/dmd/std/conv.d(278): Error: template instance isRawStaticArray!() does not match template declaration isRawStaticArray(T, A...) When compiling with dmd 2.065: /opt/compilers/dmd2/include/std/conv.d(280): Error: template instance isRawStaticArray!() does not match template declaration isRawStaticArray(T, A...) test.d(5): Error: template std.conv.to cannot deduce function from argument types !(double)(), candidates are: /opt/compilers/dmd2/include/std/conv.d(277): std.conv.to(T) The error message from dmd 2.065 is cleary better and actually points to the correct file/line where the issue is located. The error dmd 2.066 gives is completely useless in actually finding the issue.
Comment #1 by k.hara.pg — 2015-01-06T15:51:09Z
Comment #2 by k.hara.pg — 2015-01-06T16:08:09Z
Reduced test case: template isRawStaticArray(T, A...) { enum isRawStaticArray = false; } template to(T) { T to(A...)(A args) if (!isRawStaticArray!A) { return 0; } } void main(string[] args) { auto t = to!double(); }
Comment #3 by k.hara.pg — 2015-01-18T13:34:32Z
Comment #4 by github-bugzilla — 2015-01-18T14:21:27Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/6aa2755cd5776a354de2e181e5955f33c0e724c0 fix Issue 13942 - Bad template error message Partially revert changes in #3332. https://github.com/D-Programming-Language/dmd/commit/506e31b8a6cab3a046ed61d6a9c2080f1ee81167 Merge pull request #4309 from 9rnsr/fix13942 [REG2.066] Issue 13942 - Bad template error message