Skip to content

Commit 1471cb4

Browse files
author
Guido van Rossum
committed
Add a test that would require three passes
1 parent 0b8d5ae commit 1471cb4

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test-data/unit/check-modules.test

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1220,6 +1220,22 @@ x = 1 + 1
12201220
[out]
12211221
tmp/a.py:3: error: Revealed type is 'builtins.int'
12221222

1223+
[case testThreePassesRequired]
1224+
# flags: --hide-error-context
1225+
import b
1226+
[file a.py]
1227+
import b
1228+
class C:
1229+
def f1(self) -> None:
1230+
self.x2
1231+
def f2(self) -> None:
1232+
self.x2 = b.b
1233+
[file b.py]
1234+
import a
1235+
b = 1 + 1
1236+
[out]
1237+
tmp/a.py:4: error: Cannot determine type of 'x2'
1238+
12231239

12241240
-- Scripts and __main__
12251241

0 commit comments

Comments
 (0)