@@ -1551,9 +1551,11 @@ final class RecoveryTests: XCTestCase {
15511551 class WrongInheritanceClause11️⃣(Int) {}
15521552 """ ,
15531553 diagnostics: [
1554- // TODO: Old parser expected error on line 1: expected ':' to begin inheritance clause, Fix-It replacements: 30 - 31 = ': ', 34 - 35 = ''
1555- DiagnosticSpec ( message: " unexpected code '(Int)' in class " )
1556- ]
1554+ DiagnosticSpec ( message: " expected ':' to begin inheritance clause " )
1555+ ] ,
1556+ fixedSource: """
1557+ class WrongInheritanceClause1: Int {}
1558+ """
15571559 )
15581560 }
15591561
@@ -1563,9 +1565,11 @@ final class RecoveryTests: XCTestCase {
15631565 class WrongInheritanceClause21️⃣(Base2<Int>) {}
15641566 """ ,
15651567 diagnostics: [
1566- // TODO: Old parser expected error on line 1: expected ':' to begin inheritance clause, Fix-It replacements: 30 - 31 = ': ', 41 - 42 = ''
1567- DiagnosticSpec ( message: " unexpected code '(Base2<Int>)' in class " )
1568- ]
1568+ DiagnosticSpec ( message: " expected ':' to begin inheritance clause " )
1569+ ] ,
1570+ fixedSource: """
1571+ class WrongInheritanceClause2: Base2<Int> {}
1572+ """
15691573 )
15701574 }
15711575
@@ -1575,9 +1579,11 @@ final class RecoveryTests: XCTestCase {
15751579 class WrongInheritanceClause3<T>1️⃣(SubModule.Base1) where T:AnyObject {}
15761580 """ ,
15771581 diagnostics: [
1578- // TODO: Old parser expected error on line 1: expected ':' to begin inheritance clause, Fix-It replacements: 33 - 34 = ': ', 49 - 50 = ''
1579- DiagnosticSpec ( message: " unexpected code '(SubModule.Base1) where T:AnyObject' in class " )
1580- ]
1582+ DiagnosticSpec ( message: " expected ':' to begin inheritance clause " )
1583+ ] ,
1584+ fixedSource: """
1585+ class WrongInheritanceClause3<T>: SubModule.Base1 where T:AnyObject {}
1586+ """
15811587 )
15821588 }
15831589
@@ -1587,9 +1593,11 @@ final class RecoveryTests: XCTestCase {
15871593 class WrongInheritanceClause41️⃣(SubModule.Base2<Int>) {}
15881594 """ ,
15891595 diagnostics: [
1590- // TODO: Old parser expected error on line 1: expected ':' to begin inheritance clause, Fix-It replacements: 30 - 31 = ': ', 51 - 52 = ''
1591- DiagnosticSpec ( message: " unexpected code '(SubModule.Base2<Int>)' in class " )
1592- ]
1596+ DiagnosticSpec ( message: " expected ':' to begin inheritance clause " )
1597+ ] ,
1598+ fixedSource: """
1599+ class WrongInheritanceClause4: SubModule.Base2<Int> {}
1600+ """
15931601 )
15941602 }
15951603
@@ -1599,47 +1607,46 @@ final class RecoveryTests: XCTestCase {
15991607 class WrongInheritanceClause5<T>1️⃣(SubModule.Base2<Int>) where T:AnyObject {}
16001608 """ ,
16011609 diagnostics: [
1602- // TODO: Old parser expected error on line 1: expected ':' to begin inheritance clause, Fix-It replacements: 33 - 34 = ': ', 54 - 55 = ''
1603- DiagnosticSpec ( message: " unexpected code '(SubModule.Base2<Int>) where T:AnyObject' in class " )
1604- ]
1610+ DiagnosticSpec ( message: " expected ':' to begin inheritance clause " )
1611+ ] ,
1612+ fixedSource: """
1613+ class WrongInheritanceClause5<T>: SubModule.Base2<Int> where T:AnyObject {}
1614+ """
16051615 )
16061616 }
16071617
16081618 func testRecovery130( ) {
16091619 assertParse (
16101620 """
1611- class WrongInheritanceClause61️⃣(Int 2️⃣{}3️⃣
1621+ class WrongInheritanceClause61️⃣(Int {}
16121622 """ ,
16131623 diagnostics: [
1614- // TODO: Old parser expected error on line 1: expected ':' to begin inheritance clause, Fix-It replacements: 30 - 31 = ': '
1615- DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected '{' in class " ) ,
1616- DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected 'var' in variable " ) ,
1617- DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " expected ')' to end tuple pattern " ) ,
1618- DiagnosticSpec ( locationMarker: " 3️⃣ " , message: " expected '}' to end class " ) ,
1619- ]
1624+ DiagnosticSpec ( message: " expected ':' to begin inheritance clause " )
1625+ ] ,
1626+ fixedSource: """
1627+ class WrongInheritanceClause6: Int {}
1628+ """
16201629 )
16211630 }
16221631
16231632 func testRecovery131( ) {
16241633 assertParse (
16251634 """
1626- class WrongInheritanceClause7<T>1️⃣(Int 2️⃣where T:AnyObject {}
1635+ class WrongInheritanceClause7<T>1️⃣(Int where T:AnyObject {}
16271636 """ ,
16281637 diagnostics: [
1629- // TODO: Old parser expected error on line 1: expected ':' to begin inheritance clause, Fix-It replacements: 33 - 34 = ': '
1630- DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected '{' in class " ) ,
1631- DiagnosticSpec ( locationMarker: " 1️⃣ " , message: " expected 'var' in variable " ) ,
1632- DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " expected ')' to end tuple pattern " ) ,
1633- DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " expected '}' to end class " ) ,
1634- DiagnosticSpec ( locationMarker: " 2️⃣ " , message: " extraneous code 'where T:AnyObject {}' at top level " ) ,
1635- ]
1638+ DiagnosticSpec ( message: " expected ':' to begin inheritance clause " )
1639+ ] ,
1640+ fixedSource: """
1641+ class WrongInheritanceClause7<T>: Int where T:AnyObject {}
1642+ """
16361643 )
16371644 }
16381645
16391646 func testRecovery132( ) {
1647+ // <rdar://problem/18502220> [swift-crashes 078] parser crash on invalid cast in sequence expr
16401648 assertParse (
16411649 """
1642- // <rdar://problem/18502220> [swift-crashes 078] parser crash on invalid cast in sequence expr
16431650 Base=1 as Base=1
16441651 """
16451652 )
0 commit comments