mirror of
https://github.com/CatalaLang/catala.git
synced 2024-09-20 08:47:14 +03:00
45 lines
1.1 KiB
Plaintext
45 lines
1.1 KiB
Plaintext
## Article
|
|
|
|
```catala
|
|
declaration structure Foo:
|
|
data f content integer
|
|
|
|
declaration structure Bar:
|
|
data f content integer
|
|
|
|
declaration scope A:
|
|
context output x content Foo
|
|
context output y content integer
|
|
|
|
scope A:
|
|
definition x equals Foo { -- f: 1 }
|
|
definition y equals x.Foo.f
|
|
```
|
|
|
|
```catala-test-inline
|
|
$ catala Interpret -s A
|
|
[WARNING] The structure "Bar" is never used; maybe it's unnecessary?
|
|
|
|
┌─⯈ tests/test_struct/good/same_name_fields.catala_en:7.23-7.26:
|
|
└─┐
|
|
7 │ declaration structure Bar:
|
|
│ ‾‾‾
|
|
└─ Article
|
|
[RESULT] Computation successful! Results:
|
|
[RESULT] x = { "f" = 1}_Foo
|
|
[RESULT] y = 1
|
|
```
|
|
```catala-test-inline
|
|
$ catala Interpret_Lcalc -s A --avoid_exceptions --optimize
|
|
[WARNING] The structure "Bar" is never used; maybe it's unnecessary?
|
|
|
|
┌─⯈ tests/test_struct/good/same_name_fields.catala_en:7.23-7.26:
|
|
└─┐
|
|
7 │ declaration structure Bar:
|
|
│ ‾‾‾
|
|
└─ Article
|
|
[RESULT] Computation successful! Results:
|
|
[RESULT] x = ESome { "f" = ESome 1}_Foo
|
|
[RESULT] y = ESome 1
|
|
```
|