Skip to content

Commit

Permalink
Fix a bug with lambda expressions
Browse files Browse the repository at this point in the history
  • Loading branch information
valis committed Sep 20, 2023
1 parent 3e4a000 commit 335f82d
Showing 1 changed file with 16 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2457,6 +2457,22 @@ private TypecheckingResult visitLam(List<? extends Concrete.Parameter> parameter
prevLink = prevLink.getNext();
}
prevLink.setNext(EmptyDependentLink.getInstance());
prevLink = link;
while (prevLink.getNext().hasNext()) {
prevLink = prevLink.getNext();
}
if (prevLink instanceof UntypedDependentLink) {
TypedSingleDependentLink lastLink = new TypedSingleDependentLink(prevLink.isExplicit(), prevLink.getName(), actualLink.getType(), prevLink.isHidden());
if (prevLink == link) {
link = lastLink;
} else {
DependentLink prevPrevLink = link;
while (prevPrevLink.getNext() != prevLink) {
prevPrevLink = prevPrevLink.getNext();
}
prevPrevLink.setNext(lastLink);
}
}
return new Pair<>(new TypecheckingResult(new LamExpression(sort, link, result.expression), new PiExpression(sort, link, result.type)), true);
}
}
Expand Down

0 comments on commit 335f82d

Please sign in to comment.