(source, target, reportErrors)
| 65312 | return result; |
| 65313 | } |
| 65314 | function typeRelatedToSomeType(source, target, reportErrors) { |
| 65315 | var targetTypes = target.types; |
| 65316 | if (target.flags & 1048576 /* TypeFlags.Union */) { |
| 65317 | if (containsType(targetTypes, source)) { |
| 65318 | return -1 /* Ternary.True */; |
| 65319 | } |
| 65320 | var match = getMatchingUnionConstituentForType(target, source); |
| 65321 | if (match) { |
| 65322 | var related = isRelatedTo(source, match, 2 /* RecursionFlags.Target */, /*reportErrors*/ false); |
| 65323 | if (related) { |
| 65324 | return related; |
| 65325 | } |
| 65326 | } |
| 65327 | } |
| 65328 | for (var _i = 0, targetTypes_1 = targetTypes; _i < targetTypes_1.length; _i++) { |
| 65329 | var type = targetTypes_1[_i]; |
| 65330 | var related = isRelatedTo(source, type, 2 /* RecursionFlags.Target */, /*reportErrors*/ false); |
| 65331 | if (related) { |
| 65332 | return related; |
| 65333 | } |
| 65334 | } |
| 65335 | if (reportErrors) { |
| 65336 | // Elaborate only if we can find a best matching type in the target union |
| 65337 | var bestMatchingType = getBestMatchingType(source, target, isRelatedTo); |
| 65338 | if (bestMatchingType) { |
| 65339 | isRelatedTo(source, bestMatchingType, 2 /* RecursionFlags.Target */, /*reportErrors*/ true); |
| 65340 | } |
| 65341 | } |
| 65342 | return 0 /* Ternary.False */; |
| 65343 | } |
| 65344 | function typeRelatedToEachType(source, target, reportErrors, intersectionState) { |
| 65345 | var result = -1 /* Ternary.True */; |
| 65346 | var targetTypes = target.types; |
no test coverage detected
searching dependent graphs…