https://kotlinlang.org logo
#announcements
Title
# announcements
r

ribesg

02/28/2017, 9:24 AM
This works for me
Copy code
fun testKek() {
    class A {
        val x = HashMap<String, Int>()
        operator fun get(s: String) = x[s]!!

        init {
            x["topkek"] = 42
        }
    }

    println("${A()["topkek"]}")
}