This is fine: ``` class Foo { var a: Int ...
# announcements
g
This is fine:
Copy code
class Foo {
    var a: Int

    init {
        a = 1
    }
}
This doesn't compile (Error: property must be initialized)
Copy code
class Foo {
    var a: Int
        set(value) {
            a = value
        }
    
    init {
        a = 1
    }
}
But this compiles fine
Copy code
class Foo {
    var a: Int
        set(value) {
            a = value
        }
    
    constructor()
    
    init {
        a = 1
    }
}