Skip to content

Commit

Permalink
Overzealous type-checking
Browse files Browse the repository at this point in the history
  • Loading branch information
tsmacdonald committed Apr 9, 2024
1 parent 5688d0a commit 023d9ef
Showing 1 changed file with 3 additions and 11 deletions.
14 changes: 3 additions & 11 deletions java/com/metabase/macaw/AstWalker.java
Original file line number Diff line number Diff line change
Expand Up @@ -255,18 +255,10 @@ public void invokeCallback(CallbackKey key, Object visitedItem) {
}

/**
* Fold the given `expressionOrStatement`, using the callbacks to update the accumulator as appropriate.
* Fold the given `statement`, using the callbacks to update the accumulator as appropriate.
*/
public Acc fold(Object expressionOrStatement) {
if (expressionOrStatement instanceof Expression) {
((Expression)expressionOrStatement).accept(this);
}
else if (expressionOrStatement instanceof Statement) {
((Statement)expressionOrStatement).accept(this);
}
else {
throw new IllegalArgumentException("`expressionOrStatement` is neither an Expression nor a Statement");
}
public Acc fold(Statement statement) {
statement.accept(this);
return this.acc;
}

Expand Down

0 comments on commit 023d9ef

Please sign in to comment.