typst icon indicating copy to clipboard operation
typst copied to clipboard

Expressions in function parameters are accepted by the compiler

Open frozolotl opened this issue 1 year ago • 0 comments

Description

The following code is accepted by the compiler:

#let foo((test: "bar")) = {}

To my knowledge, this function can't be called, without the compiler throwing an error.

I would expect this code to not be accepted at all, even without calling it.

To solve this, it might be enough to just switch the false to true. https://github.com/typst/typst/blob/main/src/syntax/parser.rs#L1250

Reproduction URL

No response

Operating system

No response

Typst version

  • [X] I am using the latest version of Typst

frozolotl avatar May 28 '23 11:05 frozolotl