let add = (a: Int8, b: Int8): Int {
return a + b
}
// `add` has type `((Int8, Int8): Int)`
// Invalid: not possible to infer type based on array literal's elements.
//
let array = []
// Instead, specify the array type and the concrete element type, e.g. `Int`.
//
let array: [Int] = []
// Invalid: not possible to infer type based on dictionary literal's keys and values.
//
let dictionary = {}
// Instead, specify the dictionary type and the concrete key
// and value types, e.g. `String` and `Int`.
//
let dictionary: {String: Int} = {}
// Invalid: not possible to infer type based on nil literal.
//
let maybeSomething = nil
// Instead, specify the optional type and the concrete element type, e.g. `Int`.
//
let maybeSomething: Int? = nil