Closed xekoukou closed 5 years ago
The problem lies here:
( $agdaIdent36.2ed69e510f00fd1e.Agda.Builtin.Float.primATan2
( lambda ($a) ( apply (global $Stdlib $Float $atan2) $a ) )
atan2 is a binary operation and I have only applied it once. I am keeping the issue open in case you find it useful. Maybe add a check that looks at the arity of a function.
Thanks for the report! This is definitely a bug.
In OCaml, all functions are curried. However, some basic functions are implemented as "primitives", and internally these are not curried. The compiler makes sure to expand partial applications of these when compiling, but I forgot to do this in malfunction. (So the OCaml code atan2 x
compiles more like (fun a b -> atan2 a b) x
, ensuring that all uses of atan2
are fully applied).
The below file triggers an assertion in 4.07.0 OCaml.
https://github.com/ocaml/ocaml/blob/4.07/asmcomp/cmmgen.ml#L1983
I was trying to add Float support.
One weird thing that I noticed was that this was acceptable :
while this was not :