|
| 1 | +// RUN: %target-swift-emit-silgen %s | %FileCheck %s |
| 2 | + |
| 3 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f13argySi1a_SiSg1bt_tF : $@convention(thin) (Int, Optional<Int>) -> () { |
| 4 | +func f1(arg: (a: Int, b: Int?)) { |
| 5 | + guard case let (x, y?) = arg else { return } |
| 6 | +} |
| 7 | + |
| 8 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f13argyyXl1a_yXlSg1bt_tF : $@convention(thin) (@guaranteed AnyObject, @guaranteed Optional<AnyObject>) -> () { |
| 9 | +func f1(arg: (a: AnyObject, b: AnyObject?)) { |
| 10 | + guard case let (x, y?) = arg else { return } |
| 11 | +} |
| 12 | + |
| 13 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f13argyyp1a_ypSg1bt_tF : $@convention(thin) (@in_guaranteed Any, @in_guaranteed Optional<Any>) -> () { |
| 14 | +func f1(arg: (a: Any, b: Any?)) { |
| 15 | + guard case let (x, y?) = arg else { return } |
| 16 | +} |
| 17 | + |
| 18 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f23argySi1a_Si1bt_tF : $@convention(thin) (Int, Int) -> () { |
| 19 | +func f2(arg: (a: Int, b: Int)) { |
| 20 | + guard case let (x, 4) = arg else { return } |
| 21 | +} |
| 22 | + |
| 23 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f23argySi1a_SS1bt_tF : $@convention(thin) (Int, @guaranteed String) -> () { |
| 24 | +func f2(arg: (a: Int, b: String)) { |
| 25 | + guard case let (x, "") = arg else { return } |
| 26 | +} |
| 27 | + |
| 28 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f33argySi1a_Si1bt_tF : $@convention(thin) (Int, Int) -> () { |
| 29 | +func f3(arg: (a: Int, b: Int)) { |
| 30 | + guard case let (x, is String) = arg else { return } |
| 31 | +} |
| 32 | + |
| 33 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f33argySi1a_yXl1bt_tF : $@convention(thin) (Int, @guaranteed AnyObject) -> () { |
| 34 | +func f3(arg: (a: Int, b: AnyObject)) { |
| 35 | + guard case let (x, is String) = arg else { return } |
| 36 | +} |
| 37 | + |
| 38 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f33argySi1a_yp1bt_tF : $@convention(thin) (Int, @in_guaranteed Any) -> () { |
| 39 | +func f3(arg: (a: Int, b: Any)) { |
| 40 | + guard case let (x, is String) = arg else { return } |
| 41 | +} |
| 42 | + |
| 43 | +// CHECK-LABEL: sil hidden [ossa] @$s34tuple_conversion_refutable_pattern2f43argySi1a_Sb1bt_tF : $@convention(thin) (Int, Bool) -> () { |
| 44 | +func f4(arg: (a: Int, b: Bool)) { |
| 45 | + guard case let (x, false) = arg else { return } |
| 46 | +} |
0 commit comments