Skip to content

Commit ac652db

Browse files
authored
Merge pull request #863 from Kotlin/debug-mode-function-type-fix
Added special check for function types in debug mode
2 parents f9df185 + b6af0c5 commit ac652db

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

core/src/main/kotlin/org/jetbrains/kotlinx/dataframe/impl/columns/DataColumnImpl.kt

+5
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ import org.jetbrains.kotlinx.dataframe.kind
99
import kotlin.reflect.KClass
1010
import kotlin.reflect.KType
1111
import kotlin.reflect.full.isSubclassOf
12+
import kotlin.reflect.full.isSubtypeOf
13+
import kotlin.reflect.typeOf
1214

1315
internal abstract class DataColumnImpl<T>(
1416
protected val values: List<T>,
@@ -22,6 +24,9 @@ internal abstract class DataColumnImpl<T>(
2224
when {
2325
this == null -> type.isMarkedNullable
2426

27+
// special case since functions are often stored as a $$Lambda$... class, the subClassOf check would fail
28+
this is Function<*> && type.isSubtypeOf(typeOf<Function<*>?>()) -> true
29+
2530
this.isPrimitiveArray ->
2631
type.isPrimitiveArray &&
2732
this!!::class.qualifiedName == type.classifier?.let { (it as KClass<*>).qualifiedName }

0 commit comments

Comments
 (0)