@@ -122,12 +122,12 @@ enum class FixKind : uint8_t {
122
122
// / the storage or property wrapper.
123
123
UseWrappedValue,
124
124
125
- // / Add 'var projectedValue' to the property wrapper type to allow passing
126
- // / a projection argument .
127
- AddProjectedValue ,
125
+ // / Allow a type that is not a property wrapper to be used as a property
126
+ // / wrapper .
127
+ AllowInvalidPropertyWrapperType ,
128
128
129
- // / Add '@propertyWrapper' to a nominal type declaration .
130
- AddPropertyWrapperAttribute ,
129
+ // / Remove the '$' prefix from an argument label or parameter name .
130
+ RemoveProjectedValueArgument ,
131
131
132
132
// / Instead of spelling out `subscript` directly, use subscript operator.
133
133
UseSubscriptOperator,
@@ -984,37 +984,40 @@ class UseWrappedValue final : public ConstraintFix {
984
984
ConstraintLocator *locator);
985
985
};
986
986
987
- class AddProjectedValue final : public ConstraintFix {
987
+ class AllowInvalidPropertyWrapperType final : public ConstraintFix {
988
988
Type wrapperType;
989
989
990
- AddProjectedValue (ConstraintSystem &cs, Type wrapper,
991
- ConstraintLocator *locator)
992
- : ConstraintFix(cs, FixKind::AddProjectedValue, locator), wrapperType(wrapper) {}
990
+ AllowInvalidPropertyWrapperType (ConstraintSystem &cs, Type wrapperType,
991
+ ConstraintLocator *locator)
992
+ : ConstraintFix(cs, FixKind::AllowInvalidPropertyWrapperType, locator),
993
+ wrapperType (wrapperType) {}
993
994
994
995
public:
995
- static AddProjectedValue *create (ConstraintSystem &cs, Type wrapper ,
996
- ConstraintLocator *locator);
996
+ static AllowInvalidPropertyWrapperType *create (ConstraintSystem &cs, Type wrapperType ,
997
+ ConstraintLocator *locator);
997
998
998
999
std::string getName () const override {
999
- return " add 'var projectedValue' to pass a projection argument " ;
1000
+ return " allow invalid property wrapper type " ;
1000
1001
}
1001
1002
1002
1003
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
1003
1004
};
1004
1005
1005
- class AddPropertyWrapperAttribute final : public ConstraintFix {
1006
+ class RemoveProjectedValueArgument final : public ConstraintFix {
1006
1007
Type wrapperType;
1008
+ ParamDecl *param;
1007
1009
1008
- AddPropertyWrapperAttribute (ConstraintSystem &cs, Type wrapper,
1009
- ConstraintLocator *locator)
1010
- : ConstraintFix(cs, FixKind::AddPropertyWrapperAttribute, locator), wrapperType(wrapper) {}
1010
+ RemoveProjectedValueArgument (ConstraintSystem &cs, Type wrapper,
1011
+ ParamDecl *param, ConstraintLocator *locator)
1012
+ : ConstraintFix(cs, FixKind::RemoveProjectedValueArgument, locator),
1013
+ wrapperType (wrapper), param(param) {}
1011
1014
1012
1015
public:
1013
- static AddPropertyWrapperAttribute *create (ConstraintSystem &cs, Type wrapper,
1014
- ConstraintLocator *locator);
1016
+ static RemoveProjectedValueArgument *create (ConstraintSystem &cs, Type wrapper,
1017
+ ParamDecl *param, ConstraintLocator *locator);
1015
1018
1016
1019
std::string getName () const override {
1017
- return " add '@propertyWrapper' " ;
1020
+ return " remove '$' from argument label " ;
1018
1021
}
1019
1022
1020
1023
bool diagnose (const Solution &solution, bool asNote = false ) const override ;
0 commit comments