File tree Expand file tree Collapse file tree 1 file changed +13
-7
lines changed
Expand file tree Collapse file tree 1 file changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -203,21 +203,27 @@ class TypeRefinementContextBuilder : private ASTWalker {
203203
204204 return NewTRC;
205205 }
206-
206+
207207 // / Returns true if the declaration should introduce a new refinement context.
208208 bool declarationIntroducesNewContext (Decl *D) {
209209 if (!isa<ValueDecl>(D) && !isa<ExtensionDecl>(D)) {
210210 return false ;
211211 }
212-
212+
213+ // Explicit inlinability may to the decl being used on an earlier OS
214+ // version when inlined on the client side. This check assumes that
215+ // implicit decls are handled elsewhere.
216+ bool isExplicitlyInlinable = !D->isImplicit () &&
217+ (D->getAttrs ().hasAttribute <InlinableAttr>() ||
218+ D->getAttrs ().hasAttribute <AlwaysEmitIntoClientAttr>());
219+
213220 // No need to introduce a context if the declaration does not have an
214- // availability or inlinable attribute.
221+ // availability or non-implicit inlinable attribute.
215222 if (!hasActiveAvailableAttribute (D, Context) &&
216- !D->getAttrs ().hasAttribute <InlinableAttr>() &&
217- !D->getAttrs ().hasAttribute <AlwaysEmitIntoClientAttr>()) {
223+ !isExplicitlyInlinable) {
218224 return false ;
219225 }
220-
226+
221227 // Only introduce for an AbstractStorageDecl if it is not local.
222228 // We introduce for the non-local case because these may
223229 // have getters and setters (and these may be synthesized, so they might
@@ -228,7 +234,7 @@ class TypeRefinementContextBuilder : private ASTWalker {
228234 return false ;
229235 }
230236 }
231-
237+
232238 return true ;
233239 }
234240
You can’t perform that action at this time.
0 commit comments