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

Print this page

        

*** 2,12 **** * @test /nodynamiccopyright/ * @summary Value types do not support identityHashCode * @modules java.base/jvm.internal.value * @compile/fail/ref=CheckIdentityHash.out -XDrawDiagnostics -Werror -Xlint:values CheckIdentityHash.java */ ! @jvm.internal.value.DeriveValueType final class CheckIdentityHash { int identityHashCode(CheckIdentityHash x) { return 0; } void test(CheckIdentityHash v) { --- 2,12 ---- * @test /nodynamiccopyright/ * @summary Value types do not support identityHashCode * @modules java.base/jvm.internal.value * @compile/fail/ref=CheckIdentityHash.out -XDrawDiagnostics -Werror -Xlint:values CheckIdentityHash.java */ ! @jvm.internal.value.ValueCapableClass final class CheckIdentityHash { int identityHashCode(CheckIdentityHash x) { return 0; } void test(CheckIdentityHash v) {