only aliases without type arguments can be host-exposed (for now)

This commit is contained in:
Folkert 2020-11-10 13:29:25 +01:00
parent 04cdc2a276
commit b62de8fc3c

View file

@ -228,6 +228,7 @@ fn can_annotation_help(
actual.substitute(&substitutions);
// Type::Alias(symbol, vars, Box::new(actual))
if vars.is_empty() {
let actual_var = var_store.fresh();
introduced_variables.insert_host_exposed_alias(symbol, actual_var);
Type::HostExposedAlias {
@ -236,6 +237,9 @@ fn can_annotation_help(
actual: Box::new(actual),
actual_var,
}
} else {
Type::Alias(symbol, vars, Box::new(actual))
}
}
None => {
let mut args = Vec::new();
@ -369,6 +373,7 @@ fn can_annotation_help(
// Type::Alias(symbol, vars, Box::new(alias.typ.clone()))
if vars.is_empty() {
let actual_var = var_store.fresh();
introduced_variables.insert_host_exposed_alias(symbol, actual_var);
Type::HostExposedAlias {
@ -377,6 +382,9 @@ fn can_annotation_help(
actual: Box::new(alias.typ.clone()),
actual_var,
}
} else {
Type::Alias(symbol, vars, Box::new(alias.typ.clone()))
}
}
_ => {
// This is a syntactically invalid type alias.