MCPcopy Create free account
hub / github.com/microsoft/typescript-go / getTypeFromInference

Method getTypeFromInference

internal/checker/inference.go:1475–1483  ·  view source on GitHub ↗
(inference *InferenceInfo)

Source from the content-addressed store, hash-verified

1473}
1474
1475func (c *Checker) getTypeFromInference(inference *InferenceInfo) *Type {
1476 switch {
1477 case len(inference.candidates) != 0:
1478 return c.getUnionTypeEx(inference.candidates, UnionReductionSubtype, nil, nil)
1479 case len(inference.contraCandidates) != 0:
1480 return c.getIntersectionType(inference.contraCandidates)
1481 }
1482 return nil
1483}
1484
1485func getInferenceInfoForType(n *InferenceState, t *Type) *InferenceInfo {
1486 if t.flags&TypeFlagsTypeVariable != 0 {

Callers 2

getInferredTypeMethod · 0.95

Calls 3

getUnionTypeExMethod · 0.95
getIntersectionTypeMethod · 0.95
lenFunction · 0.85

Tested by

no test coverage detected