aboutsummaryrefslogtreecommitdiff
path: root/javatests/com/google/turbine/lower/testdata/record_ctor.test
blob: a3adc1596c7fe42dc7b600f87b1266c3a828816b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
=== Records.java ===
import java.lang.annotation.ElementType;
import java.lang.annotation.Target;

public class Records {
  public record A(String value) {

    void one() {}

    public A(String a, String b) {
      this(a + ", " + b);
    }

    void two() {}
  }

  @Target(ElementType.TYPE_USE)
  @interface N {}

  public record B(String value) {

    void one() {}

    public B(@N String value) {
      this.value = value;
    }

    void two() {}

    public B(String a, String b) {
      this(a + ", " + b);
    }

    void three() {}
  }

  class Inner {}

  public record C(Records.Inner value) {

    public C(Records. @N Inner value) {
      this.value = value;
    }
  }

  public record D<T>(T value) {

    public D(T value) {
      this.value = value;
    }
  }
}