Kotlin Riddler: Legit Syntax?

will the following compile?

class Qaz {  
    var bar = "hey"
}
class Foo(private var qaz: Qaz?) {  
    fun assignBarMkayyy() {
        if (qaz != null) {
            qaz.bar = "hey!"
        }
    }
}