Files
kotlin-fork/compiler/testData/diagnostics/tests/unnamedArgsInJavaAnnotations.kt
T
Nikolay Lunyak f434228244 [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.
2023-09-07 13:48:22 +00:00

36 lines
689 B
Kotlin
Vendored

// 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() {}