Apply additional checks on dynamic_casts to references #1697
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There has been a bug report where a duckdb-wasm user manage to relyably have a std::bad_cast thrown by duckdb-wasm.
This is likely due to a combinations of problems:
This PR adds an experimental checked_dynamic_cast that do check whether a cast will throw, and in that case log this to console AND throw a FatalError.
This will hopefully make failures due to 2 more visible and have them fail better and more clearly.
Added patch is:
(+ other few places where dynamic_cast on a reference has been changed to checked_dynamic_cast)
that is a bit rough (std::cout ...) but should work for now to track this down.
This should likely be considered in a similar form also duckdb-side.