@@ -2526,7 +2526,7 @@ func (c *Checker) checkConstructorDeclaration(node *ast.Node) {
2526
2526
// Constructors of classes with no extends clause may not contain super calls, whereas
2527
2527
// constructors of derived classes must contain at least one super call somewhere in their function body.
2528
2528
containingClassDecl := node.Parent
2529
- if getExtendsTypeNode (containingClassDecl) == nil {
2529
+ if ast.GetExtendsHeritageClauseElement (containingClassDecl) == nil {
2530
2530
return
2531
2531
}
2532
2532
classExtendsNull := c.classDeclarationExtendsNull(containingClassDecl)
@@ -3937,7 +3937,7 @@ func (c *Checker) checkClassLikeDeclaration(node *ast.Node) {
3937
3937
c.checkTypeParameterListsIdentical(symbol)
3938
3938
c.checkFunctionOrConstructorSymbol(symbol)
3939
3939
c.checkObjectTypeForDuplicateDeclarations(node, true /*checkPrivateNames*/)
3940
- baseTypeNode := getExtendsTypeNode (node)
3940
+ baseTypeNode := ast.GetExtendsHeritageClauseElement (node)
3941
3941
if baseTypeNode != nil {
3942
3942
c.checkSourceElements(baseTypeNode.TypeArguments())
3943
3943
baseTypes := c.getBaseTypes(classType)
@@ -3988,7 +3988,7 @@ func (c *Checker) checkClassLikeDeclaration(node *ast.Node) {
3988
3988
}
3989
3989
}
3990
3990
c.checkMembersForOverrideModifier(node, classType, typeWithThis, staticType)
3991
- implementedTypeNodes := getImplementsTypeNodes (node)
3991
+ implementedTypeNodes := ast.GetImplementsHeritageClauseElements (node)
3992
3992
for _, typeRefNode := range implementedTypeNodes {
3993
3993
expr := typeRefNode.Expression()
3994
3994
if !ast.IsEntityNameExpression(expr) || ast.IsOptionalChain(expr) {
@@ -4308,7 +4308,7 @@ func (c *Checker) isPropertyAbstractOrInterface(declaration *ast.Node, baseDecla
4308
4308
4309
4309
func (c *Checker) checkMembersForOverrideModifier(node *ast.Node, t *Type, typeWithThis *Type, staticType *Type) {
4310
4310
var baseWithThis *Type
4311
- baseTypeNode := getExtendsTypeNode (node)
4311
+ baseTypeNode := ast.GetExtendsHeritageClauseElement (node)
4312
4312
if baseTypeNode != nil {
4313
4313
baseTypes := c.getBaseTypes(t)
4314
4314
if len(baseTypes) > 0 {
@@ -4611,7 +4611,7 @@ func (c *Checker) checkInterfaceDeclaration(node *ast.Node) {
4611
4611
}
4612
4612
}
4613
4613
c.checkObjectTypeForDuplicateDeclarations(node, false /*checkPrivateNames*/)
4614
- for _, heritageElement := range getExtendsTypeNodes (node) {
4614
+ for _, heritageElement := range ast.GetExtendsHeritageClauseElements (node) {
4615
4615
expr := heritageElement.Expression()
4616
4616
if !ast.IsEntityNameExpression(expr) || ast.IsOptionalChain(expr) {
4617
4617
c.error(expr, diagnostics.An_interface_can_only_extend_an_identifier_Slashqualified_name_with_optional_type_arguments)
@@ -7336,7 +7336,7 @@ func (c *Checker) checkSuperExpression(node *ast.Node) *Type {
7336
7336
}
7337
7337
// at this point the only legal case for parent is ClassLikeDeclaration
7338
7338
classLikeDeclaration := container.Parent
7339
- if getExtendsTypeNode (classLikeDeclaration) == nil {
7339
+ if ast.GetExtendsHeritageClauseElement (classLikeDeclaration) == nil {
7340
7340
c.error(node, diagnostics.X_super_can_only_be_referenced_in_a_derived_class)
7341
7341
return c.errorType
7342
7342
}
@@ -7871,7 +7871,7 @@ func (c *Checker) resolveCallExpression(node *ast.Node, candidatesOutArray *[]*S
7871
7871
if !c.isErrorType(superType) {
7872
7872
// In super call, the candidate signatures are the matching arity signatures of the base constructor function instantiated
7873
7873
// with the type arguments specified in the extends clause.
7874
- baseTypeNode := getExtendsTypeNode (ast.GetContainingClass(node))
7874
+ baseTypeNode := ast.GetExtendsHeritageClauseElement (ast.GetContainingClass(node))
7875
7875
if baseTypeNode != nil {
7876
7876
baseConstructors := c.getInstantiatedConstructorsForTypeArguments(superType, baseTypeNode.TypeArguments(), baseTypeNode)
7877
7877
return c.resolveCall(node, baseConstructors, candidatesOutArray, checkMode, SignatureFlagsNone, nil)
@@ -11422,7 +11422,7 @@ func (c *Checker) checkThisInStaticClassFieldInitializerInDecoratedClass(thisExp
11422
11422
11423
11423
func (c *Checker) checkThisBeforeSuper(node *ast.Node, container *ast.Node, diagnosticMessage *diagnostics.Message) {
11424
11424
containingClassDecl := container.Parent
11425
- baseTypeNode := getExtendsTypeNode (containingClassDecl)
11425
+ baseTypeNode := ast.GetExtendsHeritageClauseElement (containingClassDecl)
11426
11426
// If a containing class does not have extends clause or the class extends null
11427
11427
// skip checking whether super statement is called before "this" accessing.
11428
11428
if baseTypeNode != nil && !c.classDeclarationExtendsNull(containingClassDecl) {
@@ -15740,7 +15740,7 @@ func (c *Checker) isThislessInterface(symbol *ast.Symbol) bool {
15740
15740
if declaration.Flags&ast.NodeFlagsContainsThis != 0 {
15741
15741
return false
15742
15742
}
15743
- baseTypeNodes := getExtendsTypeNodes (declaration)
15743
+ baseTypeNodes := ast.GetExtendsHeritageClauseElements (declaration)
15744
15744
for _, node := range baseTypeNodes {
15745
15745
if ast.IsEntityNameExpression(node.Expression()) {
15746
15746
baseSymbol := c.resolveEntityName(node.Expression(), ast.SymbolFlagsType, true /*ignoreErrors*/, false, nil)
@@ -17453,7 +17453,7 @@ func (c *Checker) resolveBaseTypesOfClass(t *Type) {
17453
17453
func getBaseTypeNodeOfClass(t *Type) *ast.Node {
17454
17454
decl := getClassLikeDeclarationOfSymbol(t.symbol)
17455
17455
if decl != nil {
17456
- return getExtendsTypeNode (decl)
17456
+ return ast.GetExtendsHeritageClauseElement (decl)
17457
17457
}
17458
17458
return nil
17459
17459
}
@@ -17687,7 +17687,7 @@ func (c *Checker) resolveBaseTypesOfInterface(t *Type) {
17687
17687
data := t.AsInterfaceType()
17688
17688
for _, declaration := range t.symbol.Declarations {
17689
17689
if ast.IsInterfaceDeclaration(declaration) {
17690
- for _, node := range getExtendsTypeNodes (declaration) {
17690
+ for _, node := range ast.GetExtendsHeritageClauseElements (declaration) {
17691
17691
baseType := c.getReducedType(c.getTypeFromTypeNode(node))
17692
17692
if !c.isErrorType(baseType) {
17693
17693
if c.isValidBaseType(baseType) {
0 commit comments