feat: isinstance narrowing

This commit is contained in:
Shunsuke Shibayama 2023-03-29 11:24:53 +09:00
parent ccf02405d8
commit 5876c24830
5 changed files with 62 additions and 24 deletions

View file

@ -932,6 +932,10 @@ impl Context {
self.outer.as_ref().map(|x| x.as_ref())
}
pub(crate) fn get_mut_outer(&mut self) -> Option<&mut Context> {
self.outer.as_mut().map(|x| x.as_mut())
}
pub(crate) fn impl_of(&self) -> Option<Type> {
if let ContextKind::MethodDefs(Some(tr)) = &self.kind {
Some(tr.clone())