Open and answer this issue on GitHub.
decision, bugs · opened 2026-11-16 · updated 2026-11-16 · 0 comments
Filed by the driver from the Found: of the run of issue-1766 (#1766) (owner, 2026-11-06).
an assert over a method’s self field is not a precondition, but the same assert over a free function’s parameter field is; no decision yet (ADR-269 D5 says a claim that names only parameters is a precondition, D20 says methods have preconditions like any other function; the #1476 comment reads otherwise). Probe, nikaia run scripts/probe.nika -- --file p.nika: struct Bag {\n items: Vec[i64],\n}\n\nimpl Bag {\n fn first(self) -> i64 {\n assert(self.items.len() > 0)\n return self.items[0]\n }\n}\n\nfn main() throws {\n let b = Bag { items: [] }\n println(b.first())\n} gives NK1300: assert(self.items.len() > 0) is not proved: nothing before it shows it at 7:9; the free twin fn first(b: Bag) -> i64 { assert(b.items.len() > 0) ... } gives NK1300: assert(b.items.len() > 0), the precondition of first, is not proved: one call does not prove it. Expected by D5/D20: the method’s assert is its precondition, refused only at a call that does not prove it. Suspected cause: the precondition computation (D15) does not count self among the parameters (prover_*.nika), unknown which function
std defect with a probe (nikaia run scripts/probe.nika -- SNIPPET), a defect in docs/ or scripts/ with the command or check that shows it; a behaviour the code does on purpose (name the function or ADR) closes it as by design. The Found line may lack them (#1710): the commit message, or the report’s Body: when closed, gives the probe or check with its expected output, the ADR or Part I-III section that says so, and its actual output (docs/issues.md I5, I6), and the cause, file and function, traced or suspected (I7).tests/compiler/tests/, unless a check that already runs (name it, e.g. check-adr-refs.py for a docs citation) turns red on it.The probe or check gives the expected output the first item names from its ADR or Part I-III section, and a tests/compiler/tests/ test (or the named check) that failed on the unfixed tree is green; or the issue is closed as by design, naming the function or ADR.
Generated by Claude Code