Bug 41400 - Internal compiler error due to invalid throw expression
Summary: Internal compiler error due to invalid throw expression
Status: NEW
Alias: None
Product: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: 4.4.0 (C7)
Hardware: PC Mac OS
: --- minor
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-05-31 16:25 UTC by Matt Ward
Modified: 2016-05-31 16:25 UTC (History)
1 user (show)

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


Attachments

Description Matt Ward 2016-05-31 16:25:33 UTC
With the following invalid code:

viewModel.LoadPackagesAsyncTask = (token) => {
	return Task.Run	(() => throw new Exception ("Error"));
};

When building this with xbuild the compiler returns an internal compiler error:

MyClass.cs(18,27): error CS1525: Unexpected symbol `throw'
MyClass.cs(18,56): error CS1525: Unexpected symbol `)'
MyClass.cs(19,5): error CS0589: Internal compiler error during parsingSystem.NullReferenceException: Object reference not set to an instance of an object

Full source code is available from:

https://github.com/mrward/Test-ParsingSystemNullRef

Mono version: mono-4.4.0-branch/67b89ea Fri May 20 23:36:11 EDT 2016)


On Windows using MSBuild I get:

MyClass.cs(18,28,18,33): error CS1525: Invalid expression term 'throw'
MyClass.cs(18,28,18,33): error CS1026: ) expected
MyClass.cs(18,28,18,33): error CS1002: ; expected
MyClass.cs(18,57,18,58): error CS1002: ; expected
MyClass.cs(18,57,18,58): error CS1513: } expected

Note You need to log in before you can comment on or make changes to this bug.