Revert commit e3d00f6 and really fix kind unification

Fixes #37.
This commit is contained in:
Sam Vervaeck 2022-09-15 20:46:07 +02:00
parent 2d10ceedc9
commit c1e17955cd

View file

@ -870,8 +870,8 @@ export class Checker {
const a2 = this.createKindVar(); const a2 = this.createKindVar();
const arrow = new KArrow(a1, a2); const arrow = new KArrow(a1, a2);
this.unifyKind(arrow, operator, node); this.unifyKind(arrow, operator, node);
this.unifyKind(a2, arg, node); this.unifyKind(a1, arg, node);
return a1; return a2;
} }
case KindType.Arrow: case KindType.Arrow:
{ {
@ -1036,7 +1036,7 @@ export class Checker {
if (a.type === KindType.Arrow && b.type === KindType.Arrow) { if (a.type === KindType.Arrow && b.type === KindType.Arrow) {
return this.unifyKind(a.left, b.left, node) 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)); this.diagnostics.add(new KindMismatchDiagnostic(solve(a), solve(b), node));