Skip to content

Fix collisions between same-named fields - #327

Merged
rcosta358 merged 7 commits into
mainfrom
codex/issue-318-field-identity
Oct 6, 2026
Merged

rcosta358 merged 7 commits into
mainfrom
codex/issue-318-field-identity

Conversation

@rcosta358

@rcosta358 rcosta358 commented Oct 2, 2026 •

Copy link
Copy Markdown
Collaborator

Closes #318 and #315.

Qualifies field names by declaring class, adds a combined nested-field regression, and fixes negative literal initializers.

Tests: TestExamples (201 passed).

This PR was generated by Codex.

@CatarinaGamboa CatarinaGamboa left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

minor followup

}

public static String qualifyFieldName(CtFieldReference<?> field) {
return "this#" + field.getDeclaringType().getQualifiedName() + "." + field.getSimpleName();

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

i wonder if we can also remove the # in the middle here and use the . so its more like java and less our workaround.

@rcosta358 rcosta358 Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

I had thought about that but that requires changing the grammar and will cause conflicts but we can give it a shot.

@rcosta358
rcosta358 changed the base branch from codex/issue-317-nested-context to main October 6, 2026 15:17
@rcosta358
rcosta358 merged commit e690903 into main Oct 6, 2026
2 checks passed
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.

Fields with the same name in different classes collide Handle refinements in nested classes

2 participants