[Issue 13294] New: [IFTI] IFTI fails for function with const and mutable `ref` parameters of `[u]byte`/`[u]short`

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Fri Aug 15 05:15:02 PDT 2014


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

          Issue ID: 13294
           Summary: [IFTI] IFTI fails for function with const and mutable
                    `ref` parameters of `[u]byte`/`[u]short`
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Keywords: rejects-valid
          Severity: regression
          Priority: P1
         Component: DMD
          Assignee: nobody at puremagic.com
          Reporter: verylonglogin.reg at gmail.com

This code should compile fine:
---
void f(T)(const ref T src, ref T dest)
{ }

void main()
{
    const byte src;
    byte dest;
    f(src, dest);
}
---
main.d(8): Error: template main.f cannot deduce function from argument types
!()(const(byte), byte), candidates are:
main.d(1):        main.f(T)(ref const T src, ref T dest)
---

Note: Fails only for `byte`/`ubyte`/`short`/`ushort`.

--


More information about the Digitalmars-d-bugs mailing list