Bug 7425 – IFTI does not work with inout methods

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-02-02T09:55:00Z
Last change time
2012-02-06T00:39:53Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
kennytm

Comments

Comment #0 by kennytm — 2012-02-02T09:55:30Z
Test case: ------------------------------ struct S7425 { inout(int) g(T)(T x) inout { return x; } void test() { int f = g(2); // line 9 } } ------------------------------ Compile with 'dmd -c test7425.d': test7425.d(9): Error: template test7425.S7425.g(T) does not match any function template declaration test7425.d(9): Error: template test7425.S7425.g(T) cannot deduce template function from argument types !()(int) IFTI doesn't work when the method is 'inout'. It must be called as 'g!int(2)'. It works if this parameter is not 'inout', even if other parameters are 'inout'.
Comment #1 by kennytm — 2012-02-05T15:01:33Z