Skip to content

Qualify static field references when generating @InlineMe annotations. - #6025

Merged
copybara-service[bot] merged 1 commit into
masterfrom
test_964218200
Aug 13, 2026
Merged

Qualify static field references when generating @InlineMe annotations.#6025
copybara-service[bot] merged 1 commit into
masterfrom
test_964218200

Conversation

@copybara-service

Copy link
Copy Markdown
Contributor

Qualify static field references when generating @InlineMe annotations.

Previously, ImportAndQualificationFinder skipped identifiers whose parent node
was a MemberSelectTree. When an unqualified static field was the receiver of a
member selection (such as STR.length() or MAGIC.get()), this check caused
InlineMe to leave the field reference unqualified and omit the required class
import.

We now handle ClassSymbol explicitly and ensure static fields on the enclosing
class are correctly qualified with the class name and the class is added to
imports.

Previously, `ImportAndQualificationFinder` skipped identifiers whose parent node
was a `MemberSelectTree`. When an unqualified static field was the receiver of a
member selection (such as `STR.length()` or `MAGIC.get()`), this check caused
`InlineMe` to leave the field reference unqualified and omit the required class
import.

We now handle `ClassSymbol` explicitly and ensure static fields on the enclosing
class are correctly qualified with the class name and the class is added to
imports.

PiperOrigin-RevId: 964277465
@copybara-service
copybara-service Bot merged commit bcc3cb0 into master Aug 13, 2026
@copybara-service
copybara-service Bot deleted the test_964218200 branch August 13, 2026 20:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant