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.

86 lines
2.4 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
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:
--> integer
--> 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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
Type decimal coming from expression:
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:15.20-15.27:
└──┐
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
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
│ ‾‾‾
[ERROR] Error during typechecking, incompatible types:
--> integer
--> decimal
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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
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:
└──┐
10 │ definition a equals number of (z ++ z) * 2
│ ‾
Type decimal coming from expression:
2023-04-17 19:07:22 +03:00
┌─⯈ tests/test_typing/bad/common.catala_en:15.20-15.27:
└──┐
15 │ output a content decimal
│ ‾‾‾‾‾‾‾
2022-09-15 19:28:29 +03:00
#return code 255#
```