-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Minor warning fixes #931
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor warning fixes #931
Changes from 5 commits
c028a7b
94649cf
7223471
2d3b562
d3ecd80
b7ddb60
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -75,7 +75,7 @@ extension Measurement where UnitType : Dimension { | |
/// Add two measurements of the same Unit. | ||
/// - precondition: The `unit` of `lhs` and `rhs` must be `isEqual`. | ||
/// - returns: A measurement of value `lhs.value + rhs.value` and unit `lhs.unit`. | ||
public func +<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Measurement<UnitType> { | ||
public func +<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Measurement<UnitType> { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did we make these changes in the Swift overlay too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Looks like it was done as part of swiftlang/swift#8281 |
||
if lhs.unit.isEqual(rhs.unit) { | ||
return Measurement(value: lhs.value + rhs.value, unit: lhs.unit) | ||
} else { | ||
|
@@ -100,7 +100,7 @@ public func +<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measurement | |
/// Subtract two measurements of the same Unit. | ||
/// - precondition: The `unit` of `lhs` and `rhs` must be `isEqual`. | ||
/// - returns: A measurement of value `lhs.value - rhs.value` and unit `lhs.unit`. | ||
public func -<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Measurement<UnitType> { | ||
public func -<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Measurement<UnitType> { | ||
if lhs.unit.isEqual(rhs.unit) { | ||
return Measurement(value: lhs.value - rhs.value, unit: lhs.unit) | ||
} else { | ||
|
@@ -124,31 +124,31 @@ public func -<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measurement | |
|
||
/// Multiply a measurement by a scalar value. | ||
/// - returns: A measurement of value `lhs.value * rhs` with the same unit as `lhs`. | ||
public func *<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Double) -> Measurement<UnitType> { | ||
public func *<UnitType>(lhs: Measurement<UnitType>, rhs: Double) -> Measurement<UnitType> { | ||
return Measurement(value: lhs.value * rhs, unit: lhs.unit) | ||
} | ||
|
||
/// Multiply a scalar value by a measurement. | ||
/// - returns: A measurement of value `lhs * rhs.value` with the same unit as `rhs`. | ||
public func *<UnitType : Unit>(lhs: Double, rhs: Measurement<UnitType>) -> Measurement<UnitType> { | ||
public func *<UnitType>(lhs: Double, rhs: Measurement<UnitType>) -> Measurement<UnitType> { | ||
return Measurement(value: lhs * rhs.value, unit: rhs.unit) | ||
} | ||
|
||
/// Divide a measurement by a scalar value. | ||
/// - returns: A measurement of value `lhs.value / rhs` with the same unit as `lhs`. | ||
public func /<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Double) -> Measurement<UnitType> { | ||
public func /<UnitType>(lhs: Measurement<UnitType>, rhs: Double) -> Measurement<UnitType> { | ||
return Measurement(value: lhs.value / rhs, unit: lhs.unit) | ||
} | ||
|
||
/// Divide a scalar value by a measurement. | ||
/// - returns: A measurement of value `lhs / rhs.value` with the same unit as `rhs`. | ||
public func /<UnitType : Unit>(lhs: Double, rhs: Measurement<UnitType>) -> Measurement<UnitType> { | ||
public func /<UnitType>(lhs: Double, rhs: Measurement<UnitType>) -> Measurement<UnitType> { | ||
return Measurement(value: lhs / rhs.value, unit: rhs.unit) | ||
} | ||
|
||
/// Compare two measurements of the same `Unit`. | ||
/// - returns: `true` if `lhs.value == rhs.value && lhs.unit == rhs.unit`. | ||
public func ==<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
public func ==<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
return lhs.value == rhs.value && lhs.unit == rhs.unit | ||
} | ||
|
||
|
@@ -168,7 +168,7 @@ public func ==<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measuremen | |
/// Compare two measurements of the same `Unit`. | ||
/// - note: This function does not check `==` for the `unit` property of `lhs` and `rhs`. | ||
/// - returns: `lhs.value < rhs.value` | ||
public func <<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
public func <<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
return lhs.value < rhs.value | ||
} | ||
|
||
|
@@ -188,7 +188,7 @@ public func <<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measurement | |
/// Compare two measurements of the same `Unit`. | ||
/// - note: This function does not check `==` for the `unit` property of `lhs` and `rhs`. | ||
/// - returns: `lhs.value > rhs.value` | ||
public func ><UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
public func ><UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
return lhs.value > rhs.value | ||
} | ||
|
||
|
@@ -208,7 +208,7 @@ public func ><UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measurement | |
/// Compare two measurements of the same `Unit`. | ||
/// - note: This function does not check `==` for the `unit` property of `lhs` and `rhs`. | ||
/// - returns: `lhs.value <= rhs.value` | ||
public func <=<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
public func <=<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
return lhs.value <= rhs.value | ||
} | ||
|
||
|
@@ -228,7 +228,7 @@ public func <=<UnitType : Dimension>(lhs: Measurement<UnitType>, rhs: Measuremen | |
/// Compare two measurements of the same `Unit`. | ||
/// - note: This function does not check `==` for the `unit` property of `lhs` and `rhs`. | ||
/// - returns: `lhs.value >= rhs.value` | ||
public func >=<UnitType : Unit>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
public func >=<UnitType>(lhs: Measurement<UnitType>, rhs: Measurement<UnitType>) -> Bool { | ||
return lhs.value >= rhs.value | ||
} | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ | |
/// Decorates types which are backed by a Foundation reference type. | ||
/// | ||
/// All `ReferenceConvertible` types are hashable, equatable, and provide description functions. | ||
public protocol ReferenceConvertible : CustomStringConvertible, CustomDebugStringConvertible, Hashable, Equatable { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Seems obnoxious that this generates a warning, but ok. |
||
public protocol ReferenceConvertible : CustomStringConvertible, CustomDebugStringConvertible, Hashable { | ||
associatedtype ReferenceType : NSObject, NSCopying | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@phausler did swift-corelibs-foundation get the new CharacterSet implementation yet?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@parkera Is this the only outstanding issue with this PR? I can always revert this one change if so
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's leave this one out for now.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ive reverted this change