Skip to main content
Journey Uncommon Logo
JourneyUncommon
hardKotlininline class boxing rulesSingle-choice MCQ

Two inline classes wrap the same primitive. What does Kotlin generate to keep their public functions distinct on the JVM despite type erasure of the value parameter?

@JvmInline value class Meters(val v: Double) @JvmInline value class Feet(val v: Double) fun scale(m: Meters): Meters = Meters(m.v * 2) fun scale(f: Feet): Feet = Feet(f.v * 2)