Skip to content

Assertions.validateTypes can falsely report a missing type for a Kotlin method invocation #6408

@greg-dennis

Description

@greg-dennis

What version of OpenRewrite are you using?

I am using commit d9be625, an 8.69.0-SNAPSHOT

How are you running OpenRewrite?

Developing a new recipe in rewrite-testing-frameworks.

What is the smallest, simplest way to reproduce the problem?

  • Patch the test in this PR and run it. It should pass, and the equivalent test does pass if added to the rewrite repo.

What did you see instead?

The test fails because the type of the method invocation is determined to be null.

Are you interested in contributing a fix to OpenRewrite?

Yes.

I tracked it down to the FirFunctionCall having a calleeReference that is found to be a FirErrorNamedReference in PsiElementAssociations here. And a null type is apparently acknowledged as expected for some method invocations by KotlinTreeParseVisitor here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions