[swift-evolution] Proposal: Initialization should not be required in precondition(false) case.

Amir Michail a.michail at me.com
Fri Feb 12 09:59:18 CST 2016


For example:

let x:Int
if … { x = 1 }
else if … { x = 2 }
else { precondition(false) } // no initialization needed

Similarly,

let x:Int
switch ... {
case …: x = 1
case …: x = 2
default: precondition(false) // no initialization needed
}


More information about the swift-evolution mailing list