forked from swiftlang/swift
- Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathexistential-class-bound6.swift
34 lines (29 loc) · 1.05 KB
/
existential-class-bound6.swift
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
// RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo) | %FileCheck %s
// RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo -O) | %FileCheck %s
// RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -wmo -Osize) | %FileCheck %s
// REQUIRES: swift_in_compiler
// REQUIRES: executable_test
// REQUIRES: optimized_stdlib
// REQUIRES: swift_feature_Embedded
publicvarglobal:AnyObject?=nil
func test(anyObject:AnyObject){
global = anyObject
}
classMyClass{}
classMyOtherClass{}
protocolMyProto:AnyObject{}
extensionMyClass:MyProto{}
extensionMyOtherClass:MyProto{}
@main
structMain{
staticfunc main(){
test(anyObject:MyClass())
test(anyObject:MyOtherClass())
test(anyObject:MyClass()asAnyObject)
test(anyObject:MyOtherClass()asAnyObject)
test(anyObject:MyClass()asMyProto)
test(anyObject:MyOtherClass()asMyProto)
print("OK!")
// CHECK: OK!
}
}