Skip to content

Commit 8b11223

Browse files
committed
Add regression test for https://bugs.swift.org/browse/SR-4571
1 parent 39f392c commit 8b11223

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
3+
func add(_ a: Int, _ b: Int) throws -> Int {
4+
return a + b
5+
}
6+
7+
func add(_ a: Int, _ b: Int) -> Float {
8+
return Float(a + b)
9+
}
10+
11+
func useAdd() {
12+
guard let c: Float = try? add(3, 4) else {
13+
return
14+
}
15+
print(c)
16+
}

0 commit comments

Comments
 (0)