Skip to content

Extend C-345 to a type-variable parameter instantiated at Result - #139

Merged
O6lvl4 merged 2 commits into
mainfrom
c345-generic-param-3
Oct 13, 2026
Merged

O6lvl4 merged 2 commits into
mainfrom
c345-generic-param-3

Conversation

@O6lvl4

@O6lvl4 O6lvl4 commented Oct 12, 2026

Copy link
Copy Markdown
Contributor

Widens C-345 (ALS-C5) to cover a type-variable parameter instantiated at Result, and adds a fixture for it.

Why. almide/almide#3646 found a case C-345 doesn't cover. Inside an effect fn, id(int.parse("7")) (where fn id[T](x: T) -> T), or a list.fold seeded with a Result-returning call, lowered with a ? on the argument:

  • native failed with rustc E0308;
  • wasm walled with E082;
  • yet almide check accepted the program.

The per-parameter exemption from #1970 only read parameters declared Result/Option.

The amended statement says that no call argument takes the auto-?. The checker constrains every argument against its parameter (E005, with ! as the only propagation), so an argument that is still Result-typed is one its parameter accepts. The title is widened to match.

The fixture, spec/wasm_cross/result_generic_param_arg.almd, covers:

  • id of a pure Result call, an Err Result and an effect call;
  • list.fold seeded with a Result call and with an effect call;
  • map.get_or and list.get_or with Result defaults.

Judge, run locally.

  • ref/target/release/als-ref run … --json prints exactly what almide prints on native and wasm with the almide fix (branch fix-3646-generic-arg-auto-try), byte for byte, exit 0.
  • Released 0.67.1 and develop 7ba9f194b fail to build it on both legs. That is the finding this records, and it means the informational release conformance run will show this fixture red until a release carries the fix.

Replaces #136 and #138, rebuilt on main after #137 merged (the required gates check runs on the up-to-date base; no force-push).

O6lvl4 and others added 2 commits October 13, 2026 08:57
… add its fixture

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@O6lvl4
O6lvl4 merged commit af5fcca into main Oct 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant