record, tag, alias errors

- duplicate fields and tags are reported
- circular aliases are reported
This commit is contained in:
Folkert 2020-04-13 20:53:16 +02:00
parent 0372b34e86
commit f6af66f342
13 changed files with 679 additions and 55 deletions

View file

@ -71,6 +71,15 @@ impl<T> Expected<T> {
}
}
pub fn get_annotation_region(&self) -> Option<Region> {
match self {
Expected::FromAnnotation(_, _, AnnotationSource::TypedBody { region }, _) => {
Some(*region)
}
_ => None,
}
}
pub fn replace<U>(self, new: U) -> Expected<U> {
match self {
Expected::NoExpectation(_val) => Expected::NoExpectation(new),