Skip to content

Commit

Permalink
Change overriding rules for @publicInBinary
Browse files Browse the repository at this point in the history
* Change suggestion scala/scala3#18402 (comment)
* Changed in scala/scala3@eae8831
  • Loading branch information
nicolasstucki authored and odersky committed Jul 15, 2024
1 parent ab1a0a8 commit 103bca2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion content/binary-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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.

Expand Down

0 comments on commit 103bca2

Please sign in to comment.