(source, target, reportErrors)
| 66186 | // related to Y, where X' is an instantiation of X in which P is replaced with Q. Notice |
| 66187 | // that S and T are contra-variant whereas X and Y are co-variant. |
| 66188 | function mappedTypeRelatedTo(source, target, reportErrors) { |
| 66189 | var modifiersRelated = relation === comparableRelation || (relation === identityRelation ? getMappedTypeModifiers(source) === getMappedTypeModifiers(target) : |
| 66190 | getCombinedMappedTypeOptionality(source) <= getCombinedMappedTypeOptionality(target)); |
| 66191 | if (modifiersRelated) { |
| 66192 | var result_10; |
| 66193 | var targetConstraint = getConstraintTypeFromMappedType(target); |
| 66194 | var sourceConstraint = instantiateType(getConstraintTypeFromMappedType(source), makeFunctionTypeMapper(getCombinedMappedTypeOptionality(source) < 0 ? reportUnmeasurableMarkers : reportUnreliableMarkers)); |
| 66195 | if (result_10 = isRelatedTo(targetConstraint, sourceConstraint, 3 /* RecursionFlags.Both */, reportErrors)) { |
| 66196 | var mapper = createTypeMapper([getTypeParameterFromMappedType(source)], [getTypeParameterFromMappedType(target)]); |
| 66197 | if (instantiateType(getNameTypeFromMappedType(source), mapper) === instantiateType(getNameTypeFromMappedType(target), mapper)) { |
| 66198 | return result_10 & isRelatedTo(instantiateType(getTemplateTypeFromMappedType(source), mapper), getTemplateTypeFromMappedType(target), 3 /* RecursionFlags.Both */, reportErrors); |
| 66199 | } |
| 66200 | } |
| 66201 | } |
| 66202 | return 0 /* Ternary.False */; |
| 66203 | } |
| 66204 | function typeRelatedToDiscriminatedType(source, target) { |
| 66205 | // 1. Generate the combinations of discriminant properties & types 'source' can satisfy. |
| 66206 | // a. If the number of combinations is above a set limit, the comparison is too complex. |
no test coverage detected
searching dependent graphs…