File tree Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Expand file tree Collapse file tree 2 files changed +21
-0
lines changed Original file line number Diff line number Diff line change @@ -352,6 +352,15 @@ static bool implicitSelfReferenceIsUnwrapped(const ValueDecl *selfDecl) {
352352}
353353
354354ValueDecl *UnqualifiedLookupFactory::lookupBaseDecl (const DeclContext *baseDC) const {
355+ // If the member was not in local context, we're not going to need the
356+ // 'self' declaration, so skip all this work to avoid request cycles.
357+ if (!baseDC->isLocalContext ())
358+ return nullptr ;
359+
360+ // If we're only interested in type declarations, we can also skip everything.
361+ if (isOriginallyTypeLookup)
362+ return nullptr ;
363+
355364 // Perform an unqualified lookup for the base decl of this result. This
356365 // handles cases where self was rebound (e.g. `guard let self = self`)
357366 // earlier in this closure or some outer closure.
Original file line number Diff line number Diff line change @@ -219,3 +219,15 @@ struct PropertyWrapperContainer {
219219 _ = $__lazy_storage_$_foo // This is okay.
220220 }
221221}
222+
223+ // rdar://problem/129255769
224+ struct X {
225+ struct Y { }
226+
227+ func f( ) {
228+ _ = {
229+ lazy var x : [ Y ] = [ ]
230+ _ = Y ( )
231+ }
232+ }
233+ }
You can’t perform that action at this time.
0 commit comments