mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
14 lines
479 B
Swift
14 lines
479 B
Swift
// RUN: %target-swift-frontend -emit-ir -verify %s -parse-stdlib -enable-experimental-feature Embedded -wmo -disable-embedded-existentials
|
|
|
|
// REQUIRES: swift_in_compiler
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
// This is only an error if we disable support for existentials in embedded.
|
|
|
|
public protocol Player {}
|
|
struct Concrete: Player {}
|
|
|
|
public func test() -> any Player {
|
|
Concrete() // expected-error {{cannot use a value of protocol type 'any Player' in embedded Swift}}
|
|
}
|