-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
Expression.Default and Expression.New demonstrate incorrect behavior when given structs with parameterless ctors #45397
Comments
Tagging subscribers to this area: @cston Issue DetailsWhen given a struct type with an explicit parameterless ctor, the APIs
Full unit tests demonstrating the issue at GrabYourPitchforks@1a22b6a. Found while prototyping #36194.
|
/cc @333fred as co-area owner |
Adding a few more scenarios to this issue, as I found the same problem in more places while annotating System.Linq.Expressions for ILLink warnings (#45623).
If these calls aren't changed to |
When given a struct type with an explicit parameterless ctor, the APIs
Expression.New
andExpression.Default
may incorrectly invoke (or fail to invoke) the ctor.Expression.Default(Type)
[compiled]Expression.Default(Type)
[interpreted]Expression.New(Type)
[compiled]Expression.New(Type)
[interpreted]Expression.New(ConstructorInfo)
[compiled]Expression.New(ConstructorInfo)
[interpreted]Full unit tests demonstrating the issue at GrabYourPitchforks@1a22b6a.
Found while prototyping #36194.
The text was updated successfully, but these errors were encountered: