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

Function checkTypeNameIsReserved

test/fixtures/snapshot/typescript.js:83886–83902  ·  view source on GitHub ↗
(name, message)

Source from the content-addressed store, hash-verified

83884 }
83885 }
83886 function checkTypeNameIsReserved(name, message) {
83887 // TS 1.0 spec (April 2014): 3.6.1
83888 // The predefined type keywords are reserved and cannot be used as names of user defined types.
83889 switch (name.escapedText) {
83890 case "any":
83891 case "unknown":
83892 case "never":
83893 case "number":
83894 case "bigint":
83895 case "boolean":
83896 case "string":
83897 case "symbol":
83898 case "void":
83899 case "object":
83900 error(name, message, name.escapedText);
83901 }
83902 }
83903 /**
83904 * The name cannot be used as 'Object' of user defined types with special target.
83905 */

Callers 6

checkTypeParameterFunction · 0.85
checkJSDocTypeAliasTagFunction · 0.85

Calls 1

errorFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…