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

@ -6,8 +6,8 @@ use crate::file::LoadedModule;
use roc_can::scope::Scope;
use roc_module::ident::ModuleName;
use roc_module::symbol::IdentIds;
use roc_parse::ast;
use roc_parse::ast::CommentOrNewline;
use roc_parse::ast::{self, AliasHeader};
use roc_parse::ast::{AssignedField, Def};
use roc_region::all::Loc;
@ -205,7 +205,10 @@ fn generate_entry_doc<'a>(
_ => (acc, None),
},
Def::Alias { name, vars, ann } => {
Def::Alias {
header: AliasHeader { name, vars },
ann,
} => {
let mut type_vars = Vec::new();
for var in vars.iter() {