risor-io / risor

Fast and flexible scripting for Go developers and DevOps.
https://risor.io
Apache License 2.0
576 stars 24 forks source link

Tighten allowable cross-type comparisons #217

Closed myzie closed 2 months ago

myzie commented 2 months ago

Fixes https://github.com/risor-io/risor/issues/216

All numeric types are comparable with each other.

Numerics can't be compared with strings.

Don't implement Compare for types that don't support any comparisons.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 29.03226% with 22 lines in your changes are missing coverage. Please review.

Project coverage is 31.93%. Comparing base (1de57b7) to head (8b80118).

Files Patch % Lines
object/list.go 0.00% 6 Missing :warning:
object/error.go 0.00% 4 Missing :warning:
object/module.go 0.00% 3 Missing :warning:
object/time.go 0.00% 3 Missing :warning:
object/bool.go 33.33% 1 Missing and 1 partial :warning:
object/buffer.go 0.00% 1 Missing :warning:
object/byte.go 0.00% 1 Missing :warning:
object/byte_slice.go 0.00% 1 Missing :warning:
object/file_mode.go 0.00% 1 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #217 +/- ## ========================================== + Coverage 31.51% 31.93% +0.42% ========================================== Files 121 121 Lines 15110 15094 -16 ========================================== + Hits 4762 4821 +59 + Misses 9756 9687 -69 + Partials 592 586 -6 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.