Skip to content

Commit f29d7bf

Browse files
author
Iaroslav Postovalov
committed
Add a remark on boxing constructor of inline class
1 parent 481e122 commit f29d7bf

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Diff for: proposals/annotation-to-mark-accessible-api-for-java.md

+5
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,11 @@ A `JvmExpose` annotation should be added to the constructor of `Example` to achi
154154
ExampleKt.f(new Example("42"));
155155
```
156156

157+
Usually, constructor of the inline class is used to perform boxing of it.
158+
Annotating it with `JvmExpose` will lead to creating a new,
159+
synthetic constructor (with placeholder parameter of type `Void`, probably) for boxing,
160+
enabling the default one for user.
161+
157162
### Suspending exposed functions
158163

159164
Functions that are both `suspend` and annotated with `@JvmExpose` should not take a continuation as normal ones

0 commit comments

Comments
 (0)