[Issue 13294] [IFTI] IFTI fails or works incorrectly for function with const and mutable `ref` parameters of most types

via Digitalmars-d-bugs digitalmars-d-bugs at puremagic.com
Mon Aug 25 00:55:06 PDT 2014


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

--- Comment #7 from Denis Shelomovskij <verylonglogin.reg at gmail.com> ---
(In reply to Paul D. Anderson from comment #6)
> *** Issue 13351 has been marked as a duplicate of this issue. ***

So here is testcase for those issue:
---
void f1(T)(in T) { T t; ++t; }
void f2(T)(in T, in T) { T t; ++t; } // (line 2)

void main()
{
    const double n;
    f1(n);     // ok
    f2(n, n);  // error (line 8)
}
---
main.d(2): Error: cannot modify const expression nan
main.d(8): Error: template instance main.f2!(const(double)) error instantiating
---

Compiler carries in case there is more than one argument.

--


More information about the Digitalmars-d-bugs mailing list