Skip to content

Commit 4c84597

Browse files
committed
[CSFix] Require all sub-classes of ContextualMismatch to supply a kind
1 parent 0f2ee14 commit 4c84597

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

include/swift/Sema/CSFix.h

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,11 +636,12 @@ class SkipSuperclassRequirement final : public ConstraintFix {
636636
class ContextualMismatch : public ConstraintFix {
637637
Type LHS, RHS;
638638

639-
protected:
640639
ContextualMismatch(ConstraintSystem &cs, Type lhs, Type rhs,
641640
ConstraintLocator *locator)
642641
: ConstraintFix(cs, FixKind::ContextualMismatch, locator), LHS(lhs),
643642
RHS(rhs) {}
643+
644+
protected:
644645
ContextualMismatch(ConstraintSystem &cs, FixKind kind, Type lhs, Type rhs,
645646
ConstraintLocator *locator, bool warning = false)
646647
: ConstraintFix(cs, kind, locator, warning), LHS(lhs), RHS(rhs) {}
@@ -657,6 +658,10 @@ class ContextualMismatch : public ConstraintFix {
657658

658659
static ContextualMismatch *create(ConstraintSystem &cs, Type lhs, Type rhs,
659660
ConstraintLocator *locator);
661+
662+
static bool classof(ConstraintFix *fix) {
663+
return fix->getKind() == FixKind::ContextualMismatch;
664+
}
660665
};
661666

662667
class TreatArrayLiteralAsDictionary final : public ContextualMismatch {

0 commit comments

Comments
 (0)