You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[Parse] Ignore '(' on newline after attribute names
Also '#error', '#warning', and '#sourceLocation'.
Other call-like syntax (call expression, macro expansion, and custom
attribtues) requires '(' on the same line as the callee. For consistency,
built-in attributes and built-in directives should also ignore '(' on
next line.
Copy file name to clipboardExpand all lines: test/Parse/attribute_spacing.swift
+11Lines changed: 11 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -18,6 +18,10 @@ struct MyPropertyWrapper {
18
18
structPropertyWrapperTest{
19
19
@MyPropertyWrapper(param:2) // expected-warning {{extraneous whitespace between attribute name and '('; this is an error in the Swift 6 language mode}}
20
20
varx:Int
21
+
22
+
@MyPropertyWrapper
23
+
(param:2) // expected-error {{expected 'var' keyword in property declaration}} expected-error {{property declaration does not bind any variables}} expected-error {{expected pattern}}
24
+
vary:Int
21
25
}
22
26
23
27
letclosure1={@MainActor(a, b)in // expected-warning {{extraneous whitespace between attribute name and '('; this is an error in the Swift 6 language mode}}
@@ -31,3 +35,10 @@ let closure2 = { @MainActor
31
35
@
32
36
MainActor
33
37
func mainActorFunc(){}
38
+
39
+
40
+
@inline // expected-error {{expected '(' in 'inline' attribute}}
0 commit comments