[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 RazvanN changed: What|Removed |Added CC||elpenguin...@gmail.com --- Comment #10 from RazvanN --- *** Issue 20509 has been marked as a duplicate of this issue. *** --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 --- Comment #9 from github-bugzi...@puremagic.com --- Commits pushed to stable at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/daf387f065d4914cc868deb584ee8b6fb53774a5 add comment in reponse to Issue 16484 https://github.com/dlang/dmd/commit/bee58a21d15dc3bfc5c4e1c2d1691f85b51bdf90 Merge pull request #6194 from WalterBright/fix16484 --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 --- Comment #8 from github-bugzi...@puremagic.com --- Commits pushed to newCTFE at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/daf387f065d4914cc868deb584ee8b6fb53774a5 add comment in reponse to Issue 16484 https://github.com/dlang/dmd/commit/bee58a21d15dc3bfc5c4e1c2d1691f85b51bdf90 Merge pull request #6194 from WalterBright/fix16484 --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 --- Comment #7 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/daf387f065d4914cc868deb584ee8b6fb53774a5 add comment in reponse to Issue 16484 https://github.com/dlang/dmd/commit/bee58a21d15dc3bfc5c4e1c2d1691f85b51bdf90 Merge pull request #6194 from WalterBright/fix16484 add comment in response to Issue 16484 --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu --- Comment #6 from Martin Nowak --- I think we still have a few weird orderings for the new function vs. template overloads, and also within the existing template overloads. Part of those are simply caused by the way the current ordering is implemented. Discussing this is quite tricky and doesn't make sense for single examples. If someone would want to spend the effort on a DIP to come up w/ a sound and simpler partial ordering, that is implementable in a backward compatible way, it would probably be a welcome effort. Don't think it's an urgent topic though. --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 --- Comment #5 from ag0ae...@gmail.com --- (In reply to Walter Bright from comment #3) > (In reply to ag0aep6g from comment #2) > > void foo(T)(Nullable!T value) {} > > Considered: > "match with conversion for initial template arguments" Here "with conversion" means that it needs template argument inference, right? > "exact match for inferred template arguments" > > > void foo()(int i) { assert(false); /* hit */ } > > Considered: >"exact match for initial template arguments" >"exact match for inferred template arguments" But this one is not an exact match. It involves an `alias this` conversion from Nullable!int to int. As far as I can tell, it should be: "match with conversion for initial template arguments" "match with conversion for inferred template arguments" Or maybe just "match with conversion" since there are no template parameters. The empty template parentheses can actually be omitted without changing the behavior of the code. --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 --- Comment #4 from Walter Bright --- https://github.com/dlang/dmd/pull/6194 --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED CC||bugzi...@digitalmars.com Resolution|--- |WONTFIX --- Comment #3 from Walter Bright --- (In reply to ag0aep6g from comment #2) > void foo(T)(Nullable!T value) {} Considered: "match with conversion for initial template arguments" "exact match for inferred template arguments" > void foo()(int i) { assert(false); /* hit */ } Considered: "exact match for initial template arguments" "exact match for inferred template arguments" And so the second match is better. The relevant line in the source code is "matchTiargs = MATCHconvert;" at: https://github.com/dlang/dmd/blob/master/src/dtemplate.d#L1916 This is because the parameter 'T' is deduced from argument 'Nullable!int', rather than being supplied directly. Whether this is correct or not is debatable, I think the template rules are excessively complex, but they are the result of constant complaints and revision. I am extremely reluctant to change them further, because that will inevitably result in hard-to-explain breakage, like this one, which was apparently introduced in 2.064. If someone wants to find the specific PR that did it, I'd appreciate it. --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 ag0ae...@gmail.com changed: What|Removed |Added CC||ag0ae...@gmail.com --- Comment #2 from ag0ae...@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. --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 Nick Sabalausky changed: What|Removed |Added Summary|Overloaded empty funcs |regression(2.064) |trigger AssertError:|Overloaded empty funcs |"Called `get' on null |trigger AssertError: |Nullable" |"Called `get' on null ||Nullable" Severity|enhancement |regression --
[Issue 16484] regression(2.064) Overloaded empty funcs trigger AssertError: "Called `get' on null Nullable"
https://issues.dlang.org/show_bug.cgi?id=16484 --- Comment #1 from Nick Sabalausky --- Problem appears to have been introduced in 2.064 --