@@ -303,12 +303,10 @@ namespace {
303
303
// /
304
304
// / \param expr The expression to be coerced.
305
305
// / \param toType The type to which the expression will be coerced.
306
- // / \param locator Locator describing where this conversion occurs.
307
306
// /
308
307
// / \return The coerced expression, whose type will be equivalent to
309
308
// / \c toType.
310
- Expr *coerceSuperclass (Expr *expr, Type toType,
311
- ConstraintLocatorBuilder locator);
309
+ Expr *coerceSuperclass (Expr *expr, Type toType);
312
310
313
311
// / Coerce the given value to existential type.
314
312
// /
@@ -320,12 +318,10 @@ namespace {
320
318
// /
321
319
// / \param expr The expression to be coerced.
322
320
// / \param toType The type to which the expression will be coerced.
323
- // / \param locator Locator describing where this conversion occurs.
324
321
// /
325
322
// / \return The coerced expression, whose type will be equivalent to
326
323
// / \c toType.
327
- Expr *coerceExistential (Expr *expr, Type toType,
328
- ConstraintLocatorBuilder locator);
324
+ Expr *coerceExistential (Expr *expr, Type toType);
329
325
330
326
// / Coerce an expression of (possibly unchecked) optional
331
327
// / type to have a different (possibly unchecked) optional type.
@@ -4754,8 +4750,7 @@ static Type getMetatypeSuperclass(Type t) {
4754
4750
return t->getSuperclass ();
4755
4751
}
4756
4752
4757
- Expr *ExprRewriter::coerceSuperclass (Expr *expr, Type toType,
4758
- ConstraintLocatorBuilder locator) {
4753
+ Expr *ExprRewriter::coerceSuperclass (Expr *expr, Type toType) {
4759
4754
auto &ctx = cs.getASTContext ();
4760
4755
4761
4756
auto fromType = cs.getType (expr);
@@ -4780,7 +4775,7 @@ Expr *ExprRewriter::coerceSuperclass(Expr *expr, Type toType,
4780
4775
new (ctx) ArchetypeToSuperExpr (expr, superclass));
4781
4776
4782
4777
if (!superclass->isEqual (toType))
4783
- return coerceSuperclass (expr, toType, locator );
4778
+ return coerceSuperclass (expr, toType);
4784
4779
4785
4780
return expr;
4786
4781
@@ -4794,7 +4789,7 @@ Expr *ExprRewriter::coerceSuperclass(Expr *expr, Type toType,
4794
4789
auto *archetypeVal = cs.cacheType (new (ctx) OpaqueValueExpr (
4795
4790
expr->getSourceRange (), fromArchetype));
4796
4791
4797
- auto *result = coerceSuperclass (archetypeVal, toType, locator );
4792
+ auto *result = coerceSuperclass (archetypeVal, toType);
4798
4793
4799
4794
return cs.cacheType (
4800
4795
new (ctx) OpenExistentialExpr (expr, archetypeVal, result,
@@ -4830,8 +4825,7 @@ collectExistentialConformances(Type fromType, Type toType,
4830
4825
return toType->getASTContext ().AllocateCopy (conformances);
4831
4826
}
4832
4827
4833
- Expr *ExprRewriter::coerceExistential (Expr *expr, Type toType,
4834
- ConstraintLocatorBuilder locator) {
4828
+ Expr *ExprRewriter::coerceExistential (Expr *expr, Type toType) {
4835
4829
Type fromType = cs.getType (expr);
4836
4830
Type fromInstanceType = fromType;
4837
4831
Type toInstanceType = toType;
@@ -5823,11 +5817,11 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
5823
5817
5824
5818
case ConversionRestrictionKind::Superclass:
5825
5819
case ConversionRestrictionKind::ExistentialMetatypeToMetatype:
5826
- return coerceSuperclass (expr, toType, locator );
5820
+ return coerceSuperclass (expr, toType);
5827
5821
5828
5822
case ConversionRestrictionKind::Existential:
5829
5823
case ConversionRestrictionKind::MetatypeToExistentialMetatype:
5830
- return coerceExistential (expr, toType, locator );
5824
+ return coerceExistential (expr, toType);
5831
5825
5832
5826
case ConversionRestrictionKind::ClassMetatypeToAnyObject: {
5833
5827
assert (ctx.LangOpts .EnableObjCInterop &&
@@ -6060,7 +6054,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
6060
6054
fromSuperClass;
6061
6055
fromSuperClass = fromSuperClass->getSuperclass ()) {
6062
6056
if (fromSuperClass->isEqual (toType)) {
6063
- return coerceSuperclass (expr, toType, locator );
6057
+ return coerceSuperclass (expr, toType);
6064
6058
}
6065
6059
}
6066
6060
break ;
@@ -6193,7 +6187,7 @@ Expr *ExprRewriter::coerceToType(Expr *expr, Type toType,
6193
6187
case TypeKind::ExistentialMetatype:
6194
6188
case TypeKind::ProtocolComposition:
6195
6189
case TypeKind::Protocol:
6196
- return coerceExistential (expr, toType, locator );
6190
+ return coerceExistential (expr, toType);
6197
6191
6198
6192
// Coercion to Optional<T>.
6199
6193
case TypeKind::BoundGenericEnum: {
0 commit comments