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

Emit hard error when differentiation visits unsupported statement #91

Open
efremale opened this issue Aug 20, 2018 · 0 comments
Open

Emit hard error when differentiation visits unsupported statement #91

efremale opened this issue Aug 20, 2018 · 0 comments
Assignees
Milestone

Comments

@efremale
Copy link
Contributor

Currently, if we Visit unsupported statement (e.g. try-catch, range for loop), it is simply cloned without changes and a warning is emitted.

Should we instead emit a hard error and not produce the derivative?

This is somewhat harder to achieve now.
How should the error be promoted in the visitor?
If we return null StmtDiff whenever we meet an unsupported statement, we would have to add a lot of checks for null.
We cannot throw an exception sice clang disables them.
We can set some bool flag and keep visiting function and check for the error flag in the end, but it is inefficient and error-prone.

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

2 participants