Reduced test case: struct Foo { Bar b; unittest { Foo f; f = Foo(); } } struct Bar { ~this() @safe { } struct Inner { } Inner* i; } As far as I can tell, the above is valid code, but when I run "dmd -c -unittest test.d", DMD spits out: test.d(7): Error: function test.Foo.opAssign is not callable because it is annotated with @disable
https://github.com/D-Programming-Language/dmd/pull/2804
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a113001ef631df28109d444edc493cd4ac5842b8 fix Issue 11505 - Bad error message: "opAssign [...] is annotated with @disable" https://github.com/D-Programming-Language/dmd/commit/58562d274cd81e581eef260d1be6bdea8ceeba15 Merge pull request #2804 from 9rnsr/fix11505 [REG2.064] Issue 11505 - Bad error message: "opAssign [...] is annotated with @disable"
> If struct field has @safe ~this(), enclosing struct should try to generate @trusted opAssign to use void initializer. https://github.com/D-Programming-Language/dmd/pull/2804#issuecomment-29147573