(name, arity, reportErrors)
| 60655 | return getGlobalSymbol(name, 788968 /* SymbolFlags.Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); |
| 60656 | } |
| 60657 | function getGlobalTypeAliasSymbol(name, arity, reportErrors) { |
| 60658 | var symbol = getGlobalSymbol(name, 788968 /* SymbolFlags.Type */, reportErrors ? ts.Diagnostics.Cannot_find_global_type_0 : undefined); |
| 60659 | if (symbol) { |
| 60660 | // Resolve the declared type of the symbol. This resolves type parameters for the type |
| 60661 | // alias so that we can check arity. |
| 60662 | getDeclaredTypeOfSymbol(symbol); |
| 60663 | if (ts.length(getSymbolLinks(symbol).typeParameters) !== arity) { |
| 60664 | var decl = symbol.declarations && ts.find(symbol.declarations, ts.isTypeAliasDeclaration); |
| 60665 | error(decl, ts.Diagnostics.Global_type_0_must_have_1_type_parameter_s, ts.symbolName(symbol), arity); |
| 60666 | return undefined; |
| 60667 | } |
| 60668 | } |
| 60669 | return symbol; |
| 60670 | } |
| 60671 | function getGlobalSymbol(name, meaning, diagnostic) { |
| 60672 | // Don't track references for global symbols anyway, so value if `isReference` is arbitrary |
| 60673 | return resolveName(undefined, name, meaning, diagnostic, name, /*isUse*/ false, /*excludeGlobals*/ false, /*getSpellingSuggestions*/ false); |
no test coverage detected