-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
short.Parse regression in .NET 8.0 from 7.0 #94971
Comments
I created small test project for demonstration. All .NET 7 tests are green, but 50% of .NET 8 tests are red. Project: ParseTests.zip |
just FYI, you wrote Expected & Actual Behavior reversally. |
Thank you. I corrected it. |
There may be another branch here to fail when runtime/src/libraries/System.Private.CoreLib/src/System/Number.Parsing.cs Lines 269 to 287 in 47a9422
I'm unsure if it's a bug, UB or breaking change since you are using |
cc: @tannergooding |
Tagging subscribers to this area: @dotnet/area-system-numerics Issue DetailsDescriptionMethods Reproduction StepsExample:
Expected behaviorThe function should return false in both .NET versions. Actual behaviorThe function returns true in .NET 8 and false in .NET 7. Regression?Yes, as described above. Known WorkaroundsI found the issue only in Int16. Int32 works the same in .NET 8 and 7. Configurationdotnet --info .NET SDK: Runtime Environment: .NET workloads installed: [maccatalyst] [ios] [android] Host: .NET SDKs installed: .NET runtimes installed: Other architectures found: Environment variables: global.json file: Learn more: Download .NET: Other informationThe problem appears only for values 10000 and higher in absolute value.
|
Description
Methods
Int16.Parse
andInt16.TryParse
produce different result in .NET 7 and 8, when the input is decimal number. In .NET 7 numbers with decimal point are considered invalid and the methods returns error. However, in .NET 8 the methods return integer number, when input has more than 4 digits.Reproduction Steps
Example:
Expected behavior
The function should return false in both .NET versions.
Actual behavior
The function returns true in .NET 8 and false in .NET 7.
Regression?
Yes, as described above.
Known Workarounds
I found the issue only in Int16. Int32 works the same in .NET 8 and 7.
Configuration
dotnet --info
.NET SDK:
Version: 8.0.100
Commit: 57efcf1350
Workload version: 8.0.100-manifests.8d38d0cc
Runtime Environment:
OS Name: Windows
OS Version: 10.0.22631
OS Platform: Windows
RID: win-x64
Base Path: C:\Program Files\dotnet\sdk\8.0.100\
.NET workloads installed:
Workload version: 8.0.100-manifests.8d38d0cc
[maui-windows]
Installation Source: VS 17.8.34309.116
Manifest Version: 8.0.3/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maui\8.0.3\WorkloadManifest.json
Install Type: Msi
[maccatalyst]
Installation Source: VS 17.8.34309.116
Manifest Version: 17.0.8478/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.maccatalyst\17.0.8478\WorkloadManifest.json
Install Type: Msi
[ios]
Installation Source: VS 17.8.34309.116
Manifest Version: 17.0.8478/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.ios\17.0.8478\WorkloadManifest.json
Install Type: Msi
[android]
Installation Source: VS 17.8.34309.116
Manifest Version: 34.0.43/8.0.100
Manifest Path: C:\Program Files\dotnet\sdk-manifests\8.0.100\microsoft.net.sdk.android\34.0.43\WorkloadManifest.json
Install Type: Msi
Host:
Version: 8.0.0
Architecture: x64
Commit: 5535e31
.NET SDKs installed:
8.0.100 [C:\Program Files\dotnet\sdk]
.NET runtimes installed:
Microsoft.AspNetCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.AspNetCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.NETCore.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App]
Microsoft.WindowsDesktop.App 6.0.25 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 7.0.14 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Microsoft.WindowsDesktop.App 8.0.0 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]
Other architectures found:
x86 [C:\Program Files (x86)\dotnet]
registered at [HKLM\SOFTWARE\dotnet\Setup\InstalledVersions\x86\InstallLocation]
Environment variables:
Not set
global.json file:
Not found
Learn more:
https://aka.ms/dotnet/info
Download .NET:
https://aka.ms/dotnet/download
Other information
The problem appears only for values 10000 and higher in absolute value.
The text was updated successfully, but these errors were encountered: