Handle unrecognized type names in checking signature for mutable return type
diff --git a/syntax/resolve.rs b/syntax/resolve.rs
index 757b78f..3a2635b 100644
--- a/syntax/resolve.rs
+++ b/syntax/resolve.rs
@@ -11,11 +11,16 @@
impl<'a> Types<'a> {
pub fn resolve(&self, ident: &impl UnresolvedName) -> Resolution<'a> {
let ident = ident.ident();
- match self.resolutions.get(ident) {
- Some(resolution) => *resolution,
+ match self.try_resolve(ident) {
+ Some(resolution) => resolution,
None => panic!("Unable to resolve type `{}`", ident),
}
}
+
+ pub fn try_resolve(&self, ident: &impl UnresolvedName) -> Option<Resolution<'a>> {
+ let ident = ident.ident();
+ self.resolutions.get(ident).copied()
+ }
}
pub trait UnresolvedName {