Skip to content

A user function named "isolate" (and a local named "when") is silently ignored / rejected: reserved words should be an error at the definition #2073

Description

@nicolas-maman

Aether 0.129 (the toolchain ae3d pins).

Defining a top-level function named isolate compiles without a diagnostic, and calls to it do nothing: the body never runs. In a 1,400-line tool I had

isolate(named: string) { ... sends a request ... }
...
isolate(mesh)

and the program behaved as if the call line were absent -- no error, no warning, no output from the body, the rest of the function proceeded. Renaming the function to show_only made it run. So isolate appears to be a word the language keeps (a builtin or keyword for something else), and a user definition of the same name is dropped instead of being refused.

Likewise a local named when:

    when = 0.0

fails with E0100: Expected statement in block pointing at the =, which at least fails, but names the wrong thing.

Expected: defining or assigning a reserved word is an error at the definition site that names the word as reserved ('isolate' is a keyword). Silently ignoring a call to a user function is the worst of the options -- it cost an hour to find in a port that was otherwise line-for-line.

Also seen, and worth the same message: ; after a closing } on the same line (if x { a } ; b) is E0100: Expected statement in block at the ; rather than a note that a statement cannot follow a block on its line.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions