@@ -37,6 +37,10 @@ struct AttributeNameSpacingRule: Rule {
37
37
(a: Int, b: Int) in
38
38
}
39
39
""" ) ,
40
+ Example ( """
41
+ let closure1 = { @MainActor (a, b) in
42
+ }
43
+ """ ) ,
40
44
] ,
41
45
triggeringExamples: [
42
46
Example ( " private ↓(set) var foo: Bool = false " ) ,
@@ -47,13 +51,9 @@ struct AttributeNameSpacingRule: Rule {
47
51
Example ( " func funcWithEscapingClosure(_ x: @ ↓escaping () -> Int) {} " ) ,
48
52
Example ( " func funcWithEscapingClosure(_ x: @escaping↓() -> Int) {} " ) ,
49
53
Example ( " @available ↓(*, deprecated) " ) ,
50
- Example ( " @MyPropertyWrapper ↓(param: 2) " ) ,
54
+ Example ( " @MyPropertyWrapper ↓(param: 2) let a = 1 " ) ,
51
55
Example ( " nonisolated ↓(unsafe) var _value: X? " ) ,
52
56
Example ( " @MyProperty ↓() class Foo {} " ) ,
53
- Example ( """
54
- let closure1 = { @MainActor ↓(a, b) in
55
- }
56
- """ ) ,
57
57
] ,
58
58
corrections: [
59
59
Example ( " private↓ (set) var foo: Bool = false " ) : Example ( " private(set) var foo: Bool = false " ) ,
@@ -65,16 +65,9 @@ struct AttributeNameSpacingRule: Rule {
65
65
Example ( " func test(_ x: @↓ escaping () -> Int) {} " ) : Example ( " func test(_ x: @escaping () -> Int) {} " ) ,
66
66
Example ( " func test(_ x: @escaping↓() -> Int) {} " ) : Example ( " func test(_ x: @escaping () -> Int) {} " ) ,
67
67
Example ( " @available↓ (*, deprecated) " ) : Example ( " @available(*, deprecated) " ) ,
68
- Example ( " @MyPropertyWrapper↓ (param: 2) " ) : Example ( " @MyPropertyWrapper(param: 2) " ) ,
68
+ Example ( " @MyPropertyWrapper↓ (param: 2) let a = 1 " ) : Example ( " @MyPropertyWrapper(param: 2) let a = 1 " ) ,
69
69
Example ( " nonisolated↓ (unsafe) var _value: X? " ) : Example ( " nonisolated(unsafe) var _value: X? " ) ,
70
- Example ( " @MyProperty↓ () " ) : Example ( " @MyProperty() " ) ,
71
- Example ( """
72
- let closure1 = { @MainActor↓ (a, b) in
73
- }
74
- """ ) : Example ( """
75
- let closure1 = { @MainActor(a, b) in
76
- }
77
- """ ) ,
70
+ Example ( " @MyProperty↓ () let a = 1 " ) : Example ( " @MyProperty() let a = 1 " ) ,
78
71
]
79
72
)
80
73
}
0 commit comments