mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 00:41:05 +03:00
Added a test related to #449
This commit is contained in:
parent
b2beec0bcc
commit
2d34fe7f27
32
tests/test_exception/good/double_definition.catala_en
Normal file
32
tests/test_exception/good/double_definition.catala_en
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
## Foo
|
||||||
|
|
||||||
|
```catala
|
||||||
|
declaration scope Foo:
|
||||||
|
output x content integer
|
||||||
|
|
||||||
|
scope Foo:
|
||||||
|
definition x equals 1
|
||||||
|
definition x equals 1
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
|
```catala-test-inline
|
||||||
|
$ catala Scopelang -s Foo
|
||||||
|
let scope Foo (x: integer|internal|output) =
|
||||||
|
let x : integer = ⟨⟨true ⊢ 1⟩, ⟨true ⊢ 1⟩ | false ⊢ ∅ ⟩
|
||||||
|
```
|
||||||
|
|
||||||
|
In Scopelang we have what looks like conflicting exceptions. But after
|
||||||
|
discussions related in https://github.com/CatalaLang/catala/issues/208, we
|
||||||
|
have decided to relax this behavior when translating to Dcalc because the
|
||||||
|
consequences of the conflicting exceptions are the same. Hence the
|
||||||
|
Dcalc translation below.
|
||||||
|
|
||||||
|
```catala-test-inline
|
||||||
|
$ catala Dcalc -s Foo
|
||||||
|
let Foo =
|
||||||
|
λ (Foo_in: Foo_in {}) →
|
||||||
|
let x : integer = error_empty
|
||||||
|
⟨⟨⟨true ⊢ 1⟩ | true ⊢ 1⟩ | false ⊢ ∅ ⟩ in
|
||||||
|
Foo { "x"= x }
|
||||||
|
```
|
Loading…
Reference in New Issue
Block a user