Skip to content

Commit 012af55

Browse files
committed
Adjust for change to AbstractStorageDecl storage representation.
I'm not really sure what this code was trying to do, but this maintains exactly the current behavior.
1 parent e9d1069 commit 012af55

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

source/Plugins/ExpressionParser/Swift/SwiftASTManipulator.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,8 +1405,10 @@ bool SwiftASTManipulator::FixCaptures() {
14051405
if (!variable.m_decl)
14061406
continue;
14071407

1408-
if (variable.m_decl->getStorageKind() !=
1409-
swift::AbstractStorageDecl::Computed)
1408+
auto impl = variable.m_decl->getImplInfo();
1409+
if (impl.getReadImpl() != swift::ReadImplKind::Get ||
1410+
(impl.getWriteImpl() != swift::WriteImplKind::Set &&
1411+
impl.getWriteImpl() != swift::WriteImplKind::Immutable))
14101412
continue;
14111413

14121414
swift::FuncDecl *getter_decl = variable.m_decl->getGetter();

source/Plugins/ExpressionParser/Swift/SwiftExpressionParser.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1754,8 +1754,7 @@ unsigned SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager,
17541754
llvm::cast<SwiftExpressionVariable>(persistent_variable.get())
17551755
->SetIsModifiable(false);
17561756
}
1757-
if (decl->getStorageKind() ==
1758-
swift::VarDecl::StorageKindTy::Computed) {
1757+
if (!decl->hasStorage()) {
17591758
llvm::cast<SwiftExpressionVariable>(persistent_variable.get())
17601759
->SetIsComputed(true);
17611760
}

0 commit comments

Comments
 (0)