Skip to content

[CSFix] NFC: Fixes should only be created via create(...) #22559

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 12, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions lib/Sema/CSFix.h
Original file line number Diff line number Diff line change
Expand Up @@ -441,10 +441,10 @@ class ContextualMismatch : public ConstraintFix {
/// }
/// ```
class AutoClosureForwarding final : public ConstraintFix {
public:
AutoClosureForwarding(ConstraintSystem &cs, ConstraintLocator *locator)
: ConstraintFix(cs, FixKind::AutoClosureForwarding, locator) {}

public:
std::string getName() const override { return "fix @autoclosure forwarding"; }

bool diagnose(Expr *root, bool asNote = false) const override;
Expand All @@ -456,10 +456,10 @@ class AutoClosureForwarding final : public ConstraintFix {
class RemoveUnwrap final : public ConstraintFix {
Type BaseType;

public:
RemoveUnwrap(ConstraintSystem &cs, Type baseType, ConstraintLocator *locator)
: ConstraintFix(cs, FixKind::RemoveUnwrap, locator), BaseType(baseType) {}

public:
std::string getName() const override {
return "remove unwrap operator `!` or `?`";
}
Expand All @@ -471,10 +471,10 @@ class RemoveUnwrap final : public ConstraintFix {
};

class InsertExplicitCall final : public ConstraintFix {
public:
InsertExplicitCall(ConstraintSystem &cs, ConstraintLocator *locator)
: ConstraintFix(cs, FixKind::InsertCall, locator) {}

public:
std::string getName() const override {
return "insert explicit `()` to make a call";
}
Expand All @@ -486,10 +486,10 @@ class InsertExplicitCall final : public ConstraintFix {
};

class UseSubscriptOperator final : public ConstraintFix {
public:
UseSubscriptOperator(ConstraintSystem &cs, ConstraintLocator *locator)
: ConstraintFix(cs, FixKind::UseSubscriptOperator, locator) {}

public:
std::string getName() const override {
return "replace '.subscript(...)' with subscript operator";
}
Expand All @@ -504,12 +504,12 @@ class DefineMemberBasedOnUse final : public ConstraintFix {
Type BaseType;
DeclName Name;

public:
DefineMemberBasedOnUse(ConstraintSystem &cs, Type baseType, DeclName member,
ConstraintLocator *locator)
: ConstraintFix(cs, FixKind::DefineMemberBasedOnUse, locator),
BaseType(baseType), Name(member) {}

public:
std::string getName() const override {
llvm::SmallVector<char, 16> scratch;
auto memberName = Name.getString(scratch);
Expand All @@ -525,12 +525,12 @@ class DefineMemberBasedOnUse final : public ConstraintFix {
};

class AllowInvalidPartialApplication final : public ConstraintFix {
public:
AllowInvalidPartialApplication(bool isWarning, ConstraintSystem &cs,
ConstraintLocator *locator)
: ConstraintFix(cs, FixKind::AllowInvalidPartialApplication, locator,
isWarning) {}

public:
std::string getName() const override {
return "allow partially applied 'mutating' method";
}
Expand Down