mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
[Serialization] Handle operators that can't be deserialized.
We were already doing this for top-level declarations; just use the same recovery code for operators. More rdar://problem/31920901
This commit is contained in:
@@ -1330,7 +1330,14 @@ void ModuleFile::lookupValue(DeclName name,
|
||||
auto iter = OperatorMethodDecls->find(name.getBaseName());
|
||||
if (iter != OperatorMethodDecls->end()) {
|
||||
for (auto item : *iter) {
|
||||
auto VD = cast<ValueDecl>(getDecl(item.second));
|
||||
Expected<Decl *> declOrError = getDeclChecked(item.second);
|
||||
if (!declOrError) {
|
||||
if (!getContext().LangOpts.EnableDeserializationRecovery)
|
||||
fatal(declOrError.takeError());
|
||||
llvm::consumeError(declOrError.takeError());
|
||||
continue;
|
||||
}
|
||||
auto VD = cast<ValueDecl>(declOrError.get());
|
||||
results.push_back(VD);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user