Implicit Optionals are not implicit on a tuple assignment.

Originator:Nikita.Leonov
Number:rdar://23632146 Date Originated:November, 20 2015
Status:Open Resolved:
Product:Developer Tools Product Version:Xcode 7.1 (7B91b)
Classification:Other Bug Reproducible:Always
 
Summary:
It is impossible to unwrap non-optional tuple into a tuple of two implicitly optional variables of the same type. For example, following code will not work:

var first: Int!
var second: Int!

func tuple() -> (Int, Int) {
    return (0,0)
}

(first, second) = tuple()

Steps to Reproduce:
Assign tuple of non-optional types to a tuple of variables with an implicitly optional types.

Expected Results:
Variables will be assigned.

Actual Results:
Compiler will provide a error "Cannot express tuple conversion"

Version:
Xcode 7.1

Notes:


Configuration:


Attachments:
'ImplicitOptionalsNotImplicitForTuples.playground.zip' was successfully uploaded.

Comments


Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!