From b6af0c5f26506b1618f3e352e5fbc3188bacefa5 Mon Sep 17 00:00:00 2001 From: Jolan Rensen Date: Mon, 16 Sep 2024 11:55:59 +0200 Subject: [PATCH] added special check for function types in debug mode --- .../kotlinx/dataframe/impl/columns/DataColumnImpl.kt | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt index eac43db02b..cdc6eaae77 100644 --- a/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt +++ b/core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt @@ -9,6 +9,8 @@ import org.jetbrains.kotlinx.dataframe.kind import kotlin.reflect.KClass import kotlin.reflect.KType import kotlin.reflect.full.isSubclassOf +import kotlin.reflect.full.isSubtypeOf +import kotlin.reflect.typeOf internal abstract class DataColumnImpl( protected val values: List, @@ -22,6 +24,9 @@ internal abstract class DataColumnImpl( when { this == null -> type.isMarkedNullable + // special case since functions are often stored as a $$Lambda$... class, the subClassOf check would fail + this is Function<*> && type.isSubtypeOf(typeOf?>()) -> true + this.isPrimitiveArray -> type.isPrimitiveArray && this!!::class.qualifiedName == type.classifier?.let { (it as KClass<*>).qualifiedName }