Skip to content

Commit 45f2cfa

Browse files
committed
Implement SE-0099, but where the migration diagnostics are left as warnings
for now. I'll upgrade them to errors in a week or two to give downstream projects a chance to update.
1 parent 10d76c4 commit 45f2cfa

File tree

19 files changed

+280
-370
lines changed

19 files changed

+280
-370
lines changed

include/swift/AST/DiagnosticsParse.def

Lines changed: 11 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -797,29 +797,27 @@ ERROR(expected_lbrace_after_defer,PointsToFirstBadToken,
797797
"expected '{' after 'defer'", ())
798798

799799
// If/While/Guard Conditions
800-
ERROR(expected_expr_conditional_letbinding,none,
801-
"expected 'let' or 'var' in conditional", ())
802-
ERROR(expected_expr_conditional_letbinding_bool_conditions,none,
803-
"expected 'let' or 'var' in conditional; "
804-
"use '&&' to join boolean conditions", ())
805800
ERROR(expected_comma_stmtcondition,none,
806801
"expected ',' joining parts of a multi-clause condition", ())
807802

803+
ERROR(expected_expr_conditional,PointsToFirstBadToken,
804+
"expected expression in conditional", ())
805+
806+
// FIXME: Upgrade these two diagnostics to errors in Swift 3.
807+
WARNING(expected_binding_keyword,none,
808+
"expected '%0' in conditional", (StringRef))
809+
// FIXME: just replace with expected_comma_stmtcondition
810+
WARNING(expected_comma_stmtcondition_w,none,
811+
"expected ',' joining parts of a multi-clause condition", ())
812+
813+
808814
ERROR(expected_expr_conditional_var,PointsToFirstBadToken,
809815
"expected expression after '=' in conditional binding", ())
810-
ERROR(expected_expr_conditional_where,PointsToFirstBadToken,
811-
"expected expression in conditional binding 'where' clause", ())
812816
ERROR(conditional_var_initializer_required,none,
813817
"variable binding in a condition requires an initializer", ())
814818
ERROR(wrong_condition_case_location,none,
815819
"pattern matching binding is spelled with 'case %0', not '%0 case'",
816820
(StringRef))
817-
ERROR(where_end_of_binding_use_letvar,none,
818-
"binding ended by previous 'where' clause; "
819-
"use '%0' to introduce a new one", (StringRef))
820-
ERROR(comma_should_be_where,none,
821-
"boolean condition requires 'where' to separate it from variable binding",
822-
())
823821

824822
// If Statement
825823
ERROR(expected_condition_if,PointsToFirstBadToken,

0 commit comments

Comments
 (0)