C#: Simplify extraction of is expressions and case statements#1370
Merged
Conversation
Contributor
|
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
suggested changes
Jun 3, 2019
calumgrant
left a comment
Contributor
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
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) |
Contributor
There was a problem hiding this comment.
Swap the then-else arms to remove the ! ?
25d0f61 to
2d0554a
Compare
calumgrant
approved these changes
Jun 3, 2019
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up on a1e58ce.