Introduce then statements

These allow multi-statement `if`/`switch` expression
branches that can produce a value at the end by
saying `then <expr>`. This is gated behind
`-enable-experimental-feature ThenStatements`
pending evolution discussion.
This commit is contained in:
Hamish Knight
2023-09-01 14:32:14 +01:00
parent 99a36b3f00
commit 6ee44f09b4
47 changed files with 1063 additions and 196 deletions

View File

@@ -246,6 +246,7 @@ void DiagnosticEmitter::emitMissingConsumeInDiscardingContext(
case StmtKind::Return:
case StmtKind::Yield:
case StmtKind::Break:
case StmtKind::Then:
case StmtKind::Fail:
case StmtKind::PoundAssert:
return true;