[Issue 2802] New: opCmp(VariantN, T) fails where T != VariantN

d-bugmail at puremagic.com d-bugmail at puremagic.com
Sun Apr 5 12:01:19 PDT 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 at digitalmars.com
        ReportedBy: dsimcha at 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.


-- 



More information about the Digitalmars-d-bugs mailing list