Allow creating builtin traits from methods.

This commit is contained in:
David Wendt 2020-07-11 17:57:46 -04:00
parent 5e932bcb75
commit 9dc6cbe1ce
1 changed files with 9 additions and 0 deletions

View File

@ -92,6 +92,15 @@ impl<'gc> Trait<'gc> {
}
}
pub fn from_method(name: QName<'gc>, method: Method<'gc>) -> Self {
Trait {
name,
is_final: false,
is_override: false,
kind: TraitKind::Method { disp_id: 0, method },
}
}
/// Convert an ABC trait into a loaded trait.
pub fn from_abc_trait(
unit: TranslationUnit<'gc>,