catala/tests/test_typing/bad/err3.catala_en

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

72 lines
1.9 KiB
Plaintext
Raw Normal View History

> 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
2022-09-15 19:28:29 +03:00
[ERROR] Error during typechecking, incompatible types:
--> integer
--> 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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
Type decimal coming from expression:
2022-11-24 20:00:45 +03:00
┌─⯈ 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:
2022-11-24 20:00:45 +03:00
┌─⯈ tests/test_typing/bad/err3.catala_en:10.41-42:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
Type decimal coming from expression:
2022-11-24 20:00:45 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:15.19-26:
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾
2022-09-15 19:28:29 +03:00
#return code 255#
```