Bug 9077 – Struct copy constructor ignored when opAssign with a different type is present

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-11-25T10:13:00Z
Last change time
2012-12-03T17:30:43Z
Keywords
pull
Assigned to
nobody
Creator
siegelords_abode

Comments

Comment #0 by siegelords_abode — 2012-11-25T10:13:17Z
Compiles fine with 2.060, fails with 2.061 beta. struct A { void opAssign(int a) { } void test() { A a; a = this; } this(this) { } } // test.d(11): Error: function test.A.opAssign (int a) is not callable using argument types (A) // test.d(11): Error: cannot implicitly convert expression (this) of type A to int
Comment #1 by k.hara.pg — 2012-12-03T05:54:26Z
Comment #2 by github-bugzilla — 2012-12-03T15:42:02Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/00ba398dd1d7bb5f06b2b380dc113ba32b3afff8 fix Issue 9077 - Struct copy constructor ignored when opAssign with a different type is present https://github.com/D-Programming-Language/dmd/commit/6b31d6c0d12ffacb007bb75f74a26ac3081d4b1c Merge pull request #1345 from 9rnsr/fix9077 Issue 9077 - Struct copy constructor ignored when opAssign with a different type is present