Skip to content

Commit 4ba74a2

Browse files
authored
Merge pull request #3262 from rjmccall/fix-recordImportDecls-signature-resolution
Check for lazy signature resolution failure when deciding overloadabi…
2 parents 7578cca + 1e1afc5 commit 4ba74a2

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

lib/AST/ModuleNameLookup.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,13 @@ static ResolutionKind recordImportDecls(LazyResolver *typeResolver,
108108
std::copy_if(newDecls.begin(), newDecls.end(), std::back_inserter(results),
109109
[&](ValueDecl *result) -> bool {
110110
if (!result->hasType()) {
111-
if (typeResolver)
111+
if (typeResolver) {
112112
typeResolver->resolveDeclSignature(result);
113-
else
113+
if (result->isInvalid())
114+
return true;
115+
} else {
114116
return true;
117+
}
115118
}
116119
return isValidOverload(overloads, result);
117120
});

validation-test/compiler_crashers/28295-swift-namelookup-lookupvisibledeclsinmodule.swift renamed to validation-test/compiler_crashers_fixed/28295-swift-namelookup-lookupvisibledeclsinmodule.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@
55
// See http://swift.org/LICENSE.txt for license information
66
// See http://swift.org/CONTRIBUTORS.txt for the list of Swift project authors
77

8-
// RUN: not --crash %target-swift-frontend %s -parse
8+
// RUN: not %target-swift-frontend %s -parse
99
// REQUIRES: asserts
1010
struct a{var f={H:{}}}init

0 commit comments

Comments
 (0)