(type, reference, checkMode)
| 71513 | return contextualType && !isGenericType(contextualType); |
| 71514 | } |
| 71515 | function getNarrowableTypeForReference(type, reference, checkMode) { |
| 71516 | // When the type of a reference is or contains an instantiable type with a union type constraint, and |
| 71517 | // when the reference is in a constraint position (where it is known we'll obtain the apparent type) or |
| 71518 | // has a contextual type containing no top-level instantiables (meaning constraints will determine |
| 71519 | // assignability), we substitute constraints for all instantiables in the type of the reference to give |
| 71520 | // control flow analysis an opportunity to narrow it further. For example, for a reference of a type |
| 71521 | // parameter type 'T extends string | undefined' with a contextual type 'string', we substitute |
| 71522 | // 'string | undefined' to give control flow analysis the opportunity to narrow to type 'string'. |
| 71523 | var substituteConstraints = !(checkMode && checkMode & 2 /* CheckMode.Inferential */) && |
| 71524 | someType(type, isGenericTypeWithUnionConstraint) && |
| 71525 | (isConstraintPosition(type, reference) || hasContextualTypeWithNoGenericTypes(reference, checkMode)); |
| 71526 | return substituteConstraints ? mapType(type, function (t) { return t.flags & 465829888 /* TypeFlags.Instantiable */ ? getBaseConstraintOrType(t) : t; }) : type; |
| 71527 | } |
| 71528 | function isExportOrExportExpression(location) { |
| 71529 | return !!ts.findAncestor(location, function (n) { |
| 71530 | var parent = n.parent; |
no test coverage detected
searching dependent graphs…