Skip to content

Commit 89bfad0

Browse files
committed
Swift: fix MethodLookupExpr.getMethod()
By adding a couple missing cases.
1 parent c1e746a commit 89bfad0

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

swift/ql/lib/codeql/swift/elements/expr/MethodLookupExpr.qll

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,16 @@ class MethodLookupExpr extends Generated::MethodLookupExpr {
1414

1515
override Decl getImmediateMember() {
1616
result =
17-
Synth::convertDeclFromRaw(this.getUnderlying().getFunction().(Raw::DeclRefExpr).getDecl()) // TODO: FIX THIS
17+
Synth::convertDeclFromRaw([
18+
this.getUnderlying().getFunction().(Raw::DeclRefExpr).getDecl(),
19+
this.getUnderlying()
20+
.getFunction()
21+
.(Raw::FunctionConversionExpr)
22+
.getSubExpr()
23+
.(Raw::DeclRefExpr)
24+
.getDecl(),
25+
this.getUnderlying().getFunction().(Raw::OtherConstructorDeclRefExpr).getConstructorDecl()
26+
])
1827
}
1928

2029
MethodDecl getMethod() { result = this.getMember() }

0 commit comments

Comments
 (0)