Skip to content

Commit 2ce1b2b

Browse files
committed
test coverage for GH #61041
1 parent a44f5ba commit 2ce1b2b

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

test/SILOptimizer/gh61041.swift

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// RUN: %target-swift-frontend %s -emit-sil -sil-verify-all > /dev/null
2+
// RUN: %target-swift-frontend %s -emit-sil -sil-verify-all -O > /dev/null
3+
4+
// https://github.com/apple/swift/issues/61041
5+
6+
public struct S<T>
7+
{
8+
}
9+
extension S<Int?>
10+
{
11+
public mutating
12+
func foo(x:inout [Int: Int])
13+
{
14+
for _:Int in 0 ... 1
15+
{
16+
if let y:Int? = 0 as Int??
17+
{
18+
if case 0? = y
19+
{
20+
continue
21+
}
22+
}
23+
else if case 0? = 0 as Int?
24+
{
25+
continue
26+
}
27+
{ _ in }(&x[0, default: 0])
28+
}
29+
}
30+
}

0 commit comments

Comments
 (0)