Skip to content

Commit f67c68d

Browse files
committed
Python: Make TypeParameter extend AstNode
With `AstNode` defined as a union of other classes, we don't get this for free. (Compare with `DictItem`, which is in a similar situation.)
1 parent 8782998 commit f67c68d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

python/ql/lib/semmle/python/AstExtended.qll

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,9 +222,16 @@ class StringList extends StringList_ { }
222222
class AliasList extends AliasList_ { }
223223

224224
/** A generic type parameter, as seen in function, class, and type alias definitions. */
225-
class TypeParameter extends TypeParameter_ {
225+
class TypeParameter extends TypeParameter_, AstNode {
226226
/** Gets a textual representation of this element */
227227
override string toString() { result = TypeParameter_.super.toString() }
228+
229+
override AstNode getAChildNode() { none() }
230+
231+
override Scope getScope() { none() }
232+
233+
/** Gets the location of this element */
234+
override Location getLocation() { result = TypeParameter_.super.getLocation() }
228235
}
229236

230237
/** A list of type parameters */

0 commit comments

Comments
 (0)