Bug 38243 - Compiler crashed with code: 1 - Null propagating operator, with long property path
Summary: Compiler crashed with code: 1 - Null propagating operator, with long property...
Status: RESOLVED ANSWERED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2016-02-01 10:32 UTC by Norbert Virth
Modified: 2016-02-01 12:03 UTC (History)
1 user (show)

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


Attachments
Xamarin and Mono version (883 bytes, text/plain)
2016-02-01 10:32 UTC, Norbert Virth
Details


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 ANSWERED

Description Norbert Virth 2016-02-01 10:32:25 UTC
Created attachment 14826 [details]
Xamarin and Mono version

The compiler crashes in some cases, instead of giving this error message: Error CS9030: The left-hand side of an assignment cannot contain a null 

See:

public class MyClass
{
	public MyClass MyProperty { get; set; }
	public event Action Event1;

	static void Main(string[] args)
	{
		var m = new MyClass();
		//m?.Event1 += () => {}; // Error CS9030: The left-hand side of an assignment cannot contain a null propagating operator
		//m.MyProperty?.Event1 += asd; // Error CS9030: The left-hand side of an assignment cannot contain a null propagating operator
		m.MyProperty?.MyProperty.Event1 += asd; // Error: Compiler crashed with code: 1.
		//m.MyProperty?.MyProperty.MyProperty.Event1 += asd; // Error: Compiler crashed with code: 1.
	}

	static void asd ()
	{
		
	}		
}
Comment 1 Marek Safar 2016-02-01 12:03:25 UTC
Already fixed in Mono 4.2