Skip to content

Commit 7223471

Browse files
committed
warning: Redundant superclass constraints
- Remove unneeded constraints that are inferred.
1 parent 94649cf commit 7223471

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

Foundation/Measurement.swift

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ extension Measurement where UnitType : Dimension {
7575
/// Add two measurements of the same Unit.
7676
/// - precondition: The `unit` of `lhs` and `rhs` must be `isEqual`.
7777
/// - returns: A measurement of value `lhs.value + rhs.value` and unit `lhs.unit`.
78-
public func +<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Measurement<UnitType> {
78+
public func +<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Measurement<UnitType> {
7979
if lhs.unit.isEqual(rhs.unit) {
8080
return Measurement(value: lhs.value + rhs.value, unit: lhs.unit)
8181
} else {
@@ -100,7 +100,7 @@ public func +<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measurement
100100
/// Subtract two measurements of the same Unit.
101101
/// - precondition: The `unit` of `lhs` and `rhs` must be `isEqual`.
102102
/// - returns: A measurement of value `lhs.value - rhs.value` and unit `lhs.unit`.
103-
public func -<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Measurement<UnitType> {
103+
public func -<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Measurement<UnitType> {
104104
if lhs.unit.isEqual(rhs.unit) {
105105
return Measurement(value: lhs.value - rhs.value, unit: lhs.unit)
106106
} else {
@@ -124,31 +124,31 @@ public func -<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measurement
124124

125125
/// Multiply a measurement by a scalar value.
126126
/// - returns: A measurement of value `lhs.value * rhs` with the same unit as `lhs`.
127-
public func *<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Double) -> Measurement<UnitType> {
127+
public func *<UnitType>(lhs: Measurement<UnitType>, rhs: Double) -> Measurement<UnitType> {
128128
return Measurement(value: lhs.value * rhs, unit: lhs.unit)
129129
}
130130

131131
/// Multiply a scalar value by a measurement.
132132
/// - returns: A measurement of value `lhs * rhs.value` with the same unit as `rhs`.
133-
public func *<UnitType : Unit>(lhs: Double, rhs: Measurement<UnitType>) -> Measurement<UnitType> {
133+
public func *<UnitType>(lhs: Double, rhs: Measurement<UnitType>) -> Measurement<UnitType> {
134134
return Measurement(value: lhs * rhs.value, unit: rhs.unit)
135135
}
136136

137137
/// Divide a measurement by a scalar value.
138138
/// - returns: A measurement of value `lhs.value / rhs` with the same unit as `lhs`.
139-
public func /<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Double) -> Measurement<UnitType> {
139+
public func /<UnitType>(lhs: Measurement<UnitType>, rhs: Double) -> Measurement<UnitType> {
140140
return Measurement(value: lhs.value / rhs, unit: lhs.unit)
141141
}
142142

143143
/// Divide a scalar value by a measurement.
144144
/// - returns: A measurement of value `lhs / rhs.value` with the same unit as `rhs`.
145-
public func /<UnitType : Unit>(lhs: Double, rhs: Measurement<UnitType>) -> Measurement<UnitType> {
145+
public func /<UnitType>(lhs: Double, rhs: Measurement<UnitType>) -> Measurement<UnitType> {
146146
return Measurement(value: lhs / rhs.value, unit: rhs.unit)
147147
}
148148

149149
/// Compare two measurements of the same `Unit`.
150150
/// - returns: `true` if `lhs.value == rhs.value && lhs.unit == rhs.unit`.
151-
public func ==<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
151+
public func ==<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
152152
return lhs.value == rhs.value && lhs.unit == rhs.unit
153153
}
154154

@@ -168,7 +168,7 @@ public func ==<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measuremen
168168
/// Compare two measurements of the same `Unit`.
169169
/// - note: This function does not check `==` for the `unit` property of `lhs` and `rhs`.
170170
/// - returns: `lhs.value < rhs.value`
171-
public func <<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
171+
public func <<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
172172
return lhs.value < rhs.value
173173
}
174174

@@ -188,7 +188,7 @@ public func <<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measurement
188188
/// Compare two measurements of the same `Unit`.
189189
/// - note: This function does not check `==` for the `unit` property of `lhs` and `rhs`.
190190
/// - returns: `lhs.value > rhs.value`
191-
public func ><UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
191+
public func ><UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
192192
return lhs.value > rhs.value
193193
}
194194

@@ -208,7 +208,7 @@ public func ><UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measurement
208208
/// Compare two measurements of the same `Unit`.
209209
/// - note: This function does not check `==` for the `unit` property of `lhs` and `rhs`.
210210
/// - returns: `lhs.value <= rhs.value`
211-
public func <=<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
211+
public func <=<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
212212
return lhs.value <= rhs.value
213213
}
214214

@@ -228,7 +228,7 @@ public func <=<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measuremen
228228
/// Compare two measurements of the same `Unit`.
229229
/// - note: This function does not check `==` for the `unit` property of `lhs` and `rhs`.
230230
/// - returns: `lhs.value >= rhs.value`
231-
public func >=<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
231+
public func >=<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool {
232232
return lhs.value >= rhs.value
233233
}
234234

Foundation/NSMeasurementFormatter.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,5 +79,5 @@ open class MeasurementFormatter : Formatter, NSSecureCoding {
7979
}
8080

8181
extension MeasurementFormatter {
82-
public func string<UnitType : Unit>(from measurement: Measurement<UnitType>) -> String { NSUnimplemented() }
82+
public func string<UnitType>(from measurement: Measurement<UnitType>) -> String { NSUnimplemented() }
8383
}

Foundation/ReferenceConvertible.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
/// Decorates types which are backed by a Foundation reference type.
1212
///
1313
/// All `ReferenceConvertible` types are hashable, equatable, and provide description functions.
14-
public protocol ReferenceConvertible : CustomStringConvertible, CustomDebugStringConvertible, Hashable, Equatable {
14+
public protocol ReferenceConvertible : CustomStringConvertible, CustomDebugStringConvertible, Hashable {
1515
associatedtype ReferenceType : NSObject, NSCopying
1616
}
1717

0 commit comments

Comments
 (0)