Define attributes inside object bodies
Instead of defining attributes inside the "init" method of an object, they now have to be defined in the object's body. This means that instead of this:
object Person {
def init(name: String) {
let @name = name
}
}
You now write the following:
object Person {
@name: String
def init(name: String) {
@name = name
}
}
This makes it easier for both developer and compiler to determine which attributes an object has. This in turn can allow the compiler to (in the future) require that all defined attributes are initialised in the "init" method.