We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
try
1 parent 6fafcde commit a0ad1b9Copy full SHA for a0ad1b9
test-data/unit/check-redefine.test
@@ -150,6 +150,21 @@ def exc_name() -> None:
150
e = fn_exc(e)
151
[builtins fixtures/exception.pyi]
152
153
+[case testRedefineNestedInTry]
154
+# flags: --allow-redefinition
155
+
156
+def fn_int(_: int) -> None: ...
157
158
+try:
159
+ try:
160
+ ...
161
+ finally:
162
+ a = ""
163
+ a = 5 # E: Incompatible types in assignment (expression has type "int", variable has type "str")
164
+ fn_int(a) # E: Argument 1 to "fn_int" has incompatible type "str"; expected "int"
165
+except:
166
+ pass
167
168
[case testRedefineLocalWithinWith]
169
# flags: --allow-redefinition
170
def f() -> None:
0 commit comments