(&self, other: &Box<dyn Value>)
| 68 | } |
| 69 | |
| 70 | fn mul_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 71 | if let Some(other_int) = other.as_any().downcast_ref::<IntValue>() { |
| 72 | let value = self.value * other_int.value; |
| 73 | return Ok(Box::new(IntValue::new(value))); |
| 74 | } |
| 75 | Err("Unexpected type to perform `*` with".to_string()) |
| 76 | } |
| 77 | |
| 78 | fn div_op(&self, other: &Box<dyn Value>) -> Result<Box<dyn Value>, String> { |
| 79 | if let Some(other_int) = other.as_any().downcast_ref::<IntValue>() { |