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) { } ```
Comment #2 by k.hara.pg — 2014-11-21T18:30:06Z
Comment #3 by github-bugzilla — 2014-11-22T01:40:40Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/92d878bdaa2fb729026aa67e6bab9f1b5440e830 fix Issue 13760 - Cannot deduce function for object.get https://github.com/D-Programming-Language/dmd/commit/ac8ace7e8b3b9104da3a75179b23c97def5fba86 Merge pull request #4156 from 9rnsr/fix13760 [REG2.067a] Issue 13760 - Cannot deduce function for object.get
Comment #4 by github-bugzilla — 2015-02-18T03:40:08Z