mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-30 15:21:12 +00:00
Merge trunk
This commit is contained in:
parent
baa3debae2
commit
8c96d12661
26 changed files with 2600 additions and 1093 deletions
|
@ -237,7 +237,8 @@ fn can_annotation_help(
|
|||
let var_name = Lowercase::from(ident);
|
||||
|
||||
if let Some(var) = introduced_variables.var_by_name(&var_name) {
|
||||
vars.push((var_name, Type::Variable(*var)));
|
||||
vars.push((var_name.clone(), Type::Variable(*var)));
|
||||
lowercase_vars.push(Located::at(loc_var.region, (var_name, *var)));
|
||||
} else {
|
||||
let var = var_store.fresh();
|
||||
|
||||
|
@ -276,11 +277,15 @@ fn can_annotation_help(
|
|||
let alias = Alias {
|
||||
region,
|
||||
vars: lowercase_vars,
|
||||
typ: alias_actual.clone(),
|
||||
uniqueness: None,
|
||||
typ: alias_actual,
|
||||
};
|
||||
local_aliases.insert(symbol, alias);
|
||||
|
||||
Type::Alias(symbol, vars, Box::new(alias_actual))
|
||||
// We turn this 'inline' alias into an Apply. This will later get de-aliased again,
|
||||
// but this approach is easier wrt. instantiation of uniqueness variables.
|
||||
let args = vars.into_iter().map(|(_, b)| b).collect();
|
||||
Type::Apply(symbol, args)
|
||||
}
|
||||
_ => {
|
||||
// This is a syntactically invalid type alias.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue