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