// RUN: %target-run-simple-swift(-enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck %s // RUN: %target-run-simple-swift(-Osize -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck %s // REQUIRES: swift_in_compiler // REQUIRES: executable_test // REQUIRES: optimized_stdlib // REQUIRES: OS=macosx || OS=linux-gnu protocol Fooable { func foo() } class GenericFooableClass: Fooable { func foo() { print("GenericFooableClass.foo") } } class GenericFooableSubClass: GenericFooableClass { override func foo() { print("GenericFooableSubClass.foo") } } func makeItFoo(f: F) { f.foo() } class BaseClass { func test() {} } class SubClass1: BaseClass { override func test() {} } class SubClass2 : SubClass1 { override func test() { print("SubClass2") } } public class Outer { public class Inner { func foo() { print("Inner.foo") } } } public func makeInner() -> Outer.Inner { return Outer.Inner() } @main struct Main { static func main() { let f = GenericFooableClass() makeItFoo(f: f) let g: GenericFooableClass = GenericFooableSubClass() makeItFoo(f: g) let x = SubClass2() x.test() makeInner().foo() } } // CHECK: GenericFooableClass.foo // CHECK: GenericFooableSubClass.foo // CHECK: SubClass2 // CHECK: Inner.foo