Skip to content

[Typechecker] Reapply fix for SR-11298 #27639

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 12 commits into from
Oct 15, 2019
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
[Test] Check if the fix-its are being offered and being correctly app…
…lied
  • Loading branch information
theblixguy committed Oct 15, 2019
commit 09067cf3b39aa7f02b355ac4d9be98e5c22fbd3d
6 changes: 4 additions & 2 deletions test/decl/ext/extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ extension DoesNotImposeClassReq_1 where Self: JustAClass {
wrappingProperty3 = "" // expected-error {{cannot assign to property: 'self' is immutable}}
}

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

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

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

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