mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-03 18:29:00 +00:00
chore: improve subr type mismatch hint
This commit is contained in:
parent
f0fdcaca9f
commit
cfd0d259a0
3 changed files with 79 additions and 31 deletions
|
@ -2338,6 +2338,10 @@ impl ASTLowerer {
|
|||
.replace(impl_trait, class);
|
||||
unverified_names.remove(name);
|
||||
if !self.module.context.supertype_of(&replaced_decl_t, def_t) {
|
||||
let hint = self
|
||||
.module
|
||||
.context
|
||||
.get_simple_type_mismatch_hint(&replaced_decl_t, def_t);
|
||||
errors.push(LowerError::trait_member_type_error(
|
||||
self.cfg.input.clone(),
|
||||
line!() as usize,
|
||||
|
@ -2347,7 +2351,7 @@ impl ASTLowerer {
|
|||
impl_trait,
|
||||
&decl_vi.t,
|
||||
&vi.t,
|
||||
None,
|
||||
hint,
|
||||
));
|
||||
}
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue