Д
Size: a a a
Д
Kd
КР
ML
КР
Kd
Kd
КР
КР
Kd
Д
Д
AM
enum Mode { case a, b, c(value: Int?) }
let mode: Mode = ...
switch mode { // no errors
case .a:
print("hello a")
case .b:
print("hello b")
case .c:
print("hello c")
}
switch mode { // Error: Switch must be exhaustive
case .a:
print("hello a")
case .b:
print("hello b")
case .c(let v) where v == nil:
print("hello c(nil)")
case .c(let v) where v != nil:
print("hello c(non-nil)")
}
AM
AN
(
val r = when {
a -> "sss"
!a -> "fff"
}
AM
val r = when {
a -> "sss"
!a -> "fff"
}
(
AM