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

Do not consider map constructors as data in cerl:is_data/1 #306

Closed
wants to merge 1 commit into from

Conversation

nox
Copy link
Contributor

@nox nox commented Mar 23, 2014

The optimisation passes and cerl_clauses can't handle yet map expressions as data constructors.

@UlfNorell

The optimisation passes and cerl_clauses can't handle yet map expressions as
data constructors.

Reported-by: Ulf Norell
@psyeugenic psyeugenic self-assigned this Mar 24, 2014
@OTP-Maintainer
Copy link

Patch has passed first testings and has been assigned to be reviewed

@nox
Copy link
Contributor Author

nox commented Mar 24, 2014

Bug is more general than that and can be triggered by binary expressions too:

-module(bug).
f() -> 
  case <<>> of
    <<>>    -> ok;
    not_map -> error
  end.

Closing this until I find a better fix.

@nox nox closed this Mar 24, 2014
@bjorng
Copy link
Contributor

bjorng commented Mar 24, 2014

How did you intend to fix the bug?

What I would do is to change case_opt_lit/3 to do two passes. The first would discard any clauses that cannot possibly match. The second pass would rewrite the clauses to eliminate the pattern and update the bindings just as is done now.

That would ensure that warnings are generated consistently generated for all clauses that will not match.

What is your plan?

@nox
Copy link
Contributor Author

nox commented Mar 24, 2014

That's more or less what I plan to do.

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

Successfully merging this pull request may close these issues.

4 participants