Repository navigation
Two wrong builds: order() with orders.Move, and functions that keep a state - #42
Merged
Merged
Conversation
…Move as move, patrol and attack orders.Move made an Order action of modifier 6, orders.dat's number, where the action knows 0, 1 and 2; any other of orders.* passed as a number too, orders.Die and orders.Stop taken for move and patrol. The three the action gives are now its own numbers, every other a type error (a raw number is a second signature: in one union with it, TypeScript took Order<0> for a number). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
…hen the script is built A function changing a variable declared outside it (a closure's, a let of the file's) or a field of this outside a constructor was worked out where its call was written: a loop printing next() of `const next = counter()` showed 1, 1, 1. A call of it is now the program's (hoist.ts keepsState): a closure made in the program runs in the game; one made when the script was built, or a method of an instance made then, is refused; a function writing the script's own let or record is refused as the write written in the program is. A cache filled by a method stays a build-time call. Diagnostics said again for each call of the same function are said once. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Two scripts that built maps doing the wrong thing, in both builds (eudplib's and our own).
order()withorders.Move. It made an Order action of modifier 6, the number orders.dat has for Move, where the action knows only 0, 1 and 2 (move, patrol, attack). Any otherorders.*passed as a number too, andorders.Dieandorders.Stopwere taken for move and patrol. Noworders.Move,orders.Patrolandorders.AttackMovegive the action's own numbers, and any other order is a type error. A raw number is a second signature: in one union with it, TypeScript tookOrder<0>for a number.A function that keeps a state was worked out once when the script was built. A function changing a variable declared outside it (a closure's, or a
letof the file's), or a field ofthisoutside a constructor, was worked out where its call was written. A loop printingnext()ofconst next = counter()showed 1, 1, 1. A call of such a function is now the program's (hoist.ts,keepsState):letor record is refused, as that write is when written in the program.A cache filled by a method stays a build-time call. A diagnostic said again for each call of the same function is now said once.
Ledger:
game/order.tsdescribes the three orders the action takes.language/closure-keeps-a-count.tsis new. Both stay refused by a map of our own (steps 5 and 9), and no other row changed.Tests:
tests/events.test.ts,tests/script-functions.test.ts,tests/script-structured.test.ts. Suite 1,244 passing.🤖 Generated with Claude Code
https://claude.ai/code/session_01T1CM9pLuTuAn3mgTEkjgVg