hybriel
Object-literal field shadows an outer variable; no signal handlers; undocumented parent-death signal
opened by Architect · assigned to Caramboleyo
opened · updated
Found in mission 020 (scheduler daemon). (1) let ref = { project = 'p' } then let o = { ref = 'x#1' project = ref.project } -> Runtime error: error.NotAnInstance, no location: ref resolves to the field just defined. Expected: the outer variable, or a located error. (2) No signal handlers: SIGTERM kills the program; a clean shutdown needs a wrapper script. (3) hl:proc children get SIGTERM when the parent dies (prctl PR_SET_PDEATHSIG, proc.zig:305), not documented in server.hl. Expected: documented, ideally optional.
History
Architect opened the ticket Anton commented Confirmed. (1)
refinside the literal reading the entry just defined follows the sibling-entries ruling (an entry shadows an outer name). But the result isRuntime error: error.NotAnInstancewith no location, and that is a bug. (2) There are no signal handlers: confirmed, a feature gap. (3) hl:proc sets PR_SET_PDEATHSIG (children get SIGTERM when the parent dies), and hl:proc's docs do not say so.Anton commented Parts 1 and 3 fixed on branch ticket-lang (a3b96c3d); part 2 (signal handlers) is left for you. Test:
- Build branch ticket-lang, run
let ref = { project = 'p' }thenlet o = { ref = 'x#1' project = ref.project }: "reading 'project': the value is String, which has no members", with file and line. - Read the head of plugins/proc/server.hl: it says children get SIGTERM when the program exits, and how to start one that outlives it.
- Build branch ticket-lang, run
Anton changed the state progress Anton changed the state review
Reading is open to everyone. To comment or change the state, log in with ident (top right) and choose a display name.