Skip to content

Commit

Permalink
Fix bug in isResolved
Browse files Browse the repository at this point in the history
  • Loading branch information
travisbrown committed Jul 27, 2021
1 parent 1f9e2ab commit 4702e17
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions modules/core/src/main/java/org/dhallj/core/Visitor.java
Original file line number Diff line number Diff line change
Expand Up @@ -496,12 +496,16 @@ public Boolean onPi(String name, Boolean type, Boolean result) {
}

public Boolean onLet(List<Expr.LetBinding<Boolean>> bindings, Boolean body) {
for (Expr.LetBinding<Boolean> binding : bindings) {
if (!binding.getValue() || (binding.hasType() && !binding.getType())) {
return false;
if (!body) {
return false;
} else {
for (Expr.LetBinding<Boolean> binding : bindings) {
if (!binding.getValue() || (binding.hasType() && !binding.getType())) {
return false;
}
}
return true;
}
return true;
}

public Boolean onText(String[] parts, List<Boolean> interpolated) {
Expand Down

0 comments on commit 4702e17

Please sign in to comment.