Files
swift-mirror/test/Serialization/Inputs/inherited-conformance-base.swift
Dave Abrahams 6d1095f44e Protocol names end in "Type," "ible," or "able"
Mechanically add "Type" to the end of any protocol names that don't end
in "Type," "ible," or "able."  Also, drop "Type" from the end of any
associated type names, except for those of the *LiteralConvertible
protocols.

There are obvious improvements to make in some of these names, which can
be handled with separate commits.

Fixes <rdar://problem/17165920> Protocols `Integer` etc should get
uglier names.

Swift SVN r19883
2014-07-12 17:29:57 +00:00

20 lines
506 B
Swift

// Adopt ForwardIndexType via BidirectionalIndexType.
public struct Counter<T: protocol<RandomAccessIndexType, IntegerLiteralConvertible>> : BidirectionalIndexType {
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 }
}
public func == <T>(lhs: Counter<T>, rhs: Counter<T>) -> Bool {
return lhs.value == rhs.value
}