Hi,Why the program can not return different types of data from the conditional operator?
----- import std.stdio; auto foo() { if (true) { return 0; } else return "true"; } void main() { writeln(foo); }
Dennis Ritchie via Digitalmars-d-learn Thu, 23 Apr 2015 02:52:05 -0700
Hi,Why the program can not return different types of data from the conditional operator?
----- import std.stdio; auto foo() { if (true) { return 0; } else return "true"; } void main() { writeln(foo); }