typst/typst

Make error more descriptive when non-sink argument is used instead of expected sink argument

Offen

#2.102 geöffnet am 10.09.2023

 (19 Kommentare) (3 Reaktionen) (0 zugewiesene Personen)Rust (1.574 Forks)batch import
diagnosticsfeature requestgood contributiongood first issuescripting

Repository-Metriken

Stars
 (53.538 Sterne)
PR-Merge-Metriken
 (Durchschn. Merge 8T 5h) (54 gemergte PRs in 30 T)

Beschreibung

The issue #2101 was created due to the next error message:

error: unexpected argument
   ┌─ /file.typ:42:21
   │
42 │   heading(numbering: it => it, name, ..args)
   │                      ^^

It shows that the argument is unexpected, but in reality it is of course expected, and instead of a normal argument, it should be a sink argument:

42 │   heading(numbering: (..it) => it, name, ..args)

The error did throw me off, but after an answer and some "digging" through the documentation, the error was resolved. In any case, the error message should be more descriptive and user-friendly.

Contributor Guide