File tree Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Expand file tree Collapse file tree 1 file changed +14
-2
lines changed Original file line number Diff line number Diff line change @@ -383,9 +383,21 @@ def foo(self) -> int:
383383[builtins fixtures/ops.pyi]
384384[out]
385385
386+ [case testSysPlatformEarlyReturnActualUnreachableCodeForPlatform]
387+ # flags: --warn-unreachable --platform fictional
388+ import sys
389+
390+ def foo() -> int:
391+ if sys.platform != 'fictional':
392+ return 1
393+ return 0
394+ return 0 + 1 # E: Statement is unreachable
395+ [builtins fixtures/ops.pyi]
396+ [out]
397+
386398-- TODO: We currently suppress unreachability warnings past semantic
387- -- reachability checks. This should be enabled and fixed .
388- [case testSysPlatformInFunctionEarlyReturnWithActualUnreachableCode -skip]
399+ -- reachability checks. Need to decide if this should be fixed and enabled .
400+ [case testSysPlatformEarlyReturnActualUnreachableCodeNotForPlatform -skip]
389401# flags: --warn-unreachable
390402import sys
391403
You can’t perform that action at this time.
0 commit comments