Make sure type conversion materialization callbacks return values of the correct type #7583
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.
The materialization callbacks have to return either a
nullopt
or a value of the type provided as argument. This is not guaranteed by the ones changed in this PR.This callback is invoked when an
unrealized_conversion_cast
operation inserted by the dialect conversion framework cannot be reconciled by the framework itself (e.g., if the input and output types of the op match, it gets folded away automatically).This PR takes the conservative route, just telling the dialect conversion framework that it is fine to leave the conversion cast op in there if it cannot get rid of it. We could also return
nullopt
to tell it that it should fail in those cases.