File tree Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Expand file tree Collapse file tree 2 files changed +3
-2
lines changed Original file line number Diff line number Diff line change @@ -1060,7 +1060,8 @@ namespace {
1060
1060
1061
1061
// Add the member constraint for a subscript declaration.
1062
1062
// FIXME: weak name!
1063
- auto memberTy = CS.createTypeVariable (memberLocator, TVO_CanBindToNoEscape);
1063
+ auto memberTy = CS.createTypeVariable (
1064
+ memberLocator, TVO_CanBindToLValue | TVO_CanBindToNoEscape);
1064
1065
1065
1066
// FIXME: synthesizeMaterializeForSet() wants to statically dispatch to
1066
1067
// a known subscript here. This might be cleaner if we split off a new
Original file line number Diff line number Diff line change @@ -619,7 +619,7 @@ struct WithTrailingClosure {
619
619
620
620
func keypath_with_trailing_closure_subscript( _ ty: inout SubscriptLens < WithTrailingClosure > ) {
621
621
_ = ty [ 0 ] { 42 } // expected-error {{subscript index of type '() -> Int' in a key path must be Hashable}}
622
- _ = ty [ 0 ] { 42 } = 0
622
+ _ = ty [ 0 ] { 42 } = 0 // expected-error {{cannot assign through subscript: subscript is get-only}}
623
623
// expected-error@-1 {{subscript index of type '() -> Int' in a key path must be Hashable}}
624
624
_ = ty [ ] { 42 } // expected-error {{subscript index of type '() -> Int' in a key path must be Hashable}}
625
625
_ = ty [ ] { 42 } = 0 // expected-error {{subscript index of type '() -> Int' in a key path must be Hashable}}
You can’t perform that action at this time.
0 commit comments