Support parsing multiple abilities in a clause

This commit is contained in:
Ayaz Hafiz 2022-10-11 17:08:38 -05:00
parent bdc565762b
commit 548a235c25
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58
14 changed files with 165 additions and 95 deletions

View file

@ -450,7 +450,8 @@ pub fn find_type_def_symbols(
stack.push(&annotation.value);
for has_clause in clauses.iter() {
stack.push(&has_clause.value.ability.value);
// TODO(abilities)
stack.push(&has_clause.value.abilities[0].value);
}
}
Inferred | Wildcard | Malformed(_) => {}
@ -920,7 +921,7 @@ fn canonicalize_has_clause(
) -> Result<(), Type> {
let Loc {
region,
value: roc_parse::ast::HasClause { var, ability },
value: roc_parse::ast::HasClause { var, abilities },
} = clause;
let region = *region;
@ -931,6 +932,8 @@ fn canonicalize_has_clause(
);
let var_name = Lowercase::from(var_name);
// TODO(abilities)
let ability = abilities[0];
let ability = match ability.value {
TypeAnnotation::Apply(module_name, ident, _type_arguments) => {
let symbol = make_apply_symbol(env, ability.region, scope, module_name, ident)?;