Skip to content

Conversation

@Tyrrrz
Copy link
Owner

@Tyrrrz Tyrrrz commented Nov 30, 2025

No description provided.

…nd corresponding methods for other numeric types
Copilot AI review requested due to automatic review settings November 30, 2025 15:33
@Tyrrrz Tyrrrz added the enhancement New feature or request label Nov 30, 2025
Copilot finished reviewing on behalf of Tyrrrz November 30, 2025 15:35
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR adds polyfills for the simplified TryParse(string, IFormatProvider?, out T) methods that were introduced in .NET 7.0 for all numeric types. These polyfills enable backward compatibility with earlier .NET versions by delegating to the existing TryParse overloads with explicit NumberStyles parameters.

  • Implements TryParse polyfills for 13 numeric types (byte, sbyte, short, int, long, ushort, uint, ulong, IntPtr, UIntPtr, float, double, decimal)
  • Each polyfill correctly delegates to the existing 4-parameter TryParse overload with appropriate NumberStyles
  • Updates documentation to reflect the addition of 13 new members

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
PolyShim/Signatures.md Updates member count from 184 to 197 and total count from 246 to 259; adds documentation entries for all 13 new TryParse methods
PolyShim/Net70/Byte.cs Adds TryParse polyfill for byte using NumberStyles.Integer
PolyShim/Net70/SByte.cs Adds TryParse polyfill for sbyte using NumberStyles.Integer
PolyShim/Net70/Int16.cs Adds TryParse polyfill for short using NumberStyles.Integer
PolyShim/Net70/Int32.cs Adds TryParse polyfill for int using NumberStyles.Integer
PolyShim/Net70/Int64.cs Adds TryParse polyfill for long using NumberStyles.Integer
PolyShim/Net70/Uint16.cs Adds TryParse polyfill for ushort using NumberStyles.Integer (filename has incorrect casing)
PolyShim/Net70/UInt32.cs Adds TryParse polyfill for uint using NumberStyles.Integer
PolyShim/Net70/UInt64.cs Adds TryParse polyfill for ulong using NumberStyles.Integer
PolyShim/Net70/IntPtr.cs Adds TryParse polyfill for IntPtr that delegates to int or long based on pointer size
PolyShim/Net70/UIntPtr.cs Adds TryParse polyfill for UIntPtr that delegates to uint or ulong based on pointer size
PolyShim/Net70/Single.cs Adds TryParse polyfill for float using NumberStyles.Float | NumberStyles.AllowThousands
PolyShim/Net70/Double.cs Adds TryParse polyfill for double using NumberStyles.Float | NumberStyles.AllowThousands
PolyShim/Net70/Decimal.cs Adds TryParse polyfill for decimal using NumberStyles.Number

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants