mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Revert r21291; it's breaking the standard library build.
Swift SVN r21292
This commit is contained in:
@@ -1537,32 +1537,6 @@ struct ASTNodeBase {};
|
||||
"should be marked invalid";
|
||||
abort();
|
||||
}
|
||||
|
||||
// Verify that the optionality of the result type of the
|
||||
// initializer matches the failability of the initializer.
|
||||
if (!CD->isInvalid()) {
|
||||
OptionalTypeKind resultOptionality = OTK_None;
|
||||
CD->getResultType()->getAnyOptionalObjectType(resultOptionality);
|
||||
if (resultOptionality != CD->getFailability()) {
|
||||
Out << "Initializer has result optionality/failability mismatch\n";
|
||||
CD->dump(llvm::errs());
|
||||
abort();
|
||||
}
|
||||
|
||||
// Also check the interface type.
|
||||
if (auto genericFn
|
||||
= CD->getInterfaceType()->getAs<GenericFunctionType>()) {
|
||||
resultOptionality = OTK_None;
|
||||
genericFn->getResult()->castTo<AnyFunctionType>()->getResult()
|
||||
->getAnyOptionalObjectType(resultOptionality);
|
||||
if (resultOptionality != CD->getFailability()) {
|
||||
Out << "Initializer has result optionality/failability mismatch\n";
|
||||
CD->dump(llvm::errs());
|
||||
abort();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
verifyCheckedBase(CD);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user