Use -opt-in instead of -Xopt-in in comments and scripts

This commit is contained in:
Mikhail Glukhikh
2021-09-06 14:19:51 +03:00
parent 8ad540953e
commit ffbd574a08
30 changed files with 80 additions and 80 deletions
@@ -327,7 +327,7 @@ class ExperimentalUsageChecker(project: Project) : CallChecker {
reportWarning: (String) -> Unit
) {
// Ideally, we should run full resolution (with all classifier usage checkers) on classifiers used in
// "-Xopt-in" arguments. However, it's not easy to do this. This should be solved in the future with the support of
// "-opt-in" arguments. However, it's not easy to do this. This should be solved in the future with the support of
// module annotations. For now, we only check deprecations because this is needed to correctly retire unneeded compiler arguments.
val deprecationResolver = DeprecationResolver(
LockBasedStorageManager("ExperimentalUsageChecker"),
@@ -56,7 +56,7 @@ fun <R> Function<R>.reflect(): KFunction<R>? {
*
* Any usage of a declaration annotated with `@ExperimentalReflectionOnLambdas` should be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalReflectionOnLambdas::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.reflect.jvm.ExperimentalReflectionOnLambdas`.
* or by using the compiler argument `-opt-in=kotlin.reflect.jvm.ExperimentalReflectionOnLambdas`.
*/
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
@Retention(AnnotationRetention.BINARY)
@@ -41,7 +41,7 @@ dependencies {
compileKotlin {
kotlinOptions {
freeCompilerArgs = ['-Xopt-in=kotlin.ExperimentalUnsignedTypes', '-Xskip-metadata-version-check']
freeCompilerArgs = ['-opt-in=kotlin.ExperimentalUnsignedTypes', '-Xskip-metadata-version-check']
allWarningsAsErrors=true
}
}
+6 -6
View File
@@ -36,7 +36,7 @@ sourceSets {
compileCompilerKotlin {
kotlinOptions.jvmTarget = "1.8"
kotlinOptions.allWarningsAsErrors=true
kotlinOptions.freeCompilerArgs += ['-Xopt-in=kotlin.RequiresOptIn', '-Xopt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI', '-Xskip-prerelease-check']
kotlinOptions.freeCompilerArgs += ['-opt-in=kotlin.RequiresOptIn', '-opt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI', '-Xskip-prerelease-check']
}
compileCli_bcKotlin {
@@ -185,11 +185,11 @@ targetList.each { target ->
args = [*konanArgs,
'-output', project(':kotlin-native:runtime').file("build/${target}Stdlib"),
'-produce', 'library', '-module-name', 'stdlib',
'-Xmulti-platform', '-Xopt-in=kotlin.RequiresOptIn',
'-Xopt-in=kotlin.contracts.ExperimentalContracts',
'-Xopt-in=kotlin.ExperimentalMultiplatform',
'-Xopt-in=kotlin.native.internal.InternalForKotlinNative',
'-Xopt-in=kotlin.native.SymbolNameIsDeprecated',
'-Xmulti-platform', '-opt-in=kotlin.RequiresOptIn',
'-opt-in=kotlin.contracts.ExperimentalContracts',
'-opt-in=kotlin.ExperimentalMultiplatform',
'-opt-in=kotlin.native.internal.InternalForKotlinNative',
'-opt-in=kotlin.native.SymbolNameIsDeprecated',
*commonSrc.toList(),
*testAnnotationCommon.toList(),
*testCommon.toList(),
+12 -12
View File
@@ -873,14 +873,14 @@ standaloneTest("cleaner_basic") {
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
!isNoopGC
source = "runtime/basic/cleaner_basic.kt"
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
}
standaloneTest("cleaner_workers") {
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
!isNoopGC
source = "runtime/basic/cleaner_workers.kt"
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
}
standaloneTest("cleaner_in_main_with_checker") {
@@ -927,7 +927,7 @@ standaloneTest("cleaner_in_tls_worker") {
enabled = (project.testTarget != 'wasm32') && // Cleaners need workers
!isNoopGC
source = "runtime/basic/cleaner_in_tls_worker.kt"
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
}
standaloneTest("worker_bound_reference0") {
@@ -1406,7 +1406,7 @@ task localClass_localHierarchy(type: KonanLocalTest) {
standaloneTest("objectDeclaration_globalConstants") {
disabled = (cacheTesting != null) // Cache is not compatible with -opt.
flags = ["-opt", "-Xopt-in=kotlin.native.internal.InternalForKotlinNative", "-tr"]
flags = ["-opt", "-opt-in=kotlin.native.internal.InternalForKotlinNative", "-tr"]
source = "codegen/objectDeclaration/globalConstants.kt"
}
@@ -1791,7 +1791,7 @@ linkTest("classDelegation_linkTest") {
}
standaloneTest("contracts") {
flags = [ '-Xopt-in=kotlin.RequiresOptIn', '-tr' ]
flags = [ '-opt-in=kotlin.RequiresOptIn', '-tr' ]
source = "codegen/contracts/contracts.kt"
}
@@ -3182,7 +3182,7 @@ standaloneTest("codegen_escapeAnalysis_stackAllocated") {
disabled = (cacheTesting != null) || // Cache is not compatible with -opt.
project.globalTestArgs.contains('-g') || // -g and -opt are incompatible
isExperimentalMM // TODO: Experimental MM doesn't support stack-allocated objects yet.
flags = ['-opt', '-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-opt', '-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
source = "codegen/escapeAnalysis/stackAllocated.kt"
}
@@ -3301,7 +3301,7 @@ standaloneTest("stress_gc_allocations") {
(project.testTarget != "watchos_simulator_arm64") &&
!isNoopGC
source = "runtime/memory/stress_gc_allocations.kt"
flags = ['-tr', '-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-tr', '-opt-in=kotlin.native.internal.InternalForKotlinNative']
}
standaloneTest("mpp1") {
@@ -4852,7 +4852,7 @@ if (PlatformInfo.isAppleTarget(project)) {
enabled = !isNoopGC
source = "interop/objc/kt42172/main.kt"
interop = "objc_kt42172"
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
useGoldenData = true
doBeforeBuild {
@@ -4985,7 +4985,7 @@ dynamicTest("interop_cleaners_main_thread") {
cSource = "$projectDir/interop/cleaners/main_thread.cpp"
clangTool = "clang++"
useGoldenData = true
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
}
dynamicTest("interop_cleaners_second_thread") {
@@ -4994,7 +4994,7 @@ dynamicTest("interop_cleaners_second_thread") {
cSource = "$projectDir/interop/cleaners/second_thread.cpp"
clangTool = "clang++"
useGoldenData = true
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
}
dynamicTest("interop_cleaners_leak") {
@@ -5003,7 +5003,7 @@ dynamicTest("interop_cleaners_leak") {
cSource = "$projectDir/interop/cleaners/leak.cpp"
clangTool = "clang++"
useGoldenData = true
flags = ['-Xopt-in=kotlin.native.internal.InternalForKotlinNative']
flags = ['-opt-in=kotlin.native.internal.InternalForKotlinNative']
}
dynamicTest("interop_migrating_main_thread_legacy") {
@@ -5598,7 +5598,7 @@ private void configureStdlibTest(KonanGTest task, boolean inWorker) {
enableMultiplatform true
extraOpts inWorker ? '-trw' : '-tr',
'-Xverify-ir',
'-Xopt-in=kotlin.RequiresOptIn,kotlin.ExperimentalStdlibApi',
'-opt-in=kotlin.RequiresOptIn,kotlin.ExperimentalStdlibApi',
"-friend-modules", project.rootProject.file("${UtilsKt.getKotlinNativeDist(project)}/klib/common/stdlib").absolutePath
extraOpts project.globalTestArgs
}
@@ -231,7 +231,7 @@ class RunExternalTestGroup extends JavaExec implements CompilerRunner {
def experimentalSettings = findLinesWithPrefixesRemoved(text, "// !USE_EXPERIMENTAL: ")
if (experimentalSettings.size() != 0) {
experimentalSettings.forEach { line ->
line.split(" ").toList().forEach { flags.add("-Xopt-in=$it") }
line.split(" ").toList().forEach { flags.add("-opt-in=$it") }
}
}
def expectActualLinker = findLinesWithPrefixesRemoved(text, "// EXPECT_ACTUAL_LINKER")
@@ -55,7 +55,7 @@ kotlin {
jvm().compilations.all {
kotlinOptions {
freeCompilerArgs = ["-Xopt-in=kotlinx.cli.ExperimentalCli", "-Xopt-in=kotlin.RequiresOptIn"]
freeCompilerArgs = ["-opt-in=kotlinx.cli.ExperimentalCli", "-opt-in=kotlin.RequiresOptIn"]
suppressWarnings = true
}
}
@@ -94,9 +94,9 @@ targetList.each { target ->
args = [*konanArgs,
'-output', outputFile,
'-produce', 'library', '-module-name', moduleName,
'-Xmulti-platform', '-Xopt-in=kotlinx.cli.ExperimentalCli',
'-Xopt-in=kotlin.ExperimentalMultiplatform',
'-Werror', '-Xopt-in=kotlin.RequiresOptIn',
'-Xmulti-platform', '-opt-in=kotlinx.cli.ExperimentalCli',
'-opt-in=kotlin.ExperimentalMultiplatform',
'-Werror', '-opt-in=kotlin.RequiresOptIn',
commonSrc.absolutePath,
"-Xcommon-sources=${commonSrc.absolutePath}",
nativeSrc]
@@ -15,7 +15,7 @@ import kotlin.annotation.AnnotationTarget.*
*
* Any usage of a declaration annotated with `@ExperimentalCli` must be accepted either by
* annotating that usage with the [UseExperimental] annotation, e.g. `@UseExperimental(ExperimentalCli::class)`,
* or by using the compiler argument `-Xopt-in=kotlinx.cli.ExperimentalCli`.
* or by using the compiler argument `-opt-in=kotlinx.cli.ExperimentalCli`.
*/
@RequiresOptIn("This API is experimental. It may be changed in the future without notice.", RequiresOptIn.Level.WARNING)
@Retention(AnnotationRetention.BINARY)
@@ -12,7 +12,7 @@ import kotlin.native.internal.*
*
* Any usage of a declaration annotated with `@ExperimentalAssociatedObjects` must be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalAssociatedObjects::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.reflect.ExperimentalAssociatedObjects`.
* or by using the compiler argument `-opt-in=kotlin.reflect.ExperimentalAssociatedObjects`.
*/
@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
@Retention(value = AnnotationRetention.BINARY)
+2 -2
View File
@@ -17,14 +17,14 @@ configureSourcesJar()
configureJavadocJar()
tasks.withType(org.jetbrains.kotlin.gradle.dsl.KotlinCompile) {
kotlinOptions.freeCompilerArgs += ["-Xallow-kotlin-package", "-Xopt-in=kotlin.RequiresOptIn"]
kotlinOptions.freeCompilerArgs += ["-Xallow-kotlin-package", "-opt-in=kotlin.RequiresOptIn"]
}
compileKotlinCommon {
kotlinOptions {
freeCompilerArgs += [
"-module-name", project.name,
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.contracts.ExperimentalContracts",
]
}
}
+2 -2
View File
@@ -16,8 +16,8 @@ dependencies {
compileKotlin2Js {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-Xopt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.RequiresOptIn",
]
kotlinOptions {
moduleKind = "umd"
+3 -3
View File
@@ -42,9 +42,9 @@ configureJavadocJar()
compileKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-Xsuppress-deprecated-jvm-target-warning",
"-Xopt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.RequiresOptIn",
]
kotlinOptions.moduleName = project.archivesBaseName
}
@@ -53,7 +53,7 @@ compileTestKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xsuppress-deprecated-jvm-target-warning",
"-Xopt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.RequiresOptIn",
]
}
+1 -1
View File
@@ -48,7 +48,7 @@ compileKotlin {
"-Xno-optimized-callable-references",
"-Xno-kotlin-nothing-value-exception",
"-Xsuppress-deprecated-jvm-target-warning",
"-Xopt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.RequiresOptIn",
]
moduleName = "kotlin-reflection"
}
+6 -6
View File
@@ -40,9 +40,9 @@ compileKotlinCommon {
kotlinOptions {
freeCompilerArgs = [
"-module-name", project.name,
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalMultiplatform",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalMultiplatform",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-Xallow-kotlin-package",
]
}
@@ -51,9 +51,9 @@ compileKotlinCommon {
compileTestKotlinCommon {
kotlinOptions {
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlin.ExperimentalStdlibApi",
]
}
}
@@ -21,7 +21,7 @@ public expect annotation class JsName(val name: String)
*
* Usages of such annotations will be reported as warnings unless an explicit opt-in with
* the [OptIn] annotation, e.g. `@OptIn(ExperimentalJsExport::class)`,
* or with the `-Xopt-in=kotlin.js.ExperimentalJsExport` compiler option is given.
* or with the `-opt-in=kotlin.js.ExperimentalJsExport` compiler option is given.
*/
@Suppress("DEPRECATION")
@Experimental(level = Experimental.Level.WARNING)
+6 -6
View File
@@ -70,8 +70,8 @@ compileKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-Xsuppress-deprecated-jvm-target-warning",
]
kotlinOptions.moduleName = project.name
@@ -81,10 +81,10 @@ compileTestKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmulti-platform",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-Xopt-in=kotlin.io.path.ExperimentalPathApi",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlin.io.path.ExperimentalPathApi",
"-Xcommon-sources=${fileTree('../test').join(',')}",
"-Xsuppress-deprecated-jvm-target-warning",
]
@@ -15,7 +15,7 @@ import kotlin.annotation.AnnotationTarget.*
*
* Any usage of a declaration annotated with `@ExperimentalPathApi` must be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalPathApi::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.io.path.ExperimentalPathApi`.
* or by using the compiler argument `-opt-in=kotlin.io.path.ExperimentalPathApi`.
*/
@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
@Retention(AnnotationRetention.BINARY)
+4 -4
View File
@@ -67,10 +67,10 @@ compileTestKotlin {
kotlinOptions.freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmulti-platform",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-Xopt-in=kotlin.io.path.ExperimentalPathApi",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlin.io.path.ExperimentalPathApi",
"-Xcommon-sources=${fileTree('../test').join(',')}",
]
}
+6 -6
View File
@@ -138,9 +138,9 @@ compileKotlin2Js {
outputFile = "${buildDir}/classes/main/kotlin.js"
sourceMap = true
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalMultiplatform",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalMultiplatform",
"-opt-in=kotlin.contracts.ExperimentalContracts",
]
}
}
@@ -149,9 +149,9 @@ compileTestKotlin2Js {
kotlinOptions {
moduleKind = "umd"
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlin.ExperimentalStdlibApi",
]
}
}
@@ -12,7 +12,7 @@ import findAssociatedObject
*
* Any usage of a declaration annotated with `@ExperimentalAssociatedObjects` must be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalAssociatedObjects::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.reflect.ExperimentalAssociatedObjects`.
* or by using the compiler argument `-opt-in=kotlin.reflect.ExperimentalAssociatedObjects`.
*/
@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
@Retention(value = AnnotationRetention.BINARY)
+7 -7
View File
@@ -116,9 +116,9 @@ compileKotlin {
freeCompilerArgs = [
"-Xallow-kotlin-package",
"-Xmultifile-parts-inherit",
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalMultiplatform",
"-Xopt-in=kotlin.contracts.ExperimentalContracts",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalMultiplatform",
"-opt-in=kotlin.contracts.ExperimentalContracts",
"-Xuse-14-inline-classes-mangling-scheme",
"-Xsuppress-deprecated-jvm-target-warning",
]
@@ -129,9 +129,9 @@ compileKotlin {
compileTestKotlin {
kotlinOptions {
freeCompilerArgs += [
"-Xopt-in=kotlin.RequiresOptIn",
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlin.RequiresOptIn",
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-Xsuppress-deprecated-jvm-target-warning",
]
// This is needed for JavaTypeTest; typeOf for non-reified type parameters doesn't work otherwise, for implementation reasons.
@@ -140,7 +140,7 @@ compileTestKotlin {
}
compileLongRunningTestKotlin {
kotlinOptions.freeCompilerArgs += "-Xopt-in=kotlin.ExperimentalStdlibApi"
kotlinOptions.freeCompilerArgs += "-opt-in=kotlin.ExperimentalStdlibApi"
}
task longRunningTest(type: Test, dependsOn: longRunningTestClasses) {
+3 -3
View File
@@ -12,9 +12,9 @@ sourceSets {
compileTestKotlin {
kotlinOptions {
freeCompilerArgs = [
"-Xopt-in=kotlin.ExperimentalStdlibApi",
"-Xopt-in=kotlin.ExperimentalUnsignedTypes",
"-Xopt-in=kotlin.time.ExperimentalTime",
"-opt-in=kotlin.ExperimentalStdlibApi",
"-opt-in=kotlin.ExperimentalUnsignedTypes",
"-opt-in=kotlin.time.ExperimentalTime",
]
}
}
@@ -12,7 +12,7 @@ import kotlin.annotation.AnnotationTarget.*
*
* Any usage of a declaration annotated with `@ExperimentalStdlibApi` must be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalStdlibApi::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.ExperimentalStdlibApi`.
* or by using the compiler argument `-opt-in=kotlin.ExperimentalStdlibApi`.
*/
@Suppress("DEPRECATION")
@Experimental(level = Experimental.Level.ERROR)
@@ -14,7 +14,7 @@ import kotlin.internal.RequireKotlinVersionKind
*
* Any usage of a declaration annotated with `@ExperimentalMultiplatform` must be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalMultiplatform::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.ExperimentalMultiplatform`.
* or by using the compiler argument `-opt-in=kotlin.ExperimentalMultiplatform`.
*/
@Suppress("DEPRECATION")
@Experimental
@@ -18,7 +18,7 @@ import kotlin.reflect.KClass
* Call sites of any declaration annotated with that marker should opt in to the API either by using [OptIn],
* or by being annotated with that marker themselves, effectively causing further propagation of the opt-in requirement.
*
* This class requires opt-in itself and can only be used with the compiler argument `-Xopt-in=kotlin.RequiresOptIn`.
* This class requires opt-in itself and can only be used with the compiler argument `-opt-in=kotlin.RequiresOptIn`.
*
* @property message message to be reported on usages of API without an explicit opt-in, or empty string for the default message.
* The default message is: "This declaration is experimental and its usage should be marked with 'Marker'
@@ -50,7 +50,7 @@ public annotation class RequiresOptIn(
* Allows to use the API denoted by the given markers in the annotated file, declaration, or expression.
* If a declaration is annotated with [OptIn], its usages are **not** required to opt in to that API.
*
* This class requires opt-in itself and can only be used with the compiler argument `-Xopt-in=kotlin.RequiresOptIn`.
* This class requires opt-in itself and can only be used with the compiler argument `-opt-in=kotlin.RequiresOptIn`.
*/
@Target(
CLASS, PROPERTY, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION, PROPERTY_GETTER, PROPERTY_SETTER, EXPRESSION, FILE, TYPEALIAS
@@ -14,7 +14,7 @@ import kotlin.internal.InlineOnly
*
* Any usage of a declaration annotated with `@ExperimentalContracts` must be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalContracts::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.contracts.ExperimentalContracts`.
* or by using the compiler argument `-opt-in=kotlin.contracts.ExperimentalContracts`.
*/
@Suppress("DEPRECATION")
@Retention(AnnotationRetention.BINARY)
@@ -10,7 +10,7 @@ package kotlin.experimental
*
* Any usage of a declaration annotated with `@ExperimentalTypeInference` must be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalTypeInference::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.experimental.ExperimentalTypeInference`.
* or by using the compiler argument `-opt-in=kotlin.experimental.ExperimentalTypeInference`.
*/
@Suppress("DEPRECATION")
@Experimental(level = Experimental.Level.ERROR)
@@ -16,7 +16,7 @@ import kotlin.annotation.AnnotationTarget.*
*
* Any usage of a declaration annotated with `@ExperimentalTime` must be accepted either by
* annotating that usage with the [OptIn] annotation, e.g. `@OptIn(ExperimentalTime::class)`,
* or by using the compiler argument `-Xopt-in=kotlin.time.ExperimentalTime`.
* or by using the compiler argument `-opt-in=kotlin.time.ExperimentalTime`.
*/
@Suppress("DEPRECATION")
@Experimental(level = Experimental.Level.ERROR)
@@ -15,7 +15,7 @@ import kotlin.internal.RequireKotlinVersionKind
*
* Usages of such API will be reported as warnings unless an explicit opt-in with
* the [OptIn] annotation, e.g. `@OptIn(ExperimentalUnsignedTypes::class)`,
* or with the `-Xopt-in=kotlin.ExperimentalUnsignedTypes` compiler option is given.
* or with the `-opt-in=kotlin.ExperimentalUnsignedTypes` compiler option is given.
*
* It's recommended to propagate the experimental status to the API that depends on unsigned types by annotating it with this annotation.
*/
@@ -76,7 +76,7 @@
<jvmTarget>1.8</jvmTarget>
<args>
<arg>-Xjvm-default=enable</arg>
<arg>-Xopt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI</arg>
<arg>-opt-in=org.jetbrains.kotlin.ir.ObsoleteDescriptorBasedAPI</arg>
</args>
</configuration>
</plugin>