Q:

Role of Swift 3 lazy var with no getter

I am wondering the meaning of lazy keyword when I am not working with a getter or setter. Look at this code:
class ViewController: UIViewController
{
    lazy var toto = 5
}

The compiler accepts the lazy keyword but I do not know why. Lazy means the value will me calculated only when reading. But there is no need to compute anything for an integer value.

A:

lazy means that the initial value of stored property is evaluated and assigned on the first access (so this is actually unrelated to getters
or setters which are used with computed properties).
lazy var toto = ... some expression evaluating to an `Int` ...

defines a lazy Int property.
lazy can be used to delay the evaluation of the initial value
until the property is needed, e.g. if that evaluation is
"expensive" or has side effects.
But from the language/compiler point of view, the initial value on the right-hand side
 can be an arbitrary expression.
 It does not matter if  it is a constant or a "complicated" expression involving function calls.
lazy var a = 5 // A constant
lazy var b = someFunctionReturningAnInt() // Function call
lazy var c = { _ -> Int in
               return 42
             }()               // Immediately evaluated closure

are all valid definitions. There is no advantage of using lazy with a constant initial value, but it is valid Swift.

