Commit 9bc50ce
generics: more inference coverage, native TypeError, class-method must-specify, deep unbound recursion
Tests (bex + python):
- heterogeneous array element unification (elem_type)
- unbound-instance forcing-formal recovery (ContainerShapes, GenericRecursive,
nested GenericPair) — now incl. FULLY-unbound deep nesting
- concrete baml_sdk types in covariant joins (enum + class)
- partial _types= noted as unusual; prefer inference / subscript
Inference errors -> native TypeError:
- route EngineError::TypeMismatch to a structured baml.errors.TypeMismatch
(bridge_cffi) instead of an opaque SdkPanic; map to Python TypeError in
proto.py; assert type + message on every must-specify / conflict case
- add baml.errors.TypeMismatch stdlib class; refresh builtin/HIR/TIR/bytecode
snapshots
Class-method must-specify (rule 3):
- carry generic_param_count on the runtime Class; Gate A demands a method's OWN
generic params (suffix after the class prefix), so a body-only own var
(reflect_t<T>()) is rejected, matching the free-function analogue
Deep unbound recursion:
- reconstruct_unbound_instance_args is formal-aware, recursing through nested
unbound instances so all vars are recovered from leaf field values
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>1 parent ffdae69 commit 9bc50ce
25 files changed
Lines changed: 1505 additions & 291 deletions
File tree
- baml_language
- crates
- baml_builtins2/baml_std/baml/ns_errors
- baml_cli/src/snapshots
- baml_compiler2_emit/src
- baml_tests
- snapshots/compiles/__baml_std__
- src/compiler2_tir/snapshots
- tests/bytecode_format/snapshots
- bex_engine
- src
- tests
- bex_heap/src
- bex_vm_types/src/types
- bex_vm
- src
- tests
- bridge_cffi/src
- sdk_tests
- crates/python_pydantic2
- function_calls/customizable
- type_shapes/customizable/roundtrip_tests
- fixtures/function_calls/baml_src/ns_generic_tests
- sdks
- nodejs/bridge_nodejs
- dist/proto
- typescript_src/proto
- python
- src/baml_core
Lines changed: 10 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
Lines changed: 1 addition & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
86 | 86 | | |
87 | 87 | | |
88 | 88 | | |
| 89 | + | |
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
869 | 869 | | |
870 | 870 | | |
871 | 871 | | |
| 872 | + | |
872 | 873 | | |
873 | 874 | | |
874 | 875 | | |
| |||
Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 commit comments