scrml.dev v0.7.1
Reference › Errors

E-ONTRANSITION-NO-TARGET

<onTransition> has neither to= nor from=.

Error Compile-time SPEC §51.0.H (normative)

What it means

An <onTransition> handler needs a trigger. to= fires on the outgoing edge into the named variant; from= fires on the incoming edge out of it. With neither attribute the handler is attached to no edge at all and can never run — dead code the compiler surfaces rather than emits.

Minimal reproducer

This is the exact source compiled against the linked compiler and verified to produce E-ONTRANSITION-NO-TARGET.

<program title="p">
    type Phase:enum = { Idle, Busy }
    function ping() { return 1 }
    <engine for=Phase initial=.Idle>
        <Idle rule=(.Busy)>
            <onTransition>ping()</>
        </>
        <Busy rule=(.Idle)>busy</>
    </>
</>

How to fix

  1. Add to=.Variant for the outgoing transition. Runs as the machine leaves this state for the named one.
  2. Add from=.Variant for the incoming transition. Runs as the machine enters this state from the named one.

Related

Specification

Normative text: §51.0.H, §55.15, §34. Spec lives at compiler/SPEC.md .

← Reference