Add Throwable class into interpreter builtins map

Methods of Throwable class doesn't have bodies using FIR, so they must
be handled as builtins
This commit is contained in:
Ivan Kylchik
2021-05-19 13:19:03 +03:00
committed by TeamCityServer
parent 8234c9cec1
commit e5617ede7e
2 changed files with 9 additions and 1 deletions
@@ -165,6 +165,12 @@ internal fun interpretUnaryFunction(name: String, type: String, a: Any?): Any? {
"String" -> return (a as String).length
"CharSequence" -> return (a as CharSequence).length
}
"cause" -> when (type) {
"Throwable" -> return (a as Throwable).cause
}
"message" -> when (type) {
"Throwable" -> return (a as Throwable).message
}
"size" -> when (type) {
"BooleanArray" -> return (a as BooleanArray).size
"CharArray" -> return (a as CharArray).size