Bug 1797 - Internal compiler error when inflating wrong generic type
Summary: Internal compiler error when inflating wrong generic type
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2011-10-31 11:51 UTC by Jérémie Laval
Modified: 2011-11-04 09:14 UTC (History)
1 user (show)

Tags:
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:
Status:
RESOLVED FIXED

Description Jérémie Laval 2011-10-31 11:51:45 UTC
A wrong generic type, although correctly detected with an error message, is still propagated to System.Type.MakeGenericType causing compiler to crash with following log:

ystem.ArgumentException: Invalid generic arguments
Parameter name: typeArguments
  at (wrapper managed-to-native) System.Type:MakeGenericType (System.Type,System.Type[])
  at System.Type.MakeGenericType (System.Type[] typeArguments) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.CreateMetaInfo (Mono.CSharp.TypeParameterMutator mutator) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.InflatedTypeSpec.GetMetaInfo () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.AParametersCollection.GetMetaInfo () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.DefineMethodBuilder (Mono.CSharp.TypeContainer container, System.String method_name, Mono.CSharp.ParametersCompiled param) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.MethodData.Define (Mono.CSharp.DeclSpace parent, System.String method_full_name, Mono.CSharp.Report Report) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Event+AEventAccessor.Define (Mono.CSharp.DeclSpace parent) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.EventProperty+AEventPropertyAccessor.Define (Mono.CSharp.DeclSpace ds) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Event.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.EventProperty.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.DefineContainerMembers (IList mcal) [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer.DefineContainerMembers (IList mcal) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.DefineContainerMembers (IList list) [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ClassOrStruct.DoDefineMembers () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Class.DoDefineMembers () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.TypeContainer.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 
  --- End of inner exception stack trace ---
  at Mono.CSharp.ModuleContainer.Define () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Compile () [0x00000] in <filename unknown>:0 
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000] in <filename unknown>:0

To reproduce, type 'EventHandler<System.Char[]> foo;' in csharp
Comment 1 Marek Safar 2011-11-04 09:14:47 UTC
Fixed in master