[Issue 19678] New: wrong error message with inout method

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Feb 15 10:43:35 UTC 2019


https://issues.dlang.org/show_bug.cgi?id=19678

          Issue ID: 19678
           Summary: wrong error message with inout method
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: thomas.bockman at gmail.com

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);
}

--


More information about the Digitalmars-d-bugs mailing list