(type)
| 77365 | } |
| 77366 | return result; |
| 77367 | function getInstantiatedType(type) { |
| 77368 | var hasSignatures = false; |
| 77369 | var hasApplicableSignature = false; |
| 77370 | var result = getInstantiatedTypePart(type); |
| 77371 | hasSomeApplicableSignature || (hasSomeApplicableSignature = hasApplicableSignature); |
| 77372 | if (hasSignatures && !hasApplicableSignature) { |
| 77373 | nonApplicableType !== null && nonApplicableType !== void 0 ? nonApplicableType : (nonApplicableType = type); |
| 77374 | } |
| 77375 | return result; |
| 77376 | function getInstantiatedTypePart(type) { |
| 77377 | if (type.flags & 524288 /* TypeFlags.Object */) { |
| 77378 | var resolved = resolveStructuredTypeMembers(type); |
| 77379 | var callSignatures = getInstantiatedSignatures(resolved.callSignatures); |
| 77380 | var constructSignatures = getInstantiatedSignatures(resolved.constructSignatures); |
| 77381 | hasSignatures || (hasSignatures = resolved.callSignatures.length !== 0 || resolved.constructSignatures.length !== 0); |
| 77382 | hasApplicableSignature || (hasApplicableSignature = callSignatures.length !== 0 || constructSignatures.length !== 0); |
| 77383 | if (callSignatures !== resolved.callSignatures || constructSignatures !== resolved.constructSignatures) { |
| 77384 | var result_11 = createAnonymousType(undefined, resolved.members, callSignatures, constructSignatures, resolved.indexInfos); |
| 77385 | result_11.objectFlags |= 8388608 /* ObjectFlags.InstantiationExpressionType */; |
| 77386 | result_11.node = node; |
| 77387 | return result_11; |
| 77388 | } |
| 77389 | } |
| 77390 | else if (type.flags & 58982400 /* TypeFlags.InstantiableNonPrimitive */) { |
| 77391 | var constraint = getBaseConstraintOfType(type); |
| 77392 | if (constraint) { |
| 77393 | var instantiated = getInstantiatedTypePart(constraint); |
| 77394 | if (instantiated !== constraint) { |
| 77395 | return instantiated; |
| 77396 | } |
| 77397 | } |
| 77398 | } |
| 77399 | else if (type.flags & 1048576 /* TypeFlags.Union */) { |
| 77400 | return mapType(type, getInstantiatedType); |
| 77401 | } |
| 77402 | else if (type.flags & 2097152 /* TypeFlags.Intersection */) { |
| 77403 | return getIntersectionType(ts.sameMap(type.types, getInstantiatedTypePart)); |
| 77404 | } |
| 77405 | return type; |
| 77406 | } |
| 77407 | } |
| 77408 | function getInstantiatedSignatures(signatures) { |
| 77409 | var applicableSignatures = ts.filter(signatures, function (sig) { return !!sig.typeParameters && hasCorrectTypeArgumentArity(sig, typeArguments); }); |
| 77410 | return ts.sameMap(applicableSignatures, function (sig) { |
no test coverage detected
searching dependent graphs…