I have a question regarding this sample. <http://...
# announcements
s
I have a question regarding this sample. http://try.kotlinlang.org/#/UserProjects/4sse74g8ulo4tipe1plevdvgde/o3renfke4rh9dr692dk427o1al
Copy code
typealias Args = MutableMap<String, Any>

fun argsOf(block: Args.() -> Unit) = mutableMapOf<String, Any>().apply(block)

inline var Args.resourceId
    get() = this["RESOURCE_ID"] as Long
    set(value) {
        this["RESOURCE_ID"] = value
    }

class Test(val resourceId: Long) {
    fun args() = argsOf {
        this.resourceId = resourceId //Expect to refer to Test.resourceId here 
    }
}

fun main(vararg args:String) {
    Test(1).args()
}
I'm getting NPE here I'm not sure if it's a bug or expected behaviour