diff options
| author | Laurenz <laurmaedje@gmail.com> | 2022-04-19 16:37:16 +0200 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2022-04-19 16:37:16 +0200 |
| commit | 7a2cc3e7d29d16c5cf9b5a93a688e14da93c8662 (patch) | |
| tree | 8ca787c56b84b83f5d34ee7b4701c0e8f4778753 /tests/typ/code/field.typ | |
| parent | 255d4c620f39133b40a9132843781f2a620a6008 (diff) | |
Field access
Diffstat (limited to 'tests/typ/code/field.typ')
| -rw-r--r-- | tests/typ/code/field.typ | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/tests/typ/code/field.typ b/tests/typ/code/field.typ new file mode 100644 index 00000000..b30d72e0 --- /dev/null +++ b/tests/typ/code/field.typ @@ -0,0 +1,24 @@ +// Test field access. +// Ref: false + +--- +#let dict = (nothing: "ness", hello: "world") +#test(dict.nothing, "ness") +{ + let world = dict + .hello + + test(world, "world") +} + +--- +// Error: 2-13 dictionary does not contain key: "invalid" +{(:).invalid} + +--- +// Error: 2-7 cannot access field on boolean +{false.ok} + +--- +// Error: 8-12 expected identifier, found boolean +{false.true} |
