Skip to content

Commit 6420e5a

Browse files
more tests
1 parent ed9b194 commit 6420e5a

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

test-data/unit/check-final.test

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1340,13 +1340,24 @@ class S9(S2, S4): # E: Class "S9" has incompatible disjoint bases
13401340
[case testFinalJoin]
13411341
from typing import Final
13421342

1343+
13431344
hello: Final = "hello"
13441345
x: Final = " ".join((hello,"my","name","is","joe"))
13451346
y: Final = " ".join([hello,"joe","my","name","is","moe"])
13461347

13471348
reveal_type(x) # N: Revealed type is "Literal['hello my name is joe']?"
13481349
reveal_type(y) # N: Revealed type is "Literal['hello joe my name is moe']?"
13491350

1351+
delimiter: Final = ","
1352+
headers: Final = delimiter.join(("name", "age"))
1353+
joe: Final = delimiter.join(["joe", "24"])
1354+
jack: Final = delimiter.join(("jack", "77"))
1355+
jill: Final = delimiter.join(["jill", "30"])
1356+
lines: Final = "\n".join((headers, joe, jack, jill))
1357+
1358+
reveal_type(headers) # N: Revealed type is "Literal['name,age']?"
1359+
reveal_type(lines) # N: Revealed type is "Literal['name,age\njoe,24\njack,77\njill,30']?"
1360+
13501361
# TODO: implement me
13511362
constant_fold_not_yet_supported: Final = "you", "cant", "fold", "this", "yet"
13521363
z: Final = " ".join(constant_fold_not_yet_supported)

0 commit comments

Comments
 (0)