mirror of
https://github.com/apple/swift.git
synced 2026-06-20 15:42:51 +02:00
aad51cab01
Support for existentials in Embedded Swift has been available for a little while now and appears to be solid. Remove the ability to disable them (via `-disable-experimental-feature EmbeddedExistentials`), both because it simplifies the code and because it's an ABI break to disable the feature.
28 lines
551 B
Swift
28 lines
551 B
Swift
// RUN: %target-swift-emit-ir -parse-as-library -module-name main -verify %s -enable-experimental-feature Embedded -wmo
|
|
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
protocol ClassBound: AnyObject {
|
|
func foo()
|
|
}
|
|
|
|
protocol OtherProtocol {
|
|
func bar()
|
|
}
|
|
|
|
class MyClass: ClassBound, OtherProtocol {
|
|
func foo() { print("MyClass.foo()") }
|
|
func bar() { print("MyClass.bar()") }
|
|
}
|
|
|
|
// Currently we don't support this
|
|
func test(existential: any ClassBound & OtherProtocol) {
|
|
}
|
|
|
|
@main
|
|
struct Main {
|
|
static func main() {
|
|
test(existential: MyClass())
|
|
}
|
|
}
|