Require "-Xuse-experimental=kotlin.Experimental" on usages of Experimental
Since we're not yet sure of the design of Experimental/UseExperimental, we're making them "experimental" themselves in some sense, in that the user is required to provide the magic argument "-Xuse-experimental=kotlin.Experimental" to be allowed to use either Experimental or UseExperimental. This is more convenient than the previous approach of "-language-version 1.3 -Xskip-metadata-version-check" because it's simpler and does not cause pre-release binaries to be produced
This commit is contained in:
+5
@@ -2112,6 +2112,11 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/errors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("experimentalIsNotEnabled.kt")
|
||||
public void testExperimentalIsNotEnabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalIsNotEnabled.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("experimentalOnWholeModule.kt")
|
||||
public void testExperimentalOnWholeModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt");
|
||||
|
||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+5
@@ -2112,6 +2112,11 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/errors.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("experimentalIsNotEnabled.kt")
|
||||
public void testExperimentalIsNotEnabled() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalIsNotEnabled.kt");
|
||||
}
|
||||
|
||||
@TestMetadata("experimentalOnWholeModule.kt")
|
||||
public void testExperimentalOnWholeModule() throws Exception {
|
||||
runTest("compiler/testData/diagnostics/testsWithStdLib/experimental/experimentalOnWholeModule.kt");
|
||||
|
||||
@@ -97,9 +97,7 @@ class JvmModuleProtoBufTest : KtUsefulTestCase() {
|
||||
fun testExperimental() {
|
||||
doTest(
|
||||
"/moduleProtoBuf/experimental", extraOptions = listOf(
|
||||
"-Xskip-runtime-version-check",
|
||||
"-language-version",
|
||||
"1.3",
|
||||
"-Xuse-experimental=kotlin.Experimental",
|
||||
"-Xexperimental=org.foo.A",
|
||||
"-Xexperimental=org.foo.B.C",
|
||||
"-Xuse-experimental=org.foo.D"
|
||||
|
||||
@@ -15,29 +15,22 @@ class ExperimentalIntegrationTest : AbstractKotlinCompilerIntegrationTest() {
|
||||
fun testJvmExperimentalModule() {
|
||||
val lib = compileLibrary(
|
||||
"lib", additionalOptions = listOf(
|
||||
"-Xskip-runtime-version-check",
|
||||
"-language-version",
|
||||
"1.3",
|
||||
"-Xuse-experimental=kotlin.Experimental",
|
||||
"-Xexperimental=lib.ExperimentalAPI"
|
||||
),
|
||||
checkKotlinOutput = { output -> assertTrue(output, output.trimEnd().endsWith("OK")) }
|
||||
)
|
||||
compileKotlin("usage.kt", tmpdir, listOf(lib), additionalOptions = listOf("-Xskip-metadata-version-check"))
|
||||
compileKotlin("usage.kt", tmpdir, listOf(lib))
|
||||
}
|
||||
|
||||
fun testJsExperimentalModule() {
|
||||
val lib = compileJsLibrary(
|
||||
"lib", additionalOptions = listOf(
|
||||
"-Xskip-runtime-version-check",
|
||||
"-language-version",
|
||||
"1.3",
|
||||
"-Xuse-experimental=kotlin.Experimental",
|
||||
"-Xexperimental=lib.ExperimentalAPI"
|
||||
),
|
||||
checkKotlinOutput = { output -> assertTrue(output, output.trimEnd().endsWith("OK")) }
|
||||
)
|
||||
compileKotlin(
|
||||
"usage.kt", File(tmpdir, "usage.js"), listOf(lib), K2JSCompiler(),
|
||||
additionalOptions = listOf("-Xskip-metadata-version-check")
|
||||
)
|
||||
compileKotlin("usage.kt", File(tmpdir, "usage.js"), listOf(lib), K2JSCompiler())
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user