Added a test related to #449

This commit is contained in:
Denis Merigoux 2023-04-14 10:59:39 +02:00
parent b2beec0bcc
commit 2d34fe7f27
No known key found for this signature in database
GPG Key ID: EE99DCFA365C3EE3

View 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 }
```