@safe struct X { void func() { } } @safe class Y { void func() { } } @safe void main() { X x; x.func(); // NG auto y = new Y; y.func(); // OK } Is this a bug? I like the behavior of class. I think that struct/union should change the behavior.
It's a bug. This works: struct Foo { @safe void func() { } } @safe void main() { Foo f; f.func(); }
*** This issue has been marked as a duplicate of issue 5110 ***