Closed GerardSmit closed 1 month ago
When using is pattern matching with enums, the enum value is dropped. For example:
is
_ = System.Data.ConnectionState.Closed is System.Data.ConnectionState.Closed;
Gets converted to:
_ = System.Data.ConnectionState.Closed is global::System.Data.ConnectionState;
This PR checks if the type is an enum and doesn't match the base typeSyntax (because the right-side is missing) and then adds it back.
typeSyntax
Thanks a lot for the PR.
I expanded your test case to cover using static class.
The change is in the latest nuget package.
When using
is
pattern matching with enums, the enum value is dropped. For example:Gets converted to:
This PR checks if the type is an enum and doesn't match the base
typeSyntax
(because the right-side is missing) and then adds it back.