From 103bca28974bdfe1fc6457addf5bfe644d57d547 Mon Sep 17 00:00:00 2001 From: Nicolas Stucki Date: Tue, 9 Jan 2024 15:07:16 +0100 Subject: [PATCH] Change overriding rules for `@publicInBinary` * Change suggestion https://github.com/lampepfl/dotty/pull/18402#discussion_r1424551306 * Changed in https://github.com/lampepfl/dotty/commit/eae8831353262964c559c0a27267778ea89b6496 --- content/binary-api.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/content/binary-api.md b/content/binary-api.md index e92355f..8997304 100644 --- a/content/binary-api.md +++ b/content/binary-api.md @@ -15,6 +15,7 @@ title: SIP-52 - Binary APIs | Feb 27 2023 | Initial Draft | | Aug 16 2023 | Single Annotation | | Aug 24 2023 | Change Annotation Name | +| Jan 09 2024 | Change Overload Rules | ## Summary @@ -73,7 +74,7 @@ This proposal introduces the `@publicInBinary` annotation, and adds a migration #### `@publicInBinary` annotation -A binary API is a definition that is annotated with `@publicInBinary` or overrides a definition annotated with `@publicInBinary`. +A binary API is a definition that is annotated with `@publicInBinary`. This annotation can be placed on `def`, `val`, `lazy val`, `var`, `object`, and `given` definitions. A binary API will be publicly available in the bytecode. @@ -222,6 +223,7 @@ final class publicInBinary extends scala.annotation.StaticAnnotation #### `@publicInBinary` annotation * Only valid on `def`, `val`, `lazy val`, `var`, `object`, and `given`. +* If a definition overrides a `@publicInBinary` definition, it must also be annotated with `@publicInBinary`. * TASTy will contain references to non-public definitions that are out of scope but `@publicInBinary`. TASTy already allows those references. * The annotated definitions will be public in the generated bytecode. Definitions should be made public as early as possible in the compiler phases, as this can remove the need to create other accessors. It should be done after we check the accessibility of references.