1
1
mirror of https://github.com/anoma/juvix.git synced 2024-11-30 14:13:27 +03:00
juvix/tests/Compilation
Łukasz Czajka 485f6e7920
Literal casting (#2457)
* Closes #2453 
* Closes #2432
* Any nonnegative literal `n` is replaced with `fromNat {_} {{_}} n`
where `fromNat` is the builtin conversion function defined in the
`Natural` trait in `Stdlib.Trait.Natural`.
* Any negative literal `-n` is replaced with `fromInt {_} {{_}} -n`
where `fromInt` is the builtin conversion function defined in the
`Integral` trait in `Stdlib.Trait.Integral`.
* Before resolving instance holes, it is checked whether the type holes
introduced for `fromNat` and `fromInt` have been inferred. If not, an
attempt is made to unify them with `Nat` or `Int`. This allows to
type-check e.g. `1 == 1` (there is no hint in the context as to what the
type of `1` should be, so it is decided to be `Nat` after inferring the
hole fails).
2023-11-03 10:01:03 +01:00
..
negative Add missing juvix.yaml files to test project roots (#2474) 2023-10-26 10:41:23 +01:00
positive Literal casting (#2457) 2023-11-03 10:01:03 +01:00