Thread overview
[Issue 2802] New: opCmp(VariantN, T) fails where T != VariantN
Apr 05, 2009
d-bugmail
Apr 05, 2009
d-bugmail
[Issue 2802] VariantN.opCmp!(T) fails when T != VariantN
Dec 01, 2009
David Simcha
Dec 06, 2009
Walter Bright
April 05, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2802

           Summary: opCmp(VariantN, T) fails where T != VariantN
           Product: D
           Version: 2.027
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: dsimcha@yahoo.com


import std.stdio, std.variant;

void main() {
    auto v = Variant(1);
    writeln(v < 1);
}

Results:
E:\dmd\windows\bin\..\..\src\phobos\std\variant.d|634|Error: no property 'type'
for type 'int'|
E:\dmd\windows\bin\..\..\src\phobos\std\variant.d|634|Error: constructor
std.variant.VariantException.this (immutable(char)[] s) does not match
parameter types (TypeInfo,int)|
E:\dmd\windows\bin\..\..\src\phobos\std\variant.d|634|Error: cannot implicitly
convert expression (1) of type int to object.TypeInfo|
E:\dmd\windows\bin\..\..\src\phobos\std\variant.d|634|Error: cannot cast int to
object.TypeInfo|
E:\dmd\windows\bin\..\..\src\phobos\std\variant.d|5|Error: template instance
std.variant.VariantN!(maxSize).VariantN.opCmp!(int) error instantiating|

The problem is a really simple one-liner.  Patch to follow.


-- 

April 05, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2802





------- Comment #1 from dsimcha@yahoo.com  2009-04-05 14:10 -------
Created an attachment (id=314)
 --> (http://d.puremagic.com/issues/attachment.cgi?id=314&action=view)
Patch to fix bug 2802.

Actually more like a two-liner since I also added a case to the unittest to show that the patch works.


-- 

October 11, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2802


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei@metalanguage.com
         AssignedTo|nobody@puremagic.com        |andrei@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 01, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2802


David Simcha <dsimcha@yahoo.com> changed:

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


--- Comment #2 from David Simcha <dsimcha@yahoo.com> 2009-12-01 06:21:07 PST ---
Fixed SVN.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
December 06, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=2802


Walter Bright <bugzilla@digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@digitalmars.com


--- Comment #3 from Walter Bright <bugzilla@digitalmars.com> 2009-12-06 00:50:16 PST ---
Fixed dmd 2.037

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