doughlang: enums, ref patterns, ref types
This commit is contained in:
@@ -162,14 +162,14 @@ impl<A: Annotation> Match<A> for Mod<A> {
|
||||
}
|
||||
}
|
||||
|
||||
impl<A: Annotation> Match<A> for Struct {
|
||||
impl<A: Annotation> Match<A> for Typedef {
|
||||
fn recurse(sub: &mut Subst<A>, pat: &Self, expr: &Self) -> bool {
|
||||
let (Self(pat_pat), Self(expr_pat)) = (pat, expr);
|
||||
Match::recurse(sub, pat_pat, expr_pat)
|
||||
let (Self(pat_kind, pat_pat), Self(expr_kind, expr_pat)) = (pat, expr);
|
||||
pat_kind == expr_kind && Match::recurse(sub, pat_pat, expr_pat)
|
||||
}
|
||||
|
||||
fn apply(&mut self, sub: &Subst<A>) {
|
||||
let Self(pat) = self;
|
||||
let Self(_, pat) = self;
|
||||
pat.apply(sub);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user