Comment #0 by mattbowiewilson — 2018-04-18T17:11:22Z
import std.stdio;
import std.traits : ReturnType;
int foo()
{
return 1;
}
short foo()
{
return 1;
}
void main()
{
// This prints 2147483647 but why not 32767?
writeln(ReturnType!(foo).max);
}
-----------------------------------------------------------
I expected to get a compiler error here. Is this a DMD bug?
Comment #1 by destructionator — 2018-04-18T17:17:59Z
It is illegal to overload based on return value, I don't think it should allow that definition at all.
Comment #2 by simen.kjaras — 2018-04-19T20:30:43Z
*** This issue has been marked as a duplicate of issue 7549 ***