Rename UseExperimental->OptIn, Experimental->RequiresOptIn in quickfix and IDE tests
This commit is contained in:
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
package experimentalApi
|
package experimentalApi
|
||||||
|
|
||||||
@Experimental(Experimental.Level.ERROR)
|
@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
|
||||||
annotation class UnstableApi
|
annotation class UnstableApi
|
||||||
|
|
||||||
@UnstableApi
|
@UnstableApi
|
||||||
|
|||||||
@@ -28,11 +28,11 @@ class MakeModuleExperimentalFix(
|
|||||||
private val module: Module,
|
private val module: Module,
|
||||||
private val annotationFqName: FqName
|
private val annotationFqName: FqName
|
||||||
) : KotlinQuickFixAction<KtFile>(file) {
|
) : KotlinQuickFixAction<KtFile>(file) {
|
||||||
override fun getText(): String = "Add '-Xuse-experimental=$annotationFqName' to module ${module.name} compiler arguments"
|
override fun getText(): String = "Add '-Xopt-in=$annotationFqName' to module ${module.name} compiler arguments"
|
||||||
|
|
||||||
override fun getFamilyName(): String = "Make module experimental"
|
override fun getFamilyName(): String = "Add an opt-in requirement marker compiler argument"
|
||||||
|
|
||||||
private val compilerArgument = "-Xuse-experimental=$annotationFqName"
|
private val compilerArgument = "-Xopt-in=$annotationFqName"
|
||||||
|
|
||||||
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
|
override fun invoke(project: Project, editor: Editor?, file: KtFile) {
|
||||||
val modelsProvider = IdeModifiableModelsProviderImpl(project)
|
val modelsProvider = IdeModifiableModelsProviderImpl(project)
|
||||||
@@ -60,7 +60,7 @@ class MakeModuleExperimentalFix(
|
|||||||
compilerArgument !in compilerSettings.additionalArgumentsAsList
|
compilerArgument !in compilerSettings.additionalArgumentsAsList
|
||||||
} else {
|
} else {
|
||||||
compilerSettings.additionalArgumentsAsList.none {
|
compilerSettings.additionalArgumentsAsList.none {
|
||||||
it.startsWith("-Xuse-experimental=") || it.startsWith("-Xexperimental=")
|
it.startsWith("-Xopt-in=") || it.startsWith("-Xuse-experimental=") || it.startsWith("-Xexperimental=")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class FirstExperience
|
annotation class FirstExperience
|
||||||
|
|
||||||
open class ParentTarget {
|
open class ParentTarget {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class FirstExperience
|
annotation class FirstExperience
|
||||||
|
|
||||||
open class ParentTarget {
|
open class ParentTarget {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ package test
|
|||||||
|
|
||||||
import kotlin.contracts.*
|
import kotlin.contracts.*
|
||||||
|
|
||||||
@UseExperimental(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
fun myRequire(x: Boolean) {
|
fun myRequire(x: Boolean) {
|
||||||
contract {
|
contract {
|
||||||
returns(true) implies (x)
|
returns(true) implies (x)
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class ExperimentalAPI
|
annotation class ExperimentalAPI
|
||||||
|
|
||||||
class Foo
|
class Foo
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
package lib
|
package lib
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class ExperimentalAPI
|
annotation class ExperimentalAPI
|
||||||
|
|
||||||
class Foo
|
class Foo
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@TopMarker' annotation to 'topUserVal'" "true"
|
// "Add '@TopMarker' annotation to 'topUserVal'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class TopMarker
|
annotation class TopMarker
|
||||||
|
|
||||||
@TopMarker
|
@TopMarker
|
||||||
@@ -12,4 +12,4 @@ class TopClass
|
|||||||
@TopMarker
|
@TopMarker
|
||||||
annotation class TopAnn
|
annotation class TopAnn
|
||||||
|
|
||||||
val topUserVal: @<caret>TopAnn TopClass? = null
|
val topUserVal: @<caret>TopAnn TopClass? = null
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@TopMarker' annotation to 'topUserVal'" "true"
|
// "Add '@TopMarker' annotation to 'topUserVal'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class TopMarker
|
annotation class TopMarker
|
||||||
|
|
||||||
@TopMarker
|
@TopMarker
|
||||||
@@ -13,4 +13,4 @@ class TopClass
|
|||||||
annotation class TopAnn
|
annotation class TopAnn
|
||||||
|
|
||||||
@TopMarker
|
@TopMarker
|
||||||
val topUserVal: @TopAnn TopClass? = null
|
val topUserVal: @TopAnn TopClass? = null
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to 'bar'" "true"
|
// "Add '@MyExperimentalAPI' annotation to 'bar'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
@@ -12,4 +12,4 @@ class Bar {
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
foo<caret>()
|
foo<caret>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to 'bar'" "true"
|
// "Add '@MyExperimentalAPI' annotation to 'bar'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
@@ -13,4 +13,4 @@ class Bar {
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to containing class 'Bar'" "true"
|
// "Add '@MyExperimentalAPI' annotation to containing class 'Bar'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
@@ -12,4 +12,4 @@ class Bar {
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
foo<caret>()
|
foo<caret>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to containing class 'Bar'" "true"
|
// "Add '@MyExperimentalAPI' annotation to containing class 'Bar'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
@@ -13,4 +13,4 @@ class Bar {
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,13 +1,13 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to 'bar'" "false"
|
// "Add '@MyExperimentalAPI' annotation to 'bar'" "false"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Add '@MyExperimentalAPI' annotation to containing class 'Bar'
|
// ACTION: Add '@MyExperimentalAPI' annotation to containing class 'Bar'
|
||||||
// ACTION: Add '@OptIn(MyExperimentalAPI::class)' annotation to 'bar'
|
// ACTION: Add '@OptIn(MyExperimentalAPI::class)' annotation to 'bar'
|
||||||
// ACTION: Add '-Xuse-experimental=MyExperimentalAPI' to module light_idea_test_case compiler arguments
|
// ACTION: Add '-Xopt-in=MyExperimentalAPI' to module light_idea_test_case compiler arguments
|
||||||
// ERROR: This declaration is experimental and its usage must be marked with '@MyExperimentalAPI' or '@OptIn(MyExperimentalAPI::class)'
|
// ERROR: This declaration is experimental and its usage must be marked with '@MyExperimentalAPI' or '@OptIn(MyExperimentalAPI::class)'
|
||||||
// ERROR: This declaration is experimental and its usage must be marked with '@MyExperimentalAPI' or '@OptIn(MyExperimentalAPI::class)'
|
// ERROR: This declaration is experimental and its usage must be marked with '@MyExperimentalAPI' or '@OptIn(MyExperimentalAPI::class)'
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
|
|||||||
+5
-5
@@ -1,12 +1,12 @@
|
|||||||
// "Add '-Xuse-experimental=test.MyExperimentalAPI' to module light_idea_test_case compiler arguments" "true"
|
// "Add '-Xopt-in=test.MyExperimentalAPI' to module light_idea_test_case compiler arguments" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// COMPILER_ARGUMENTS_AFTER: -Xuse-experimental=kotlin.Experimental -Xuse-experimental=test.MyExperimentalAPI
|
// COMPILER_ARGUMENTS_AFTER: -Xopt-in=kotlin.RequiresOptIn -Xopt-in=test.MyExperimentalAPI
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
@@ -18,4 +18,4 @@ class Bar {
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
Some().foo<caret>()
|
Some().foo<caret>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
// "Add '-Xuse-experimental=test.MyExperimentalAPI' to module light_idea_test_case compiler arguments" "true"
|
// "Add '-Xopt-in=test.MyExperimentalAPI' to module light_idea_test_case compiler arguments" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// COMPILER_ARGUMENTS_AFTER: -Xuse-experimental=kotlin.Experimental -Xuse-experimental=test.MyExperimentalAPI
|
// COMPILER_ARGUMENTS_AFTER: -Xopt-in=kotlin.RequiresOptIn -Xopt-in=test.MyExperimentalAPI
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
@@ -18,4 +18,4 @@ class Bar {
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
Some().foo()
|
Some().foo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// "Add '@OptIn(MyExperimentalAPI::class)' annotation to 'bar'" "true"
|
// "Add '@OptIn(MyExperimentalAPI::class)' annotation to 'bar'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
package a.b
|
package a.b
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// "Add '@OptIn(MyExperimentalAPI::class)' annotation to 'bar'" "true"
|
// "Add '@OptIn(MyExperimentalAPI::class)' annotation to 'bar'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
package a.b
|
package a.b
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
@Target(AnnotationTarget.CLASS)
|
@Target(AnnotationTarget.CLASS)
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// "Add '@OptIn(MyExperimentalAPI::class)' annotation to containing class 'Bar'" "true"
|
// "Add '@OptIn(MyExperimentalAPI::class)' annotation to containing class 'Bar'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
package a.b
|
package a.b
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
@Target(AnnotationTarget.FUNCTION)
|
@Target(AnnotationTarget.FUNCTION)
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// "Add '@OptIn(MyExperimentalAPI::class)' annotation to containing class 'Bar'" "true"
|
// "Add '@OptIn(MyExperimentalAPI::class)' annotation to containing class 'Bar'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
package a.b
|
package a.b
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
@Target(AnnotationTarget.FUNCTION)
|
@Target(AnnotationTarget.FUNCTION)
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
|
|||||||
+4
-4
@@ -1,10 +1,10 @@
|
|||||||
// "Add '-Xuse-experimental=kotlin.Experimental' to module light_idea_test_case compiler arguments" "false"
|
// "Add '-Xopt-in=kotlin.RequiresOptIn' to module light_idea_test_case compiler arguments" "false"
|
||||||
// COMPILER_ARGUMENTS: -version -Xuse-experimental=Something
|
// COMPILER_ARGUMENTS: -version -Xopt-in=Something
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Introduce import alias
|
// ACTION: Introduce import alias
|
||||||
// ACTION: Make internal
|
// ACTION: Make internal
|
||||||
// ACTION: Make private
|
// ACTION: Make private
|
||||||
|
|
||||||
@Experimental<caret>
|
@RequiresOptIn<caret>
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// "Safe delete 'Marker'" "false"
|
// "Safe delete 'Marker'" "false"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental -Xuse-experimental=test.Marker
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn -Xopt-in=test.Marker
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Rename file to Marker.kt
|
// ACTION: Rename file to Marker.kt
|
||||||
// TOOL: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
|
// TOOL: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
|
||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class <caret>Marker
|
annotation class <caret>Marker
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
// "Safe delete 'Marker'" "false"
|
// "Safe delete 'Marker'" "false"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental -Xexperimental=test.Marker
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn -Xexperimental=test.Marker
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Rename file to Marker.kt
|
// ACTION: Rename file to Marker.kt
|
||||||
// TOOL: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
|
// TOOL: org.jetbrains.kotlin.idea.inspections.UnusedSymbolInspection
|
||||||
|
|
||||||
package test
|
package test
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class <caret>Marker
|
annotation class <caret>Marker
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to 'outer'" "true"
|
// "Add '@MyExperimentalAPI' annotation to 'outer'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
@Target(AnnotationTarget.FUNCTION)
|
@Target(AnnotationTarget.FUNCTION)
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@@ -17,4 +17,4 @@ class Outer {
|
|||||||
override fun foo<caret>() {}
|
override fun foo<caret>() {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to 'outer'" "true"
|
// "Add '@MyExperimentalAPI' annotation to 'outer'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
@Target(AnnotationTarget.FUNCTION)
|
@Target(AnnotationTarget.FUNCTION)
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@@ -18,4 +18,4 @@ class Outer {
|
|||||||
override fun foo<caret>() {}
|
override fun foo<caret>() {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to 'outer'" "true"
|
// "Add '@MyExperimentalAPI' annotation to 'outer'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
@@ -12,4 +12,4 @@ fun outer() {
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
foo<caret>()
|
foo<caret>()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to 'outer'" "true"
|
// "Add '@MyExperimentalAPI' annotation to 'outer'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
@@ -13,4 +13,4 @@ fun outer() {
|
|||||||
fun bar() {
|
fun bar() {
|
||||||
foo()
|
foo()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -1,14 +1,14 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to containing class 'Outer'" "false"
|
// "Add '@MyExperimentalAPI' annotation to containing class 'Outer'" "false"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Add '@MyExperimentalAPI' annotation to 'bar'
|
// ACTION: Add '@MyExperimentalAPI' annotation to 'bar'
|
||||||
// ACTION: Add '@MyExperimentalAPI' annotation to containing class 'Inner'
|
// ACTION: Add '@MyExperimentalAPI' annotation to containing class 'Inner'
|
||||||
// ACTION: Add '@OptIn(MyExperimentalAPI::class)' annotation to 'bar'
|
// ACTION: Add '@OptIn(MyExperimentalAPI::class)' annotation to 'bar'
|
||||||
// ACTION: Add '-Xuse-experimental=MyExperimentalAPI' to module light_idea_test_case compiler arguments
|
// ACTION: Add '-Xopt-in=MyExperimentalAPI' to module light_idea_test_case compiler arguments
|
||||||
// ACTION: Introduce import alias
|
// ACTION: Introduce import alias
|
||||||
// ERROR: This declaration is experimental and its usage must be marked with '@MyExperimentalAPI' or '@OptIn(MyExperimentalAPI::class)'
|
// ERROR: This declaration is experimental and its usage must be marked with '@MyExperimentalAPI' or '@OptIn(MyExperimentalAPI::class)'
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
@MyExperimentalAPI
|
@MyExperimentalAPI
|
||||||
|
|||||||
+3
-3
@@ -1,13 +1,13 @@
|
|||||||
// "Add '@MyExperimentalAPI' annotation to containing class 'Derived'" "false"
|
// "Add '@MyExperimentalAPI' annotation to containing class 'Derived'" "false"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Add '@MyExperimentalAPI' annotation to 'foo'
|
// ACTION: Add '@MyExperimentalAPI' annotation to 'foo'
|
||||||
// ACTION: Add '@OptIn(MyExperimentalAPI::class)' annotation to 'foo'
|
// ACTION: Add '@OptIn(MyExperimentalAPI::class)' annotation to 'foo'
|
||||||
// ACTION: Add '@OptIn(MyExperimentalAPI::class)' annotation to containing class 'Derived'
|
// ACTION: Add '@OptIn(MyExperimentalAPI::class)' annotation to containing class 'Derived'
|
||||||
// ACTION: Add '-Xuse-experimental=MyExperimentalAPI' to module light_idea_test_case compiler arguments
|
// ACTION: Add '-Xopt-in=MyExperimentalAPI' to module light_idea_test_case compiler arguments
|
||||||
// ERROR: This declaration overrides experimental member of supertype 'Base' and must be annotated with '@MyExperimentalAPI'
|
// ERROR: This declaration overrides experimental member of supertype 'Base' and must be annotated with '@MyExperimentalAPI'
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
@Target(AnnotationTarget.FUNCTION)
|
@Target(AnnotationTarget.FUNCTION)
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
// "Add '@PropertyTypeMarker' annotation to 'PropertyTypeContainer'" "true"
|
// "Add '@PropertyTypeMarker' annotation to 'PropertyTypeContainer'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Add '@PropertyTypeMarker' annotation to containing class 'PropertyTypeContainer'
|
// ACTION: Add '@PropertyTypeMarker' annotation to containing class 'PropertyTypeContainer'
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class PropertyTypeMarker
|
annotation class PropertyTypeMarker
|
||||||
|
|
||||||
@PropertyTypeMarker
|
@PropertyTypeMarker
|
||||||
class PropertyTypeMarked
|
class PropertyTypeMarked
|
||||||
|
|
||||||
class PropertyTypeContainer(val subject: Property<caret>TypeMarked)
|
class PropertyTypeContainer(val subject: Property<caret>TypeMarked)
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
// "Add '@PropertyTypeMarker' annotation to 'PropertyTypeContainer'" "true"
|
// "Add '@PropertyTypeMarker' annotation to 'PropertyTypeContainer'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Add '@PropertyTypeMarker' annotation to containing class 'PropertyTypeContainer'
|
// ACTION: Add '@PropertyTypeMarker' annotation to containing class 'PropertyTypeContainer'
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class PropertyTypeMarker
|
annotation class PropertyTypeMarker
|
||||||
|
|
||||||
@PropertyTypeMarker
|
@PropertyTypeMarker
|
||||||
class PropertyTypeMarked
|
class PropertyTypeMarked
|
||||||
|
|
||||||
class PropertyTypeContainer @PropertyTypeMarker constructor(val subject: PropertyTypeMarked)
|
class PropertyTypeContainer @PropertyTypeMarker constructor(val subject: PropertyTypeMarked)
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
// "Add '-Xuse-experimental=kotlin.RequiresOptIn' to module light_idea_test_case compiler arguments" "true"
|
// "Add '-Xopt-in=kotlin.RequiresOptIn' to module light_idea_test_case compiler arguments" "true"
|
||||||
// COMPILER_ARGUMENTS: -version
|
// COMPILER_ARGUMENTS: -version
|
||||||
// COMPILER_ARGUMENTS_AFTER: -version -Xuse-experimental=kotlin.RequiresOptIn
|
// COMPILER_ARGUMENTS_AFTER: -version -Xopt-in=kotlin.RequiresOptIn
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental<caret>
|
@RequiresOptIn<caret>
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|||||||
+3
-3
@@ -1,8 +1,8 @@
|
|||||||
// "Add '-Xuse-experimental=kotlin.RequiresOptIn' to module light_idea_test_case compiler arguments" "true"
|
// "Add '-Xopt-in=kotlin.RequiresOptIn' to module light_idea_test_case compiler arguments" "true"
|
||||||
// COMPILER_ARGUMENTS: -version
|
// COMPILER_ARGUMENTS: -version
|
||||||
// COMPILER_ARGUMENTS_AFTER: -version -Xuse-experimental=kotlin.RequiresOptIn
|
// COMPILER_ARGUMENTS_AFTER: -version -Xopt-in=kotlin.RequiresOptIn
|
||||||
// DISABLE-ERRORS
|
// DISABLE-ERRORS
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class MyExperimentalAPI
|
annotation class MyExperimentalAPI
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
// "Add '@OptIn(AliasMarker::class)' annotation to 'AliasMarkerUsage'" "true"
|
// "Add '@OptIn(AliasMarker::class)' annotation to 'AliasMarkerUsage'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Add '-Xuse-experimental=AliasMarker' to module light_idea_test_case compiler arguments
|
// ACTION: Add '-Xopt-in=AliasMarker' to module light_idea_test_case compiler arguments
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class AliasMarker
|
annotation class AliasMarker
|
||||||
|
|
||||||
@AliasMarker
|
@AliasMarker
|
||||||
|
|||||||
+3
-3
@@ -1,9 +1,9 @@
|
|||||||
// "Add '@OptIn(AliasMarker::class)' annotation to 'AliasMarkerUsage'" "true"
|
// "Add '@OptIn(AliasMarker::class)' annotation to 'AliasMarkerUsage'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
// ACTION: Add '-Xuse-experimental=AliasMarker' to module light_idea_test_case compiler arguments
|
// ACTION: Add '-Xopt-in=AliasMarker' to module light_idea_test_case compiler arguments
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class AliasMarker
|
annotation class AliasMarker
|
||||||
|
|
||||||
@AliasMarker
|
@AliasMarker
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@TopMarker' annotation to 'topUserVal'" "true"
|
// "Add '@TopMarker' annotation to 'topUserVal'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class TopMarker
|
annotation class TopMarker
|
||||||
|
|
||||||
@TopMarker
|
@TopMarker
|
||||||
@@ -12,4 +12,4 @@ class TopClass
|
|||||||
@TopMarker
|
@TopMarker
|
||||||
annotation class TopAnn
|
annotation class TopAnn
|
||||||
|
|
||||||
val topUserVal: @TopAnn <caret>TopClass? = null
|
val topUserVal: @TopAnn <caret>TopClass? = null
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
// "Add '@TopMarker' annotation to 'topUserVal'" "true"
|
// "Add '@TopMarker' annotation to 'topUserVal'" "true"
|
||||||
// COMPILER_ARGUMENTS: -Xuse-experimental=kotlin.Experimental
|
// COMPILER_ARGUMENTS: -Xopt-in=kotlin.RequiresOptIn
|
||||||
// WITH_RUNTIME
|
// WITH_RUNTIME
|
||||||
|
|
||||||
@Experimental
|
@RequiresOptIn
|
||||||
annotation class TopMarker
|
annotation class TopMarker
|
||||||
|
|
||||||
@TopMarker
|
@TopMarker
|
||||||
@@ -13,4 +13,4 @@ class TopClass
|
|||||||
annotation class TopAnn
|
annotation class TopAnn
|
||||||
|
|
||||||
@TopMarker
|
@TopMarker
|
||||||
val topUserVal: @TopAnn TopClass? = null
|
val topUserVal: @TopAnn TopClass? = null
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package test
|
|||||||
|
|
||||||
import kotlin.contracts.*
|
import kotlin.contracts.*
|
||||||
|
|
||||||
@UseExperimental(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
fun myRequire(x: Boolean) {
|
fun myRequire(x: Boolean) {
|
||||||
contract {
|
contract {
|
||||||
returns() implies x
|
returns() implies x
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ package test
|
|||||||
|
|
||||||
import kotlin.contracts.*
|
import kotlin.contracts.*
|
||||||
|
|
||||||
@UseExperimental(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
fun myRequire(x: Boolean) {
|
fun myRequire(x: Boolean) {
|
||||||
contract {
|
contract {
|
||||||
returns() implies x
|
returns() implies x
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package test
|
|||||||
|
|
||||||
import kotlin.contracts.*
|
import kotlin.contracts.*
|
||||||
|
|
||||||
@UseExperimental(ExperimentalContracts::class)
|
@OptIn(ExperimentalContracts::class)
|
||||||
fun myRequire(x: Boolean) {
|
fun myRequire(x: Boolean) {
|
||||||
contract {
|
contract {
|
||||||
returns() implies x
|
returns() implies x
|
||||||
|
|||||||
@@ -234,7 +234,7 @@ open class MultiModuleHighlightingTest : AbstractMultiModuleHighlightingTest() {
|
|||||||
val lib = MockLibraryUtil.compileJvmLibraryToJar(
|
val lib = MockLibraryUtil.compileJvmLibraryToJar(
|
||||||
testDataPath + "${getTestName(true)}/lib", "lib",
|
testDataPath + "${getTestName(true)}/lib", "lib",
|
||||||
extraOptions = listOf(
|
extraOptions = listOf(
|
||||||
"-Xuse-experimental=kotlin.Experimental",
|
"-Xopt-in=kotlin.RequiresOptIn",
|
||||||
"-Xexperimental=lib.ExperimentalAPI"
|
"-Xexperimental=lib.ExperimentalAPI"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
@@ -247,7 +247,7 @@ open class MultiModuleHighlightingTest : AbstractMultiModuleHighlightingTest() {
|
|||||||
val lib = MockLibraryUtil.compileJsLibraryToJar(
|
val lib = MockLibraryUtil.compileJsLibraryToJar(
|
||||||
testDataPath + "${getTestName(true)}/lib", "lib", false,
|
testDataPath + "${getTestName(true)}/lib", "lib", false,
|
||||||
extraOptions = listOf(
|
extraOptions = listOf(
|
||||||
"-Xuse-experimental=kotlin.Experimental",
|
"-Xopt-in=kotlin.RequiresOptIn",
|
||||||
"-Xexperimental=lib.ExperimentalAPI"
|
"-Xexperimental=lib.ExperimentalAPI"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user