-
Notifications
You must be signed in to change notification settings - Fork 38.7k
Closed
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: bugA general bugA general bug
Milestone
Description
The init
block of the value class
can contain processing.
@JvmInline
value class Value(val value: Int) {
init {
if (100 < value) throw IllegalArgumentException()
}
}
This will be compiled into a method named constructor-impl
in the bytecode.
When instantiating a value class
using Java reflection, both constructor-impl
and box-impl
must be called in order to be equivalent to instantiating it on Kotlin
.
On the other hand, there is no evidence that constructor-impl
is called in the spring-framework
, and only box-impl
seems to be called.
Is this an intentional design?
efemoney
Metadata
Metadata
Assignees
Labels
in: coreIssues in core modules (aop, beans, core, context, expression)Issues in core modules (aop, beans, core, context, expression)theme: kotlinAn issue related to Kotlin supportAn issue related to Kotlin supporttype: bugA general bugA general bug