use super::super::{
super::{annotate::*, normal::*},
errors::*,
resolve::*,
};
use {
duplicate::*,
kutil::std::{error::*, immutable::*},
};
#[duplicate_item(
ResolvedT;
[isize];
[i64];
[i32];
[i16];
[i8];
[usize];
[u64];
[u32];
[u16];
[u8];
[f64];
[f32];
[bool];
[ByteString];
[String];
[Bytes];
)]
impl<AnnotatedT> Resolve<ResolvedT, AnnotatedT> for Variant<AnnotatedT>
where
AnnotatedT: Annotated + Clone + Default,
{
fn resolve_with_errors<ErrorReceiverT>(self, errors: &mut ErrorReceiverT) -> ResolveResult<ResolvedT, AnnotatedT>
where
ErrorReceiverT: ErrorReceiver<ResolveError<AnnotatedT>>,
{
let maybe_annotations = self.maybe_annotations();
Ok(match self.try_into() {
Ok(native) => Some(native),
Err(error) => {
errors.give(error.with_annotations_from(&maybe_annotations))?;
None
}
})
}
}