FIR IDE: make constant evaluator robust to arithmetic exception
This commit is contained in:
committed by
Ilya Kirillov
parent
e5bff514b6
commit
c3c79b874d
+11
@@ -29,6 +29,17 @@ import org.jetbrains.kotlin.types.ConstantValueKind
|
||||
public sealed class KtConstantValue(
|
||||
public open val sourcePsi: KtElement? = null
|
||||
)
|
||||
|
||||
/**
|
||||
* This represents an error during expression evaluation or constant conversion.
|
||||
*/
|
||||
public class KtErrorValue(
|
||||
public val message: String
|
||||
) : KtConstantValue()
|
||||
|
||||
/**
|
||||
* This represents an unsupported expression used as an annotation value.
|
||||
*/
|
||||
public object KtUnsupportedConstantValue : KtConstantValue()
|
||||
|
||||
public class KtArrayConstantValue(
|
||||
|
||||
Vendored
+1
@@ -0,0 +1 @@
|
||||
val p = <expr>42 / 0</expr>
|
||||
Vendored
+3
@@ -0,0 +1,3 @@
|
||||
expression: 42 / 0
|
||||
constant_value: KtErrorValue(/ by zero)
|
||||
constant: null
|
||||
Reference in New Issue
Block a user