Proposal: allow ref enumeration over arrays #8820
Unanswered
huoyaoyuan
asked this question in
Language Ideas
Replies: 2 comments
-
I feel like it would be a better idea to open an issue on dotnet/runtime to improve the Jit. |
Beta Was this translation helpful? Give feedback.
0 replies
-
This is still a hole in the language. I opened an issue about it a while ago, and it appears that the feature is a little half baked. |
Beta Was this translation helpful? Give feedback.
0 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.
-
Proposed syntax:
Currently alternative:
Benifits:
Syntax completeness.
Can work if the
Span
type is not present.Since array enumeration is specially treated by the compiler, the compiler can generate simpler code to reduce the stress of JIT. Currently JIT generate worse code when using
AsSpan()
.Risk
No risk:
Array is specially treated by the compiler. This feature should not require any member defined in metadata.
This is about introducing new binding rule, not new syntax.
The semantic is straight.
Beta Was this translation helpful? Give feedback.
All reactions