mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 10:49:54 +00:00
feat: isinstance
narrowing
This commit is contained in:
parent
ccf02405d8
commit
5876c24830
5 changed files with 62 additions and 24 deletions
|
@ -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())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue