mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-81679 reword inspection about too many unpacked tuples
(cherry picked from commit 4b13744dd7b9e7969f08042cf9eb662ad8899dd2) IJ-MR-164905 GitOrigin-RevId: 31114c8ef89f7a058ba88da410eba8dbcb77db9d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
a67b146160
commit
997750ddad
@@ -1209,7 +1209,7 @@ INSP.type.hints.expected.a.type=Expected a type
|
||||
INSP.type.hints.metaclass.cannot.be.generic=Metaclass cannot be generic
|
||||
INSP.type.hints.unbound.type.variable=Unbound type variable
|
||||
INSP.type.hints.some.type.variables.are.used.by.an.outer.scope=Some type variables ({0}) are used by an outer scope
|
||||
INSP.type.hints.at.most.one.unpacked.tuple=Type argument list can have at most one unpacked TypeVarTuple or tuple
|
||||
INSP.type.hints.at.most.one.unpacked.tuple=Type argument list can have at most one unpacked TypeVarTuple or unbounded tuple
|
||||
INSP.type.hints.cannot.use.covariant.in.function.param=Covariant type variable cannot be used in parameter type
|
||||
INSP.type.hints.cannot.use.contravariant.in.return.type=Contravariant type variable cannot be used in function return type
|
||||
QFIX.remove.function.annotations=Remove function annotations
|
||||
|
||||
@@ -2816,10 +2816,10 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
|
||||
doTestByText("""
|
||||
from typing import TypeVarTuple, Unpack
|
||||
|
||||
t1: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or tuple">tuple[*tuple[str, ...], *tuple[int, ...]]</warning>
|
||||
t2: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or tuple">tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]]</warning>
|
||||
t3: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or tuple">tuple[Unpack[tuple[str, ...]], Unpack[tuple[int, ...]]]</warning>
|
||||
t4: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or tuple">tuple[Unpack[tuple[str, Unpack[tuple[str, ...]]]], Unpack[tuple[int, ...]]]</warning>
|
||||
t1: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or unbounded tuple">tuple[*tuple[str, ...], *tuple[int, ...]]</warning>
|
||||
t2: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or unbounded tuple">tuple[*tuple[str, *tuple[str, ...]], *tuple[int, ...]]</warning>
|
||||
t3: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or unbounded tuple">tuple[Unpack[tuple[str, ...]], Unpack[tuple[int, ...]]]</warning>
|
||||
t4: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or unbounded tuple">tuple[Unpack[tuple[str, Unpack[tuple[str, ...]]]], Unpack[tuple[int, ...]]]</warning>
|
||||
|
||||
# > An unpacked TypeVarTuple counts as an unbounded tuple in the context of this rule
|
||||
|
||||
@@ -2828,7 +2828,7 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
|
||||
|
||||
def func(t: tuple[*Ts]):
|
||||
t5: tuple[*tuple[str], *Ts]
|
||||
t6: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or tuple">tuple[*tuple[str, ...], *Ts]</warning>
|
||||
t6: <warning descr="Type argument list can have at most one unpacked TypeVarTuple or unbounded tuple">tuple[*tuple[str, ...], *Ts]</warning>
|
||||
""");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user