I’ll mention this here since it’s related to tuples and optionals. Starting
with this setup:

var x, y: Int?
func f() -> (Int, Int) { return (0, 1) }

This fails to compile:

(x, y) = f()  // Error: Cannot express tuple conversion '(Int, Int)' to
'(Int?, Int?)'

But this works fine:

func g() -> Int { return 2 }
(x, y) = (g(), g())

What is going on, why does the first one fail, and is this a bug or does it
need a proposal to fix?

Nevin
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution

Reply via email to