Do not report pre-release errors if release LV is used in pre-release compiler
This commit effectively reverts
d386712903.
The reason is that when using a release language version, you can only
"see" the subset of a pre-release library which consists of released and
supported features, so reporting an error is not helpful there. Also, it
presents a problem currently when using kotlinc 1.3 (which is
pre-release) with language version 1.2 (stable) against the bundled
stdlib of version 1.3 (pre-release)
#KT-21267 Declined
This commit is contained in:
+1
-8
@@ -1,8 +1 @@
|
|||||||
error: incompatible classes were found in dependencies. Remove them from the classpath or use '-Xskip-metadata-version-check' to suppress errors
|
OK
|
||||||
compiler/testData/compileKotlinAgainstCustomBinaries/preReleaseCompilerAgainstPreReleaseLibraryStableLanguageVersion/source.kt:5:16: error: class 'a.A' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
|
|
||||||
fun baz(param: A) {
|
|
||||||
^
|
|
||||||
compiler/testData/compileKotlinAgainstCustomBinaries/preReleaseCompilerAgainstPreReleaseLibraryStableLanguageVersion/source.kt:6:5: error: class 'a.AKt' is compiled by a pre-release version of Kotlin and cannot be loaded by this version of the compiler
|
|
||||||
foo()
|
|
||||||
^
|
|
||||||
COMPILATION_ERROR
|
|
||||||
|
|||||||
+2
-1
@@ -2,6 +2,7 @@ package usage
|
|||||||
|
|
||||||
import a.*
|
import a.*
|
||||||
|
|
||||||
fun baz(param: A) {
|
fun baz(param: A): A {
|
||||||
foo()
|
foo()
|
||||||
|
return param
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -271,7 +271,7 @@ class LanguageVersionSettingsImpl @JvmOverloads constructor(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun isPreRelease(): Boolean = languageVersion.isPreRelease() ||
|
override fun isPreRelease(): Boolean = KotlinCompilerVersion.isPreRelease() ||
|
||||||
specificFeatures.any { (feature, state) ->
|
specificFeatures.any { (feature, state) ->
|
||||||
state == LanguageFeature.State.ENABLED && feature.forcesPreReleaseBinariesIfEnabled()
|
state == LanguageFeature.State.ENABLED && feature.forcesPreReleaseBinariesIfEnabled()
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user