Bug 12889 - [AST] Missing expression on error after throw
Summary: [AST] Missing expression on error after throw
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks: 12824
  Show dependency tree
 
Reported: 2013-06-26 05:15 UTC by Mike Krüger
Modified: 2013-06-28 04:17 UTC (History)
1 user (show)

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

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:
Status:
RESOLVED FIXED

Description Mike Krüger 2013-06-26 05:15:10 UTC
use case:

-----
class Stub {
	public static void Main (string[] args)
	{
		Task.Factory.StartNew (() => {
				throw new Exception (a)
                });
        )
}
-----

This works as expected:

-----
class Stub {
	public static void Main (string[] args)
	{
		Task.Factory.StartNew (() => {
			new Exception (a)
                });
        )
}
Comment 1 Marek Safar 2013-06-27 06:59:58 UTC
This works as expected with master mcs
Comment 2 Mike Krüger 2013-06-28 02:39:24 UTC
Not for me

ThrowStatement.Expr == null for me
Comment 3 Mike Krüger 2013-06-28 02:44:11 UTC
Looking at the grammar the THROW error rule is take in the case above - it can't work:
---------------
throw_statement
	: THROW opt_expression SEMICOLON
	  {
		$$ = new Throw ((Expression) $2, GetLocation ($1));
		lbag.AddStatement ($$, GetLocation ($3));
	  }
	| THROW error
	  {
		Error_SyntaxError (yyToken);
		$$ = new Throw (null, GetLocation ($1));
	  }
	;
Comment 4 Marek Safar 2013-06-28 04:17:09 UTC
Fixed.

I thought you were reporting missing throw from AST