PY-87796 UI Texts: Fix typos and grammar mistakes (Feb 2026)

(cherry picked from commit 8996fec06c52cda4d28cd5176ba1d97a7036639b)

GitOrigin-RevId: 3bc91b31ef8ecea7cd57b67c7298ed815f9a9116
This commit is contained in:
Tatiana Ber
2026-02-25 12:27:16 +01:00
committed by intellij-monorepo-bot
parent d019776e5f
commit d99b42eef2
3 changed files with 6 additions and 6 deletions

View File

@@ -8,7 +8,7 @@
from typing import TypeVar, Generic
T = TypeVar("T", covariant=True)
class C(Generic[T]):
def method(self, t: T): # at 'T': Incompatible variance: expected contravariant but was covariant
def method(self, t: T): # at 'T': A covariant type variable cannot be used in this contravariant position
pass
</code></pre>

View File

@@ -1269,7 +1269,7 @@ QFIX.NAME.unpack.type.var.tuple=Unpack the TypeVarTuple
# PyVarianceInspection
INSP.NAME.variance.checker=Incorrect variance
INSP.variance.checker.incompatible=Incompatible variance: expected {0} but was {1}
INSP.variance.checker.incompatible=A {1} type variable cannot be used in this {0} position
INSP.variance.checker.superfluous=Superfluous variance since the given constraints have no subtype relation
# PyInspectionsSuppressor

View File

@@ -80,7 +80,7 @@ internal class PyVarianceTest : PyTestCase() {
class Foo(Generic[T_co]):
def __init__(self, x: T_co) -> None: ... # allowed in __init__
def do_smth(self, x: <warning descr="Incompatible variance: expected contravariant but was covariant">T_co</warning>) -> None: ...
def do_smth(self, x: <warning descr="A covariant type variable cannot be used in this contravariant position">T_co</warning>) -> None: ...
""")
}
@@ -109,7 +109,7 @@ internal class PyVarianceTest : PyTestCase() {
def foo(x: T_contra) -> T_contra: ...
class Foo(Generic[T_contra]):
def do_smth(self, x: T_contra) -> <warning descr="Incompatible variance: expected covariant but was contravariant">T_contra</warning>: ...
def do_smth(self, x: T_contra) -> <warning descr="A contravariant type variable cannot be used in this covariant position">T_contra</warning>: ...
""")
}
@@ -122,7 +122,7 @@ internal class PyVarianceTest : PyTestCase() {
class Inv(Generic[T]):
...
class Class1(Inv[<warning descr="Incompatible variance: expected invariant but was covariant">T_co</warning>]):
class Class1(Inv[<warning descr="A covariant type variable cannot be used in this invariant position">T_co</warning>]):
pass
inv = Inv[T_co]() # there should be no issue about incompatible variance here
@@ -150,7 +150,7 @@ internal class PyVarianceTest : PyTestCase() {
def __init__(self, x: T_contra):
pass
def foo(self, x) -> <warning descr="Incompatible variance: expected covariant but was contravariant">T_contra</warning>: # False-negative
def foo(self, x) -> <warning descr="A contravariant type variable cannot be used in this covariant position">T_contra</warning>: # False-negative
pass
""")
}