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

Print this page

        

*** 2,14 **** * @test /nodynamiccopyright/ * @summary Value types do not support clone * @modules java.base/jvm.internal.value * @compile/fail/ref=CheckClone.out -XDrawDiagnostics -Werror -Xlint:values CheckClone.java */ ! @jvm.internal.value.DeriveValueType final class CheckClone { ! @jvm.internal.value.DeriveValueType final class InnerValue { void foo(InnerValue iv) { iv.clone(); // <-- error } } --- 2,14 ---- * @test /nodynamiccopyright/ * @summary Value types do not support clone * @modules java.base/jvm.internal.value * @compile/fail/ref=CheckClone.out -XDrawDiagnostics -Werror -Xlint:values CheckClone.java */ ! @jvm.internal.value.ValueCapableClass final class CheckClone { ! @jvm.internal.value.ValueCapableClass final class InnerValue { void foo(InnerValue iv) { iv.clone(); // <-- error } }