mirror of
https://gitflic.ru/project/openide/openide.git
synced 2025-12-13 15:52:01 +07:00
PY-81941 Make CallInstruction.isNoReturnCall non-recursive
(cherry picked from commit 4c9c1e2c6a42b6632d84667a31fb4f46936405b3) GitOrigin-RevId: aa5d89a12fbb6f0bdda6c78b53123f6fcae5785d
This commit is contained in:
committed by
intellij-monorepo-bot
parent
b274df9909
commit
f18ba33412
@@ -17,10 +17,14 @@ class CallInstruction(builder: ControlFlowBuilder, call: PyCallExpression) : Ins
|
||||
val callees = element.multiResolveCalleeFunction(PyResolveContext.defaultContext(context))
|
||||
if (callees.size == 1) {
|
||||
val pyFunction = callees.single()
|
||||
if (pyFunction is PyFunction) {
|
||||
if (pyFunction is PyFunction && hasReturnTypeAnnotation(pyFunction)) {
|
||||
return context.getReturnType(pyFunction) is PyNeverType
|
||||
}
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
private fun hasReturnTypeAnnotation(function: PyFunction): Boolean {
|
||||
return function.annotation != null || function.typeCommentAnnotation != null
|
||||
}
|
||||
Reference in New Issue
Block a user