mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
Sema: Allow overrides to be unavailable in the current Swift language mode.
Fixes a regression from https://github.com/swiftlang/swift/pull/83354. Resolves rdar://158262522
This commit is contained in:
@@ -239,7 +239,6 @@ func testOverrideOfUnavailableDeclFromUnavailableDerivedType() {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
func testImplicitSuperInit() {
|
||||
// FIXME: The diagnostics for the implicit call to super.init() could be
|
||||
// relaxed since both initializers are unreachable and the developer cannot
|
||||
@@ -256,3 +255,19 @@ func testImplicitSuperInit() {
|
||||
// expected-note@-2 {{call to unavailable initializer 'init()' from superclass 'Base' occurs implicitly at the end of this initializer}}
|
||||
}
|
||||
}
|
||||
|
||||
func testUnavailableInSwiftOverrides() {
|
||||
class Base {
|
||||
func availableMethod() {}
|
||||
}
|
||||
|
||||
class Derived1: Base {
|
||||
@available(swift, introduced: 99)
|
||||
override func availableMethod() {}
|
||||
}
|
||||
|
||||
class Derived2: Base {
|
||||
@available(swift, obsoleted: 1)
|
||||
override func availableMethod() {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user