mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-29 06:44:46 +00:00
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:
parent
597a1cef3b
commit
966198a6e7
11 changed files with 61 additions and 27 deletions
|
@ -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>>,
|
||||
},
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue