Skip to content

const patterns can't be used by themselves, need // prefix #191

@jaqx0r

Description

@jaqx0r

When using a const by itself as a match condition, then we get warnings about
the capture group names not existing.

    const A /(?<a>.*)/
    A {
      x[$a]++
    }

reports that $a not defined in scope.

A workaround is to prefix A with a // to force it into a locally evaluated pattern, which is weird:

// + A {
  x[$a]++
}

Metadata

Metadata

Assignees

Labels

bugThis is considered a bug and shall get fixedmtail-Language/VMIssues related to the mtail language, compiler, or VM

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions