Skip to content

Commit 8bf1649

Browse files
committed
Add additional SILGen test for keypath-function subtype conversion
1 parent 755f260 commit 8bf1649

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

test/SILGen/keypaths.swift

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -649,7 +649,12 @@ struct CodingStackEntry {
649649

650650
struct Test {
651651
var codingStack: [CodingStackEntry]
652-
var codingPath: [any CodingKey] { codingStack.map(\.key) }
652+
// CHECK-LABEL: sil hidden [ossa] @{{.*}}codingPathAny
653+
var codingPathAny: [any CodingKey] { codingStack.map(\.key) }
654+
// CHECK: keypath $KeyPath<CodingStackEntry, URICoderCodingKey>, (root $CodingStackEntry; stored_property #CodingStackEntry.key : $URICoderCodingKey)
655+
656+
// CHECK-LABEL: sil hidden [ossa] @{{.*}}codingPathOpt
657+
var codingPathOpt: [URICoderCodingKey?] { codingStack.map(\.key) }
653658
// CHECK: keypath $KeyPath<CodingStackEntry, URICoderCodingKey>, (root $CodingStackEntry; stored_property #CodingStackEntry.key : $URICoderCodingKey)
654659
}
655660

0 commit comments

Comments
 (0)