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

Improve error when using non-arith guard BIF in match #5667

Merged
merged 2 commits into from
Jan 18, 2017
Merged

Conversation

fishcakez
Copy link
Member

Only arith BIFs are allowed in matches.

Partial fix for #5666.

Only arith BIFs are allowed in matches
test "invalid :erlang call on guard" do
assert_compile_fail CompileError,
"nofile:1: cannot invoke remote function :erlang.make_ref/0 inside match",
'case [] do; :erlang.make_ref() -> :ok; end'
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know the rest of the file is like this so that might be the reason, but why are we using ;s here instead of:

case [] do :erlang.make_ref() -> :ok end

Is there a specific reason or just No Particular Reason™?

@fishcakez
Copy link
Member Author

fishcakez commented Jan 17, 2017 via email

@whatyouhide
Copy link
Member

That's what rest of file did?

Yup, I suspected this :)

@fishcakez
Copy link
Member Author

Yup, I suspected this :)

Would you like to change it?

@whatyouhide
Copy link
Member

@fishcakez We can change it on the whole file after this if we care about this, for this PR I think we're ok sticking with what's in the file. Wdyt?

@fishcakez
Copy link
Member Author

@whatyouhide ok, I have fixed the guard test.

@fishcakez fishcakez merged commit a47f97b into master Jan 18, 2017
@fishcakez fishcakez deleted the jf-match-arith branch January 18, 2017 11:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants