Skip to content

Implement .as for Regex and Unify Match and AnyRegexOutput #376

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 5 commits into from
May 18, 2022

Conversation

Azoy
Copy link
Contributor

@Azoy Azoy commented May 3, 2022

No description provided.

@Azoy Azoy requested review from milseman and rxwei May 3, 2022 21:00
@Azoy Azoy force-pushed the types-types-and-more-types branch from 592e377 to 7e1ab7d Compare May 3, 2022 21:04
@Azoy
Copy link
Contributor Author

Azoy commented May 10, 2022

@swift-ci please test

@@ -17,17 +17,13 @@ extension Regex {
/// providing direct access to captures.
@dynamicMemberLookup
public struct Match {
let input: String
let anyRegexOutput: AnyRegexOutput

/// The range of the overall match.
public let range: Range<String.Index>
Copy link
Member

Choose a reason for hiding this comment

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

Doesn't ARO store this?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The ARO inside of Match does not store it, but match.output where Output == ARO does store it.

Copy link
Member

Choose a reason for hiding this comment

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

Wait, so sometimes ARO stores it and sometimes it doesn't? That seems like a footgun.

@Azoy
Copy link
Contributor Author

Azoy commented May 12, 2022

@swift-ci please test

@Azoy
Copy link
Contributor Author

Azoy commented May 12, 2022

@milseman anything else for this?

@hamishknight
Copy link
Contributor

@Azoy Should this be cherry-picked to 5.7? I have opened a PR: #447

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.

3 participants