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

An inline class (value class) `@JvmInline value class UserId(val raw: Long)` is sometimes represented as a plain `long` and sometimes boxed. Which of these forces boxing at the JVM level?

@JvmInline value class UserId(val raw: Long) fun direct(id: UserId) {} // (A) fun <T> generic(value: T) {} // (B) val list: List<UserId> = listOf(UserId(1)) // (C) val n: UserId? = UserId(1) // (D)