Print type name in type resolver error
diff --git a/syntax/resolve.rs b/syntax/resolve.rs
index 821f542..757b78f 100644
--- a/syntax/resolve.rs
+++ b/syntax/resolve.rs
@@ -10,10 +10,11 @@
impl<'a> Types<'a> {
pub fn resolve(&self, ident: &impl UnresolvedName) -> Resolution<'a> {
- *self
- .resolutions
- .get(ident.ident())
- .expect("Unable to resolve type")
+ let ident = ident.ident();
+ match self.resolutions.get(ident) {
+ Some(resolution) => *resolution,
+ None => panic!("Unable to resolve type `{}`", ident),
+ }
}
}