From c1e17955cd31cf743dad0566d21b263f33030a8a Mon Sep 17 00:00:00 2001 From: Sam Vervaeck Date: Thu, 15 Sep 2022 20:46:07 +0200 Subject: [PATCH] Revert commit e3d00f6 and really fix kind unification Fixes #37. --- src/checker.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/checker.ts b/src/checker.ts index 18af9e9fd..43a9e0e35 100644 --- a/src/checker.ts +++ b/src/checker.ts @@ -870,8 +870,8 @@ export class Checker { const a2 = this.createKindVar(); const arrow = new KArrow(a1, a2); this.unifyKind(arrow, operator, node); - this.unifyKind(a2, arg, node); - return a1; + this.unifyKind(a1, arg, node); + return a2; } case KindType.Arrow: { @@ -1036,7 +1036,7 @@ export class Checker { if (a.type === KindType.Arrow && b.type === KindType.Arrow) { return this.unifyKind(a.left, b.left, node) - || this.unifyKind(a.right, b.right, node); + && this.unifyKind(a.right, b.right, node); } this.diagnostics.add(new KindMismatchDiagnostic(solve(a), solve(b), node));