-
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
IDE0028: Added simplifying collection initializer in tuple #72332
IDE0028: Added simplifying collection initializer in tuple #72332
Conversation
855d9b1
to
363d730
Compare
if (newExpression.IsKind(SyntaxKind.TupleExpression) && | ||
this.SpeculativeSemanticModel.GetConversion(newExpression).IsTupleLiteralConversion) | ||
{ | ||
return true; |
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.
Is there any extra condition needed here? Like:
SymbolsAreCompatible(originalTypeInfo.Type, newTypeInfo.ConvertedType)
I see the tests are working too if having this extra condition
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.
Yes. The types should be validated as well.
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.
Added
Hi @CyrusNajmabadi, could you review this PR please 🌝 |
Thanks! |
…n-expression-in-valuetuple
fixes #72169
collection-expression.mp4