scala-dev icon indicating copy to clipboard operation
scala-dev copied to clipboard

Extra field when creating multiple fields using a val pattern

Open lrytz opened this issue 8 years ago • 1 comments

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();
    }
}

lrytz avatar Feb 21 '17 14:02 lrytz

The lint doesn't cover tuples? https://github.com/scala/bug/issues/11618

som-snytt avatar Nov 13 '21 16:11 som-snytt