www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17733] New: idup fails for structs/classes with member

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

          Issue ID: 17733
           Summary: idup fails for structs/classes with member functions
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: druntime
          Assignee: nobody puremagic.com
          Reporter: fediushin.anton yandex.ru

Test case:

void main() {
    struct S {
        void f() {}
    }
    [S()].idup;
}

Also, compilation fails only if struct is defined in same scope idup is called,
so this code works just fine:

struct S {
    void f() {}
}
void main() {
    [S()].idup;
}

I've tested it with latest dmd, gdc and ldc

--
Aug 08