www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 2802] New: opCmp(VariantN, T) fails where T != VariantN

reply d-bugmail puremagic.com writes:
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.


-- 
Apr 05 2009
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2802






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.


-- 
Apr 05 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
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: -------
Oct 11 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2802


David Simcha <dsimcha yahoo.com> changed:

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



Fixed SVN.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Dec 01 2009
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=2802


Walter Bright <bugzilla digitalmars.com> changed:

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



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: -------
Dec 06 2009