-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Champion "Await in Catch and Finally" #37
Comments
Will it be ready for VS 2017 RTM ? |
We are "done" with the compiler for VS2017 RTM and the work for this has not started. |
I am disappointed. This is most missing feature. Will it be avalable in some VS 2017 update ? |
@vbcodec We do not make product announcements on github. Usually product announcements and plans would be found on the Visual Studio Blog. |
@vbcodec we do have the ability to ship it in an update, though as Neal says, we can't commit to if it would ship in an update or which update it would ship in. We don't usually commit to features in updates this early given that our highest priorities for them are bug fixes, performance improvements, and reacting to other feedback from the RTW. |
So, what is the current status on this? |
There is nothing to discuss. There feature is self explanatory. There may be questions that come up during implementation but there's nothing to design at this point. |
With "discuss"I mean, has it somehow prioritized that an actual implementation will begin? |
We have not announced a schedule for any features post 15.3. That process is on-going and the recent activity on this repo are specifically motivated to get more transparency into the backlog. When that process produces a schedule we're confident in enough to share it'll be published here and on the Roslyn repo. |
The VB LDM looked at this proposal on August 9th and approved it in-principle. We also decided not to restrict VBs existing permissiveness with |
Here's a scenario, snippets taken from taken from the ASP.NET docs sample project for
|
Now that |
Yes please and this is also just so frustrating. IAsyncDisposable also presupposes VB support for an Async function that returns ValueTask which it absolutely should have. It is sick and wrong to have to carve out exceptions, write C# helper functions, etc., just to get a seat at the table with the big kids. |
I'm not a regular user of C#... so my take on this is purely as a consumer of VB. In other words, I don't give a rats rear-end regarding what C# is or isn't capable of doing or how it does it. With that out of the way... It does seem rather annoying that it isn't possible to utilize Await in a Catch block. One recent example where I've encountered this (and it's not a unique occurrence)... and, yes, was able to "work around" was when I wanted in an Async function that has a multiple phases to work through. It is entirely possible to have an exception occur and, in the event one does occur, I'd like to update my visual layer (WinForms) so that there is a visible indication of this happening. To do this I have a Label on the Form and would like to update it with a comment stating that a particular step has failed. Simple enough to update the .Text value. However, I'd also like to add a bit of a delay... my choices are... In the Catch block:
--- OR --- Before the Try block:
In the Catch block:
After the Try block:
Both of these will work with what we currently have... however, in order to not lock up the UI, I have to do something in three different places in the code and this is something that could easily lead to human error over time as the project evolves. If I could simply switch out the thread-locking version with:
The code is clean and there isn't the penalty of locking the UI. I'm sure there are other scenarios where this is the case... just bringing this one up as I literally run into it constantly. |
it's 2021, has this functionality (await inside catch for VB) been eliminated as a possibility? |
I don't think MS cares at all about VB sadly. Would be nice to get Enum extension functionality like C# too. |
VB is only being enhanced when a .Net library requires it to avoid breaking compatibility. That is why VB got all the Record stuff. VB needs to be a consumer of library's but new library's don't need to be written in VB. Maximum performance is not a priority for Vb, compatibility is. If you want new features look at the work by Anthony D. Green http://anthonydgreen.net/ |
VB doesn't allow this today and C# does. Seems like it could be a pain if APIs require this pattern a lot.
There are special design considerations required for VB as in VB it is permitted to
Goto
from the Catch block back into theTry
block. This would complicate the state machine rewrite a bit:dim retryCount = 0
try
retry:
catch ex as Exception When retryCount < 3
retryCount += 1
goto retry
end try
The text was updated successfully, but these errors were encountered: