[Issue 2073] New: Variant.coerce!() fails

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue May 6 04:18:51 PDT 2008


http://d.puremagic.com/issues/show_bug.cgi?id=2073

           Summary: Variant.coerce!() fails
           Product: D
           Version: 2.014
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla at digitalmars.com
        ReportedBy: arkangath at gmail.com


The documentation states:

If the VariantN object is a string, a parse of the string to type T is
attempted.

But it doesn't do that.

-----------
test.d:

import std.variant;

void main ()
{
    Variant v="2".dup;
    int n=v.coerce!(int);
}
------------
Runtime:
Error: Variant: attempting to use incompatible types char[] and real


-- 



More information about the Digitalmars-d-bugs mailing list