Skip to content

Commit 273a90a

Browse files
committed
conformance: check for variance on constraints
1 parent ef75648 commit 273a90a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

conformance/tests/generics_basic.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ def test_concat_subtype(s: str, b: bytes, a: Any, m: MyStr) -> None:
7272
# reveal_type(concat(m, a))
7373
# reveal_type(concat(a, m))
7474

75+
BadConstraint3 = TypeVar("BadConstraint3", str, int, covariant=True) # E: constraints can't have variance
7576

7677
# Specification: https://typing.readthedocs.io/en/latest/spec/generics.html#user-defined-generic-classes
7778

0 commit comments

Comments
 (0)