@@ -581,13 +581,6 @@ abstract class FunctionValue extends CallableValue {
581581 exists ( Expr expr , AstNode origin | expr .pointsTo ( this , origin ) | not origin instanceof Lambda )
582582 )
583583 }
584-
585- /** Gets a class that this function may return */
586- ClassValue getAnInferredReturnType ( ) {
587- result = this .( BuiltinFunctionValue ) .getAReturnType ( )
588- or
589- result = this .( BuiltinMethodValue ) .getAReturnType ( )
590- }
591584}
592585
593586/** Class representing Python functions */
@@ -627,29 +620,6 @@ class BuiltinFunctionValue extends FunctionValue {
627620 override int minParameters ( ) { none ( ) }
628621
629622 override int maxParameters ( ) { none ( ) }
630-
631- ClassValue getAReturnType ( ) {
632- /* Enumerate the types of a few builtin functions, that the CPython analysis misses.
633- */
634- this = TBuiltinFunctionObject ( Builtin:: builtin ( "hex" ) ) and result = ClassValue:: str ( )
635- or
636- this = TBuiltinFunctionObject ( Builtin:: builtin ( "oct" ) ) and result = ClassValue:: str ( )
637- or
638- this = TBuiltinFunctionObject ( Builtin:: builtin ( "intern" ) ) and result = ClassValue:: str ( )
639- or
640- /* Fix a few minor inaccuracies in the CPython analysis */
641- exists ( Builtin mthd , Builtin cls | this = TBuiltinFunctionObject ( mthd ) and result = TBuiltinClassObject ( cls )
642- | ext_rettype ( mthd , cls ) ) and
643- not (
644- this = TBuiltinFunctionObject ( Builtin:: builtin ( "__import__" ) ) and result = ClassValue:: nonetype ( )
645- or
646- this = TBuiltinFunctionObject ( Builtin:: builtin ( "compile" ) ) and result = ClassValue:: nonetype ( )
647- or
648- this = TBuiltinFunctionObject ( Builtin:: builtin ( "sum" ) )
649- or
650- this = TBuiltinFunctionObject ( Builtin:: builtin ( "filter" ) )
651- )
652- }
653623}
654624
655625/** Class representing builtin methods, such as `list.append` or `set.add` */
@@ -667,15 +637,6 @@ class BuiltinMethodValue extends FunctionValue {
667637 override int minParameters ( ) { none ( ) }
668638
669639 override int maxParameters ( ) { none ( ) }
670-
671- ClassValue getAReturnType ( ) {
672- exists ( Builtin mthd , Builtin cls |
673- this = TBuiltinMethodObject ( mthd ) and
674- result = TBuiltinClassObject ( cls )
675- |
676- ext_rettype ( mthd , cls )
677- )
678- }
679640}
680641
681642/**
0 commit comments