Bugfix in Transition class with a stricter type check for boxing required types#127
Closed
victorr99 wants to merge 1 commit into
Closed
Conversation
…e not passed anymore to the assert
Contributor
Author
|
Thanks for the review. Not sure if we still need to this PR because @bfarmer67 has a fix ready in #133 . As far as I know he's waiting for this issue to be addressed: dadhi/FastExpressionCompiler#495 |
Contributor
|
Addressed in #133 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
The Transition class performs a check which tells if type A is assignable to type B. This check did not take types into account which require boxing if you want to assign them (value types like
intmust be boxed in order to be assignable toobject).Similar checks are done at two other places. I haven't touched these two places because I'm not sure if the fix needs to be applied there to. I guess that the FinalTransition is used when the last call in the expression is not an await call? In that case I think the current behavior is already correct (if you want to return an
intfrom a lambda with return typeobject, theintmust be boxed with aConvertcall)hyperbee.expressions/src/Hyperbee.Expressions/CompilerServices/Transitions/Transition.cs
Line 39 in 0eddf5a
hyperbee.expressions/src/Hyperbee.Expressions/CompilerServices/Transitions/FinalTransition.cs
Line 35 in 0eddf5a
This PR fixes this issue:
Type of Change
Checklist