mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When we are printing Swift interface, we have to skip the override keyword if the overriden decl is invisible from the interface. Otherwise, an error will occur while building the Swift module because the overriding decl doesn't override anything. We couldn't skip every `override` keywords because they change the ABI if the overriden decl is also publicly visible. For public-override-internal case, having `override` doesn't have ABI implication. Thus we can skip them. rdar://58562780
15 lines
617 B
Swift
15 lines
617 B
Swift
// RUN: %empty-directory(%t)
|
|
// RUN: %target-swift-frontend -typecheck -module-name Foo -emit-module-interface-path %t/Foo.swiftinterface %s
|
|
// RUN: %target-swift-frontend -compile-module-from-interface %t/Foo.swiftinterface -o %t/Foo.swiftmodule
|
|
|
|
public class BaseClass {
|
|
var property: Int { return 1 }
|
|
func doSomething() { }
|
|
subscript(index: Int) -> Int { get { return 0 } set(newValue) {} }
|
|
}
|
|
public class DerivedClass: BaseClass {
|
|
public override var property : Int { return 0 }
|
|
public override func doSomething() { }
|
|
public override subscript(index: Int) -> Int { get {return 0} set(newValue) {} }
|
|
}
|