MCPcopy Create free account
hub / github.com/nodejs/node / createImplementsDiagnostics

Function createImplementsDiagnostics

test/fixtures/snapshot/typescript.js:84177–84195  ·  view source on GitHub ↗
(typeRefNode)

Source from the content-addressed store, hash-verified

84175 checkPropertyInitialization(node);
84176 });
84177 function createImplementsDiagnostics(typeRefNode) {
84178 return function () {
84179 var t = getReducedType(getTypeFromTypeNode(typeRefNode));
84180 if (!isErrorType(t)) {
84181 if (isValidBaseType(t)) {
84182 var genericDiag = t.symbol && t.symbol.flags & 32 /* SymbolFlags.Class */ ?
84183 ts.Diagnostics.Class_0_incorrectly_implements_class_1_Did_you_mean_to_extend_1_and_inherit_its_members_as_a_subclass :
84184 ts.Diagnostics.Class_0_incorrectly_implements_interface_1;
84185 var baseWithThis = getTypeWithThisArgument(t, type.thisType);
84186 if (!checkTypeAssignableTo(typeWithThis, baseWithThis, /*errorNode*/ undefined)) {
84187 issueMemberSpecificError(node, typeWithThis, baseWithThis, genericDiag);
84188 }
84189 }
84190 else {
84191 error(typeRefNode, ts.Diagnostics.A_class_can_only_implement_an_object_type_or_intersection_of_object_types_with_statically_known_members);
84192 }
84193 }
84194 };
84195 }
84196 }
84197 function checkMembersForOverrideModifier(node, type, typeWithThis, staticType) {
84198 var baseTypeNode = ts.getEffectiveBaseTypeNode(node);

Callers 1

Calls 8

getReducedTypeFunction · 0.85
getTypeFromTypeNodeFunction · 0.85
isErrorTypeFunction · 0.85
isValidBaseTypeFunction · 0.85
getTypeWithThisArgumentFunction · 0.85
checkTypeAssignableToFunction · 0.85
issueMemberSpecificErrorFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected