mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
chore: add hir::Methods
This commit is contained in:
parent
234fa3ffeb
commit
21c937e633
14 changed files with 109 additions and 64 deletions
|
@ -1295,7 +1295,7 @@ impl Context {
|
|||
}
|
||||
}
|
||||
hir::Expr::ClassDef(class_def) => {
|
||||
for def in class_def.methods.iter_mut() {
|
||||
for def in class_def.all_methods_mut() {
|
||||
self.resolve_expr_t(def, qnames)?;
|
||||
}
|
||||
Ok(())
|
||||
|
|
|
@ -3405,7 +3405,7 @@ impl Context {
|
|||
candidates.collect()
|
||||
}
|
||||
|
||||
pub(crate) fn is_class(&self, typ: &Type) -> bool {
|
||||
pub fn is_class(&self, typ: &Type) -> bool {
|
||||
match typ {
|
||||
Type::And(_l, _r) => false,
|
||||
Type::Never => true,
|
||||
|
@ -3429,7 +3429,7 @@ impl Context {
|
|||
}
|
||||
}
|
||||
|
||||
pub(crate) fn is_trait(&self, typ: &Type) -> bool {
|
||||
pub fn is_trait(&self, typ: &Type) -> bool {
|
||||
match typ {
|
||||
Type::Never => false,
|
||||
Type::FreeVar(fv) if fv.is_linked() => self.is_class(&fv.crack()),
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue