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

Update Regex t:compile_option/0 to reflect :re #13643

Closed
wants to merge 2 commits into from

Conversation

sabiwara
Copy link
Contributor

@sabiwara sabiwara commented Jun 6, 2024

Closes #13598.
Was caused by my PR.

Copied the spec from :re.

We can't just use :re type directly because it has been exported only recently.

@type re_option ::
@type nl_spec() :: :cr | :crlf | :lf | :anycrlf | :any

@type compile_option ::
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Also renamed since it's been introduced in 1.17, and I think it's clearer + matches :re's.

Copy link
Member

Choose a reason for hiding this comment

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

If it was introduced in 1.17.0, maybe we should remove them for now. Erlang said they will change the RE engine for OTP 28, so any of those options may no longer be supported in a year. So perhaps we should remove those for now and backport?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oh, do you think they'll break backwards compatibility?
This is a shame, these specs really help figuring out what the types are.

How about:

  • keeping compile_option :: term and run_option :: term just to make the intent and distinction clear
  • perhaps add a link to erlang's doc for options in typedoc

@sabiwara
Copy link
Contributor Author

sabiwara commented Jun 6, 2024

Note: to be backported if merged.

@sabiwara
Copy link
Contributor Author

sabiwara commented Jun 6, 2024

Closing in favor of #13645

@sabiwara sabiwara closed this Jun 6, 2024
@sabiwara sabiwara deleted the regex-types branch June 6, 2024 13:32
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.

Dialyzer fails on sigil_r with unicode (/u) modifier in 1.17-rc.0+ (was fine in 1.16.3-)
2 participants