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

import std.stdio, std.variant;

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

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
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.


Reply via email to