mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
EA-231509: dont use PsiType.NULL as a return type
GitOrigin-RevId: 23f8141f25a7b1ba7779debe97002663c543be31
This commit is contained in:
committed by
intellij-monorepo-bot
parent
897ea7110a
commit
90a476deb1
+4
-1
@@ -146,7 +146,10 @@ private fun findOutputFromReturn(flowOutput: FlowOutput): ExpressionOutput? {
|
||||
val returnExpressions = flowOutput.statements
|
||||
.mapNotNull { statement -> (statement as? PsiReturnStatement)?.returnValue }
|
||||
.sortedBy { returnStatement -> returnStatement.startOffset }
|
||||
val returnType = returnExpressions.asSequence().mapNotNull { expression -> expression.type }.firstOrNull()
|
||||
val returnType = returnExpressions.asSequence()
|
||||
.mapNotNull { expression -> expression.type }
|
||||
.filterNot { type -> type == PsiType.NULL }
|
||||
.firstOrNull()
|
||||
val variableName = returnExpressions.asSequence().map { expression -> guessName(expression) }.firstOrNull() ?: "x"
|
||||
val nullability = CodeFragmentAnalyzer.inferNullability(returnExpressions)
|
||||
return if (returnType != null) ExpressionOutput(returnType, variableName, returnExpressions, nullability) else null
|
||||
|
||||
Reference in New Issue
Block a user