Skip to content

Commit 4473cb8

Browse files
committed
[Test] Update fix-it range for test case and add comments
1 parent 6665e71 commit 4473cb8

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

test/decl/ext/extensions.swift

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ extension DoesNotImposeClassReq_1 where Self: JustAClass {
157157
wrappingProperty3 = "" // Okay
158158
}
159159

160-
func bar() { // expected-note {{mark method 'mutating' to make 'self' mutable}}{{2-2=mutating }}
160+
func bar() { // expected-note {{mark method 'mutating' to make 'self' mutable}}{{3-3=mutating }}
161161
property = "" // Okay
162162
wrappingProperty1 = "" // Okay
163163
wrappingProperty2 = "" // Okay
@@ -178,6 +178,7 @@ instanceOfJustAClass1.wrappingProperty2 = "" // Okay
178178
instanceOfJustAClass1.wrappingProperty3 = "" // expected-error {{cannot assign to property: 'instanceOfJustAClass1' is a 'let' constant}}
179179
instanceOfJustAClass1.foo() // expected-error {{cannot use mutating member on immutable value: 'instanceOfJustAClass1' is a 'let' constant}}
180180
instanceOfJustAClass1.bar() // Okay
181+
instanceOfJustAClass1.baz() // Okay
181182

182183
var instanceOfJustAClass2 = JustAClass()
183184
instanceOfJustAClass2.foo() // Okay
@@ -204,22 +205,22 @@ extension DoesNotImposeClassReq_2 where Self : AnyObject {
204205

205206
mutating func foo() {
206207
property = "" // Okay
207-
wrappingProperty1 = "" // Okay
208-
wrappingProperty2 = "" // Okay
208+
wrappingProperty1 = "" // Okay (the error is on the setter declaration above)
209+
wrappingProperty2 = "" // Okay (the error is on the setter declaration above)
209210
wrappingProperty3 = "" // Okay
210211
}
211212

212-
func bar() { // expected-note 2{{mark method 'mutating' to make 'self' mutable}}{{2-2=mutating }}
213+
func bar() { // expected-note 2{{mark method 'mutating' to make 'self' mutable}}{{3-3=mutating }}
213214
property = "" // expected-error {{cannot assign to property: 'self' is immutable}}
214-
wrappingProperty1 = "" // Okay
215-
wrappingProperty2 = "" // Okay
215+
wrappingProperty1 = "" // Okay (the error is on the setter declaration above)
216+
wrappingProperty2 = "" // Okay (the error is on the setter declaration above)
216217
wrappingProperty3 = "" // expected-error {{cannot assign to property: 'self' is immutable}}
217218
}
218219

219220
nonmutating func baz() { // expected-note 2{{mark method 'mutating' to make 'self' mutable}}
220221
property = "" // expected-error {{cannot assign to property: 'self' is immutable}}
221-
wrappingProperty1 = "" // Okay
222-
wrappingProperty2 = "" // Okay
222+
wrappingProperty1 = "" // Okay (the error is on the setter declaration above)
223+
wrappingProperty2 = "" // Okay (the error is on the setter declaration above)
223224
wrappingProperty3 = "" // expected-error {{cannot assign to property: 'self' is immutable}}
224225
}
225226
}

0 commit comments

Comments
 (0)