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

@ -14,6 +14,7 @@ use roc_collections::all::{default_hasher, ImMap, ImSet, MutMap, MutSet, SendMap
use roc_module::ident::Lowercase;
use roc_module::symbol::Symbol;
use roc_parse::ast;
use roc_parse::ast::AliasHeader;
use roc_parse::pattern::PatternType;
use roc_problem::can::{CycleEntry, Problem, RuntimeError};
use roc_region::all::{Loc, Region};
@ -1505,7 +1506,9 @@ fn to_pending_def<'a>(
}
Alias {
name, vars, ann, ..
header: AliasHeader { name, vars },
ann,
..
} => {
let region = Region::span_across(&name.region, &ann.region);