Report incorrect JVM target only when @JvmRecord is actually used

This commit is contained in:
Denis.Zharkov
2020-12-08 16:48:31 +03:00
parent 920ed558ee
commit 92b402759b
15 changed files with 39 additions and 18 deletions
+1 -1
View File
@@ -5,7 +5,7 @@ $TEMP_DIR$
1.5
-language-version
1.5
-cp
-jdk-home
$JDK_15$
-XXLanguage:+JvmRecordSupport
-jvm-target
+3 -1
View File
@@ -8,5 +8,7 @@ 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
error: -XXLanguage:+JvmRecordSupport feature is only supported with JVM target 15 or later
compiler/testData/cli/jvm/jvmRecord.kt:1:1: error: using @JvmRecord is only allowed with -jvm-target 15 and -Xjvm-enable-preview flag enabled
@JvmRecord
^
COMPILATION_ERROR
@@ -1,6 +1,8 @@
// !API_VERSION: 1.5
// !LANGUAGE: +JvmRecordSupport
// SKIP_TXT
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
<!NON_DATA_CLASS_JVM_RECORD!>@JvmRecord<!>
class A0
@@ -1,6 +1,8 @@
// !API_VERSION: 1.5
// !LANGUAGE: +JvmRecordSupport
// SKIP_TXT
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
interface I
@@ -1,5 +1,7 @@
// !API_VERSION: 1.5
// !LANGUAGE: +JvmRecordSupport
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
<!NON_DATA_CLASS_JVM_RECORD!>@JvmRecord<!>
class BasicRecord(val x: String)
@@ -1,5 +1,7 @@
// !API_VERSION: 1.5
// !LANGUAGE: +JvmRecordSupport
// JVM_TARGET: 15
// ENABLE_JVM_PREVIEW
abstract class Abstract
interface I