use crate::parse_tree::CallPath;
use crate::type_engine::TypeInfo;
use crate::Ident;
#[derive(Debug, Clone)]
pub enum MethodName<'sc> {
FromType {
call_path: CallPath<'sc>,
type_name: Option<TypeInfo>,
is_absolute: bool,
},
FromModule { method_name: Ident<'sc> },
}
impl<'sc> MethodName<'sc> {
pub(crate) fn easy_name(&self) -> &'sc str {
match self {
MethodName::FromType { call_path, .. } => call_path.suffix.primary_name,
MethodName::FromModule { method_name, .. } => method_name.primary_name,
}
}
}