[Issue 11857] New: `out` parameter breaks overload resolution

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jan 2 05:00:53 PST 2014


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

           Summary: `out` parameter breaks overload resolution
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: ice, rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: verylonglogin.reg at gmail.com


--- Comment #0 from Denis Shelomovskij <verylonglogin.reg at gmail.com> 2014-01-02 17:00:51 MSK ---
This code should compile:
---
void f(int) { }
void f(out int) { }
void t(T)(T) { }
void t(T)(out T) if(false) { } // line 4

void main()
{
    const int n = 1;
    f(n); // line 9
    t(n); // also causes ICE
}
---
main.d(9): Error: constant 1 is not an lvalue
main.d(4): Error: cannot have const out parameter of type const(int)
<access violation>
---

Previously dmd just shown error. Now it also ICE-s with access violation in
template case.

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


More information about the Digitalmars-d-bugs mailing list