mirror of
https://github.com/CatalaLang/catala.git
synced 2024-11-09 01:35:56 +03:00
8960e5dbbc
Some typing errors are changed a little, because they get triggered during the typing of the disambiguation pass, which does not specify the expected return type (it's an expected invariant that it should not be needed for disambiguation). It would be possible to still specify these types during disambiguation just to get the same errors, but since the newer ones don't appear to be clearly worse at the moment, it has not been done.
41 lines
956 B
Plaintext
41 lines
956 B
Plaintext
> Include: common.catala_en
|
|
|
|
```catala
|
|
scope S:
|
|
definition z equals [
|
|
Structure { -- i: 3 -- e: Int content x };
|
|
Structure { -- i: 4 -- e: y };
|
|
1040
|
|
]
|
|
definition a equals number of (z ++ z) / 2
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Typecheck
|
|
[ERROR] Error during typechecking, incompatible types:
|
|
--> integer
|
|
--> Structure
|
|
|
|
Error coming from typechecking the following expression:
|
|
┌─⯈ tests/test_typing/bad/err5.catala_en:8.4-8:
|
|
└─┐
|
|
8 │ 1040
|
|
│ ‾‾‾‾
|
|
|
|
|
|
Type integer coming from expression:
|
|
┌─⯈ tests/test_typing/bad/err5.catala_en:8.4-8:
|
|
└─┐
|
|
8 │ 1040
|
|
│ ‾‾‾‾
|
|
|
|
|
|
Type Structure coming from expression:
|
|
┌─⯈ tests/test_typing/bad/err5.catala_en:6.4-45:
|
|
└─┐
|
|
6 │ Structure { -- i: 3 -- e: Int content x };
|
|
│ ‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾‾
|
|
|
|
#return code 255#
|
|
```
|