File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -2484,9 +2484,18 @@ bool ReplaceOpaqueTypesWithUnderlyingTypes::shouldPerformSubstitution(
2484
2484
2485
2485
// Allow replacement of opaque result types of inlineable function regardless
2486
2486
// of resilience and in which context.
2487
- if (namingDecl->getAttrs ().hasAttribute <InlinableAttr>()) {
2488
- return true ;
2487
+ if (auto *afd = dyn_cast<AbstractFunctionDecl>(namingDecl)) {
2488
+ if (afd->getResilienceExpansion () == ResilienceExpansion::Minimal) {
2489
+ return true ;
2490
+ }
2491
+ } else if (auto *asd = dyn_cast<AbstractStorageDecl>(namingDecl)) {
2492
+ auto *getter = asd->getGetter ();
2493
+ if (getter &&
2494
+ getter->getResilienceExpansion () == ResilienceExpansion::Minimal) {
2495
+ return true ;
2496
+ }
2489
2497
}
2498
+
2490
2499
// Allow replacement of opaque result types in the context of maximal
2491
2500
// resilient expansion if the context's and the opaque type's module are the
2492
2501
// same.
You can’t perform that action at this time.
0 commit comments