Skip to content

Commit 42b0be7

Browse files
committed
Add a workaround for rdar://58355191
1 parent f64e25b commit 42b0be7

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

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

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1125,8 +1125,13 @@ bool SwiftASTManipulator::AddExternalVariables(
11251125

11261126
redirected_var_decl->setImplicit(true);
11271127

1128-
m_source_file.addTopLevelDecl(top_level_code);
1129-
m_source_file.addTopLevelDecl(redirected_var_decl);
1128+
// FIXME: This should use SourceFile::addTopLevelDecl, but if these decls
1129+
// are not inserted at the beginning of the source file then
1130+
// SwiftREPL/FoundationTypes.test fails.
1131+
//
1132+
// See rdar://58355191
1133+
m_source_file.prependTopLevelDecl(top_level_code);
1134+
m_source_file.prependTopLevelDecl(redirected_var_decl);
11301135

11311136
variable.m_decl = redirected_var_decl;
11321137

0 commit comments

Comments
 (0)