File tree Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Expand file tree Collapse file tree 2 files changed +17
-0
lines changed Original file line number Diff line number Diff line change @@ -1172,6 +1172,10 @@ static bool doesPropertyNeedDescriptor(AbstractStorageDecl *decl) {
1172
1172
if (!decl->getGetter ())
1173
1173
return false ;
1174
1174
1175
+ // If the getter is mutating, we cannot form a keypath to it at all.
1176
+ if (decl->isGetterMutating ())
1177
+ return false ;
1178
+
1175
1179
// TODO: If previous versions of an ABI-stable binary needed the descriptor,
1176
1180
// then we still do.
1177
1181
Original file line number Diff line number Diff line change @@ -76,5 +76,18 @@ public struct A {
76
76
internal subscript< T> ( d x: T ) -> T { return x }
77
77
fileprivate subscript< T> ( e x: T ) -> T { return x }
78
78
private subscript< T> ( f x: T ) -> T { return x }
79
+
80
+ // no descriptor
81
+ public var count : Int {
82
+ mutating get {
83
+ _count += 1
84
+ return _count
85
+ }
86
+ set {
87
+ _count = newValue
88
+ }
89
+ }
90
+
91
+ private var _count : Int = 0
79
92
}
80
93
You can’t perform that action at this time.
0 commit comments