Fix incorrect type checking of anonymous match expressions

This commit is contained in:
Sam Vervaeck 2024-07-11 21:02:58 +02:00
parent 2b7ae3eba3
commit 71912f8c65
Signed by: samvv
SSH key fingerprint: SHA256:dIg0ywU1OP+ZYifrYxy8c5esO72cIKB+4/9wkZj1VaY

View file

@ -131,7 +131,7 @@ std::tuple<ConstraintSet, Type*> Checker::inferExpr(TypeEnv& Env, Expression* Ex
mergeTo(Out, ExprOut);
Out.push_back(new CTypesEqual { ExprTy, Ty, Case->Expression });
}
if (E->Value) {
if (!E->Value) {
auto ParamTy = createTVar();
Ty = new TFun(ParamTy, Ty);
}