Files
kotlin-fork/compiler/fir/analysis-tests/testData/resolveWithStdlib/repeatedAnnotations.kt
T
Kirill Rakhman 5a08d8da8d FIR: don't check annotations on returnTypeRefs that are not of real kind
This fixes an exception in FirAnnotationChecker where we tried to report
repeated annotations on implicit type refs that have no source.
2023-01-13 12:54:18 +00:00

38 lines
644 B
Kotlin
Vendored

// FILE: Some.java
import java.util.List;
public class Some {
public static List<@SomeAnn(1) @SomeAnn(2) String> foo() {
return null;
}
}
// FILE: SomeAnn.java
@Target({ElementType.TYPE_PARAMETER, ElementType.TYPE_USE})
public @interface SomeAnn {
int value();
}
// FILE: test.kt
fun <T> foo(bar: () -> T) {
}
@Target(AnnotationTarget.TYPE)
annotation class Ann
fun baz(): @Ann <!REPEATED_ANNOTATION!>@Ann<!> String = "12"
fun qux() = Some.foo()[0]
fun test() {
foo({ Some.foo()[0] })
foo({ baz() })
foo({ qux() })
foo(fun(): @Ann <!REPEATED_ANNOTATION!>@Ann<!> String {
return ""
})
}