You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-----
struct S1
{
T get(T)() if (is(T == float)) { }
}
struct S2
{
auto get(alias value)()
{
return S1.get!(typeof(value));
}
}
struct S3
{
auto get(alias value)()
{
return get!(typeof(value));
}
T get(T)() if (is(T == float)){ return T.init;}
}
void main()
{
// Error: template instance get!int does not match template declaration get(T)() if (is(T == float))
S1.get!int;
// Error: template instance get!int does not match template declaration get(T)() if (is(T == float))S2.get!1;// Error: cannot resolve type for this.get!intS3.get!1;
}
-----
Observations:
S2.get calls into S1.get, and creates a nice error message. However in S3 the get templates are overloaded against each other, and this causes the diagnostic to become bad. S3.get should have the same diagnostic as S2.get.
The text was updated successfully, but these errors were encountered:
Andrej Mitrovic (@AndrejMitrovic) reported this on 2013-07-03T18:59:28Z
Transferred from https://issues.dlang.org/show_bug.cgi?id=10533
Description
The text was updated successfully, but these errors were encountered: