Skip to content

Commit

Permalink
[Test] Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
theblixguy committed Sep 6, 2019
1 parent 3146eed commit fc6a49e
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions test/decl/ext/extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ struct WrapperContext {
}

// Class-constrained extension where protocol does not impose class requirement

// SR-11298
protocol DoesNotImposeClassReq_1 {}

class JustAClass: DoesNotImposeClassReq_1 {
Expand All @@ -140,8 +140,8 @@ extension DoesNotImposeClassReq_1 where Self: JustAClass {
}
}

let instanceOfJustAClass = JustAClass() // expected-note {{change 'let' to 'var' to make it mutable}}
instanceOfJustAClass.wrappingProperty = "" // expected-error {{cannot assign to property: 'instanceOfJustAClass' is a 'let' constant}}
let instanceOfJustAClass = JustAClass()
instanceOfJustAClass.wrappingProperty = "" // Okay

protocol DoesNotImposeClassReq_2 {
var property: String { get set }
Expand All @@ -150,6 +150,7 @@ protocol DoesNotImposeClassReq_2 {
extension DoesNotImposeClassReq_2 where Self : AnyObject {
var wrappingProperty: String {
get { property }
set { property = newValue } // Okay
set { property = newValue } // expected-error {{cannot assign to property: 'self' is immutable}}
// expected-note@-1 {{mark accessor 'mutating' to make 'self' mutable}}
}
}

0 comments on commit fc6a49e

Please sign in to comment.