rixed / ramen

A stream processing language and compiler for small-scale monitoring
Other
14 stars 4 forks source link

Compilation error with parse_time #1427

Closed rixed closed 2 years ago

rixed commented 2 years ago
21h56m50:execompserver: Compiling program parse_time
File "/tmp/ramen_test.362864/execompserver/cache/v106_29.0.0_v47/acc918e2949de4bef79ce5a0a96e0bce_c1d76690aab2115d8e62a90fca148db6_v106_29_46_0_46_0_v47.ml", line 107, characters 40-42:
Error: This expression has type float but an expression was expected of type
         float option

Here is the faulty code:

let out_tuple_of_minimal_tuple_ (() as in_) global_last_out_ local_last_out_ group_ global_ (out__not_minimal_output_0_, out__not_minimal_output_1_ as out_) =
  (* Output field output_0 of type FLOAT? *)
  let out_output_0_ = (let x_ = (match (nullable_map_no_fail identity) ((let x0_ = (identity) ((identity "1976-01-28 12:00:00.9")) in
  time_of_abstime x0_)) with None as n_ -> n_ | Some x0_ -> (let x1_ = (Uint32.to_float) ((identity (Uint32.of_int64 (86400L)))) in
  Some (Float.div x0_ x1_))) in if x_ >= 0. then floor x_ else ceil x_) in

x0 is a float option (as returned by time_of_abstime.

The error is actually in IDiv.