-
Notifications
You must be signed in to change notification settings - Fork 1.9k
C#: Simplify extraction of is expressions and case statements
#1370
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
Conversation
|
This pull request introduces 1 alert when merging c0a9204 into 9fb61d5 - view on LGTM.com new alerts:
Comment posted by LGTM.com |
c0a9204 to
741380e
Compare
calumgrant
left a comment
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.
A few small suggestions, but overall it's great to remove the complex logic from expr_parent_adjusted
| VariableDeclaration(IExpressionInfo info) : base(info) { } | ||
|
|
||
| public static VariableDeclaration Create(Context cx, ISymbol symbol, Type type, Extraction.Entities.Location exprLocation, Extraction.Entities.Location declLocation, bool isVar, IExpressionParentEntity parent, int child) | ||
| public static VariableDeclaration Create(Context cx, ISymbol symbol, Type type, TypeSyntax mention, Extraction.Entities.Location exprLocation, Extraction.Entities.Location declLocation, bool isVar, IExpressionParentEntity parent, int child) |
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.
Can we make it clear that mention is maybe null. Perhaps rename to optionalMention or add some doc comment.
| break; | ||
| case DiscardDesignationSyntax discard: | ||
| new Expressions.Discard(cx, discard, this, 0); | ||
| if (!isVar) |
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.
Swap the then-else arms to remove the ! ?
calumgrant
left a comment
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.
LGTM
25d0f61 to
2d0554a
Compare
Follow-up on a1e58ce.