Skip to content

Commit f80d685

Browse files
committed
add fb_init calls to init fns
1 parent 69603ab commit f80d685

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

src/lowering/initializers.rs

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,22 @@ fn create_init_unit(
195195
})
196196
.collect::<Vec<_>>();
197197

198+
if let Some(fbinit) = lowerer
199+
.index
200+
.find_method(container_name, "fb_init")
201+
.and_then(|it| it.find_implementation(&lowerer.index))
202+
{
203+
let base = create_member_reference("self", id_provider.clone(), None);
204+
let op = create_member_reference(
205+
&fbinit.get_call_name().rsplit_once('.').map(|(_, name)| name).unwrap(),
206+
id_provider.clone(),
207+
Some(base),
208+
);
209+
let call_statement =
210+
AstFactory::create_call_statement(op, None, id_provider.next_id(), location.clone());
211+
statements.push(call_statement);
212+
}
213+
198214
let member_init_calls = lowerer
199215
.index
200216
.get_container_members(container_name)

0 commit comments

Comments
 (0)