Skip to content

Commit 9aa48ce

Browse files
authored
Add class and extension tests.
1 parent 613b629 commit 9aa48ce

File tree

1 file changed

+17
-1
lines changed

1 file changed

+17
-1
lines changed

test/decl/var/usage.swift

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -287,14 +287,30 @@ func sr964() {
287287
print(suspiciousSetter) // expected-warning {{setter argument 'newValue' was never used, but the property was accessed}} expected-note {{did you mean to use 'newValue' instead of accessing the property's current value?}} {{13-29=newValue}}
288288
}
289289
}
290-
struct MemberGetter {
290+
struct MemberGetterStruct {
291291
var suspiciousSetter: String {
292292
get { return "" }
293293
set {
294294
print(suspiciousSetter) // expected-warning {{setter argument 'newValue' was never used, but the property was accessed}} expected-note {{did you mean to use 'newValue' instead of accessing the property's current value?}} {{15-31=newValue}}
295295
}
296296
}
297297
}
298+
class MemberGetterClass {
299+
var suspiciousSetter: String {
300+
get { return "" }
301+
set {
302+
print(suspiciousSetter) // expected-warning {{setter argument 'newValue' was never used, but the property was accessed}} expected-note {{did you mean to use 'newValue' instead of accessing the property's current value?}} {{15-31=newValue}}
303+
}
304+
}
305+
}
306+
extension MemberGetterClass {
307+
var suspiciousSetterExt: String {
308+
get { return "" }
309+
set {
310+
print(suspiciousSetterExt) // expected-warning {{setter argument 'newValue' was never used, but the property was accessed}} expected-note {{did you mean to use 'newValue' instead of accessing the property's current value?}} {{15-34=newValue}}
311+
}
312+
}
313+
}
298314
var namedSuspiciousSetter: String {
299315
get { return "" }
300316
set(parameter) {

0 commit comments

Comments
 (0)