[Proposal] fixed expression #1041
Replies: 6 comments
-
I would prefer a syntax of This is also very similar to #114 and dotnet/roslyn#5881, just with |
Beta Was this translation helpful? Give feedback.
-
@tannergooding please see my previous proposal, I guess |
Beta Was this translation helpful? Give feedback.
-
@MkazemAkhgary, I was reading it but still don't understand why
|
Beta Was this translation helpful? Give feedback.
-
I see that makes sense. so in conclusion such statement would be valid to compile.
How ever, since stackalloc is implicitly fixed, wouldn't this cause compile time error But I get your point, it should also make sense to have
|
Beta Was this translation helpful? Give feedback.
-
@tannergooding here is main challenge. how should
I get your point that stackalloc array is implicitly fixed, but for Semantic Analysis phase of compiler, so |
Beta Was this translation helpful? Give feedback.
-
It should be entirely possible for the compiler to relax the |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
this proposal is derived from #1040 I thought maybe its better to have separate thread for this. since its separate feature on its own.
allow
fixed
statement to be used as expression.I thought the operator
&
could be omitted, becausefixed
is already going to take pointer. but I guess it can cause ambiguity in pointer to pointer scenarios.One usage you can see in issue #1040 . other than that this can also save 2 lines, avoid extra block when using fixed as expression.
Beta Was this translation helpful? Give feedback.
All reactions