Skip to content

Commit fee0ab1

Browse files
authored
Rename KClass<*>.isInterface helper in the JS part (#3027)
We are going to introduce a new KClass member in the standard library with the same name marked with an opt-in annotation, so in the usages of this extension property would stop compiling because the member is always favored and there is no opt-in. See KT-78581
1 parent 13a487c commit fee0ab1

File tree

1 file changed

+4
-2
lines changed
  • core/jsMain/src/kotlinx/serialization/internal

1 file changed

+4
-2
lines changed

core/jsMain/src/kotlinx/serialization/internal/Platform.kt

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ internal actual fun <T : Any> KClass<T>.compiledSerializerImpl(): KSerializer<T>
2626
else this.js.asDynamic().Companion?.serializer()
2727
) as? KSerializer<T>
2828

29-
internal actual fun <T: Any> KClass<T>.isInterface(): Boolean = isInterface
29+
internal actual fun <T: Any> KClass<T>.isInterface(): Boolean = isInterfaceHack
3030

3131
internal actual fun <T> createCache(factory: (KClass<*>) -> KSerializer<T>?): SerializerCache<T> {
3232
return object: SerializerCache<T> {
@@ -73,8 +73,10 @@ internal actual fun isReferenceArray(rootClass: KClass<Any>): Boolean = rootClas
7373
* WARNING: may be broken in arbitrary time in the future without notice
7474
*
7575
* Should be eventually replaced with compiler intrinsics
76+
*
77+
* TODO: Remove this when KT-78581 lands into a 2.2.20 release
7678
*/
77-
private val KClass<*>.isInterface: Boolean
79+
private val KClass<*>.isInterfaceHack: Boolean
7880
get(): Boolean {
7981
// .js throws an exception for Nothing
8082
if (this === Nothing::class) return false

0 commit comments

Comments
 (0)