From 7a2cc3e7d29d16c5cf9b5a93a688e14da93c8662 Mon Sep 17 00:00:00 2001 From: Laurenz Date: Tue, 19 Apr 2022 16:37:16 +0200 Subject: Field access --- tests/typ/code/field.typ | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 tests/typ/code/field.typ (limited to 'tests/typ/code') 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} -- cgit v1.2.3