Uh oh!
There was an error while loading. Please reload this page.
Add IParsable/ISpanParsable to Rune - #129464
Conversation
…lt result on failure Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Pull request overview
This PR expands System.Text.Rune’s generic parsing support by making it implement IParsable<Rune> and ISpanParsable<Rune> (explicitly), aligning with the existing explicit IUtf8SpanParsable<Rune> pattern. It updates the System.Runtime ref surface accordingly and adds targeted unit tests for the new parsing behaviors.
Changes:
- Add
IParsable<Rune>/ISpanParsable<Rune>toRuneand implement the four explicit interface members usingDecodeFromUtf16+ full-consumption checks. - Update
System.Runtimeref to include the new interfaces and explicit member declarations onRune. - Add new
RuneTestscoverage for valid/invalid UTF-16 single-rune inputs for both string and span parsing paths.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| src/libraries/System.Private.CoreLib/src/System/Text/Rune.cs | Adds explicit IParsable<Rune> / ISpanParsable<Rune> implementations backed by DecodeFromUtf16 and full-input validation. |
| src/libraries/System.Runtime/ref/System.Runtime.cs | Updates the public contract for Rune to include the two new interfaces and explicit members. |
| src/libraries/System.Runtime/tests/System.Runtime.Tests/System/Text/RuneTests.cs | Adds theory-based tests for string/span parse and try-parse success and failure cases. |
Uh oh!
There was an error while loading. Please reload this page.
… Decode tests Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: MihaZupan <25307628+MihaZupan@users.noreply.github.com> Co-authored-by: Miha Zupan <mihazupan.zupan1@gmail.com>
Closes#60231
Adds the new interfaces, implemented explicitly