Skip to content

Commit f66405c

Browse files
[Diagnostics] Adjust RemoveUnnecessaryCoercion and UnnecessaryCoercionFailure to use solution on diagnose()
1 parent d2d32a2 commit f66405c

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

lib/Sema/CSDiagnostics.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1804,10 +1804,10 @@ class UnnecessaryCoercionFailure final
18041804
: public ContextualFailure {
18051805

18061806
public:
1807-
UnnecessaryCoercionFailure(ConstraintSystem &cs,
1807+
UnnecessaryCoercionFailure(const Solution &solution,
18081808
Type fromType, Type toType,
18091809
ConstraintLocator *locator)
1810-
: ContextualFailure(cs, fromType, toType, locator) {}
1810+
: ContextualFailure(solution, fromType, toType, locator) {}
18111811

18121812
bool diagnoseAsError() override;
18131813
};

lib/Sema/CSFix.cpp

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1136,9 +1136,8 @@ IgnoreContextualType *IgnoreContextualType::create(ConstraintSystem &cs,
11361136
IgnoreContextualType(cs, resultTy, specifiedTy, locator);
11371137
}
11381138

1139-
bool RemoveUnnecessaryCoercion::diagnose(bool asNote) const {
1140-
auto &cs = getConstraintSystem();
1141-
UnnecessaryCoercionFailure failure(cs, getFromType(), getToType(),
1139+
bool RemoveUnnecessaryCoercion::diagnose(const Solution &solution, bool asNote) const {
1140+
UnnecessaryCoercionFailure failure(solution, getFromType(), getToType(),
11421141
getLocator());
11431142
return failure.diagnose(asNote);
11441143
}

lib/Sema/CSFix.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1577,7 +1577,7 @@ class RemoveUnnecessaryCoercion : public ContextualMismatch {
15771577
return "remove unnecessary explicit type coercion";
15781578
}
15791579

1580-
bool diagnose(bool asNote = false) const override;
1580+
bool diagnose(const Solution &solution, bool asNote = false) const override;
15811581

15821582
static bool attempt(ConstraintSystem &cs, Type fromType, Type toType,
15831583
ConstraintLocatorBuilder locator);

0 commit comments

Comments
 (0)