-
Notifications
You must be signed in to change notification settings - Fork 15
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
Type 'UInt64' does not conform to protocol 'IntegerNumber' #22
Comments
This is related to a bug fix I did recently, which apparently has lead to a similar bug being introduced in the Hedera SDK (probably long ago). NumberKit used to contain the following code: extension UInt64: IntegerNumber {
public var doubleValue: Double {
return Double(self)
}
} This is semantically incorrect, because Unfortunately, the Swift Hedera API contains a similar erroneous definition when extending extension Rational: ProtobufCodable where T == UInt64 {
internal typealias Protobuf = Proto_Fraction
internal init(protobuf proto: Protobuf) {
self.init(UInt64(proto.numerator), UInt64(proto.denominator))
}
internal func toProtobuf() -> Protobuf {
.with { proto in
proto.numerator = Int64(self.numerator)
proto.denominator = Int64(self.denominator)
}
}
} And the fact that the code needs to cast the values multiple times between extension Rational: ProtobufCodable where T == Int64 {
internal typealias Protobuf = Proto_Fraction
internal init(protobuf proto: Protobuf) {
self.init(proto.numerator, proto.denominator)
}
internal func toProtobuf() -> Protobuf {
.with { proto in
proto.numerator = self.numerator
proto.denominator = self.denominator
}
}
} To silence the error you get for now, there are two options:
I'd also be willing to consider changes to |
I'm getting error in my xcode project when I have used the latest version of Hedera SDK Swift so I checked it uses the latest version of NumberKit library which causing this issue.
Here is the link for issue created on Hedera SDK Swift
The text was updated successfully, but these errors were encountered: