@@ -86,14 +86,15 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,
86
86
// Selector for the partial_application_of_function_invalid diagnostic
87
87
// message.
88
88
struct PartialApplication {
89
- unsigned level : 29 ;
90
89
enum : unsigned {
91
90
Function,
92
91
MutatingMethod,
93
92
SuperInit,
94
93
SelfInit,
95
94
};
95
+ // 'kind' before 'level' is better for code gen.
96
96
unsigned kind : 3 ;
97
+ unsigned level : 29 ;
97
98
};
98
99
99
100
// Partial applications of functions that are not permitted. This is
@@ -121,7 +122,7 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,
121
122
122
123
// Partial applications of delegated initializers aren't allowed, and
123
124
// don't really make sense to begin with.
124
- InvalidPartialApplications.insert ({ expr, {1 , kind } });
125
+ InvalidPartialApplications.insert ({ expr, {kind, 1 } });
125
126
return ;
126
127
}
127
128
@@ -141,7 +142,7 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,
141
142
if (!expr->getArg ()->getType ()->isMaterializable ()) {
142
143
// We need to apply all argument clauses.
143
144
InvalidPartialApplications.insert ({
144
- fnExpr, {fn->getNumParameterLists (), kind }
145
+ fnExpr, {kind, fn->getNumParameterLists ()}
145
146
});
146
147
}
147
148
}
@@ -172,7 +173,7 @@ static void diagSyntacticUseRestrictions(TypeChecker &TC, const Expr *E,
172
173
InvalidPartialApplications.erase (foundApplication);
173
174
if (level > 1 ) {
174
175
// We have remaining argument clauses.
175
- InvalidPartialApplications.insert ({ AE, {level - 1 , kind } });
176
+ InvalidPartialApplications.insert ({ AE, {kind, level - 1 } });
176
177
}
177
178
return ;
178
179
}
0 commit comments