Open and answer this issue on GitHub.
bug, ready · opened 2026-11-22 · updated 2026-11-22 · 0 comments
Found while supervising the safety lane (re-recording a_pub_parameter_at_a_raw_sink_is_from_outside.stderr for #2483).
tests/compiler/tests/a_pub_parameter_at_a_raw_sink_is_from_outside.stderr records a rustc warning as expected output:
warning: Type `__NikaiaThrows_io_IoError__process_Exit` is more private than the item `list_guarded`.
--> tests/a_pub_parameter_at_a_raw_sink_is_from_outside.nika:20:1
|
20 | pub fn list_guarded(dir: String) throws {
= note: But type `__NikaiaThrows_io_IoError__process_Exit` is only usable at visibility `pub(crate)`.
Probe: any program with pub fn f(x: String) throws { if x == "" { process::exit(2) }; process::run("ls", [x]) } called from main (a pub fn whose inferred throws are two errors, so the emitter makes a sum).
Cause: crates/nikaia-std/src/compiler/emit_sums.nika:194 writes the sum enum pub only when is_std || offered_to_rust || every_item_public || as_a_module(); otherwise it is private, while the pub fn whose signature names it is pub. The comment two lines below says “a warning about this file is a defect here (Part III C.1)”. The test then enshrines the warning in its expected stderr.
pub whenever a pub item’s signature names it (or always, if that draws no other warning); in emit_sums.nika, then lower-std.a_pub_parameter_at_a_raw_sink_is_from_outside.stderr without the rustc warning (the NK warnings stay).tests/compiler/tests/: a pub fn with a two-error throws in a program, whose .stderr holds no rustc warning; fails before..stderr files for more private than (today only this one).No expected output holds a rustc more private warning, and the new test is green and failed on the old tree.