Skip to content

Commit

Permalink
Merge pull request apple#71109 from kavon/test-coverage-linearlifetim…
Browse files Browse the repository at this point in the history
…echecker

test coverage for GH apple#61041
  • Loading branch information
kavon committed Jan 24, 2024
2 parents 3a8e31d + 2ce1b2b commit 0c4efe4
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions test/SILOptimizer/gh61041.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
// RUN: %target-swift-frontend %s -emit-sil -sil-verify-all > /dev/null
// RUN: %target-swift-frontend %s -emit-sil -sil-verify-all -O > /dev/null

// https://github.com/apple/swift/issues/61041

public struct S<T>
{
}
extension S<Int?>
{
public mutating
func foo(x:inout [Int: Int])
{
for _:Int in 0 ... 1
{
if let y:Int? = 0 as Int??
{
if case 0? = y
{
continue
}
}
else if case 0? = 0 as Int?
{
continue
}
{ _ in }(&x[0, default: 0])
}
}
}

0 comments on commit 0c4efe4

Please sign in to comment.