Bug 13952 - Internal compiler error on switch statements
Summary: Internal compiler error on switch statements
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: Other Linux
: --- normal
Target Milestone: ---
Assignee: Marek Safar
Depends on:
Reported: 2013-08-13 09:41 UTC by alex
Modified: 2013-08-14 15:49 UTC (History)
2 users (show)

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:

Description alex 2013-08-13 09:41:08 UTC
Description of Problem:

Internal compiler error on switch statements

Steps to reproduce the problem:
1. Clone repo from https://github.com/aBothe/D_Parser.git at this commit: https://github.com/aBothe/D_Parser/commit/5d04c82d8e26f25eec0b2cb110876a9886c36e4d
2. Try to build DParser2.Unittest.sln

Actual Results:

Tool /opt/mono/bin/dmcs execution started with arguments: /noconfig /debug:full /debug+ /optimize- /out:obj/Debug/D_Parser.dll Completion/Abstra [.......] rseCacheView.cs Misc/StringCache.cs /target:library /warnaserror- /unsafe- /define:"DEBUG;TRACE" /platform:x86 /reference:/opt/mono/lib/mono/4.0/System.dll /reference:/opt/mono/lib/mono/4.0/System.Xml.dll /reference:/opt/mono/lib/mono/4.0/System.Core.dll /warn:4
[several warnings]
Resolver/ResolutionCache.cs(34,22): warning CS0168: The variable `x' is declared but never used
Resolver/ResultComparer.cs(155,9): warning CS0219: The variable `tup1' is assigned but its value is never used
Resolver/ResultComparer.cs(156,9): warning CS0219: The variable `tup2' is assigned but its value is never used
Resolver/Templates/TemplateInstanceHandler.cs(239,8): warning CS0219: The variable `paramEnum' is assigned but its value is never used
Resolver/ExpressionSemantics/Evaluation.StaticProperties.cs(106,6): error CS0584: Internal compiler error: Object reference not set to an instance of an object
Resolver/ExpressionSemantics/Evaluation.StaticProperties.cs(51,27): error CS0161: `D_Parser.Resolver.ExpressionSemantics.StaticPropertyResolver.TryResolveStaticProperties(D_Parser.Resolver.ISemantic, int, D_Parser.Resolver.ResolutionContext, bool, D_Parser.Dom.IdentifierDeclaration)': not all code paths return a value
Parser/Parser.cs(434,5): warning CS0162: Unreachable code detected
Parser/Parser_Impl.cs(1306,6): warning CS0162: Unreachable code detected
Misc/VersionIdEvaluation.cs(95,5): warning CS0162: Unreachable code detected
	Task "Csc" execution -- FAILED

Expected Results:

Compilation should've shown regular build errors, not compiler-internal ones.

How often does this happen? 

On every build. Fully reproducable for me.

Additional Information:

Mono 3.1.1 (master/5dd394c Di 9. Jul 09:19:09 CEST 2013) (64-bit)
Comment 1 alex 2013-08-13 09:43:15 UTC
The commit message containing 'mono 3.0.11' is obviously misleading, take the version from the Additional Information paragraph instead,

thank you in advance!
Comment 2 Marek Safar 2013-08-14 09:33:32 UTC
Fixed in master and 3-2 branch.