Skip to content

Commit 628b1fb

Browse files
committed
Avoid spurious import fixits in the REPL
There is no point in invoking the per-module fallback and import retry mechanism inside the repl. rdar://110492710
1 parent ce97507 commit 628b1fb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1691,11 +1691,13 @@ SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager,
16911691
parsed_expr.takeError(),
16921692
[&](const ModuleImportError &MIE) {
16931693
diagnostic_manager.PutString(eDiagnosticSeverityError, MIE.message());
1694-
// There are no fallback contexts in REPL and playgrounds.
1695-
if (repl || playground || MIE.is_new_dylib) {
1694+
if (MIE.is_new_dylib) {
16961695
retry = true;
16971696
return;
16981697
}
1698+
// There are no fallback contexts in REPL and playgrounds.
1699+
if (repl || playground)
1700+
return;
16991701
if (!m_sc.target_sp->UseScratchTypesystemPerModule()) {
17001702
// This, together with the fatal error forces
17011703
// a per-module scratch to be instantiated on

lldb/test/Shell/SwiftREPL/ImportError.test

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,4 @@
55

66
import ModuleThatDoesNotExist
77
// CHECK: error: no such module 'ModuleThatDoesNotExist'
8+
// CHECK-NOT: fixed expression suggested

0 commit comments

Comments
 (0)