Skip to content

Commit bb8709c

Browse files
DevAndArtistDougGregor
authored andcommitted
Fixing old renamed property name. (#1051)
1 parent 57abdc1 commit bb8709c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

proposals/0258-property-wrappers.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ translates to:
144144
```swift
145145
var $foo: Lazy<Int> = Lazy<Int>(initialValue: 1738)
146146
var foo: Int {
147-
get { return $foo.value }
148-
set { $foo.value = newValue }
147+
get { return $foo.wrappedValue }
148+
set { $foo.wrappedValue = newValue }
149149
}
150150
```
151151

@@ -643,8 +643,8 @@ Composition is implemented by nesting later wrapper types inside earlier wrapper
643643
```swift
644644
var $path: DelayedMutable<Copying<UIBezierPath>> = .init()
645645
var path: UIBezierPath {
646-
get { return $path.value.value }
647-
set { $path.value.value = newValue }
646+
get { return $path.wrappedValue.wrappedValue }
647+
set { $path.wrappedValue.wrappedValue = newValue }
648648
}
649649
```
650650

@@ -695,7 +695,7 @@ in one of three ways:
695695

696696
// ... implemented as
697697
var $foo: Lazy = Lazy(initialValue: 17)
698-
var foo: Int { /* access via $foo.value as described above */ }
698+
var foo: Int { /* access via $foo.wrappedValue as described above */ }
699699
```
700700
When there are multiple, composed property wrappers, all of them must provide an `init(initialValue:)`, and the resulting initialization will wrap each level of call:
701701

@@ -704,7 +704,7 @@ in one of three ways:
704704

705705
// ... implemented as
706706
var $path: Lazy<Copying<UIBezierPath>> = .init(initialValue: .init(initialValue: UIBezierPath()))
707-
var path: UIBezierPath { /* access via $path.value.value as described above */ }
707+
var path: UIBezierPath { /* access via $path.wrappedValue.wrappedValue as described above */ }
708708
```
709709

710710
2. Via a value of the property wrapper type, by placing the initializer
@@ -718,7 +718,7 @@ in one of three ways:
718718

719719
// ... implemented as
720720
var $someInt: UnsafeMutablePointer<Int> = UnsafeMutablePointer(mutating: addressOfInt)
721-
var someInt: Int { /* access via $someInt.value */ }
721+
var someInt: Int { /* access via $someInt.wrappedValue */ }
722722
```
723723

724724
When there are multiple, composed property wrappers, only the first (outermost) wrapper may have initializer arguments.
@@ -730,7 +730,7 @@ in one of three ways:
730730

731731
// ... implemented as
732732
var $x: DelayedMutable<Int> = DelayedMutable<Int>()
733-
var x: Int { /* access via $x.value */ }
733+
var x: Int { /* access via $x.wrappedValue */ }
734734
```
735735

736736
When there are multiple, composed property wrappers, only the first (outermost) wrapper needs to have an `init()`.
@@ -892,7 +892,7 @@ apply to properties that have wrappers. Let's expand the example of
892892
// ...
893893
x2 = 17 // okay, treated as $x2 = .init(initialValue: 17)
894894
// ...
895-
x2 = 42 // okay, treated as x2 = 42 (calls the Lazy.value setter)
895+
x2 = 42 // okay, treated as x2 = 42 (calls the Lazy.wrappedValue setter)
896896
```
897897

898898
### Memberwise initializers
@@ -1102,8 +1102,8 @@ struct AB<Value> {
11021102
private var storage: A<B<Value>>
11031103

11041104
var wrappedValue: Value {
1105-
get { storage.value.value }
1106-
set { storage.value.value = newValue }
1105+
get { storage.wrappedValue.wrappedValue }
1106+
set { storage.wrappedValue.wrappedValue = newValue }
11071107
}
11081108
}
11091109
```

0 commit comments

Comments
 (0)