Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Julien Richard-Foy <[email protected]>
  • Loading branch information
nicolasstucki and julienrf committed May 11, 2023
1 parent 2857ccd commit eb57925
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions content/binary-api.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Currently, the compiler automatically generates accessors for references to priv
* Changing the implementation of an inline definition can be a binary incompatible change
* Removing final from a class is a binary incompatible change

You can find more details in https://github.com/lampepfl/dotty/issues/16983
You can find more details in [https://github.com/lampepfl/dotty/issues/16983](https://github.com/lampepfl/dotty/issues/16983)

### Avoid duplication of inline accessors

Expand All @@ -44,7 +44,7 @@ There is no precise mechanism to remove a deprecated method from a library witho
+ private[C] def myOldAPI: T = ...
```

Related to discussion in https://github.com/lightbend/mima/discussions/724
Related to discussion in [https://github.com/lightbend/mima/discussions/724](https://github.com/lightbend/mima/discussions/724).

### No way to inline reference to private constructors

Expand All @@ -54,7 +54,7 @@ It is currently impossible to refer to private constructors in inline methods. I

### High-level overview

This proposal introduces 2 the `@binaryAPI` and `@binaryAPIAccessor` annotations, and changes adds a migration path to inline methods.
This proposal introduces 2 the `@binaryAPI` and `@binaryAPIAccessor` annotations, and adds a migration path to inline methods.

#### `@binaryAPI` annotation

Expand Down Expand Up @@ -165,13 +165,13 @@ final class binaryAPIAccessor extends scala.annotation.StaticAnnotation

* Only valid on `def`, `val`, `lazy val`, `var`, `object`, and `given`.
* TASTy will contain references to non-public definitions that are out of scope but `@binaryAPI`. TASTy already allows those references.
* Annotated definition 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.
* 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.


#### `@binaryAPIAccessor` annotation

* Only valid on `def`, `val`, `lazy val`, `var`, `object`, and `given`.
* An public accessor will be generated for the annotated definition. This accessor will be named `<fullClassName>$$inline$<definitionName>`.
* A public accessor will be generated for the annotated definition. This accessor will be named `<fullClassName>$$inline$<definitionName>`.

#### Inline

Expand Down Expand Up @@ -221,7 +221,7 @@ This would simplify the system and the user interaction with this feature. The d

## Related work

* Proof of concept: https://github.com/lampepfl/dotty/pull/16992
* Initial discussions: https://github.com/lampepfl/dotty/issues/16983
* Proof of concept: [https://github.com/lampepfl/dotty/pull/16992](https://github.com/lampepfl/dotty/pull/16992)
* Initial discussions: [https://github.com/lampepfl/dotty/issues/16983](https://github.com/lampepfl/dotty/issues/16983)

<!-- ## FAQ -->

0 comments on commit eb57925

Please sign in to comment.