mirror of
https://github.com/roc-lang/roc.git
synced 2025-08-04 04:08:19 +00:00
Constrain function annotation fx to body
This commit is contained in:
parent
b9b85a222f
commit
7af05cc6c9
10 changed files with 102 additions and 87 deletions
|
@ -1151,7 +1151,7 @@ fn unify_pure<M: MetaCollector>(env: &mut Env, ctx: &Context, other: &Content) -
|
|||
match other {
|
||||
Pure => merge(env, ctx, Pure),
|
||||
Effectful => merge(env, ctx, Effectful),
|
||||
FlexVar(_) => merge(env, ctx, Pure),
|
||||
FlexVar(_) => merge(env, ctx, *other),
|
||||
RigidVar(_)
|
||||
| FlexAbleVar(_, _)
|
||||
| RigidAbleVar(_, _)
|
||||
|
@ -1171,8 +1171,8 @@ fn unify_pure<M: MetaCollector>(env: &mut Env, ctx: &Context, other: &Content) -
|
|||
#[must_use]
|
||||
fn unify_effectful<M: MetaCollector>(env: &mut Env, ctx: &Context, other: &Content) -> Outcome<M> {
|
||||
match other {
|
||||
Pure | Effectful => merge(env, ctx, Effectful),
|
||||
FlexVar(_) => merge(env, ctx, Effectful),
|
||||
Effectful | FlexVar(_) => merge(env, ctx, Effectful),
|
||||
Pure => mismatch!("Cannot unify effectful with pure"),
|
||||
RigidVar(_)
|
||||
| FlexAbleVar(_, _)
|
||||
| RigidAbleVar(_, _)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue