edgedb / edgedb-net

The official .NET client library for EdgeDB
https://edgedb.com
Apache License 2.0
82 stars 9 forks source link

Fix value types in anonymous arguments #61

Closed quinchs closed 1 year ago

quinchs commented 1 year ago

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.