D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 7425 - IFTI does not work with inout methods
Summary: IFTI does not work with inout methods
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P2 normal
Assignee: No Owner
URL:
Keywords: pull, rejects-valid
Depends on:
Blocks:
 
Reported: 2012-02-02 09:55 UTC by kennytm
Modified: 2012-02-06 00:39 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description kennytm 2012-02-02 09:55:30 UTC
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 kennytm 2012-02-05 15:01:33 UTC
Pull #698.

https://github.com/D-Programming-Language/dmd/pull/698