Fix KT-22752 (#1958)

This commit is contained in:
Sergey Bogolepov
2018-08-29 13:57:06 +03:00
committed by GitHub
parent 38d47df3aa
commit 96b6645f2e
+4 -1
View File
@@ -19,6 +19,7 @@
#include "KString.h"
#include "Porting.h"
#include "Types.h"
#include "Exceptions.h"
#include "utf8.h"
@@ -26,7 +27,9 @@ extern "C" {
// io/Console.kt
void Kotlin_io_Console_print(KString message) {
RuntimeAssert(message->type_info() == theStringTypeInfo, "Must use a string");
if (message->type_info() != theStringTypeInfo) {
ThrowClassCastException(message->obj(), theStringTypeInfo);
}
// TODO: system stdout must be aware about UTF-8.
const KChar* utf16 = CharArrayAddressOfElementAt(message, 0);
KStdString utf8;