D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 13942 - [REG2.066] Bad template error message
Summary: [REG2.066] Bad template error message
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 regression
Assignee: No Owner
URL:
Keywords: diagnostic, pull
Depends on:
Blocks:
 
Reported: 2015-01-05 23:05 UTC by Benjamin Thaut
Modified: 2015-01-18 14:21 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Benjamin Thaut 2015-01-05 23:05:53 UTC
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 Kenji Hara 2015-01-06 15:51:09 UTC
Introduced in: https://github.com/D-Programming-Language/dmd/pull/3332
Comment 2 Kenji Hara 2015-01-06 16:08:09 UTC
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 4 github-bugzilla 2015-01-18 14:21:27 UTC
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