diff --git a/crates/ty_python_semantic/resources/mdtest/call/replace.md b/crates/ty_python_semantic/resources/mdtest/call/replace.md index a5e5390b97..b0112c1129 100644 --- a/crates/ty_python_semantic/resources/mdtest/call/replace.md +++ b/crates/ty_python_semantic/resources/mdtest/call/replace.md @@ -17,8 +17,7 @@ from datetime import time t = time(12, 0, 0) t = replace(t, minute=30) -# TODO: this should be `time`, once we support specialization of generic protocols -reveal_type(t) # revealed: Unknown +reveal_type(t) # revealed: time ``` ## The `__replace__` protocol @@ -48,8 +47,7 @@ b = a.__replace__(x=3, y=4) reveal_type(b) # revealed: Point b = replace(a, x=3, y=4) -# TODO: this should be `Point`, once we support specialization of generic protocols -reveal_type(b) # revealed: Unknown +reveal_type(b) # revealed: Point ``` A call to `replace` does not require all keyword arguments: @@ -59,8 +57,7 @@ c = a.__replace__(y=4) reveal_type(c) # revealed: Point d = replace(a, y=4) -# TODO: this should be `Point`, once we support specialization of generic protocols -reveal_type(d) # revealed: Unknown +reveal_type(d) # revealed: Point ``` Invalid calls to `__replace__` or `replace` will raise an error: diff --git a/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md b/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md index 60bfd36176..8607acd426 100644 --- a/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md +++ b/crates/ty_python_semantic/resources/mdtest/dataclasses/dataclasses.md @@ -1152,6 +1152,8 @@ d_int = DataWithDescription[int](1, "description") # OK reveal_type(d_int.data) # revealed: int reveal_type(d_int.description) # revealed: str +# TODO: only one error +# error: [invalid-argument-type] # error: [invalid-argument-type] DataWithDescription[int](None, "description") ``` diff --git a/crates/ty_python_semantic/resources/mdtest/type_compendium/tuple.md b/crates/ty_python_semantic/resources/mdtest/type_compendium/tuple.md index e323d25a17..baad42780f 100644 --- a/crates/ty_python_semantic/resources/mdtest/type_compendium/tuple.md +++ b/crates/ty_python_semantic/resources/mdtest/type_compendium/tuple.md @@ -57,6 +57,8 @@ reveal_type(tuple((1, 2))) # revealed: tuple[Literal[1], Literal[2]] reveal_type(tuple([1])) # revealed: tuple[Unknown | int, ...] +# TODO: one error +# error: [invalid-argument-type] # error: [invalid-argument-type] reveal_type(tuple[int]([1])) # revealed: tuple[int]