Bug 11505 – Bad error message: "opAssign [...] is annotated with @disable"

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-11-12T11:10:00Z
Last change time
2013-11-30T10:55:22Z
Keywords
diagnostic, pull, rejects-valid
Assigned to
nobody
Creator
bugzilla

Comments

Comment #0 by bugzilla — 2013-11-12T11:10:07Z
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
Comment #1 by k.hara.pg — 2013-11-17T18:34:09Z
Comment #2 by github-bugzilla — 2013-11-30T10:54:11Z
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"
Comment #3 by code — 2013-11-30T10:55:22Z
> 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