Files
swift-mirror/test/SILOptimizer/gh61041.swift
2024-01-23 22:23:13 -08:00

30 lines
655 B
Swift

// 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])
}
}
}