Files
openide/python/testData/codeInsight/controlflow/IfFalse.txt
Aleksandr.Govenko 4dd41ee9f5 PY-20611 Missing warning about functions implicitly returning None when return type is not Optional
Updated PyFunction to account for implicit 'return None' statements when inferring return statement types.

It affected return type inference of PyFunction.

Fixed a failing test related to formatted strings.

Added a quick fix to make all return statements explicit.

Updated the CFG to include PyPassStatements, enabling detection of exit points in empty functions.

Simplified PyMakeFunctionReturnTypeQuickFix to independently infer function types and handle required imports. Currently, it does not support specifying custom suggested types.



Merge-request: IJ-MR-148719
Merged-by: Aleksandr Govenko <aleksandr.govenko@jetbrains.com>

(cherry picked from commit 9f58961f9eb70e4f9dbba7359f5aafdfd392b7e2)

IJ-MR-148719

GitOrigin-RevId: 68ef5c4a1cc0fcaffd750cc0713250a106136643
2024-12-17 18:16:40 +00:00

29 lines
994 B
Plaintext

0(1) element: null
1(2) element: PyIfStatement
2(7) READ ACCESS: False
3(4) element: PyStatementList. Condition: False:true
4(5) ASSERTTYPE ACCESS: False
5(6) element: PyAssignmentStatement
6(7) WRITE ACCESS: a
7(8) element: PyIfStatement
8(13) READ ACCESS: False
9(10) element: PyStatementList. Condition: False:true
10(11) ASSERTTYPE ACCESS: False
11(12) element: PyAssignmentStatement
12(15) WRITE ACCESS: b
13(14) element: PyStatementList. Condition: False:false
14(15) element: PyPassStatement
15(16) element: PyIfStatement
16(21) READ ACCESS: False
17(18) element: PyStatementList. Condition: False:true
18(19) ASSERTTYPE ACCESS: False
19(20) element: PyAssignmentStatement
20(28) WRITE ACCESS: c
21(22) element: PyIfPartElif. Condition: False:false
22(23,26) READ ACCESS: d
23(24) element: PyStatementList. Condition: d:true
24(25) ASSERTTYPE ACCESS: d
25(28) element: PyPassStatement
26(27) element: PyStatementList. Condition: d:false
27(28) element: PyPassStatement
28() element: null