We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents bff3364 + a7ea880 commit d07b101Copy full SHA for d07b101
1 file changed
std/typecons.d
@@ -2228,7 +2228,8 @@ Params:
2228
}
2229
2230
/// Ditto
2231
- bool opEquals()(auto ref const(T) rhs) const
+ bool opEquals(U)(auto ref const(U) rhs) const
2232
+ if (is(typeof(this.get == rhs)))
2233
{
2234
return _isNull ? false : rhs == _value;
2235
@@ -2276,6 +2277,16 @@ Params:
2276
2277
assert(a != Nullable!int(29));
2278
2279
2280
+ // Issue 17482
2281
+ @system unittest
2282
+ {
2283
+ import std.variant : Variant;
2284
+ Nullable!Variant a = Variant(12);
2285
+ assert(a == 12);
2286
+ Nullable!Variant e;
2287
+ assert(e != 12);
2288
+ }
2289
+
2290
template toString()
2291
2292
import std.format : FormatSpec, formatValue;
0 commit comments