mingmwang commented on issue #2175: URL: https://github.com/apache/arrow-datafusion/issues/2175#issuecomment-1095793355
> > with_new_children_if_necessary > > FWIW you could use an associated trait function (or a free function as the PR does) > > ``` > fn with_new_children_if_necessary(s: Arc<dyn ExecutionPlan>, children: Vec<Arc<dyn ExecutionPlan>>) -> Result<Arc<dyn ExecutionPlan>>; > ``` > > Which can be invoked as `ExecutionPlan::with_new_children_if_necessary(s, children)`. Whilst perhaps not as ergonomic as `s.with_new_children_if_necessary(children)`, its effectively a constructor so... 🤷 > I think this can not compile either. For Trait Objects, it requires the first params of the trait method must be the Self type or can be derefed to self -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
