Files
swift-mirror/validation-test/Evolution/Inputs/class_add_override.swift
Slava Pestov 8de76da8e9 Add library evolution test for part of vtable resilience
Subclasses of resilient and generic classes now dynamically initialize
the vtable by copying the vtable from the superclass, and filling in
method overrides.

This means we no longer emit references to the base class's methods
statically, which allows the base class to add or remove an overload
resiliently without invalidating vtables of subclasses already
compiled.

Note that we still don't know how to slide subclass metadata when
the size of superclass metadata changes, so we can't resiliently
add or remove vtable entries yet.
2017-08-24 19:15:43 -07:00

39 lines
576 B
Swift

public func getVersion() -> Int {
#if BEFORE
return 0
#else
return 1
#endif
}
open class AddOverrideBase {
public init() {}
public var description: String {
return "Base"
}
}
#if BEFORE
open class AddOverrideGeneric<T> : AddOverrideBase {}
open class AddOverrideConcrete : AddOverrideBase {}
#else
open class AddOverrideGeneric<T> : AddOverrideBase {
override public var description: String {
return "Generic"
}
}
open class AddOverrideConcrete : AddOverrideBase {
override public var description: String {
return "Concrete"
}
}
#endif