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

Function checkAndReportErrorForUsingValueAsType

test/fixtures/snapshot/typescript.js:50214–50223  ·  view source on GitHub ↗
(errorLocation, name, meaning)

Source from the content-addressed store, hash-verified

50212 return false;
50213 }
50214 function checkAndReportErrorForUsingValueAsType(errorLocation, name, meaning) {
50215 if (meaning & (788968 /* SymbolFlags.Type */ & ~1920 /* SymbolFlags.Namespace */)) {
50216 var symbol = resolveSymbol(resolveName(errorLocation, name, ~788968 /* SymbolFlags.Type */ & 111551 /* SymbolFlags.Value */, /*nameNotFoundMessage*/ undefined, /*nameArg*/ undefined, /*isUse*/ false));
50217 if (symbol && !(symbol.flags & 1920 /* SymbolFlags.Namespace */)) {
50218 error(errorLocation, ts.Diagnostics._0_refers_to_a_value_but_is_being_used_as_a_type_here_Did_you_mean_typeof_0, ts.unescapeLeadingUnderscores(name));
50219 return true;
50220 }
50221 }
50222 return false;
50223 }
50224 function isPrimitiveTypeName(name) {
50225 return name === "any" || name === "string" || name === "number" || name === "boolean" || name === "never" || name === "unknown";
50226 }

Callers 1

resolveNameHelperFunction · 0.85

Calls 3

resolveSymbolFunction · 0.85
resolveNameFunction · 0.85
errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…