Thread overview
[Issue 7070] New: can't assign null to Variant
Dec 06, 2011
Trass3r
Dec 09, 2011
Kenji Hara
Dec 10, 2011
Kenji Hara
Dec 13, 2011
Kenji Hara
December 06, 2011
http://d.puremagic.com/issues/show_bug.cgi?id=7070

           Summary: can't assign null to Variant
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: mrmocool@gmx.de


--- Comment #0 from Trass3r <mrmocool@gmx.de> 2011-12-06 04:19:43 PST ---
If it isn't supposed to work anymore, just close the report.

import std.variant;
void main()
{
    Variant v;
    v = null;
}

$ dmd test.d
/std/traits.d(1755): Error: static assert  "argument is not a class or
interface"
/std/traits.d(1818):        instantiated from here:
BaseTypeTuple!(typeof(null))
/std/traits.d(1933):        instantiated from here:
BaseClassesTuple!(typeof(null))
/std/traits.d(2230):        instantiated from here:
TransitiveBaseTypeTuple!(typeof(null))
/std/variant.d(255):        instantiated from here:
ImplicitConversionTargets!(typeof(null))
/std/variant.d(543):        instantiated from here: handler!(typeof(null))
test.d(6):        instantiated from here: opAssign!(typeof(null))

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



--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> 2011-12-09 02:51:56 PST ---
2.057head changes the type of null literal from void* to typeof(null). But std.variant yet not support it.

Workaround:

import std.variant;
void main()
{
    Variant v;
    //v = null;
    v = (void*).init;
}

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


Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch


--- Comment #2 from Kenji Hara <k.hara.pg@gmail.com> 2011-12-09 19:28:25 PST ---
https://github.com/D-Programming-Language/phobos/pull/361

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


Kenji Hara <k.hara.pg@gmail.com> changed:

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


--- Comment #3 from Kenji Hara <k.hara.pg@gmail.com> 2011-12-13 07:50:45 PST ---
https://github.com/D-Programming-Language/phobos/commit/a119672746888c66eecd2158dad09f69f286fce8

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