Commit Graph

1 Commits

Author SHA1 Message Date
KtorZ 54d41f73ea
Fix adjacent sequence collapse in parser
Without this fix, the parser wrongly turns the following:

  ```
  {
    let a = Void
    a
  }
  let _ = True
  True
  ```

  into the following:

  ```
  let a = Void
  a
  let _ = True
  True
  ```

  Which in this particular example looks benign. But now takes something
  more _real-world_:

  ```
  {
    let scope, output <- for_each_2(scopes, other_outputs)
    Void
  }

  let _ = True
  True
  ```

  This would lead to the the entire sequence that follows the
  backpassed continuation to be added to the continuation; here
  ultimately causing a type unification error (since for_each_2 is
  expected to yield Void, not Bool).

  This is utterly confusing.. and dangerous.

Signed-off-by: KtorZ <matthias.benkort@gmail.com>
2025-03-16 13:46:52 +01:00