Bug 19678 – wrong error message with inout method

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-02-15T10:43:35Z
Last change time
2019-02-20T00:08:07Z
Assigned to
No Owner
Creator
thomas.bockman

Comments

Comment #0 by thomas.bockman — 2019-02-15T10:43:35Z
This is very similar to https://issues.dlang.org/show_bug.cgi?id=17518 . The code below should yield the same errors as it would without the `inout`: Error: function `bug.A.f(short x)` is not callable using argument types `(int)` cannot pass argument `cast(int)y + 1` of type `int` to parameter `short x` Instead I get this unhelpful nonsense: Error: `inout` method `bug.A.f` is not callable using a mutable object ////////////////////////////////// module bug; struct A { void f(short x) inout { } } void main() { short y = 5; A().f(y + 1); }
Comment #1 by razvan.nitu1305 — 2019-02-18T16:34:34Z
Regression since 2.062
Comment #2 by razvan.nitu1305 — 2019-02-19T09:56:16Z
This is fixed in master by : https://github.com/dlang/dmd/pull/9102 . Closing as fixed.
Comment #3 by thomas.bockman — 2019-02-20T00:08:07Z
Yes, I can confirm this is fixed in nightly. Thanks!