Skip to content

Renamed deprecated annotation in the doc #2412

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

Merged
merged 1 commit into from
May 30, 2022
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
4 changes: 2 additions & 2 deletions _overviews/scala3-book/interacting-with-java.md
Original file line number Diff line number Diff line change
Expand Up @@ -341,10 +341,10 @@ def +(a: Int, b: Int) = a + b
That method name won’t work well in Java, but what you can do in Scala 3 is provide an “alternate” name for the method---an alias---that will work in Java:

```scala
import scala.annotation.alpha
import scala.annotation.targetName

class Adder:
@alpha("add") def +(a: Int, b: Int) = a + b
@targetName("add") def +(a: Int, b: Int) = a + b
```

Now in your Java code you can use the aliased method name `add`:
Expand Down