{"record":{"id":"fc3861d3cc77f6ba","repo":"BoundaryML/baml","slug":"is-type-emits-bytecode","errorCode":null,"errorMessage":"is_type emits bytecode","messagePattern":"is_type emits bytecode","errorType":"panic","errorClass":null,"httpStatus":null,"severity":"error","filePath":"baml_language/crates/baml_compiler2_emit/src/emit.rs","lineNumber":2294,"sourceCode":"            Place::Field { .. } | Place::Index { .. } => {\n                unreachable!(\n                    \"Field/Index stores are handled in emit_statement, not emit_store_place\"\n                );\n            }\n        }\n    }\n\n    // ========================================================================\n    // Terminator Emission\n    // ========================================================================\n\n    fn emit_narrow_bind(&mut self, ty_template: &TyTemplate, destination: Local) {\n        unwrap_infallible(PullSink::is_type(self, ty_template));\n        let last = self\n            .bytecode\n            .instructions\n            .last_mut()\n            .expect(\"is_type emits bytecode\");\n        if let Instruction::IsType(ty) = *last {\n            debug_assert!(!self.captured_locals.contains(&destination));\n            *last = Instruction::NarrowBind {\n                ty,\n                destination: self.local_slots[&destination],\n            };\n        }\n    }\n\n    /// Emit a terminator.\n    fn emit_terminator(&mut self, term: &Terminator<'ctx>) {\n        match term {\n            Terminator::Goto { target } => {\n                // Skip jump if target is the next block (fall-through)\n                self.emit_jump_unless_fallthrough(*target);\n            }\n\n            Terminator::Branch {","sourceCodeStart":2276,"sourceCodeEnd":2312,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/baml_language/crates/baml_compiler2_emit/src/emit.rs#L2276-L2312","documentation":"Internal compiler invariant in narrow-bind emission: PullSink::is_type was expected to return a type blob for the template but instead signaled that it emits bytecode. The narrow-bind path requires a pure type-level answer (it encodes a type template into a constant), so a bytecode-producing sink here means the pull-semantics classification and the emitter disagree. A compiler bug, unreachable from valid user code.","triggerScenarios":"Thrown at baml_language/crates/baml_compiler2_emit/src/emit.rs:2294 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Update baml — the pull-sink classification and emitter are out of sync, which is a compiler bug","Capture the .baml source that triggers it (typically involving a narrow/junction type bind) and report it to the BAML maintainers"],"exampleFix":null,"handlingStrategy":"fallback","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"bd85ce9dee1463ff04d27efd20531013a4ff46c1","analyzedAt":"2026-09-12T03:38:25.718Z","contentChangedAt":"2026-09-12T03:38:25.718Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}