This commit is contained in:
Douglas Creager 2025-12-10 16:38:53 -05:00
parent aaae48af68
commit a4f5b3522d
1 changed files with 1 additions and 4 deletions

View File

@ -417,16 +417,13 @@ The `converter` function act as a decorator here:
def f3(x: int, y: str) -> int: def f3(x: int, y: str) -> int:
return 1 return 1
# TODO: This should reveal `(x: int, y: str) -> bool` but there's a cycle: https://github.com/astral-sh/ty/issues/1729 reveal_type(f3) # revealed: (x: int, y: str) -> bool
reveal_type(f3) # revealed: ((x: int, y: str) -> bool) | ((x: Divergent, y: Divergent) -> bool)
reveal_type(f3(1, "a")) # revealed: bool reveal_type(f3(1, "a")) # revealed: bool
reveal_type(f3(x=1, y="a")) # revealed: bool reveal_type(f3(x=1, y="a")) # revealed: bool
reveal_type(f3(1, y="a")) # revealed: bool reveal_type(f3(1, y="a")) # revealed: bool
reveal_type(f3(y="a", x=1)) # revealed: bool reveal_type(f3(y="a", x=1)) # revealed: bool
# TODO: There should only be one error but the type of `f3` is a union: https://github.com/astral-sh/ty/issues/1729
# error: [missing-argument] "No argument provided for required parameter `y`"
# error: [missing-argument] "No argument provided for required parameter `y`" # error: [missing-argument] "No argument provided for required parameter `y`"
f3(1) f3(1)
# error: [invalid-argument-type] "Argument is incorrect: Expected `int`, found `Literal["a"]`" # error: [invalid-argument-type] "Argument is incorrect: Expected `int`, found `Literal["a"]`"