Bug 17482 – [REG 2.074] comile error: Comparing Nullable!Variant with basic type

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2017-06-09T01:21:42Z
Last change time
2018-01-05T13:29:45Z
Assigned to
No Owner
Creator
Nick Sabalausky

Comments

Comment #0 by bus_dbugzilla — 2017-06-09T01:21:42Z
Worked fine up through 2.073.2, but 2.074.0 gives a compiler error: ---------------------------------------- import std.variant, std.typecons; void main() { Nullable!Variant a; a == 11; // Yes, comparison intended } ---------------------------------------- test_nullable_variant.d(6): Error: template std.typecons.Nullable!(VariantN!32LU).Nullable.opEquals cannot deduce function from argument types !()(int), candidates are: /home/nick/.dvm/compilers/dmd-2.074.0/linux/bin/../../src/phobos/std/typecons.d(2212): std.typecons.Nullable!(VariantN!32LU).Nullable.opEquals()(auto ref const(typeof(this)) rhs) /home/nick/.dvm/compilers/dmd-2.074.0/linux/bin/../../src/phobos/std/typecons.d(2222): std.typecons.Nullable!(VariantN!32LU).Nullable.opEquals()(auto ref const(T) rhs)
Comment #1 by dlang-bugzilla — 2017-06-09T07:32:45Z
Comment #2 by davidma — 2017-06-12T11:15:37Z
Should it also be possible to assign values? a = 11; // Isn't compiling as well
Comment #3 by issues.dlang — 2017-07-04T02:24:39Z
(In reply to David Marquant from comment #2) > Should it also be possible to assign values? > > a = 11; // Isn't compiling as well That did not compile with 2.073.2. So, regardless of what the desired behavior would be, the fact that that does not currently compile is not a regression. Also, a better example of the regression would probably be something like Nullable!Variant a = Variant(12); assert(a != 11); since the original example would actually fail an assertion otherwise - though the compilation error is the same.
Comment #4 by issues.dlang — 2017-07-05T02:59:16Z
Comment #5 by github-bugzilla — 2017-07-07T22:09:34Z
Commits pushed to stable at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a7ea880eb24a36e09e50de7b8b32d941110aa630 Fix issue 17482: Fix Nullable!Variant equality checks. https://github.com/dlang/phobos/commit/d07b10148dcfbf494a8f433ebf5646a4cb8d1b10 Merge pull request #5541 from jmdavis/issue_17482 Fix issue 17482: Fix Nullable!Variant equality checks. merged-on-behalf-of: Sebastian Wilzbach <[email protected]>
Comment #6 by github-bugzilla — 2017-07-10T04:19:54Z
Commits pushed to master at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a7ea880eb24a36e09e50de7b8b32d941110aa630 Fix issue 17482: Fix Nullable!Variant equality checks. https://github.com/dlang/phobos/commit/d07b10148dcfbf494a8f433ebf5646a4cb8d1b10 Merge pull request #5541 from jmdavis/issue_17482
Comment #7 by github-bugzilla — 2018-01-05T13:29:45Z
Commits pushed to dmd-cxx at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/a7ea880eb24a36e09e50de7b8b32d941110aa630 Fix issue 17482: Fix Nullable!Variant equality checks. https://github.com/dlang/phobos/commit/d07b10148dcfbf494a8f433ebf5646a4cb8d1b10 Merge pull request #5541 from jmdavis/issue_17482