-
Notifications
You must be signed in to change notification settings - Fork 266
Labels
Description
Describe the Bug
See:
from typing import TypeGuard, reveal_type
def f[T: str](x: T) -> TypeGuard[T]:
return True
def g(x: int | str):
if f(x):
reveal_type(x)
We correctly report a bad-specialization error on f(x), but we do it twice:
ERROR sandbox.py:7:5-8:23: `int | str` is not assignable to upper bound `str` of type variable `T` [bad-specialization]
ERROR sandbox.py:7:9-12: `int | str` is not assignable to upper bound `str` of type variable `T` [bad-specialization]
Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Reactions are currently unavailable