Rename UseExperimental->OptIn, Experimental->RequiresOptIn in compiler tests

This commit is contained in:
Alexander Udalov
2019-12-18 20:03:42 +01:00
parent b839b905b5
commit 7742a3b697
137 changed files with 416 additions and 416 deletions
@@ -1,6 +1,6 @@
$TESTDATA_DIR$/experimentalAndUseExperimentalWithSameAnnotation.kt $TESTDATA_DIR$/experimentalAndUseExperimentalWithSameAnnotation.kt
-d -d
$TEMP_DIR$ $TEMP_DIR$
-Xuse-experimental=kotlin.Experimental -Xopt-in=kotlin.RequiresOptIn
-Xexperimental=org.test.ExperimentalAPI -Xexperimental=org.test.ExperimentalAPI
-Xuse-experimental=org.test.ExperimentalAPI -Xopt-in=org.test.ExperimentalAPI
@@ -1,4 +1,4 @@
package org.test package org.test
@Experimental @RequiresOptIn
annotation class ExperimentalAPI annotation class ExperimentalAPI
+3 -3
View File
@@ -1,8 +1,8 @@
$TESTDATA_DIR$/experimentalDeprecated.kt $TESTDATA_DIR$/experimentalDeprecated.kt
-d -d
$TEMP_DIR$ $TEMP_DIR$
-Xuse-experimental=kotlin.Experimental -Xopt-in=kotlin.RequiresOptIn
-Xexperimental=org.test.Error1 -Xexperimental=org.test.Error1
-Xexperimental=org.test.Hidden1 -Xexperimental=org.test.Hidden1
-Xuse-experimental=org.test.Error2 -Xopt-in=org.test.Error2
-Xuse-experimental=org.test.Hidden2 -Xopt-in=org.test.Hidden2
+4 -4
View File
@@ -1,17 +1,17 @@
package org.test package org.test
@Deprecated("Error1", level = DeprecationLevel.ERROR) @Deprecated("Error1", level = DeprecationLevel.ERROR)
@Experimental @RequiresOptIn
annotation class Error1 annotation class Error1
@Deprecated("Error2", level = DeprecationLevel.ERROR) @Deprecated("Error2", level = DeprecationLevel.ERROR)
@Experimental @RequiresOptIn
annotation class Error2 annotation class Error2
@Deprecated("Hidden1", level = DeprecationLevel.HIDDEN) @Deprecated("Hidden1", level = DeprecationLevel.HIDDEN)
@Experimental @RequiresOptIn
annotation class Hidden1 annotation class Hidden1
@Deprecated("Hidden2", level = DeprecationLevel.HIDDEN) @Deprecated("Hidden2", level = DeprecationLevel.HIDDEN)
@Experimental @RequiresOptIn
annotation class Hidden2 annotation class Hidden2
@@ -1,6 +1,6 @@
$TESTDATA_DIR$/experimentalDeprecatedWarning.kt $TESTDATA_DIR$/experimentalDeprecatedWarning.kt
-d -d
$TEMP_DIR$ $TEMP_DIR$
-Xuse-experimental=kotlin.Experimental -Xopt-in=kotlin.RequiresOptIn
-Xuse-experimental=org.test.Warning1 -Xopt-in=org.test.Warning1
-Xexperimental=org.test.Warning2 -Xexperimental=org.test.Warning2
+2 -2
View File
@@ -1,9 +1,9 @@
package org.test package org.test
@Deprecated("Warning1", level = DeprecationLevel.WARNING) @Deprecated("Warning1", level = DeprecationLevel.WARNING)
@Experimental @RequiresOptIn
annotation class Warning1 annotation class Warning1
@Deprecated("Warning2", level = DeprecationLevel.WARNING) @Deprecated("Warning2", level = DeprecationLevel.WARNING)
@Experimental @RequiresOptIn
annotation class Warning2 annotation class Warning2
+1 -1
View File
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/experimentalIsNotAnnotation.kt
-d -d
$TEMP_DIR$ $TEMP_DIR$
-Xexperimental=org.test.NotAnAnnotation1 -Xexperimental=org.test.NotAnAnnotation1
-Xuse-experimental=org.test.NotAnAnnotation2 -Xopt-in=org.test.NotAnAnnotation2
+1 -1
View File
@@ -2,4 +2,4 @@ $TESTDATA_DIR$/experimentalIsNotMarker.kt
-d -d
$TEMP_DIR$ $TEMP_DIR$
-Xexperimental=org.test.NotAMarker1 -Xexperimental=org.test.NotAMarker1
-Xuse-experimental=org.test.NotAMarker2 -Xopt-in=org.test.NotAMarker2
+1 -1
View File
@@ -1,5 +1,5 @@
$TESTDATA_DIR$/experimentalNested.kt $TESTDATA_DIR$/experimentalNested.kt
-d -d
$TEMP_DIR$ $TEMP_DIR$
-Xuse-experimental=kotlin.Experimental -Xopt-in=kotlin.RequiresOptIn
-Xexperimental=org.test.Outer.Nested -Xexperimental=org.test.Outer.Nested
+1 -1
View File
@@ -1,7 +1,7 @@
package org.test package org.test
class Outer { class Outer {
@Experimental @RequiresOptIn
annotation class Nested annotation class Nested
} }
+2 -2
View File
@@ -1,6 +1,6 @@
$TESTDATA_DIR$/experimentalUnresolved.kt $TESTDATA_DIR$/experimentalUnresolved.kt
-d -d
$TEMP_DIR$ $TEMP_DIR$
-Xuse-experimental=org.test.Unresolved1 -Xopt-in=org.test.Unresolved1
-Xexperimental=org.test.Unresolved2 -Xexperimental=org.test.Unresolved2
-Xuse-experimental=org.test.Unresolved3 -Xopt-in=org.test.Unresolved3
@@ -20,7 +20,7 @@ interface AsyncIterator<out T> {
operator suspend fun next(): T operator suspend fun next(): T
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <T> asyncGenerate(@BuilderInference block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> { fun <T> asyncGenerate(@BuilderInference block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> {
override fun iterator(): AsyncIterator<T> { override fun iterator(): AsyncIterator<T> {
val iterator = AsyncGeneratorIterator<T>() val iterator = AsyncGeneratorIterator<T>()
@@ -21,7 +21,7 @@ interface AsyncIterator<out T> {
operator suspend fun next(): T operator suspend fun next(): T
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <T> asyncGenerate(@BuilderInference block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> { fun <T> asyncGenerate(@BuilderInference block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> {
override fun iterator(): AsyncIterator<T> { override fun iterator(): AsyncIterator<T> {
val iterator = AsyncGeneratorIterator<T>() val iterator = AsyncGeneratorIterator<T>()
@@ -20,7 +20,7 @@ interface AsyncIterator<out T> {
operator suspend fun next(): T operator suspend fun next(): T
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <T> asyncGenerate(@BuilderInference block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> { fun <T> asyncGenerate(@BuilderInference block: suspend AsyncGenerator<T>.() -> Unit): AsyncSequence<T> = object : AsyncSequence<T> {
override fun iterator(): AsyncIterator<T> { override fun iterator(): AsyncIterator<T> {
val iterator = AsyncGeneratorIterator<T>() val iterator = AsyncGeneratorIterator<T>()
@@ -8,7 +8,7 @@ interface Foo<T>
class FooImpl<T> : Foo<T> class FooImpl<T> : Foo<T>
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <T> myflow(@BuilderInference block: Foo<T>.() -> Unit): Foo<T> { fun <T> myflow(@BuilderInference block: Foo<T>.() -> Unit): Foo<T> {
val impl = FooImpl<T>() val impl = FooImpl<T>()
impl.block() impl.block()
+1 -1
View File
@@ -16,7 +16,7 @@ fun myLaunch(
block: suspend MyCoroutineScope.() -> Unit block: suspend MyCoroutineScope.() -> Unit
) {} ) {}
@UseExperimental(kotlin.experimental.ExperimentalTypeInference::class) @OptIn(kotlin.experimental.ExperimentalTypeInference::class)
public fun <E> myProduce(@BuilderInference block: suspend MyProducerScope<E>.() -> Unit) {} public fun <E> myProduce(@BuilderInference block: suspend MyProducerScope<E>.() -> Unit) {}
fun <T> MyReceiveChannel<T>.debounce(period: Long) { fun <T> MyReceiveChannel<T>.debounce(period: Long) {
+1 -1
View File
@@ -2,7 +2,7 @@
// IGNORE_BACKEND_FIR: JVM_IR // IGNORE_BACKEND_FIR: JVM_IR
// WITH_RUNTIME // WITH_RUNTIME
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
package test package test
@@ -22,7 +22,7 @@ interface LiveDataScope<T> {
suspend fun emit(value: T) suspend fun emit(value: T)
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <T> liveData(@BuilderInference block: suspend LiveDataScope<T>.() -> Unit): LiveData<T> = null!! fun <T> liveData(@BuilderInference block: suspend LiveDataScope<T>.() -> Unit): LiveData<T> = null!!
fun <Value> Flow<Value>.asLiveData() = liveData { fun <Value> Flow<Value>.asLiveData() = liveData {
@@ -10,7 +10,7 @@ fun main(args: Array<String>) {
println(s.toList()) println(s.toList())
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
@BuilderInference @BuilderInference
suspend fun SequenceScope<Int>.awaitSeq(): Int = 42 suspend fun SequenceScope<Int>.awaitSeq(): Int = 42
@@ -1,6 +1,6 @@
// !LANGUAGE: +NewInference // !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
import kotlin.reflect.KSuspendFunction0 import kotlin.reflect.KSuspendFunction0
import kotlin.reflect.KSuspendFunction1 import kotlin.reflect.KSuspendFunction1
@@ -1,6 +1,6 @@
// !LANGUAGE: +NewInference // !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -12,7 +12,7 @@ interface ProducerScope<E> {
class CoroutineScope class CoroutineScope
class ReceiveChannel<E> class ReceiveChannel<E>
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
public fun <E> produce(@BuilderInference block: suspend ProducerScope<E>.() -> Unit): ProducerScope<E> = TODO() public fun <E> produce(@BuilderInference block: suspend ProducerScope<E>.() -> Unit): ProducerScope<E> = TODO()
fun test(ls: List<Int>) = fun test(ls: List<Int>) =
@@ -1,6 +1,6 @@
package package
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ E> produce(/*0*/ @kotlin.BuilderInference block: suspend ProducerScope<E>.() -> kotlin.Unit): ProducerScope<E> @kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ E> produce(/*0*/ @kotlin.BuilderInference block: suspend ProducerScope<E>.() -> kotlin.Unit): ProducerScope<E>
public fun test(/*0*/ ls: kotlin.collections.List<kotlin.Int>): ProducerScope<kotlin.Int> public fun test(/*0*/ ls: kotlin.collections.List<kotlin.Int>): ProducerScope<kotlin.Int>
private fun </*0*/ E> kotlin.collections.Iterable<E>.asReceiveChannel(): ReceiveChannel<E> private fun </*0*/ E> kotlin.collections.Iterable<E>.asReceiveChannel(): ReceiveChannel<E>
public suspend fun </*0*/ E, /*1*/ C> ReceiveChannel<E>.toChannel(/*0*/ destination: C): C public suspend fun </*0*/ E, /*1*/ C> ReceiveChannel<E>.toChannel(/*0*/ destination: C): C
@@ -1,6 +1,6 @@
// !LANGUAGE: +NewInference // !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -9,7 +9,7 @@ suspend fun main() {
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <K> iFlow(@BuilderInference block: suspend iFlowCollector<in K>.() -> Unit): iFlow<K> = TODO() fun <K> iFlow(@BuilderInference block: suspend iFlowCollector<in K>.() -> Unit): iFlow<K> = TODO()
interface iFlowCollector<S> { interface iFlowCollector<S> {
@@ -1,6 +1,6 @@
package package
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ K> iFlow(/*0*/ @kotlin.BuilderInference block: suspend iFlowCollector<in K>.() -> kotlin.Unit): iFlow<K> @kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ K> iFlow(/*0*/ @kotlin.BuilderInference block: suspend iFlowCollector<in K>.() -> kotlin.Unit): iFlow<K>
public suspend fun main(): kotlin.Unit public suspend fun main(): kotlin.Unit
public interface iFlow</*0*/ out V> { public interface iFlow</*0*/ out V> {
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,9 +1,9 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !WITH_NEW_INFERENCE // !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE // NI_EXPECTED_FILE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,9 +1,9 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !WITH_NEW_INFERENCE // !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE // NI_EXPECTED_FILE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
// !WITH_NEW_INFERENCE // !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE // NI_EXPECTED_FILE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,5 +1,5 @@
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -7,7 +7,7 @@ interface Inv<T> {
fun send(e: T) fun send(e: T)
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <K> foo(@BuilderInference block: Inv<K>.() -> Unit) {} fun <K> foo(@BuilderInference block: Inv<K>.() -> Unit) {}
fun test(i: Int) { fun test(i: Int) {
@@ -1,6 +1,6 @@
package package
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ K> foo(/*0*/ @kotlin.BuilderInference block: Inv<K>.() -> kotlin.Unit): kotlin.Unit @kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ K> foo(/*0*/ @kotlin.BuilderInference block: Inv<K>.() -> kotlin.Unit): kotlin.Unit
public fun test(/*0*/ i: kotlin.Int): kotlin.Unit public fun test(/*0*/ i: kotlin.Int): kotlin.Unit
public interface Inv</*0*/ T> { public interface Inv</*0*/ T> {
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
// !WITH_NEW_INFERENCE // !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE // NI_EXPECTED_FILE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,4 +1,4 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
// FILE: a.kt // FILE: a.kt
@@ -19,7 +19,7 @@ public class Queue {
// FILE: c.kt // FILE: c.kt
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
package c package c
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// !WITH_NEW_INFERENCE // !WITH_NEW_INFERENCE
// NI_EXPECTED_FILE // NI_EXPECTED_FILE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,6 +1,6 @@
// !LANGUAGE: +NewInference // !LANGUAGE: +NewInference
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -8,7 +8,7 @@ interface ProducerScope<E> {
fun yield(e: E) fun yield(e: E)
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <E> produce(@BuilderInference block: ProducerScope<E>.() -> Unit): ProducerScope<E> = TODO() fun <E> produce(@BuilderInference block: ProducerScope<E>.() -> Unit): ProducerScope<E> = TODO()
fun <K> filter(e: K, predicate: (K) -> Boolean) = fun <K> filter(e: K, predicate: (K) -> Boolean) =
@@ -1,7 +1,7 @@
package package
public fun </*0*/ K> filter(/*0*/ e: K, /*1*/ predicate: (K) -> kotlin.Boolean): ProducerScope<kotlin.Int> public fun </*0*/ K> filter(/*0*/ e: K, /*1*/ predicate: (K) -> kotlin.Boolean): ProducerScope<kotlin.Int>
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ E> produce(/*0*/ @kotlin.BuilderInference block: ProducerScope<E>.() -> kotlin.Unit): ProducerScope<E> @kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ E> produce(/*0*/ @kotlin.BuilderInference block: ProducerScope<E>.() -> kotlin.Unit): ProducerScope<E>
public interface ProducerScope</*0*/ E> { public interface ProducerScope</*0*/ E> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.Experimental
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -9,7 +9,7 @@ interface ProducerScope<E> {
fun yield(e: E) fun yield(e: E)
} }
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <E> produce(@BuilderInference block: ProducerScope<E>.() -> Unit): ProducerScope<E> = TODO() fun <E> produce(@BuilderInference block: ProducerScope<E>.() -> Unit): ProducerScope<E> = TODO()
fun <K> filter(e: K, predicate: (K) -> Boolean) = fun <K> filter(e: K, predicate: (K) -> Boolean) =
@@ -1,7 +1,7 @@
package package
public fun </*0*/ K> filter(/*0*/ e: K, /*1*/ predicate: (K) -> kotlin.Boolean): ProducerScope<kotlin.Int> public fun </*0*/ K> filter(/*0*/ e: K, /*1*/ predicate: (K) -> kotlin.Boolean): ProducerScope<kotlin.Int>
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ E> produce(/*0*/ @kotlin.BuilderInference block: ProducerScope<E>.() -> kotlin.Unit): ProducerScope<E> @kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ E> produce(/*0*/ @kotlin.BuilderInference block: ProducerScope<E>.() -> kotlin.Unit): ProducerScope<E>
public interface ProducerScope</*0*/ E> { public interface ProducerScope</*0*/ E> {
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -1,7 +1,7 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,5 +1,5 @@
// !LANGUAGE: +NewInference // !LANGUAGE: +NewInference
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_EXPRESSION -UNUSED_PARAMETER -UNUSED_VARIABLE
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -18,7 +18,7 @@ class Foo<T>
fun <T> f1(f: Foo<T>.() -> Unit) {} fun <T> f1(f: Foo<T>.() -> Unit) {}
@UseExperimental(ExperimentalTypeInference::class) @OptIn(ExperimentalTypeInference::class)
fun <T> f2(@BuilderInference f: Foo<T>.() -> Unit) { fun <T> f2(@BuilderInference f: Foo<T>.() -> Unit) {
} }
@@ -1,7 +1,7 @@
package package
public fun </*0*/ T> f1(/*0*/ f: Foo<T>.() -> kotlin.Unit): kotlin.Unit public fun </*0*/ T> f1(/*0*/ f: Foo<T>.() -> kotlin.Unit): kotlin.Unit
@kotlin.UseExperimental(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ T> f2(/*0*/ @kotlin.BuilderInference f: Foo<T>.() -> kotlin.Unit): kotlin.Unit @kotlin.OptIn(markerClass = {kotlin.experimental.ExperimentalTypeInference::class}) public fun </*0*/ T> f2(/*0*/ @kotlin.BuilderInference f: Foo<T>.() -> kotlin.Unit): kotlin.Unit
public fun test1(): kotlin.Unit public fun test1(): kotlin.Unit
public fun test2(): [ERROR : Error function type] public fun test2(): [ERROR : Error function type]
public fun test3(): kotlin.Unit public fun test3(): kotlin.Unit
@@ -1,8 +1,8 @@
// !LANGUAGE: +ReleaseCoroutines +ExperimentalBuilderInference // !LANGUAGE: +ReleaseCoroutines +ExperimentalBuilderInference
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// SKIP_TXT // SKIP_TXT
@file:UseExperimental(ExperimentalTypeInference::class) @file:OptIn(ExperimentalTypeInference::class)
import kotlin.experimental.ExperimentalTypeInference import kotlin.experimental.ExperimentalTypeInference
@@ -1,10 +1,10 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS, @Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS,
AnnotationTarget.VALUE_PARAMETER) AnnotationTarget.VALUE_PARAMETER)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -65,41 +65,41 @@ package usage2
import api.* import api.*
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
@EAnno fun function() {} @EAnno fun function() {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun parameter(@EAnno p: String) {} fun parameter(@EAnno p: String) {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun parameterType(p: @EAnno String) {} fun parameterType(p: @EAnno String) {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun returnType(): @EAnno Unit {} fun returnType(): @EAnno Unit {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
@EAnno val property = "" @EAnno val property = ""
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
@EAnno typealias Typealias = Unit @EAnno typealias Typealias = Unit
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
@EAnno class Klass @EAnno class Klass
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
annotation class AnnotationArgument(val p: EAnno) annotation class AnnotationArgument(val p: EAnno)
fun insideBody() { fun insideBody() {
@UseExperimental(ExperimentalAPI::class) @EAnno fun local() {} @OptIn(ExperimentalAPI::class) @EAnno fun local() {}
} }
fun inDefaultArgument(@UseExperimental(ExperimentalAPI::class) f: () -> Unit = @EAnno fun() {}) {} fun inDefaultArgument(@OptIn(ExperimentalAPI::class) f: () -> Unit = @EAnno fun() {}) {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
val inProperty = @EAnno fun() {} val inProperty = @EAnno fun() {}
val inPropertyAccessor: () -> Unit val inPropertyAccessor: () -> Unit
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
get() = @EAnno fun() {} get() = @EAnno fun() {}
// FILE: usage-none.kt // FILE: usage-none.kt
@@ -1,10 +1,10 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_PARAMETER
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS, @Target(AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS,
AnnotationTarget.VALUE_PARAMETER) AnnotationTarget.VALUE_PARAMETER)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -65,41 +65,41 @@ package usage2
import api.* import api.*
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
@EAnno fun function() {} @EAnno fun function() {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun parameter(@EAnno p: String) {} fun parameter(@EAnno p: String) {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun parameterType(p: @EAnno String) {} fun parameterType(p: @EAnno String) {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun returnType(): @EAnno Unit {} fun returnType(): @EAnno Unit {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
@EAnno val property = "" @EAnno val property = ""
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
@EAnno typealias Typealias = Unit @EAnno typealias Typealias = Unit
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
@EAnno class Klass @EAnno class Klass
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
annotation class AnnotationArgument(val p: EAnno) annotation class AnnotationArgument(val p: EAnno)
fun insideBody() { fun insideBody() {
@UseExperimental(ExperimentalAPI::class) @EAnno fun local() {} @OptIn(ExperimentalAPI::class) @EAnno fun local() {}
} }
fun inDefaultArgument(@UseExperimental(ExperimentalAPI::class) f: () -> Unit = @EAnno fun() {}) {} fun inDefaultArgument(@OptIn(ExperimentalAPI::class) f: () -> Unit = @EAnno fun() {}) {}
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
val inProperty = @EAnno fun() {} val inProperty = @EAnno fun() {}
val inPropertyAccessor: () -> Unit val inPropertyAccessor: () -> Unit
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
get() = @EAnno fun() {} get() = @EAnno fun() {}
// FILE: usage-none.kt // FILE: usage-none.kt
@@ -9,7 +9,7 @@ package api {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS, AnnotationTarget.VALUE_PARAMETER}) public final annotation class ExperimentalAPI : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.TYPE, AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY, AnnotationTarget.TYPEALIAS, AnnotationTarget.VALUE_PARAMETER}) public final annotation class ExperimentalAPI : kotlin.Annotation {
public constructor ExperimentalAPI() public constructor ExperimentalAPI()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -46,17 +46,17 @@ package usage1 {
} }
package usage2 { package usage2 {
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public val inProperty: () -> kotlin.Unit @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public val inProperty: () -> kotlin.Unit
@get:kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public val inPropertyAccessor: () -> kotlin.Unit @get:kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public val inPropertyAccessor: () -> kotlin.Unit
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public val property: kotlin.String = "" @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public val property: kotlin.String = ""
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public fun function(): kotlin.Unit @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public fun function(): kotlin.Unit
public fun inDefaultArgument(/*0*/ @kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) f: () -> kotlin.Unit = ...): kotlin.Unit public fun inDefaultArgument(/*0*/ @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) f: () -> kotlin.Unit = ...): kotlin.Unit
public fun insideBody(): kotlin.Unit public fun insideBody(): kotlin.Unit
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun parameter(/*0*/ @api.EAnno p: kotlin.String): kotlin.Unit @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public fun parameter(/*0*/ @api.EAnno p: kotlin.String): kotlin.Unit
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun parameterType(/*0*/ p: @api.EAnno kotlin.String): kotlin.Unit @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public fun parameterType(/*0*/ p: @api.EAnno kotlin.String): kotlin.Unit
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun returnType(): @api.EAnno kotlin.Unit @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public fun returnType(): @api.EAnno kotlin.Unit
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public final annotation class AnnotationArgument : kotlin.Annotation { @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public final annotation class AnnotationArgument : kotlin.Annotation {
public constructor AnnotationArgument(/*0*/ p: api.EAnno) public constructor AnnotationArgument(/*0*/ p: api.EAnno)
public final val p: api.EAnno public final val p: api.EAnno
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -64,13 +64,13 @@ package usage2 {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public final class Klass { @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public final class Klass {
public constructor Klass() public constructor Klass()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public typealias Typealias = kotlin.Unit @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) @api.EAnno public typealias Typealias = kotlin.Unit
} }
package usage3 { package usage3 {
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class ExperimentalAPI annotation class ExperimentalAPI
interface I interface I
@@ -19,12 +19,12 @@ import api.*
open class Base(val i: I) open class Base(val i: I)
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
class Derived : Base(Impl()) class Derived : Base(Impl())
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
class Delegated : I by Impl() class Delegated : I by Impl()
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
val delegatedProperty by Impl() val delegatedProperty by Impl()
operator fun I.getValue(x: Any?, y: Any?) = null operator fun I.getValue(x: Any?, y: Any?) = null
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class ExperimentalAPI annotation class ExperimentalAPI
interface I interface I
@@ -19,12 +19,12 @@ import api.*
open class Base(val i: I) open class Base(val i: I)
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
class Derived : Base(Impl()) class Derived : Base(Impl())
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
class Delegated : I by Impl() class Delegated : I by Impl()
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
val delegatedProperty by Impl() val delegatedProperty by Impl()
operator fun I.getValue(x: Any?, y: Any?) = null operator fun I.getValue(x: Any?, y: Any?) = null
@@ -2,7 +2,7 @@ package
package api { package api {
@kotlin.Experimental(level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation {
public constructor ExperimentalAPI() public constructor ExperimentalAPI()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -24,7 +24,7 @@ package api {
} }
package usage { package usage {
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public val delegatedProperty: kotlin.Nothing? @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public val delegatedProperty: kotlin.Nothing?
public operator fun api.I.getValue(/*0*/ x: kotlin.Any?, /*1*/ y: kotlin.Any?): kotlin.Nothing? public operator fun api.I.getValue(/*0*/ x: kotlin.Any?, /*1*/ y: kotlin.Any?): kotlin.Nothing?
public open class Base { public open class Base {
@@ -35,14 +35,14 @@ package usage {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public final class Delegated : api.I { @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public final class Delegated : api.I {
public constructor Delegated() public constructor Delegated()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public final class Derived : usage.Base { @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public final class Derived : usage.Base {
public constructor Derived() public constructor Derived()
public final override /*1*/ /*fake_override*/ val i: api.I public final override /*1*/ /*fake_override*/ val i: api.I
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean
@@ -1,10 +1,10 @@
// !DIAGNOSTICS: -NOTHING_TO_INLINE -UNUSED_PARAMETER // !DIAGNOSTICS: -NOTHING_TO_INLINE -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class API annotation class API
@API @API
@@ -1,10 +1,10 @@
// !DIAGNOSTICS: -NOTHING_TO_INLINE -UNUSED_PARAMETER // !DIAGNOSTICS: -NOTHING_TO_INLINE -UNUSED_PARAMETER
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class API annotation class API
@API @API
@@ -3,7 +3,7 @@ package
package api { package api {
@api.API public fun f(): kotlin.Unit @api.API public fun f(): kotlin.Unit
@kotlin.Experimental(level = Level.WARNING) public final annotation class API : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) public final annotation class API : kotlin.Annotation {
public constructor API() public constructor API()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -51,7 +51,7 @@ package usage2
import api.* import api.*
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun useAll() { fun useAll() {
val c: C = C() val c: C = C()
c.function() c.function()
@@ -61,7 +61,7 @@ fun useAll() {
c.extension() c.extension()
} }
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
class Use { class Use {
fun useAll(c: C) { fun useAll(c: C) {
c.function() c.function()
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -51,7 +51,7 @@ package usage2
import api.* import api.*
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun useAll() { fun useAll() {
val c: C = C() val c: C = C()
c.function() c.function()
@@ -61,7 +61,7 @@ fun useAll() {
c.extension() c.extension()
} }
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
class Use { class Use {
fun useAll(c: C) { fun useAll(c: C) {
c.function() c.function()
@@ -26,7 +26,7 @@ package api {
} }
} }
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
public constructor ExperimentalAPI() public constructor ExperimentalAPI()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -47,9 +47,9 @@ package usage1 {
} }
package usage2 { package usage2 {
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun useAll(): kotlin.Unit @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public fun useAll(): kotlin.Unit
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public final class Use { @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public final class Use {
public constructor Use() public constructor Use()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -19,7 +19,7 @@ package api {
} }
} }
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY}) public final annotation class ExperimentalAPI : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY}) public final annotation class ExperimentalAPI : kotlin.Annotation {
public constructor ExperimentalAPI() public constructor ExperimentalAPI()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION) @Target(AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -24,7 +24,7 @@ fun usage() {}
// FILE: usage-use.kt // FILE: usage-use.kt
@file:UseExperimental(ExperimentalAPI::class) @file:OptIn(ExperimentalAPI::class)
package usage2 package usage2
import api.* import api.*
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION) @Target(AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -24,7 +24,7 @@ fun usage() {}
// FILE: usage-use.kt // FILE: usage-use.kt
@file:UseExperimental(ExperimentalAPI::class) @file:OptIn(ExperimentalAPI::class)
package usage2 package usage2
import api.* import api.*
@@ -11,7 +11,7 @@ package api {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.PROPERTY, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
public constructor ExperimentalAPI() public constructor ExperimentalAPI()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -36,12 +36,12 @@ package usage2
import api.* import api.*
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun use1() { fun use1() {
C.D.E.F() C.D.E.F()
} }
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun use2(f: C.D.E.F) = f.hashCode() fun use2(f: C.D.E.F) = f.hashCode()
// FILE: usage-none.kt // FILE: usage-none.kt
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION) @Target(AnnotationTarget.CLASS, AnnotationTarget.FUNCTION)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@@ -36,12 +36,12 @@ package usage2
import api.* import api.*
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun use1() { fun use1() {
C.D.E.F() C.D.E.F()
} }
@UseExperimental(ExperimentalAPI::class) @OptIn(ExperimentalAPI::class)
fun use2(f: C.D.E.F) = f.hashCode() fun use2(f: C.D.E.F) = f.hashCode()
// FILE: usage-none.kt // FILE: usage-none.kt
@@ -30,7 +30,7 @@ package api {
} }
} }
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.FUNCTION}) public final annotation class ExperimentalAPI : kotlin.Annotation {
public constructor ExperimentalAPI() public constructor ExperimentalAPI()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -44,8 +44,8 @@ package usage1 {
} }
package usage2 { package usage2 {
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun use1(): kotlin.Unit @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public fun use1(): kotlin.Unit
@kotlin.UseExperimental(markerClass = {api.ExperimentalAPI::class}) public fun use2(/*0*/ f: api.C.D.E.F): kotlin.Int @kotlin.OptIn(markerClass = {api.ExperimentalAPI::class}) public fun use2(/*0*/ f: api.C.D.E.F): kotlin.Int
} }
package usage3 { package usage3 {
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental @RequiresOptIn
annotation class E annotation class E
open class Base { open class Base {
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental @RequiresOptIn
annotation class E annotation class E
open class Base { open class Base {
@@ -10,7 +10,7 @@ package api {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental public final annotation class E : kotlin.Annotation { @kotlin.RequiresOptIn public final annotation class E : kotlin.Annotation {
public constructor E() public constructor E()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,6 +1,6 @@
// FILE: api.kt // FILE: api.kt
@Experimental @RequiresOptIn
annotation class Marker annotation class Marker
@Marker @Marker
@@ -17,7 +17,7 @@ fun use2() {
f() f()
} }
@UseExperimental(Marker::class) @OptIn(Marker::class)
fun use3() { fun use3() {
f() f()
} }
@@ -1,6 +1,6 @@
// FILE: api.kt // FILE: api.kt
@<!EXPERIMENTAL_IS_NOT_ENABLED!>Experimental<!> @<!EXPERIMENTAL_IS_NOT_ENABLED!>RequiresOptIn<!>
annotation class Marker annotation class Marker
@Marker @Marker
@@ -17,7 +17,7 @@ fun use2() {
f() f()
} }
@<!EXPERIMENTAL_IS_NOT_ENABLED!>UseExperimental<!>(Marker::class) @<!EXPERIMENTAL_IS_NOT_ENABLED!>OptIn<!>(Marker::class)
fun use3() { fun use3() {
f() f()
} }
@@ -3,9 +3,9 @@ package
@Marker public fun f(): kotlin.Unit @Marker public fun f(): kotlin.Unit
public fun use1(): kotlin.Unit public fun use1(): kotlin.Unit
@Marker public fun use2(): kotlin.Unit @Marker public fun use2(): kotlin.Unit
@kotlin.UseExperimental(markerClass = {Marker::class}) public fun use3(): kotlin.Unit @kotlin.OptIn(markerClass = {Marker::class}) public fun use3(): kotlin.Unit
@kotlin.Experimental public final annotation class Marker : kotlin.Annotation { @kotlin.RequiresOptIn public final annotation class Marker : kotlin.Annotation {
public constructor Marker() public constructor Marker()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,11 +1,11 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !EXPERIMENTAL: api.ExperimentalAPI // !EXPERIMENTAL: api.ExperimentalAPI
// MODULE: api // MODULE: api
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental @RequiresOptIn
annotation class ExperimentalAPI annotation class ExperimentalAPI
@ExperimentalAPI @ExperimentalAPI
@@ -1,11 +1,11 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !EXPERIMENTAL: api.ExperimentalAPI // !EXPERIMENTAL: api.ExperimentalAPI
// MODULE: api // MODULE: api
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental @RequiresOptIn
annotation class ExperimentalAPI annotation class ExperimentalAPI
@ExperimentalAPI @ExperimentalAPI
@@ -4,7 +4,7 @@ package
package api { package api {
@api.ExperimentalAPI public fun function(): kotlin.String @api.ExperimentalAPI public fun function(): kotlin.String
@kotlin.Experimental public final annotation class ExperimentalAPI : kotlin.Annotation { @kotlin.RequiresOptIn public final annotation class ExperimentalAPI : kotlin.Annotation {
public constructor ExperimentalAPI() public constructor ExperimentalAPI()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,4 +1,4 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION, -UNUSED_VARIABLE, -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_EXPRESSION, -UNUSED_VARIABLE, -UNUSED_PARAMETER
fun test() { fun test() {
@@ -18,7 +18,7 @@ fun test() {
5u 5u
) )
@UseExperimental(ExperimentalUnsignedTypes::class) 42u @OptIn(ExperimentalUnsignedTypes::class) 42u
} }
fun takeAll( fun takeAll(
@@ -1,4 +1,4 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_EXPRESSION, -UNUSED_VARIABLE, -UNUSED_PARAMETER // !DIAGNOSTICS: -UNUSED_EXPRESSION, -UNUSED_VARIABLE, -UNUSED_PARAMETER
fun test() { fun test() {
@@ -18,7 +18,7 @@ fun test() {
<!EXPERIMENTAL_UNSIGNED_LITERALS!>5u<!> <!EXPERIMENTAL_UNSIGNED_LITERALS!>5u<!>
) )
@UseExperimental(ExperimentalUnsignedTypes::class) 42u @OptIn(ExperimentalUnsignedTypes::class) 42u
} }
fun takeAll( fun takeAll(
@@ -1,11 +1,11 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
package test.abc package test.abc
@Experimental @RequiresOptIn
annotation class E annotation class E
@UseExperimental(test.abc.E::class) @OptIn(test.abc.E::class)
fun f() {} fun f() {}
@test.abc.E @test.abc.E
@@ -1,11 +1,11 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
package test.abc package test.abc
@Experimental @RequiresOptIn
annotation class E annotation class E
@UseExperimental(test.abc.E::class) @OptIn(test.abc.E::class)
fun f() {} fun f() {}
@test.abc.E @test.abc.E
@@ -3,10 +3,10 @@ package
package test { package test {
package test.abc { package test.abc {
@kotlin.UseExperimental(markerClass = {test.abc.E::class}) public fun f(): kotlin.Unit @kotlin.OptIn(markerClass = {test.abc.E::class}) public fun f(): kotlin.Unit
@test.abc.E public fun g(): kotlin.Unit @test.abc.E public fun g(): kotlin.Unit
@kotlin.Experimental public final annotation class E : kotlin.Annotation { @kotlin.RequiresOptIn public final annotation class E : kotlin.Annotation {
public constructor E() public constructor E()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package feature.experimental.self package feature.experimental.self
@Experimental @RequiresOptIn
annotation class ImportedMarker annotation class ImportedMarker
@ImportedMarker @ImportedMarker
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package feature.experimental.self package feature.experimental.self
@Experimental @RequiresOptIn
annotation class ImportedMarker annotation class ImportedMarker
@ImportedMarker @ImportedMarker
@@ -16,7 +16,7 @@ package feature {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental public final annotation class ImportedMarker : kotlin.Annotation { @kotlin.RequiresOptIn public final annotation class ImportedMarker : kotlin.Annotation {
public constructor ImportedMarker() public constructor ImportedMarker()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,25 +1,25 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
import kotlin.annotation.AnnotationTarget.* import kotlin.annotation.AnnotationTarget.*
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(CLASS, ANNOTATION_CLASS, TYPE_PARAMETER, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION, @Target(CLASS, ANNOTATION_CLASS, TYPE_PARAMETER, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION,
PROPERTY_GETTER, PROPERTY_SETTER, TYPE, TYPEALIAS) PROPERTY_GETTER, PROPERTY_SETTER, TYPE, TYPEALIAS)
annotation class E1 annotation class E1
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(FILE) @Target(FILE)
annotation class E2 annotation class E2
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(EXPRESSION) @Target(EXPRESSION)
@Retention(AnnotationRetention.SOURCE) @Retention(AnnotationRetention.SOURCE)
annotation class E3 annotation class E3
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(FILE, EXPRESSION) @Target(FILE, EXPRESSION)
@Retention(AnnotationRetention.SOURCE) @Retention(AnnotationRetention.SOURCE)
annotation class E4 annotation class E4
@@ -1,25 +1,25 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
import kotlin.annotation.AnnotationTarget.* import kotlin.annotation.AnnotationTarget.*
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
@Target(CLASS, ANNOTATION_CLASS, TYPE_PARAMETER, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION, @Target(CLASS, ANNOTATION_CLASS, TYPE_PARAMETER, PROPERTY, FIELD, LOCAL_VARIABLE, VALUE_PARAMETER, CONSTRUCTOR, FUNCTION,
PROPERTY_GETTER, PROPERTY_SETTER, TYPE, TYPEALIAS) PROPERTY_GETTER, PROPERTY_SETTER, TYPE, TYPEALIAS)
annotation class E1 annotation class E1
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
<!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(FILE)<!> <!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(FILE)<!>
annotation class E2 annotation class E2
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
<!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(EXPRESSION)<!> <!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(EXPRESSION)<!>
@Retention(AnnotationRetention.SOURCE) @Retention(AnnotationRetention.SOURCE)
annotation class E3 annotation class E3
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
<!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(FILE, EXPRESSION)<!> <!EXPERIMENTAL_ANNOTATION_WITH_WRONG_TARGET!>@Target(FILE, EXPRESSION)<!>
@Retention(AnnotationRetention.SOURCE) @Retention(AnnotationRetention.SOURCE)
annotation class E4 annotation class E4
@@ -2,28 +2,28 @@ package
package api { package api {
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPE, AnnotationTarget.TYPEALIAS}) public final annotation class E1 : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.CLASS, AnnotationTarget.ANNOTATION_CLASS, AnnotationTarget.TYPE_PARAMETER, AnnotationTarget.PROPERTY, AnnotationTarget.FIELD, AnnotationTarget.LOCAL_VARIABLE, AnnotationTarget.VALUE_PARAMETER, AnnotationTarget.CONSTRUCTOR, AnnotationTarget.FUNCTION, AnnotationTarget.PROPERTY_GETTER, AnnotationTarget.PROPERTY_SETTER, AnnotationTarget.TYPE, AnnotationTarget.TYPEALIAS}) public final annotation class E1 : kotlin.Annotation {
public constructor E1() public constructor E1()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FILE}) public final annotation class E2 : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FILE}) public final annotation class E2 : kotlin.Annotation {
public constructor E2() public constructor E2()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.EXPRESSION}) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) public final annotation class E3 : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.EXPRESSION}) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) public final annotation class E3 : kotlin.Annotation {
public constructor E3() public constructor E3()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FILE, AnnotationTarget.EXPRESSION}) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) public final annotation class E4 : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) @kotlin.annotation.Target(allowedTargets = {AnnotationTarget.FILE, AnnotationTarget.EXPRESSION}) @kotlin.annotation.Retention(value = AnnotationRetention.SOURCE) public final annotation class E4 : kotlin.Annotation {
public constructor E4() public constructor E4()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
annotation class NotAMarker annotation class NotAMarker
@UseExperimental @OptIn
fun f1() {} fun f1() {}
@UseExperimental(NotAMarker::class) @OptIn(NotAMarker::class)
fun f2() {} fun f2() {}
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
annotation class NotAMarker annotation class NotAMarker
<!USE_EXPERIMENTAL_WITHOUT_ARGUMENTS!>@UseExperimental<!> <!USE_EXPERIMENTAL_WITHOUT_ARGUMENTS!>@OptIn<!>
fun f1() {} fun f1() {}
<!USE_EXPERIMENTAL_ARGUMENT_IS_NOT_MARKER!>@UseExperimental(NotAMarker::class)<!> <!USE_EXPERIMENTAL_ARGUMENT_IS_NOT_MARKER!>@OptIn(NotAMarker::class)<!>
fun f2() {} fun f2() {}
@@ -1,7 +1,7 @@
package package
@kotlin.UseExperimental(markerClass = {}) public fun f1(): kotlin.Unit @kotlin.OptIn(markerClass = {}) public fun f1(): kotlin.Unit
@kotlin.UseExperimental(markerClass = {NotAMarker::class}) public fun f2(): kotlin.Unit @kotlin.OptIn(markerClass = {NotAMarker::class}) public fun f2(): kotlin.Unit
public final annotation class NotAMarker : kotlin.Annotation { public final annotation class NotAMarker : kotlin.Annotation {
public constructor NotAMarker() public constructor NotAMarker()
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class E annotation class E
open class Base { open class Base {
@@ -1,9 +1,9 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class E annotation class E
open class Base { open class Base {
@@ -18,7 +18,7 @@ package api {
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental(level = Level.WARNING) public final annotation class E : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) public final annotation class E : kotlin.Annotation {
public constructor E() public constructor E()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,8 +1,8 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class E1 annotation class E1
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class E3 annotation class E3
interface Base1 { interface Base1 {
@@ -1,8 +1,8 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class E1 annotation class E1
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class E3 annotation class E3
interface Base1 { interface Base1 {
@@ -45,14 +45,14 @@ public final class DerivedC : Base1, Base2, Base3 {
public open override /*3*/ /*fake_override*/ fun toString(): kotlin.String public open override /*3*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental(level = Level.WARNING) public final annotation class E1 : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) public final annotation class E1 : kotlin.Annotation {
public constructor E1() public constructor E1()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String public open override /*1*/ /*fake_override*/ fun toString(): kotlin.String
} }
@kotlin.Experimental(level = Level.WARNING) public final annotation class E3 : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) public final annotation class E3 : kotlin.Annotation {
public constructor E3() public constructor E3()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int
@@ -1,10 +1,10 @@
// !USE_EXPERIMENTAL: kotlin.Experimental // !USE_EXPERIMENTAL: kotlin.RequiresOptIn
// !DIAGNOSTICS: -UNUSED_VARIABLE // !DIAGNOSTICS: -UNUSED_VARIABLE
// FILE: api.kt // FILE: api.kt
package api package api
@Experimental(Experimental.Level.WARNING) @RequiresOptIn(RequiresOptIn.Level.WARNING)
annotation class ExperimentalAPI annotation class ExperimentalAPI
@ExperimentalAPI @ExperimentalAPI
@@ -24,7 +24,7 @@ fun use() {
// FILE: usage-use.kts // FILE: usage-use.kts
@file:UseExperimental(ExperimentalAPI::class) @file:OptIn(ExperimentalAPI::class)
import api.* import api.*
fun use() { fun use() {
@@ -30,7 +30,7 @@ public final class Usage_use : kotlin.script.templates.standard.ScriptTemplateWi
package api { package api {
@api.ExperimentalAPI public fun function(): kotlin.String @api.ExperimentalAPI public fun function(): kotlin.String
@kotlin.Experimental(level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation { @kotlin.RequiresOptIn(level = Level.WARNING) public final annotation class ExperimentalAPI : kotlin.Annotation {
public constructor ExperimentalAPI() public constructor ExperimentalAPI()
public open override /*1*/ /*fake_override*/ fun equals(/*0*/ other: kotlin.Any?): kotlin.Boolean 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 hashCode(): kotlin.Int

Some files were not shown because too many files have changed in this diff Show More