Fix default initializers in classes

This commit is contained in:
2026-07-04 09:03:52 +02:00
parent b02439edfc
commit 603ce1eb1e
2 changed files with 9 additions and 5 deletions
+2 -1
View File
@@ -352,8 +352,9 @@ impl ClassProcessedData {
for field in &self.fields {
if let Some(init) = &field.item.init {
field.gen_span(cg);
cg.add_indentedln(&format!("this.{} = ", field.item.decl.name.get_rust()));
cg.add_indented(&format!("this.{} = ", field.item.decl.name.get_rust()));
init.gen_rust(ctx, cg);
cg.addln(";");
}
}