scrml.dev v0.7.1
Reference › Errors

E-EQ-004

=== and !== are not scrml operators.

Error Compile-time SPEC §45.7 (normative)

What it means

scrml equality is always strict. Because there is no loose comparison in the language, there is nothing for a second, stricter operator to distinguish itself from — so == and != are the only spellings, and they already mean what === and !== mean in JavaScript. The compiler rejects the JS forms outright rather than silently accepting a synonym, and the diagnostic names the exact replacement.

Minimal reproducer

This is the exact source compiled against the linked compiler and verified to produce E-EQ-004.

<program title="p">
    <count> = 0
    const <isZero> = @count === 0
    <p>${@isZero}</p>
</>

How to fix

  1. Use == or !=. The replacement is mechanical and behaviour-preserving — the emitted comparison was already strict.
  2. Do not reach for a loose-equality escape hatch. There isn't one. If two values of different types need comparing, convert explicitly at the comparison site.

Related

Specification

Normative text: §45.7, §45.8, §34. Spec lives at compiler/SPEC.md .

← Reference