feat(cli): ludic deps --writes warns about writes through a local alias

A local bound straight from another module's global (let t =
thing_cur), or from such a local, is followed within its function, and
a write through its field or element is listed as a warning after the
counted writes. A reference from a function's result is not followed.
Reseed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Orkun ÇAKILKAYA 2026-09-25 13:22:37 +03:00
parent 8892f51096
commit 63a1fa1378
12 changed files with 43331 additions and 41501 deletions

View file

@ -1,5 +1,6 @@
# tangle.ludic — the program `ludic deps` is tested on: a and b use each other (the largest cycle is
# 2), both use the leaf c (not counted), and a writes b's global b_count (one cross-module write).
# 2), both use the leaf c (not counted), and a writes b's global b_count (one cross-module write);
# a_bump writes b_rec through a local (a warning in ludic deps --writes, not counted).
#
# Running it prints: 4
import "tangle/c"
@ -7,6 +8,7 @@ import "tangle/a"
import "tangle/b"
program Tangle {
entry {
print(a_run())
a_bump()
print(a_run() + b_rec.n - 1)
}
}

View file

@ -7,3 +7,7 @@ export function a_run() -> int {
export function a_two() -> int {
return 2
}
export function a_bump() -> void {
let r = b_rec
r.n = r.n + 1
}

View file

@ -1,6 +1,10 @@
# b/index.ludic - uses a back: a and b are a cycle
module b
export var b_count: int = 0
export property Tally {
n: int = 0
}
export var b_rec: Tally = new Tally
export function b_run() -> int {
return a_two() + c_one()
}