Add check for bytecode target when @JvmRecord is used
^KT-43677 In Progress
This commit is contained in:
+8
@@ -0,0 +1,8 @@
|
||||
$TESTDATA_DIR$/jvmRecordWrongTarget.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-jdk-home
|
||||
$JDK_15$
|
||||
-XXLanguage:+JvmRecordSupport
|
||||
-jvm-target
|
||||
15_PREVIEW
|
||||
+2
@@ -0,0 +1,2 @@
|
||||
@JvmRecord
|
||||
data class MyRec(val name: String)
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
warning: ATTENTION!
|
||||
This build uses unsafe internal compiler arguments:
|
||||
|
||||
-XXLanguage:+JvmRecordSupport
|
||||
|
||||
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!
|
||||
|
||||
OK
|
||||
@@ -0,0 +1,8 @@
|
||||
$TESTDATA_DIR$/jvmRecordWrongTarget.kt
|
||||
-d
|
||||
$TEMP_DIR$
|
||||
-cp
|
||||
$JDK_15$
|
||||
-XXLanguage:+JvmRecordSupport
|
||||
-jvm-target
|
||||
9
|
||||
@@ -0,0 +1,2 @@
|
||||
@JvmRecord
|
||||
data class MyRec(val name: String)
|
||||
@@ -0,0 +1,11 @@
|
||||
warning: ATTENTION!
|
||||
This build uses unsafe internal compiler arguments:
|
||||
|
||||
-XXLanguage:+JvmRecordSupport
|
||||
|
||||
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!
|
||||
|
||||
error: -XXLanguage:+JvmRecordSupport feature is only supported with JVM target 15_PREVIEW or later
|
||||
COMPILATION_ERROR
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
error: unknown JVM target version: 1.5
|
||||
Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15
|
||||
Supported versions: 1.6, 1.8, 9, 10, 11, 12, 13, 14, 15, 15_PREVIEW
|
||||
COMPILATION_ERROR
|
||||
|
||||
Reference in New Issue
Block a user