How to call outer class' super method from inner class in Kotlin? -


what kotlin equivalent of java's outerclass.super.method()?

example (in java):

class outer {     class inner {         void somemethod() {             outer.super.someothermethod();         }     }      @override     public string someothermethod() {         // not called...     } } 

use super@outerclass.method() syntax:

open class c {     open fun f() { println("c.f()") } }  class d : c() {     override fun f() { println("d.f()") }      inner class x {         fun g() {             super@d.f() // <- here         }     } } 

this similar how java outerclass.this expressed in kotlin this@outerclass.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -