Bug 24547 - await within catch should fail, doesn't
Summary: await within catch should fail, doesn't
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2014-11-14 21:10 UTC by Cody Beyer (MSFT)
Modified: 2014-11-18 07:41 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

TestCaseAndVersions (14.80 KB, application/zip)
2014-11-14 21:10 UTC, Cody Beyer (MSFT)

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Cody Beyer (MSFT) 2014-11-14 21:10:20 UTC
Created attachment 8750 [details]

### Description 

In Visual Studio, either on a C# console project, or within a Xamarin project, if there is an await statement within a catch, compile will fail, as you can not have await within a catch block

On Xamarin Studio within Mac, you can compile the same project without issue. However the project will crash if it hits the code within the block

### Test Case


### Steps to Reproduce

1. Open test case using Xamarin Studio on Mac
2. Attempt to compile app
3. Notice app compiles

4. Open app in Visual Studio
5. Attempt to compile app
6. Notice app fails to compile

### Version Information

Comment 2 Marek Safar 2014-11-18 07:41:27 UTC
That's limitation of Microsoft C# compiler (new version fixes that)