Issue #1172: std: BTreeMap has no extend (NK1171)

Open and answer this issue on GitHub.

ready · opened 2026-11-02 · updated 2026-11-02 · 0 comments

This came up in the M10 move of check/mod.rs (#125). unrolling_report cannot move into Nikaia because collections::BTreeMap has no extend.

let mut m: collections::BTreeMap[String, String] = collections::BTreeMap()
m.extend(other)   // NK1171

Decision (supervisor, obvious extension): Map and Vec already merge collections, and no ADR refuses extend on BTreeMap. So extend gets the same meaning as it has on the other collections: it takes an iterable of pairs, and a later key overwrites an earlier one.

To build

  1. Add BTreeMap.extend in std, with the same semantics as the existing extend.
  2. Add a test in tests/compiler/ with its .stdout.
  3. Move unrolling_report (check/mod.rs) into check_walked.nika.

Back to Open Issues