Skip to content

Kotlin ValueBoxing breaks entity instantiator for data classes that has generic field  #2986

Closed
@ajax-kanarik-v

Description

@ajax-kanarik-v

As for now, there is check for generic type if it's generic value class field, and that's working normally

nestedType.getClassifier() instanceof KTypeParameter ktp

but it fails with class cast exception when this constructor is being invoked with the KType parameter

private ValueBoxing(BoxingRules rules, KParameter parameter) {
    this(rules, parameter.getType(), (KClass<?>) parameter.getType().getClassifier(), parameter.isOptional());
}

Example data class :

data class Foo<T>{val bar: T? = null)

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions