pub trait Overload {
// Required methods
fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>;
fn unroll(
&self,
params: Vec<AnyExpr>,
context: &mut CompileContext,
props: Properties,
) -> AnyExpr;
}
Expand description
Trait for function overloads
Required Methods§
Sourcefn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>
fn get_returned_type(&self, params: &[AnyExpr]) -> Option<Type>
Get the return type for the given parameters. Returns None
if the overload
cannot be called with these parameters.
Sourcefn unroll(
&self,
params: Vec<AnyExpr>,
context: &mut CompileContext,
props: Properties,
) -> AnyExpr
fn unroll( &self, params: Vec<AnyExpr>, context: &mut CompileContext, props: Properties, ) -> AnyExpr
Unroll the function for the given params. The resulting expression
matches the type returned by get_returned_type
.