You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: test/Sema/diag_self_assign.swift
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -50,7 +50,7 @@ class SA3 {
50
50
return foo // expected-warning {{attempting to access 'foo' within its own getter}} expected-note{{access 'self' explicitly to silence this warning}} {{14-14=self.}}
51
51
}
52
52
set{
53
-
foo = foo // expected-error {{assigning a property to itself}} expected-warning {{attempting to modify 'foo' within its own setter}} expected-note{{access 'self' explicitly to silence this warning}} {{7-7=self.}}
53
+
foo = foo // expected-error {{assigning a property to itself}} expected-warning {{attempting to modify 'foo' within its own setter}} expected-note{{access 'self' explicitly to silence this warning}} {{7-7=self.}} 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?}}
54
54
self.foo =self.foo // expected-error {{assigning a property to itself}}
55
55
foo =self.foo // expected-error {{assigning a property to itself}} expected-warning {{attempting to modify 'foo' within its own setter}} expected-note{{access 'self' explicitly to silence this warning}} {{7-7=self.}}
56
56
self.foo = foo // expected-error {{assigning a property to itself}}
Copy file name to clipboardExpand all lines: test/decl/var/usage.swift
+25Lines changed: 25 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -287,6 +287,22 @@ func sr964() {
287
287
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}}
288
288
}
289
289
}
290
+
structMemberGetterStruct{
291
+
varsuspiciousSetter:String{
292
+
get{return""}
293
+
set{
294
+
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}}
295
+
}
296
+
}
297
+
}
298
+
classMemberGetterClass{
299
+
varsuspiciousSetter: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
+
}
290
306
varnamedSuspiciousSetter:String{
291
307
get{return""}
292
308
set(parameter){
@@ -305,3 +321,12 @@ func sr964() {
305
321
}
306
322
}
307
323
}
324
+
structMemberGetterExtension{}
325
+
extensionMemberGetterExtension{
326
+
varsuspiciousSetter:String{
327
+
get{return""}
328
+
set{
329
+
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}}
0 commit comments