@@ -143,6 +143,8 @@ bool TypeChecker::diagnoseInlinableDeclRefAccess(SourceLoc loc,
143
143
TreatUsableFromInlineAsPublic).isPublic ())
144
144
return false ;
145
145
146
+ auto &Context = DC->getASTContext ();
147
+
146
148
// Dynamic declarations were mistakenly not checked in Swift 4.2.
147
149
// Do enforce the restriction even in pre-Swift-5 modes if the module we're
148
150
// building is resilient, though.
@@ -194,18 +196,19 @@ bool TypeChecker::diagnoseInlinableDeclRefAccess(SourceLoc loc,
194
196
if (downgradeToWarning == DowngradeToWarning::Yes)
195
197
diagID = diag::resilience_decl_unavailable_warn;
196
198
197
- diagnose (loc, diagID,
199
+ Context.Diags .diagnose (
200
+ loc, diagID,
198
201
D->getDescriptiveKind (), diagName,
199
202
D->getFormalAccessScope ().accessLevelForDiagnostics (),
200
203
static_cast <unsigned >(Kind),
201
204
isAccessor);
202
205
203
206
if (TreatUsableFromInlineAsPublic) {
204
- diagnose (D, diag::resilience_decl_declared_here,
205
- D->getDescriptiveKind (), diagName, isAccessor);
207
+ Context. Diags . diagnose (D, diag::resilience_decl_declared_here,
208
+ D->getDescriptiveKind (), diagName, isAccessor);
206
209
} else {
207
- diagnose (D, diag::resilience_decl_declared_here_public,
208
- D->getDescriptiveKind (), diagName, isAccessor);
210
+ Context. Diags . diagnose (D, diag::resilience_decl_declared_here_public,
211
+ D->getDescriptiveKind (), diagName, isAccessor);
209
212
}
210
213
211
214
return (downgradeToWarning == DowngradeToWarning::No);
0 commit comments