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.
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
Add
ignoreDeadCode
option #633base: master
Are you sure you want to change the base?
Add
ignoreDeadCode
option #633Changes from 15 commits
7102456
bd2e5e7
58f4773
1d1c348
2540cd3
02c69a8
a3e4013
73de62f
30638eb
6392013
decd355
f7b1bb5
a93748b
1576672
3571c39
fa183ec
f678255
2117ffc
aff7485
1508ca6
bf1652c
85d3a9a
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
As this is the point of the PR, we should fix this issue before merging.
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.
Also note that this also doesn't produce a warning before this PR - so does this PR do anything?
The deref on
obj
before is remembered and then we don't produce multiple errors. So, here and below, don't use the same variable outside the loop and inside.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.
You should add the same test to the normal Nullness Checker tests and show the actual difference in behavior between the two.
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 see. I thought we want to enable the check first. I will write dead branch analysis in this PR. I think Jenny's thesis contains case study for dead branch analysis but not sure why it is not in the dataflow framework.
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.
What do you mean? The
GenericAnnotatedTypeFactory#reachableNodes
should already contain whether a node is reachable or not, right? So what additional analysis do you want to add? In #627 it sounds like all the infrastructure is already there, we just wanted to guard it by an option.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 think this issue comes from when we fetch upstream changes. They only implement reachablenodes to determine whether it includes exception node and its Successors. See
typetool#6246
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.
That upstream change is already in eisop. Are you saying there are other changes that have not been merged yet?
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.
Sorry, I am trying to say the upstream change is not enough to check dead branch for
if else
andwhile loop
.