[FIR-TEST] Add new testdata generated after changes in previous commit
This commit is contained in:
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
package test
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation class AnnClass(val a: KClass<*>)
|
||||
|
||||
class MyClass {
|
||||
|
||||
@AnnClass(MyClass::class)
|
||||
companion object {
|
||||
}
|
||||
|
||||
}
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class My {
|
||||
@delegate:JvmSynthetic val s: String by lazy { "s" }
|
||||
|
||||
// Both Ok
|
||||
@get:JvmSynthetic val t: String by lazy { "t" }
|
||||
@set:JvmSynthetic var z: String by Delegates.observable("?") { prop, old, new -> old.hashCode() }
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
import kotlin.jvm.Synchronized
|
||||
|
||||
interface My {
|
||||
@Synchronized fun foo()
|
||||
|
||||
@Synchronized fun bar() = 1
|
||||
|
||||
@Synchronized fun baz(): String {
|
||||
return "abc"
|
||||
}
|
||||
|
||||
var v: String
|
||||
@Synchronized get() = ""
|
||||
@Synchronized set(value) {}
|
||||
}
|
||||
|
||||
abstract class Your {
|
||||
@Synchronized abstract fun foo()
|
||||
|
||||
@Synchronized fun bar() = 1
|
||||
|
||||
@Synchronized open fun baz(): String {
|
||||
return "xyz"
|
||||
}
|
||||
|
||||
var v: String
|
||||
@Synchronized get() = ""
|
||||
@Synchronized set(value) {}
|
||||
}
|
||||
|
||||
@Synchronized fun gav() = 1
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// !LANGUAGE: +JvmStaticInInterface
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
interface I {
|
||||
companion object {
|
||||
@Synchronized fun syncFun() {}
|
||||
|
||||
@Synchronized @JvmStatic fun syncFunJvmStatic() {}
|
||||
|
||||
var syncProp: String
|
||||
@Synchronized get() = ""
|
||||
@Synchronized set(value) {}
|
||||
|
||||
@JvmStatic var syncPropJvmStatic: String
|
||||
@Synchronized get() = ""
|
||||
@Synchronized set(value) {}
|
||||
|
||||
var syncPropJvmStaticAccessors: String
|
||||
@Synchronized @JvmStatic get() = ""
|
||||
@Synchronized @JvmStatic set(value) {}
|
||||
}
|
||||
}
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
class C {
|
||||
val plainField: Int = 1
|
||||
@delegate:Transient
|
||||
val lazy by lazy { 1 }
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
// !DIAGNOSTICS: -UNUSED_ANONYMOUS_PARAMETER
|
||||
import kotlin.jvm.Volatile
|
||||
import kotlin.properties.Delegates
|
||||
|
||||
class My {
|
||||
@Volatile val x = 0
|
||||
// ok
|
||||
@Volatile var y = 1
|
||||
|
||||
@delegate:Volatile var z: String by Delegates.observable("?") { prop, old, new -> old.hashCode() }
|
||||
|
||||
@field:Volatile val w = 2
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
interface Test {
|
||||
@get:JvmStatic
|
||||
val a: Int
|
||||
|
||||
@get:JvmName("1")
|
||||
val b: Int
|
||||
|
||||
@get:Synchronized
|
||||
val c: Int
|
||||
|
||||
@get:JvmOverloads
|
||||
val d: Int
|
||||
}
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
@JvmName("")
|
||||
fun foo(a: Any) {}
|
||||
|
||||
@JvmName(".")
|
||||
fun foo() {}
|
||||
|
||||
@JvmName("/")
|
||||
fun fooSlash() {}
|
||||
|
||||
@JvmName("<")
|
||||
fun fooLT() {}
|
||||
Vendored
+95
@@ -0,0 +1,95 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE -UNUSED_PARAMETER
|
||||
|
||||
@JvmName("a")
|
||||
fun foo() {}
|
||||
|
||||
@JvmName("b")
|
||||
fun Any.foo() {}
|
||||
|
||||
@JvmName("c")
|
||||
val px = 1
|
||||
|
||||
@JvmName("d")
|
||||
val Any.px : Int
|
||||
get() = 1
|
||||
|
||||
val valx: Int
|
||||
@JvmName("e")
|
||||
get() = 1
|
||||
|
||||
var varx: Int
|
||||
@JvmName("f")
|
||||
get() = 1
|
||||
@JvmName("g")
|
||||
set(v) {}
|
||||
|
||||
var vardef: Int = 1
|
||||
@JvmName("h")
|
||||
get
|
||||
@JvmName("i")
|
||||
set
|
||||
|
||||
@JvmName("C")
|
||||
class C @JvmName("primary") constructor() {
|
||||
@JvmName("ctr") constructor(x: Int): this() {}
|
||||
|
||||
@JvmName("a")
|
||||
fun foo() {}
|
||||
|
||||
@JvmName("b")
|
||||
fun Any.foo() {}
|
||||
|
||||
@JvmName("c")
|
||||
val px = 1
|
||||
|
||||
@JvmName("d")
|
||||
val Any.px : Int
|
||||
get() = 1
|
||||
|
||||
val valx: Int
|
||||
@JvmName("e")
|
||||
get() = 1
|
||||
|
||||
var varx: Int
|
||||
@JvmName("f")
|
||||
get() = 1
|
||||
@JvmName("g")
|
||||
set(v) {}
|
||||
}
|
||||
|
||||
fun foo1() {
|
||||
@JvmName("a")
|
||||
fun foo() {}
|
||||
|
||||
@JvmName("a")
|
||||
val x = 1
|
||||
}
|
||||
|
||||
abstract class AB {
|
||||
@JvmName("AB_absFun1")
|
||||
abstract fun absFun1()
|
||||
|
||||
abstract fun absFun2()
|
||||
|
||||
@JvmName("AB_openFun")
|
||||
open fun openFun() {}
|
||||
}
|
||||
|
||||
class D: AB() {
|
||||
override fun absFun1() {}
|
||||
|
||||
@JvmName("D_absFun2")
|
||||
override fun absFun2() {}
|
||||
|
||||
@JvmName("D_openFun")
|
||||
final override fun openFun() {}
|
||||
|
||||
@JvmName("D_finalFun")
|
||||
fun finalFun() {}
|
||||
}
|
||||
|
||||
interface Intf {
|
||||
@get:JvmName("getBar") // no error in IDE
|
||||
@set:JvmName("setBar") // no error in IDE
|
||||
var foo: Int
|
||||
}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// !LANGUAGE: +InlineClasses
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
|
||||
inline class Foo(val x: Int) {
|
||||
@JvmName("other")
|
||||
fun simple() {}
|
||||
}
|
||||
|
||||
@JvmName("bad")
|
||||
fun bar(f: Foo) {}
|
||||
|
||||
@JvmName("good")
|
||||
fun baz(r: Result<Int>) {}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
@file:JvmName("MultifileClass")
|
||||
@file:JvmMultifileClass
|
||||
@file:FileAnn
|
||||
@file:FileBinaryAnn
|
||||
@file:FileSourceAnn
|
||||
|
||||
@Target(AnnotationTarget.FILE)
|
||||
@Retention(AnnotationRetention.RUNTIME)
|
||||
public annotation class FileAnn
|
||||
|
||||
@Target(AnnotationTarget.FILE)
|
||||
@Retention(AnnotationRetention.BINARY)
|
||||
public annotation class FileBinaryAnn
|
||||
|
||||
@Target(AnnotationTarget.FILE)
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
public annotation class FileSourceAnn
|
||||
|
||||
|
||||
+40
@@ -0,0 +1,40 @@
|
||||
// FILE: test.kt
|
||||
@file:JvmName("MultifileClass")
|
||||
@file:JvmMultifileClass
|
||||
@file:JavaAnn
|
||||
@file:JavaClassAnn
|
||||
@file:JavaSourceAnn
|
||||
|
||||
// FILE: JavaAnn.java
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.RUNTIME)
|
||||
public @interface JavaAnn {
|
||||
}
|
||||
|
||||
// FILE: JavaClassAnn.java
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.CLASS)
|
||||
public @interface JavaClassAnn {
|
||||
}
|
||||
|
||||
// FILE: JavaSourceAnn.java
|
||||
import java.lang.annotation.ElementType;
|
||||
import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
@Target(ElementType.TYPE)
|
||||
@Retention(RetentionPolicy.SOURCE)
|
||||
public @interface JavaSourceAnn {
|
||||
}
|
||||
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
// See KT-15839
|
||||
|
||||
val x = "1".let(@Suppress("DEPRECATION") Integer::parseInt)
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann(val i: IntArray)
|
||||
|
||||
@Ann(intArrayOf(i))
|
||||
@Ann(intArrayOf(i2))
|
||||
@Ann(intArrayOf(i3))
|
||||
@Ann(intArrayOf(i, i2, i3))
|
||||
@Ann(<!INAPPLICABLE_CANDIDATE!>intArrayOf<!>(intArrayOf(i, i2, i3)))
|
||||
class Test
|
||||
|
||||
var i = 1
|
||||
const val i2 = 1
|
||||
val i3 = foo()
|
||||
|
||||
fun foo(): Int = 1
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class AnnAnn(val i: Array<Ann>)
|
||||
@AnnAnn(arrayOf(Ann(intArrayOf(1))))
|
||||
@AnnAnn(arrayOf(iAnn))
|
||||
class TestAnn
|
||||
val iAnn = Ann(intArrayOf(1))
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann(val i: Int)
|
||||
annotation class AnnIA(val ia: IntArray)
|
||||
annotation class AnnSA(val sa: Array<String>)
|
||||
|
||||
@Ann(MyClass().i)
|
||||
@Ann(i)
|
||||
@Ann(i2)
|
||||
@AnnIA(ia)
|
||||
@AnnSA(sa)
|
||||
class Test {
|
||||
val i = 1
|
||||
@Ann(i) val i2 = 1
|
||||
}
|
||||
|
||||
var i = 1
|
||||
val i2 = foo()
|
||||
|
||||
fun foo(): Int = 1
|
||||
|
||||
@AnnSA(emptyArray())
|
||||
class MyClass {
|
||||
val i = 1
|
||||
}
|
||||
|
||||
val ia: IntArray = intArrayOf(1, 2)
|
||||
val sa: Array<String> = arrayOf("a", "b")
|
||||
|
||||
annotation class Ann2
|
||||
+16
@@ -0,0 +1,16 @@
|
||||
val nonConst = 1
|
||||
|
||||
const val constConst = nonConst * nonConst + 2
|
||||
|
||||
annotation class Ann(val x: Int, val y: String)
|
||||
|
||||
@Ann(nonConst, "${nonConst}")
|
||||
fun foo1() {}
|
||||
|
||||
@Ann(nonConst + constConst, "${constConst}")
|
||||
fun foo2() {}
|
||||
|
||||
annotation class ArrayAnn(val x: IntArray)
|
||||
|
||||
@ArrayAnn(intArrayOf(1, constConst, nonConst))
|
||||
fun foo3() {}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class Ann(vararg val i: Int)
|
||||
|
||||
@Ann(i)
|
||||
@Ann(i2)
|
||||
@Ann(i3)
|
||||
@Ann(i, i2, i3)
|
||||
@Ann(*intArrayOf(i))
|
||||
@Ann(*intArrayOf(i2))
|
||||
@Ann(*intArrayOf(i3))
|
||||
@Ann(*intArrayOf(i, i2, i3))
|
||||
class Test
|
||||
|
||||
var i = 1
|
||||
const val i2 = 1
|
||||
val i3 = foo()
|
||||
|
||||
fun foo(): Int = 1
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
@Repeatable
|
||||
annotation class AnnAnn(vararg val i: Ann)
|
||||
@AnnAnn(*arrayOf(Ann(1)))
|
||||
@AnnAnn(*arrayOf(iAnn))
|
||||
class TestAnn
|
||||
val iAnn = Ann(1)
|
||||
Vendored
+8
@@ -0,0 +1,8 @@
|
||||
annotation class A
|
||||
annotation class A1(val x: Int)
|
||||
|
||||
annotation class B(
|
||||
val a: A = A(),
|
||||
val x: Int = A1(42).x,
|
||||
val aa: Array<A> = arrayOf(A())
|
||||
)
|
||||
+34
@@ -0,0 +1,34 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation class Ann(
|
||||
val a: Array<String> = arrayOf(readOnly),
|
||||
val b: Array<String> = arrayOf(withGetter),
|
||||
val c: Array<String> = arrayOf(func()),
|
||||
val d: IntArray = intArrayOf(ONE, twoWithGetter),
|
||||
val e: IntArray = intArrayOf(ONE + twoWithGetter),
|
||||
val f: Array<String> = arrayOf(mutable),
|
||||
val g: Array<String> = arrayOf(mutableWithGetter),
|
||||
val h: Array<KClass<*>> = arrayOf(WithLateinit.kClass)
|
||||
)
|
||||
|
||||
const val ONE = 1
|
||||
|
||||
val twoWithGetter
|
||||
get() = 2
|
||||
|
||||
val readOnly = ""
|
||||
|
||||
val withGetter
|
||||
get() = ""
|
||||
|
||||
fun func() = ""
|
||||
|
||||
var mutable = ""
|
||||
|
||||
var mutableWithGetter
|
||||
get() = ""
|
||||
set(x) = TODO()
|
||||
|
||||
object WithLateinit {
|
||||
lateinit var kClass: KClass<*>
|
||||
}
|
||||
compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/orderWithValue.fir.kt
Vendored
+9
@@ -0,0 +1,9 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
double b();
|
||||
Class<?> x1();
|
||||
int a();
|
||||
String value();
|
||||
Class<?> x();
|
||||
Class<?> x2();
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
double b();
|
||||
Class<?> x1();
|
||||
int a();
|
||||
Class<?> x();
|
||||
Class<?> x2();
|
||||
}
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] value();
|
||||
Class<?> x() default Integer.class;
|
||||
int y();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A("1", "2", "3", y = 1) fun test1() {}
|
||||
|
||||
@A("4", y = 2) fun test2() {}
|
||||
|
||||
@A(*arrayOf("5", "6"), "7", y = 3) fun test3() {}
|
||||
|
||||
@A("1", "2", "3", x = String::class, y = 4) fun test4() {}
|
||||
|
||||
@A("4", y = 5) fun test5() {}
|
||||
|
||||
@A(*arrayOf("5", "6"), "7", x = Any::class, y = 6) fun test6() {}
|
||||
|
||||
@A(y = 7) fun test7() {}
|
||||
|
||||
@A("8", "9", "10") fun test8() {}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] value();
|
||||
Class<?> x() default Integer.class;
|
||||
int y() default 1;
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A("1", "2", "3") fun test1() {}
|
||||
|
||||
@A("4") fun test2() {}
|
||||
|
||||
@A(*arrayOf("5", "6"), "7") fun test3() {}
|
||||
|
||||
@A("1", "2", "3", x = String::class) fun test4() {}
|
||||
|
||||
@A("4", y = 2) fun test5() {}
|
||||
|
||||
@A(*arrayOf("5", "6"), "7", x = Any::class, y = 3) fun test6() {}
|
||||
|
||||
@A() fun test7() {}
|
||||
|
||||
@A fun test8() {}
|
||||
|
||||
@A(x = Any::class, *arrayOf("5", "6"), "7", y = 3) fun test9() {}
|
||||
@A(x = Any::class, value = ["5", "6"], "7", y = 3) fun test10() {}
|
||||
@A(x = Any::class, value = ["5", "6", "7"], y = 3) fun test11() {}
|
||||
compiler/testData/diagnostics/testsWithStdLib/annotations/annotationParameters/valueArrayOnly.fir.kt
Vendored
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] value();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A("1", "2", "3") fun test1() {}
|
||||
|
||||
@A("4") fun test2() {}
|
||||
|
||||
@A(*arrayOf("5", "6"), "7") fun test3() {}
|
||||
|
||||
@A() fun test4() {}
|
||||
|
||||
@A fun test5() {}
|
||||
+15
@@ -0,0 +1,15 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] value() default {"abc", "cde"};
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A("1", "2", "3") fun test1() {}
|
||||
|
||||
@A("4") fun test2() {}
|
||||
|
||||
@A(*arrayOf("5", "6"), "7") fun test3() {}
|
||||
|
||||
@A() fun test4() {}
|
||||
|
||||
@A fun test5() {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
String[] value();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(*arrayOf(1, "b"))
|
||||
fun test() {
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
annotation class B(vararg val args: String)
|
||||
|
||||
@B(*arrayOf(1, "b"))
|
||||
fun test() {
|
||||
}
|
||||
+14
@@ -0,0 +1,14 @@
|
||||
// Please make sure that this test is consistent with the blackbox test "annotationsOnLateinitAccessors.kt"
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
annotation class Ann
|
||||
annotation class AnnRepeat
|
||||
|
||||
class LateinitProperties {
|
||||
@get:Ann
|
||||
lateinit var y0: String
|
||||
|
||||
@get:Ann
|
||||
private lateinit var y1: String
|
||||
}
|
||||
+114
@@ -0,0 +1,114 @@
|
||||
// Please make sure that this test is consistent with the blackbox test "annotationsOnNonExistentAccessors.kt"
|
||||
|
||||
import kotlin.reflect.KProperty
|
||||
|
||||
annotation class Ann
|
||||
annotation class AnnRepeat
|
||||
|
||||
class Foo(
|
||||
@get:Ann private val y0: Int,
|
||||
@get:Ann private vararg val y1: String
|
||||
) {
|
||||
@get:Ann
|
||||
private val x1 = ""
|
||||
|
||||
@set:Ann
|
||||
private var x2 = ""
|
||||
|
||||
@setparam:Ann
|
||||
private var x3 = ""
|
||||
|
||||
@setparam:[Ann AnnRepeat]
|
||||
private var x4 = ""
|
||||
|
||||
@get:Ann
|
||||
internal val x5 = ""
|
||||
|
||||
@get:Ann
|
||||
protected val x6 = ""
|
||||
|
||||
@get:Ann
|
||||
private val x7: String = ""
|
||||
@AnnRepeat get
|
||||
|
||||
@get:Ann
|
||||
@set:Ann
|
||||
private var x8: String = ""
|
||||
get() { return "" }
|
||||
|
||||
@get:Ann
|
||||
@set:Ann
|
||||
private var x9: String = ""
|
||||
get() { return "" }
|
||||
set(f) { field = f }
|
||||
}
|
||||
|
||||
private class EffetivelyPrivate private constructor(
|
||||
@get:Ann val x0: Int,
|
||||
@get:Ann protected val x1: Int,
|
||||
@get:Ann internal val x2: Int
|
||||
) {
|
||||
private class Nested {
|
||||
@get:Ann
|
||||
val fofo = 0
|
||||
}
|
||||
}
|
||||
|
||||
class PrivateToThis<in I> {
|
||||
@get:Ann
|
||||
@set:Ann
|
||||
@setparam:Ann
|
||||
private var x0: I = TODO()
|
||||
}
|
||||
|
||||
class Statics {
|
||||
companion object {
|
||||
@JvmField
|
||||
@get:Ann
|
||||
val x0 = ""
|
||||
|
||||
@get:Ann
|
||||
const val x1 = ""
|
||||
|
||||
@JvmStatic
|
||||
@get:Ann
|
||||
val x2 = ""
|
||||
|
||||
@JvmStatic
|
||||
@get:Ann
|
||||
private val x3 = ""
|
||||
|
||||
@JvmStatic
|
||||
@get:Ann
|
||||
private val x4 = ""
|
||||
}
|
||||
}
|
||||
|
||||
private class Other(@param:Ann private val param: Int) {
|
||||
@property:Ann
|
||||
@field:Ann
|
||||
private val other = ""
|
||||
|
||||
private fun @receiver:Ann Int.receiver() {}
|
||||
|
||||
@delegate:Ann
|
||||
@get:Ann
|
||||
private val delegate by CustomDelegate()
|
||||
}
|
||||
|
||||
class CustomDelegate {
|
||||
operator fun getValue(thisRef: Any?, prop: KProperty<*>): String = prop.name
|
||||
}
|
||||
|
||||
@Retention(AnnotationRetention.SOURCE)
|
||||
annotation class SourceAnn
|
||||
|
||||
class WithSource {
|
||||
@get:SourceAnn
|
||||
@set:SourceAnn
|
||||
@setparam:SourceAnn
|
||||
private var x0 = ""
|
||||
|
||||
private val x1 = ""
|
||||
@SourceAnn get
|
||||
}
|
||||
Vendored
+22
@@ -0,0 +1,22 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
const val CONST = 1
|
||||
fun foo() = 1
|
||||
val nonConst = foo()
|
||||
|
||||
annotation class ValidAnn(
|
||||
val p1: Int = 1 <!AMBIGUITY!>+<!> CONST,
|
||||
val p2: String = "",
|
||||
val p3: KClass<*> = String::class,
|
||||
val p4: IntArray = intArrayOf(1, 2, 3),
|
||||
val p5: Array<String> = arrayOf("abc"),
|
||||
val p6: Array<KClass<*>> = arrayOf(Int::class)
|
||||
)
|
||||
|
||||
val nonConstKClass = String::class
|
||||
|
||||
annotation class InvalidAnn(
|
||||
val p1: Int = foo(),
|
||||
val p2: Int = nonConst,
|
||||
val p3: KClass<*> = nonConstKClass
|
||||
)
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
@Metadata
|
||||
class A
|
||||
|
||||
@Metadata(extraString = "_")
|
||||
annotation class B(val m: Metadata)
|
||||
|
||||
@Metadata(extraInt = 0)
|
||||
@B(Metadata())
|
||||
fun f() {}
|
||||
+19
@@ -0,0 +1,19 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> arg() default Integer.class;
|
||||
int x() default 1;
|
||||
B b();
|
||||
}
|
||||
|
||||
// FILE: B.java
|
||||
public @interface B {
|
||||
Class<?> arg() default String.class;
|
||||
int y() default 2;
|
||||
}
|
||||
|
||||
// FILE: c.kt
|
||||
@A(arg = String::class, b = <!UNRESOLVED_REFERENCE!>B<!>(y = 1)) class MyClass1
|
||||
|
||||
@A(b = <!UNRESOLVED_REFERENCE!>B<!>(y = 3)) class MyClass2
|
||||
|
||||
@A(arg = String::class, b = <!UNRESOLVED_REFERENCE!>B<!>(arg = Boolean::class)) class MyClass3
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> arg();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(arg = String::class) class MyClass3
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> arg();
|
||||
int x() default 1;
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(arg = String::class) class MyClass1
|
||||
@A(arg = String::class, x = 2) class MyClass2
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?>[] arg();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(arg = arrayOf(String::class, Int::class)) class MyClass
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> arg() default Integer.class;
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(arg = String::class) class MyClass1
|
||||
@A class MyClass2
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> arg() default Integer.class;
|
||||
int x();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(arg = String::class, x = 4) class MyClass2
|
||||
@A(x = 5) class MyClass3
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> arg1();
|
||||
Class<?> arg2();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(arg1 = String::class, arg2 = Int::class) class MyClass
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> value();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(String::class) class MyClass1
|
||||
@A(value = String::class) class MyClass2
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> value();
|
||||
int x() default 1;
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(String::class) class MyClass1
|
||||
@A(value = String::class) class MyClass2
|
||||
|
||||
@A(String::class, x = 2) class MyClass3
|
||||
@A(value = String::class, x = 4) class MyClass4
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?>[] value();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(String::class, Int::class) class MyClass1
|
||||
@A(*arrayOf(String::class, Int::class)) class MyClass2
|
||||
@A(value = [String::class, Int::class]) class MyClass3
|
||||
+9
@@ -0,0 +1,9 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> value() default Integer.class;
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(String::class) class MyClass1
|
||||
@A(value = String::class) class MyClass2
|
||||
@A class MyClass3
|
||||
+10
@@ -0,0 +1,10 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
Class<?> value() default Integer.class;
|
||||
int x();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(String::class, x = 2) class MyClass1
|
||||
@A(value = String::class, x = 4) class MyClass2
|
||||
@A(x = 5) class MyClass3
|
||||
+60
@@ -0,0 +1,60 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface A<T> {
|
||||
@JvmDefault
|
||||
fun test(p: T) {
|
||||
}
|
||||
}
|
||||
|
||||
interface ANonDefault {
|
||||
fun test(p: String) {}
|
||||
}
|
||||
|
||||
interface B<T> : A<T> {
|
||||
|
||||
override fun test(p: T)
|
||||
{}
|
||||
}
|
||||
|
||||
interface C<T> : A<T>, ANonDefault {
|
||||
|
||||
override fun test(p: T)
|
||||
{}
|
||||
|
||||
override fun test(p: String) {
|
||||
}
|
||||
}
|
||||
|
||||
interface C1 : C<String> {
|
||||
override fun test(p: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface C2 : C<String>, ANonDefault {
|
||||
override fun test(p: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface D<T> : ANonDefault, A<T> {
|
||||
|
||||
override fun test(p: T)
|
||||
{}
|
||||
|
||||
override fun test(p: String) {
|
||||
}
|
||||
}
|
||||
|
||||
interface D1 : D<String> {
|
||||
override fun test(p: String) {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface D2 : ANonDefault, D<String> {
|
||||
override fun test(p: String) {
|
||||
|
||||
}
|
||||
}
|
||||
+72
@@ -0,0 +1,72 @@
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
// FILE: JavaInterface.java
|
||||
public interface JavaInterface {
|
||||
default void test() {}
|
||||
|
||||
default void testForNonDefault() {}
|
||||
|
||||
void testAbstract();
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
interface KotlinInterface : JavaInterface {
|
||||
@JvmDefault
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
|
||||
interface KotlinInterface2 : JavaInterface, KotlinInterface {
|
||||
@JvmDefault
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
|
||||
|
||||
interface KotlinInterfaceForIndirect : JavaInterface {
|
||||
|
||||
}
|
||||
|
||||
interface KotlinInterfaceIndirectInheritance : KotlinInterfaceForIndirect {
|
||||
|
||||
@JvmDefault
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
|
||||
open class KotlinClass : JavaInterface {
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
|
||||
interface KotlinInterfaceX {
|
||||
|
||||
fun test() {}
|
||||
|
||||
fun testForNonDefault() {}
|
||||
|
||||
fun testAbstract() {}
|
||||
}
|
||||
|
||||
interface KotlinInterfaceManySuper: JavaInterface, KotlinInterfaceX {
|
||||
@JvmDefault
|
||||
override fun test() {}
|
||||
|
||||
override fun testForNonDefault() {}
|
||||
|
||||
override fun testAbstract() {}
|
||||
}
|
||||
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
interface A {
|
||||
@JvmDefault
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
interface B : A {
|
||||
|
||||
}
|
||||
|
||||
|
||||
open class Foo : B
|
||||
open class Foo2 : B, A
|
||||
|
||||
open class FooNoError : B {
|
||||
override fun test() {
|
||||
}
|
||||
}
|
||||
open class Foo2NoError : B, A {
|
||||
override fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
class Bar : Foo()
|
||||
class Bar2 : Foo(), A
|
||||
class Bar3 : Foo(), B
|
||||
|
||||
open class BarWithJvmDefault : B {
|
||||
@JvmDefault
|
||||
override fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
class BarWithJvmDefaultSuper: BarWithJvmDefault()
|
||||
+322
@@ -0,0 +1,322 @@
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
public interface KInterface {
|
||||
@JvmDefault
|
||||
fun test(): String {
|
||||
return "OK";
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
val property: String
|
||||
get() = "OK"
|
||||
|
||||
|
||||
fun testNonDefault(): String {
|
||||
return "OK";
|
||||
}
|
||||
|
||||
val propertyNonDefault: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
interface KotlinInterface : KInterface {
|
||||
@JvmDefault
|
||||
fun fooo() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
val propertyy: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
fun foooNonDefault() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val propertyyNonDefault: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
interface KotlinInterfaceIndirectInheritance : KotlinInterface {
|
||||
@JvmDefault
|
||||
fun foooo() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
val propertyyy: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
fun fooooNonDefault() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val propertyyyNonDefault: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
open class KotlinClass : KInterface {
|
||||
fun foo() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val xproperty: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
class KotlinClassIndirectInheritance : KotlinClass() {
|
||||
fun foo2() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
val property2: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
|
||||
fun foo() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val xproperty: String
|
||||
get() {
|
||||
super.test()
|
||||
super.property
|
||||
|
||||
super.testNonDefault()
|
||||
super.propertyNonDefault
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>property<!>
|
||||
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>testNonDefault<!>()
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>propertyNonDefault<!>
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
KotlinClass().test()
|
||||
KotlinClass().property
|
||||
KotlinClass().propertyNonDefault
|
||||
KotlinClassIndirectInheritance2().test()
|
||||
KotlinClassIndirectInheritance2().testNonDefault()
|
||||
KotlinClassIndirectInheritance2().propertyyy
|
||||
KotlinClassIndirectInheritance2().propertyyyNonDefault
|
||||
|
||||
KotlinClass().test()
|
||||
KotlinClass().testNonDefault()
|
||||
KotlinClass().property
|
||||
KotlinClass().propertyNonDefault
|
||||
}
|
||||
Vendored
+162
@@ -0,0 +1,162 @@
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
// !JVM_TARGET: 1.8
|
||||
// FILE: JavaInterface.java
|
||||
|
||||
public interface JavaInterface {
|
||||
default String test() {
|
||||
return "OK";
|
||||
}
|
||||
|
||||
default String testOverride() {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 1.kt
|
||||
|
||||
interface KotlinInterface : JavaInterface {
|
||||
@JvmDefault
|
||||
fun fooo() {
|
||||
super.test()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
val propertyy: String
|
||||
get() {
|
||||
super.test()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterface.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
override fun testOverride(): String {
|
||||
return "OK";
|
||||
}
|
||||
}
|
||||
|
||||
interface KotlinInterfaceIndirectInheritance : KotlinInterface {
|
||||
@JvmDefault
|
||||
fun foooo() {
|
||||
super.test()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmDefault
|
||||
val propertyyy: String
|
||||
get() {
|
||||
super.test()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinInterfaceIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
open class KotlinClass : JavaInterface {
|
||||
fun foo() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val property: String
|
||||
get() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClass.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
class KotlinClassIndirectInheritance : KotlinClass() {
|
||||
fun foo2() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val property2: String
|
||||
get() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
class KotlinClassIndirectInheritance2 : KotlinInterfaceIndirectInheritance {
|
||||
fun foo() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
val property: String
|
||||
get() {
|
||||
super.test()
|
||||
super.testOverride()
|
||||
|
||||
object {
|
||||
fun run () {
|
||||
super@KotlinClassIndirectInheritance2.<!UNRESOLVED_REFERENCE!>test<!>()
|
||||
}
|
||||
}
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
KotlinClass().foo()
|
||||
KotlinClass().property
|
||||
KotlinClassIndirectInheritance2().foo()
|
||||
KotlinClassIndirectInheritance2().property
|
||||
|
||||
KotlinClass().test()
|
||||
KotlinClass().property
|
||||
KotlinClass().testOverride()
|
||||
KotlinClassIndirectInheritance().testOverride()
|
||||
}
|
||||
Vendored
+29
@@ -0,0 +1,29 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
interface B {
|
||||
|
||||
@JvmDefault
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test2(s: String = "")
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test3()
|
||||
|
||||
|
||||
@JvmDefault
|
||||
abstract val prop: String
|
||||
|
||||
@JvmDefault
|
||||
abstract val prop2: String
|
||||
|
||||
@JvmDefault
|
||||
val prop3: String
|
||||
get() = ""
|
||||
|
||||
@JvmDefault
|
||||
var prop4: String
|
||||
get() = ""
|
||||
set(value) {}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
|
||||
abstract class A {
|
||||
|
||||
@JvmDefault
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test2(s: String = "")
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test3()
|
||||
}
|
||||
|
||||
object B {
|
||||
|
||||
@JvmDefault
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
fun test2(s: String = "") {}
|
||||
}
|
||||
Vendored
+14
@@ -0,0 +1,14 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface B {
|
||||
|
||||
@JvmDefault
|
||||
val prop1: String
|
||||
@JvmDefault get() = ""
|
||||
|
||||
|
||||
var prop2: String
|
||||
@JvmDefault get() = ""
|
||||
@JvmDefault set(value) {}
|
||||
}
|
||||
+31
@@ -0,0 +1,31 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface A {
|
||||
@JvmDefault
|
||||
fun test() {}
|
||||
}
|
||||
|
||||
interface Abstract : A {
|
||||
override fun test()
|
||||
}
|
||||
|
||||
interface ANonDefault {
|
||||
fun test() {}
|
||||
}
|
||||
|
||||
interface B: A {
|
||||
override fun test() {}
|
||||
}
|
||||
|
||||
interface C: ANonDefault, A {
|
||||
override fun test() {}
|
||||
}
|
||||
|
||||
interface D: A, ANonDefault {
|
||||
override fun test() {}
|
||||
}
|
||||
|
||||
class Foo : A {
|
||||
override fun test() {}
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface A {
|
||||
@JvmDefault
|
||||
val test: String
|
||||
get() = "OK"
|
||||
}
|
||||
|
||||
interface Abstract : A {
|
||||
override val test: String
|
||||
}
|
||||
|
||||
interface ANonDefault {
|
||||
val test: String
|
||||
get() = "ANonDefault"
|
||||
}
|
||||
|
||||
interface B: A {
|
||||
override val test: String
|
||||
get() = "B"
|
||||
}
|
||||
|
||||
interface C: ANonDefault, A {
|
||||
override val test: String
|
||||
get() = "C"
|
||||
}
|
||||
|
||||
interface D: A, ANonDefault {
|
||||
override val test: String
|
||||
get() = "C"
|
||||
}
|
||||
+62
@@ -0,0 +1,62 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
// FILE: 1.kt
|
||||
interface A {
|
||||
@JvmDefault
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: 2.kt
|
||||
interface B : A {
|
||||
|
||||
}
|
||||
|
||||
interface C : B {
|
||||
@JvmDefault
|
||||
override fun test() {
|
||||
super.test()
|
||||
}
|
||||
}
|
||||
|
||||
open class Foo : B {
|
||||
override fun test() {
|
||||
super.test()
|
||||
}
|
||||
}
|
||||
open class Foo2 : B
|
||||
|
||||
open class Bar : Foo2() {
|
||||
override fun test() {
|
||||
super.test()
|
||||
}
|
||||
}
|
||||
|
||||
open class Bar2 : Bar() {
|
||||
override fun test() {
|
||||
super.test()
|
||||
}
|
||||
}
|
||||
|
||||
class ManySupers: Foo2(), B {
|
||||
fun foo() {
|
||||
super<Foo2>.test()
|
||||
super<B>.test()
|
||||
super.test()
|
||||
}
|
||||
}
|
||||
|
||||
class ManySupers2: Foo2(), C {
|
||||
fun foo() {
|
||||
super<Foo2>.test()
|
||||
super<C>.test()
|
||||
super.test()
|
||||
}
|
||||
}
|
||||
|
||||
class ManySupers3: Bar2(), C {
|
||||
fun foo() {
|
||||
super<Bar2>.test()
|
||||
super<C>.test()
|
||||
super.test()
|
||||
}
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
interface A {
|
||||
@JvmDefault
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
interface B{
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
interface AB: A, B
|
||||
|
||||
interface BA: B, A
|
||||
|
||||
|
||||
interface C : A, B {
|
||||
@JvmDefault
|
||||
override fun test() {
|
||||
super<B>.test()
|
||||
super<A>.test()
|
||||
}
|
||||
}
|
||||
|
||||
interface D : B, A {
|
||||
@JvmDefault
|
||||
override fun test() {
|
||||
super<B>.test()
|
||||
super<A>.test()
|
||||
}
|
||||
}
|
||||
Vendored
+32
@@ -0,0 +1,32 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
interface A {
|
||||
@JvmDefault
|
||||
fun test()
|
||||
}
|
||||
|
||||
interface B{
|
||||
fun test() {
|
||||
}
|
||||
}
|
||||
|
||||
interface AB: A, B
|
||||
|
||||
interface BA: B, A
|
||||
|
||||
class C : A, B {
|
||||
override fun test() {
|
||||
super<B>.test()
|
||||
}
|
||||
}
|
||||
|
||||
class D : B, A {
|
||||
override fun test() {
|
||||
super<B>.test()
|
||||
}
|
||||
}
|
||||
|
||||
class E: B, A {
|
||||
fun foo() {
|
||||
super<B>.test()
|
||||
}
|
||||
}
|
||||
Vendored
+31
@@ -0,0 +1,31 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
interface A {
|
||||
@JvmDefault
|
||||
fun test() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface B{
|
||||
fun test()
|
||||
}
|
||||
interface AB : A, B
|
||||
interface BA : B, A
|
||||
|
||||
class C : A, B {
|
||||
override fun test() {
|
||||
super<A>.test()
|
||||
}
|
||||
}
|
||||
|
||||
class D : B, A {
|
||||
override fun test() {
|
||||
super<A>.test()
|
||||
}
|
||||
}
|
||||
|
||||
class E: B, A {
|
||||
fun foo() {
|
||||
super<A>.test()
|
||||
}
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// !JVM_TARGET: 1.6
|
||||
|
||||
interface B {
|
||||
|
||||
@JvmDefault
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test2(s: String = "")
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test3()
|
||||
|
||||
|
||||
@JvmDefault
|
||||
abstract val prop: String
|
||||
|
||||
@JvmDefault
|
||||
abstract val prop2: String
|
||||
|
||||
@JvmDefault
|
||||
val prop3: String
|
||||
get() = ""
|
||||
|
||||
@JvmDefault
|
||||
var prop4: String
|
||||
get() = ""
|
||||
set(value) {}
|
||||
}
|
||||
+30
@@ -0,0 +1,30 @@
|
||||
// !JVM_TARGET: 1.8
|
||||
// !JVM_DEFAULT_MODE: enable
|
||||
|
||||
interface B {
|
||||
|
||||
@JvmDefault
|
||||
fun test() {}
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test2(s: String = "")
|
||||
|
||||
@JvmDefault
|
||||
abstract fun test3()
|
||||
|
||||
|
||||
@JvmDefault
|
||||
abstract val prop: String
|
||||
|
||||
@JvmDefault
|
||||
abstract val prop2: String
|
||||
|
||||
@JvmDefault
|
||||
val prop3: String
|
||||
get() = ""
|
||||
|
||||
@JvmDefault
|
||||
var prop4: String
|
||||
get() = ""
|
||||
set(value) {}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class A {
|
||||
|
||||
@JvmField val clash = 1;
|
||||
|
||||
companion object {
|
||||
val clash = 1;
|
||||
}
|
||||
}
|
||||
Vendored
+13
@@ -0,0 +1,13 @@
|
||||
@file:kotlin.jvm.JvmMultifileClass
|
||||
@file:JvmName("SomeName")
|
||||
|
||||
@JvmField
|
||||
val c = 4
|
||||
|
||||
@JvmField
|
||||
var g = 5
|
||||
|
||||
class C {
|
||||
@JvmField
|
||||
var g = 5
|
||||
}
|
||||
Vendored
+12
@@ -0,0 +1,12 @@
|
||||
@file:JvmName("SomeName")
|
||||
|
||||
@JvmField
|
||||
val c = 4
|
||||
|
||||
@JvmField
|
||||
var g = 5
|
||||
|
||||
class C {
|
||||
@JvmField
|
||||
var g = 5
|
||||
}
|
||||
+59
@@ -0,0 +1,59 @@
|
||||
// !LANGUAGE: +JvmFieldInInterface
|
||||
|
||||
interface A {
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val c = 3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface B {
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
val c = 3
|
||||
|
||||
@JvmField
|
||||
val a = 3
|
||||
}
|
||||
}
|
||||
|
||||
interface C {
|
||||
companion object {
|
||||
@JvmField
|
||||
val c = 3
|
||||
|
||||
val a = 3
|
||||
}
|
||||
}
|
||||
|
||||
interface D {
|
||||
companion object {
|
||||
@JvmField
|
||||
var c = 3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface E {
|
||||
companion object {
|
||||
@JvmField
|
||||
private val a = 3
|
||||
|
||||
@JvmField
|
||||
internal val b = 3
|
||||
|
||||
@JvmField
|
||||
protected val c = 3
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
interface F {
|
||||
companion object {
|
||||
@JvmField
|
||||
open val a = 3
|
||||
}
|
||||
}
|
||||
Vendored
+143
@@ -0,0 +1,143 @@
|
||||
// !LANGUAGE: +NestedClassesInAnnotations +InlineClasses
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER -UNUSED_VARIABLE
|
||||
|
||||
@kotlin.jvm.JvmField
|
||||
fun foo() {
|
||||
@kotlin.jvm.JvmField val x = "A"
|
||||
}
|
||||
|
||||
annotation class DemoAnnotation
|
||||
|
||||
@JvmField
|
||||
abstract class C : I{
|
||||
|
||||
@kotlin.jvm.JvmField constructor(s: String) {
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmField private fun foo(s: String = "OK") {
|
||||
}
|
||||
|
||||
@JvmField val a: String by lazy { "A" }
|
||||
|
||||
@JvmField open val b: Int = 3
|
||||
|
||||
@JvmField abstract val c: Int
|
||||
|
||||
@JvmField
|
||||
val customGetter: String = ""
|
||||
get() = field
|
||||
|
||||
@JvmField
|
||||
val explicitDefaultGetter: String = ""
|
||||
get
|
||||
|
||||
@JvmField
|
||||
var explicitDefaultSetter: String = ""
|
||||
set
|
||||
|
||||
@JvmField
|
||||
val explicitDefaultAnnotatedGetter: String = ""
|
||||
@DemoAnnotation get
|
||||
|
||||
@JvmField
|
||||
var explicitDefaultAnnotatedSetter: String = ""
|
||||
@DemoAnnotation set
|
||||
|
||||
@JvmField
|
||||
var customSetter: String = ""
|
||||
set(s) {
|
||||
field = s
|
||||
}
|
||||
|
||||
@JvmField
|
||||
val noBackingField: String
|
||||
get() = "a"
|
||||
|
||||
@JvmField
|
||||
final override val ai = 3
|
||||
|
||||
@JvmField
|
||||
private val private = 3
|
||||
}
|
||||
|
||||
interface I {
|
||||
@JvmField val ai: Int
|
||||
@JvmField val bi: Int
|
||||
get() = 5
|
||||
}
|
||||
|
||||
class G {
|
||||
@JvmField
|
||||
lateinit var lateInit: String
|
||||
|
||||
@delegate:JvmField
|
||||
val s: String by lazy { "s" }
|
||||
}
|
||||
|
||||
@JvmField
|
||||
const val Const = 4
|
||||
|
||||
@JvmField
|
||||
var i = 5
|
||||
|
||||
class H {
|
||||
companion object {
|
||||
@JvmField
|
||||
var c = 3
|
||||
}
|
||||
}
|
||||
|
||||
interface K {
|
||||
|
||||
val i: Int
|
||||
val j: Int
|
||||
|
||||
companion object {
|
||||
@JvmField
|
||||
var c = 3
|
||||
|
||||
var x = 3
|
||||
}
|
||||
}
|
||||
|
||||
class KK : K {
|
||||
@JvmField
|
||||
override val i: Int = 0
|
||||
@JvmField
|
||||
override final val j: Int = 0
|
||||
}
|
||||
|
||||
open class KKK : K {
|
||||
@JvmField
|
||||
override val i: Int = 0
|
||||
@JvmField
|
||||
override final val j: Int = 0
|
||||
}
|
||||
|
||||
annotation class L {
|
||||
companion object {
|
||||
@JvmField
|
||||
var c = 3
|
||||
}
|
||||
}
|
||||
|
||||
object O {
|
||||
@JvmField
|
||||
val c = 3
|
||||
}
|
||||
|
||||
@JvmField
|
||||
private val private = 3
|
||||
|
||||
inline class Foo(val x: Int)
|
||||
|
||||
object IObject {
|
||||
@JvmField
|
||||
val c: Foo = Foo(42)
|
||||
|
||||
@JvmField
|
||||
val u = 42u
|
||||
|
||||
@JvmField
|
||||
private val r: Result<Int> = TODO()
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
class C {
|
||||
@kotlin.jvm.JvmOverloads constructor() {
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmOverloads fun foo(s: String) {}
|
||||
}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
interface T {
|
||||
@kotlin.jvm.JvmOverloads fun foo(s: String = "OK")
|
||||
|
||||
@kotlin.jvm.JvmOverloads fun bar(s: String = "OK") {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
abstract class C {
|
||||
@kotlin.jvm.JvmOverloads abstract fun foo(s: String = "OK")
|
||||
}
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// !LANGUAGE: -ProhibitJvmOverloadsOnConstructorsOfAnnotationClasses
|
||||
|
||||
annotation class A1 @JvmOverloads constructor(val x: Int = 1)
|
||||
annotation class A2 @JvmOverloads constructor()
|
||||
+4
@@ -0,0 +1,4 @@
|
||||
// !LANGUAGE: +ProhibitJvmOverloadsOnConstructorsOfAnnotationClasses
|
||||
|
||||
annotation class A1 @JvmOverloads constructor(val x: Int = 1)
|
||||
annotation class A2 @JvmOverloads constructor()
|
||||
Vendored
+23
@@ -0,0 +1,23 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
class C {
|
||||
@kotlin.jvm.JvmOverloads private fun foo(s: String = "OK") {
|
||||
}
|
||||
|
||||
@kotlin.jvm.JvmOverloads fun bar(s: String = "OK") {
|
||||
}
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
@kotlin.jvm.JvmOverloads fun quux(s: String = "OK") {
|
||||
}
|
||||
|
||||
class D {
|
||||
@kotlin.jvm.JvmOverloads fun foo(s: String = "OK") {
|
||||
}
|
||||
}
|
||||
|
||||
val x = object {
|
||||
@kotlin.jvm.JvmOverloads fun foo(s: String = "OK") {
|
||||
}
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// !DIAGNOSTICS: -INVISIBLE_MEMBER -INVISIBLE_REFERENCE
|
||||
|
||||
// FILE: b.kt
|
||||
@file:JvmPackageName("")
|
||||
package b
|
||||
fun b() {}
|
||||
|
||||
// FILE: c.kt
|
||||
@file:JvmPackageName("invalid-fq-name")
|
||||
package c
|
||||
fun c() {}
|
||||
|
||||
// FILE: d.kt
|
||||
@file:JvmPackageName("d")
|
||||
package d
|
||||
class D
|
||||
fun d() {}
|
||||
|
||||
// FILE: e.kt
|
||||
@file:JvmPackageName(42)
|
||||
package e
|
||||
fun e() {}
|
||||
|
||||
// FILE: f.kt
|
||||
@file:JvmPackageName(f)
|
||||
package f
|
||||
const val name = "f"
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
// !DIAGNOSTICS: -UNUSED_PARAMETER
|
||||
// SKIP_TXT
|
||||
// FILE: test.kt
|
||||
package test
|
||||
|
||||
import kotlin.internal.*
|
||||
|
||||
const val ZERO = 0
|
||||
const val ONE = 1
|
||||
|
||||
fun zero() = 0
|
||||
val one = 1
|
||||
|
||||
val test0 = apiVersionIsAtLeast(0, 0, 0)
|
||||
val testConstVals = apiVersionIsAtLeast(ONE, ONE, ZERO)
|
||||
val testConstExprs = apiVersionIsAtLeast(ONE + 0, 1 + 0, ((0 + 1 + 0)))
|
||||
val testNonConstExprs = apiVersionIsAtLeast(one, zero(), one + 1)
|
||||
|
||||
// FILE: apiVersionIsAtLeast.kt
|
||||
package kotlin.internal
|
||||
|
||||
fun apiVersionIsAtLeast(epic: Int, major: Int, minor: Int): Boolean =
|
||||
false
|
||||
Vendored
+18
@@ -0,0 +1,18 @@
|
||||
class A {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmStatic const val z = 1;
|
||||
|
||||
@JvmStatic @JvmField val x = 1;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
object B {
|
||||
|
||||
@JvmStatic const val z = 1;
|
||||
|
||||
@JvmStatic @JvmField val x = 1;
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// !LANGUAGE: -JvmStaticInInterface
|
||||
class A(@JvmStatic val z: Int) {
|
||||
|
||||
}
|
||||
Vendored
+4
@@ -0,0 +1,4 @@
|
||||
// !LANGUAGE: +JvmStaticInInterface
|
||||
class A(@JvmStatic val z: Int) {
|
||||
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
class A {
|
||||
@JvmStatic constructor() {}
|
||||
inner class B {
|
||||
@JvmStatic constructor() {}
|
||||
}
|
||||
}
|
||||
|
||||
class C @JvmStatic constructor()
|
||||
Vendored
+33
@@ -0,0 +1,33 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
abstract class A {
|
||||
|
||||
open fun a() {}
|
||||
|
||||
abstract fun b()
|
||||
|
||||
open fun c() {}
|
||||
}
|
||||
|
||||
object B: A() {
|
||||
|
||||
@JvmStatic override fun a() {}
|
||||
|
||||
@JvmStatic override fun b() {}
|
||||
|
||||
@JvmStatic final override fun c() {}
|
||||
|
||||
@JvmStatic open fun d() {}
|
||||
}
|
||||
|
||||
class C {
|
||||
|
||||
companion object: A() {
|
||||
@JvmStatic override fun a() {}
|
||||
|
||||
@JvmStatic override fun b() {}
|
||||
|
||||
@JvmStatic final override fun c() {}
|
||||
|
||||
@JvmStatic open fun d() {}
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
// !LANGUAGE: -JvmStaticInInterface
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
class A {
|
||||
companion object {
|
||||
@JvmStatic fun a1() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
object A {
|
||||
@JvmStatic fun a2() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val s = object {
|
||||
@JvmStatic fun a3() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic fun a4() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface B {
|
||||
companion object {
|
||||
@JvmStatic fun a1() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
object A {
|
||||
@JvmStatic fun a2() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val s = object {
|
||||
@JvmStatic fun a3() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic fun a4() {
|
||||
|
||||
}
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// !LANGUAGE: +JvmStaticInInterface
|
||||
class A {
|
||||
companion object {
|
||||
@JvmStatic fun a1() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
object A {
|
||||
@JvmStatic fun a2() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val s = object {
|
||||
@JvmStatic fun a3() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic fun a4() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
interface B {
|
||||
companion object {
|
||||
@JvmStatic fun a1() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
object A {
|
||||
@JvmStatic fun a2() {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
fun test() {
|
||||
val s = object {
|
||||
@JvmStatic fun a3() {
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@JvmStatic fun a4() {
|
||||
|
||||
}
|
||||
}
|
||||
Vendored
+54
@@ -0,0 +1,54 @@
|
||||
// !LANGUAGE: -JvmStaticInInterface
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
interface B {
|
||||
companion object {
|
||||
@JvmStatic fun a1() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic private fun a2() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic protected fun a3() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic internal fun a4() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
var foo = 1
|
||||
|
||||
@JvmStatic
|
||||
var foo1 = 1
|
||||
protected set
|
||||
|
||||
@JvmStatic
|
||||
var foo2 = 1
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
private var foo3 = 1
|
||||
|
||||
@JvmStatic
|
||||
protected var foo4 = 1
|
||||
|
||||
@JvmStatic
|
||||
protected var foo5 = 1
|
||||
|
||||
@JvmStatic
|
||||
val foo6 = 1
|
||||
|
||||
val foo7 = 1
|
||||
@JvmStatic get
|
||||
|
||||
private var foo8 = 1
|
||||
@JvmStatic public set
|
||||
|
||||
public var foo9 = 1
|
||||
@JvmStatic private set
|
||||
}
|
||||
|
||||
}
|
||||
+55
@@ -0,0 +1,55 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// !LANGUAGE: +JvmStaticInInterface
|
||||
interface B {
|
||||
companion object {
|
||||
@JvmStatic fun a1() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic private fun a2() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic protected fun a3() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic internal fun a4() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
var foo = 1
|
||||
|
||||
@JvmStatic
|
||||
var foo1 = 1
|
||||
protected set
|
||||
|
||||
@JvmStatic
|
||||
var foo2 = 1
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
private var foo3 = 1
|
||||
|
||||
@JvmStatic
|
||||
protected var foo4 = 1
|
||||
|
||||
@JvmStatic
|
||||
protected var foo5 = 1
|
||||
|
||||
@JvmStatic
|
||||
val foo6 = 1
|
||||
|
||||
val foo7 = 1
|
||||
@JvmStatic get
|
||||
|
||||
private var foo8 = 1
|
||||
@JvmStatic public set
|
||||
|
||||
public var foo9 = 1
|
||||
@JvmStatic private set
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
// !LANGUAGE: +JvmStaticInInterface
|
||||
// !JVM_TARGET: 1.8
|
||||
interface B {
|
||||
companion object {
|
||||
@JvmStatic fun a1() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic private fun a2() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic protected fun a3() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic internal fun a4() {
|
||||
|
||||
}
|
||||
|
||||
@JvmStatic
|
||||
var foo = 1
|
||||
|
||||
@JvmStatic
|
||||
var foo1 = 1
|
||||
protected set
|
||||
|
||||
@JvmStatic
|
||||
var foo2 = 1
|
||||
private set
|
||||
|
||||
@JvmStatic
|
||||
private var foo3 = 1
|
||||
|
||||
@JvmStatic
|
||||
protected var foo4 = 1
|
||||
|
||||
@JvmStatic
|
||||
protected var foo5 = 1
|
||||
|
||||
@JvmStatic
|
||||
val foo6 = 1
|
||||
|
||||
val foo7 = 1
|
||||
@JvmStatic get
|
||||
|
||||
private var foo8 = 1
|
||||
@JvmStatic public set
|
||||
|
||||
public var foo9 = 1
|
||||
@JvmStatic private set
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// !LANGUAGE: -JvmStaticInInterface
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
fun main() {
|
||||
@JvmStatic fun a(){
|
||||
|
||||
}
|
||||
}
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
// !LANGUAGE: +JvmStaticInInterface
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
fun main() {
|
||||
@JvmStatic fun a(){
|
||||
|
||||
}
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// !LANGUAGE: -JvmStaticInInterface
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
open class B {
|
||||
public open val base1 : Int = 1
|
||||
public open val base2 : Int = 1
|
||||
}
|
||||
|
||||
class A {
|
||||
companion object : B() {
|
||||
var p1:Int = 1
|
||||
@JvmStatic set(p: Int) {
|
||||
p1 = 1
|
||||
}
|
||||
|
||||
@JvmStatic val z = 1;
|
||||
|
||||
@JvmStatic override val base1: Int = 0
|
||||
|
||||
override val base2: Int = 0
|
||||
@JvmStatic get
|
||||
}
|
||||
|
||||
object A : B() {
|
||||
var p:Int = 1
|
||||
@JvmStatic set(p1: Int) {
|
||||
p = 1
|
||||
}
|
||||
|
||||
@JvmStatic val z = 1;
|
||||
|
||||
@JvmStatic override val base1: Int = 0
|
||||
|
||||
@JvmStatic open fun f() {}
|
||||
|
||||
override val base2: Int = 0
|
||||
@JvmStatic get
|
||||
}
|
||||
|
||||
var p:Int = 1
|
||||
@JvmStatic set(p1: Int) {
|
||||
p = 1
|
||||
}
|
||||
|
||||
@JvmStatic val z2 = 1;
|
||||
}
|
||||
+45
@@ -0,0 +1,45 @@
|
||||
// !LANGUAGE: +JvmStaticInInterface
|
||||
// !DIAGNOSTICS: -UNUSED_VARIABLE
|
||||
open class B {
|
||||
public open val base1 : Int = 1
|
||||
public open val base2 : Int = 1
|
||||
}
|
||||
|
||||
class A {
|
||||
companion object : B() {
|
||||
var p1:Int = 1
|
||||
@JvmStatic set(p: Int) {
|
||||
p1 = 1
|
||||
}
|
||||
|
||||
@JvmStatic val z = 1;
|
||||
|
||||
@JvmStatic override val base1: Int = 0
|
||||
|
||||
override val base2: Int = 0
|
||||
@JvmStatic get
|
||||
}
|
||||
|
||||
object A : B() {
|
||||
var p:Int = 1
|
||||
@JvmStatic set(p1: Int) {
|
||||
p = 1
|
||||
}
|
||||
|
||||
@JvmStatic val z = 1;
|
||||
|
||||
@JvmStatic override val base1: Int = 0
|
||||
|
||||
@JvmStatic open fun f() {}
|
||||
|
||||
override val base2: Int = 0
|
||||
@JvmStatic get
|
||||
}
|
||||
|
||||
var p:Int = 1
|
||||
@JvmStatic set(p1: Int) {
|
||||
p = 1
|
||||
}
|
||||
|
||||
@JvmStatic val z2 = 1;
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
open class A
|
||||
class B1 : A()
|
||||
class B2 : A()
|
||||
|
||||
annotation class Ann1(val arg: Array<KClass<in A>>)
|
||||
|
||||
@Ann1(arrayOf(A::class))
|
||||
class MyClass1
|
||||
|
||||
@Ann1(arrayOf(Any::class))
|
||||
class MyClass1a
|
||||
|
||||
@Ann1(arrayOf(B1::class))
|
||||
class MyClass2
|
||||
|
||||
annotation class Ann2(val arg: Array<KClass<in B1>>)
|
||||
|
||||
@Ann2(arrayOf(A::class))
|
||||
class MyClass3
|
||||
|
||||
@Ann2(arrayOf(B1::class))
|
||||
class MyClass4
|
||||
|
||||
@Ann2(arrayOf(B2::class))
|
||||
class MyClass5
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
// !WITH_NEW_INFERENCE
|
||||
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
open class A
|
||||
class B1 : A()
|
||||
class B2 : A()
|
||||
|
||||
annotation class Ann1(val arg: Array<KClass<out A>>)
|
||||
|
||||
@Ann1(arrayOf(A::class))
|
||||
class MyClass1
|
||||
|
||||
@Ann1(arrayOf(Any::class))
|
||||
class MyClass1a
|
||||
|
||||
@Ann1(arrayOf(B1::class))
|
||||
class MyClass2
|
||||
|
||||
annotation class Ann2(val arg: Array<KClass<out B1>>)
|
||||
|
||||
@Ann2(arrayOf(A::class))
|
||||
class MyClass3
|
||||
|
||||
@Ann2(arrayOf(B1::class))
|
||||
class MyClass4
|
||||
|
||||
@Ann2(arrayOf(B2::class))
|
||||
class MyClass5
|
||||
+20
@@ -0,0 +1,20 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
annotation class Ann1(val arg: KClass<*>)
|
||||
annotation class Ann2(vararg val arg: KClass<*>)
|
||||
annotation class Ann3(val arg: Array<KClass<*>>)
|
||||
|
||||
class A1
|
||||
class A2
|
||||
|
||||
@Ann1(A1::class)
|
||||
@Ann2(A1::class, A2::class)
|
||||
@Ann3(arrayOf(A1::class, A2::class))
|
||||
class MyClass1
|
||||
|
||||
@Ann1(<!UNRESOLVED_REFERENCE!>A3<!>::class)
|
||||
class MyClass2
|
||||
|
||||
val x = A1::class
|
||||
@Ann1(x)
|
||||
class MyClass3
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
open class A
|
||||
class B1 : A()
|
||||
class B2 : A()
|
||||
|
||||
annotation class Ann1(val arg: KClass<in A>)
|
||||
|
||||
@Ann1(A::class)
|
||||
class MyClass1
|
||||
|
||||
@Ann1(Any::class)
|
||||
class MyClass1a
|
||||
|
||||
@Ann1(B1::class)
|
||||
class MyClass2
|
||||
|
||||
annotation class Ann2(val arg: KClass<in B1>)
|
||||
|
||||
@Ann2(A::class)
|
||||
class MyClass3
|
||||
|
||||
@Ann2(B1::class)
|
||||
class MyClass4
|
||||
|
||||
@Ann2(B2::class)
|
||||
class MyClass5
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
open class A
|
||||
class B1 : A()
|
||||
class B2 : A()
|
||||
|
||||
annotation class Ann1(val arg: KClass<out A>)
|
||||
|
||||
@Ann1(A::class)
|
||||
class MyClass1
|
||||
|
||||
@Ann1(Any::class)
|
||||
class MyClass1a
|
||||
|
||||
@Ann1(B1::class)
|
||||
class MyClass2
|
||||
|
||||
annotation class Ann2(val arg: KClass<out B1>)
|
||||
|
||||
@Ann2(A::class)
|
||||
class MyClass3
|
||||
|
||||
@Ann2(B1::class)
|
||||
class MyClass4
|
||||
|
||||
@Ann2(B2::class)
|
||||
class MyClass5
|
||||
+23
@@ -0,0 +1,23 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
open class A
|
||||
class B : A()
|
||||
|
||||
annotation class Ann1(val arg: KClass<A>)
|
||||
|
||||
@Ann1(A::class)
|
||||
class MyClass1
|
||||
|
||||
@Ann1(Any::class)
|
||||
class MyClass1a
|
||||
|
||||
@Ann1(B::class)
|
||||
class MyClass2
|
||||
|
||||
annotation class Ann2(val arg: KClass<B>)
|
||||
|
||||
@Ann2(A::class)
|
||||
class MyClass3
|
||||
|
||||
@Ann2(B::class)
|
||||
class MyClass4
|
||||
+7
@@ -0,0 +1,7 @@
|
||||
import kotlin.reflect.KClass
|
||||
|
||||
open class A
|
||||
class B1 : A()
|
||||
class B2 : A()
|
||||
|
||||
annotation class Ann1(val arg: Array<out KClass<out A>>)
|
||||
+5
@@ -0,0 +1,5 @@
|
||||
annotation class Ann(val x: Int, val value: String, val y: Double)
|
||||
|
||||
@Ann(value = "a", x = 1, y = 1.0) fun foo1() {}
|
||||
@Ann(2, "b", 2.0) fun foo2() {}
|
||||
@Ann(3, "c", y = 2.0) fun foo3() {}
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
int a();
|
||||
double b();
|
||||
boolean x();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(false,
|
||||
1.0,
|
||||
false, 1, 2) fun foo1() {}
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
int a();
|
||||
double b();
|
||||
boolean x();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(false,
|
||||
1.0,
|
||||
false) fun foo1() {}
|
||||
|
||||
@A(2.0, x = true, b = 2.0) fun foo2() {}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
int a();
|
||||
double b();
|
||||
String value();
|
||||
boolean x();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A("v1", 1,
|
||||
1.0,
|
||||
false) fun foo1() {}
|
||||
|
||||
@A("v2", 2, x = true, b = 2.0) fun foo2() {}
|
||||
|
||||
@A("v2", x = true, b = 3.0, a = 4) fun foo3() {}
|
||||
@A(value = "v2", x = true, b = 3.0, a = 4) fun foo4() {}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
// FILE: A.java
|
||||
public @interface A {
|
||||
int a();
|
||||
double b();
|
||||
boolean x();
|
||||
}
|
||||
|
||||
// FILE: b.kt
|
||||
@A(1,
|
||||
1.0,
|
||||
false) fun foo1() {}
|
||||
|
||||
@A(2, x = true, b = 2.0) fun foo2() {}
|
||||
|
||||
@A(x = true, b = 3.0, a = 4) fun foo3() {}
|
||||
|
||||
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
// !DIAGNOSTICS: -JAVA_LANG_CLASS_PARAMETER_IN_ANNOTATION
|
||||
package a.b.c
|
||||
|
||||
@kotlin.Deprecated("aaa")
|
||||
@ann1(kotlin.Deprecated("aaa"))
|
||||
|
||||
@a.b.c.ann1()
|
||||
@ann2(a.b.c.ann1())
|
||||
|
||||
@A.IAnn()
|
||||
@ann3(A.IAnn())
|
||||
|
||||
@a.b.c.A.IAnn()
|
||||
@ann3(a.b.c.A.IAnn())
|
||||
|
||||
@annArray(kotlin.arrayOf("a"))
|
||||
fun test() = 1
|
||||
|
||||
annotation class ann1(val p: Deprecated = kotlin.Deprecated("aaa"))
|
||||
annotation class ann2(val p: ann1 = a.b.c.ann1())
|
||||
annotation class ann3(val p: A.IAnn = A.IAnn(), val p2: A.IAnn = a.b.c.A.IAnn())
|
||||
|
||||
annotation class annArray(val p: Array<String> = kotlin.arrayOf("a"))
|
||||
|
||||
class A {
|
||||
annotation class IAnn
|
||||
}
|
||||
+17
@@ -0,0 +1,17 @@
|
||||
@kotlin.jvm.Strictfp class A {
|
||||
|
||||
}
|
||||
|
||||
@kotlin.jvm.Strictfp object B {
|
||||
|
||||
}
|
||||
|
||||
@kotlin.jvm.Strictfp interface C {
|
||||
|
||||
}
|
||||
|
||||
fun foo() {
|
||||
@kotlin.jvm.Strictfp class D
|
||||
|
||||
@kotlin.jvm.Strictfp object: Any() {}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
// FILE: TargetUse.java
|
||||
|
||||
import java.lang.annotation.Target;
|
||||
|
||||
public class TargetUse {
|
||||
public static String foo(kotlin.annotation.Target aTarget) {
|
||||
return aTarget.toString();
|
||||
}
|
||||
|
||||
public static String bar(Target aTarget) {
|
||||
return aTarget.toString();
|
||||
}
|
||||
}
|
||||
|
||||
// FILE: TargetUse.kt
|
||||
|
||||
import java.lang.annotation.Target as JTarget
|
||||
|
||||
fun fooUse(aTarget: Target): String = TargetUse.foo(aTarget)
|
||||
|
||||
fun barUse(aTarget: JTarget): String = TargetUse.bar(aTarget)
|
||||
Reference in New Issue
Block a user