Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlinvalue class codegenSingle-choice MCQ

What does Kotlin generate for an `init` block in a value class, and when does that code run relative to the unboxed representation?

@JvmInline value class Percent(val v: Int) { init { require(v in 0..100) } } fun make(x: Int): Percent = Percent(x) // passes x straight through?