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

Warn about potentially-confusing uses of function applications in patterns #31

Open
LPTK opened this issue Oct 19, 2017 · 0 comments
Open

Comments

@LPTK
Copy link
Member

LPTK commented Oct 19, 2017

Direct function application syntax on a pattern hole is currently interpreted as higher-order matching. To extract a function, one should ascribe the hole with a function type. This can lead to confusing error, such as the following:

[error] Embedding Error: Unexpected expression in higher-order pattern variable argument: 42
[error]     case ir"$f(42)" => println(s"$f(42)")
[error]          ^

In this case, the error message should inform and guide users who just wanted to extract a function...

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

No branches or pull requests

1 participant