mirror of https://github.com/astral-sh/ruff
tests
This commit is contained in:
parent
aaae48af68
commit
a4f5b3522d
|
|
@ -417,16 +417,13 @@ The `converter` function act as a decorator here:
|
|||
def f3(x: int, y: str) -> int:
|
||||
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) | ((x: Divergent, y: Divergent) -> bool)
|
||||
reveal_type(f3) # revealed: (x: int, y: str) -> bool
|
||||
|
||||
reveal_type(f3(1, "a")) # revealed: bool
|
||||
reveal_type(f3(x=1, y="a")) # revealed: bool
|
||||
reveal_type(f3(1, y="a")) # 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`"
|
||||
f3(1)
|
||||
# error: [invalid-argument-type] "Argument is incorrect: Expected `int`, found `Literal["a"]`"
|
||||
|
|
|
|||
Loading…
Reference in New Issue