www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 12157] New: Variant opEquals always returns false for classes.

reply d-bugmail puremagic.com writes:
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: opantm2+dbugs gmail.com
        ReportedBy: opantm2+dbugs gmail.com


--- Comment #0 from Kapps <opantm2+dbugs gmail.com> 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: -------
Feb 13 2014
next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12157


Kapps <opantm2+dbugs gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull


--- Comment #1 from Kapps <opantm2+dbugs gmail.com> 2014-02-23 21:49:53 PST ---
https://github.com/D-Programming-Language/phobos/pull/1963

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Feb 23 2014
prev sibling next sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12157



--- Comment #2 from github-bugzilla puremagic.com 2014-03-15 10:21:51 PDT ---
Commits pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/83b0cf52a5712fa1d1c2aaf984bbf31390f6b35f
Fix issue 12157 - Variant opEquals always returns false for classes and
interfaces.

https://github.com/D-Programming-Language/phobos/commit/549657fe65082a01f697943105b9cb0aab86550a
Merge pull request #1963 from Kapps/fix12157

Fix issue 12157 - Variant opEquals always returns false for classes.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 15 2014
prev sibling parent d-bugmail puremagic.com writes:
https://d.puremagic.com/issues/show_bug.cgi?id=12157


Kapps <opantm2+dbugs gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Mar 15 2014