Skip to content

Commit 09067cf

Browse files
committed
[Test] Check if the fix-its are being offered and being correctly applied
1 parent e18a49a commit 09067cf

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

test/decl/ext/extensions.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ extension DoesNotImposeClassReq_1 where Self: JustAClass {
164164
wrappingProperty3 = "" // expected-error {{cannot assign to property: 'self' is immutable}}
165165
}
166166

167-
nonmutating func baz() { // expected-note {{mark method 'mutating' to make 'self' mutable}}
167+
nonmutating func baz() { // expected-note {{mark method 'mutating' to make 'self' mutable}}{{3-14=mutating}}
168168
property = "" // Okay
169169
wrappingProperty1 = "" // Okay
170170
wrappingProperty2 = "" // Okay
@@ -191,11 +191,13 @@ extension DoesNotImposeClassReq_2 where Self : AnyObject {
191191
var wrappingProperty1: String {
192192
get { property }
193193
set { property = newValue } // expected-error {{cannot assign to property: 'self' is immutable}}
194+
// expected-note@-1 {{mark accessor 'mutating' to make 'self' mutable}}{{5-5=mutating }}
194195
}
195196

196197
var wrappingProperty2: String {
197198
get { property }
198199
nonmutating set { property = newValue } // expected-error {{cannot assign to property: 'self' is immutable}}
200+
// expected-note@-1 {{mark accessor 'mutating' to make 'self' mutable}}{{5-16=mutating}}
199201
}
200202

201203
var wrappingProperty3: String {
@@ -217,7 +219,7 @@ extension DoesNotImposeClassReq_2 where Self : AnyObject {
217219
wrappingProperty3 = "" // expected-error {{cannot assign to property: 'self' is immutable}}
218220
}
219221

220-
nonmutating func baz() { // expected-note 2{{mark method 'mutating' to make 'self' mutable}}
222+
nonmutating func baz() { // expected-note 2{{mark method 'mutating' to make 'self' mutable}}{{3-14=mutating}}
221223
property = "" // expected-error {{cannot assign to property: 'self' is immutable}}
222224
wrappingProperty1 = "" // Okay (the error is on the setter declaration above)
223225
wrappingProperty2 = "" // Okay (the error is on the setter declaration above)

0 commit comments

Comments
 (0)