mirror of
https://github.com/apple/swift.git
synced 2026-02-27 18:26:24 +01:00
Before: ``` Total Discovered Tests: 255 Unsupported : 100 (39.22%) Passed : 154 (60.39%) Expectedly Failed: 1 (0.39%) ``` After: ``` Total Discovered Tests: 255 Unsupported : 41 (16.08%) Passed : 210 (82.35%) Expectedly Failed: 4 (1.57%) ``` Work in progress on https://github.com/swiftlang/swift/issues/83482. rdar://157304207
50 lines
1.0 KiB
Swift
50 lines
1.0 KiB
Swift
// RUN: %target-run-simple-swift(-g -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck %s
|
|
// RUN: %target-run-simple-swift(-g -Osize -enable-experimental-feature Embedded -parse-as-library -runtime-compatibility-version none -wmo -Xfrontend -disable-objc-interop) | %FileCheck %s
|
|
|
|
// REQUIRES: executable_test
|
|
// REQUIRES: optimized_stdlib
|
|
// REQUIRES: OS=macosx || OS=linux-gnu || OS=wasip1
|
|
// REQUIRES: swift_feature_Embedded
|
|
|
|
struct User {
|
|
let o: BaseClass
|
|
}
|
|
|
|
class BaseClass {
|
|
func foo() {}
|
|
}
|
|
|
|
protocol Protocol {
|
|
func protofoo()
|
|
}
|
|
|
|
class Implementor: Protocol {
|
|
func protofoo() { print("Implementor.protofoo") }
|
|
}
|
|
|
|
class GenericSubClass<P: Protocol>: BaseClass {
|
|
let p: P
|
|
|
|
init(p: P) {
|
|
self.p = p
|
|
}
|
|
|
|
override func foo() {
|
|
let x = { self.p.protofoo() }
|
|
x()
|
|
}
|
|
}
|
|
|
|
@main
|
|
struct Main {
|
|
static func main() {
|
|
let p = Implementor()
|
|
let o = GenericSubClass(p: p)
|
|
let user = User(o: o)
|
|
user.o.foo()
|
|
}
|
|
}
|
|
|
|
// CHECK: Implementor.protofoo
|
|
|