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.
This commit is contained in:
committed by
Space Team
parent
c0961e91b8
commit
5a08d8da8d
+37
@@ -0,0 +1,37 @@
|
||||
// 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 ""
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user