Skip to content

Commit 6c19f35

Browse files
committed
[lldb] Update for extension binding cleanup
`computeExtendedNominal` no longer caches its result, it's meant to be used by extension binding itself. We ought to migrate LLDB off it, but for now update to set the result.
1 parent 664ae58 commit 6c19f35

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

lldb/source/Plugins/ExpressionParser/Swift/SwiftASTManipulator.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -848,11 +848,15 @@ GetPatternBindingForVarDecl(swift::VarDecl *var_decl,
848848

849849
// Since lldb does not call bindExtensions, must ensure that any enclosing
850850
// extension is bound
851+
// FIXME: This won't correctly handle cases that rely on other extensions
852+
// being bound first, e.g for nested types defined in extensions.
851853
for (auto *context = containing_context; context;
852854
context = context->getParent()) {
853855
if (auto *d = context->getAsDecl()) {
854-
if (auto *ext = swift::dyn_cast<swift::ExtensionDecl>(d))
855-
ext->computeExtendedNominal();
856+
if (auto *ext = swift::dyn_cast<swift::ExtensionDecl>(d)) {
857+
if (!ext->hasBeenBound())
858+
ext->setExtendedNominal(ext->computeExtendedNominal());
859+
}
856860
}
857861
}
858862
swift::Type type = containing_context->mapTypeIntoContext(

0 commit comments

Comments
 (0)