www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 11916] New: [IFTI] Disabled by constraint overload with `out` with IFTI breaks overload resolution

https://d.puremagic.com/issues/show_bug.cgi?id=11916

           Summary: [IFTI] Disabled by constraint overload with `out` with
                    IFTI breaks overload resolution
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: major
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: verylonglogin.reg gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg gmail.com> 2014-01-13
18:56:58 MSK ---
This code should compile:
---
void f(T)(T) { }
void f(T)(out T) if(false) { } // line 2

void main()
{
    const int n = 1;
    f(n); // no errors for `f!int(n)`
}
---
main.d(2): Error: cannot have const out parameter of type const(int)
---

The bug is major as there is no line number for the call.

Also note the code will work with `ref` instead of `out` because of Issue
11915.

The issue is segregated from Issue 11857.

-- 
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 13 2014