File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -1034,7 +1034,7 @@ extension Parser {
1034
1034
@_spi ( RawSyntax)
1035
1035
public mutating func parseDeinitializerDeclaration( _ attrs: DeclAttributes ) -> RawDeinitializerDeclSyntax {
1036
1036
let deinitKeyword = self . eat ( . deinitKeyword)
1037
- let items = self . parseCodeBlock ( )
1037
+ let items = self . parseOptionalCodeBlock ( )
1038
1038
return RawDeinitializerDeclSyntax (
1039
1039
attributes: attrs. attributes, modifiers: attrs. modifiers,
1040
1040
deinitKeyword: deinitKeyword, body: items,
Original file line number Diff line number Diff line change @@ -708,6 +708,11 @@ final class DeclarationTests: XCTestCase {
708
708
]
709
709
)
710
710
}
711
+
712
+ func testDeinitializers( ) {
713
+ AssertParse ( " deinit {} " , { $0. parseDeinitializerDeclaration ( . empty) } )
714
+ AssertParse ( " deinit " , { $0. parseDeinitializerDeclaration ( . empty) } )
715
+ }
711
716
}
712
717
713
718
extension Parser . DeclAttributes {
You can’t perform that action at this time.
0 commit comments