8000 Explicit test case that reveal_type() shuts up in deferred function f… · python/mypy@f1b8872 · GitHub
[go: up one dir, main page]

Skip to content

Commit f1b8872

Browse files
author
Guido van Rossum
committed
Explicit test case that reveal_type() shuts up in deferred function first time around
1 parent dff87cd commit f1b8872

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

test-data/unit/check-expressions.test

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1605,6 +1605,14 @@ reveal_type("foo") # E: Argument 1 to "reveal_type" has incompatible type "str";
16051605
reveal_type = 1
16061606
1 + "foo" # E: Unsupported operand types for + ("int" and "str")
16071607

1608+
[case testRevealForward]
1609+
def f() -> None:
1610+
reveal_type(x)
1611+
x = 1 + 1
1612+
[out]
1613+
main: note: In function "f":
1614+
main:2: error: Revealed type is 'builtins.int'
1615+
16081616
[case testEqNone]
16091617
None == None
16101618
[builtins fixtures/ops.pyi]

0 commit comments

Comments
 (0)
0