@@ -621,82 +621,83 @@ final class RecoveryTests: XCTestCase {
621621 func testRecovery46( ) {
622622 AssertParse (
623623 """
624- switch {
625- }1️⃣
624+ switch 1️⃣ {
625+ }
626626 """ ,
627627 diagnostics: [
628- // TODO: Old parser expected error on line 1: expected expression in 'switch' statement
628+ DiagnosticSpec ( message : " expected expression in 'switch' statement " )
629629 // TODO: Old parser expected error on line 1: 'switch' statement body must have at least one 'case' or 'default' block
630- DiagnosticSpec ( message: " expected '{}' in 'switch' statement " )
631630 ]
632631 )
633632 }
634633
635634 func testRecovery47( ) {
636635 AssertParse (
637636 """
638- switch
637+ switch 1️⃣
639638 {
640- }1️⃣
639+ }
641640 """ ,
642641 diagnostics: [
643- // TODO: Old parser expected error on line 1: expected expression in 'switch' statement
642+ DiagnosticSpec ( message : " expected expression in 'switch' statement " )
644643 // TODO: Old parser expected error on line 1: 'switch' statement body must have at least one 'case' or 'default' block
645- DiagnosticSpec ( message: " expected '{}' in 'switch' statement " )
646644 ]
647645 )
648646 }
649647
650648 func testRecovery48( ) {
651649 AssertParse (
652650 """
653- switch {
654- 1️⃣case _: return
655- }2️⃣
651+ switch 1️⃣ {
652+ 2️⃣case _: return
653+ }
656654 """ ,
657655 diagnostics: [
658- // TODO: Old parser expected error on line 1: expected expression in 'switch' statement
659- DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " 'case' can only appear inside a 'switch' statement or 'enum' declaration " ) ,
660- DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " expected '{}' in 'switch' statement " ) ,
656+ DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected expression in 'switch' statement " )
661657 ]
662658 )
663659 }
664660
665661 func testRecovery49( ) {
666662 AssertParse (
667663 """
668- switch {
669- 1️⃣case Int: return
670- 2️⃣case _: return
671- }3️⃣
664+ switch 1️⃣ {
665+ case Int: return
666+ case _: return
667+ }
672668 """ ,
673669 diagnostics: [
674- // TODO: Old parser expected error on line 1: expected expression in 'switch' statement
670+ DiagnosticSpec ( locationMarker : " 1️⃣ " , message : " expected expression in 'switch' statement " ) ,
675671 // TODO: Old parser expected error on line 2: 'is' keyword required to pattern match against type name, Fix-It replacements: 10 - 10 = 'is '
676- DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " 'case' can only appear inside a 'switch' statement or 'enum' declaration " ) ,
677672 DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " 'case' can only appear inside a 'switch' statement or 'enum' declaration " ) ,
678- DiagnosticSpec ( locationMarker: " 3️⃣ " , message: " expected '{}' in 'switch' statement" ) ,
673+ DiagnosticSpec ( locationMarker: " 3️⃣ " , message: " 'case' can only appear inside a 'switch' statement or 'enum' declaration " ) ,
679674 ]
680675 )
681676 }
682677
683678 func testRecovery50( ) {
684679 AssertParse (
685680 """
686- switch { 42 } {
681+ switch 1️⃣ { 42 } {
687682 case _: return
688683 }
689- """
684+ """ ,
685+ diagnostics: [
686+ DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected expression in 'switch' statement " )
687+ ]
690688 )
691689 }
692690
693691 func testRecovery51( ) {
694692 AssertParse (
695693 """
696- switch { 42 }() {
694+ switch 1️⃣ { 42 }() {
697695 case _: return
698696 }
699- """
697+ """ ,
698+ diagnostics: [
699+ DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected expression in 'switch' statement " )
700+ ]
700701 )
701702 }
702703
0 commit comments