Skip to content
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 1.4 breaks ktlint api: java.lang.NoSuchFieldError: FUN_KEYWORD #771

Closed
stephanenicolas opened this issue Jun 8, 2020 · 8 comments

Comments

@stephanenicolas
Copy link
Contributor

Using kotlin 1.4 M2,

I got these errors in a test:

java.lang.NoSuchFieldError: FUN_KEYWORD
	at com.pinterest.ktlint.core.ast.ElementType.<clinit>(ElementType.kt:154)

and

java.lang.NoClassDefFoundError: Could not initialize class com.pinterest.ktlint.core.ast.ElementType

More generally speaking, is there a plan to have ktlint working with kotlin 1.4 ?

@stephanenicolas
Copy link
Contributor Author

stephanenicolas commented Jun 8, 2020

I forked the repo and yes, definitely the problem is the field FUN_KEYWORD in KtTokens that is used from ktlint's ElementType.
It might be coming from this change: JetBrains/kotlin@4aa195e#diff-2bc480f66e04de84c4be401f25395fb3

@shashachu
Copy link
Contributor

@stephanenicolas hi, thanks for the report and for digging in to root cause. Yes, we will update to support 1.4, likely once it's been officially released.

@stephanenicolas
Copy link
Contributor Author

stephanenicolas commented Jun 9, 2020

@shashachu I understand that other aspects of the plugin and its maintenance also require work.
I totally get that and thx for all the work you're doing.

Nonetheless, we cannot test our build and prepare our own migration due to this bug and I guess we're not the only ones.
I tried to check a bit more but I am really not confident on how to address the issue.

Is there a way this issue could be prioritized so that we could test other aspects of our builds ?Ideally we would be early adopters of kotlin 1.4 which is already in M2 stage.
We have a very large build and we work often with people from JB to optimize the performance of the kotlin tooling. Fixing this bug would help us to enhance the next kotlin version for the whole community.

@shashachu
Copy link
Contributor

@stephanenicolas when you have a chance, can you just add a little more detail about your setup and how you're running your tests? Thanks!

@Tapchicoma
Copy link
Collaborator

As one of the things that should address this - we are planning to start publishing snapshots that will use kotlin-in-development versions.

@henrik242
Copy link

Kotlin 1.4.0 has been released: https://github.com/JetBrains/kotlin/releases/tag/v1.4.0

@ZacSweers
Copy link

This should be folded into #830 to de-dupe issues

@romtsn
Copy link
Collaborator

romtsn commented Aug 18, 2020

yep, please track this in #830 (there's already a 0.38.0-alpha01 version that should resolve the aforementioned issue)

@romtsn romtsn closed this as completed Aug 18, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants