[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:
Daniil Kalinin
2025-11-03 10:33:56 +00:00
committed by intellij-monorepo-bot
parent 1b197eb884
commit 489b9b90aa
4 changed files with 15 additions and 2 deletions
+3
View File
@@ -22,6 +22,9 @@ bin3_ok = Union[str, bool] | None
bin4_notOk = str & int
list_notOk = [int, str]
bin5_notOk: int | str = "foo"
list_none_notOk: list[int] | None = None
callable_ok = Callable[[int, str], bool]
explicit_alias1_ok: TypeAlias = 'Foo is bar.'