SE-0380 restricts if and switch expressions to assignments and returns. I'd like them wherever an ordinary expression is accepted, especially argument values and parenthesized postfix receivers:
animate(
orientation: switch alignment {
case .none: entityOrientation
case .target: targetOrientation
}
)
(switch alignment {
case .none: entityOrientation
case .target: targetOrientation
}).mirrorRotation(of: targetOrientation)
The latter is unambiguous because the parentheses delimit the switch. Today both require otherwise unnecessary intermediate values.
Parenthesized arbitrary expression positions were suggested during the original pitch. Would a focused follow-up allowing parenthesized if/switch expressions as primary expressions be welcome?