[Issue 21678] New: "_d_arraysetlengthT is not callable using argument types" on chained array length assignment

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Mar 3 22:57:16 UTC 2021


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

          Issue ID: 21678
           Summary: "_d_arraysetlengthT is not callable using argument
                    types" on chained array length assignment
           Product: D
           Version: D2
          Hardware: x86_64
                OS: Linux
            Status: NEW
          Severity: minor
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: martin.dorey at hitachivantara.com

I don't know D but I hope that this is the minimal reproducer:

martind at sirius:~/tmp/D147043$ cat D147043.d 
auto F() {
    int[] f;
    int[] a;
    a.length = f.length = 0;
}
martind at sirius:~/tmp/D147043$ 

That compiles OK with:

martind at sirius:~/tmp/D147043$ dmd --version
DMD64 D Compiler v2.094.2
Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved
written by Walter Bright
martind at sirius:~/tmp/D147043$ dmd -w -c D147043.d 
martind at sirius:~/tmp/D147043$ 

But not with v2.095.0 (I claim but don't show here) or the latest release at
the time of writing:

martind at sirius:~/tmp/D147043$ dmd --version
DMD64 D Compiler v2.095.1
Copyright (C) 1999-2020 by The D Language Foundation, All Rights Reserved
written by Walter Bright
martind at sirius:~/tmp/D147043$ dmd -w -c D147043.d 
D147043.d(4): Error: function
core.internal.array.capacity._d_arraysetlengthTImpl!(int[],
int)._d_arraysetlengthT(return ref scope int[] arr, ulong newlength) is not
callable using argument types (int[], int[])
D147043.d(4):        cannot pass argument f = f[0..0] of type int[] to
parameter ulong newlength
martind at sirius:~/tmp/D147043$ 

Google suggests that this has been seen in the wild in two projects.

--


More information about the Digitalmars-d-bugs mailing list