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

Given an inline (value) class wrapping a reference type, under which of these usages does the Kotlin compiler emit code that does NOT box the underlying value?

@JvmInline value class Name(val raw: String) fun greet(n: Name): String = n.raw // (A) fun pick(n: Name?): String? = n?.raw // (B) val list: List<Name> = listOf(Name("x")) // (C) fun <T> identity(t: T): T = t // identity(Name("x")) (D)