Skip to content

Remove the shadowed copy of matchExistentialInstantiation - #46

Open
Chessing234 wants to merge 1 commit into
teorth:masterfrom
Chessing234:fix/duplicate-existential-instantiation
Open

Remove the shadowed copy of matchExistentialInstantiation#46
Chessing234 wants to merge 1 commit into
teorth:masterfrom
Chessing234:fix/duplicate-existential-instantiation

Conversation

@Chessing234

Copy link
Copy Markdown
Contributor

docs/js/logic.js declares matchExistentialInstantiation twice — once at line 871 and again at line 1018, 147 lines apart. The two bodies are byte-identical (54 lines each). In JavaScript the second declaration silently replaces the first, so the earlier copy has never run.

That is worth removing not because the duplication costs anything at runtime, but because a fix applied to the first copy would appear to do nothing. It sits among the other match* law handlers, so it is a plausible place to edit by mistake.

Evidence

The removal is provably a no-op. Loading logic.js before and after the change in separate vm contexts and comparing every function:

functions before/after: 74 / 74
sources changed:        0
functions lost:         0

Same 74 top-level functions, every one with identical source text, none dropped — including matchExistentialInstantiation itself, which still resolves to the surviving definition.

I checked the two bodies were genuinely identical rather than near-identical by extracting each with a brace-matching scan and comparing the strings directly.

Scope

Only the dead declaration and its comment are removed; nothing else in the file is touched, and no behaviour changes. I have not tried to reorder or otherwise tidy the surrounding handlers.

This was AI-assisted.

logic.js defines matchExistentialInstantiation twice, 147 lines apart, with
byte-identical bodies. The second declaration silently replaces the first, so
the earlier copy has never run -- and a fix applied to it would appear to do
nothing.

Dropping the dead copy leaves the same 74 functions with identical sources.
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