Switch default JVM target to 1.8

#KT-29405 Fixed
This commit is contained in:
Alexander Udalov
2021-01-21 17:12:46 +01:00
parent 509ed64917
commit d022bb0248
52 changed files with 247 additions and 164 deletions
@@ -104,7 +104,7 @@ class GradleFacetImportTest : GradleImportingTestCase() {
Assert.assertFalse(compilerArguments!!.autoAdvanceLanguageVersion)
Assert.assertFalse(compilerArguments!!.autoAdvanceApiVersion)
Assert.assertEquals(JvmPlatforms.jvm16, targetPlatform)
Assert.assertEquals("1.6", (compilerArguments as K2JVMCompilerArguments).jvmTarget)
Assert.assertEquals("1.8", (compilerArguments as K2JVMCompilerArguments).jvmTarget)
Assert.assertEquals(
"-Xallow-no-source-files -Xdump-declarations-to=tmpTest",
compilerSettings!!.additionalArguments
@@ -158,7 +158,7 @@ class GradleFacetImportTest : GradleImportingTestCase() {
Assert.assertEquals("1.3", languageLevel!!.versionString)
Assert.assertEquals("1.0", apiLevel!!.versionString)
Assert.assertEquals(JvmPlatforms.jvm16, targetPlatform)
Assert.assertEquals("1.6", (compilerArguments as K2JVMCompilerArguments).jvmTarget)
Assert.assertEquals("1.8", (compilerArguments as K2JVMCompilerArguments).jvmTarget)
Assert.assertEquals(
"-Xallow-no-source-files -Xdump-declarations-to=tmpTest",
compilerSettings!!.additionalArguments
@@ -38,7 +38,7 @@ object JvmIdePlatformKind : IdePlatformKind<JvmIdePlatformKind>() {
message = "IdePlatform is deprecated and will be removed soon, please, migrate to org.jetbrains.kotlin.platform.TargetPlatform",
level = DeprecationLevel.ERROR
)
override fun getDefaultPlatform(): Platform = Platform(JvmTarget.JVM_1_6)
override fun getDefaultPlatform(): Platform = Platform(JvmTarget.DEFAULT)
override fun createArguments(): CommonCompilerArguments {
return K2JVMCompilerArguments()
+1 -1
View File
@@ -31,7 +31,7 @@ class A {
<error descr="[WRONG_ANNOTATION_TARGET] This annotation is not applicable to target 'interface'">@JvmStatic</error>
interface B {
companion object {
<error descr="[JVM_STATIC_IN_INTERFACE_1_6] '@JvmStatic' annotation in interface supported only with JVM target 1.8 and above. Recompile with '-jvm-target 1.8'\"">@JvmStatic fun a1()</error> {
@JvmStatic fun a1() {
}
}
@@ -1,4 +1,3 @@
// ERROR: Super calls to Java default methods are prohibited in JVM target 1.6. Recompile with '-jvm-target 1.8'
import java.util.stream.Stream
abstract class A : List<String> {