diff options
| author | Leedehai <18319900+Leedehai@users.noreply.github.com> | 2024-01-02 04:13:45 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-01-02 09:13:45 +0000 |
| commit | 39e53fcdc9af2cabbc272387a64ac099e0b8077a (patch) | |
| tree | 763781da08792528c1330148ed6ee9951e880371 /crates | |
| parent | 527d63ed25d668eeb24e21ff441429fbcc7ad6a5 (diff) | |
Clarify the way to access functions from dictionaries (#3064)
Co-authored-by: Laurenz <laurmaedje@gmail.com>
Diffstat (limited to 'crates')
| -rw-r--r-- | crates/typst/src/eval/call.rs | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/crates/typst/src/eval/call.rs b/crates/typst/src/eval/call.rs index e15f2c33..3bdd9a46 100644 --- a/crates/typst/src/eval/call.rs +++ b/crates/typst/src/eval/call.rs @@ -110,10 +110,11 @@ impl Eval for ast::FuncCall<'_> { match target { Value::Dict(ref dict) => { if matches!(dict.get(&field), Ok(Value::Func(_))) { - error.hint( - "to call the function stored in the dictionary, \ - surround the field access with parentheses", - ); + error.hint(eco_format!( + "to call the function stored in the dictionary, surround \ + the field access with parentheses, e.g. `(dict.{})(..)`", + field.as_str(), + )); } else { field_hint(); } |
