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

Added when clauses in pretty printed contracts. #8

Merged
merged 1 commit into from
Aug 26, 2018

Conversation

asummers
Copy link
Owner

Going to let this sit for a second to coordinate with reporting user to verify fix. This also fixes up some minor issues from #4 found when implementing.

Resolves #2

pretty_printed = Erlex.pretty_print(input)

expected_output =
"(:Atom, :Encoding) :: binary() when Atom: atom(), Encoding: :latin1 | :utf8"
Copy link

Choose a reason for hiding this comment

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

Atom and Encoding are variables, not atoms. I think the output should be:

"(atom, encoding) :: binary() when atom :: atom(), encoding :: :latin1 | :utf8"

Copy link
Owner Author

@asummers asummers Aug 23, 2018

Choose a reason for hiding this comment

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

That's a deeper issue this exposed that is slightly out of scope of this fix. I need to figure out how to detect Erlang terms as opposed to Elixir ones and handle them specially.

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.

Handle when clauses in function heads.
2 participants