mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-18 09:34:34 +07:00
PY-86002 Adjust PyUnnecessaryCastInspectionTest.test okay expected result
`UnsafeUnion[int | str]` is considered a subtype of `str`, so the cast is redundant. (cherry picked from commit 550a9d55715564492169175c5e20cfbf1ade4b20) IJ-MR-184619 GitOrigin-RevId: 854131d04308bd97b12ef06cc10a4aa89238c9ef
This commit is contained in:
committed by
intellij-monorepo-bot
parent
3a75cb758c
commit
7c1fa29f39
@@ -52,7 +52,7 @@ from typing import cast
|
||||
cast(B, C()) # ok
|
||||
|
||||
a: int | str
|
||||
b = cast(str, a) # ok
|
||||
b = <weak_warning descr="Unnecessary cast; type is already 'str'">cast(str,</weak_warning> a) # ok
|
||||
""".trimIndent()
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user