You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When compiled with -optimize -Yinline-warnings I get the following:
Test.scala:17: warning: Could not inline required method foo because callee (ImplOptimized.foo) has no code.
def bar(f: Foo) = f.foo(x => x == 1)
I asked Iulian about this and he said it might be tricky but should be possible to get inlining to work here. First we would need inline the forwarder Foo.foo that forwards to ImplOptimized.foo and then inline that method (with little twist related to handling $this).
Now, why getting this to work is important? Because we could mark all methods in LinearSeqOptimized as final and @inline and get rid of closure allocations for many operations on collections like List. This would be huge gain for the compiler.
The text was updated successfully, but these errors were encountered:
Consider the following code:
When compiled with -optimize -Yinline-warnings I get the following:
Test.scala:17: warning: Could not inline required method foo because callee (ImplOptimized.foo) has no code.
def bar(f: Foo) = f.foo(x => x == 1)
I asked Iulian about this and he said it might be tricky but should be possible to get inlining to work here. First we would need inline the forwarder Foo.foo that forwards to ImplOptimized.foo and then inline that method (with little twist related to handling $this).
Now, why getting this to work is important? Because we could mark all methods in LinearSeqOptimized as final and @inline and get rid of closure allocations for many operations on collections like List. This would be huge gain for the compiler.
The text was updated successfully, but these errors were encountered: