Skip to content

Commit 8a8efcb

Browse files
committed
Drop ConstraintFix::diagfixBehavior() in favor of public const fixBehavior.
1 parent 7436fb3 commit 8a8efcb

File tree

2 files changed

+6
-10
lines changed

2 files changed

+6
-10
lines changed

include/swift/Sema/CSFix.h

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -411,10 +411,10 @@ class ConstraintFix {
411411
FixKind Kind;
412412
ConstraintLocator *Locator;
413413

414+
public:
414415
/// The behavior limit to apply to the diagnostics emitted.
415-
FixBehavior fixBehavior;
416+
const FixBehavior fixBehavior;
416417

417-
public:
418418
ConstraintFix(ConstraintSystem &cs, FixKind kind, ConstraintLocator *locator,
419419
FixBehavior fixBehavior = FixBehavior::Error)
420420
: CS(cs), Kind(kind), Locator(locator), fixBehavior(fixBehavior) {}
@@ -445,10 +445,6 @@ class ConstraintFix {
445445
/// Determine the impact of this fix on the solution score, if any.
446446
Optional<ScoreKind> impact() const;
447447

448-
/// The diagnostic behavior limit that will be applied to any emitted
449-
/// diagnostics.
450-
FixBehavior diagfixBehavior() const { return fixBehavior; }
451-
452448
virtual std::string getName() const = 0;
453449

454450
/// Coalesce this fix with the given secondary fixes and diagnose the failure.

lib/Sema/CSFix.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ MarkExplicitlyEscaping::create(ConstraintSystem &cs, Type lhs, Type rhs,
243243
bool MarkGlobalActorFunction::diagnose(const Solution &solution,
244244
bool asNote) const {
245245
DroppedGlobalActorFunctionAttr failure(
246-
solution, getFromType(), getToType(), getLocator(), diagfixBehavior());
246+
solution, getFromType(), getToType(), getLocator(), fixBehavior);
247247
return failure.diagnose(asNote);
248248
}
249249

@@ -263,7 +263,7 @@ bool AddSendableAttribute::diagnose(const Solution &solution,
263263
bool asNote) const {
264264
AttributedFuncToTypeConversionFailure failure(
265265
solution, getFromType(), getToType(), getLocator(),
266-
AttributedFuncToTypeConversionFailure::Concurrent, diagfixBehavior());
266+
AttributedFuncToTypeConversionFailure::Concurrent, fixBehavior);
267267
return failure.diagnose(asNote);
268268
}
269269

@@ -1639,7 +1639,7 @@ bool TreatEphemeralAsNonEphemeral::diagnose(const Solution &solution,
16391639
bool asNote) const {
16401640
NonEphemeralConversionFailure failure(solution, getLocator(), getFromType(),
16411641
getToType(), ConversionKind,
1642-
diagfixBehavior());
1642+
fixBehavior);
16431643
return failure.diagnose(asNote);
16441644
}
16451645

@@ -2233,7 +2233,7 @@ IgnoreDefaultExprTypeMismatch::create(ConstraintSystem &cs, Type argType,
22332233
bool AddExplicitExistentialCoercion::diagnose(const Solution &solution,
22342234
bool asNote) const {
22352235
MissingExplicitExistentialCoercion failure(solution, ErasedResultType,
2236-
getLocator(), diagfixBehavior());
2236+
getLocator(), fixBehavior);
22372237
return failure.diagnose(asNote);
22382238
}
22392239

0 commit comments

Comments
 (0)