Commit 3d83f99
authored
Maps are being returned not as pointers as they are already pointers (#1956)
This was incorrectly attempting to coerce maps/lists as pointers when
Decode does not return them that way.
Added a test that failed before and now passes.
<!-- ELLIPSIS_HIDDEN -->
----
> [!IMPORTANT]
> Fixes incorrect pointer coercion for maps and lists in
`render_value_coercion()` and adds a test to verify the fix.
>
> - **Behavior**:
> - Fixes incorrect pointer coercion for maps and lists in
`render_value_coercion()` in `generate_types.rs`.
> - Adds a test case in `cffi_test.go` to verify correct handling of
maps and lists.
> - **Models**:
> - Adds `is_map` field to `GoType` struct in `generate_types.rs`.
> - Updates `ToTypeReferenceInTypeDefinition` implementation to set
`is_map` for `FieldType::Map`.
> - **Misc**:
> - Updates `Decode` calls in `types.go` and `unions.go` to remove
unnecessary pointer dereferencing for maps.
>
> <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 e1fc8a0. 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 ae13c4d commit 3d83f99
4 files changed
Lines changed: 18 additions & 3 deletions
File tree
- engine/language_client_codegen/src/go
- integ-tests/go
- baml_client/types
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
68 | 73 | | |
69 | 74 | | |
70 | 75 | | |
| |||
229 | 234 | | |
230 | 235 | | |
231 | 236 | | |
| 237 | + | |
232 | 238 | | |
233 | 239 | | |
234 | 240 | | |
| |||
530 | 536 | | |
531 | 537 | | |
532 | 538 | | |
| 539 | + | |
533 | 540 | | |
534 | 541 | | |
535 | 542 | | |
| |||
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
68 | 76 | | |
69 | 77 | | |
70 | 78 | | |
| |||
0 commit comments