mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
20 lines
561 B
Swift
20 lines
561 B
Swift
// RUN: %target-typecheck-verify-swift -swift-version 4
|
|
|
|
// https://github.com/apple/swift/issues/43310
|
|
// In version 4 and earlier all of these should build with no diagnostic.
|
|
class Mario {
|
|
func getFriend() -> Self { return self }
|
|
func getEnemy() -> Mario { return self }
|
|
}
|
|
class SuperMario : Mario {
|
|
override func getFriend() -> SuperMario {
|
|
return SuperMario()
|
|
}
|
|
override func getEnemy() -> Self { return self }
|
|
}
|
|
final class FinalMario : Mario {
|
|
override func getFriend() -> FinalMario {
|
|
return FinalMario()
|
|
}
|
|
}
|