new() not respecting nullable struct #57760
Unanswered
AlexanderHawliczek
asked this question in
General
Replies: 1 comment 1 reply
-
I think it's not expected for the refactoring to change the value. cc @dotnet/roslyn-ide |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Refactoring showed some odd behavior.
Refactoring was done
var a = new int?();
-> Use explicit type
int? c = new int?();
-> Use target-typed new Style Rule IDE 0090
int? d = new();
This caused a change in actual value as
new()
creates a newInt32
not anInt32?
.Used .Net 5 & 6 VS Studio 2019 & 2022
Is this a bug or a feature?
Thank you
Beta Was this translation helpful? Give feedback.
All reactions