-
Notifications
You must be signed in to change notification settings - Fork 4k
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
Don't offer Use Explicit Type for target typed new #46469
Don't offer Use Explicit Type for target typed new #46469
Conversation
@@ -286,6 +286,16 @@ private static bool IsSafeToSwitchToVarWithoutNeedingSpeculation(DeclarationExpr | |||
return false; | |||
} | |||
|
|||
// var cannot be used with target typed new | |||
#if CODE_STYLE |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have no idea if this is the right thing to do with CODE_STYLE
, or really what CODE_STYLE
is or means, but its Friday afternoon for me so thought I'd just put up a PR and see what happens 😄
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. @sharwell for another pair of eyes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no need for the condition here. Just use SyntaxKindEx
on both paths.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
➡️ #46489
Noticed this today while doing something else. Couldn't find a bug for it, should I log one?