1use crate::syntax::{IdentifiedTypedObject, MaybeIdentifiedTypedObject, TypedObject};
2
3pub trait Typed {
4 fn types(&self) -> &[String];
5}
6
7impl Typed for std::convert::Infallible {
8 fn types(&self) -> &[String] {
9 unreachable!()
10 }
11}
12
13impl Typed for IdentifiedTypedObject {
14 fn types(&self) -> &[String] {
15 &self.types
16 }
17}
18
19impl Typed for MaybeIdentifiedTypedObject {
20 fn types(&self) -> &[String] {
21 &self.types
22 }
23}
24
25impl Typed for TypedObject {
26 fn types(&self) -> &[String] {
27 &self.types
28 }
29}