scrml.dev v0.8.0
E-PURE-001 · scrml error reference
Retired code

E-PURE-001 was retired 2026-07-16 and is no longer emitted by the compiler. It is superseded by the E-FN-001…009 family, which SPEC §33.6 defines as specialized subcategories of it. The pure modifier is deprecated language-wide — use fn. This page is kept because older build output and existing code still reference the old code.

Reference › Errors

E-PURE-001

pure-marked function performs a non-pure operation (write, IO, mutation).

What to do instead

Mark a pure function with fn. The compiler checks the body and reports a specific E-FN-* code for each kind of impurity — for example, a write to a reactive cell:

<program>
  <x> = 0
  fn bump() { @x = 1 }      // E-FN-003: fn body writes to @x
  <button onclick=bump()>bump</button>
</program>

pure function still compiles, with the warning W-PURE-DEPRECATED. The full list of E-FN-* codes is in the catalogue at SPEC §34 (§33.6 for the rules).

← Reference