Skip to content

fix(jdk-codemodel): resolve receiver type for unqualified method calls#13

Merged
deer merged 1 commit intomainfrom
receiver
Apr 8, 2026
Merged

fix(jdk-codemodel): resolve receiver type for unqualified method calls#13
deer merged 1 commit intomainfrom
receiver

Conversation

@deer
Copy link
Copy Markdown
Collaborator

@deer deer commented Apr 8, 2026

Unqualified method calls like foo() previously had no receiverType in the MethodInvocation model node, while qualified calls like this.foo() and obj.foo() did. The implicit receiver for an unqualified call is always the enclosing class instance.

JdkExpressionConverter now tracks the enclosing class type via setEnclosingType(), called from JdkInitializer.visitClass before processTypeElement runs. The unqualified branch of visitMethodInvocation uses this as receiverType instead of leaving it empty.

Tests updated: the existing assertion that unqualified calls have empty receiverType is replaced with two new tests — one verifying resolution to the enclosing class, one verifying inner class calls resolve to the inner class type (not the outer).

@deer deer merged commit 3152620 into main Apr 8, 2026
1 check passed
@deer deer deleted the receiver branch April 8, 2026 13:04
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