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

Switch to kotlin.reflect.typeOf for configurate-extra-kotlin #422

Closed

Conversation

NichtStudioCode
Copy link

This pull requests fixes #420 by replacing all typeTokenOf<T>() calls in the configurate-extra-kotlin module with typeOf<T>().javaType and also adds extension functions for KType.

I've also had to update Kotlin to 1.8.20 because typeOf() was experimental on the previous Kotlin version and added/changed some methods in the core module to also accept java.lang.reflect.Type instead of just TypeToken and Class.

I'm aware that this PR currently fails detekt tests, as ConfigurationNodeExtensions.kt now has 22/20 methods, but I don't see how (and why) one would split that file.

@zml2008
Copy link
Member

zml2008 commented Jul 25, 2023

We aren't planning on bumping the minimum kotlin version

@zml2008 zml2008 closed this Jul 25, 2023
@NichtStudioCode
Copy link
Author

NichtStudioCode commented Jul 25, 2023

What's the reason for that? I get why one would stay on older java versions, but I don't see a reason to stay on an old Kotlin version, because kotlin-stdlib is just a dependency. I'm also not aware of any breaking changes since 1.4.
Also, due to the usage of this outdated version, configurate is currently using experimental couroutines methods that don't exist anymore, which probably breaks compatibility with modern versions (which I would deem as more important).

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

Successfully merging this pull request may close these issues.

TypeToken interprets Kotlin type variance wrongly
2 participants