Result: done Files: crates/nikaia-std/src/tools/ty.nika crates/nikaia-std/src/tools/lowered/ty.rs crates/nikaia-std/src/tools/check_core_args.nika crates/nikaia-std/src/tools/lowered/check_core_args.rs crates/nikaia-std/src/tools/text_tiers.nika crates/nikaia-std/src/tools/lowered/text_tiers.rs crates/nikaia-std/src/tools/lowered/project_settings.rs tests/compiler/tests/filter_map_split_parts.nika tests/compiler/tests/filter_map_split_parts.stdout docs/briefs/bugs/b18-1078-filter-map-split-parts.md.report.md Commit: tiers, check: filter_map hands on the parts of a split it keeps (Fixes #1078) Body: Both rows came from the checker: Seq::filter_map/find_map declare f: fn(T) -> (U?). ty::parse read (U?) as a one-element tuple, bind had no Nullable arm, and a lambda’s type took the written ?? over what its body came to, so U was never bound. The element type after filter_map stayed ?: row b got NK1245, and row a lowered the next lambda’s parts as views. Fixes: a parenthesised type with one part and no comma is a group (ty.nika parse); U? binds U to what the option holds (ty.nika bind); a lambda whose written result is ?? reports what its body comes to (check_core_args.nika check_core_args_lambda). text_tiers.nika gives filter_map the map rule (mapped, ADR-293 D26); mapped is called only from the map and fold branches. Rows a and b were not tried with the checker fix alone, so whether that rule is needed is not shown; it is the brief’s step 2. The fixpoint re-lowered project_settings.rs: filter_map(strip_prefix).last() is now typed ref String?, so the .map(to_string) and the "".into() are gone. ty.nika and check_core_args.nika are row b’s checker files: the cause spans both. Fixes: #1078 Pushed: local 46824f2b Tests: unfixed binary (nikaia-suite): row a rustc Mismatched types Vec<(&str, String)>, row b NK1245, the new test fails with NK1245. Fixed: rows a and b print a <x.rlib>/b <y.rlib>. tests/compiler –both-settings 500 passed, the new test included (no name filter exists, so the whole project ran). it modules that mention filter_map/find_map (nullable seq_reductions inline errors mut_bindings views_kept jumps literals map_trust templates expr_ids statement_order jump_guards touch_sets tools_below send entry_points) 334 passed. nikaia-std lib unit tests (ty text_tiers check_core_args project_settings) 10 passed. lower-std fixpoint clean. fmt and clippy 1.97 clean, pre-push-check clean. Clippy 1.99.1 not run (cold target dir, only 6 GB disk free; the Rust change is lowered code only). Gate: green Deviation: none Found: flat_map(fn(l) { l.split(";") }) gets NK1245 on the next lambda: Seq::flat_map declares f: fn(T) -> Vec[U], which a Seq result does not bind. Also on the unfixed binary: a named fn into [1, 4, 6].iter().map(half) reaches rustc (fn(i64) handed &i64), and filter_map(fn(n) { if n > 1 { n / 2 } else { null } }) over iter() reaches rustc with expected reference. Needs: none Changelog: The element type after filter_map and find_map with a lambda is what the lambda’s option holds, so the parts of a split_once it keeps are typed and keep their text kinds (#1078). Owner: none Disk freed: 0 GB (target/nikaia-project-tests 3.5G, / 6.0G free; new entries over 100 MB: run-bundle 480 MB, build-time-parsers 1030 MB) Rs2nika: none

This site is open source. Improve this page.