[Issue 18777] New: std.traits.RetrunType ambiguity
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Wed Apr 18 17:11:22 UTC 2018
https://issues.dlang.org/show_bug.cgi?id=18777
Issue ID: 18777
Summary: std.traits.RetrunType ambiguity
Product: D
Version: D2
Hardware: x86_64
OS: Mac OS X
Status: NEW
Severity: minor
Priority: P1
Component: dmd
Assignee: nobody at puremagic.com
Reporter: mattbowiewilson at gmail.com
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?
--
More information about the Digitalmars-d-bugs
mailing list