// example simplified and made to work in a scratch file import Scratch_1.API.instance object API{ // in the old java code there is a private static `INSTANCE` and a static `instance()` // in kotlin we'd like to use an object @Deprecated("kotlin allows for easy singletons", ReplaceWith("this")) fun instance() = this fun test() = "hi" } class Test { fun hi() { // this works well API.instance().test() // transformed into API.test() // this doesn't work. The `this` argument doesn't seem to be // properly recognised and left in the stub instance().test() // transforms into this.test() } }