mirror of
https://github.com/roc-lang/roc.git
synced 2025-10-01 15:51:12 +00:00
only aliases without type arguments can be host-exposed (for now)
This commit is contained in:
parent
04cdc2a276
commit
b62de8fc3c
1 changed files with 22 additions and 14 deletions
|
@ -228,6 +228,7 @@ fn can_annotation_help(
|
||||||
actual.substitute(&substitutions);
|
actual.substitute(&substitutions);
|
||||||
|
|
||||||
// Type::Alias(symbol, vars, Box::new(actual))
|
// Type::Alias(symbol, vars, Box::new(actual))
|
||||||
|
if vars.is_empty() {
|
||||||
let actual_var = var_store.fresh();
|
let actual_var = var_store.fresh();
|
||||||
introduced_variables.insert_host_exposed_alias(symbol, actual_var);
|
introduced_variables.insert_host_exposed_alias(symbol, actual_var);
|
||||||
Type::HostExposedAlias {
|
Type::HostExposedAlias {
|
||||||
|
@ -236,6 +237,9 @@ fn can_annotation_help(
|
||||||
actual: Box::new(actual),
|
actual: Box::new(actual),
|
||||||
actual_var,
|
actual_var,
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Type::Alias(symbol, vars, Box::new(actual))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
let mut args = Vec::new();
|
let mut args = Vec::new();
|
||||||
|
@ -369,6 +373,7 @@ fn can_annotation_help(
|
||||||
|
|
||||||
// Type::Alias(symbol, vars, Box::new(alias.typ.clone()))
|
// Type::Alias(symbol, vars, Box::new(alias.typ.clone()))
|
||||||
|
|
||||||
|
if vars.is_empty() {
|
||||||
let actual_var = var_store.fresh();
|
let actual_var = var_store.fresh();
|
||||||
introduced_variables.insert_host_exposed_alias(symbol, actual_var);
|
introduced_variables.insert_host_exposed_alias(symbol, actual_var);
|
||||||
Type::HostExposedAlias {
|
Type::HostExposedAlias {
|
||||||
|
@ -377,6 +382,9 @@ fn can_annotation_help(
|
||||||
actual: Box::new(alias.typ.clone()),
|
actual: Box::new(alias.typ.clone()),
|
||||||
actual_var,
|
actual_var,
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
Type::Alias(symbol, vars, Box::new(alias.typ.clone()))
|
||||||
|
}
|
||||||
}
|
}
|
||||||
_ => {
|
_ => {
|
||||||
// This is a syntactically invalid type alias.
|
// This is a syntactically invalid type alias.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue