aboutsummaryrefslogtreecommitdiff
path: root/javatests/com/google/turbine/lower/testdata/record_tostring.test
blob: f93187a0ee3393be75b1d921cf9c03dc9916fc12 (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
=== Records.java ===

import java.lang.annotation.ElementType;
import java.lang.annotation.Target;
import java.util.Objects;

class Records {
  public record A() {
    @Override
    public String toString() {
      return "A";
    }
  }

  public record B() {
    @Override
    public final String toString() {
      return "B";
    }
  }

  public record C() {
    @Override
    public final boolean equals(Object o) {
      return false;
    }
  }

  public record D() {
    @Override
    public final int hashCode() {
      return -1;
    }
  }
}