File tree Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Expand file tree Collapse file tree 2 files changed +16
-1
lines changed Original file line number Diff line number Diff line change @@ -302,7 +302,7 @@ extension Parser {
302
302
let attributes = self . parseAttributeList ( )
303
303
304
304
let ( unexpectedBeforeName, name) = self . expectIdentifier ( )
305
- if unexpectedBeforeName == nil && name. isMissing && elements. isEmpty {
305
+ if attributes == nil && unexpectedBeforeName == nil && name. isMissing && elements. isEmpty {
306
306
break
307
307
}
308
308
Original file line number Diff line number Diff line change @@ -1059,6 +1059,21 @@ final class DeclarationTests: XCTestCase {
1059
1059
}
1060
1060
""" )
1061
1061
}
1062
+
1063
+ func testStandaloneAtSignInGenericParameter( ) {
1064
+ AssertParse (
1065
+ """
1066
+ struct U<@#^DIAG^#
1067
+ """ ,
1068
+ diagnostics: [
1069
+ DiagnosticSpec ( message: " Expected name of attribute " ) ,
1070
+ DiagnosticSpec ( message: " Expected identifier in generic parameter " ) ,
1071
+ DiagnosticSpec ( message: " Expected '>' to end generic parameter clause " ) ,
1072
+ DiagnosticSpec ( message: " Expected '{' to start struct " ) ,
1073
+ DiagnosticSpec ( message: " Expected '}' to end struct " ) ,
1074
+ ]
1075
+ )
1076
+ }
1062
1077
}
1063
1078
1064
1079
extension Parser . DeclAttributes {
You can’t perform that action at this time.
0 commit comments