File tree Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Expand file tree Collapse file tree 1 file changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ // RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo) | %FileCheck %s
2+ // RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo -O) | %FileCheck %s
3+ // RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo -Osize) | %FileCheck %s
4+
5+ // REQUIRES: swift_in_compiler
6+ // REQUIRES: executable_test
7+ // REQUIRES: optimized_stdlib
8+ // REQUIRES: OS=macosx || OS=linux-gnu
9+
10+ protocol ClassBound : AnyObject {
11+ func foo( )
12+ }
13+
14+ protocol OtherProtocol : AnyObject {
15+ func bar( )
16+ }
17+
18+ class MyClass : ClassBound , OtherProtocol {
19+ func foo( ) { print ( " MyClass.foo() " ) }
20+ func bar( ) { print ( " MyClass.bar() " ) }
21+ }
22+
23+ func test( existential: any ClassBound & OtherProtocol ) {
24+ existential. foo ( )
25+ existential. bar ( )
26+ }
27+
28+ @main
29+ struct Main {
30+ static func main( ) {
31+ test ( existential: MyClass ( ) )
32+ // CHECK: MyClass.foo()
33+ // CHECK: MyClass.bar()
34+ }
35+ }
You can’t perform that action at this time.
0 commit comments