Fix critical bug in unification algorithm
This commit is contained in:
parent
b4fc8c87cb
commit
e5563dd33d
1 changed files with 2 additions and 2 deletions
|
@ -1358,10 +1358,10 @@ export class Checker {
|
||||||
|
|
||||||
private unify(left: Type, right: Type, solution: TVSub, constraint: CEqual): boolean {
|
private unify(left: Type, right: Type, solution: TVSub, constraint: CEqual): boolean {
|
||||||
|
|
||||||
if (left.kind === TypeKind.Var && solution.has(left)) {
|
while (left.kind === TypeKind.Var && solution.has(left)) {
|
||||||
left = solution.get(left)!;
|
left = solution.get(left)!;
|
||||||
}
|
}
|
||||||
if (right.kind === TypeKind.Var && solution.has(right)) {
|
while (right.kind === TypeKind.Var && solution.has(right)) {
|
||||||
right = solution.get(right)!;
|
right = solution.get(right)!;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue