fixing infinite recusrion bug
This commit is contained in:
parent
2a4d27d8e6
commit
1ee8d464c6
|
@ -759,9 +759,16 @@ impl Codegen {
|
|||
use {Expr as E, TokenKind as T};
|
||||
let value = match *expr {
|
||||
E::Mod { id, .. } => Some(Value::ty(ty::Kind::Module(id).compress())),
|
||||
E::Struct { captured, .. } => {
|
||||
E::Struct { captured, packed, fields, .. } => {
|
||||
if captured.is_empty() {
|
||||
Some(Value::ty(self.ty(expr)))
|
||||
Some(Value::ty(
|
||||
ty::Kind::Struct(self.build_struct(
|
||||
self.ci.file,
|
||||
packed.then_some(1),
|
||||
fields,
|
||||
))
|
||||
.compress(),
|
||||
))
|
||||
} else {
|
||||
let values = captured
|
||||
.iter()
|
||||
|
|
|
@ -705,6 +705,14 @@ impl Types {
|
|||
}
|
||||
ty
|
||||
}
|
||||
Expr::Slice { size: None, item, .. } => {
|
||||
let ty = self.ty(file, item, files)?;
|
||||
self.make_array(ty, ArrayLen::MAX)
|
||||
}
|
||||
//Expr::Slice { size: Some(&Expr::Number { value, .. }), item, .. } => {
|
||||
// let ty = self.ty(file, item, files)?;
|
||||
// self.make_array(ty, value as _)
|
||||
//}
|
||||
Expr::Struct { pos, fields, packed, .. } => {
|
||||
let sym = SymKey { file, ident: pos };
|
||||
if let Some(&ty) = self.syms.get(&sym) {
|
||||
|
|
Loading…
Reference in a new issue