Bug 3604 - Compiler crashes while it should give CS0311-like error
Summary: Compiler crashes while it should give CS0311-like error
Status: RESOLVED FIXED
Alias: None
Product: Compilers
Classification: Mono
Component: C# ()
Version: unspecified
Hardware: Other Other
: --- normal
Target Milestone: ---
Assignee: Marek Safar
URL:
Depends on:
Blocks:
 
Reported: 2012-02-23 04:20 UTC by Alexey Pelykh
Modified: 2012-02-23 07:31 UTC (History)
1 user (show)

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


Attachments
Sources (30.95 KB, application/octet-stream)
2012-02-23 04:21 UTC, Alexey Pelykh
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 Alexey Pelykh 2012-02-23 04:20:44 UTC
Description of Problem:
See attached sources. On this solution MSVS gives this output:
d:\TOM\tom\backend\editors\CurrenciesEditors\CurrencyEntityEditor.cs(8,18): error CS0311: The type 'TOM.Entities.Currencies.CurrencyEntity' cannot be used as type parameter 'ENTITY_TYPE' in the generic type or method 'TOM.EntitiesEditors.Core.EntityEditor<ENTITY_TYPE>'. There is no implicit reference conversion from 'TOM.Entities.Currencies.CurrencyEntity' to 'TOM.Entities.Core.IEntity'.
d:\TOM\tom\backend\editors\CurrenciesEditors\CurrencyEntityEditor.cs(20,55): error CS0311: The type 'TOM.Entities.Currencies.CurrencyEntity' cannot be used as type parameter 'ENTITY_TYPE' in the generic type or method 'TOM.EntitiesEditors.Core.Listing.IListingAdapter<ENTITY_TYPE>'. There is no implicit reference conversion from 'TOM.Entities.Currencies.CurrencyEntity' to 'TOM.Entities.Core.IEntity'.

Mono compiler crashes:
C:\Program Files (x86)\Mono-2.10.8\bin\dmcs.bat /noconfig "/out:D:\TOM\tom\backend\Core\EntityEditorCore\bin\Debug\EntityEditorCore.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.dll"
 "/r:D:\TOM\tom\third-party\nhibernate\Iesi.Collections.dll"
 "/r:D:\TOM\tom\third-party\nhibernate\NHibernate.dll"
 "/r:D:\TOM\tom\third-party\nhibernate\NHibernate.Mapping.Attributes.dll"
 "/r:D:\TOM\tom\third-party\nhibernate\NHibernate.Validator.dll"
 "/r:D:\TOM\tom\backend\Core\EntitiesCore\bin\Debug\EntitiesCore.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.Core.dll"
 /nologo
 /warn:4
 /debug:+
 /debug:full
 /optimize-
 /codepage:utf8
 "/define:DEBUG"
 
 /t:library
 "D:\TOM\tom\backend\Core\EntityEditorCore\AssemblyInfo.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\IEntityEditor.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\IListingAdapter.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\IListingFieldDeclaration.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\ListingSortingDirection.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\IListingSortingRulesCollection.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\IViewFrameBoundaries.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\ListingOutdatedException.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\FieldTypes\IFieldType.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\IListingEntriesCollection.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\IListingEntry.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\Listing\IListingEntryValuesCollection.cs"
 "D:\TOM\tom\backend\Core\EntityEditorCore\EntityEditor.cs"
 

Build complete -- 0 errors, 0 warnings



Building: CurrenciesEditors (Debug)



Performing main compilation...

C:\Program Files (x86)\Mono-2.10.8\bin\dmcs.bat /noconfig "/out:D:\TOM\tom\backend\editors\CurrenciesEditors\bin\Debug\CurrenciesEditors.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.dll"
 "/r:D:\TOM\tom\backend\Core\EntitiesCore\bin\Debug\EntitiesCore.dll"
 "/r:D:\TOM\tom\backend\Entities\Currencies\bin\Debug\Currencies.dll"
 "/r:D:\TOM\tom\backend\Core\EntityEditorCore\bin\Debug\EntityEditorCore.dll"
 "/r:C:\Program Files (x86)\Mono-2.10.8\lib\mono\4.0\System.Core.dll"
 /nologo
 /warn:4
 /debug:+
 /debug:full
 /optimize-
 /codepage:utf8
 "/define:DEBUG"
 
 /t:library
 "D:\TOM\tom\backend\editors\CurrenciesEditors\AssemblyInfo.cs"
 "D:\TOM\tom\backend\editors\CurrenciesEditors\CurrencyEntityEditor.cs"
 





Unhandled Exception: System.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.TypeContainer.DefineBaseTypes () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeContainer.DefineType () [0x00000] in <filename unknown>:0 



  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 

[ERROR] FATAL UNHANDLED EXCEPTION: System.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.TypeContainer.DefineBaseTypes () [0x00000] in <filename unknown>:0 



  at Mono.CSharp.TypeContainer.DefineType () [0x00000] in <filename unknown>:0 



  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 







Unhandled Exception: System.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.TypeContainer.DefineBaseTypes () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeContainer.DefineType () [0x00000] in <filename unknown>:0 


  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 

[ERROR] FATAL UNHANDLED EXCEPTION: System.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.TypeContainer.DefineBaseTypes () [0x00000] in <filename unknown>:0 


  at Mono.CSharp.TypeContainer.DefineType () [0x00000] in <filename unknown>:0 


  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 

Build complete -- 1 error, 0 warnings
Comment 1 Alexey Pelykh 2012-02-23 04:21:11 UTC
Created attachment 1408 [details]
Sources
Comment 2 Marek Safar 2012-02-23 07:31:57 UTC
Already fixed in master