File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,7 +42,7 @@ predicate returns_meaningful_value(FunctionValue f) {
4242 or
4343 /* Is f a builtin function that returns something other than None?
4444 * 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__"
4646 )
4747}
4848
Original file line number Diff line number Diff line change @@ -514,6 +514,12 @@ abstract class FunctionValue extends CallableValue {
514514 predicate isOverriddenMethod ( ) {
515515 exists ( Value f | f .overrides ( this ) )
516516 }
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+ }
517523}
518524
519525/** Class representing Python functions */
You can’t perform that action at this time.
0 commit comments