Fix an Erg standard library loading bug

This commit is contained in:
Shunsuke Shibayama 2022-12-09 11:48:13 +09:00
parent a460b431a3
commit a395938413
7 changed files with 68 additions and 47 deletions

View file

@ -10,6 +10,7 @@ use erg_common::{enum_unwrap, log};
use erg_parser::ast::{DefId, OperationKind};
use erg_parser::token::{Token, TokenKind, DOT, EQUAL};
use crate::context::Context;
use crate::ty::typaram::TyParam;
use crate::ty::value::ValueObj;
use crate::ty::HasType;
@ -297,7 +298,7 @@ impl<'a> Linker<'a> {
let path =
enum_unwrap!(expr.ref_t().typarams().remove(0), TyParam::Value:(ValueObj::Str:(_)));
let path = Path::new(&path[..]);
let path = self.cfg.input.local_resolve(path).unwrap();
let path = Context::resolve_real_path(self.cfg, path).unwrap();
// In the case of REPL, entries cannot be used up
let hir = if self.cfg.input.is_repl() {
self.mod_cache