JD557 commented on PR #1247: URL: https://github.com/apache/pekko/pull/1247#issuecomment-2057324609
I don't think that `BoxesRunTime` trick is enough, unfortunately. Say one asks `ByteString.indexOf(500)`. This should obviously return `-1`, as it is impossible for a byte to have that value. However `BoxesRunTime.toByte(500)` returns `-12: Byte`. Ideally we would check if the number is between `Byte.MinValue` and `Byte.MaxValue` before boxing, but even that is not enough, due to floating point values (BoxesRunTime.toByte(127.9) == 127.toByte == 127.0). Although I imagine most problems would come from `Int` and `Char`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
