Add span to TypeAnnotation
@@ -34,6 +34,14 @@ impl TypeAnnotation {
TypeAnnotation::NonNull(of) => (*of).type_.inner(),
}
}
+
+ pub fn span(&self) -> Span {
+ match self {
+ TypeAnnotation::Named(x) => x.span,
+ TypeAnnotation::List(of) => (*of).span,
+ TypeAnnotation::NonNull(of) => (*of).span,
+ }
+ }
}
#[derive(Clone, Debug, Eq, PartialEq, Ord, PartialOrd, Hash)]
