Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update SIP-52 #71

Merged
merged 2 commits into from
Jan 16, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions content/binary-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ title: SIP-52 - Binary APIs

| Date | Version |
|---------------|------------------------|
| Feb 27 2022 | Initial Draft |
| Aug 16 2022 | Single Annotation |
| Aug 24 2022 | Change Annotation Name |
| 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