Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 87b52bc

Browse files
committed
Add nested function test case
1 parent d1bdbfe commit 87b52bc

1 file changed

Lines changed: 13 additions & 0 deletions

File tree

test-data/unit/check-redefine2.test

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,19 @@ class C:
216216

217217
reveal_type(x) # N: Revealed type is "None | builtins.int"
218218

219+
[case testNewRedefineGlobalVariableNoneInit4]
220+
# flags: --allow-redefinition-new --local-partial-types
221+
x = None
222+
223+
def f() -> None:
224+
def nested() -> None:
225+
global x
226+
x = 1
227+
228+
nested()
229+
230+
reveal_type(x) # N: Revealed type is "None | builtins.int"
231+
219232
[case testNewRedefineGlobalVariableWithUnsupportedType]
220233
# flags: --allow-redefinition-new --local-partial-types
221234
x = 1

0 commit comments

Comments
 (0)