use crate::Env;
use crate::function::{FunctionBody, FunctionBodyObject};
use std::rc::Rc;
#[derive(Clone, Debug, Default)]
pub struct FunctionBodyStub;
impl FunctionBodyStub {
#[inline(always)]
#[must_use]
pub fn new() -> Self {
Self
}
#[inline]
#[must_use]
pub fn rc_dyn<S>() -> Rc<dyn FunctionBodyObject<S>> {
Rc::new(Self::new())
}
}
impl std::fmt::Display for FunctionBodyStub {
fn fmt(&self, _: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
unreachable!("unexpected call to FunctionBodyStub::fmt")
}
}
impl<S> FunctionBody<S> for FunctionBodyStub {
async fn execute(&self, _: &mut Env<S>) -> crate::semantics::Result {
unreachable!("unexpected call to FunctionBodyStub::execute")
}
}