blob: 095734354c072c6b939bd355a8db4f08aecbbc7f [file] [log] [blame]
// RUN: %empty-directory(%t)
// RUN: %target-build-swift -O -module-name=test %s -o %t/a.out
// RUN: %target-codesign %t/a.out
// RUN: %target-run %t/a.out | %FileCheck %s
// REQUIRES: executable_test
class Base {
required init() { }
class func instance() -> Base {
return self.init()
}
}
class Middle: Base {
override class func instance() -> Middle {
return self.init()
}
}
class Derived: Middle {
required init() {
super.init()
print("init Derived")
}
}
struct Maker<C: Base> {
@inline(never)
static func create() -> Base {
return C.instance()
}
}
// CHECK: init Derived
// CHECK: test.Derived
print(Maker<Derived>.create())