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 @@ -2259,6 +2259,17 @@ final class DeclarationTests: ParserTestCase {
22592259 )
22602260 }
22612261
2262+ func testVariableGetSetNextLine( ) {
2263+ assertParse (
2264+ """
2265+ struct X {
2266+ var x: Int
2267+ { 17 }
2268+ }
2269+ """
2270+ )
2271+ }
2272+
22622273 func testVariableFollowedByReferenceToSet( ) {
22632274 assertParse (
22642275 """
You can’t perform that action at this time.
0 commit comments