Test case for Pattern.pattern and Pattern.toString#1590
Open
Test case for Pattern.pattern and Pattern.toString#1590
Pattern.pattern and Pattern.toString#1590Conversation
There was a problem hiding this comment.
Pull request overview
Adds a regression test in the regex checker test suite to ensure java.util.regex.Pattern.pattern() and Pattern.toString() preserve precise regex group-count information (via PolyRegex), addressing typetools issue typetools#7539 without over-approximating results as plain @Regex.
Changes:
- Introduce a new compilation test covering
Pattern.pattern()andPattern.toString()result usage inPattern.compile. - Verify group-count precision is preserved by expecting
group(3)to be rejected when the pattern has only 2 capturing groups.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Added closed issue typetools#7539 to the changelog.
Member
Author
|
Blocked on #1592. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Merge with eisop/jdk#132
Fixes typetools issue 7539 properly by using
PolyRegexon the return and receiver types.This preserves the regex information, instead of over-approximating it as
@Regex.