mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
[inspections] PY-85120 Do not consider expressions like a: list[int] | None = None a type alias
Target expression should have either explicit `TypeAlias` annotation or valid type expression in assignment without type annotation (to be considered implicit type alias) (cherry picked from commit 1059a8df2d221bd068eee706139be20c256df549) GitOrigin-RevId: 8c952138fbc4124f02f717ce8a1784c1f0dc86b2
This commit is contained in:
committed by
intellij-monorepo-bot
parent
1b197eb884
commit
489b9b90aa
@@ -3189,6 +3189,16 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
|
||||
""");
|
||||
}
|
||||
|
||||
// PY-85120
|
||||
public void testTargetExpressionWithAnnotationNotConsideredTypeAlias() {
|
||||
doTestByText("""
|
||||
a: list[int] | None = None # Not a type alias
|
||||
|
||||
if a:
|
||||
_ = a[1] # No error expected
|
||||
""");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends PyInspection> getInspectionClass() {
|
||||
|
||||
Reference in New Issue
Block a user