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

Two inline classes `A` and `B` each wrap a non-null `Int`, and there are two functions `f(A)` and `f(B)`. After compilation both erase to taking a raw `int`. What prevents an illegal duplicate-method clash on the JVM?

@JvmInline value class A(val x: Int) @JvmInline value class B(val x: Int) fun f(a: A) {} fun f(b: B) {}