Bug 13498 – Return type is not checked in function template
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-09-19T11:16:00Z
Last change time
2015-02-18T03:37:11Z
Keywords
accepts-invalid, pull
Assigned to
nobody
Creator
sinkuupump
Comments
Comment #0 by sinkuupump — 2014-09-19T11:16:34Z
Introduced by https://github.com/D-Programming-Language/dmd/pull/3979
The code below compiles with DMD v2.067-devel-5606406.
int test1()()
{
return "foo"; // should fail as well
}
/+
int test2()
{
return "foo"; // Error: cannot implicitly convert expression ("foo") of type string to int
}
+/
void main()
{
test1();
}