Push constructor IrFunction in class lowering. WIP.
This commit is contained in:
parent
d50cc24d0a
commit
9d3e906957
@ -17,9 +17,9 @@ use crate::error_codes::{FIELD_MULTIPLE_INIT, FIELD_UNINIT};
|
||||
use crate::ir::ir_class::{IrClass, IrField};
|
||||
use crate::ir::ir_function::IrFunction;
|
||||
use crate::source_range::SourceRange;
|
||||
use crate::symbol::Symbol;
|
||||
use crate::symbol::class_symbol::ClassSymbol;
|
||||
use crate::symbol::constructor_symbol::ConstructorSymbol;
|
||||
use crate::symbol::Symbol;
|
||||
use crate::symbol_table::SymbolTable;
|
||||
use crate::type_info::TypeInfo;
|
||||
use crate::types_table::TypesTable;
|
||||
@ -544,8 +544,19 @@ impl Class {
|
||||
) -> (IrClass, Vec<IrFunction>) {
|
||||
let mut ir_functions = Vec::new();
|
||||
|
||||
let self_class_symbol = nodes_to_symbols
|
||||
.get(&self.node_id)
|
||||
.unwrap()
|
||||
.unwrap_class_symbol();
|
||||
|
||||
if let Some(constructor) = &self.constructor {
|
||||
// todo
|
||||
ir_functions.push(constructor.lower_to_ir(
|
||||
self_class_symbol,
|
||||
&self.fields,
|
||||
nodes_to_symbols,
|
||||
symbols_to_types,
|
||||
nodes_to_types,
|
||||
));
|
||||
}
|
||||
|
||||
for function in &self.functions {
|
||||
@ -557,11 +568,6 @@ impl Class {
|
||||
));
|
||||
}
|
||||
|
||||
let self_class_symbol = nodes_to_symbols
|
||||
.get(&self.node_id)
|
||||
.unwrap()
|
||||
.unwrap_class_symbol();
|
||||
|
||||
let ir_class = IrClass::new(
|
||||
self_class_symbol.declared_name_owned(),
|
||||
fqn_parts_to_string(self_class_symbol.fqn_parts()).into(),
|
||||
|
||||
Loading…
Reference in New Issue
Block a user