Files
swift-mirror/validation-test/Evolution/Inputs/superclass_methods.swift
David Farler 7229ce29df Convert resilient superclass dispatch tests to StdlibUnittest
Also run the full product of before/after combinations.
2016-01-15 22:22:26 -08:00

75 lines
1.5 KiB
Swift

public func getVersion() -> Int {
#if BEFORE
return 0
#else
return 1
#endif
}
public class Base {
public init() {}
public func method() -> String {
return "Base.method()"
}
public class func classMethod() -> String {
return "Base.classMethod()"
}
}
public class OtherBase {
public init() {}
public func method() -> String {
return "OtherBase.method()"
}
public class func classMethod() -> String {
return "OtherBase.classMethod()"
}
}
public class InBetween : Base {
public override func method() -> String {
return "InBetween.method()"
}
public override class func classMethod() -> String {
return "InBetween.classMethod()"
}
}
#if BEFORE
public class AddInterposingMethod : Base {}
#else
public class AddInterposingMethod : Base {
public override func method() -> String {
return "AddInterposingMethod.method()"
}
public override class func classMethod() -> String {
return "AddInterposingMethod.classMethod()"
}
}
#endif
#if BEFORE
public class RemoveInterposingMethod : Base {
public override func method() -> String {
return "RemoveInterposingMethod.method()"
}
public override class func classMethod() -> String {
return "RemoveInterposingMethod.classMethod()"
}
}
#else
public class RemoveInterposingMethod : Base {}
#endif
#if BEFORE
public class InsertSuperclass : Base {}
#else
public class InsertSuperclass : InBetween {}
#endif
#if BEFORE
public class ChangeRoot : Base {}
#else
public class ChangeRoot : OtherBase {}
#endif