dotnet/runtime

Possible bug with S.L.Expression: cannot generate assign expression for ref returning properties

Opened this issue · 1 comments

Relatively recently, ref returning properties were added to c#. I use them from time to time and i have serialization library that relied on ILGenerator but converted to S.L.Expression. There is problem: ref return properties have CanWrite set to false preventing easy generation of assign expressions!

I use 4.7.1 Desktop framework for now with future plans to move to Core.

Is this by design or overlooked? Is there some hack around this issue?

The ref-returning properties are very new and support in reflection/S.L.Expressions is lagging behind a bit. It is a known problem that needs fixing.

Some of this can be fixed without changing/adding APIs. Some may require deeper changes.

See also https://github.com/dotnet/corefx/issues/26772