mirror of
https://github.com/github/codeql.git
synced 2026-02-08 03:01:10 +01:00
resolve super-expressions when the super-type is explicitly mentioned
This commit is contained in:
@@ -1758,9 +1758,16 @@ class ThisAccess extends Identifier {
|
||||
|
||||
/** A use of `super`. */
|
||||
class Super extends TSuper, Expr {
|
||||
Super() { this = TSuper(_) }
|
||||
QL::SuperRef ref;
|
||||
|
||||
Super() { this = TSuper(ref) }
|
||||
|
||||
override string getAPrimaryQlClass() { result = "Super" }
|
||||
|
||||
override Type getType() {
|
||||
exists(TypeExpr te | ref.getChild(0) = toQL(te) | result = te.getResolvedType())
|
||||
// TODO: Also resolve the type when there is no TypeExpr.
|
||||
}
|
||||
}
|
||||
|
||||
/** An access to `result`. */
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
| Test.qll:22:18:22:24 | Set | file://:0:0:0:0 | string |
|
||||
| Test.qll:22:19:22:23 | String | file://:0:0:0:0 | string |
|
||||
| Test.qll:24:15:24:20 | result | file://:0:0:0:0 | int |
|
||||
| Test.qll:24:24:24:33 | Super | Test.qll:15:1:19:1 | Base |
|
||||
| Test.qll:24:24:24:39 | MemberCall | file://:0:0:0:0 | int |
|
||||
| Test.qll:26:16:26:21 | result | file://:0:0:0:0 | int |
|
||||
| Test.qll:26:25:26:35 | MemberCall | file://:0:0:0:0 | int |
|
||||
|
||||
Reference in New Issue
Block a user