Skip to content

javaClass.classLoader in registerSerializersCore causes a compiler warning #492

Description

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions