Ruby: Handle captured yield calls

This commit is contained in:
Tom Hvitved
2024-01-10 11:03:55 +01:00
parent 55be4c39ef
commit 295198744b
8 changed files with 70 additions and 13 deletions

View File

@@ -319,4 +319,9 @@ module MakeConsistency<
strictcount(DataFlowCall call0 | multipleArgumentCallInclude(arg, call0)) > 1 and
msg = "Multiple calls for argument node."
}
query predicate lambdaCallEnclosingCallableMismatch(DataFlowCall call, Node receiver) {
lambdaCall(call, _, receiver) and
not nodeGetEnclosingCallable(receiver) = call.getEnclosingCallable()
}
}