Skip to content
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

Make SympyVisitor fail on error. #1259

Open
1uc opened this issue May 14, 2024 · 1 comment
Open

Make SympyVisitor fail on error. #1259

1uc opened this issue May 14, 2024 · 1 comment

Comments

@1uc
Copy link
Collaborator

1uc commented May 14, 2024

Currently, when the SympyVisitor detects a bug, it simply prints a warning and continues. The tests also assert that the SympyVisitor is idempotent:

        THEN("More SympySolver passes do nothing to the AST and don't throw") {
            REQUIRE_NOTHROW(run_sympy_visitor_passes(*ast));
            REQUIRE(AST_string == ast_to_string(*ast));
        }

Unfortunately, the output of SymPy is not valid input to SymPy. This is why when it fails it the assumption is that the visitor already ran. Then it kindly warns, just in case the assumption is wrong and carries on.

Therefore, simple fixes such as:
#1257

fail.

This leads to confusing error messages:
#1258

@1uc
Copy link
Collaborator Author

1uc commented May 14, 2024

@pramodk Do we need the property that the visitor can be reapplied, even though its output is invalid input?

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

No branches or pull requests

1 participant