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

inline new mixin methods #86

Closed
lrytz opened this issue Feb 18, 2016 · 1 comment
Closed

inline new mixin methods #86

lrytz opened this issue Feb 18, 2016 · 1 comment
Milestone

Comments

@lrytz
Copy link
Member

lrytz commented Feb 18, 2016

trait T { @inline def f = 1 } } // note that f is not final
class C extends T

bfore nuke-impl-classes, the mixin f in C is def f = T$class.f(this), which is inlined.

with default methods the mixin becomes def f = super.f and is currently not inlined, even though it could (INVOKESPECIAL).

Note that this also causes an inliner warning (T::f()I is annotated @inline but cannot be inlined: the method is not final and may be overridden)

@lrytz
Copy link
Member Author

lrytz commented Feb 18, 2016

Another issue: module accessors in traits were effectivelyFinal before the patch, now not anymore. Need to investigate, see ScalaInlineInfoTest.

@lrytz lrytz added this to the 2.12.0-M4 milestone Mar 3, 2016
lrytz added a commit to lrytz/scala that referenced this issue Mar 9, 2016
Ensures that mixin methods of `@inline` annotated concrete trait methods
inline the trait method.

Fixes scala/scala-dev#86
lrytz added a commit to lrytz/scala that referenced this issue Mar 23, 2016
Ensures that mixin methods of `@inline` annotated concrete trait methods
inline the trait method.

Fixes scala/scala-dev#86
lrytz added a commit to lrytz/scala that referenced this issue Mar 23, 2016
Ensures that mixin methods of `@inline` annotated concrete trait methods
inline the trait method.

Fixes scala/scala-dev#86
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant