< prev index next >

langtools/test/tools/javac/valhalla/minimalvalues/CheckNullAssign.java

Print this page

        

*** 1,12 **** /* * @test /nodynamiccopyright/ * @summary Assignment of null to value types should be disallowed. ! * @modules java.base/jvm.internal.value ! * @compile/fail/ref=CheckNullAssign.out -XDrawDiagnostics -Werror -Xlint:values CheckNullAssign.java */ ! @jvm.internal.value.ValueCapableClass final class CheckNullAssign { CheckNullAssign foo(CheckNullAssign cna) { // All of the below involve subtype/assignability checks and should be rejected. CheckNullAssign cnal = null; cna = null; --- 1,12 ---- /* * @test /nodynamiccopyright/ * @summary Assignment of null to value types should be disallowed. ! * @modules jdk.incubator.mvt ! * @compile/fail/ref=CheckNullAssign.out --should-stop:ifError=PARSE -XDrawDiagnostics -Werror -Xlint:values CheckNullAssign.java */ ! @jdk.incubator.mvt.ValueCapableClass final class CheckNullAssign { CheckNullAssign foo(CheckNullAssign cna) { // All of the below involve subtype/assignability checks and should be rejected. CheckNullAssign cnal = null; cna = null;
< prev index next >