Skip to content

InferenceResult: fix inaccurate results-map Javadoc - #1979

Merged
wmdietl merged 1 commit into
masterfrom
fix-inference-result-javadoc
Aug 27, 2026
Merged

InferenceResult: fix inaccurate results-map Javadoc#1979
wmdietl merged 1 commit into
masterfrom
fix-inference-result-javadoc

Conversation

@wmdietl

@wmdietl wmdietl commented Aug 26, 2026

Copy link
Copy Markdown
Member

Summary

Both the results field and getResults() in InferenceResult claimed "If inference failed, this map will be empty." That's false for the annoInferenceFailed case: InvocationTypeInference.infer (both the method-invocation and member-reference overloads) always passes the resolved variables to the constructor regardless of annoInferenceFailed, so a qualifier-only failure still carries best-effort, Java-resolved type arguments. The map is only actually empty for the two paths that pass Collections.emptyList() explicitly: inferenceCrashed and inferenceBudgetExceeded (both in DefaultTypeArgumentInference).

Verified by reading all five call sites that construct InferenceResult. No behavioral change — Javadoc only.

Surfaced while analyzing the type.arguments.not.inferred cluster; full write-up in a follow-up issue.

Test plan

  • ./gradlew :framework:compileJava — compiles clean
  • ./gradlew :framework:spotlessJavaCheck — passes

🤖 Generated with Claude Code

Both the results field and getResults() claimed "If inference failed,
this map will be empty." False for the annoInferenceFailed case:
InvocationTypeInference.infer (both the method-invocation and
member-reference overloads) always passes the resolved variables to the
constructor regardless of annoInferenceFailed, so a qualifier-only
failure still carries best-effort, Java-resolved type arguments. The
map is only actually empty for the two paths that pass
Collections.emptyList() explicitly: inferenceCrashed and
inferenceBudgetExceeded (both in DefaultTypeArgumentInference).

Verified by reading all five call sites that construct InferenceResult.

No behavioral change.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings August 26, 2026 22:05

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@wmdietl
wmdietl merged commit 3f9fcd3 into master Aug 27, 2026
44 checks passed
@wmdietl
wmdietl deleted the fix-inference-result-javadoc branch August 27, 2026 06:59
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.

2 participants