Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Anonymous variable _ is allowed outside of patterns #1975

Open
rodinaarssen opened this issue Jun 12, 2024 · 0 comments
Open

Anonymous variable _ is allowed outside of patterns #1975

rodinaarssen opened this issue Jun 12, 2024 · 0 comments
Labels

Comments

@rodinaarssen
Copy link
Member

Describe the bug

While _ is a valid identifier, it should not be allowed outside of patterns (e.g., as an expression, in an assignment, in a declaration). If assigned to, it gets a value, although it then still behaves "normally" in the context of a pattern.

To Reproduce

rascal>_ = 1;
int: 1
rascal>_
1
ok
rascal>_ := 2 && <_, _> := <"", |hi:///|>
bool: true
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant