From 699ef5490be82c332a8e5e792a3c32e2858875f0 Mon Sep 17 00:00:00 2001 From: Ilya Chernikov Date: Fri, 19 May 2023 17:26:39 +0200 Subject: [PATCH] Scripting: using kotlin type names instead of java ones avoids problems with K2 resolving of the java types in unexpected places --- .../common/src/kotlin/script/experimental/api/kotlinType.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/scripting/common/src/kotlin/script/experimental/api/kotlinType.kt b/libraries/scripting/common/src/kotlin/script/experimental/api/kotlinType.kt index cae589959aa..2d6aa9be6ea 100644 --- a/libraries/scripting/common/src/kotlin/script/experimental/api/kotlinType.kt +++ b/libraries/scripting/common/src/kotlin/script/experimental/api/kotlinType.kt @@ -29,7 +29,7 @@ class KotlinType private constructor( * Constructs KotlinType from reflected [kclass] */ @JvmOverloads - constructor(kclass: KClass<*>, isNullable: Boolean = false) : this(kclass.java.name, kclass, isNullable) + constructor(kclass: KClass<*>, isNullable: Boolean = false) : this(kclass.qualifiedName ?: error("Cannot use class $kclass as a KotlinType"), kclass, isNullable) // TODO: implement other approach for non-class types /**