Bug 17518 – [Reg 2.063] confusing error message with inout constructor/ctor

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2017-06-17T18:21:21Z
Last change time
2018-12-21T02:10:19Z
Keywords
diagnostic
Assigned to
No Owner
Creator
Martin Nowak

Comments

Comment #0 by code — 2017-06-17T18:21:21Z
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.
Comment #1 by dlang-bugzilla — 2017-06-18T07:59:38Z
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.
Comment #2 by razvan.nitu1305 — 2018-12-18T14:40:59Z
Comment #3 by github-bugzilla — 2018-12-21T02:10:18Z
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 <[email protected]>