mirror of
https://github.com/typst/typst
synced 2025-05-13 20:46:23 +08:00
25 lines
379 B
Typst
25 lines
379 B
Typst
// Test field access.
|
|
// Ref: false
|
|
|
|
---
|
|
#let dict = (nothing: "ness", hello: "world")
|
|
#test(dict.nothing, "ness")
|
|
{
|
|
let world = dict
|
|
.hello
|
|
|
|
test(world, "world")
|
|
}
|
|
|
|
---
|
|
// Error: 6-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}
|