fix: decl file generation bug

This commit is contained in:
Shunsuke Shibayama 2025-01-19 15:04:31 +09:00
parent 1aa3f53d5d
commit b52b017c37
1 changed files with 21 additions and 0 deletions

View File

@ -7,6 +7,7 @@ use erg_common::set::Set;
use erg_common::traits::LimitedDisplay; use erg_common::traits::LimitedDisplay;
use erg_common::{log, Str}; use erg_common::{log, Str};
use erg_compiler::build_package::{CheckStatus, PylyzerStatus}; use erg_compiler::build_package::{CheckStatus, PylyzerStatus};
use erg_compiler::context::ControlKind;
use erg_compiler::hir::{ClassDef, Expr, HIR}; use erg_compiler::hir::{ClassDef, Expr, HIR};
use erg_compiler::module::SharedModuleCache; use erg_compiler::module::SharedModuleCache;
use erg_compiler::ty::value::{GenTypeObj, TypeObj}; use erg_compiler::ty::value::{GenTypeObj, TypeObj};
@ -182,6 +183,26 @@ impl DeclFileGenerator {
self.gen_chunk_decl(chunk); self.gen_chunk_decl(chunk);
} }
} }
Expr::Compound(compound) => {
for chunk in compound.iter() {
self.gen_chunk_decl(chunk);
}
}
Expr::Call(call)
if call
.obj
.show_acc()
.is_some_and(|acc| ControlKind::try_from(&acc[..]).is_ok()) =>
{
for arg in call.args.iter() {
self.gen_chunk_decl(arg);
}
}
Expr::Lambda(lambda) => {
for arg in lambda.body.iter() {
self.gen_chunk_decl(arg);
}
}
_ => {} _ => {}
} }
self.code.push('\n'); self.code.push('\n');