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

Optimizer: Tuple copy and copy$default are not inlined #11669

lrytz opened this issue Aug 8, 2019 · 0 comments


Copy link

commented Aug 8, 2019

This could probably be improved

class C {
   final def f = {
      val tup = (1, 2)
      tup.copy(_1 = 3)
$> scalac Test.scala -opt:l:inline '-opt-inline-from:**' -opt-warnings:_
Test.scala:4: warning: there was a problem determining if method copy$default$2 can be inlined:
No inline information for method scala/Tuple2$mcII$sp::copy$default$2()Ljava/lang/Object; could be found.
      tup.copy(_1 = 3)
one warning found
$> cfr-decompiler C.class
public class C {
    public final Tuple2<Object, Object> f() {
        Tuple2$mcII$sp tup = new Tuple2$mcII$sp(1, 2);
        return tup.copy$mIIc$sp(3, BoxesRunTime.unboxToInt(((Tuple2)tup).copy$default$2()));

@lrytz lrytz added the optimizer label Aug 8, 2019

@lrytz lrytz added this to the Backlog milestone Aug 8, 2019

@lrytz lrytz self-assigned this Aug 8, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
1 participant
You can’t perform that action at this time.