Skip to content

v0.6.5

  • v0.6.5
  • d41eb22
  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
  • Choose a tag to compare

  • v0.6.5
  • d41eb22
  • Choose a tag to compare

  • Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature.
@robertvansteen robertvansteen tagged this 27 Jul 11:14
An expression pattern's compiled child was recorded as `pattern.expression`
— a constant, while the sibling recorded three lines away in the same
compiler is `arm.{index}.expression`. `compilePattern()` simply never
received the index, though the `within()` wrapper at its call site already
had one.

A role is how a caller tells one child from another. Two arms with
expression patterns therefore reported one name twice:

    match n { 5 => 'five', 10 => 'ten', _ => 'other' }

    subject, pattern.expression, arm.0.expression,
             pattern.expression, arm.1.expression, arm.2.expression

Nothing in the analysis said which pattern the second `5`-vs-`10` type
belonged to, so a consumer reading types off an analysis had to fall back to
child order — an implementation detail this package never promised. Patterns
are now `arm.{index}.pattern` and the six children have six names.

Paths are untouched: a child is still `$.children[1].node`, and the failure
channel still locates by path. Only the naming changes, so a consumer
matching the literal `pattern.expression` reads `arm.{index}.pattern`.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Assets 2
Loading