https://d.puremagic.com/issues/show_bug.cgi?id=12157
Summary: Variant opEquals always returns false for classes.
Product: D
Version: D2
Platform: All
OS/Version: All
Status: ASSIGNED
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from Kapps <[email protected]> 2014-02-13 22:02:00 PST ---
Sample:
import std.variant;
class Foo {
int a;
}
void main() {
Foo f = new Foo();
Variant v = f;
assert(v == f);
}
Because the check for if it's possible checks if typeof T.init == T.init, which
is a compiler error for classes as it compares to null.
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------