-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Kotlin constructor invocation parsed as method invocation #622
Comments
Thanks for the runnable example @reisners ! Did you already explore what the cause might be? |
I did some debugging, but not yet to a conclusive result. Will keep looking |
To begin with, I was setting up the test wrongly, using the JavaParser builder instead of the KotlinParser.Builder, and I wasn't adding 3rd party dependencies to either parser's classpath (although this is irrelevant for the example code, I noticed that the same error also occurred when invoking the constructor of a class from some other 3rd party dependency). |
Thanks for reporting your findings here! Indeed 2.1+ support is pending and tracked here; we're exploring a collaboration there. |
This may be an ill place but I just have to compliment you people on this project: the sheer volume of what you have built and the quality of the code, and last but not least the value it adds to the ecosystem.
Best regards,
Stefan
…________________________________
From: Tim te Beek ***@***.***>
Sent: Sunday, January 5, 2025 4:14:55 PM
To: openrewrite/rewrite-kotlin ***@***.***>
Cc: Dr. Stefan Reisner ***@***.***>; State change ***@***.***>
Subject: Re: [openrewrite/rewrite-kotlin] Kotlin constructor invocation parsed as method invocation (Issue #622)
Thanks for reporting your findings here! Indeed 2.1+ support is pending and tracked here; we're exploring a collaboration there.
* #618<#618>
—
Reply to this email directly, view it on GitHub<#622 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/AAPKZTSD7VJMTWQOCRFVCYT2JE457AVCNFSM6AAAAABUPY4JVCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDKNZRGY2DCMJYGI>.
You are receiving this because you modified the open/close state.Message ID: ***@***.***>
|
Thanks a lot for the kind words! Indeed a lot of work and passion has been poured into the project, and we feel fortunate with where we stand and the support from the wider community. I continue to look forward to where this will go. It's a big shift! :) |
I'm trying to use OpenRewrite (bom version 2.23.1, rewrite-kotlin 1.23.1) to do some static analysis on our Kotlin and Java Spring Boot codebase.
I noticed the following issue: OpenRewrite does not correctly parse invocations of constructors of Kotlin classes defined in 3rd party dependencies or even Kotlin standard library, e.g. Pair. It seems to interpret the constructor invocation as a method invocation and complains about the unknown return type, as can be seen in the following test case:
While the locally declared
A("x")
is correctly identified as a constructor invocation, the last line errors with(the behavior does not change if I use import statements)
The text was updated successfully, but these errors were encountered: