AA: avoid NPE in compile-time constant evaluator
This commit is contained in:
committed by
Ilya Kirillov
parent
a986aff429
commit
9be6520c96
+1
-1
@@ -60,7 +60,7 @@ internal object FirCompileTimeConstantEvaluator {
|
|||||||
// This is no longer used during FIR2IR where an inner expression is recursively rewritten to ConstExpression if possible.
|
// This is no longer used during FIR2IR where an inner expression is recursively rewritten to ConstExpression if possible.
|
||||||
// Maybe rewrite this to a recursive version with caching either here or in provider.
|
// Maybe rewrite this to a recursive version with caching either here or in provider.
|
||||||
private fun evaluate(functionCall: FirFunctionCall): FirConstExpression<*>? {
|
private fun evaluate(functionCall: FirFunctionCall): FirConstExpression<*>? {
|
||||||
val function = functionCall.getOriginalFunction()!! as? FirSimpleFunction ?: return null
|
val function = functionCall.getOriginalFunction() as? FirSimpleFunction ?: return null
|
||||||
|
|
||||||
val opr1 = functionCall.explicitReceiver as? FirConstExpression<*> ?: return null
|
val opr1 = functionCall.explicitReceiver as? FirConstExpression<*> ?: return null
|
||||||
opr1.evaluate(function)?.let {
|
opr1.evaluate(function)?.let {
|
||||||
|
|||||||
Reference in New Issue
Block a user