Separate JVM target option from javac's --enable-preview analogue

This commit is contained in:
Denis.Zharkov
2020-12-04 19:04:14 +03:00
parent 3abd8b1ab2
commit 46c3979acd
18 changed files with 73 additions and 39 deletions
+2
View File
@@ -22,6 +22,8 @@ where advanced options include:
-Xir-do-not-clear-binding-context
When using the IR backend, do not clear BindingContext between psi2ir and lowerings
-Xemit-jvm-type-annotations Emit JVM type annotations in bytecode
-Xjvm-enable-preview Allow using features from Java language that are in preview phase.
Works as `--enable-preview` in Java. All class files are marked as preview-generated thus it won't be possible to use them in release environment
-Xfriend-paths=<path> Paths to output directories for friend modules (whose internals should be visible)
-Xmultifile-parts-inherit Compile multifile classes as a hierarchy of parts and facade
-Xir-check-local-names Check that names of local classes and anonymous objects are the same in the IR backend as in the old backend
+2 -1
View File
@@ -8,5 +8,6 @@ $TEMP_DIR$
-jdk-home
$JDK_15$
-XXLanguage:+JvmRecordSupport
-Xjvm-enable-preview
-jvm-target
15_PREVIEW
15
+2
View File
@@ -7,4 +7,6 @@ This mode is not recommended for production use,
as no stability/compatibility guarantees are given on
compiler or generated code. Use it at your own risk!
warning: language version 1.5 is experimental, there are no backwards compatibility guarantees for new language and library features
info: using preview Java language features
OK
+1 -1
View File
@@ -1,3 +1,3 @@
error: unknown JVM target version: 1.5
Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 15_PREVIEW
Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15
COMPILATION_ERROR
@@ -1,6 +1,7 @@
// !API_VERSION: 1.5
// !LANGUAGE: +JvmRecordSupport
// JVM_TARGET: 15_PREVIEW
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
// FILE: JavaClass.java
public class JavaClass {
public static String box() {
@@ -1,6 +1,7 @@
// !API_VERSION: 1.5
// !LANGUAGE: +JvmRecordSupport
// JVM_TARGET: 15_PREVIEW
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
@JvmRecord
data class MyRec<R>(val x: String, val y: R)
@@ -1,4 +1,5 @@
// JVM_TARGET: 15_PREVIEW
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
// FILE: MyRec.java
public record MyRec(String name) implements KI {
public String getName() {
@@ -1,4 +1,5 @@
// JVM_TARGET: 15_PREVIEW
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
// FILE: MyRec.java
public record MyRec(String name) {
public String getName() {
@@ -1,5 +1,6 @@
// !LANGUAGE: +JvmRecordSupport
// JVM_TARGET: 15_PREVIEW
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
// FILE: MyRec.java
public record MyRec(String name) {}
@@ -1,6 +1,7 @@
// !API_VERSION: 1.5
// !LANGUAGE: +JvmRecordSupport
// JVM_TARGET: 15_PREVIEW
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
// FILE: A.kt
@JvmRecord
data class MyRecord(val foo: String, val bar: String)