Skip to content

Commit 304449b

Browse files
committed
[Test] Add a test case
1 parent 9c23a9e commit 304449b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

test/decl/ext/extensions.swift

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,3 +124,23 @@ struct WrapperContext {
124124
static let propUsingMember = originalValue
125125
}
126126
}
127+
128+
// SR-11298
129+
130+
protocol SR_11298_P {}
131+
132+
class SR_11298_C: SR_11298_P {
133+
var property: String = ""
134+
}
135+
136+
// Self: SR_11298_C requirement constrains this extension to SR_11298C and its subclasses.
137+
// Since this implies a class constraint, the setter should be implicitly nonmutating.
138+
extension SR_11298_P where Self: SR_11298_C {
139+
var wrappingProperty: String {
140+
get { return property }
141+
set { property = newValue }
142+
}
143+
}
144+
145+
let instance = SR_11298_C()
146+
instance.wrappingProperty = "" // Okay

0 commit comments

Comments
 (0)