We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
if
guard
1 parent a113ef9 commit a4ae2efCopy full SHA for a4ae2ef
Sources/SwiftParser/Lookahead.swift
@@ -266,7 +266,7 @@ extension Parser.Lookahead {
266
}
267
268
// If we don't have attributes, then it cannot be an accessor block.
269
- if nextToken.rawTokenKind != .atSign {
+ guard self.peek(isAt: .atSign) else {
270
return false
271
272
Tests/SwiftParserTest/DeclarationTests.swift
@@ -3768,4 +3768,16 @@ final class UsingDeclarationTests: ParserTestCase {
3768
"""
3769
)
3770
3771
+
3772
+ func testAccessorBlockAfterPatternBindingDeclWithAttribute() {
3773
+ assertParse(
3774
+ """
3775
+ var x: Int = 2
3776
+ {
3777
+ @something
3778
+ didSet {}
3779
+ }
3780
3781
+ )
3782
3783
0 commit comments