Tweak error message location printing

This commit is contained in:
Louis Gesbert 2022-11-24 18:00:45 +01:00
parent 9fc4c0c10c
commit af2f5dbe19
97 changed files with 209 additions and 395 deletions

View File

@ -79,11 +79,11 @@ let to_string (pos : t) : string =
let to_string_short (pos : t) : string =
let s, e = pos.code_pos in
if e.Lexing.pos_lnum = s.Lexing.pos_lnum then
Printf.sprintf "%s:%d.%d-%d" s.Lexing.pos_fname s.Lexing.pos_lnum
Printf.sprintf "%s:%d.%d-%d:" s.Lexing.pos_fname s.Lexing.pos_lnum
(s.Lexing.pos_cnum - s.Lexing.pos_bol)
(e.Lexing.pos_cnum - e.Lexing.pos_bol)
else
Printf.sprintf "%s:%d.%d-%d.%d" s.Lexing.pos_fname s.Lexing.pos_lnum
Printf.sprintf "%s:%d.%d-%d.%d:" s.Lexing.pos_fname s.Lexing.pos_lnum
(s.Lexing.pos_cnum - s.Lexing.pos_bol)
e.Lexing.pos_lnum
(e.Lexing.pos_cnum - e.Lexing.pos_bol)
@ -193,10 +193,8 @@ let retrieve_loc_text (pos : t) : string =
(Cli.with_style blue_style "└%s┐" (string_repeat spaces ""));
Buffer.add_char buf '\n';
Buffer.add_string buf
(Cli.add_prefix_to_each_line
(String.concat "\n" ("" :: pos_lines))
(fun i ->
let cur_line = sline - include_extra_count + i - 1 in
(Cli.add_prefix_to_each_line (String.concat "\n" pos_lines) (fun i ->
let cur_line = sline - include_extra_count + i in
if
cur_line >= sline
&& cur_line <= sline + (2 * (eline - sline))

View File

@ -17,8 +17,7 @@
include Stdlib.String
let to_ascii : string -> string = Ubase.from_utf8
let is_uppercase_ascii = function 'A'..'Z' -> true | _ -> false
let is_uppercase_ascii = function 'A' .. 'Z' -> true | _ -> false
let begins_with_uppercase (s : string) : bool =
"" <> s && is_uppercase_ascii (get (to_ascii s) 0)
@ -44,8 +43,7 @@ let to_camel_case (s : string) : string =
!out
^
if is_underscore then ""
else if !last_was_underscore || 0 = i then
uppercase_ascii c_string
else if !last_was_underscore || 0 = i then uppercase_ascii c_string
else c_string;
last_was_underscore := is_underscore);
!out

View File

@ -57,10 +57,7 @@ module Make (X : Info) () : Id with type info = X.info = struct
{ id = !counter; info }
let get_info (uid : t) : X.info = uid.info
let format_t (fmt : Format.formatter) (x : t) : unit =
X.format fmt x.info
let format_t (fmt : Format.formatter) (x : t) : unit = X.format fmt x.info
let hash (x : t) : int = x.id
module Set = Set.Make (Ordering)

View File

@ -1,5 +1,4 @@
open Catala_utils
open Driver
open Js_of_ocaml

View File

@ -16,7 +16,6 @@
the License. *)
open Catala_utils
module Plugin = Plugin.PluginAPI
val driver : Pos.input_file -> Cli.options -> int

View File

@ -166,12 +166,14 @@ let format_struct_field_name
| Some sname ->
Format.fprintf fmt "%a.%s" format_to_module_name (`Sname sname)
| None -> Format.fprintf fmt "%s")
(avoid_keywords (String.to_ascii (Format.asprintf "%a" StructField.format_t v)))
(avoid_keywords
(String.to_ascii (Format.asprintf "%a" StructField.format_t v)))
let format_enum_name (fmt : Format.formatter) (v : EnumName.t) : unit =
Format.fprintf fmt "%s"
(avoid_keywords
(String.to_snake_case (String.to_ascii (Format.asprintf "%a" EnumName.format_t v))))
(String.to_snake_case
(String.to_ascii (Format.asprintf "%a" EnumName.format_t v))))
let format_enum_cons_name (fmt : Format.formatter) (v : EnumConstructor.t) :
unit =
@ -221,7 +223,9 @@ let rec format_typ (fmt : Format.formatter) (typ : typ) : unit =
| TAny -> Format.fprintf fmt "_"
let format_var (fmt : Format.formatter) (v : 'm Var.t) : unit =
let lowercase_name = String.to_snake_case (String.to_ascii (Bindlib.name_of v)) in
let lowercase_name =
String.to_snake_case (String.to_ascii (Bindlib.name_of v))
in
let lowercase_name =
Re.Pcre.substitute ~rex:(Re.Pcre.regexp "\\.")
~subst:(fun _ -> "_dot_")

View File

@ -17,8 +17,7 @@
open Catala_utils
val literal_title : Cli.backend_lang -> string
(** Return the title traduction according the given
{!type:Cli.backend_lang}. *)
(** Return the title traduction according the given {!type:Cli.backend_lang}. *)
val literal_generated_by : Cli.backend_lang -> string
(** Return the 'generated by' traduction according the given
@ -30,8 +29,7 @@ val literal_source_files : Cli.backend_lang -> string
val literal_disclaimer_and_link : Cli.backend_lang -> string
(** Return the traduction of a paragraph giving a basic disclaimer about Catala
and a link to the website according the given {!type:
Cli.backend_lang}. *)
and a link to the website according the given {!type: Cli.backend_lang}. *)
val literal_last_modification : Cli.backend_lang -> string
(** Return the 'last modification' traduction according the given

View File

@ -124,17 +124,20 @@ let avoid_keywords (s : string) : string =
let format_struct_name (fmt : Format.formatter) (v : StructName.t) : unit =
Format.fprintf fmt "%s"
(avoid_keywords
(String.to_camel_case (String.to_ascii (Format.asprintf "%a" StructName.format_t v))))
(String.to_camel_case
(String.to_ascii (Format.asprintf "%a" StructName.format_t v))))
let format_struct_field_name (fmt : Format.formatter) (v : StructField.t) : unit
=
Format.fprintf fmt "%s"
(avoid_keywords (String.to_ascii (Format.asprintf "%a" StructField.format_t v)))
(avoid_keywords
(String.to_ascii (Format.asprintf "%a" StructField.format_t v)))
let format_enum_name (fmt : Format.formatter) (v : EnumName.t) : unit =
Format.fprintf fmt "%s"
(avoid_keywords
(String.to_camel_case (String.to_ascii (Format.asprintf "%a" EnumName.format_t v))))
(String.to_camel_case
(String.to_ascii (Format.asprintf "%a" EnumName.format_t v))))
let format_enum_cons_name (fmt : Format.formatter) (v : EnumConstructor.t) :
unit =

View File

@ -26,7 +26,8 @@ let uid_list (fmt : Format.formatter) (infos : Uid.MarkedString.info list) :
~pp_sep:(fun fmt () -> Format.pp_print_char fmt '.')
(fun fmt info ->
Cli.format_with_style
(if String.begins_with_uppercase (Marked.unmark info) then [ANSITerminal.red]
(if String.begins_with_uppercase (Marked.unmark info) then
[ANSITerminal.red]
else [])
fmt
(Uid.MarkedString.to_string info))

View File

@ -18,8 +18,7 @@
without the expected backend. All functions print an error message and exit *)
let dummy () =
Cli.error_print
"This instance of Catala was compiled without Z3 support.";
Cli.error_print "This instance of Catala was compiled without Z3 support.";
exit 124
module Io = struct

View File

@ -33,17 +33,15 @@ Message: unexpected token
Autosuggestion: did you mean "content", or maybe "condition"?
Error token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.20-25
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.20-25:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾
Last good token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.10-19
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.10-19:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾‾‾‾‾
@ -79,17 +77,15 @@ Message: unexpected token
Autosuggestion: did you mean "content", or maybe "condition"?
Error token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.20-25
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.20-25:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾
Last good token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.10-19
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.10-19:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾‾‾‾‾
@ -125,17 +121,15 @@ Message: unexpected token
Autosuggestion: did you mean "content", or maybe "condition"?
Error token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.20-25
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.20-25:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾
Last good token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.10-19
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.10-19:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾‾‾‾‾
@ -173,17 +167,15 @@ Message: unexpected token
Autosuggestion: did you mean "content", or maybe "condition"?
Error token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.20-25
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.20-25:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾
Last good token:
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.10-19
┌─⯈ examples/NSW_community_gaming/tests/test_nsw_social_housie.catala_en:11.10-19:
└──┐
11 │ context my_gaming scope GamingAuthorized
│ ‾‾‾‾‾‾‾‾‾

View File

@ -186,8 +186,8 @@ let include_legislative_text
let include_line = Pos.get_end_line pos in
let ic = open_in file in
let new_file = file ^ ".new" in
Cli.warning_print
"LégiFrance inclusion detected, writing new contents to %s" new_file;
Cli.warning_print "LégiFrance inclusion detected, writing new contents to %s"
new_file;
let oc = open_out new_file in
(* Pos.t lines start at 1 *)
let counter = ref 1 in

View File

@ -36,18 +36,16 @@ $ catala Interpret -s Dec
[ERROR] division by zero at runtime
The division operator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:20.22-30
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:20.22-30:
└──┐
20 │ definition i equals 1. /. 0.
│ ‾‾‾‾‾‾‾‾
└┬ `Division_by_zero` exception management
└─ with decimals
The null denominator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:20.28-30
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:20.28-30:
└──┐
20 │ definition i equals 1. /. 0.
│ ‾‾
└┬ `Division_by_zero` exception management
@ -60,18 +58,16 @@ $ catala Interpret -s Int
[ERROR] division by zero at runtime
The division operator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:10.22-27
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:10.22-27:
└──┐
10 │ definition i equals 1 / 0
│ ‾‾‾‾‾
└┬ `Division_by_zero` exception management
└─ with integers
The null denominator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:10.26-27
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:10.26-27:
└──┐
10 │ definition i equals 1 / 0
│ ‾
└┬ `Division_by_zero` exception management
@ -84,18 +80,16 @@ $ catala Interpret -s Money
[ERROR] division by zero at runtime
The division operator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:30.22-35
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:30.22-35:
└──┐
30 │ definition i equals $10.0 /$ $0.0
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ `Division_by_zero` exception management
└─ with money
The null denominator:
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:30.31-35
┌─⯈ tests/test_arithmetic/bad/division_by_zero.catala_en:30.31-35:
└──┐
30 │ definition i equals $10.0 /$ $0.0
│ ‾‾‾‾
└┬ `Division_by_zero` exception management

View File

@ -17,25 +17,22 @@ $ catala Interpret -s A
--> money
Error coming from typechecking the following expression:
┌─⯈ tests/test_array/bad/fold_error.catala_en:10.52-56
┌─⯈ tests/test_array/bad/fold_error.catala_en:10.52-56:
└──┐
10 │ definition list_high_count equals number for m in list of (m >=$ $7)
│ ‾‾‾‾
└─ Article
Type integer coming from expression:
┌─⯈ tests/test_array/bad/fold_error.catala_en:5.34-41
┌─⯈ tests/test_array/bad/fold_error.catala_en:5.34-41:
└─┐
5 │ context list content collection integer
│ ‾‾‾‾‾‾‾
└─ Article
Type money coming from expression:
┌─⯈ tests/test_array/bad/fold_error.catala_en:10.63-66
┌─⯈ tests/test_array/bad/fold_error.catala_en:10.63-66:
└──┐
10 │ definition list_high_count equals number for m in list of (m >=$ $7)
│ ‾‾‾
└─ Article

View File

@ -17,25 +17,22 @@ $ catala Interpret -s Foo
--> bool
Error coming from typechecking the following expression:
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.12-13
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.12-13:
└─┐
9 │ assertion x
│ ‾
└─ Test
Type integer coming from expression:
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:5.21-28
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:5.21-28:
└─┐
5 │ internal x content integer
│ ‾‾‾‾‾‾‾
└─ Test
Type bool coming from expression:
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.12-13
┌─⯈ tests/test_bool/bad/bad_assert.catala_en:9.12-13:
└─┐
9 │ assertion x
│ ‾
└─ Test

View File

@ -15,25 +15,22 @@ $ catala Typecheck
--> integer
Error coming from typechecking the following expression:
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.32-35
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.32-35:
└─┐
8 │ definition test_var equals 10 xor 20
│ ‾‾‾
└─ 'xor' should be a boolean operator
Type bool coming from expression:
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.32-35
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:8.32-35:
└─┐
8 │ definition test_var equals 10 xor 20
│ ‾‾‾
└─ 'xor' should be a boolean operator
Type integer coming from expression:
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:5.27-34
┌─⯈ tests/test_bool/bad/test_xor_with_int.catala_en:5.27-34:
└─┐
5 │ context test_var content integer
│ ‾‾‾‾‾‾‾
└─ 'xor' should be a boolean operator

View File

@ -44,17 +44,15 @@ scope Ge:
$ catala Interpret -s Ge
[ERROR] Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:40.22-29
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:40.22-29:
└──┐
40 │ definition d equals 1 month >=^ 2 day
│ ‾‾‾‾‾‾‾
└┬ `UncomparableDurations` exception management
└─ `>=^` operator
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:40.34-39
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:40.34-39:
└──┐
40 │ definition d equals 1 month >=^ 2 day
│ ‾‾‾‾‾
└┬ `UncomparableDurations` exception management
@ -66,17 +64,15 @@ $ catala Interpret -s Ge
$ catala Interpret -s Gt
[ERROR] Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:30.22-29
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:30.22-29:
└──┐
30 │ definition d equals 1 month >^ 2 day
│ ‾‾‾‾‾‾‾
└┬ `UncomparableDurations` exception management
└─ `<=^` operator
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:30.33-38
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:30.33-38:
└──┐
30 │ definition d equals 1 month >^ 2 day
│ ‾‾‾‾‾
└┬ `UncomparableDurations` exception management
@ -88,17 +84,15 @@ $ catala Interpret -s Gt
$ catala Interpret -s Le
[ERROR] Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:20.22-29
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:20.22-29:
└──┐
20 │ definition d equals 1 month <=^ 2 day
│ ‾‾‾‾‾‾‾
└┬ `UncomparableDurations` exception management
└─ `<=^` operator
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:20.34-39
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:20.34-39:
└──┐
20 │ definition d equals 1 month <=^ 2 day
│ ‾‾‾‾‾
└┬ `UncomparableDurations` exception management
@ -110,17 +104,15 @@ $ catala Interpret -s Le
$ catala Interpret -s Lt
[ERROR] Cannot compare together durations that cannot be converted to a precise number of days
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:10.22-29
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:10.22-29:
└──┐
10 │ definition d equals 1 month <^ 2 day
│ ‾‾‾‾‾‾‾
└┬ `UncomparableDurations` exception management
└─ `<^` operator
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:10.33-38
┌─⯈ tests/test_date/bad/uncomparable_duration.catala_en:10.33-38:
└──┐
10 │ definition d equals 1 month <^ 2 day
│ ‾‾‾‾‾
└┬ `UncomparableDurations` exception management

View File

@ -14,17 +14,15 @@ $ catala Interpret -s A
[ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:
┌─⯈ tests/test_default/bad/conflict.catala_en:8.55-56
┌─⯈ tests/test_default/bad/conflict.catala_en:8.55-56:
└─┐
8 │ definition x under condition true consequence equals 1
│ ‾
└─ Article
This consequence has a valid justification:
┌─⯈ tests/test_default/bad/conflict.catala_en:9.55-56
┌─⯈ tests/test_default/bad/conflict.catala_en:9.55-56:
└─┐
9 │ definition x under condition true consequence equals 0
│ ‾
└─ Article

View File

@ -13,9 +13,8 @@ scope A:
$ catala Interpret -s A
[ERROR] This variable evaluated to an empty term (no rule that defined it applied in this situation)
┌─⯈ tests/test_default/bad/empty.catala_en:6.10-11
┌─⯈ tests/test_default/bad/empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Article

View File

@ -16,9 +16,8 @@ scope A:
$ catala Interpret -s A
[ERROR] This variable evaluated to an empty term (no rule that defined it applied in this situation)
┌─⯈ tests/test_default/bad/empty_with_rules.catala_en:5.10-11
┌─⯈ tests/test_default/bad/empty_with_rules.catala_en:5.10-11:
└─┐
5 │ context x content integer
│ ‾
└─ Article

View File

@ -18,9 +18,8 @@ scope A:
$ catala Interpret -s A
[ERROR] This constructor name is ambiguous, it can belong to E or F. Desambiguate it by prefixing it with the enum name.
┌─⯈ tests/test_enum/bad/ambiguous_cases.catala_en:14.22-27
┌─⯈ tests/test_enum/bad/ambiguous_cases.catala_en:14.22-27:
└──┐
14 │ definition e equals Case1
│ ‾‾‾‾‾
└─ Article

View File

@ -19,9 +19,8 @@ scope A:
$ catala Interpret -s A
[ERROR] Couldn't infer the enumeration name from lonely wildcard (wildcard cannot be used as single match case)
┌─⯈ tests/test_enum/bad/ambiguous_wildcard.catala_en:15.7-20
┌─⯈ tests/test_enum/bad/ambiguous_wildcard.catala_en:15.7-20:
└──┐
15 │ -- anything : 31
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Wildcard cannot be used as single match case

View File

@ -22,16 +22,14 @@ scope A:
$ catala Interpret -s A
[ERROR] The constructor Case3 has been matched twice:
┌─⯈ tests/test_enum/bad/duplicate_case.catala_en:18.15-19
┌─⯈ tests/test_enum/bad/duplicate_case.catala_en:18.15-19:
└──┐
18 │ -- Case3 : true
│ ‾‾‾‾
└─ Article
┌─⯈ tests/test_enum/bad/duplicate_case.catala_en:17.15-20
┌─⯈ tests/test_enum/bad/duplicate_case.catala_en:17.15-20:
└──┐
17 │ -- Case3 : false
│ ‾‾‾‾‾
└─ Article

View File

@ -11,9 +11,8 @@ declaration scope Bar:
$ catala Typecheck
[ERROR] The enum Foo does not have any cases; give it some for Catala to be able to accept it.
┌─⯈ tests/test_enum/bad/empty.catala_en:4.24-27
┌─⯈ tests/test_enum/bad/empty.catala_en:4.24-27:
└─┐
4 │ declaration enumeration Foo:
│ ‾‾‾
└─ Test

View File

@ -20,9 +20,8 @@ scope A:
$ catala Interpret -s A
[ERROR] The constructor Case3 of enum E is missing from this pattern matching
┌─⯈ tests/test_enum/bad/missing_case.catala_en:14.24-16.21
┌─⯈ tests/test_enum/bad/missing_case.catala_en:14.24-16.21:
└──┐
14 │ definition out equals match e with pattern
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
15 │ -- Case1 of i : i = 0

View File

@ -41,18 +41,16 @@ $ catala Interpret -s First_case
[ERROR] Wildcard must be the last match case
Not ending wildcard:
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:19.7-20
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:19.7-20:
└──┐
19 │ -- anything : 31
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Wildcard must be the last case
└─ Wildcard can't be the first case
Next reachable case:
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:20.7-17
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:20.7-17:
└──┐
20 │ -- Case2 : 42
│ ‾‾‾‾‾‾‾‾‾‾
└┬ Wildcard must be the last case
@ -65,18 +63,16 @@ $ catala Interpret -s Middle_case
[ERROR] Wildcard must be the last match case
Not ending wildcard:
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:19.7-20
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:19.7-20:
└──┐
19 │ -- anything : 31
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
└┬ Wildcard must be the last case
└─ Wildcard can't be the first case
Next reachable case:
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:20.7-17
┌─⯈ tests/test_enum/bad/not_ending_wildcard.catala_en:20.7-17:
└──┐
20 │ -- Case2 : 42
│ ‾‾‾‾‾‾‾‾‾‾
└┬ Wildcard must be the last case

View File

@ -35,25 +35,22 @@ $ catala Interpret -s A
--> F
Error coming from typechecking the following expression:
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.22-23
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.22-23:
└──┐
28 │ definition y equals x with pattern Case3
│ ‾
└─ Article
Type E coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:17.20-21
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:17.20-21:
└──┐
17 │ context x content E
│ ‾
└─ Article
Type F coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.22-42
┌─⯈ tests/test_enum/bad/quick_pattern_2.catala_en:28.22-42:
└──┐
28 │ definition y equals x with pattern Case3
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Article

View File

@ -25,25 +25,22 @@ $ catala Interpret -s A
--> F
Error coming from typechecking the following expression:
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.20-21
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.20-21:
└──┐
18 │ definition y equals x with pattern Case3
│ ‾
└─ Article
Type E coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:13.18-19
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:13.18-19:
└──┐
13 │ context x content E
│ ‾
└─ Article
Type F coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.20-40
┌─⯈ tests/test_enum/bad/quick_pattern_3.catala_en:18.20-40:
└──┐
18 │ definition y equals x with pattern Case3
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Article

View File

@ -24,25 +24,22 @@ $ catala Interpret -s A
--> F
Error coming from typechecking the following expression:
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.20-21
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.20-21:
└──┐
17 │ definition y equals x with pattern Case3
│ ‾
└─ Test
Type E coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:12.18-19
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:12.18-19:
└──┐
12 │ context x content E
│ ‾
└─ Test
Type F coming from expression:
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.20-40
┌─⯈ tests/test_enum/bad/quick_pattern_4.catala_en:17.20-40:
└──┐
17 │ definition y equals x with pattern Case3
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Test

View File

@ -19,9 +19,8 @@ scope A:
$ catala Interpret -s A
[ERROR] The name of this constructor has not been defined before, maybe it is a typo?
┌─⯈ tests/test_enum/bad/quick_pattern_fail.catala_en:15.37-42
┌─⯈ tests/test_enum/bad/quick_pattern_fail.catala_en:15.37-42:
└──┐
15 │ definition y equals x with pattern Case3
│ ‾‾‾‾‾
└─ Article

View File

@ -25,9 +25,8 @@ scope A:
$ catala Interpret -s A
[ERROR] This case matches a constructor of enumeration E but previous case were matching constructors of enumeration F
┌─⯈ tests/test_enum/bad/too_many_cases.catala_en:21.7-19
┌─⯈ tests/test_enum/bad/too_many_cases.catala_en:21.7-19:
└──┐
21 │ -- Case4 : true
│ ‾‾‾‾‾‾‾‾‾‾‾‾
└─ Article

View File

@ -21,9 +21,8 @@ scope A:
$ catala Interpret -s A
[WARNING] Unreachable match case, all constructors of the enumeration E are already specified
┌─⯈ tests/test_enum/bad/useless_wildcard.catala_en:17.7-20
┌─⯈ tests/test_enum/bad/useless_wildcard.catala_en:17.7-20:
└──┐
17 │ -- anything : 31
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Useless wildcard

View File

@ -18,9 +18,8 @@ $ catala Interpret -s A
[ERROR] This exception can refer to several definitions. Try using labels to disambiguate
Ambiguous exception
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:10.23-13.23
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:10.23-13.23:
└──┐
10 │ definition x equals 1
11 │
@ -32,17 +31,15 @@ Ambiguous exception
└─ Test
Candidate definition
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:10.13-14
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:10.13-14:
└──┐
10 │ definition x equals 1
│ ‾
└─ Test
Candidate definition
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:8.13-14
┌─⯈ tests/test_exception/bad/ambiguous_unlabeled_exception.catala_en:8.13-14:
└─┐
8 │ definition x equals 0
│ ‾
└─ Test

View File

@ -17,9 +17,8 @@ scope A:
$ catala Interpret -s A
[ERROR] Unknown label for the scope variable x: "base_y"
┌─⯈ tests/test_exception/bad/dangling_exception.catala_en:12.12-18
┌─⯈ tests/test_exception/bad/dangling_exception.catala_en:12.12-18:
└──┐
12 │ exception base_y
│ ‾‾‾‾‾‾
└─ Test

View File

@ -23,9 +23,8 @@ $ catala Interpret -s A
[ERROR] Cyclic dependency detected between exceptions!
Cyclic exception for definition of variable "x", declared here:
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:16.2-18.23
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:16.2-18.23:
└──┐
16 │ label exception_exception_x
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
17 │ exception exception_x
@ -35,17 +34,15 @@ Cyclic exception for definition of variable "x", declared here:
Used here in the definition of another cyclic exception for defining "x":
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:17.12-23
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:17.12-23:
└──┐
17 │ exception exception_x
│ ‾‾‾‾‾‾‾‾‾‾‾
└─ Test
Cyclic exception for definition of variable "x", declared here:
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:12.2-14.23
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:12.2-14.23:
└──┐
12 │ label exception_x
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
13 │ exception base_x
@ -55,17 +52,15 @@ Cyclic exception for definition of variable "x", declared here:
Used here in the definition of another cyclic exception for defining "x":
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:13.12-18
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:13.12-18:
└──┐
13 │ exception base_x
│ ‾‾‾‾‾‾
└─ Test
Cyclic exception for definition of variable "x", declared here:
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:8.2-10.23
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:8.2-10.23:
└──┐
8 │ label base_x
│ ‾‾‾‾‾‾‾‾‾‾‾
9 │ exception exception_exception_x
@ -75,9 +70,8 @@ Cyclic exception for definition of variable "x", declared here:
Used here in the definition of another cyclic exception for defining "x":
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:9.12-33
┌─⯈ tests/test_exception/bad/exceptions_cycle.catala_en:9.12-33:
└─┐
9 │ exception exception_exception_x
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
└─ Test

View File

@ -13,9 +13,8 @@ scope A:
$ catala Interpret -s A
[ERROR] This exception does not have a corresponding definition
┌─⯈ tests/test_exception/bad/missing_unlabeled_definition.catala_en:7.8-9.23
┌─⯈ tests/test_exception/bad/missing_unlabeled_definition.catala_en:7.8-9.23:
└─┐
7 │ scope A:
8 │ exception

View File

@ -24,9 +24,8 @@ $ catala Interpret -s A
[ERROR] This exception can refer to several definitions. Try using labels to disambiguate
Ambiguous exception
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:16.23-19.23
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:16.23-19.23:
└──┐
16 │ definition y equals 4
17 │
@ -38,17 +37,15 @@ Ambiguous exception
└─ Test
Candidate definition
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:16.13-14
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:16.13-14:
└──┐
16 │ definition y equals 4
│ ‾
└─ Test
Candidate definition
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:14.13-14
┌─⯈ tests/test_exception/bad/one_ambiguous_exception.catala_en:14.13-14:
└──┐
14 │ definition y equals 2
│ ‾
└─ Test

View File

@ -14,9 +14,8 @@ scope A:
$ catala Interpret -s A
[ERROR] Cannot define rule as an exception to itself
┌─⯈ tests/test_exception/bad/self_exception.catala_en:9.12-18
┌─⯈ tests/test_exception/bad/self_exception.catala_en:9.12-18:
└─┐
9 │ exception base_y
│ ‾‾‾‾‾‾
└─ Test

View File

@ -20,17 +20,15 @@ $ catala Interpret -s A
[ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:
┌─⯈ tests/test_exception/bad/two_exceptions.catala_en:12.22-23
┌─⯈ tests/test_exception/bad/two_exceptions.catala_en:12.22-23:
└──┐
12 │ definition x equals 1
│ ‾
└─ Test
This consequence has a valid justification:
┌─⯈ tests/test_exception/bad/two_exceptions.catala_en:15.22-23
┌─⯈ tests/test_exception/bad/two_exceptions.catala_en:15.22-23:
└──┐
15 │ definition x equals 2
│ ‾
└─ Test

View File

@ -32,17 +32,15 @@ $ catala Interpret -s S
[ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:
┌─⯈ tests/test_func/bad/bad_func.catala_en:14.64-69
┌─⯈ tests/test_func/bad/bad_func.catala_en:14.64-69:
└──┐
14 │ definition f of x under condition (x >= x) consequence equals x + x
│ ‾‾‾‾‾
└─ Article
This consequence has a valid justification:
┌─⯈ tests/test_func/bad/bad_func.catala_en:15.61-66
┌─⯈ tests/test_func/bad/bad_func.catala_en:15.61-66:
└──┐
15 │ definition f of x under condition not b consequence equals x * x
│ ‾‾‾‾‾
└─ Article

View File

@ -12,9 +12,8 @@ scope RecursiveFunc:
$ catala Interpret -s RecursiveFunc
[ERROR] The variable f is used in one of its definitions, but recursion is forbidden in Catala
┌─⯈ tests/test_func/bad/recursive.catala_en:8.27-28
┌─⯈ tests/test_func/bad/recursive.catala_en:8.27-28:
└─┐
8 │ definition f of x equals f of x + 1
│ ‾
└─ Article

View File

@ -19,17 +19,15 @@ $ catala Typecheck
[ERROR] This subscope variable is a mandatory input but no definition was provided.
Incriminated subscope:
┌─⯈ tests/test_io/bad/forgot_input.catala_en:9.2-3
┌─⯈ tests/test_io/bad/forgot_input.catala_en:9.2-3:
└─┐
9 │ a scope A
│ ‾
└─ Test
Incriminated variable:
┌─⯈ tests/test_io/bad/forgot_input.catala_en:6.8-9
┌─⯈ tests/test_io/bad/forgot_input.catala_en:6.8-9:
└─┐
6 │ input x content integer
│ ‾
└─ Test

View File

@ -19,25 +19,22 @@ $ catala Typecheck
[ERROR] It is impossible to give a definition to a subscope variable not tagged as input or context.
Incriminated subscope:
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:8.2-3
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:8.2-3:
└─┐
8 │ a scope A
│ ‾
└─ Test
Incriminated variable:
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:5.9-10
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:5.9-10:
└─┐
5 │ output a content integer
│ ‾
└─ Test
Incriminated subscope variable definition:
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:14.2-25
┌─⯈ tests/test_io/bad/inputing_to_not_input.catala_en:14.2-25:
└──┐
14 │ definition a.a equals 0
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -12,17 +12,15 @@ $ catala Typecheck
[ERROR] It is impossible to give a definition to a scope variable tagged as input.
Incriminated variable:
┌─⯈ tests/test_io/bad/redefining_input.catala_en:5.8-9
┌─⯈ tests/test_io/bad/redefining_input.catala_en:5.8-9:
└─┐
5 │ input a content integer
│ ‾
└─ Test
Incriminated variable definition:
┌─⯈ tests/test_io/bad/redefining_input.catala_en:8.2-23
┌─⯈ tests/test_io/bad/redefining_input.catala_en:8.2-23:
└─┐
8 │ definition a equals 0
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾

View File

@ -18,25 +18,22 @@ $ catala Typecheck
[ERROR] The variable a.a cannot be used here, as it is not part of subscope a's results. Maybe you forgot to qualify it as an output?
Incriminated variable usage:
┌─⯈ tests/test_io/bad/using_non_output.catala_en:14.12-15
┌─⯈ tests/test_io/bad/using_non_output.catala_en:14.12-15:
└──┐
14 │ assertion a.a = 0
│ ‾‾‾
└─ Test
Incriminated subscope variable declaration:
┌─⯈ tests/test_io/bad/using_non_output.catala_en:5.11-12
┌─⯈ tests/test_io/bad/using_non_output.catala_en:5.11-12:
└─┐
5 │ internal a content integer
│ ‾
└─ Test
Incriminated subscope declaration:
┌─⯈ tests/test_io/bad/using_non_output.catala_en:8.2-3
┌─⯈ tests/test_io/bad/using_non_output.catala_en:8.2-3:
└─┐
8 │ a scope A
│ ‾
└─ Test

View File

@ -19,25 +19,22 @@ $ catala Interpret -s A
--> decimal
Error coming from typechecking the following expression:
┌─⯈ tests/test_money/bad/no_mingle.catala_en:12.28-29
┌─⯈ tests/test_money/bad/no_mingle.catala_en:12.28-29:
└──┐
12 │ definition z equals (x *$ y)
│ ‾
└─ Article
Type money coming from expression:
┌─⯈ tests/test_money/bad/no_mingle.catala_en:6.20-25
┌─⯈ tests/test_money/bad/no_mingle.catala_en:6.20-25:
└─┐
6 │ context y content money
│ ‾‾‾‾‾
└─ Article
Type decimal coming from expression:
┌─⯈ tests/test_money/bad/no_mingle.catala_en:12.25-27
┌─⯈ tests/test_money/bad/no_mingle.catala_en:12.25-27:
└──┐
12 │ definition z equals (x *$ y)
│ ‾‾
└─ Article

View File

@ -13,9 +13,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/array_length-empty.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/array_length-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -14,9 +14,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/array_length-overlap.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/array_length-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -16,9 +16,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/dates_get_year-empty.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/dates_get_year-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -16,9 +16,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/dates_get_year-overlap.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/dates_get_year-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -15,9 +15,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/dates_simple-empty.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/dates_simple-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -16,9 +16,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/dates_simple-overlap.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/dates_simple-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -13,9 +13,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/duration-empty.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/duration-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -14,9 +14,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/duration-overlap.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/duration-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -24,9 +24,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums-empty.catala_en:15.10-11
┌─⯈ tests/test_proof/bad/enums-empty.catala_en:15.10-11:
└──┐
15 │ context x content integer
│ ‾
└─ Test

View File

@ -22,9 +22,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums-nonbool-empty.catala_en:13.10-11
┌─⯈ tests/test_proof/bad/enums-nonbool-empty.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test

View File

@ -22,9 +22,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums-nonbool-overlap.catala_en:13.10-11
┌─⯈ tests/test_proof/bad/enums-nonbool-overlap.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test

View File

@ -24,9 +24,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums-overlap.catala_en:15.10-11
┌─⯈ tests/test_proof/bad/enums-overlap.catala_en:15.10-11:
└──┐
15 │ context x content integer
│ ‾
└─ Test

View File

@ -17,9 +17,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums_inj-empty.catala_en:10.10-11
┌─⯈ tests/test_proof/bad/enums_inj-empty.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article

View File

@ -19,9 +19,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums_inj-overlap.catala_en:10.10-11
┌─⯈ tests/test_proof/bad/enums_inj-overlap.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article

View File

@ -22,9 +22,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/enums_unit-empty.catala_en:10.10-11
┌─⯈ tests/test_proof/bad/enums_unit-empty.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article

View File

@ -22,9 +22,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/enums_unit-overlap.catala_en:10.10-11
┌─⯈ tests/test_proof/bad/enums_unit-overlap.catala_en:10.10-11:
└──┐
10 │ context y content integer
│ ‾
└─ Article

View File

@ -17,9 +17,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/money-empty.catala_en:8.10-11
┌─⯈ tests/test_proof/bad/money-empty.catala_en:8.10-11:
└─┐
8 │ context y content boolean
│ ‾
└─ Test

View File

@ -18,9 +18,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/money-overlap.catala_en:8.10-11
┌─⯈ tests/test_proof/bad/money-overlap.catala_en:8.10-11:
└─┐
8 │ context y content boolean
│ ‾
└─ Test

View File

@ -18,9 +18,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/no_vars-conflict.catala_en:8.10-11
┌─⯈ tests/test_proof/bad/no_vars-conflict.catala_en:8.10-11:
└─┐
8 │ context y content integer
│ ‾
└─ Test

View File

@ -17,9 +17,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/no_vars-empty.catala_en:7.10-11
┌─⯈ tests/test_proof/bad/no_vars-empty.catala_en:7.10-11:
└─┐
7 │ context y content integer
│ ‾
└─ Test

View File

@ -124,27 +124,24 @@ scope Amount:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [Amount.amount] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:60.10-16
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:60.10-16:
└──┐
60 │ context amount content integer
│ ‾‾‾‾‾‾
└┬ ProLaLa 2022 Super Cash Bonus
└─ Amount
Counterexample generation is disabled so none was generated.
[ERROR] [Eligibility.is_eligible] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:11.9-20
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:11.9-20:
└──┐
11 │ output is_eligible content boolean
│ ‾‾‾‾‾‾‾‾‾‾‾
└┬ ProLaLa 2022 Super Cash Bonus
└─ Eligibility
Counterexample generation is disabled so none was generated.
[ERROR] [Eligibility.is_eligible] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:11.9-20
┌─⯈ tests/test_proof/bad/prolala_motivating_example.catala_en:11.9-20:
└──┐
11 │ output is_eligible content boolean
│ ‾‾‾‾‾‾‾‾‾‾‾
└┬ ProLaLa 2022 Super Cash Bonus

View File

@ -13,9 +13,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/rationals-empty.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/rationals-empty.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -14,9 +14,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.y] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/rationals-overlap.catala_en:6.10-11
┌─⯈ tests/test_proof/bad/rationals-overlap.catala_en:6.10-11:
└─┐
6 │ context y content boolean
│ ‾
└─ Test

View File

@ -41,9 +41,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.x10] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/sat_solving.catala_en:15.10-13
┌─⯈ tests/test_proof/bad/sat_solving.catala_en:15.10-13:
└──┐
15 │ context x10 content boolean
│ ‾‾‾
└─ Test

View File

@ -22,9 +22,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.x] This variable might return an empty error:
┌─⯈ tests/test_proof/bad/structs-empty.catala_en:13.10-11
┌─⯈ tests/test_proof/bad/structs-empty.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test

View File

@ -22,9 +22,8 @@ scope A:
```catala-test-inline
$ catala Proof --disable_counterexamples
[ERROR] [A.x] At least two exceptions overlap for this variable:
┌─⯈ tests/test_proof/bad/structs-overlap.catala_en:13.10-11
┌─⯈ tests/test_proof/bad/structs-overlap.catala_en:13.10-11:
└──┐
13 │ context x content integer
│ ‾
└─ Test

View File

@ -19,49 +19,43 @@ $ catala Interpret -s A
[ERROR] Cyclic dependency detected between variables of scope A!
Cycle variable z, declared:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:7.10-11
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:7.10-11:
└─┐
7 │ context z content integer
│ ‾
└─ Article
Used here in the definition of another cycle variable x:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:14.22-23
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:14.22-23:
└──┐
14 │ definition x equals z
│ ‾
└─ Article
Cycle variable y, declared:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:6.10-11
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:6.10-11:
└─┐
6 │ context y content integer
│ ‾
└─ Article
Used here in the definition of another cycle variable z:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:13.31-32
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:13.31-32:
└──┐
13 │ definition z under condition y < 1 consequence equals y
│ ‾
└─ Article
Cycle variable x, declared:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:5.10-11
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:5.10-11:
└─┐
5 │ context x content integer
│ ‾
└─ Article
Used here in the definition of another cycle variable y:
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:11.31-32
┌─⯈ tests/test_scope/bad/cycle_in_scope.catala_en:11.31-32:
└──┐
11 │ definition y under condition x >= 0 consequence equals x
│ ‾
└─ Article

View File

@ -21,33 +21,29 @@ $ catala Interpret -s A
[ERROR] Cyclic dependency detected between scopes!
Cycle variable B, declared:
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:8.18-19
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:8.18-19:
└─┐
8 │ declaration scope B:
│ ‾
└─ Article
Used here in the definition of another cycle variable A:
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:5.2-3
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:5.2-3:
└─┐
5 │ b scope B
│ ‾
└─ Article
Cycle variable A, declared:
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:4.18-19
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:4.18-19:
└─┐
4 │ declaration scope A:
│ ‾
└─ Article
Used here in the definition of another cycle variable B:
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:9.2-3
┌─⯈ tests/test_scope/bad/cyclic_scopes.catala_en:9.2-3:
└─┐
9 │ a scope A
│ ‾
└─ Article

View File

@ -19,17 +19,15 @@ $ catala Interpret -s A
[ERROR] There is a conflict between multiple valid consequences for assigning the same variable.
This consequence has a valid justification:
┌─⯈ tests/test_scope/bad/scope.catala_en:13.56-60
┌─⯈ tests/test_scope/bad/scope.catala_en:13.56-60:
└──┐
13 │ definition b under condition not c consequence equals 1337
│ ‾‾‾‾
└─ Article
This consequence has a valid justification:
┌─⯈ tests/test_scope/bad/scope.catala_en:14.56-57
┌─⯈ tests/test_scope/bad/scope.catala_en:14.56-57:
└──┐
14 │ definition b under condition not c consequence equals 0
│ ‾
└─ Article

View File

@ -18,9 +18,8 @@ scope Titi:
$ catala dcalc -s Titi
[ERROR] Duplicate definition of scope input variable 'bar'
┌─⯈ tests/test_scope/bad/scope_call_duplicate.catala_en:14.57-60
┌─⯈ tests/test_scope/bad/scope_call_duplicate.catala_en:14.57-60:
└──┐
14 │ definition fizz equals Toto of {--bar: 1 --baz: 2.1 -- bar: 3}
│ ‾‾‾

View File

@ -18,17 +18,15 @@ scope Titi:
$ catala dcalc -s Titi
[ERROR] Scope Toto has no input variable biz
┌─⯈ tests/test_scope/bad/scope_call_extra.catala_en:14.36-39
┌─⯈ tests/test_scope/bad/scope_call_extra.catala_en:14.36-39:
└──┐
14 │ definition fizz equals Toto of {--biz: 1}
│ ‾‾‾
Scope Toto declared here
┌─⯈ tests/test_scope/bad/scope_call_extra.catala_en:2.18-22
┌─⯈ tests/test_scope/bad/scope_call_extra.catala_en:2.18-22:
└─┐
2 │ declaration scope Toto:
│ ‾‾‾‾

View File

@ -18,17 +18,15 @@ scope Titi:
$ catala dcalc -s Titi
[ERROR] Definition of input variable 'baz' missing in this scope call
┌─⯈ tests/test_scope/bad/scope_call_missing.catala_en:14.25-43
┌─⯈ tests/test_scope/bad/scope_call_missing.catala_en:14.25-43:
└──┐
14 │ definition fizz equals Toto of {--bar: 1}
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
Declaration of the missing input variable
┌─⯈ tests/test_scope/bad/scope_call_missing.catala_en:4.8-11
┌─⯈ tests/test_scope/bad/scope_call_missing.catala_en:4.8-11:
└─┐
4 │ input baz content decimal
│ ‾‾‾

View File

@ -17,9 +17,8 @@ scope B:
$ catala Interpret -s A
[ERROR] The subscope a is used when defining one of its inputs, but recursion is forbidden in Catala
┌─⯈ tests/test_scope/bad/sub_vars_in_sub_var.catala_en:13.27-30
┌─⯈ tests/test_scope/bad/sub_vars_in_sub_var.catala_en:13.27-30:
└──┐
13 │ definition a.y equals if a.x then 0 else 1
│ ‾‾‾
└─ Article

View File

@ -20,9 +20,8 @@ scope A:
$ catala Interpret -s A
[ERROR] This struct field name is ambiguous, it can belong to Foo or Bar. Disambiguate it by prefixing it with the struct name.
┌─⯈ tests/test_struct/bad/ambiguous_fields.catala_en:16.24-25
┌─⯈ tests/test_struct/bad/ambiguous_fields.catala_en:16.24-25:
└──┐
16 │ definition y equals x.f
│ ‾
└─ Article

View File

@ -21,17 +21,15 @@ $ catala Interpret -s A
[ERROR] struct name "S" already defined
First definition:
┌─⯈ tests/test_struct/bad/bug_107.catala_en:4.22-23
┌─⯈ tests/test_struct/bad/bug_107.catala_en:4.22-23:
└─┐
4 │ declaration structure S:
│ ‾
└─ https://github.com/CatalaLang/catala/issues/107
Second definition:
┌─⯈ tests/test_struct/bad/bug_107.catala_en:8.22-23
┌─⯈ tests/test_struct/bad/bug_107.catala_en:8.22-23:
└─┐
8 │ declaration structure S:
│ ‾
└─ https://github.com/CatalaLang/catala/issues/107

View File

@ -11,9 +11,8 @@ declaration scope Bar:
$ catala Typecheck
[ERROR] The struct Foo does not have any fields; give it some for Catala to be able to accept it.
┌─⯈ tests/test_struct/bad/empty_struct.catala_en:4.22-25
┌─⯈ tests/test_struct/bad/empty_struct.catala_en:4.22-25:
└─┐
4 │ declaration structure Foo:
│ ‾‾‾
└─ Test

View File

@ -16,9 +16,8 @@ scope A:
$ catala Interpret -s A
[ERROR] The type E is defined using itself, which is forbidden since Catala does not provide recursive types
┌─⯈ tests/test_struct/bad/nested.catala_en:6.17-18
┌─⯈ tests/test_struct/bad/nested.catala_en:6.17-18:
└─┐
6 │ -- Rec content E
│ ‾
└─ Article

View File

@ -18,33 +18,29 @@ $ catala Interpret -s A
[ERROR] Cyclic dependency detected between types!
Cycle type S, declared:
┌─⯈ tests/test_struct/bad/nested2.catala_en:4.22-23
┌─⯈ tests/test_struct/bad/nested2.catala_en:4.22-23:
└─┐
4 │ declaration structure S:
│ ‾
└─ Article
Used here in the definition of another cycle type E:
┌─⯈ tests/test_struct/bad/nested2.catala_en:10.19-20
┌─⯈ tests/test_struct/bad/nested2.catala_en:10.19-20:
└──┐
10 │ -- Case2 content S
│ ‾
└─ Article
Cycle type E, declared:
┌─⯈ tests/test_struct/bad/nested2.catala_en:8.24-25
┌─⯈ tests/test_struct/bad/nested2.catala_en:8.24-25:
└─┐
8 │ declaration enumeration E:
│ ‾
└─ Article
Used here in the definition of another cycle type S:
┌─⯈ tests/test_struct/bad/nested2.catala_en:5.17-18
┌─⯈ tests/test_struct/bad/nested2.catala_en:5.17-18:
└─┐
5 │ data x content E
│ ‾
└─ Article

View File

@ -17,9 +17,8 @@ scope A:
$ catala Interpret -s A
[ERROR] No struct named Fo found
┌─⯈ tests/test_struct/bad/nonexisting_struct.catala_en:13.24-26
┌─⯈ tests/test_struct/bad/nonexisting_struct.catala_en:13.24-26:
└──┐
13 │ definition y equals x.Fo.f
│ ‾‾
└─ Article

View File

@ -21,9 +21,8 @@ scope A:
$ catala Interpret -s A
[ERROR] Struct Foo does not contain field g
┌─⯈ tests/test_struct/bad/wrong_qualified_field.catala_en:17.22-29
┌─⯈ tests/test_struct/bad/wrong_qualified_field.catala_en:17.22-29:
└──┐
17 │ definition y equals x.Foo.g
│ ‾‾‾‾‾‾‾
└─ Article

View File

@ -17,25 +17,22 @@ $ catala Typecheck
--> integer
Error coming from typechecking the following expression:
┌─⯈ tests/test_typing/bad/err1.catala_en:7.22-25
┌─⯈ tests/test_typing/bad/err1.catala_en:7.22-25:
└─┐
7 │ Structure { -- i: 4.1 -- e: y };
│ ‾‾‾
Type decimal coming from expression:
┌─⯈ tests/test_typing/bad/err1.catala_en:7.22-25
┌─⯈ tests/test_typing/bad/err1.catala_en:7.22-25:
└─┐
7 │ Structure { -- i: 4.1 -- e: y };
│ ‾‾‾
Type integer coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:8.17-24
┌─⯈ tests/test_typing/bad/common.catala_en:8.17-24:
└─┐
8 │ data i content integer
│ ‾‾‾‾‾‾‾

View File

@ -17,25 +17,22 @@ $ catala Typecheck
--> decimal
Error coming from typechecking the following expression:
┌─⯈ tests/test_typing/bad/err2.catala_en:10.43-44
┌─⯈ tests/test_typing/bad/err2.catala_en:10.43-44:
└──┐
10 │ definition a equals number of (z ++ 1.1) / 2
│ ‾
Type integer coming from expression:
┌─⯈ tests/test_typing/bad/err2.catala_en:10.43-44
┌─⯈ tests/test_typing/bad/err2.catala_en:10.43-44:
└──┐
10 │ definition a equals number of (z ++ 1.1) / 2
│ ‾
Type decimal coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26:
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾

View File

@ -17,25 +17,22 @@ $ catala Typecheck
--> decimal
Error coming from typechecking the following expression:
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
└──┐
10 │ definition a equals number of (z ++ z) / 2
│ ‾
Type integer coming from expression:
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
└──┐
10 │ definition a equals number of (z ++ z) / 2
│ ‾
Type decimal coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26:
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾
@ -51,25 +48,22 @@ $ catala ocaml
--> decimal
Error coming from typechecking the following expression:
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
└──┐
10 │ definition a equals number of (z ++ z) / 2
│ ‾
Type integer coming from expression:
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
└──┐
10 │ definition a equals number of (z ++ z) / 2
│ ‾
Type decimal coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26:
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾

View File

@ -15,25 +15,22 @@ $ catala ocaml
--> Structure
Error coming from typechecking the following expression:
┌─⯈ tests/test_typing/bad/err4.catala_en:5.24-37
┌─⯈ tests/test_typing/bad/err4.catala_en:5.24-37:
└─┐
5 │ definition z equals [ Int content x ]
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
Type Enum coming from expression:
┌─⯈ tests/test_typing/bad/err4.catala_en:5.24-37
┌─⯈ tests/test_typing/bad/err4.catala_en:5.24-37:
└─┐
5 │ definition z equals [ Int content x ]
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾
Type Structure coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:14.30-39
┌─⯈ tests/test_typing/bad/common.catala_en:14.30-39:
└──┐
14 │ output z content collection Structure
│ ‾‾‾‾‾‾‾‾‾

View File

@ -17,25 +17,22 @@ $ catala Typecheck
--> Structure
Error coming from typechecking the following expression:
┌─⯈ tests/test_typing/bad/err5.catala_en:8.4-8
┌─⯈ tests/test_typing/bad/err5.catala_en:8.4-8:
└─┐
8 │ 1040
│ ‾‾‾‾
Type integer coming from expression:
┌─⯈ tests/test_typing/bad/err5.catala_en:8.4-8
┌─⯈ tests/test_typing/bad/err5.catala_en:8.4-8:
└─┐
8 │ 1040
│ ‾‾‾‾
Type Structure coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:14.30-39
┌─⯈ tests/test_typing/bad/common.catala_en:14.30-39:
└──┐
14 │ output z content collection Structure
│ ‾‾‾‾‾‾‾‾‾

View File

@ -33,25 +33,22 @@ $ catala ocaml
--> integer
Error coming from typechecking the following expression:
┌─⯈ tests/test_typing/bad/err6.catala_en:20.26-29
┌─⯈ tests/test_typing/bad/err6.catala_en:20.26-29:
└──┐
20 │ definition sub.x equals 44.
│ ‾‾‾
Type decimal coming from expression:
┌─⯈ tests/test_typing/bad/err6.catala_en:20.26-29
┌─⯈ tests/test_typing/bad/err6.catala_en:20.26-29:
└──┐
20 │ definition sub.x equals 44.
│ ‾‾‾
Type integer coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:12.18-25
┌─⯈ tests/test_typing/bad/common.catala_en:12.18-25:
└──┐
12 │ input x content integer
│ ‾‾‾‾‾‾‾

View File

@ -14,17 +14,15 @@ scope A:
$ catala Typecheck
[ERROR] This definition does not indicate which state has to be considered for variable foo.
┌─⯈ tests/test_variable_state/bad/def_no_state.catala_en:10.13-16
┌─⯈ tests/test_variable_state/bad/def_no_state.catala_en:10.13-16:
└──┐
10 │ definition foo equals 2
│ ‾‾‾
└─ Test
Variable declaration:
┌─⯈ tests/test_variable_state/bad/def_no_state.catala_en:5.9-12
┌─⯈ tests/test_variable_state/bad/def_no_state.catala_en:5.9-12:
└─┐
5 │ output foo content integer
│ ‾‾‾
└─ Test

View File

@ -18,9 +18,8 @@ scope A:
$ catala Typecheck
[ERROR] Unknown label for the scope variable foo.baz: "thing"
┌─⯈ tests/test_variable_state/bad/no_cross_exceptions.catala_en:14.12-17
┌─⯈ tests/test_variable_state/bad/no_cross_exceptions.catala_en:14.12-17:
└──┐
14 │ exception thing definition foo state baz under condition true consequence equals 3
│ ‾‾‾‾‾
└─ Test

View File

@ -16,9 +16,8 @@ scope A:
$ catala Typecheck
[ERROR] It is impossible to refer to the variable you are defining when defining its first state.
┌─⯈ tests/test_variable_state/bad/self_reference_first_state.catala_en:10.34-37
┌─⯈ tests/test_variable_state/bad/self_reference_first_state.catala_en:10.34-37:
└──┐
10 │ definition foo state bar equals foo + 1
│ ‾‾‾
└─ Test

View File

@ -24,65 +24,57 @@ $ catala Typecheck
[ERROR] Cyclic dependency detected between variables of scope A!
Cycle variable foofoo.bar, declared:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:9.10-13
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:9.10-13:
└─┐
9 │ state bar
│ ‾‾‾
└─ Test
Used here in the definition of another cycle variable foofoo.baz:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:19.37-43
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:19.37-43:
└──┐
19 │ definition foofoo state baz equals foofoo + 1
│ ‾‾‾‾‾‾
└─ Test
Cycle variable foofoo.baz, declared:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:10.10-13
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:10.10-13:
└──┐
10 │ state baz
│ ‾‾‾
└─ Test
Used here in the definition of another cycle variable foo.bar:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:13.34-40
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:13.34-40:
└──┐
13 │ definition foo state bar equals foofoo
│ ‾‾‾‾‾‾
└─ Test
Cycle variable foo.bar, declared:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:6.10-13
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:6.10-13:
└─┐
6 │ state bar
│ ‾‾‾
└─ Test
Used here in the definition of another cycle variable foo.baz:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:15.34-37
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:15.34-37:
└──┐
15 │ definition foo state baz equals foo + 1
│ ‾‾‾
└─ Test
Cycle variable foo.baz, declared:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:7.10-13
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:7.10-13:
└─┐
7 │ state baz
│ ‾‾‾
└─ Test
Used here in the definition of another cycle variable foofoo.bar:
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:17.37-40
┌─⯈ tests/test_variable_state/bad/state_cycle.catala_en:17.37-40:
└──┐
17 │ definition foofoo state bar equals foo
│ ‾‾‾
└─ Test

View File

@ -16,17 +16,15 @@ scope A:
$ catala Typecheck
[ERROR] This identifier is not a state declared for variable foo.
┌─⯈ tests/test_variable_state/bad/unknown_state.catala_en:12.23-27
┌─⯈ tests/test_variable_state/bad/unknown_state.catala_en:12.23-27:
└──┐
12 │ definition foo state basz equals foo + 1
│ ‾‾‾‾
└─ Test
Variable declaration:
┌─⯈ tests/test_variable_state/bad/unknown_state.catala_en:5.9-12
┌─⯈ tests/test_variable_state/bad/unknown_state.catala_en:5.9-12:
└─┐
5 │ output foo content integer
│ ‾‾‾
└─ Test