[ty] Improve specialization-error diagnostics (#20326)
## Summary Add information about the upper bound or the constraints of the type variable to the `SpecializationError` diagnostics.
This commit is contained in:
@@ -112,7 +112,7 @@ def _(n: int):
|
||||
# error: [too-many-positional-arguments]
|
||||
# error: [invalid-argument-type] "Argument to function `f2` is incorrect: Expected `str`, found `Literal[3]`"
|
||||
# error: [missing-argument]
|
||||
# error: [invalid-argument-type] "Argument to function `f4` is incorrect: Argument type `Literal[3]` does not satisfy upper bound of type variable `T`"
|
||||
# error: [invalid-argument-type] "Argument to function `f4` is incorrect: Argument type `Literal[3]` does not satisfy upper bound `str` of type variable `T`"
|
||||
# error: [invalid-argument-type] "Argument to function `f5` is incorrect: Expected `str`, found `Literal[3]`"
|
||||
# error: [no-matching-overload] "No overload of function `f6` matches arguments"
|
||||
# error: [call-non-callable] "Object of type `Literal[5]` is not callable"
|
||||
|
||||
Reference in New Issue
Block a user