cat > bug.d << CODE struct S { this(inout Correct) inout { } } struct Correct {} struct Wrong {} S bug() { return S(Wrong()); } CODE dmd -c bug ---- bug.d(13): Error: inout method bug.S.this is not callable using a mutable object ---- The error should point out that the wrong type is passed, not that it's mutable.
This seems to be a regression. 2.061: test.d(13): Error: constructor test.S.this (inout(Correct) _param_0) inout is not callable using argument types (Wrong) test.d(13): Error: cannot implicitly convert expression (Wrong()) of type Wrong to Correct 2.062: test.d(13): Error: inout method test.S.this is not callable using a mutable object test.d(13): Error: cannot implicitly convert expression (Wrong()) of type Wrong to Correct 2.063: test.d(13): Error: inout method test.S.this is not callable using a mutable object The 2.062 -> 2.063 change was caused by https://github.com/dlang/dmd/pull/1842. Not sure about the first one.
PR: https://github.com/dlang/dmd/pull/9102
Commits pushed to master at https://github.com/dlang/dmd https://github.com/dlang/dmd/commit/3d9550ca39f53dcdab98093aa77221a1b8b30538 Fix Issue 17518 - [Reg 2.063] confusing error message with inout constructor/ctor https://github.com/dlang/dmd/commit/624236c30ab84957a8f75f5c51fe75b3b2b99e41 Merge pull request #9102 from RazvanN7/Issue_17518 Fix Issue 17518 - [Reg 2.063] confusing error message with inout constructor/ctor merged-on-behalf-of: Nicholas Wilson <thewilsonator@users.noreply.github.com>