Issue #1059: A warning about a project’s library file is shown in each test program, at the test’s own span

Open and answer this issue on GitHub.

ready · opened 2026-10-31 · updated 2026-10-31 · 0 comments

Seen while verifying ee22551: tests/compiler/src/main.nika gained pub fn none_of[T](n: i64) with n unused. nikaia test --project tests/compiler then failed two unrelated tests (a_let_mut_of_an_entry_takes_no_rust_mut, a_mut_view_handed_to_a_mut_parameter_is_lent_on), whose stderr held:

warning: Unused variable: `n`.
   --> tests/a_mut_view_handed_to_a_mut_parameter_is_lent_on.nika:18:5
 18 |     let mut v = m["a"] ?? return

The warning is about main.nika, but it names the test file and a line of it, and it appears in only some tests. Worked around in 00cae93 by renaming the parameter _n; the misplaced warning is the defect.

To build

  1. A diagnostic about a library file of the project names that file and its span, once, not each test program’s (find where test programs inherit the library’s warnings with their own source map).
  2. Test: a project test whose library holds an unused parameter; the test programs’ .stderr stay empty, and the warning names src/main.nika.

Back to Open Issues