Skip to content

Introduce @forceInline annotation #4755

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
Jul 5, 2018
Merged

Conversation

allanrenucci
Copy link
Contributor

An annotation on methods that is equivalent to Dotty inline modifier.
The annotation should be used instead of the inline modifier in code
that needs to cross compile between Scala 2 and Dotty.

Fix #4737

@smarter
Copy link
Member

smarter commented Jul 4, 2018

On second thoughts, maybe we should keep this in the scala package like the inline annotation for now to avoid confusion. Eventually we'll remove this annotation anyway so it doesn't matter much.

@allanrenucci allanrenucci changed the title Introduce @annotation.forceInline annotation Introduce @forceInline annotation Jul 4, 2018
/** An annotation on methods that is equivalent to Dotty `inline` modifier.
*
* The annotation should be used instead of the `inline` modifier in code
* that needs to cross compile between Scala 2 and Dotty.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should also mention that @forceInline will be ignored by Scala 2. Maybe hint at the need of @forceInline @inline for cross compilation with the optimization in both versions.

An annotation on methods that is equivalent to Dotty `inline` modifier.
The annotation should be used instead of the `inline` modifier in code
that needs to cross compile between Scala 2 and Dotty.
@odersky odersky merged commit 31f9a1b into scala:master Jul 5, 2018
@Blaisorblade Blaisorblade deleted the forceInline branch July 5, 2018 16:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants