(n *InferenceState, source *Type, target *Type)
| 518 | } |
| 519 | |
| 520 | func (c *Checker) inferToConditionalType(n *InferenceState, source *Type, target *Type) { |
| 521 | if source.flags&TypeFlagsConditional != 0 { |
| 522 | c.inferFromTypes(n, source.AsConditionalType().checkType, target.AsConditionalType().checkType) |
| 523 | c.inferFromTypes(n, source.AsConditionalType().extendsType, target.AsConditionalType().extendsType) |
| 524 | c.inferFromTypes(n, c.getTrueTypeFromConditionalType(source), c.getTrueTypeFromConditionalType(target)) |
| 525 | c.inferFromTypes(n, c.getFalseTypeFromConditionalType(source), c.getFalseTypeFromConditionalType(target)) |
| 526 | } else { |
| 527 | targetTypes := []*Type{c.getTrueTypeFromConditionalType(target), c.getFalseTypeFromConditionalType(target)} |
| 528 | c.inferToMultipleTypesWithPriority(n, source, targetTypes, target.flags, core.IfElse(n.contravariant, InferencePriorityContravariantConditional, 0)) |
| 529 | } |
| 530 | } |
| 531 | |
| 532 | func (c *Checker) inferToTemplateLiteralType(n *InferenceState, source *Type, target *TemplateLiteralType) { |
| 533 | matches := c.inferTypesFromTemplateLiteralType(source, target) |
nothing calls this directly
no test coverage detected