Skip to content

Commit e60fb08

Browse files
committed
Fixes to "Expose boxed inline value classes in JVM"
1 parent cd586ae commit e60fb08

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

proposals/KEEP-0394-jvm-expose-boxed.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,18 +119,16 @@ The consequence of the rules above is that if we annotate a class,
119119
```kotlin
120120
@JvmExposeBoxed @JvmInline value class PositiveInt(val number: Int) {
121121
fun add(other: PositiveInt): PositiveInt = ...
122-
123122
fun toInt(): Int = number
124123
}
125124
```
126125

127-
this is equivalent to annotating the constructor and the `add` member, leaving `toInt` without annotation as no boxed variant exists,
126+
this is equivalent to annotating the constructor and both members,
128127

129128
```kotlin
130129
@JvmInline value class PositiveInt @JvmExposeBoxed constructor (val number: Int) {
131130
@JvmExposeBoxed fun add(other: PositiveInt): PositiveInt = ...
132-
133-
fun toInt(): Int = number
131+
@JvmExposeBoxed fun toInt(): Int = number
134132
}
135133
```
136134

0 commit comments

Comments
 (0)