mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix: overload resolution bug
This commit is contained in:
parent
66352ddd3a
commit
21d5f22ca8
5 changed files with 30 additions and 1 deletions
|
@ -1126,7 +1126,15 @@ impl Context {
|
|||
_ => {}
|
||||
}
|
||||
if self.subtype_of(ty, &input_t) {
|
||||
return Ok(ty.clone());
|
||||
if let Ok(instance) = self.instantiate(ty.clone(), obj) {
|
||||
let subst = self
|
||||
.substitute_call(obj, &None, &instance, pos_args, kw_args, self)
|
||||
.is_ok();
|
||||
let eval = self.eval_t_params(instance, self.level, obj).is_ok();
|
||||
if subst && eval {
|
||||
return Ok(ty.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
let Type::Subr(subr_t) = input_t else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue