///////// test.d ///////// struct S { struct T { int foo; int[] bar; } struct M() { T[] arr; this(this) { arr = arr.dup; } } M!() m; } ////////////////////////// Introduced in https://github.com/dlang/dmd/pull/5500
(In reply to Vladimir Panteleev from comment #0) > Introduced in https://github.com/dlang/dmd/pull/5500 This is why I don't like 700 line PRs spread across 18 files :-(
The commits are big too, but if it helped, I can bisect it down to the commit.
Related: struct S { string get(string key) { return key; } alias get this; } void main() { S[] a; auto b = a.dup; } /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4473): Error: mutable method onlineapp.S.get is not callable using a const object /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4473): Consider adding const or inout to onlineapp.S.get /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4460): Error: template instance `object._dup!(const(S), S)` error instantiating /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4424): instantiated from here: _trustedDup!(const(S), S) onlineapp.d(13): instantiated from here: dup!(S) and struct S { string get(string key) const { return key; } alias get this; } void main() { S[] a; auto b = a.dup; } /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4473): Error: function onlineapp.S.get(string key) const is not callable using argument types () const /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4473): missing argument for parameter #1: string key /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4460): Error: template instance `object._dup!(const(S), S)` error instantiating /dlang/dmd/linux/bin64/../../src/druntime/import/object.d(4424): instantiated from here: _trustedDup!(const(S), S) onlineapp.d(13): instantiated from here: dup!(S)
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19409 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB