mirror of
https://github.com/erg-lang/erg.git
synced 2025-10-02 21:44:34 +00:00
Fix a python module resolving bug
This commit is contained in:
parent
3c17518963
commit
954c6f752d
4 changed files with 41 additions and 36 deletions
|
@ -424,7 +424,15 @@ impl Context {
|
|||
}
|
||||
Type::Poly { name, mut params } => {
|
||||
let typ = poly(&name, params.clone());
|
||||
let (_, ctx) = self.get_nominal_type_ctx(&typ).unwrap();
|
||||
let (_, ctx) = self.get_nominal_type_ctx(&typ).ok_or_else(|| {
|
||||
TyCheckError::type_not_found(
|
||||
self.cfg.input.clone(),
|
||||
line!() as usize,
|
||||
loc,
|
||||
self.caused_by(),
|
||||
&typ,
|
||||
)
|
||||
})?;
|
||||
let variances = ctx.type_params_variance();
|
||||
for (param, variance) in params.iter_mut().zip(variances.into_iter()) {
|
||||
*param = self.deref_tp(mem::take(param), variance, loc)?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue