@@ -581,13 +581,6 @@ abstract class FunctionValue extends CallableValue {
581
581
exists ( Expr expr , AstNode origin | expr .pointsTo ( this , origin ) | not origin instanceof Lambda )
582
582
)
583
583
}
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
- }
591
584
}
592
585
593
586
/** Class representing Python functions */
@@ -627,29 +620,6 @@ class BuiltinFunctionValue extends FunctionValue {
627
620
override int minParameters ( ) { none ( ) }
628
621
629
622
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
- }
653
623
}
654
624
655
625
/** Class representing builtin methods, such as `list.append` or `set.add` */
@@ -667,15 +637,6 @@ class BuiltinMethodValue extends FunctionValue {
667
637
override int minParameters ( ) { none ( ) }
668
638
669
639
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
- }
679
640
}
680
641
681
642
/**
0 commit comments