diff --git a/tests/test_exception/good/double_definition.catala_en b/tests/test_exception/good/double_definition.catala_en new file mode 100644 index 00000000..5d543e95 --- /dev/null +++ b/tests/test_exception/good/double_definition.catala_en @@ -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 } +```