{"record":{"id":"1d053dbcb1c760c0","repo":"BoundaryML/baml","slug":"unknown-method-at-should-have-been-caught-during","errorCode":null,"errorMessage":"unknown method '{}' at {:?}, should have been caught during typechecking","messagePattern":"unknown method '(.+?)' at (.+?), should have been caught during typechecking","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"engine/baml-compiler/src/thir/interpret.rs","lineNumber":3016,"sourceCode":"                    meta.0\n                ),\n            };\n\n            if args.len() > 1 {\n                bail!(\"to_fixed() method takes at most 1 argument at {:?}\", meta.0);\n            }\n\n            let digits = match args.first() {\n                Some(BamlValueWithMeta::Int(v, _)) => *v,\n                Some(_) => bail!(\"to_fixed() digits argument must be an int at {:?}\", meta.0),\n                None => 0,\n            };\n\n            let formatted = baml_vm::native::number_to_fixed(value, digits)\n                .map_err(|msg| anyhow::anyhow!(\"{msg} at {:?}\", meta.0))?;\n            Ok(BamlValueWithMeta::String(formatted, meta.clone()))\n        }\n        _ => bail!(\n            \"unknown method '{}' at {:?}, should have been caught during typechecking\",\n            method_name,\n            meta.0\n        ),\n    }\n}\n\n#[cfg(test)]\nmod tests {\n    use std::path::PathBuf;\n\n    #[allow(unused_imports)]\n    use baml_types::ir_type::TypeIR;\n    use internal_baml_ast::parse_standalone_expression;\n    use internal_baml_diagnostics::{Diagnostics, SourceFile, Span};\n\n    use super::*;\n    use crate::{","sourceCodeStart":2998,"sourceCodeEnd":3034,"githubUrl":"https://github.com/BoundaryML/baml/blob/bd85ce9dee1463ff04d27efd20531013a4ff46c1/engine/baml-compiler/src/thir/interpret.rs#L2998-L3034","documentation":"evaluate_method_call reached its catch-all arm for a method name it does not implement. The message explicitly states this should have been caught during typechecking, so it signals an internal invariant violation: the typechecker allowed a method call the interpreter does not know (a typechecker/interpreter desync).","triggerScenarios":"Calling a method that exists in docs/another BAML version but is not implemented in this compiler build (e.g. a newly added string/array method on an older interpreter), or a typechecker bug admitting an unsupported method.","commonSituations":"Version skew between editor/tooling support and the installed baml runtime; trying methods from other languages (e.g. .split, .trim) before they are implemented in the interpreter.","solutions":["Upgrade the BAML runtime/compiler so the method is implemented (or downgrade usage to supported methods)","Check the supported-methods list in baml-compiler and replace the call with an available equivalent","If the typechecker should have rejected it, file a bug with the BAML team including the span"],"exampleFix":"// before (method not implemented in this version)\nlet parts = s.split(\",\");\n// after (upgrade, or use supported method)\n// baml-cli / dependency updated, then keep s.split(\",\")","handlingStrategy":"fallback","validationCode":"// check method is supported by your baml-compiler version before use","typeGuard":null,"tryCatchPattern":"try { out = receiver.unknownMethod(x); } catch (e) { log(\"unsupported method: \" + e); out = fallback; }","preventionTips":["Keep baml runtime and editor tooling versions in sync","Consult the supported-methods list for your version","Report typechecker/interpreter desyncs as bugs"],"tags":["runtime","internal","method-not-implemented","baml"],"backgroundTag":"unsupported-operation","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"}