mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-19 21:11:28 +07:00
PY-80248 Fix: Reference to type alias statement reported as invalid type hint
GitOrigin-RevId: 72c3631559622e278a23fa9d827ceef1667001cb
This commit is contained in:
committed by
intellij-monorepo-bot
parent
6872f28d2e
commit
aa84f6f92d
@@ -1553,7 +1553,7 @@ class PyTypeHintsInspection : PyInspection() {
|
||||
return type is PyTypingNewType || type is PyTypedDictType
|
||||
}
|
||||
}
|
||||
is PyTypeParameter, is PyClass -> true
|
||||
is PyTypeParameter, is PyClass, is PyTypeAliasStatement -> true
|
||||
is PyFunction -> resolvedElement.qualifiedName?.let {
|
||||
it.endsWith("ParamSpec.args") || it.endsWith("ParamSpec.kwargs")
|
||||
} == true
|
||||
|
||||
@@ -2563,6 +2563,15 @@ public class PyTypeHintsInspectionTest extends PyInspectionTestCase {
|
||||
""");
|
||||
}
|
||||
|
||||
// PY-80248
|
||||
public void testReferenceToTypeStatementIsValidTypeHint() {
|
||||
doTestByText("""
|
||||
type my_type = str
|
||||
|
||||
def func1(x: my_type) -> str: ...
|
||||
""");
|
||||
}
|
||||
|
||||
@NotNull
|
||||
@Override
|
||||
protected Class<? extends PyInspection> getInspectionClass() {
|
||||
|
||||
Reference in New Issue
Block a user