@@ -69,22 +69,22 @@ public final class UseEnumForNamespacing: SyntaxFormatRule {
69
69
/// Determines if the set of declarations is consistent with a class or struct being used
70
70
/// solely as a namespace for static functions. If there is a non-static private initializer
71
71
/// with no arguments, that does not count against possibly being a namespace.
72
- func declsIfUsedAsNamespace( _ decls : DeclListSyntax ) -> DeclListSyntax ? {
73
- var declList = [ DeclSyntax ] ( )
74
- for decl in decls {
75
- switch decl {
72
+ func declsIfUsedAsNamespace( _ members : MemberDeclListSyntax ) -> MemberDeclListSyntax ? {
73
+ var declList = [ MemberDeclListItemSyntax ] ( )
74
+ for member in members {
75
+ switch member . decl {
76
76
case let decl as FunctionDeclSyntax :
77
77
guard let modifiers = decl. modifiers,
78
78
modifiers. has ( modifier: " static " ) else {
79
79
return nil
80
80
}
81
- declList. append ( decl )
81
+ declList. append ( member )
82
82
case let decl as VariableDeclSyntax :
83
83
guard let modifiers = decl. modifiers,
84
84
modifiers. has ( modifier: " static " ) else {
85
85
return nil
86
86
}
87
- declList. append ( decl )
87
+ declList. append ( member )
88
88
case let decl as InitializerDeclSyntax :
89
89
guard let modifiers = decl. modifiers,
90
90
modifiers. has ( modifier: " private " ) ,
@@ -93,10 +93,10 @@ public final class UseEnumForNamespacing: SyntaxFormatRule {
93
93
}
94
94
// Do not append private initializer
95
95
default :
96
- declList. append ( decl )
96
+ declList. append ( member )
97
97
}
98
98
}
99
- return SyntaxFactory . makeDeclList ( declList)
99
+ return SyntaxFactory . makeMemberDeclList ( declList)
100
100
}
101
101
}
102
102
0 commit comments