F# RFC FS-1057 - Make Enum cases public
This RFC documents the change Make enum cases public.
The goal is to align our code generation for enumerations with C# by making them emit as public.
- Approved in principle
- Implementation: Complete
- Discussion: https://github.com/Microsoft/visualfsharp/pull/5002
F# enumeration generation will be public to align with how C# does it.
The motivation for this is twofold:
- Align with C# for the sake of consistency with the rest of the .NET platform.
- Allow for more predictable behavior when analyzing logs from profiling F# code.
The latter case was discovered in recent work to add more logging capabilities to the F# compiler and tools. When analyzing logs, the value of the enumeration (rather than the label) is emitted, making it more difficult to analyze logs unless those enumerations are also marked as public.
Code gen enumeration cases to be public under all circumstances.
This can break people who, in reflection code, depend on the existing behavior.
This does not break code unless it uses reflection and depends on existing enum case code generation in that reflection code.