Error merging non-generic and generic Protocol classes #1101
Labels
bug
Something isn't working
fixed in next version (main)
A fix has been implemented and will appear in an upcoming version
Environment data
Actual behaviour
Defining the merge of a generic Protocol (such as Iterable[T]) and a non-generic Protocol (such as Sized) makes Pylance end with a cryptic error
Error: Debug Failure. False expression.
raised fromcanAssignProtocolClassToSelf
.The following example is from PEP-544:
The same happens if I make T covariant instead, or if I replace
Protocol
withProtocol[T]
orProtocol, Generic[T]
.In fact already the following fails:
Logs
The text was updated successfully, but these errors were encountered: