mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
At some point I want to propose a revised model for exports, but for now just mark that support for '@exported' is still experimental and subject to change. (Thanks, Max.)
64 lines
1.2 KiB
Swift
64 lines
1.2 KiB
Swift
@_exported import def_class
|
|
|
|
public class OverrideComputedProperty : ComputedProperty {
|
|
public override var value : Int {
|
|
get {
|
|
return super.value + 1
|
|
}
|
|
set {
|
|
super.value = newValue
|
|
}
|
|
}
|
|
|
|
public override var readOnly : Int {
|
|
return super.readOnly + 1
|
|
}
|
|
|
|
public override init () { super.init() }
|
|
}
|
|
|
|
public class OverrideAddsSetter : ComputedProperty {
|
|
public override var readOnly : Int {
|
|
get { return 1 }
|
|
set { /* do nothing */ }
|
|
}
|
|
public override init () { super.init() }
|
|
}
|
|
|
|
public class OverrideSimpleSubscript : ReadonlySimpleSubscript {
|
|
public override subscript(x: Int) -> Bool {
|
|
return false
|
|
}
|
|
public override init () {}
|
|
}
|
|
|
|
public class OverrideAddsSubscriptSetter : ReadonlySimpleSubscript {
|
|
public override subscript(x: Int) -> Bool {
|
|
set(newValue) {
|
|
// do nothing!
|
|
}
|
|
get {
|
|
return super[x]
|
|
}
|
|
}
|
|
public override init () {}
|
|
}
|
|
|
|
public class OverrideComplexSubscript : ComplexSubscript {
|
|
public override subscript(x : Int, y : Bool) -> Int {
|
|
set(newValue) {
|
|
// do nothing!
|
|
}
|
|
get {
|
|
return super[x, y]
|
|
}
|
|
}
|
|
public override init () {}
|
|
}
|
|
|
|
public class OverrideFunc : StillEmpty {
|
|
public override func reset() {
|
|
}
|
|
public override init () {}
|
|
}
|