Rename ErrorType to ErrorProtocol

This commit is contained in:
Dmitri Gribenko
2015-11-03 18:58:39 -08:00
committed by Max Moiseev
parent 99d3f96c6d
commit feacbc4433
123 changed files with 1121 additions and 1118 deletions

View File

@@ -4645,8 +4645,9 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
}
case ConversionRestrictionKind::BridgeToNSError: {
// Tell the ErrorType to become an NSError, using _bridgeErrorTypeToNSError.
auto fn = tc.Context.getBridgeErrorTypeToNSError(&tc);
// Tell the ErrorProtocol to become an NSError, using
// _bridgeErrorProtocolToNSError.
auto fn = tc.Context.getBridgeErrorProtocolToNSError(&tc);
if (!fn) {
tc.diagnose(expr->getLoc(), diag::missing_nserror_bridging_function);
return nullptr;
@@ -4661,9 +4662,9 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
if (tc.typeCheckExpressionShallow(call, dc))
return nullptr;
// The return type of _bridgeErrorTypeToNSError is formally 'AnyObject' to avoid
// stdlib-to-Foundation dependencies, but it's really NSError.
// Abuse CovariantReturnConversionExpr to fix this.
// The return type of _bridgeErrorProtocolToNSError is formally
// 'AnyObject' to avoid stdlib-to-Foundation dependencies, but it's
// really NSError. Abuse CovariantReturnConversionExpr to fix this.
return new (tc.Context) CovariantReturnConversionExpr(call, toType);
}