Files
swift-mirror/test/embedded/existential-composition.swift
Doug Gregor aad51cab01 [Embedded] Remove the ability to disable existentials in Embedded Swift
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.
2026-04-17 17:38:01 -07:00

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())
}
}