[0..181] (NK1281, ADR-362 D5)Open and answer this issue on GitHub.
enhancement, note · opened 2026-10-17 · updated 2026-10-17 · 0 comments
Low priority — decided, not to be built now (owner, 2026-10-17). Labelled note until the owner moves it to ready.
The owner wrote let safety_buffer = [0..181] meaning the numbers 0 to 181. It is a list of one element, the range: printing an element is NK1201 (#638), safety_buffer[110] aborts at run time. Rust has the same trap (vec[0..n]), and Clippy warns on it (single_range_in_vec_init).
A list literal whose only element is a range is the warning NK1281: a list of one range; the help writes (0..181).collect() for the numbers and [0; 182] for that many equal values (#643). A written type (let r: Vec[Range[i64]] = [0..181]) says the list is meant and silences it. Several ranges ([0..5, 10..15]) are not warned. Rejected: an error (a list of one range is rare, not wrong); nothing.
NK1281).ready)a..b, a..<b, a..), with no type written for the binding, argument or field it goes to → NK1281 warning at the literal, help as above (the [0; n] count is the range’s length, inclusive or exclusive).[0..181] warns with both helps; [0..<181] names [0; 181]; let r: Vec[Range[i64]] = [0..181] and [0..5, 10..15] do not warn; the program still builds.[v; n] help names something that builds.