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