catala/tests/struct/good/ambiguous_fields.catala_en
2024-05-03 15:27:06 +02:00

55 lines
1.0 KiB
Plaintext

## Article
```catala
declaration structure Foo:
data f content integer
declaration structure Bar:
data f content integer
declaration scope A:
internal x content Foo
output y content integer
scope A:
definition x equals Foo { -- f: 1 }
definition y equals x.f
```
```catala-test-inline
$ catala Typecheck --check-invariants
┌─[WARNING]─
│ The structure "Bar" is never used; maybe it's unnecessary?
├─➤ tests/struct/good/ambiguous_fields.catala_en:7.23-7.26:
│ │
│ 7 │ declaration structure Bar:
│ │ ‾‾‾
└─ Article
┌─[RESULT]─
│ All invariant checks passed
└─
┌─[RESULT]─
│ Typechecking successful!
└─
```
```catala-test-inline
$ catala test-scope A
┌─[WARNING]─
│ The structure "Bar" is never used; maybe it's unnecessary?
├─➤ tests/struct/good/ambiguous_fields.catala_en:7.23-7.26:
│ │
│ 7 │ declaration structure Bar:
│ │ ‾‾‾
└─ Article
┌─[RESULT]─
│ y = 1
└─
```