Skip to content

Draft: Combine afterguard and guard into a single primitive function

Jordy Aaldering requested to merge 2367-combine-guard-and-afterguard into develop

Conformity checks only have an afterguard, we want to combine this afterguard with guard so that we have a single primitive function, instead of having almost the same thing twice.

Additionally, similarly to type patterns, we want this guard to occur both before and after the conformity checked code so that we can keep the context in the future if we have better error messages.

Something like:

p1 = conformity check 1
...
pv = conformity check v

x1', .., xn' = guard (n, x, .., xn, p1, .., pv, "context");
res1, .., resm = _prf_ (x1', .., xn');
res1', .., resm' = guard (m, res1, .., resm, p1, .., pv, "context");

Closes #2367 (closed) Closes #2363 (closed)

Edited by Jordy Aaldering

Merge request reports