diff --git a/compiler/erg_compiler/lower.rs b/compiler/erg_compiler/lower.rs index 34107c7e..e03f9be6 100644 --- a/compiler/erg_compiler/lower.rs +++ b/compiler/erg_compiler/lower.rs @@ -171,7 +171,7 @@ impl ASTLowerer { None, expect, found, - self.ctx.get_candidates(found), + None, // self.ctx.get_candidates(found), Context::get_simple_type_mismatch_hint(expect, found), ) }) @@ -1475,7 +1475,6 @@ impl ASTLowerer { fn lower_redef(&mut self, redef: ast::ReDef) -> LowerResult { log!(info "entered {}({redef})", fn_name!()); - let loc = redef.loc(); let attr = self.lower_acc(redef.attr)?; let expr = self.lower_expr(*redef.expr)?; if let Err(err) = self.var_result_t_check( @@ -1486,20 +1485,6 @@ impl ASTLowerer { ) { self.errs.push(err); } - if !self.ctx.supertype_of(attr.ref_t(), expr.ref_t()) { - self.errs.push(LowerError::type_mismatch_error( - self.cfg.input.clone(), - line!() as usize, - loc, - self.ctx.caused_by(), - &attr.to_string_notype(), - None, - attr.ref_t(), - expr.ref_t(), - None, - None, - )); - } Ok(hir::ReDef::new(attr, hir::Block::new(vec![expr]))) }