Skip to content

Commit 2f5c3aa

Browse files
committed
test: Add regression test for rdar://91922018
1 parent 707ea39 commit 2f5c3aa

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

test/Constraints/opened_existentials.swift

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -423,3 +423,19 @@ func nestedMetatypeCaller() {
423423
let t = String.Type.Type.Type.self as (any Q.Type.Type.Type.Type)
424424
nestedMetatypeCallee(t)
425425
}
426+
427+
// rdar://91922018
428+
do {
429+
func f<E>(_ c: some Collection<E>) -> some Collection<E> {
430+
return c
431+
}
432+
let c: any Collection<Int>
433+
let result = f(c)
434+
do {
435+
struct G<T> {
436+
init(_: T) {}
437+
}
438+
let t = G(result)
439+
let _: G<any Collection<Int>> = t
440+
}
441+
}

0 commit comments

Comments
 (0)