mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 18:58:30 +00:00
fix: type coercion bug
This commit is contained in:
parent
e273517bb5
commit
4cd79cbb1a
11 changed files with 194 additions and 107 deletions
|
@ -3484,9 +3484,9 @@ impl Context {
|
|||
// In many cases, it is still better to determine the type variable than if the target is not found.
|
||||
let coerced = self.coerce_tp(lhs.clone(), t_loc)?;
|
||||
if lhs != coerced {
|
||||
let proj = proj_call(coerced, attr_name, args);
|
||||
let proj = proj_call(coerced.clone(), attr_name, args);
|
||||
self.eval_t_params(proj, level, t_loc)
|
||||
.inspect(|_t| lhs.destructive_coerce())
|
||||
.inspect(|_t| lhs.destructive_link(&coerced))
|
||||
.map_err(|(_, errs)| errs)
|
||||
} else {
|
||||
let proj = proj_call(lhs, attr_name, args);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue