Relax restrictions on tuple operations for ref struct
s
#7725
Unanswered
RenderMichael
asked this question in
Language Ideas
Replies: 1 comment 2 replies
-
Such expression also depends on the existence of ValueTuple type. It fails to compile on older versions of .NET Framework. |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The following code will not work:
Because it tries to fit the tuple into a
ValueTuple<,>
. However, many tuple "operations" are inlined, such as the above when using an array.This can be worked around with a manual swap:
The only difference between the
Span<byte>
and the loweredbyte[]
versions is the addition of thescoped
keyword, which hopefully isn't an issue.Concerns
To what extent is the whole "you're not actually using a ValueTuple under the hood" an implementation detail? If my suggestion is followed up on, it would no longer be one.
Beta Was this translation helpful? Give feedback.
All reactions