File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ predicate returns_meaningful_value(FunctionValue f) {
42
42
or
43
43
/* Is f a builtin function that returns something other than None?
44
44
* Ignore __import__ as it is often called purely for side effects */
45
- f .isBuiltin ( ) and f .getAnInferredReturnType ( ) != theNoneType ( ) and not f .getName ( ) = "__import__"
45
+ f .isBuiltin ( ) and f .getAnInferredReturnType ( ) != ClassValue :: nonetype ( ) and not f .getName ( ) = "__import__"
46
46
)
47
47
}
48
48
Original file line number Diff line number Diff line change @@ -514,6 +514,12 @@ abstract class FunctionValue extends CallableValue {
514
514
predicate isOverriddenMethod ( ) {
515
515
exists ( Value f | f .overrides ( this ) )
516
516
}
517
+
518
+ /** Gets a class that this function may return */
519
+ ClassValue getAnInferredReturnType ( ) {
520
+ //result = this.(BuiltinCallable).getAReturnType()
521
+ result = this .getScope ( ) .getAReturnValueFlowNode ( ) .pointsTo ( ) .getClass ( )
522
+ }
517
523
}
518
524
519
525
/** Class representing Python functions */
You can’t perform that action at this time.
0 commit comments