Skip to content

Commit 4f5078d

Browse files
committed
---
yaml --- r: 349369 b: refs/heads/master-next c: a6c5944 h: refs/heads/master i: 349367: 28469a3
1 parent 7f99515 commit 4f5078d

File tree

4 files changed

+8
-7
lines changed

4 files changed

+8
-7
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
---
22
refs/heads/master: 3574c513bbc5578dd9346b4ea9ab5995c5927bb5
3-
refs/heads/master-next: 3ce02335c6f0e14aa486489da06bf498d6fbea31
3+
refs/heads/master-next: a6c5944f929013f6c5ccd9ebe454f74142d3bc6d
44
refs/tags/osx-passed: b6b74147ef8a386f532cf9357a1bde006e552c54
55
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-a: 6bb18e013c2284f2b45f5f84f2df2887dc0f7dea
66
refs/tags/swift-2.2-SNAPSHOT-2015-12-01-b: 66d897bfcf64a82cb9a87f5e663d889189d06d07

branches/master-next/lib/Sema/CSGen.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1060,7 +1060,8 @@ namespace {
10601060

10611061
// Add the member constraint for a subscript declaration.
10621062
// FIXME: weak name!
1063-
auto memberTy = CS.createTypeVariable(memberLocator, TVO_CanBindToNoEscape);
1063+
auto memberTy = CS.createTypeVariable(
1064+
memberLocator, TVO_CanBindToLValue | TVO_CanBindToNoEscape);
10641065

10651066
// FIXME: synthesizeMaterializeForSet() wants to statically dispatch to
10661067
// a known subscript here. This might be cleaner if we split off a new

branches/master-next/lib/Sema/CSSimplify.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2059,12 +2059,12 @@ ConstraintSystem::matchTypesBindTypeVar(
20592059
type.visit([&](Type t) {
20602060
if (auto *tvt = dyn_cast<TypeVariableType>(t.getPointer())) {
20612061
if (!typeVar->getImpl().canBindToLValue()) {
2062-
typeVar->getImpl().setCanBindToLValue(getSavedBindings(),
2063-
/*enabled=*/false);
2062+
tvt->getImpl().setCanBindToLValue(getSavedBindings(),
2063+
/*enabled=*/false);
20642064
}
20652065
if (!typeVar->getImpl().canBindToNoEscape()) {
2066-
typeVar->getImpl().setCanBindToNoEscape(getSavedBindings(),
2067-
/*enabled=*/false);
2066+
tvt->getImpl().setCanBindToNoEscape(getSavedBindings(),
2067+
/*enabled=*/false);
20682068
}
20692069
}
20702070
});

branches/master-next/test/attr/attr_dynamic_member_lookup.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,7 @@ struct WithTrailingClosure {
619619

620620
func keypath_with_trailing_closure_subscript(_ ty: inout SubscriptLens<WithTrailingClosure>) {
621621
_ = 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}}
623623
// expected-error@-1 {{subscript index of type '() -> Int' in a key path must be Hashable}}
624624
_ = ty[] { 42 } // expected-error {{subscript index of type '() -> Int' in a key path must be Hashable}}
625625
_ = ty[] { 42 } = 0 // expected-error {{subscript index of type '() -> Int' in a key path must be Hashable}}

0 commit comments

Comments
 (0)