-
Notifications
You must be signed in to change notification settings - Fork 832
Open
Labels
Area-LibraryIssues for FSharp.Core not covered elsewhereIssues for FSharp.Core not covered elsewhereBugRegression
Milestone
Description
When using .NET 9 SDK or earlier, the string function returns the enum case name for FSharp.Core versions < 10. When upgrading to FSharp.Core 10.0.100, the string function returns the enum's integer value as a string.
Repro steps
- New .NET 9 F# console app with the following lines:
let enumValue = System.ConsoleColor.DarkBlue printfn $"string: '{string enumValue}'" printfn $"ToString(): '{enumValue.ToString()}'"
- Pin FSharp.Core version to 9.0.303.
- Add
global.jsonwith SDK version set to 9.0.308. dotnet runproduces:string: 'DarkBlue' ToString(): 'DarkBlue'
- Update FSharp.Core version to 10.0.100.
dotnet runproduces:string: '1' ToString(): 'DarkBlue'
Project used to reproduce behaviour above: FSharp.String.TestApp.zip
Expected behavior
string function returns the enum case name, i.e. the equivalent of calling the ToString() method.
Actual behavior
string function returns the enum case's integer value as a string.
Known workarounds
One of the following:
- Use the
ToString()method directly - Use an earlier version of FSharp.Core
- Use the .NET 10 SDK.
brianrourkeboll and hyazinthh
Metadata
Metadata
Assignees
Labels
Area-LibraryIssues for FSharp.Core not covered elsewhereIssues for FSharp.Core not covered elsewhereBugRegression
Type
Projects
Status
New