[FIR] Fix false positive POSITIONED_VALUE_ARGUMENT_FOR_JAVA_ANNOTATION

The original Java checker has an early return in
case of `resultingDescriptor !is JavaClassConstructorDescriptor`.
It fires if the descriptor is
`TypeAliasConstructorDescriptor`, thus further
diagnostics are not reported.
This commit is contained in:
Nikolay Lunyak
2023-09-05 14:19:33 +03:00
committed by Space Team
parent 1efa9abf57
commit f434228244
7 changed files with 73 additions and 2 deletions
@@ -0,0 +1,35 @@
// FIR_IDENTICAL
// ISSUE: KT-61309
// ALLOW_KOTLIN_PACKAGE
// FILE: Test.java
package javacode;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
@Target({ElementType.METHOD})
public @interface Test {
Class<? extends Throwable> expected() default None.class;
long timeout() default 0L;
}
// FILE: test.kt
package kotlin.test
typealias Test = javacode.Test
// FILE: main.kt
import kotlin.test.Test
import java.io.IOException
@Test(IOException::class)
fun someTest() {}
@Test(expected = IOException::class)
fun someRest() {}