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

javaClass.classLoader in registerSerializersCore causes a compiler warning #492

Open
ForNeVeR opened this issue Aug 24, 2024 · 0 comments
Open
Labels

Comments

@ForNeVeR
Copy link
Collaborator

ForNeVeR commented Aug 24, 2024

Every generated Kotlin class contains this snippet:

        override fun registerSerializersCore(serializers: ISerializers)  {
            val classLoader = javaClass.classLoader

javaClass.classLoader causes a Kotlin compiler warning:

The resulting type of this 'javaClass' call is Class<AvaloniaRiderProjectModel.Companion> and not Class. Please use the more clear '::class.java' syntax to avoid confusion

Let's either replace it with val classLoader = Companion::class.java.classLoader, or add @Suppress("JAVA_CLASS_ON_COMPANION") to generated files.

Currently, this issue blocks compiling projects with generated files if we have enabled warnings-as-errors in Kotlin.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant