Skip to content

Commit c606d92

Browse files
Merge pull request #79247 from AnthonyLatsis/sepia-apama-6.1
[6.1] test: Add regression test for rdar://91922018
2 parents 995e9e0 + 2f5c3aa commit c606d92

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)