@@ -122,12 +122,12 @@ enum class FixKind : uint8_t {
122122 // / the storage or property wrapper.
123123 UseWrappedValue,
124124
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 ,
128128
129- // / Add '@propertyWrapper' to a nominal type declaration .
130- AddPropertyWrapperAttribute ,
129+ // / Remove the '$' prefix from an argument label or parameter name .
130+ RemoveProjectedValueArgument ,
131131
132132 // / Instead of spelling out `subscript` directly, use subscript operator.
133133 UseSubscriptOperator,
@@ -984,37 +984,40 @@ class UseWrappedValue final : public ConstraintFix {
984984 ConstraintLocator *locator);
985985};
986986
987- class AddProjectedValue final : public ConstraintFix {
987+ class AllowInvalidPropertyWrapperType final : public ConstraintFix {
988988 Type wrapperType;
989989
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) {}
993994
994995public:
995- static AddProjectedValue *create (ConstraintSystem &cs, Type wrapper ,
996- ConstraintLocator *locator);
996+ static AllowInvalidPropertyWrapperType *create (ConstraintSystem &cs, Type wrapperType ,
997+ ConstraintLocator *locator);
997998
998999 std::string getName () const override {
999- return " add 'var projectedValue' to pass a projection argument " ;
1000+ return " allow invalid property wrapper type " ;
10001001 }
10011002
10021003 bool diagnose (const Solution &solution, bool asNote = false ) const override ;
10031004};
10041005
1005- class AddPropertyWrapperAttribute final : public ConstraintFix {
1006+ class RemoveProjectedValueArgument final : public ConstraintFix {
10061007 Type wrapperType;
1008+ ParamDecl *param;
10071009
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) {}
10111014
10121015public:
1013- static AddPropertyWrapperAttribute *create (ConstraintSystem &cs, Type wrapper,
1014- ConstraintLocator *locator);
1016+ static RemoveProjectedValueArgument *create (ConstraintSystem &cs, Type wrapper,
1017+ ParamDecl *param, ConstraintLocator *locator);
10151018
10161019 std::string getName () const override {
1017- return " add '@propertyWrapper' " ;
1020+ return " remove '$' from argument label " ;
10181021 }
10191022
10201023 bool diagnose (const Solution &solution, bool asNote = false ) const override ;
0 commit comments