From 79da3c7d839af42b9f3c9965acf3821dd0e8d9b1 Mon Sep 17 00:00:00 2001 From: Alejandro Serrano Date: Mon, 7 Jul 2025 09:43:52 +0200 Subject: [PATCH] Fixes to "Expose boxed inline value classes in JVM" --- proposals/jvm-expose-boxed.md | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/proposals/jvm-expose-boxed.md b/proposals/jvm-expose-boxed.md index 5be0581da..e44edf304 100644 --- a/proposals/jvm-expose-boxed.md +++ b/proposals/jvm-expose-boxed.md @@ -119,18 +119,16 @@ The consequence of the rules above is that if we annotate a class, ```kotlin @JvmExposeBoxed @JvmInline value class PositiveInt(val number: Int) { fun add(other: PositiveInt): PositiveInt = ... - fun toInt(): Int = number } ``` -this is equivalent to annotating the constructor and the `add` member, leaving `toInt` without annotation as no boxed variant exists, +this is equivalent to annotating the constructor and both members, ```kotlin @JvmInline value class PositiveInt @JvmExposeBoxed constructor (val number: Int) { @JvmExposeBoxed fun add(other: PositiveInt): PositiveInt = ... - - fun toInt(): Int = number + @JvmExposeBoxed fun toInt(): Int = number } ```