fix: fieldsexpose getting wrong generic id and not replacing type
This commit is contained in:
parent
47fae21af7
commit
5b908aaeb7
|
@ -1020,7 +1020,6 @@ pub fn monomorphize(
|
||||||
needs_variant = false;
|
needs_variant = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Air::BinOp {
|
Air::BinOp {
|
||||||
scope,
|
scope,
|
||||||
name,
|
name,
|
||||||
|
@ -1153,8 +1152,8 @@ pub fn monomorphize(
|
||||||
let mut tipo = tipo.clone();
|
let mut tipo = tipo.clone();
|
||||||
find_generics_to_replace(&mut tipo, &generic_types);
|
find_generics_to_replace(&mut tipo, &generic_types);
|
||||||
needs_variant = false;
|
needs_variant = false;
|
||||||
|
new_indices.push((ind, name, tipo));
|
||||||
}
|
}
|
||||||
new_indices.push((ind, name, tipo));
|
|
||||||
}
|
}
|
||||||
new_air[index] = Air::FieldsExpose {
|
new_air[index] = Air::FieldsExpose {
|
||||||
scope,
|
scope,
|
||||||
|
|
|
@ -922,9 +922,9 @@ impl<'a> CodeGenerator<'a> {
|
||||||
|
|
||||||
let mut type_map: HashMap<String, Arc<Type>> = HashMap::new();
|
let mut type_map: HashMap<String, Arc<Type>> = HashMap::new();
|
||||||
|
|
||||||
for arg in &constructor_type.arguments {
|
for (index, arg) in tipo.arg_types().unwrap().iter().enumerate() {
|
||||||
let label = arg.label.clone().unwrap();
|
let label = constructor_type.arguments[index].label.clone().unwrap();
|
||||||
let field_type = arg.tipo.clone();
|
let field_type = arg.clone();
|
||||||
|
|
||||||
type_map.insert(label, field_type);
|
type_map.insert(label, field_type);
|
||||||
}
|
}
|
||||||
|
@ -1014,8 +1014,8 @@ impl<'a> CodeGenerator<'a> {
|
||||||
} else {
|
} else {
|
||||||
let mut type_map: HashMap<usize, Arc<Type>> = HashMap::new();
|
let mut type_map: HashMap<usize, Arc<Type>> = HashMap::new();
|
||||||
|
|
||||||
for (index, arg) in constructor_type.arguments.iter().enumerate() {
|
for (index, arg) in tipo.arg_types().unwrap().iter().enumerate() {
|
||||||
let field_type = arg.tipo.clone();
|
let field_type = arg.clone();
|
||||||
|
|
||||||
type_map.insert(index, field_type);
|
type_map.insert(index, field_type);
|
||||||
}
|
}
|
||||||
|
@ -1265,9 +1265,9 @@ impl<'a> CodeGenerator<'a> {
|
||||||
|
|
||||||
let mut type_map: HashMap<String, Arc<Type>> = HashMap::new();
|
let mut type_map: HashMap<String, Arc<Type>> = HashMap::new();
|
||||||
|
|
||||||
for arg in &constructor_type.arguments {
|
for (index, arg) in tipo.arg_types().unwrap().iter().enumerate() {
|
||||||
let label = arg.label.clone().unwrap();
|
let label = constructor_type.arguments[index].label.clone().unwrap();
|
||||||
let field_type = arg.tipo.clone();
|
let field_type = arg.clone();
|
||||||
|
|
||||||
type_map.insert(label, field_type);
|
type_map.insert(label, field_type);
|
||||||
}
|
}
|
||||||
|
@ -1333,8 +1333,8 @@ impl<'a> CodeGenerator<'a> {
|
||||||
} else {
|
} else {
|
||||||
let mut type_map: HashMap<usize, Arc<Type>> = HashMap::new();
|
let mut type_map: HashMap<usize, Arc<Type>> = HashMap::new();
|
||||||
|
|
||||||
for (index, arg) in constructor_type.arguments.iter().enumerate() {
|
for (index, arg) in tipo.arg_types().unwrap().iter().enumerate() {
|
||||||
let field_type = arg.tipo.clone();
|
let field_type = arg.clone();
|
||||||
|
|
||||||
type_map.insert(index, field_type);
|
type_map.insert(index, field_type);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue