[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Fri Sep 9 11:55:05 PDT 2016
https://issues.dlang.org/show_bug.cgi?id=16484
ag0aep6g at gmail.com changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ag0aep6g at gmail.com
--- Comment #2 from ag0aep6g at gmail.com ---
Without phobos:
----
struct Nullable(T)
{
T x;
alias x this;
}
void foo(T)(Nullable!T value) {}
void foo()(int i) { assert(false); /* hit */ }
void main() { foo(Nullable!int()); }
----
The second overload being selected is surprising, because it involves an
implicit conversion whereas the first overload would be an exact match. I can't
find anything in the spec about how IFTI interacts with overloading.
--
More information about the Digitalmars-d-bugs
mailing list