Replies: 11 comments
-
Maybe there should be a symmetrical method |
Beta Was this translation helpful? Give feedback.
-
On the other hand default interface implementation could solve this as well? |
Beta Was this translation helpful? Give feedback.
-
Today we have Why wouldn't we have |
Beta Was this translation helpful? Give feedback.
-
Idk, isn't the whole point of using declarations to make disposable declarations nicer? If there is no declaration it is more like a disposable expression and that is kind of odd. I like the idea of using an explicit discard to imply the variable is what is being disposed and it's scope is the same as other variables. |
Beta Was this translation helpful? Give feedback.
-
This'll be ambiguous: using (expr); is it a regular |
Beta Was this translation helpful? Give feedback.
-
@alrz Perfect, thanks! Now since |
Beta Was this translation helpful? Give feedback.
-
Reading comprehension is important 😅 |
Beta Was this translation helpful? Give feedback.
-
@AlgorithmsAreCool As per the doc you linked yourself:
It also works in SharpLab. |
Beta Was this translation helpful? Give feedback.
-
@jnm2 the syntax doesn't allow it. var is a part of declaration which is not optional. note: |
Beta Was this translation helpful? Give feedback.
-
Am I reading this correctly that this code will be be illegal?
This is valid with the current |
Beta Was this translation helpful? Give feedback.
-
No, @scalablecory, you are not reading that correctly. The only error condition is when the label and the using declaration appear directly in the same statement list (which is not the case here) and the |
Beta Was this translation helpful? Give feedback.
-
C# Language Design Notes for Dec 3, 2018
using
declaration open issuesRange
indexer on array and framework typesBeta Was this translation helpful? Give feedback.
All reactions