Skip to content

Fix type of RegExp.Result.matches #7393

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

Merged
merged 2 commits into from
Apr 15, 2025

Conversation

mediremi
Copy link
Contributor

@mediremi mediremi commented Apr 13, 2025

While the type RegExp.Result.t (array<option<string>>) is correct, matches was typed as array<string> even though it can contain undefined.

I've also used this PR to make RegExp.fromString more ergonomic by adding an optional flags argument and deprecating RegExp.fromStringWithFlags.

@mediremi mediremi force-pushed the regexp-result-matches-type branch from d39996e to 10d9d1f Compare April 13, 2025 17:10
@mediremi mediremi force-pushed the regexp-result-matches-type branch from 10d9d1f to aae95ea Compare April 13, 2025 17:21
@mediremi mediremi marked this pull request as ready for review April 13, 2025 17:25
@mediremi mediremi force-pushed the regexp-result-matches-type branch from dec17a4 to 0025d93 Compare April 13, 2025 17:46
Copy link
Member

@cknitt cknitt left a comment

Choose a reason for hiding this comment

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

Nice! Thanks a lot!

@cknitt cknitt merged commit 1f0d70d into rescript-lang:master Apr 15, 2025
20 checks passed
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.

2 participants