From f29d7bfb6a995d394a593658c048ba211f2ba490 Mon Sep 17 00:00:00 2001 From: Iaroslav Postovalov Date: Wed, 23 Nov 2022 18:47:09 +0400 Subject: [PATCH] Add a remark on boxing constructor of inline class --- proposals/annotation-to-mark-accessible-api-for-java.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/proposals/annotation-to-mark-accessible-api-for-java.md b/proposals/annotation-to-mark-accessible-api-for-java.md index 06454d55c..716a130b1 100644 --- a/proposals/annotation-to-mark-accessible-api-for-java.md +++ b/proposals/annotation-to-mark-accessible-api-for-java.md @@ -154,6 +154,11 @@ A `JvmExpose` annotation should be added to the constructor of `Example` to achi ExampleKt.f(new Example("42")); ``` +Usually, constructor of the inline class is used to perform boxing of it. +Annotating it with `JvmExpose` will lead to creating a new, +synthetic constructor (with placeholder parameter of type `Void`, probably) for boxing, +enabling the default one for user. + ### Suspending exposed functions Functions that are both `suspend` and annotated with `@JvmExpose` should not take a continuation as normal ones