Skip to content

Commit 6a3bded

Browse files
committed
Merge remote-tracking branch 'origin/master' into master-next
2 parents fadeb0e + e840330 commit 6a3bded

File tree

3 files changed

+15
-0
lines changed

3 files changed

+15
-0
lines changed

lib/Serialization/ModuleFile.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1868,6 +1868,8 @@ ModuleFile::loadNamedMembers(const IterableDeclContext *IDC, DeclBaseName N,
18681868
} else {
18691869
if (!getContext().LangOpts.EnableDeserializationRecovery)
18701870
fatal(mem.takeError());
1871+
llvm::consumeError(mem.takeError());
1872+
18711873
// Treat this as a cache-miss to the caller and let them attempt
18721874
// to refill through the normal loadAllMembers() path.
18731875
return None;
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
// Tiny test that only accesses specific members of the 'User' class, never
2+
// forcing /all/ members to be loaded, in order to test recovery for lazy member
3+
// loading.
4+
5+
import Typedefs
6+
import Lib
7+
8+
func test(user: User) {
9+
_ = user.returnsWrappedMethod() // expected-error {{value of type 'User' has no member 'returnsWrappedMethod'; did you mean 'returnsUnwrappedMethod'?}}
10+
_ = user.returnsUnwrappedMethod() // okay
11+
}

test/Serialization/Recovery/typedefs.swift

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
// RUN: %target-swift-frontend -emit-ir -I %t -I %S/Inputs/custom-modules -DTEST %s | %FileCheck -check-prefix CHECK-IR %s
1414
// RUN: %target-swift-frontend -emit-ir -I %t -I %S/Inputs/custom-modules -Xcc -DBAD -DTEST %s | %FileCheck -check-prefix CHECK-IR %s
1515

16+
// RUN: %target-swift-frontend -typecheck -I %t -I %S/Inputs/custom-modules -Xcc -DBAD %S/Inputs/typedefs-helper.swift -verify
17+
1618
#if TEST
1719

1820
import Typedefs

0 commit comments

Comments
 (0)