Skip to content

Commit 3d88f9d

Browse files
Merge pull request #6979 from adrian-prantl/110492710
Avoid spurious import fixits in the REPL
2 parents 3d253b0 + 628b1fb commit 3d88f9d

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
@@ -1690,11 +1690,13 @@ SwiftExpressionParser::Parse(DiagnosticManager &diagnostic_manager,
16901690
parsed_expr.takeError(),
16911691
[&](const ModuleImportError &MIE) {
16921692
diagnostic_manager.PutString(eDiagnosticSeverityError, MIE.message());
1693-
// There are no fallback contexts in REPL and playgrounds.
1694-
if (repl || playground || MIE.is_new_dylib) {
1693+
if (MIE.is_new_dylib) {
16951694
retry = true;
16961695
return;
16971696
}
1697+
// There are no fallback contexts in REPL and playgrounds.
1698+
if (repl || playground)
1699+
return;
16981700
if (!m_sc.target_sp->UseScratchTypesystemPerModule()) {
16991701
// This, together with the fatal error forces
17001702
// 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)