Commit 8d66b80
authored
deeply typecheck class constructors (#2000)
<!-- ELLIPSIS_HIDDEN -->
> [!IMPORTANT]
> Enhance type checking for nested fields in class constructors and add
corresponding tests.
>
> - **Behavior**:
> - In `expr_typecheck.rs`, `typecheck_in_context` now checks nested
fields in `Expr::ClassConstructor`.
> - Adds a call to `typecheck_in_context` for each field value in class
constructors.
> - **Tests**:
> - Adds `constructors_nested.baml` to test nested class constructor
type checking.
> - Verifies type mismatch error for incorrect nested field types.
>
> <sup>This description was created by </sup>[<img alt="Ellipsis"
src="https://img.shields.io/badge/Ellipsis-blue?color=175173">](https://www.ellipsis.dev?ref=BoundaryML%2Fbaml&utm_source=github&utm_medium=referral)<sup>
for b6d0603. You can
[customize](https://app.ellipsis.dev/BoundaryML/settings/summaries) this
summary. It will automatically update as commits are pushed.</sup>
<!-- ELLIPSIS_HIDDEN -->1 parent fb87426 commit 8d66b80
2 files changed
Lines changed: 18 additions & 0 deletions
File tree
- engine/baml-lib
- baml-core/src/validate/validation_pipeline/validations
- baml/tests/validation_files/expr
Lines changed: 2 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
253 | 254 | | |
254 | 255 | | |
255 | 256 | | |
256 | 257 | | |
| 258 | + | |
257 | 259 | | |
258 | 260 | | |
259 | 261 | | |
| |||
Lines changed: 16 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
0 commit comments