Files
swift-mirror/test/NameBinding/Inputs/objc_multi_file_2.swift
John McCall afdda3d107 Implement SE-0117.
One minor revision: this lifts the proposed restriction against
overriding a non-open method with an open one.  On reflection,
that was inconsistent with the existing rule permitting non-public
methods to be overridden with public ones.  The restriction on
subclassing a non-open class with an open class remains, and is
in fact consistent with the existing access rule.
2016-08-02 07:46:38 -07:00

45 lines
921 B
Swift

import Foundation
#if FAKE_UIIMAGE
class UIImage : NSObject { }
@objc
protocol ImagePresentingView {
var hidden: Bool { @objc(isHidden) get set }
}
#endif
extension UIImage : ImagePresentingView {
var hidden: Bool {
@objc(isHidden) get { return true }
set { }
}
}
open class SuperA : NSObject {
public init(foo: Int) {
super.init()
}
}
open class SuperB : NSObject {
public init(foo: String) { super.init() }
public init(bar: String) { super.init() }
public convenience init(wibble: String) { self.init(foo: wibble) }
}
open class SubB : SuperB {
public override init(bar: String) { super.init(bar: bar) }
}
// rdar://problem/19941580
public class Foo : NSObject, FooProto {
public static var staticEntityName: String = "yo"
public var entityName: String = "yo"
}
@objc public protocol FooProto {
static var staticEntityName: String { get }
var entityName: String { get }
}