Bug 12220 – [REG2.066a] hash.get() does not accept proper parameters

Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P2
Component
druntime
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-02-21T14:54:00Z
Last change time
2014-03-04T21:29:13Z
Keywords
pull, rejects-valid
Assigned to
nobody
Creator
andrej.mitrovich
Depends on
12290, 12296

Comments

Comment #0 by andrej.mitrovich — 2014-02-21T14:54:27Z
----- void main() { short[short] hash; auto k = hash.get(1, 1); } ----- $ dmd test.d > Error: template object.get cannot deduce function from argument types !()(short[short], int, int) Not sure if dupe of some of the reports in https://d.puremagic.com/issues/show_bug.cgi?id=12167, but each issue should be filed separately.
Comment #1 by dlang-bugzilla — 2014-02-21T20:41:22Z
Introduced in the same pulls as with 12167.
Comment #2 by k.hara.pg — 2014-03-03T01:11:41Z
This is git-head only issue (does not exist in 2.065 release). The UFCS 'get' function in object module should have following signature: inout(V) get(K, V)(inout(V[K]) aa, K key, lazy V defaultValue) { auto p = key in aa; return p ? *p : defaultValue; } But current IFTI does not consider the narrowing conversion from (1) to short during type parameters deduction. I think that enhancement 12290 is the best way to fix issue.
Comment #3 by k.hara.pg — 2014-03-03T01:12:13Z
*** Issue 12221 has been marked as a duplicate of this issue. ***
Comment #4 by k.hara.pg — 2014-03-03T01:19:54Z
Comment #5 by github-bugzilla — 2014-03-03T22:01:33Z
Commits pushed to master at https://github.com/D-Programming-Language/druntime https://github.com/D-Programming-Language/druntime/commit/16198ea6abc750d4e3119195bde3c317156d4288 fix Issue 12220 - hash.get() does not accept proper parameters https://github.com/D-Programming-Language/druntime/commit/7c8722f331ac61dd4fa82ea7c76c6ade7b2d51c5 Merge pull request #733 from 9rnsr/fix12220 [REG2.066a] Issue 12220 - hash.get() does not accept proper parameters
Comment #6 by github-bugzilla — 2014-03-04T21:29:13Z
Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/537d821b409d7b379dae982212f37e6a38c6e883 fix Issue 12220 - hash.get() does not accept proper parameters https://github.com/D-Programming-Language/dmd/commit/93542b840b1609797a9ad4b155110e99c5f83b08 Merge pull request #3358 from 9rnsr/fix12220 Issue 12220 - hash.get() does not accept proper parameters