Apply suggestions from code review

Co-authored-by: Taus <tausbn@github.com>
This commit is contained in:
yoff
2021-01-27 12:15:35 +01:00
committed by GitHub
parent 9b13834d28
commit f2241e04e5
2 changed files with 7 additions and 3 deletions

View File

@@ -40,8 +40,12 @@ class Function extends Function_, Scope, AstNode {
}
/**
* Whether this is a lambda.
* We detect this by comparing its name to the one the extractor gives to lambdas.
* Holds if this function represents a lambda.
*
* The extractor reifies each lambda expression as a (local) function with the name
* "lambda". As `lambda` is a keyword in Python, it's impossible to create a function with this
* name otherwise, and so it's impossible to get a non-lambda function accidentally
* classified as a lambda.
*/
predicate isLambda() { this.getName() = "lambda" }

View File

@@ -721,7 +721,7 @@ abstract class FunctionValue extends CallableValue {
/** Gets a class that this function may return */
abstract ClassValue getAnInferredReturnType();
/** Wheter this is a lambda function */
/** Holds if this function represents a lambda. */
predicate isLambda() { this.getOrigin().getNode() instanceof Lambda }
}