Skip to content

Fix: Rename the members of an object's nested classes in the stubs - #87

Merged
b-re-w merged 1 commit into
developfrom
feat/nested-companion
Oct 3, 2026
Merged

b-re-w merged 1 commit into
developfrom
feat/nested-companion

Conversation

@b-re-w

@b-re-w b-re-w commented Oct 3, 2026

Copy link
Copy Markdown
Member

Closes #86

The converter never passed an object's nested classes (Companion, ...) through its member rule, so PathOperation.Companion.reverseDifference kept its Kotlin spelling. A one-line fix applies the rule at any depth. A scan found no other camelCase nested member. Test added: TheNestedCompanion; red first. The documented baselines are also corrected to the measured counts (256 passed, 1 skipped with the binder; 148 passed, 109 skipped without).

Issue #86. gen_stubs.py's object folding appended an object's nested classes
(Companion, Horizontal, ...) to the parent class without passing them
through _convert_class, which is what applies the member rule and drops the
binder's own aliases. So PathOperation.Companion.reverseDifference kept its
Kotlin spelling, beside the binder's reverse_difference alias. One call fixes
it at any depth: upper-case names kept, receiver and anonymous slots kept,
aliases dropped, no duplicates. A scan of every committed stub found no other
camelCase nested member. The binder serves a nested companion's member under
its snake_case alias like any proxy member (python-multiplatform #131, read
from its source; the fake host does not model nested companions).

The documented baselines are brought up to date as well: they still showed
the counts from before #79's step 5.

defect fixed: nested-class member names in stubs.
test added: TheNestedCompanion (depth 2 and 3, upper-case kept, alias
collapsed). Red: the camelCase name and its alias both present.
documentation corrected: baselines in SPEC 0, PROJECT.md, guide.
Suite with python-multiplatform 452cc807 (worktree, zip): 256 passed, 1
skipped; without a checkout, 148 passed, 109 skipped. Generating twice gives
no diff; one stub changed (ui/graphics: 1 rename, 4 duplicate lines gone).

Refs #86
@b-re-w
b-re-w merged commit d393a20 into develop Oct 3, 2026
6 checks passed
@b-re-w
b-re-w deleted the feat/nested-companion branch October 3, 2026 15:22
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