# E4217

Compiler diagnostic name: `lexscan_guard_not_supported`.

This diagnostic described a guard on a `lexmatch` or `lexscan` case and is not
emitted by the current compiler. The parser now rejects this syntax with
[E3002](E3002.md).

The scanner selects a case from its regex patterns before it evaluates the case
body. A guard would make that selection depend on an arbitrary expression.

## Erroneous example

```{literalinclude} /sources/error_codes/4217_error/top.mbt
:language: moonbit
```

## Suggestion

Move the additional condition into the selected case body.

```{literalinclude} /sources/error_codes/4217_fixed/top.mbt
:language: moonbit
```
