2022-09-15 18:25:58 +03:00
> Include: common.catala_en
```catala
scope S:
definition z equals [
Structure { -- i: 3 -- e: Int content x };
Structure { -- i: 4 -- e: y };
Structure { -- i: 5 -- e: Dat content |1970-01-01| }
]
2022-12-12 19:55:53 +03:00
definition a equals number of (z ++ z) * 2
2022-09-15 18:25:58 +03:00
```
2022-09-23 15:04:13 +03:00
```catala-test-inline
$ catala Typecheck
2023-03-31 15:01:04 +03:00
[WARNING] The constructor "Dec" of enumeration "Enum" is never used; maybe it's unnecessary?
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:4.6-4.9:
2023-03-31 15:01:04 +03:00
└─┐
4 │ -- Dec content decimal
│ ‾‾‾
2022-09-15 19:28:29 +03:00
[ERROR] Error during typechecking, incompatible types:
2022-09-16 19:29:27 +03:00
--> integer
2022-09-20 19:32:38 +03:00
--> decimal
2022-09-15 19:28:29 +03:00
Error coming from typechecking the following expression:
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43:
2022-10-27 13:18:00 +03:00
└──┐
2022-12-12 19:55:53 +03:00
10 │ definition a equals number of (z ++ z) * 2
2022-10-27 13:18:00 +03:00
│ ‾
2022-09-15 19:28:29 +03:00
Type integer coming from expression:
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43:
2022-10-27 13:18:00 +03:00
└──┐
2022-12-12 19:55:53 +03:00
10 │ definition a equals number of (z ++ z) * 2
2022-10-27 13:18:00 +03:00
│ ‾
2022-09-20 19:32:38 +03:00
Type decimal coming from expression:
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:15.20-15.27:
2022-10-27 13:18:00 +03:00
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾
2022-09-16 19:29:27 +03:00
#return code 255#
```
2022-09-26 16:27:36 +03:00
Re-putting the same check again, to ensure that the `Typecheck` and `ocaml` subcommands output the same type error consistently (bug pointed out and fixed in 498429e).
2022-09-16 19:29:27 +03:00
```catala-test-inline
$ catala ocaml
2023-03-31 15:01:04 +03:00
[WARNING] The constructor "Dec" of enumeration "Enum" is never used; maybe it's unnecessary?
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:4.6-4.9:
2023-03-31 15:01:04 +03:00
└─┐
4 │ -- Dec content decimal
│ ‾‾‾
2022-09-16 19:29:27 +03:00
[ERROR] Error during typechecking, incompatible types:
--> integer
2022-09-20 19:32:38 +03:00
--> decimal
2022-09-16 19:29:27 +03:00
Error coming from typechecking the following expression:
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43:
2022-10-27 13:18:00 +03:00
└──┐
2022-12-12 19:55:53 +03:00
10 │ definition a equals number of (z ++ z) * 2
2022-10-27 13:18:00 +03:00
│ ‾
2022-09-15 19:28:29 +03:00
2022-09-16 19:29:27 +03:00
Type integer coming from expression:
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.42-10.43:
2022-10-27 13:18:00 +03:00
└──┐
2022-12-12 19:55:53 +03:00
10 │ definition a equals number of (z ++ z) * 2
2022-10-27 13:18:00 +03:00
│ ‾
2022-09-20 19:32:38 +03:00
Type decimal coming from expression:
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:15.20-15.27:
2022-10-27 13:18:00 +03:00
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾
2022-09-15 19:28:29 +03:00
#return code 255#
```