Working inheritance

This commit is contained in:
2026-05-28 16:21:36 +02:00
parent 99ff0ead2d
commit 97b2cc4413
+9 -1
View File
@@ -339,6 +339,12 @@ impl GenRust for TopLevelKind {
));
cg.indent += 1;
if let Some(inherits) = inherits {
cg.add_indented("pub _super: ");
cg.add(&inherits.get_rust());
cg.addln(",");
}
for field in fields.clone() {
cg.add_indentedln(&field.get_comment());
cg.add_indentedln(&field.item.decl.get_rust());
@@ -421,7 +427,9 @@ impl GenRust for TopLevelKind {
cg.addln(" {");
cg.indent += 1;
cg.add_indentedln("fn deref(&mut self) -> &mut Self::Target {&mut self._super}");
cg.add_indentedln(
"fn deref_mut(&mut self) -> &mut Self::Target {&mut self._super}",
);
cg.indent -= 1;
cg.addln("}");