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
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:
2022-11-24 20:00:45 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
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:
2022-11-24 20:00:45 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
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:
2022-11-24 20:00:45 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26:
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
[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:
2022-11-24 20:00:45 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
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:
2022-11-24 20:00:45 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
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:
2022-11-24 20:00:45 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26:
2022-10-27 13:18:00 +03:00
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾
2022-09-15 19:28:29 +03:00
#return code 255#
```