mirror of
https://github.com/nim-lang/Nim.git
synced 2026-06-07 04:14:19 +00:00
fixes generic types sink T cannot be inferred for passed arguments (#24761)
Otherwise, `sink T` is kept as it is. This PR treats sink types as its base types for the arguments. So the concept would match both cases Required by https://github.com/nim-lang/Nim/pull/24724
This commit is contained in:
@@ -1234,9 +1234,10 @@ proc typeRel(c: var TCandidate, f, aOrig: PType,
|
||||
else:
|
||||
var candidate = f
|
||||
|
||||
case f.kind
|
||||
let fType = f.skipTypes({tySink})
|
||||
case fType.kind
|
||||
of tyGenericParam:
|
||||
var prev = lookup(c.bindings, f)
|
||||
var prev = lookup(c.bindings, fType)
|
||||
if prev != nil: candidate = prev
|
||||
of tyFromExpr:
|
||||
let computedType = tryResolvingStaticExpr(c, f.n).typ
|
||||
|
||||
Reference in New Issue
Block a user