mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-14 18:05:27 +07:00
Instead, parse them as usual and later report in the dedicated AssignTargetAnnotator and TypeAnnotationTargetAnnotator. This way, a PsiError element appearing in the PSI tree of a type declaration statement doesn't cause PyAstTypeDeclarationStatement.getTarget nullability contract violation. GitOrigin-RevId: a3e90088cfac7938c398d4d293a72dbd127a2cd0
14 lines
885 B
Python
14 lines
885 B
Python
(x): int = 42
|
|
(((x))): float
|
|
x['foo']: str
|
|
f(42).attr: dict
|
|
|
|
<error descr="An illegal target for a variable annotation">2 ** 8</error>: int
|
|
<error descr="An illegal target for a variable annotation">f()</error>: bool
|
|
async def f():
|
|
<error descr="An illegal target for a variable annotation">await foo()</error>: int
|
|
<error descr="A variable annotation cannot be combined with tuple unpacking">x, y, z</error>: Tuple[int, ...]
|
|
(<error descr="A variable annotation cannot be combined with tuple unpacking">x, y, z</error>): Tuple[int, int, int]
|
|
<error descr="A variable annotation cannot be combined with tuple unpacking">[x, y, z]</error>: Tuple[Any, Any, Any]
|
|
<error descr="A variable annotation cannot be combined with tuple unpacking">x, *xs</error>: tuple = range(10)
|
|
<error descr="A variable annotation cannot be used in assignment with multiple targets">x:int = y = 42</error> |