File tree Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Expand file tree Collapse file tree 2 files changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -1355,7 +1355,8 @@ extension Parser {
13551355
13561356 let accessors : RawAccessorBlockSyntax ?
13571357 if ( self . at ( . leftBrace)
1358- && ( !self . currentToken. isAtStartOfLine || self . withLookahead ( { $0. atStartOfGetSetAccessor ( ) } ) ) )
1358+ && ( initializer == nil || !self . currentToken. isAtStartOfLine
1359+ || self . withLookahead ( { $0. atStartOfGetSetAccessor ( ) } ) ) )
13591360 || ( inMemberDeclList && self . at ( anyIn: AccessorDeclSyntax . AccessorSpecifierOptions. self) != nil
13601361 && !self . at ( . keyword( . `init`) ) )
13611362 {
Original file line number Diff line number Diff line change @@ -2293,6 +2293,17 @@ final class DeclarationTests: ParserTestCase {
22932293 )
22942294 }
22952295
2296+ func testVariableGetSetNextLine( ) {
2297+ assertParse (
2298+ """
2299+ struct X {
2300+ var x: Int
2301+ { 17 }
2302+ }
2303+ """
2304+ )
2305+ }
2306+
22962307 func testVariableFollowedByReferenceToSet( ) {
22972308 assertParse (
22982309 """
You can’t perform that action at this time.
0 commit comments