Unify real expression in U{FreeIdent,Repeated}Test #32
Merged
rickie merged 3 commits intoJul 4, 2022
Merged
Conversation
rickie
commented
Jun 9, 2022
| } | ||
|
|
||
| @BugPattern( | ||
| name = "UnificationChecker", |
Member
Author
There was a problem hiding this comment.
After merging the PR, we can rebase it and also drop the name field here and below.
rickie
force-pushed
the
rossendrijver/refaster_simple_return_fix
branch
from
June 9, 2022 08:02
45120d2 to
20508e2
Compare
Member
Author
|
@Stephan202 , do you have time for a last pass? (We already discussed this twice offline 😄, I think it is good to go) |
Stephan202
approved these changes
Jul 4, 2022
Stephan202
left a comment
Member
There was a problem hiding this comment.
Sorry for my tardiness; added a commit :)
| Unifier unifier = new Unifier(new Context()); | ||
| UFreeIdent ident = UFreeIdent.create("foo"); | ||
|
|
||
| assertThat(ident.unify(tree.getExpression(), unifier)).isNotNull(); |
Member
There was a problem hiding this comment.
We can avoid the .getExpression() calls if we use a MethodInvocationTreeMatcher instead.
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.
❗ This PR is on top of #4 ❗
In #4 we introduce additional logic to filter out invalid expressions in
UFreeIdent, see here.However, when this code got introduced in this commit c2e14f2, it broke our code.
The test cases in the
UFreeIdentTestandURepeatedTestare not "valid"/"realistic" enough and therefore results in anIllegalArgumentExceptioninASTHelpers#getSymbol(MethodInvocationTree).To make our code compatible with this change, we changed the tests to use
BugCheckers for the two tests. This way we can use the same assertions but use real expressions that are accepted byASTHelpers#getSymbol.Once we merge this PR we can also rebase #4 with
master.