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

Print this page

        

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