Add additional SILGen test for keypath-function subtype conversion

This commit is contained in:
Freddy Kellison-Linn
2024-03-02 12:44:49 -05:00
parent 755f2607c3
commit 8bf16493f9

View File

@@ -649,7 +649,12 @@ struct CodingStackEntry {
struct Test {
var codingStack: [CodingStackEntry]
var codingPath: [any CodingKey] { codingStack.map(\.key) }
// CHECK-LABEL: sil hidden [ossa] @{{.*}}codingPathAny
var codingPathAny: [any CodingKey] { codingStack.map(\.key) }
// CHECK: keypath $KeyPath<CodingStackEntry, URICoderCodingKey>, (root $CodingStackEntry; stored_property #CodingStackEntry.key : $URICoderCodingKey)
// CHECK-LABEL: sil hidden [ossa] @{{.*}}codingPathOpt
var codingPathOpt: [URICoderCodingKey?] { codingStack.map(\.key) }
// CHECK: keypath $KeyPath<CodingStackEntry, URICoderCodingKey>, (root $CodingStackEntry; stored_property #CodingStackEntry.key : $URICoderCodingKey)
}