Introduce FIR_IDENTICAL for FIR vs old frontend tests #KT-36879 Fixed
This commit is contained in:
@@ -1,30 +0,0 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
interface I
|
||||
|
||||
@ExperimentalAPI
|
||||
class Impl : I
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
open class Base(val i: I)
|
||||
|
||||
@OptIn(ExperimentalAPI::class)
|
||||
class Derived : Base(Impl())
|
||||
|
||||
@OptIn(ExperimentalAPI::class)
|
||||
class Delegated : I by Impl()
|
||||
|
||||
@OptIn(ExperimentalAPI::class)
|
||||
val delegatedProperty by Impl()
|
||||
operator fun I.getValue(x: Any?, y: Any?) = null
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
|
||||
Vendored
-23
@@ -1,23 +0,0 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// !EXPERIMENTAL: api.ExperimentalAPI
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
fun function(): String = ""
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
fun use() {
|
||||
function()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// !EXPERIMENTAL: api.ExperimentalAPI
|
||||
// MODULE: api
|
||||
|
||||
-12
@@ -1,12 +0,0 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
|
||||
package test.abc
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class E
|
||||
|
||||
@OptIn(test.abc.E::class)
|
||||
fun f() {}
|
||||
|
||||
@test.abc.E
|
||||
fun g() {}
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
|
||||
package test.abc
|
||||
|
||||
-27
@@ -1,27 +0,0 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
package feature.experimental.self
|
||||
|
||||
@RequiresOptIn
|
||||
annotation class ImportedMarker
|
||||
|
||||
@ImportedMarker
|
||||
object ImportedClass {
|
||||
@ImportedMarker
|
||||
fun importedObjectMember() {}
|
||||
}
|
||||
|
||||
@ImportedMarker
|
||||
fun importedFunction() {}
|
||||
|
||||
@ImportedMarker
|
||||
val importedProperty = Unit
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
import feature.experimental.self.ImportedMarker
|
||||
import feature.experimental.self.ImportedClass
|
||||
import feature.experimental.self.importedFunction
|
||||
import feature.experimental.self.importedProperty
|
||||
import feature.experimental.self.ImportedClass.importedObjectMember
|
||||
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
annotation class VeryExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
@VeryExperimentalAPI
|
||||
fun f() {}
|
||||
|
||||
@ExperimentalAPI
|
||||
fun g() {}
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
@file:OptIn(ExperimentalAPI::class, VeryExperimentalAPI::class)
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
fun usage() {
|
||||
f()
|
||||
g()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// FILE: api.kt
|
||||
|
||||
|
||||
Vendored
-22
@@ -1,22 +0,0 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn api.ExperimentalAPI
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.ERROR)
|
||||
annotation class ExperimentalAPI
|
||||
|
||||
@ExperimentalAPI
|
||||
fun function(): String = ""
|
||||
|
||||
// MODULE: usage(api)
|
||||
// FILE: usage.kt
|
||||
|
||||
package usage
|
||||
|
||||
import api.*
|
||||
|
||||
fun use() {
|
||||
function()
|
||||
}
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn api.ExperimentalAPI
|
||||
// MODULE: api
|
||||
// FILE: api.kt
|
||||
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FILE: api.kt
|
||||
|
||||
package api
|
||||
|
||||
@RequiresOptIn(level = RequiresOptIn.Level.WARNING)
|
||||
@Target(AnnotationTarget.CLASS)
|
||||
annotation class E
|
||||
|
||||
@E
|
||||
open class Foo(val s: String = "")
|
||||
|
||||
// FILE: usage.kt
|
||||
|
||||
import api.*
|
||||
|
||||
@OptIn(E::class)
|
||||
class Klass {
|
||||
init {
|
||||
Foo()
|
||||
}
|
||||
}
|
||||
|
||||
class Constructor {
|
||||
@OptIn(E::class) constructor() {
|
||||
Foo()
|
||||
}
|
||||
}
|
||||
|
||||
@OptIn(E::class)
|
||||
val property = Foo().s
|
||||
|
||||
@OptIn(E::class)
|
||||
fun function() {
|
||||
Foo()
|
||||
}
|
||||
|
||||
fun valueParameter(@OptIn(E::class) p: String = Foo().s): String {
|
||||
@OptIn(E::class)
|
||||
val localVariable: String = Foo().s
|
||||
return localVariable
|
||||
}
|
||||
|
||||
var propertyAccessors: String
|
||||
@OptIn(E::class)
|
||||
get() = Foo().s
|
||||
@OptIn(E::class)
|
||||
set(value) { Foo() }
|
||||
|
||||
fun expression(): String {
|
||||
val s = @OptIn(E::class) Foo().s
|
||||
return s
|
||||
}
|
||||
|
||||
@OptIn(E::class)
|
||||
typealias TypeAlias = Foo
|
||||
+1
@@ -1,3 +1,4 @@
|
||||
// FIR_IDENTICAL
|
||||
// !USE_EXPERIMENTAL: kotlin.RequiresOptIn
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// FILE: api.kt
|
||||
|
||||
Reference in New Issue
Block a user