learn-swift
learn-swift copied to clipboard
Tuples type inferrence
Hi, In tuples example there is this example:
// We can also specify the type in order to avoid inferrence
let someOtherTuple = (Double(100), Bool(false))
I think comment for example is not true because type of someOtherTuple
is still inferred from content. Right example for this comment would be:
let someOtherTuple: (Double, Bool) = (100, false)
In this way we are avoiding inferrence and we will get error if we specify content with wrong type.