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

Fix value types in anonymous arguments #61

Merged
merged 1 commit into from
Jul 14, 2023
Merged

Conversation

quinchs
Copy link
Collaborator

@quinchs quinchs commented Jul 14, 2023

Summary

The code generated for converting anonymous values into a map of string->object would not box value types correctly, resulting in the following exception: System.ArgumentException: Expression of type 'System.Int32' cannot be used for parameter of type 'System.Object' of method 'Void Add(System.String, System.Object)' (Parameter 'arg1').

This PR fixes this by adding an explicit check for value types, and calling Expression.TypeAs() if so.

@quinchs quinchs requested a review from nsidnev July 14, 2023 14:37
@quinchs quinchs merged commit 6508caf into dev Jul 14, 2023
2 checks passed
@quinchs quinchs deleted the fix/value-type-anon-args branch July 14, 2023 20:45
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

Successfully merging this pull request may close these issues.

2 participants