objectionary / objectionary/lints

`anemic-getter` lint incorrectly flags explicit receiver as a redundant rename

Open
#1,300 1 comment 0 reactions 1 assignee View on GitHub

@maxonfjvipon is already working on this.

Since Aug 23, 2026.

bug good-title
Dominant language
Java
Stars
14
Forks
39
Avg merge
22h 54m
Merged PRs (30d)
90

Description

In eo-runtime we are making the receiver explicit: every formation head declares ^, so the receiver becomes an ordinary void filled by dispatch rather than arriving through AtWithRho at load time. That turns eighty-four existing bindings into lint failures.

The idiom is a formation giving its receiver a name:

[^ x] > xor
  or. > @
    b.and x.not
    b.not.and x
  ^ > b

Once ρ is a declared void, ^ > b reads as a getter renaming an attribute, and the lint says The object "b" is a redundant getter, it just renames "ρ" without adding anything, use "ρ" directly instead.

For a flat body the advice is fine. It stops being fine as soon as an inner formation uses the name, because the replacement is not ^ but a chain. In chunk/to-output.eo the body reads ^.^.^.allocated, and dropping the binding makes that ^.^.^.^.

Those two are equal only for the nesting that exists today. allocated names one thing no matter where it is written; ^.^.^.^ names whatever happens to be four hops up, so re-indenting a block or introducing a wrapper silently retargets it. We tried the rewrite and CI found the breakage — a StackOverflowError in the README snippets and errors across map, while, range and input — which is a fair summary of how easy it is to get the hop count wrong.

So the binding does add something: a name that survives nesting. That is the opposite of anemic.

Skip a getter whose source is ρ. Or, if the flat case is still worth reporting, only report when no descendant formation refers to the name, since that is exactly the case where the replacement is a plain ^.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.