feat: implement Structural types

This commit is contained in:
Shunsuke Shibayama 2023-02-23 01:37:54 +09:00
parent 8903e84011
commit c9dda183ab
16 changed files with 472 additions and 58 deletions

View file

@ -1975,11 +1975,12 @@ impl ASTLowerer {
match expr {
acc @ hir::Expr::Accessor(_) => Some(acc),
hir::Expr::Call(mut call) => match call.obj.show_acc().as_ref().map(|s| &s[..]) {
Some("Class") => call.args.remove_left_or_key("Requirement"),
Some("Class" | "Trait") => call.args.remove_left_or_key("Requirement"),
Some("Inherit") => call.args.remove_left_or_key("Super"),
Some("Inheritable") => {
Self::get_require_or_sup_or_base(call.args.remove_left_or_key("Class").unwrap())
}
Some("Structural") => call.args.remove_left_or_key("Type"),
Some("Patch") => call.args.remove_left_or_key("Base"),
_ => todo!(),
},