test/tools/javac/valhalla/minimalvalues/CheckEquals.java

Print this page


   1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary Value types do not support == or !=
   4  * @modules java.base/jvm.internal.value
   5  * @compile/fail/ref=CheckEquals.out -XDrawDiagnostics -Werror  -Xlint:values CheckEquals.java
   6  */
   7 @jvm.internal.value.DeriveValueType
   8 final class CheckEquals {
   9     boolean foo(CheckEquals a, CheckEquals b) {
  10         return (a == b) || (a != b);
  11     }
  12 }
   1 /*
   2  * @test /nodynamiccopyright/
   3  * @summary Value types do not support == or !=
   4  * @modules java.base/jvm.internal.value
   5  * @compile/fail/ref=CheckEquals.out -XDrawDiagnostics -Werror  -Xlint:values CheckEquals.java
   6  */
   7 @jvm.internal.value.ValueCapableClass
   8 final class CheckEquals {
   9     boolean foo(CheckEquals a, CheckEquals b) {
  10         return (a == b) || (a != b);
  11     }
  12 }