diff --git a/lldb/test/Shell/SwiftREPL/Inputs/A.swift b/lldb/test/Shell/SwiftREPL/Inputs/A.swift index d0054413e07bb..887eb06b3efb5 100644 --- a/lldb/test/Shell/SwiftREPL/Inputs/A.swift +++ b/lldb/test/Shell/SwiftREPL/Inputs/A.swift @@ -24,3 +24,7 @@ public struct FromInterface {} public struct OtherType {} public let testValue = FromInterface() + +extension StringProtocol { + public func foo() -> Bool { true } +} diff --git a/lldb/test/Shell/SwiftREPL/LookupAfterImport.test b/lldb/test/Shell/SwiftREPL/LookupAfterImport.test new file mode 100644 index 0000000000000..d067501e5f155 --- /dev/null +++ b/lldb/test/Shell/SwiftREPL/LookupAfterImport.test @@ -0,0 +1,15 @@ +// Make sure we properly load in new extension members after an import. +// rdar://64040436 + +// RUN: rm -rf %t +// RUN: mkdir %t +// RUN: %target-swiftc -emit-library %S/Inputs/A.swift -module-name A -emit-module-path %t/A.swiftmodule -o %t/libA%target-shared-library-suffix +// RUN: %lldb --repl="-I%t -L%t -lA" < %s 2>&1 | FileCheck %s + +"".foo() +// CHECK: error: value of type 'String' has no member 'foo' + +import A + +"".foo() +// CHECK: $R0: Bool = true