Skip to content
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

Merged

Conversation

davidwengier
Copy link
Contributor

Noticed this today while doing something else. Couldn't find a bug for it, should I log one?

@davidwengier davidwengier requested a review from a team as a code owner July 31, 2020 03:36
@@ -286,6 +286,16 @@ private static bool IsSafeToSwitchToVarWithoutNeedingSpeculation(DeclarationExpr
return false;
}

// var cannot be used with target typed new
#if CODE_STYLE
Copy link
Contributor Author

@davidwengier davidwengier Jul 31, 2020

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 😄

Copy link
Contributor

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.

Copy link
Member

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.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

➡️ #46489

@davidwengier davidwengier merged commit 938d1f6 into dotnet:master Jul 31, 2020
@ghost ghost added this to the Next milestone Jul 31, 2020
@davidwengier davidwengier deleted the NoUseImplicitTypeForTargetTypedNew branch July 31, 2020 22:35
@RikkiGibson RikkiGibson modified the milestones: Next, 16.8.P2 Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants