Skip to content

baml-language-source-d961dc9485bd4521122b301dcc10a39c0109cdcf

@codeshaunted codeshaunted tagged this 24 Jul 21:57
## Summary

- lower every written class and interface destructure field in source
order
- retain the first runtime field pattern and assign duplicate
occurrences an error type
- preserve all syntactically valid bindings without unresolved-name
cascades

## Testing

- `cargo fmt --manifest-path baml_language/Cargo.toml --all -- --check
--config imports_granularity=Crate --config
group_imports=StdExternalCrate`
- `cargo test --manifest-path baml_language/Cargo.toml -p
baml_compiler2_tir`
- `cargo clippy --manifest-path baml_language/Cargo.toml -p
baml_compiler2_tir -p baml_tests --all-targets -- -D warnings`
- targeted `patterns_class_destructure` snapshots: 26 passed

Linear: B-922

<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit

* **Bug Fixes**
* Improved diagnostics for class and interface patterns that include
unknown fields or members.
* Added clearer “did you mean” style suggestions when a pattern
references an invalid class field.
* Enhanced handling of duplicate field occurrences in patterns to report
issues more accurately.
* Preserved pattern bindings when unknown fields are encountered for
more consistent compiler behavior.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
Assets 2
Loading