File tree 2 files changed +9
-2
lines changed
2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -370,7 +370,7 @@ extension VariableDeclSyntax {
370
370
var type : ( text: String , isWrapper: Bool ) ? {
371
371
guard
372
372
let binding = bindings. first,
373
- let typeAnnotation = binding. typeAnnotation? . as ( TypeAnnotationSyntax . self ) ,
373
+ let typeAnnotation = binding. typeAnnotation,
374
374
let type = typeAnnotation. type. as ( IdentifierTypeSyntax . self)
375
375
else {
376
376
return nil
@@ -393,7 +393,7 @@ extension IdentifierTypeSyntax {
393
393
var text = name. text
394
394
if let genericArgumentClause {
395
395
let generics = genericArgumentClause. arguments
396
- . compactMap { $0. as ( GenericArgumentSyntax . self ) ? . argument }
396
+ . compactMap { $0. argument }
397
397
. compactMap { $0. as ( IdentifierTypeSyntax . self) }
398
398
. map { $0. text }
399
399
text += " < \( generics. joined ( separator: " , " ) ) > "
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ final class MyMacroTests: XCTestCase {
17
17
var label: Label
18
18
var content: Content
19
19
var identifier: String
20
+ var traits: Array<Int>
20
21
@Binding var isEnabled: Bool
21
22
22
23
var body: some View {
@@ -33,6 +34,7 @@ final class MyMacroTests: XCTestCase {
33
34
var label: Label
34
35
var content: Content
35
36
var identifier: String
37
+ var traits: Array<Int>
36
38
@Binding var isEnabled: Bool
37
39
38
40
var body: some View {
@@ -47,6 +49,7 @@ final class MyMacroTests: XCTestCase {
47
49
LabelViewBody(
48
50
configuration: LabelViewConfiguration(
49
51
identifier: identifier,
52
+ traits: traits,
50
53
isEnabled: $isEnabled
51
54
)
52
55
)
@@ -62,11 +65,13 @@ final class MyMacroTests: XCTestCase {
62
65
@ViewBuilder label: () -> Label,
63
66
@ViewBuilder content: () -> Content,
64
67
identifier: String,
68
+ traits: Array<Int>,
65
69
isEnabled: Binding<Bool>
66
70
) {
67
71
self.label = label()
68
72
self.content = content()
69
73
self.identifier = identifier
74
+ self.traits = traits
70
75
self._isEnabled = isEnabled
71
76
}
72
77
@@ -76,6 +81,7 @@ final class MyMacroTests: XCTestCase {
76
81
self.label = configuration.label
77
82
self.content = configuration.content
78
83
self.identifier = configuration.identifier
84
+ self.traits = configuration.traits
79
85
self._isEnabled = configuration.isEnabled
80
86
}
81
87
}
@@ -92,6 +98,7 @@ final class MyMacroTests: XCTestCase {
92
98
.init()
93
99
}
94
100
var identifier: String
101
+ var traits: Array<Int>
95
102
var isEnabled: Binding<Bool>
96
103
}
97
104
You can’t perform that action at this time.
0 commit comments