scrml.dev v0.7.1
Reference › Errors

E-INTERNAL-RULE-NOT-COMPOSITE

internal:rule= on a state-child with no inner <engine>.

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

What it means

internal:rule= governs which inner-engine variants are reachable from within a composite state. Like history, it is composite-only — on a leaf state-child there is no inner machine for it to constrain, so the attribute is inert and the compiler rejects it rather than letting a reader believe it constrains something.

Minimal reproducer

This is the exact source compiled against the linked compiler and verified to produce E-INTERNAL-RULE-NOT-COMPOSITE.

<program title="p">
    type Phase:enum = { Idle, Busy }
    <engine for=Phase initial=.Idle>
        <Idle rule=(.Busy) internal:rule=(.Busy)>idle</>
        <Busy rule=(.Idle)>busy</>
    </>
</>

How to fix

  1. Add an inner <engine>. The attribute then constrains that machine's reachable variants.
  2. Remove internal:rule=. For a leaf state, the outer rule= is the only transition contract that applies.

Related

Specification

Normative text: §51.0.O, §51.0.Q, §34. Spec lives at compiler/SPEC.md .

← Reference