MCPcopy Create free account
hub / github.com/microsoft/typescript-go / checkTypeReferenceOrImport

Method checkTypeReferenceOrImport

internal/checker/checker.go:2986–3002  ·  view source on GitHub ↗
(node *ast.Node)

Source from the content-addressed store, hash-verified

2984}
2985
2986func (c *Checker) checkTypeReferenceOrImport(node *ast.Node) {
2987 t := c.getTypeFromTypeNode(node)
2988 if !c.isErrorType(t) {
2989 if len(node.TypeArguments()) != 0 {
2990 typeParameters := c.getTypeParametersForTypeReferenceOrImport(node)
2991 if len(typeParameters) != 0 {
2992 c.checkTypeArgumentConstraints(node, typeParameters)
2993 }
2994 }
2995 symbol := c.getResolvedSymbolOrNil(node)
2996 if symbol != nil {
2997 if core.Some(symbol.Declarations, func(d *ast.Node) bool { return ast.IsTypeDeclaration(d) && c.IsDeprecatedDeclaration(d) }) {
2998 c.addDeprecatedSuggestion(c.getDeprecatedSuggestionNode(node), symbol.Declarations, symbol.Name)
2999 }
3000 }
3001 }
3002}
3003
3004func (c *Checker) checkTypeArgumentConstraints(node *ast.Node, typeParameters []*Type) bool {
3005 var typeArguments []*Type

Callers 2

checkImportTypeMethod · 0.95

Calls 12

getTypeFromTypeNodeMethod · 0.95
isErrorTypeMethod · 0.95
SomeFunction · 0.92
IsTypeDeclarationFunction · 0.92
lenFunction · 0.85
TypeArgumentsMethod · 0.45

Tested by

no test coverage detected