FIR IDE: make constant evaluator robust to arithmetic exception
This commit is contained in:
committed by
Ilya Kirillov
parent
e5bff514b6
commit
c3c79b874d
+1
-1
@@ -31,4 +31,4 @@ internal class KtFe10CompileTimeConstantProvider(override val analysisSession: K
|
||||
val bindingTrace = DelegatingBindingTrace(bindingContext, "Binding trace for constant expression evaluation")
|
||||
return evaluator.evaluateToConstantValue(expression, bindingTrace, TypeUtils.NO_EXPECTED_TYPE)?.toKtConstantValue()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+2
-1
@@ -229,6 +229,7 @@ internal fun ConstantValue<*>.toKtConstantValue(): KtConstantValue {
|
||||
val arguments = value.allValueArguments.map { (name, v) -> KtNamedConstantValue(name.asString(), v.toKtConstantValue()) }
|
||||
KtAnnotationConstantValue(value.annotationClass?.classId, arguments, null)
|
||||
}
|
||||
is ErrorValue -> KtErrorValue(this.toString())
|
||||
else -> KtUnsupportedConstantValue
|
||||
}
|
||||
}
|
||||
@@ -296,4 +297,4 @@ internal fun DeclarationDescriptor.render(analysisSession: KtFe10AnalysisSession
|
||||
|
||||
internal fun CallableMemberDescriptor.getSymbolPointerSignature(analysisSession: KtFe10AnalysisSession): String {
|
||||
return render(analysisSession, KtDeclarationRendererOptions.DEFAULT)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user