mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
We want to be able to use these typealiases both as existential types and as generic constraints, so unwrap the ExistentialType explicitly before setting the underlying type of the typealias. This might not be the best long-term approach, so I added a FIXME comment with my thoughts there. Fixes rdar://problem/88208893.
15 lines
516 B
Swift
15 lines
516 B
Swift
// RUN: %target-typecheck-verify-swift %clang-importer-sdk -enable-objc-interop -import-objc-header %S/Inputs/explicit_existential.h
|
|
|
|
// Make sure that 'typedef id<P, Q> PAndQ' imports as a typealias without
|
|
// the ExistentialType wrapping the underlying type.
|
|
|
|
protocol InheritsFromQAndQ : PAndQ {}
|
|
|
|
func genericOverPAndQ<T : PAndQ>(_: T) {}
|
|
|
|
func takesSequenceOfPAndQ<T : Sequence>(_: T) where T.Element : PAndQ {}
|
|
|
|
func takesPAndQExistential(_ x: PAndQ) {
|
|
let b = PAndQProcessor()
|
|
b.takesPAndQExistential(x)
|
|
} |