mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
The original bug here about not serializing base protocol conformances is unlikely to return, but I think this still captures the spirit of the original test: rely on a base protocol conformance without the model type ever referring to it. rdar://problem/25125727
17 lines
334 B
Swift
17 lines
334 B
Swift
import Lib
|
|
|
|
// Adopt SimpleProto via ComplexProto.
|
|
public struct Counter<T> : ComplexProto {
|
|
public var value = 0
|
|
|
|
public func predecessor() -> Counter {
|
|
return Counter(value: value - 1)
|
|
}
|
|
|
|
public func successor() -> Counter {
|
|
return Counter(value: value + 1)
|
|
}
|
|
|
|
public init(value: Int) { self.value = value }
|
|
}
|