Refactor: Replace Object with StreamStorage for streams
The `Object` trait is too generic and has been causing confusion. This commit introduces `StreamStorage` as a dedicated trait for reactive stream types. This change involves: - Renaming `Object` to `StreamStorage` in relevant places. - Updating the `Value::Object` enum variant to `Value::Stream`. - Modifying how streams are handled in the compiler, VM, and tests to use the new `StreamStorage` trait. - Adjusting example scripts and tests to reflect the change in type representation. - The `StreamNode` struct now explicitly holds its `element_type`.
This commit is contained in:
@@ -245,7 +245,7 @@ impl Specializer {
|
||||
// Only replace the callee if the compiled value is actually a function/object.
|
||||
// If it's a scalar (like 30 from folding), we DON'T fold here.
|
||||
// We keep the Call but update the callee to the specialized version if it's an object.
|
||||
if let Value::Object(_) | Value::Function(_) = &compiled_val {
|
||||
if let Value::Stream(_) | Value::Function(_) = &compiled_val {
|
||||
let specialized_callee = self.make_constant_node(
|
||||
compiled_val,
|
||||
StaticType::Function(Box::new(Signature {
|
||||
|
||||
Reference in New Issue
Block a user