www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 15312] New: Variant.get cannot access frame pointer


          Issue ID: 15312
           Summary: Variant.get cannot access frame pointer
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: ryan rcorre.net

Variant.get!T fails if T is a locally declared struct with at least one method.

unittest {
  struct S { auto i() { return 1; } }
  Variant v = S();
  S s = v.get!S;

Error: cannot access frame pointer of variant_get_bug.__unittestL3_1.S

If S is declared outside the unittest or contains no methods (fields are fine)
it will not fail.

Nov 09 2015