Conversation
Every other `ainfer*Generate*` task deletes the WPI output directory with `wpiOutputDirectory()` and `DirectoryDeleter`. This task still inlined an equivalent loop, which the merge of the commit that introduced those helpers left behind. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…e-variable-upper-bound
A use of a type variable is relevant exactly when the type variable's upper bound is relevant, so resolve such a use to its bound rather than conservatively retaining every annotation that is written on it. `JavaParserUtil.resolveTypeVariableName` answers which type variable a name refers to. It shares its scope walk with `resolveTypeName`, so the two agree about which declaration a name refers to. That walk now searches a type declaration's declared member types before its type parameters, because a declared member type shadows a type parameter of the same name -- whereas a member type that the declaration merely inherits does not. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
When the checker supports no invisible qualifier, `removeUnprintedAnnotations` has no effect, so skip both it and the clone that it requires. Also, walk the AST rather than building a list of every node in it. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…ork-fork-mernst-branch-ajava-remove-annotations-from-ast into ajava-omit-irrelevant # Conflicts: # framework/src/main/java/org/checkerframework/common/wholeprograminference/WholeProgramInferenceJavaParserStorage.java
…nst-branch-ajava-omit-irrelevant into resolve-type-name-local-anonymous
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
Their computation is reflective, and they do not change over the lifetime of a `WholeProgramInferenceJavaParserStorage`. The computation is lazy rather than in the constructor, because `getSupportedTypeQualifiers()` might not yet yield its final result when the storage is constructed. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…-fork-mernst-branch-resolve-type-name-member-scope into resolve-member-type-inheritance
…k-fork-mernst-branch-resolve-member-type-inheritance into relevance-type-variable-upper-bound
…ork-fork-mernst-branch-ajava-remove-annotations-from-ast into ajava-omit-irrelevant
…nst-branch-ajava-omit-irrelevant into resolve-type-name-local-anonymous
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…-fork-mernst-branch-resolve-type-name-member-scope into resolve-member-type-inheritance
…lve-type-name-memoize
…k-fork-mernst-branch-resolve-member-type-inheritance into relevance-type-variable-upper-bound
…-mernst-branch-resolve-type-name-memoize into resolve-type-name-local-anonymous
…a-remove-annotations-from-ast
…ork-fork-mernst-branch-ajava-remove-annotations-from-ast into ajava-omit-irrelevant
…nst-branch-ajava-omit-irrelevant into resolve-type-name-local-anonymous
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…-fork-mernst-branch-resolve-type-name-member-scope into resolve-member-type-inheritance
* Skip cloning and walking the AST when no annotation can be removed. * Don't crash if a declaration has no variables; be conservative instead. * Fix comments about where an annotation on a type parameter declaration lands. * Narrow a @SuppressWarnings from a method to a single expression. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…a-omit-irrelevant
…a-remove-annotations-from-ast
…ork-fork-mernst-branch-ajava-remove-annotations-from-ast into ajava-omit-irrelevant
…nst-branch-ajava-omit-irrelevant into resolve-type-name-local-anonymous
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…-fork-mernst-branch-resolve-type-name-member-scope into resolve-member-type-inheritance
…k-fork-mernst-branch-resolve-member-type-inheritance into relevance-type-variable-upper-bound
Also correct the comment about why the compilation unit must be cloned. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…a-remove-annotations-from-ast
…ork-fork-mernst-branch-ajava-remove-annotations-from-ast into ajava-omit-irrelevant Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…nst-branch-ajava-omit-irrelevant into resolve-type-name-local-anonymous
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…-fork-mernst-branch-resolve-type-name-member-scope into resolve-member-type-inheritance
…k-fork-mernst-branch-resolve-member-type-inheritance into relevance-type-variable-upper-bound
…a-omit-irrelevant
…nst-branch-ajava-omit-irrelevant into resolve-type-name-local-anonymous
…ork-fork-mernst-branch-resolve-type-name-local-anonymous into resolve-type-name-member-scope
…-fork-mernst-branch-resolve-type-name-member-scope into resolve-member-type-inheritance
…k-fork-mernst-branch-resolve-member-type-inheritance into relevance-type-variable-upper-bound
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
…-fork-mernst-branch-resolve-type-name-member-scope into resolve-member-type-inheritance
…k-fork-mernst-branch-resolve-member-type-inheritance into relevance-type-variable-upper-bound
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.
Part 8, splitting #8177 into reviewable pieces. Based on #8187.
Note on the diff: this branch merges #8188, whose build-file change it extends, so this PR shows three commits. Review only
Use a type variable's upper bound when deciding relevance.A use of a type variable is relevant exactly when the type variable's upper bound is relevant, so resolve such a use to its bound rather than conservatively retaining every annotation written on it.
JavaParserUtil.resolveTypeVariableNameanswers which type variable a name refers to. It shares its scope walk withresolveTypeName, so the two agree about which declaration a name refers to. That walk now searches a type declaration's declared member types before its type parameters, because a declared member type shadows a type parameter of the same name -- whereas a member type that the declaration merely inherits does not.ainferRelevanceGenerateAjavadeletes the generatedIrrelevantTypeVariable.javabefore the validation pass: the test expects ananno.on.irrelevantwarning, and the// ::comment stating that expectation is stripped when the file is copied, so the validation pass would otherwise report the warning as unexpected.🤖 Generated with Claude Code