[Issue 16194] auto return type inference depends on return statement order
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jun 22 11:43:51 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16194
hbaelx at hotmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |hbaelx at hotmail.com
--- Comment #1 from hbaelx at hotmail.com ---
In other words, the compiler apparently extracts info about the return type
from the first return statement it comes across, rather than trying to find a
common type that matches all of the return statements.
As an obvious workaround, I suggest you avoid using the auto keyword here. The
compiler might have some trouble looking for common types, and I doubt this is
something that need urgent attention.
--
More information about the Digitalmars-d-bugs
mailing list