Fix "kotlin.TypeCastException has no message on Native"

#KT-35544 Fixed

Merge-request: KT-MR-6392
Merged-by: Vladimir Sukharev <Vladimir.Sukharev@jetbrains.com>
This commit is contained in:
Vladimir Sukharev
2022-06-03 07:40:26 +00:00
committed by Space
parent 6fc27c22f4
commit eabf6dac7f
3 changed files with 13 additions and 3 deletions
@@ -32,8 +32,8 @@ fun ThrowClassCastException(instance: Any, typeInfo: NativePtr): Nothing {
}
@ExportForCppRuntime
fun ThrowTypeCastException(): Nothing {
throw TypeCastException()
fun ThrowTypeCastException(instance: Any, typeName: String): Nothing {
throw TypeCastException("${instance::class} cannot be cast to class $typeName")
}
@ExportForCppRuntime