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

How are equals/hashCode handled for a boxed inline class, and what surprising boxing happens with this == comparison?

@JvmInline value class Wrapped(val x: Int) fun check(): Boolean { val a: Any = Wrapped(5) val b: Any = Wrapped(5) return a == b }