Skip to content

Conversation

@zhjwpku
Copy link
Collaborator

@zhjwpku zhjwpku commented Jan 10, 2026

No description provided.

}

Result<bool> IsBoundVisitor::AlwaysTrue() { return true; }
Result<std::optional<bool>> IsBoundVisitor::AlwaysTrue() { return std::nullopt; }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the Java impl is overly complicated to return null by default and then a lot of places should handle null with different meanings.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about letting each visitors to handle this instead of complicating the return type?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed.

@zhjwpku zhjwpku force-pushed the fix_is_bound_expression branch from 1ba9c7d to 366c586 Compare January 12, 2026 10:49
@zhjwpku zhjwpku force-pushed the fix_is_bound_expression branch from 366c586 to 7730c88 Compare January 13, 2026 06:12
@zhjwpku zhjwpku changed the title IsBoundVisitor mixed bound/unbound predicate should error chore: IsBoundVisitor mixed bound/unbound predicate should error Jan 13, 2026

Result<bool> IsBoundVisitor::And(bool left_result, bool right_result) {
return left_result && right_result;
ICEBERG_PRECHECK(left_result == right_result, "Found partially bound expression");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is correct. If we want to keep the same behavior as the Java impl, we might need to return error for AlwaysTrue() and AlwaysFalse() and then revert changes to And and Or.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

But if we do that, mixed bound and unbound will be evaluated as false, is that expected?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That is expected. IsBoundVisitor checks if all expressions are bound and returns false if any is unbound. This is used to check if the expression has called bind function along the tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants