Bug 34387 - Compiler crashed with code: 1 - Duplicated class
Summary: Compiler crashed with code: 1 - Duplicated class
Status: RESOLVED FIXED
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: 2015-09-29 07:04 UTC by Norbert Virth
Modified: 2015-10-09 09:51 UTC (History)
1 user (show)

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


Attachments
Compiler StackTrace (97.71 KB, application/octet-stream)
2015-09-29 07:04 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 FIXED

Description Norbert Virth 2015-09-29 07:04:42 UTC
Created attachment 13121 [details]
Compiler StackTrace

In the Common project:
There was a class (DefaultTableViewDelegate) which was accidentally declared in 2 files, both the same namespace. One file contained 3 classes, the other only this one. These were:
    Common/Controls/TableViews/TableViewDelegate.cs
    Common/Controls/TableViews/Delegates/DefaultTableViewDelegate.cs

This Common project seems to build! The crash comes after this has been built; the build of the Lua project fails (because this Lua project references this Common project)

This error was only a refactor mistake for me; I forgot to remove the code of the class from the earlier file after I've put it into a new one. Once I remove it, the whole solution builds.
Comment 1 Marek Safar 2015-10-05 06:01:25 UTC
Could you provide more info how the classes were declared or you could attach only files with declarations. Simple repro for me works.
Comment 2 Norbert Virth 2015-10-09 07:28:39 UTC
I think the key information missing was that this class was generic. Now I could reproduce the compiler crash with an empty class, but only if generic.
Comment 3 Norbert Virth 2015-10-09 07:35:32 UTC
Yes, now I could reproduce it easily with 2 empty Console Projects:

ProjectA/Program.cs:

namespace Asd
{
	public class A<T>{}
}
namespace Asd
{
	public class A<T>{}
}

This builds for me :)
The crash only will occur if I create a ProjectB (Console Project, but it does not make any sense I guess), and reference ProjectA from it, and build ProjectB.
Comment 4 Marek Safar 2015-10-09 09:51:29 UTC
Already fixed in Mono 4.2