Skip to content

Add error for signaling that type variable does not expect arguments

E. Rivas requested to merge er433/fix/type-var-not-inj into dev

This MR replaces a failwith with an error, to prevent the following:

$ cat foo.mligo 
let x : int bool = true
$ dune exec -- ligo print-mini-c foo.mligo
ligo: internal error, uncaught exception:
      (Failure "variable with parameters is not an injection")
      Raised at file "stdlib.ml", line 29, characters 17-33
      Called from file "vendors/ligo-utils/simple-utils/trace.ml", line 237, characters 11-14
      Called from file "vendors/ligo-utils/simple-utils/trace.ml", line 344, characters 12-15
      Called from file "src/passes/10-checking/checking.ml", line 65, characters 23-70
      Called from file "src/passes/10-checking/checking.ml", line 43, characters 24-44
      Called from file "vendors/ligo-utils/simple-utils/trace.ml", line 237, characters 11-14
      Called from file "list.ml", line 121, characters 24-34
      Called from file "src/passes/10-checking/checking.ml", line 48, characters 4-39
      Called from file "src/main/compile/of_core.ml", line 15, characters 46-95
      Called from file "src/main/build/build.ml", line 122, characters 37-99
      Called from file "vendors/ligo-utils/simple-utils/trace.ml", line 237, characters 11-14
      Called from file "vendors/ligo-utils/simple-utils/trace.ml", line 237, characters 11-14
      Called from file "list.ml", line 121, characters 24-34
      Called from file "src/main/build/build.ml", line 153, characters 26-110
      Called from file "vendors/ligo-utils/simple-utils/trace.ml", line 237, characters 11-14
      Called from file "vendors/ligo-utils/simple-utils/trace.ml", line 237, characters 11-14
      Called from file "src/main/build/build.ml", line 159, characters 28-83
      Called from file "src/bin/cli.ml", line 424, characters 26-76
      Called from file "vendors/ligo-utils/simple-utils/trace.ml", line 237, characters 11-14
      Called from file "src/bin/cli.ml", line 419, characters 6-580
      Called from file "cmdliner_term.ml", line 25, characters 19-24
      Called from file "cmdliner.ml", line 26, characters 27-34
      Called from file "cmdliner.ml", line 117, characters 32-39

Merge request reports

Loading