None of these examples compile.
var multiplyClosure = { (a, b) in
a * b
}
and
var multiplyClosure = {
$0 * $1
}
Ambiguous use of operator ‘*’ - is the error
None of these examples compile.
var multiplyClosure = { (a, b) in
a * b
}
and
var multiplyClosure = {
$0 * $1
}
Ambiguous use of operator ‘*’ - is the error
You must define the types in order for this to work.
It’s possible that when the book was written, the Swift compiler allowed this to work, but definitely not in newer versions of it. Could you direct me to the edition and page where you see this?