Swift ternary operator compilation error

前端 未结 2 1419
鱼传尺愫
鱼传尺愫 2020-12-11 06:34

Why does this generate an error and how should it be written?

    let x = 5
    let y = 4
    var z:Int
    x < 4 ? z = 6 : z = 8

The er

2条回答
提交回复
热议问题