{"record":{"id":"8389a7974a2daf20","repo":"gleam-lang/gleam","slug":"echo-with-no-previous-step-in-a-pipe","errorCode":null,"errorMessage":"echo with no previous step in a pipe","messagePattern":"echo with no previous step in a pipe","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"compiler-core/src/javascript/expression.rs","lineNumber":1046,"sourceCode":"\n        let all_assignments = std::iter::once(first_value)\n            .chain(assignments.iter().map(|(assignment, _kind)| assignment));\n\n        let mut latest_local_var: Option<EcoString> = None;\n        for assignment in all_assignments {\n            // An echo in a pipeline won't result in an assignment, instead it\n            // just prints the previous variable assigned in the pipeline.\n            if let TypedExpr::Echo {\n                expression: None,\n                message,\n                location,\n                ..\n            } = assignment.value.as_ref()\n            {\n                documents.push(self.not_in_tail_position(Some(Ordering::Strict), |this| {\n                    let var = latest_local_var\n                        .as_ref()\n                        .expect(\"echo with no previous step in a pipe\");\n                    this.echo(arena, var.to_doc(arena), message.as_deref(), location)\n                }));\n                documents.push(SEMICOLON_DOCUMENT);\n            } else {\n                // Otherwise we assign the intermediate pipe value to a variable.\n                let assignment_document =\n                    self.not_in_tail_position(Some(Ordering::Strict), |this| {\n                        this.simple_variable_assignment(\n                            arena,\n                            &assignment.name,\n                            &assignment.value,\n                            assignment.location,\n                        )\n                    });\n                documents.push(self.add_statement_level(arena, assignment_document));\n                latest_local_var = Some(self.local_var(&assignment.name));\n            }\n","sourceCodeStart":1028,"sourceCodeEnd":1064,"githubUrl":"https://github.com/gleam-lang/gleam/blob/7e623aa83da3776faee50ca4ab9a6c40124acd95/compiler-core/src/javascript/expression.rs#L1028-L1064","documentation":"Error \"echo with no previous step in a pipe\" thrown in gleam-lang/gleam.","triggerScenarios":"Thrown at compiler-core/src/javascript/expression.rs:1046 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":[],"exampleFix":null,"handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"7e623aa83da3776faee50ca4ab9a6c40124acd95","analyzedAt":"2026-08-17T00:07:02.091Z","schemaVersion":2},"datasetVersion":"2026-08-17T04:17:16.089Z"}