Jenkins Extension Annotations In Kotlin Do Not Work

Implementing a Jenkins plugin, the “@Extension” annotation is used to define extension points. These work in Java, but do not work in Kotlin. I am unsure why. Here is a small snippet of the kotlin code:

class MySCM : SCM, Serializable
{
    @Extension
    class DescriptorImpl : SCMDescriptor(MySCM::class.java, MyRepoBrowser::class.java)
    {
        init
        {
            load()
        }
       ...
    }
    ...
}

Since I believe the idea of the extension is to declare things that need to be implemented, I assume you would want to declare the class as open (non-final in Java-speak) along with the methods to be overridden.

Unfortunately, it doesn’t work for me. Looks that it works even for final Java classes, but doesn’t work for Kotlin open classes

Cannot understand why it doesn’t work