Skip to content

Commit 5f05495

Browse files
authored
Fine-grained: Test f string (#4967)
Work towards #4951.
1 parent 697a956 commit 5f05495

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

test-data/unit/fine-grained.test

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5806,6 +5806,18 @@ class M(type):
58065806
==
58075807
a.py:2: error: Argument 1 to "f" of "M" has incompatible type "int"; expected "str"
58085808

5809+
[case testFString]
5810+
from a import g
5811+
f'{g(1)}'
5812+
[file a.py]
5813+
def g(x: int) -> str: pass
5814+
[file a.py.2]
5815+
def g(x: str) -> str: pass
5816+
[builtins fixtures/f_string.pyi]
5817+
[out]
5818+
==
5819+
main:2: error: Argument 1 to "g" has incompatible type "int"; expected "str"
5820+
58095821
[case testExtendedUnpacking-skip-cache]
58105822
from typing import List
58115823
from a import g

0 commit comments

Comments
 (0)