You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
module M;
import Stdlib.Prelude open;
main : List Nat := filter (const false) [];
Then compile:
juvix compile native M.juvix
Expected
The module compiles.
Actual
The compiler loops.
NB:
module M;
import Stdlib.Prelude open;
main : List Nat := filter (const true) [];
works fine.
The compilation works if the optimiser is switched off:
juvix compile native -O0 M.juvix
Other ways to reproduce
This bug is also triggered with other functions, for example with the following definition of find. It seems to be triggered by some combination of the specialize pragma and the use of const false.
module Find;
import Stdlib.Prelude open;
{-# specialize: [predicate] #-}
myFind {A} (predicate : A → Bool) : List A → Maybe A
| nil := nothing
| (x :: xs) :=
if
| predicate x := just x
| else := myFind predicate xs;
main : Maybe Nat := myFind (const false) [1;2;3];
The text was updated successfully, but these errors were encountered:
To reproduce:
Then compile:
Expected
The module compiles.
Actual
The compiler loops.
NB:
works fine.
The compilation works if the optimiser is switched off:
Other ways to reproduce
This bug is also triggered with other functions, for example with the following definition of find. It seems to be triggered by some combination of the
specialize
pragma and the use ofconst false
.The text was updated successfully, but these errors were encountered: