Bug 13760 – [REG2.067a] Cannot deduce function for object.get
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-11-21T15:19:00Z
Last change time
2015-02-18T03:40:08Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
sinkuupump
Comments
Comment #0 by sinkuupump — 2014-11-21T15:19:11Z
Error occurs when trying to call object.get:
```
static class C {}
C[int] aa;
auto c = aa.get(0, new C); // Error: template object.get cannot deduce function from argument types !()(C[int], int, C)
```
Test case:
```
class C { }
void main()
{
C[int] aa;
func(new C);
}
void func(K, V)(inout(V[K]) aa, inout(V) val)
{
}
```
Output:
```
$ dmd test.d
test.d(6): Error: template test.func cannot deduce function from argument types !()(C[int], C), candidates are:
test.d(9): test.func(K, V)(inout(V[K]) aa, inout(V) val)
```
This is a regression introduced by DMD pull 4145.
https://github.com/D-Programming-Language/dmd/pull/4145
Comment #1 by sinkuupump — 2014-11-21T15:27:18Z
Sorry, the test case is wrong.
Test case:
```
class C { }
void main()
{
C[int] aa;
func(aa, new C);
}
void func(K, V)(inout(V[K]) aa, inout(V) val)
{
}
```