catala/tests/test_typing/bad/err3.catala_en
Louis Gesbert c94509e0bb Remove integer division from the language
it's unlikely to be used in any law, and likely to be cause for confusion.

best of all, the new operator has a different return type, which
ensures no inconsistency with the change can get overlooked.
2022-12-13 12:35:02 +01:00

72 lines
1.9 KiB
Plaintext

> 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| }
]
definition a equals number of (z ++ z) * 2
```
```catala-test-inline
$ catala Typecheck
[ERROR] Error during typechecking, incompatible types:
--> integer
--> decimal
Error coming from typechecking the following expression:
┌─⯈ 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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
Type decimal coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26:
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾
#return code 255#
```
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).
```catala-test-inline
$ catala ocaml
[ERROR] Error during typechecking, incompatible types:
--> integer
--> decimal
Error coming from typechecking the following expression:
┌─⯈ 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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
Type decimal coming from expression:
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26:
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾
#return code 255#
```