Add test on Experimental in scripts
This commit is contained in:
@@ -0,0 +1,50 @@
|
||||
// !API_VERSION: 1.3
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@Experimental(Experimental.Level.WARNING, [Experimental.Impact.COMPILATION])
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
fun function(): String = ""
|
||||
|
||||
// MODULE: usage1(api)
|
||||
// FILE: usage-propagate.kts
|
||||
|
||||
import api.*
|
||||
|
||||
@ExperimentalAPI
|
||||
fun use() {
|
||||
function()
|
||||
}
|
||||
|
||||
<!EXPERIMENTAL_API_USAGE!>function<!>()
|
||||
<!EXPERIMENTAL_API_USAGE!>use<!>()
|
||||
|
||||
// MODULE: usage2(api)
|
||||
// FILE: usage-use.kts
|
||||
|
||||
@file:UseExperimental(ExperimentalAPI::class)
|
||||
import api.*
|
||||
|
||||
fun use() {
|
||||
function()
|
||||
}
|
||||
|
||||
<!EXPERIMENTAL_API_USAGE!>function<!>()
|
||||
use()
|
||||
|
||||
// MODULE: usage3(api)
|
||||
// FILE: usage-none.kts
|
||||
|
||||
import api.*
|
||||
|
||||
fun use() {
|
||||
<!EXPERIMENTAL_API_USAGE!>function<!>()
|
||||
}
|
||||
|
||||
<!EXPERIMENTAL_API_USAGE!>function<!>()
|
||||
use()
|
||||
@@ -0,0 +1,61 @@
|
||||
// -- Module: <api> --
|
||||
package
|
||||
|
||||
package api {
|
||||
@api.ExperimentalAPI public fun function(): kotlin.String
|
||||
|
||||
@kotlin.Experimental(changesMayBreak = {Impact.COMPILATION}, level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation {
|
||||
public constructor ExperimentalAPI()
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage1> --
|
||||
package
|
||||
|
||||
public final class Usage_propagate : kotlin.script.templates.standard.ScriptTemplateWithArgs {
|
||||
public constructor Usage_propagate(/*0*/ args: kotlin.Array<kotlin.String>)
|
||||
public final override /*1*/ /*fake_override*/ val args: kotlin.Array<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
@api.ExperimentalAPI public final fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage2> --
|
||||
package
|
||||
|
||||
public final class Usage_use : kotlin.script.templates.standard.ScriptTemplateWithArgs {
|
||||
public constructor Usage_use(/*0*/ args: kotlin.Array<kotlin.String>)
|
||||
public final override /*1*/ /*fake_override*/ val args: kotlin.Array<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public final fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
package api {
|
||||
}
|
||||
|
||||
|
||||
// -- Module: <usage3> --
|
||||
package
|
||||
|
||||
public final class Usage_none : kotlin.script.templates.standard.ScriptTemplateWithArgs {
|
||||
public constructor Usage_none(/*0*/ args: kotlin.Array<kotlin.String>)
|
||||
public final override /*1*/ /*fake_override*/ val args: kotlin.Array<kotlin.String>
|
||||
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
|
||||
public open override /*1*/ /*fake_override*/ fun hashCode(): kotlin.Int
|
||||
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
|
||||
public final fun use(): kotlin.Unit
|
||||
}
|
||||
|
||||
package api {
|
||||
}
|
||||
+6
@@ -1887,6 +1887,12 @@ public class DiagnosticsTestWithStdLibGenerated extends AbstractDiagnosticsTestW
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("scripts.kt")
|
||||
public void testScripts() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/experimental/scripts.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("topLevel.kt")
|
||||
public void testTopLevel() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/experimental/topLevel.kt");
|
||||
|
||||
compiler/tests/org/jetbrains/kotlin/checkers/javac/DiagnosticsTestWithStdLibUsingJavacGenerated.java
Generated
+6
@@ -1887,6 +1887,12 @@ public class DiagnosticsTestWithStdLibUsingJavacGenerated extends AbstractDiagno
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("scripts.kt")
|
||||
public void testScripts() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/experimental/scripts.kt");
|
||||
doTest(fileName);
|
||||
}
|
||||
|
||||
@TestMetadata("topLevel.kt")
|
||||
public void testTopLevel() throws Exception {
|
||||
String fileName = KotlinTestUtils.navigationMetadata("compiler/testData/diagnostics/testsWithStdLib/experimental/topLevel.kt");
|
||||
|
||||
Reference in New Issue
Block a user