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

Take into account the provided format in Utf8Parser.TryParse for bool #100676

Closed
wants to merge 3 commits into from
Closed

Take into account the provided format in Utf8Parser.TryParse for bool #100676

wants to merge 3 commits into from

Conversation

joegoldman2
Copy link
Contributor

Fixes #100659.
I couldn't find any existing unit tests for this class but I'd be happy to add/update them if anyone can give me a hint.

Copy link
Contributor

Tagging subscribers to this area: @dotnet/area-system-memory
See info in area-owners.md if you want to be subscribed.

@dotnet-policy-service dotnet-policy-service bot added the community-contribution Indicates that the PR has been added by a community member label Apr 5, 2024
@stephentoub
Copy link
Member

Thanks for the issue and fix.

I'm not sure we should take this, though. It's been this way for a very long time, and there could easily be code relying on both casings being parsed.

Can you elaborate on in what situation it's breaking you that TryParse allows for additional casings to be parsed successfully?

@joegoldman2
Copy link
Contributor Author

Thank you for your feedback.

To be honest, I don't have a scenario in mind and I saw the "issue" when reading the code. I'm fine with keeping the current implementation, which allows parsing regardless of the case sensitivity.

@stephentoub
Copy link
Member

Thanks. Personally, I'd be more inclined to "fix" the comment in the source as well as the docs, to make them match the long-standing behavior. But I'll leave that up to the area owners. @dotnet/area-system-buffers ?

@tannergooding
Copy link
Member

I'd like weigh in from @GrabYourPitchforks since he was involved in getting this all supported in the first place.

I think this is overall less important if we just update System.Boolean to implement IUtf8SpanParsable and `IUtf8SpanFormattable. There are a number of existing quirks/oddities with the Utf8Parser/Utf8Formatter types and we opted not to "fix" those either.

@joegoldman2
Copy link
Contributor Author

Closing in favor of #103861.

@github-actions github-actions bot locked and limited conversation to collaborators Jul 24, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Memory community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Utf8Parser.TryParse ignores the provided format for bool
3 participants