jacob/inference: docstring improvements

This commit is contained in:
Jacob Zimmerman 2024-11-22 17:05:18 -05:00
Родитель 2b35184173
Коммит 57eb2acf6e
1 изменённых файлов: 13 добавлений и 11 удалений

Просмотреть файл

@ -2337,17 +2337,19 @@ Nodes:
return inf return inf
} }
targs := c.getTypeArgs(node) if sig.TypeParams().Len() > 0 {
res := inferExpectedResultTypes(c, i) targs := c.getTypeArgs(node)
substs := reverseInferTypeArgs(sig, targs, res) res := inferExpectedResultTypes(c, i)
inst := instantiate(sig, substs) substs := reverseInferTypeArgs(sig, targs, res)
if inst != nil { inst := instantiate(sig, substs)
// TODO(jacobz): If partial signature instantiation becomes possible, if inst != nil {
// make needsExactType only true if necessary. // TODO(jacobz): If partial signature instantiation becomes possible,
// Currently ambigious cases resolve to a correct, but occassionally, // make needsExactType only true if necessary.
// superfluous conversion expression wrapping the completion. // Currently, ambigious cases always resolve to a conversion expression
inf.needsExactType = true // wrapping the completion, which is occassionally superfluous.
sig = inst inf.needsExactType = true
sig = inst
}
} }
inf = c.expectedCallParamType(inf, node, sig) inf = c.expectedCallParamType(inf, node, sig)