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

Given this inline (value) class, at which of the following call sites does the underlying String get boxed into the wrapper type at runtime?

@JvmInline value class Name(val s: String) fun greet(n: Name) = "hi ${n.s}" fun <T> identity(x: T): T = x val n = Name("a") greet(n) // (A) identity(n) // (B) val list = listOf(n) // (C) val direct: Name = n // (D)