Skip to content

Commit 0fa62dd

Browse files
committed
[NFC] Add a test case for SR-12365
1 parent 5e7bafc commit 0fa62dd

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

test/Constraints/sr12365.swift

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// RUN: %target-swift-frontend -typecheck -verify %s
2+
3+
public protocol MyProtocol {}
4+
5+
public struct MyProtocolImpl: MyProtocol {}
6+
7+
public func != (lhs: MyProtocol, rhs: MyProtocol) -> MyProtocolImpl {
8+
return MyProtocolImpl()
9+
}
10+
11+
public func && (lhs: MyProtocol, rhs: MyProtocol) -> MyProtocolImpl {
12+
return MyProtocolImpl()
13+
}
14+
15+
func check(a: Double, b: Int64) -> Bool {
16+
return a != 0 && b != 0 // Okay
17+
}
18+
19+
func check() {
20+
let x: Int = 1
21+
let _ = UInt(1) << x - 1 // Okay
22+
let _ = UInt(1) << (x + 1) - 1 // Okay
23+
}

0 commit comments

Comments
 (0)