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>