PY-36416 Don't wrap return types of overridden async methods in Coroutine twice

(cherry picked from commit 48d01bedeb62d1a232704e58a3f39e3a7d543d2d)

IJ-CR-149694

GitOrigin-RevId: e431744a18f2b9d2976de7ee12888961e22f2298
This commit is contained in:
Mikhail Golubev
2024-11-15 12:30:07 +02:00
committed by intellij-monorepo-bot
parent 40f8f30b67
commit fae8df34f4
2 changed files with 32 additions and 1 deletions

View File

@@ -90,7 +90,9 @@ private fun getReturnTypeFromSupertype(function: PyFunction, context: TypeEvalCo
val superFunctionAnnotation = getReturnTypeAnnotation(overriddenFunction, context)
if (superFunctionAnnotation != null) {
val typeRef = PyTypingTypeProvider.getType(superFunctionAnnotation, context)
typeRef?.let { return Ref.create(PyTypingTypeProvider.toAsyncIfNeeded(function, it.get())) }
if (typeRef != null) {
return typeRef
}
}
}
return null