https://issues.dlang.org/show_bug.cgi?id=14404

          Issue ID: 14404
           Summary: Class nested within function cannot be created
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: critical
          Priority: P1
         Component: druntime
          Assignee: [email protected]
          Reporter: [email protected]

Created attachment 1506
  --> https://issues.dlang.org/attachment.cgi?id=1506&action=edit
Minimal Code Sample

Calling ClassInfo.Create will fail for a class nested within a function.
Minimal code to reproduce the issue follows:

[CODE]

extern (C) Object _d_newclass(const TypeInfo_Class ci);

void main()
{
    int kittens;
    class Foo {
        this() { kittens = 1; }
        ~this() { kittens = 0; }
    }
    Foo f = new Foo();  // this works

    typeid(f).create(); // fails

}
[/CODE]

--

Reply via email to