Bug 31092

Summary: compiler crashed with code: 1
Product: [Mono] Compilers Reporter: Benoit Jadinon <benoit.jadinon>
Component: C#Assignee: Marek Safar <masafa>
Status: RESOLVED FIXED    
Severity: normal CC: mono-bugs+mono
Priority: ---    
Version: 4.0.0   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:

Description Benoit Jadinon 2015-06-14 10:03:44 UTC
Hi, 
After I changed some Android code, I received the dreaded "compiler crashed with code: 1" compiler error.
I was able to narrow it down to the faulty line, it may help you.
granted, it's not the cleanest line of code I have written, it's actually pretty ugly/stupid and should totally be refactored, but still, the compiler should not display such an unfriendly error message, it was hard to track down.
thanks.

The lines :
var evt = new Event();
string str = (evt.Name != null ? " " + evt?.Name : "").Trim();

The problem :
it's due to the presence of both evt?.Name AND .Trim(), 
remove the ? or .Trim() and compilation will work just fine.


My info:

Xamarin Studio
Version 5.9.3 (build 1)
Installation UUID: 61e0abeb-0865-4725-a8ee-c543f38e3ccf
Runtime:
	Mono 4.0.1 ((detached/ed1d3ec)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 400010044

Apple Developer Tools
Xcode 6.3.2 (7718)
Build 6D2105

Xamarin.iOS
Version: 8.10.1.64 (Business Edition)
Hash: e6ebd18
Branch: master
Build date: 2015-05-21 21:55:09-0400

Xamarin.Android
Version: 5.1.3.1 (Business Edition)
Android SDK: /Users/bja/SDKs/android-sdk-macosx
	Supported Android versions:
		2.3   (API level 10)
		4.0.3 (API level 15)
		4.1   (API level 16)
		4.2   (API level 17)
		4.3   (API level 18)
		4.4   (API level 19)
		5.0   (API level 21)
Java SDK: /usr
java version "1.7.0_76"
Java(TM) SE Runtime Environment (build 1.7.0_76-b13)
Java HotSpot(TM) 64-Bit Server VM (build 24.76-b04, mixed mode)

Xamarin Android Player
Version: Unknown version
Location: /Applications/Xamarin Android Player.app

Xamarin.Mac
Not Installed

Build Information
Release ID: 509030001
Git revision: 5a524e1726ed103fdd4fe37e0356f2b35466ce9d
Build date: 2015-06-02 16:35:08-04
Xamarin addins: 51957cfbd06be911b212671ad05c2c6221ac90f9

Operating System
Mac OS X 10.10.3
Darwin emamac0098 14.3.0 Darwin Kernel Version 14.3.0
    Mon Mar 23 11:59:05 PDT 2015
    root:xnu-2782.20.48~5/RELEASE_X86_64 x86_64
Comment 1 Marek Safar 2015-06-17 11:37:56 UTC
Fixed in master/4.2 branch