Coalesce inline and normal alias headers

Unifies `As` annotations and `Alias` defs to use a common struct for
defining alias header information, i.e. the name and type variables of
the alias.
This commit is contained in:
ayazhafiz 2021-12-26 09:37:35 -06:00
parent 597a1cef3b
commit 966198a6e7
11 changed files with 61 additions and 27 deletions

View file

@ -228,7 +228,7 @@ pub struct PrecedenceConflict<'a> {
#[derive(Debug, Clone, Copy, PartialEq)]
pub struct AliasHeader<'a> {
pub name: Loc<&'a str>,
pub vars: &'a [Loc<&'a str>],
pub vars: &'a [Loc<Pattern<'a>>],
}
#[derive(Debug, Clone, Copy, PartialEq)]
@ -242,8 +242,7 @@ pub enum Def<'a> {
///
/// Foo : Bar Baz
Alias {
name: Loc<&'a str>,
vars: &'a [Loc<Pattern<'a>>],
header: AliasHeader<'a>,
ann: Loc<TypeAnnotation<'a>>,
},