mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
Rename ErrorType to ErrorProtocol
This commit is contained in:
committed by
Max Moiseev
parent
99d3f96c6d
commit
feacbc4433
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user