Skip to content

Confusing error when missing space between function name and body #1909

@zzamboni

Description

@zzamboni

What happened, and what did you expect to happen?

Elvish produces a confusing error when a function definition is missing the space between the name and the body:

> fn foo{print "hi"}
compilation error: [interactive]:1:4-18: name must be string literal, found compound expression

I think it would be nice to produce a better explanation of what's wrong in this case, since it can be a common error to make.

Output of "elvish -version"

0.21.0

Code of Conduct

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ❓Triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions