-
Notifications
You must be signed in to change notification settings - Fork 282
Closed
Labels
Description
Describe the Bug
MInimal repro:
from typing import TypeVar, Generic
T = TypeVar("T", covariant=True)
U = TypeVar("U", contravariant=True)
class Foo(Generic[T, U]):
def bad0(self, x: T) -> None: ...
def bar1(self) -> U: ...Expected: Error saying that covariant T cannot be used on contravariant positions (e.g. toplevel param type), and contravariant U cannot be used on covariant positions (e.g. toplevel return type).
Actual: No error
Sandbox Link
(Only applicable for extension issues) IDE Information
No response
Reactions are currently unavailable