-
Notifications
You must be signed in to change notification settings - Fork 107
Removing error
extension function
#874
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks fine to me. A little sad to see the precision loss in the updated test cases -- maybe open an issue to consider precision optimizations in the future?
/// Create a ternary (if-then-else) `Expr`. | ||
/// Takes `Arc`s instead of owned `Expr`s | ||
/// `test_expr` must evaluate to a Bool type | ||
pub fn ite_arc(test_expr: Arc<Expr>, then_expr: Arc<Expr>, else_expr: Arc<Expr>) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: can we make it pub(crate)
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rest of the functions are not pub(crate)
, why this one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the signature of this function is not idiomatic as public functions. I was thinking another function as well but just commented on this one.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just pub
in Core, right? not re-exported in cedar-policy
?
Signed-off-by: Aaron Eline <[email protected]>
d3917c9
to
b56bbad
Compare
/// Create a ternary (if-then-else) `Expr`. | ||
/// Takes `Arc`s instead of owned `Expr`s | ||
/// `test_expr` must evaluate to a Bool type | ||
pub fn ite_arc(test_expr: Arc<Expr>, then_expr: Arc<Expr>, else_expr: Arc<Expr>) -> Self { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is just pub
in Core, right? not re-exported in cedar-policy
?
Signed-off-by: Aaron Eline <[email protected]> Co-authored-by: Craig Disselkoen <[email protected]>
Signed-off-by: Aaron Eline <[email protected]> Co-authored-by: Craig Disselkoen <[email protected]>
Issue for re-increasing precision: #880 |
Signed-off-by: Aaron Eline <[email protected]> Co-authored-by: Craig Disselkoen <[email protected]>
Signed-off-by: Aaron Eline <[email protected]> Co-authored-by: Aaron Eline <[email protected]> Co-authored-by: Craig Disselkoen <[email protected]>
Description of changes
Reduces the precision of partial evaluation when reducing expressions that are lazily evaluated (
if
and
or
subexpressions). The primary motivation for this is removing theerror
extension function, which is impossible to type.Increases in precision without re-introducing
error
could come later.Issue #, if available
N/A
Checklist for requesting a review
The change in this PR is (choose one, and delete the other options):
I confirm that this PR (choose one, and delete the other options):
I confirm that
cedar-spec
(choose one, and delete the other options):