[Issue 20243] New: inout not substituted for in associative array key type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Sep 25 18:31:50 UTC 2019


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

          Issue ID: 20243
           Summary: inout not substituted for in associative array key
                    type
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: enhancement
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: rightfold+bugzilla+dlang at gmail.com

DMD 2.87.

Example program:

// https://run.dlang.io/is/mIIhvc
void main()
{
    inout(int) f(inout(int)[inout(string)] x);
    const(int)[const(string)] x;
    f(x);
}

Fails with error:

onlineapp.d(5): Error: function onlineapp.main.f(inout(int)[inout(string)] x)
is not callable using argument types (const(int)[const(string)])
onlineapp.d(5):        cannot pass argument x of type const(int)[const(string)]
to parameter inout(int)[inout(string)] x

But I expect it to succeed, and substitute const for inout in the associative
array key type.

--


More information about the Digitalmars-d-bugs mailing list