Skip to content

Extra field when creating multiple fields using a val pattern #308

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

Open
lrytz opened this issue Feb 21, 2017 · 1 comment
Open

Extra field when creating multiple fields using a val pattern #308

lrytz opened this issue Feb 21, 2017 · 1 comment
Assignees
Milestone

Comments

@lrytz
Copy link
Member

lrytz commented Feb 21, 2017

https://issues.scala-lang.org/browse/SI-1913:

class C {
  val (a, b) = (1, 2)
}

class C has 3 fields:

public class C {
    private final /* synthetic */ Tuple2 x$1;
    private final int a;
    private final int b;

    public C() {
        int n = 2;
        int n2 = 1;
        this.x$1 = new Tuple2.mcII.sp(n2, n);
        this.a = this.x$1._1$mcI$sp();
        this.b = this.x$1._2$mcI$sp();
    }
}
@som-snytt
Copy link

The lint doesn't cover tuples? scala/bug#11618

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

3 participants