[Issue 21806] New: Overload selection ignores slice

d-bugmail at puremagic.com d-bugmail at puremagic.com
Wed Apr 7 01:08:02 UTC 2021


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

          Issue ID: 21806
           Summary: Overload selection ignores slice
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: critical
          Priority: P1
         Component: dmd
          Assignee: nobody at puremagic.com
          Reporter: temtaime at gmail.com

Consider:

void main()
{
        ubyte[16] arr;

        pragma(msg, typeof(arr[]));
        pragma(msg, typeof(arr[].bar));

        arr[].bar.writeln; // 123
}

char bar()(in ubyte[] arr)
{
        return 'X';
}

int bar(size_t N)(in ubyte[N] arr)
{
        return 123;
}

Compilation output:
ubyte[]
int

Should be:
ubyte[]
char

--


More information about the Digitalmars-d-bugs mailing list