Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions include/swift/AST/DiagnosticsSema.def
Original file line number Diff line number Diff line change
Expand Up @@ -1274,8 +1274,7 @@ ERROR(single_value_stmt_branch_empty,none,
"expected expression in branch of '%0' expression",
(StmtKind))
ERROR(single_value_stmt_branch_must_end_in_result,none,
"non-expression branch of '%0' expression may only end with a 'throw' "
"or 'then'",
"non-expression branch of '%0' expression may only end with a 'throw'",
(StmtKind))
ERROR(cannot_jump_in_single_value_stmt,none,
"cannot '%0' in '%1' when used as expression",
Expand Down
2 changes: 2 additions & 0 deletions lib/Sema/MiscDiagnostics.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3938,6 +3938,8 @@ class SingleValueStmtUsageChecker final : public ASTWalker {
continue;
}
}
// TODO: If 'then' statements are enabled by default, the wording of
// this diagnostic should be tweaked.
Diags.diagnose(branch->getEndLoc(),
diag::single_value_stmt_branch_must_end_in_result,
S->getKind());
Expand Down