mirror of
https://github.com/erg-lang/erg.git
synced 2025-08-04 02:39:20 +00:00
fix: module member resolution bug
This commit is contained in:
parent
7f2c0301e2
commit
53cd052dc3
5 changed files with 36 additions and 10 deletions
|
@ -2584,7 +2584,10 @@ impl PyCodeGenerator {
|
|||
fn emit_import(&mut self, acc: Accessor) {
|
||||
self.emit_load_const(0i32);
|
||||
self.emit_load_const(ValueObj::None);
|
||||
let full_name = Str::from(acc.show());
|
||||
let full_name = Str::from(
|
||||
acc.qual_name()
|
||||
.map_or(acc.show(), |s| s.replace(".__init__", "")),
|
||||
);
|
||||
let name = self
|
||||
.local_search(&full_name, Name)
|
||||
.unwrap_or_else(|| self.register_name(full_name));
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue