You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
False bad-specialization when a generic Protocol is used as a bound on a 2-param class inherited across modules #5449
A type parameter bounded by a generic Protocol (F: SupportsSave[Any]) rejects a valid argument
when the class has two type parameters and inherits from a generic base defined in another module.
The error message shows the bound as SupportsSave (no type argument), as if SupportsSave[Any]
lost its argument:
ERROR views.py:16:17-37: `EventForm` is not assignable to upper bound `SupportsSave` of type variable `F` [bad-specialization]
(Empty section; without a config, the basic preset hides the error.)
Narrowing
The error goes away if any of these change:
everything is in a single module;
the classes have a single type parameter;
the bound is a non-generic Protocol.
Using old-style TypeVar(bound=...), a string bound, or SupportsSave[Model] instead of SupportsSave[Any] does not change anything. pyright accepts the code, and so does ty.
Version
pyrefly 1.4.0 (latest release) and main 8003f9b3d (2026-10-29), Python 3.14 (same on 3.15).
Activity