mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-03 19:58:18 +00:00
Allow generalization of annotations with no implementation
This commit is contained in:
parent
beb7e79830
commit
d9da945283
3 changed files with 8 additions and 1 deletions
|
@ -12,6 +12,7 @@ roc_error_macros = { path = "../../error_macros" }
|
|||
roc_region = { path = "../region" }
|
||||
roc_module = { path = "../module" }
|
||||
roc_parse = { path = "../parse" }
|
||||
roc_problem = { path = "../problem" }
|
||||
roc_types = { path = "../types" }
|
||||
roc_can = { path = "../can" }
|
||||
arrayvec = "0.7.2"
|
||||
|
|
|
@ -3833,6 +3833,11 @@ fn is_generalizable_expr(mut expr: &Expr) -> bool {
|
|||
// Opaque wrapper functions `@Q` are equivalent to closures `\x -> @Q x`, no need to weaken them.
|
||||
return true;
|
||||
}
|
||||
RuntimeError(roc_problem::can::RuntimeError::NoImplementation)
|
||||
| RuntimeError(roc_problem::can::RuntimeError::NoImplementationNamed { .. }) => {
|
||||
// Allow generalization of signatures with no implementation
|
||||
return true;
|
||||
}
|
||||
OpaqueRef { argument, .. } => expr = &argument.1.value,
|
||||
Str(_)
|
||||
| List { .. }
|
||||
|
@ -3853,7 +3858,7 @@ fn is_generalizable_expr(mut expr: &Expr) -> bool {
|
|||
| ExpectFx { .. }
|
||||
| Dbg { .. }
|
||||
| TypedHole(_)
|
||||
| RuntimeError(_) => return false,
|
||||
| RuntimeError(..) => return false,
|
||||
// TODO(weakening)
|
||||
Var(_, _) | AbilityMember(_, _, _) | Tag { .. } | ZeroArgumentTag { .. } => {
|
||||
return true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue