implement super-type fields and methods
This commit is contained in:
parent
ab003e4cdc
commit
df4cc0677b
|
@ -681,6 +681,29 @@ pub mod rust {
|
||||||
|
|
||||||
// TODO: impl super-type fields and methods.
|
// TODO: impl super-type fields and methods.
|
||||||
|
|
||||||
|
let mut sup = class.super_class;
|
||||||
|
let super_traits = core::iter::from_fn(|| {
|
||||||
|
if let Some(key) = sup {
|
||||||
|
let next = self.sdk.get_object(&key);
|
||||||
|
sup = next.and_then(|next| next.super_class());
|
||||||
|
next
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
}
|
||||||
|
})
|
||||||
|
.map(|ty| ty.unique_name())
|
||||||
|
.map(|super_name| {
|
||||||
|
let fields = format_ident!("{super_name}Fields");
|
||||||
|
let methods = format_ident!("{super_name}Methods");
|
||||||
|
|
||||||
|
// FIXME: full path here? meaning I need the package name aswell.
|
||||||
|
|
||||||
|
quote! {
|
||||||
|
impl #fields for #name {}
|
||||||
|
impl #methods for #name {}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
quote! {
|
quote! {
|
||||||
#[repr(transparent)]
|
#[repr(transparent)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
|
|
Loading…
Reference in a new issue