I'm learning, so no idea if this is known or what causes the segfault.

Linux
DMD64 D Compiler v2.078.3

```
void main()
{
        import std.stdio;
        
        {
                class C
                {
                        int i;
                }
        }
        {
                class C
                {
                        int i;
                }
                C c1 = new C();
                c1.i++;          // no segfault without this line
                C c2 = c1;
        }
}
```

dmd -run test.d
test.d(12): Error: declaration C is already defined in another scope in main
test.d(16): Error: class C no size because of forward reference
test.d(12): Error: class C is forward referenced when looking for 'i' test.d(12): Error: class C is forward referenced when looking for 'i' test.d(12): Error: class C is forward referenced when looking for 'opDot' test.d(12): Error: class C is forward referenced when looking for 'opDispatch'
Segmentation fault (core dumped)


Reply via email to