Skip to content

Commit b22b1b8

Browse files
[Sema] Fixing compilation errors caused by removed APIs
1 parent 3225f62 commit b22b1b8

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5549,8 +5549,8 @@ bool ThrowingFunctionConversionFailure::diagnoseAsError() {
55495549
bool UnnecessaryCoercionFailure::diagnoseAsError() {
55505550
auto expr = getAsExpr<CoerceExpr>(getAnchor());
55515551
auto sourceRange =
5552-
SourceRange(expr->getLoc(), expr->getCastTypeLoc().getSourceRange().End);
5553-
auto castType = expr->getCastTypeLoc().getType();
5552+
SourceRange(expr->getLoc(), expr->getCastTypeRepr()->getSourceRange().End);
5553+
auto castType = getType(expr->getCastTypeRepr());
55545554

55555555
if (isa<TypeAliasType>(getFromType().getPointer()) &&
55565556
isa<TypeAliasType>(getToType().getPointer())) {

lib/Sema/CSFix.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,11 +1163,11 @@ bool RemoveUnnecessaryCoercion::attempt(ConstraintSystem &cs, Type fromType,
11631163
// to AnyHashable where if we coerce a generic type that conforms to
11641164
// this protocol to AnyHashable we match equal types here, but the
11651165
// explicit coercion is still required.
1166-
auto castType = cs.getType(expr->getCastTypeLoc());
1166+
auto castType = cs.getType(expr->getCastTypeRepr());
11671167
if (!fromType->isEqual(castType) && cs.isAnyHashableType(castType))
11681168
return false;
11691169

1170-
auto toTypeRepr = expr->getCastTypeLoc().getTypeRepr();
1170+
auto toTypeRepr = expr->getCastTypeRepr();
11711171

11721172
// Don't emit this diagnostic for Implicitly unwrapped optional types
11731173
// e.g. i as Int!

0 commit comments

Comments
 (0)