Skip to content

Commit fedc754

Browse files
committed
this gets recursively expanded now
1 parent 9950c12 commit fedc754

File tree

3 files changed

+3
-5
lines changed

3 files changed

+3
-5
lines changed

crates/ty_python_semantic/resources/mdtest/generics/legacy/functions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -385,8 +385,7 @@ def identity(x: T, /) -> T:
385385
def head(xs: list[T], /) -> T:
386386
return xs[0]
387387

388-
# TODO: this should be `Literal[1]`
389-
reveal_type(invoke(identity, 1)) # revealed: Unknown
388+
reveal_type(invoke(identity, 1)) # revealed: Literal[1]
390389

391390
# TODO: this should be `Unknown | int`
392391
reveal_type(invoke(head, [1, 2, 3])) # revealed: Unknown

crates/ty_python_semantic/resources/mdtest/generics/pep695/functions.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,8 +340,7 @@ def identity[T](x: T, /) -> T:
340340
def head[T](xs: list[T], /) -> T:
341341
return xs[0]
342342

343-
# TODO: this should be `Literal[1]`
344-
reveal_type(invoke(identity, 1)) # revealed: Unknown
343+
reveal_type(invoke(identity, 1)) # revealed: Literal[1]
345344

346345
# TODO: this should be `Unknown | int`
347346
reveal_type(invoke(head, [1, 2, 3])) # revealed: Unknown

crates/ty_python_semantic/resources/mdtest/literal_promotion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ x11: list[Literal[1] | Literal[2] | Literal[3]] = [1, 2, 3]
304304
reveal_type(x11) # revealed: list[Literal[1, 2, 3]]
305305

306306
x12: Y[Y[Literal[1]]] = [[1]]
307-
reveal_type(x12) # revealed: list[Y[Literal[1]]]
307+
reveal_type(x12) # revealed: list[list[Literal[1]]]
308308

309309
x13: list[tuple[Literal[1], Literal[2], Literal[3]]] = [(1, 2, 3)]
310310
reveal_type(x13) # revealed: list[tuple[Literal[1], Literal[2], Literal[3]]]

0 commit comments

Comments
 (0)