MCPcopy Index your code
hub / github.com/nodejs/node / checkTypeParameterDeferred

Function checkTypeParameterDeferred

test/fixtures/snapshot/typescript.js:80037–80056  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

80035 addLazyDiagnostic(function () { return checkTypeNameIsReserved(node.name, ts.Diagnostics.Type_parameter_name_cannot_be_0); });
80036 }
80037 function checkTypeParameterDeferred(node) {
80038 if (ts.isInterfaceDeclaration(node.parent) || ts.isClassLike(node.parent) || ts.isTypeAliasDeclaration(node.parent)) {
80039 var typeParameter = getDeclaredTypeOfTypeParameter(getSymbolOfNode(node));
80040 var modifiers = getVarianceModifiers(typeParameter);
80041 if (modifiers) {
80042 var symbol = getSymbolOfNode(node.parent);
80043 if (ts.isTypeAliasDeclaration(node.parent) && !(ts.getObjectFlags(getDeclaredTypeOfSymbol(symbol)) & (16 /* ObjectFlags.Anonymous */ | 32 /* ObjectFlags.Mapped */))) {
80044 error(node, ts.Diagnostics.Variance_annotations_are_only_supported_in_type_aliases_for_object_function_constructor_and_mapped_types);
80045 }
80046 else if (modifiers === 32768 /* ModifierFlags.In */ || modifiers === 65536 /* ModifierFlags.Out */) {
80047 var source = createMarkerType(symbol, typeParameter, modifiers === 65536 /* ModifierFlags.Out */ ? markerSubType : markerSuperType);
80048 var target = createMarkerType(symbol, typeParameter, modifiers === 65536 /* ModifierFlags.Out */ ? markerSuperType : markerSubType);
80049 var saveVarianceTypeParameter = typeParameter;
80050 varianceTypeParameter = typeParameter;
80051 checkTypeAssignableTo(source, target, node, ts.Diagnostics.Type_0_is_not_assignable_to_type_1_as_implied_by_variance_annotation);
80052 varianceTypeParameter = saveVarianceTypeParameter;
80053 }
80054 }
80055 }
80056 }
80057 function checkParameter(node) {
80058 // Grammar checking
80059 // It is a SyntaxError if the Identifier "eval" or the Identifier "arguments" occurs as the

Callers 1

checkDeferredNodeFunction · 0.85

Calls 7

getSymbolOfNodeFunction · 0.85
getVarianceModifiersFunction · 0.85
getDeclaredTypeOfSymbolFunction · 0.85
createMarkerTypeFunction · 0.85
checkTypeAssignableToFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…