Open traceyyoshima opened 6 months ago
Hey @traceyyoshima - this might be a separate issue, but I'm seeing missing types on a variety of annotation usages (in 1.8.1):
All these fail for me:
@Test
void fmtConstructorParamAnnotation() {
rewriteRun(
spec -> spec.recipe(new FindMissingTypes()).parser(KotlinParser.builder().logCompilationWarningsAndErrors(true)),
kotlin("""
import org.openrewrite.internal.lang.NonNull
class Foo(
@NonNull val x: String
)
"""
));
}
@Test
void fmtMethodParamAnnotation() {
rewriteRun(
spec -> spec.recipe(new FindMissingTypes()).parser(KotlinParser.builder().logCompilationWarningsAndErrors(true)),
kotlin("""
import org.openrewrite.internal.lang.NonNull
class Foo {
fun foo(@NonNull x: String) = ""
}
"""
));
}
@Test
void fmtClassAnnotation() {
rewriteRun(
spec -> spec.recipe(new FindMissingTypes()).parser(KotlinParser.builder().logCompilationWarningsAndErrors(true)),
kotlin("""
import org.openrewrite.internal.lang.NonNull
@NonNull
class Foo
"""
));
}
Annotations on expressions
+=
and-=
will not contain an associated FIR element. The issue is caused by the compiler and is fixed in1.9.20
.https://youtrack.jetbrains.com/issue/KT-62473