You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: implement Display trait support for DynamicBox opaque types
Enables proper Display trait formatting for opaque types (like Tensor) by storing
and calling Display trait implementation function pointers in DynamicBox.
Key changes:
- Fix Display trait lookup in cranelift_backend to handle both HirType::Opaque
and HirType::Ptr(Opaque) types when creating DynamicBox
- Add display_fn field initialization in zrtl.rs for primitive DynamicBox creation
- Extend ZRTL plugin macro to support 'opaque' return type syntax in signatures
- Add opaque return type signatures to tensor plugin functions
- Fix format_dynamic_box in zrtl_io to properly call display_fn function pointer
- Add arange shorthand to ZynML grammar @Builtin and @types directives
- Change ZynPEG runtime defaults from I32 to Type::Any for proper type inference
Result: Tensors now print as "tensor([1.0, 2.0, 3.0], shape=[3], dtype=f32)"
instead of "<opaque ...>" hex dumps when @types directive properly declares return types.
Note: Type::Any resolution still needs proper implementation in the type resolver/checker.
Currently works for cases where @types directive provides explicit type information.
0 commit comments