www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 21806] New: Overload selection ignores slice

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 puremagic.com
          Reporter: temtaime 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

--
Apr 06