Is there a workaround for this? ``` class Test { ...
# getting-started
c
Is there a workaround for this?
Copy code
class Test {
    val test: String
    
    init {
        build {
        	test = "This does not compile."
        }
        // test = "This would compile."
    }
}

inline fun build(action: () -> Unit) {
    action()
}
I don't want to use
lateinit var
, if possible. I've encountered this problem when using type-safe building API that requires a lot of nesting. Imagine building a GUI and needing a reference to a single widget nested inside a few blocks.