Skip to content

Commit e2bd467

Browse files
committed
---
yaml --- r: 349455 b: refs/heads/master-next c: ac53a28 h: refs/heads/master i: 349453: 23fc1d2 349451: 3e03f93 349447: bab91bc 349439: 5ea090b
1 parent 3eb830c commit e2bd467

File tree

3 files changed

+20
-2
lines changed

3 files changed

+20
-2
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: f3f5194bcd8be7cce7657718be51a3d663e39108
3+
refs/heads/master-next: ac53a288b214f791e9538f5994b7d25c28a2970c
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/TypeCheckExpr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,7 @@ namespace {
416416
if (!group) return false;
417417
if (storedGroup == group) return !GroupAndIsStrict.getInt();
418418
return TC.Context.associateInfixOperators(group, storedGroup)
419-
== Associativity::Left;
419+
!= Associativity::Right;
420420
}
421421
};
422422
} // end anonymous namespace

branches/master-next/test/Constraints/operator.swift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,3 +237,21 @@ func sr10843() {
237237
(^^^)(s, s)
238238
_ = (==)(0, 0)
239239
}
240+
241+
// SR-10970
242+
precedencegroup PowerPrecedence {
243+
lowerThan: BitwiseShiftPrecedence
244+
higherThan: AdditionPrecedence
245+
associativity: right
246+
}
247+
infix operator ^^ : PowerPrecedence
248+
249+
extension Int {
250+
static func ^^ (lhs: Int, rhs: Int) -> Int {
251+
var result = 1
252+
for _ in 1...rhs { result *= lhs }
253+
return result
254+
}
255+
}
256+
257+
_ = 1 ^^ 2 ^^ 3 * 4 // expected-error {{adjacent operators are in unordered precedence groups 'PowerPrecedence' and 'MultiplicationPrecedence'}}

0 commit comments

Comments
 (0)