gleam-lang/gleam · error

decision tree with no subjects

Error message

decision tree with no subjects

What it means

Error "decision tree with no subjects" thrown in gleam-lang/gleam.

Source

Thrown at compiler-core/src/javascript/decision.rs:1324

        }

        assignments
    }

    /// Give a unique name to the subject of a let expression (if it needs one
    /// and it's not already a variable) and keep track of that name in case it
    /// needs to be referenced later.
    ///
    fn assign_let_subject(
        &mut self,
        arena: &'doc DocumentArena<'a, 'doc>,
        compiled_case: &'a CompiledCase,
        subject: &'a TypedExpr,
    ) -> SubjectAssignment<'a, 'doc> {
        let variable = compiled_case
            .subject_variables
            .first()
            .expect("decision tree with no subjects");
        let assignment = assign_subject(arena, self.expression_generator, subject, Ordering::Loose);
        self.set_value(variable, assignment.name());
        self.bind(assignment.name(), variable);
        assignment
    }

    fn local_var(&mut self, name: &EcoString) -> EcoString {
        self.expression_generator.local_var(name)
    }

    fn next_local_var(&mut self, name: &EcoString) -> EcoString {
        self.expression_generator.next_local_var(name)
    }

    /// Records that a given pattern `variable` has been assigned a runtime
    /// `value`. For example if we had something like this:
    ///
    /// ```txt

View on GitHub (pinned to 7e623aa83d)

When it happens

Trigger: Thrown at compiler-core/src/javascript/decision.rs:1324 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of gleam-lang/gleam@7e623aa83d (2026-08-17). Data as JSON: /api/errors/1fcf718cbb74f142. Report an issue: GitHub.