You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
With the addition of Ref locals to C# 7, a lot of new possibilities have been created. One of the biggest I can think of is allow reference wrappers to struct types. For certain things, this can be very nice. However, to place a struct in that reference wrapper, you would always have to new the wrapper, unless you implement an implicit conversion in the structure. However, in some cases the structure class is not known, so you cannot create that conversion. Looking through the IL generated by an extension method and an implicit operator, it looks like both pieces of code look the same.
My proposal would be to allow extension methods to extend operators in order to make this an easier case. It does not look like these would require a new version of the CLR.
The text was updated successfully, but these errors were encountered:
With the addition of Ref locals to C# 7, a lot of new possibilities have been created. One of the biggest I can think of is allow reference wrappers to struct types. For certain things, this can be very nice. However, to place a struct in that reference wrapper, you would always have to new the wrapper, unless you implement an implicit conversion in the structure. However, in some cases the structure class is not known, so you cannot create that conversion. Looking through the IL generated by an extension method and an implicit operator, it looks like both pieces of code look the same.
My proposal would be to allow extension methods to extend operators in order to make this an easier case. It does not look like these would require a new version of the CLR.
The text was updated successfully, but these errors were encountered: