Skip to content

Commit 339d3c2

Browse files
committed
[SE-0258] Add a Fix-It for the value -> wrappedValue rename.
(cherry picked from commit 99d42c4)
1 parent 2a03cc0 commit 339d3c2

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/Sema/TypeCheckPropertyWrapper.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -261,7 +261,8 @@ PropertyWrapperTypeInfoRequest::evaluate(
261261
return PropertyWrapperTypeInfo();
262262
}
263263

264-
valueVar->diagnose(diag::property_wrapper_value);
264+
valueVar->diagnose(diag::property_wrapper_value)
265+
.fixItReplace(valueVar->getNameLoc(), "wrappedValue");
265266
}
266267

267268
PropertyWrapperTypeInfo result;

test/decl/var/property_wrapper_aliases.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct Wrapper<T> {
2626

2727
@propertyWrapper
2828
struct OldValue<T> {
29-
var value: T // expected-warning{{property wrapper's `value` property should be renamed to 'wrappedValue'; use of 'value' is deprecated}}
29+
var value: T // expected-warning{{property wrapper's `value` property should be renamed to 'wrappedValue'; use of 'value' is deprecated}}{{7-12=wrappedValue}}
3030
}
3131

3232
struct TestOldValue {

0 commit comments

Comments
 (0)