scrml.dev v0.7.1
Reference › Errors

W-AUTH-RUNTIME-FALLBACK

An auth gate's predicate cannot be statically resolved, so the gate ships eagerly.

Info Compile-time SPEC §40.9.5 (normative)

Despite the W- prefix, the compiler assigns this diagnostic severity info.

What it means

Closed-form gate predicates — a variant literal, a literal comma-OR, a const-ref to a role set — let the compiler compute per-role bundles, so a visitor never downloads code for a role they do not hold. A predicate the compiler cannot resolve statically (a reactive read, an async server check) defeats that: the gated component ships to everyone and the check moves to render time. The gate is still enforced — this is a bundle-size and information-exposure trade-off, not a security hole in the check itself.

Minimal reproducer

This is the exact source compiled against the linked compiler and verified to produce W-AUTH-RUNTIME-FALLBACK.

<program title="p" auth="required">
    type Role:enum = { Admin, Member }
    <currentRole> = "Member"
    <auth role=@currentRole>
        <p>gated</p>
    </>
</>

How to fix

  1. Refactor to a closed-form predicate. <auth role="Admin"> resolves statically and gets its own per-role chunk.
  2. Accept the eager-ship default. Legitimate when the role genuinely is not known at compile time. The lint exists to make the cost visible, not to forbid the pattern.

Related

Specification

Normative text: §40.9.5, §40.1.1, §34. Spec lives at compiler/SPEC.md .

← Reference