Bugzilla – Bug 319226
[GMCS] partial type does not allow such base type that has generic where clause
Last modified: 2007-09-15 21:24:23 UTC
---- Reported by atsushi@ximian.com 2005-10-07 15:11:57 MST ---- The code below crashes gmcs: -------- public class R {} public class A<T> where T : R {} public partial class D : A<R> {} -------- Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object in [0x0015f] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\generic.cs:1373) Mono.CSharp.ConstructedType:CheckConstraints (Mono.CSharp.EmitContext ec, Int32 index) in [0x0000a] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\generic.cs:1435) Mono.CSharp.ConstructedType:CheckConstraints (Mono.CSharp.EmitContext ec) in [0x00094] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\ecore.cs:273) Mono.CSharp.Expression:ResolveAsTypeTerminal (Mono.CSharp.EmitContext ec, Boolean silent) in [0x00003] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\ecore.cs:247) Mono.CSharp.Expression:ResolveAsTypeTerminal (Mono.CSharp.EmitContext ec) in [0x00002] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\ecore.cs:2279) Mono.CSharp.TypeExpr:ResolveType (Mono.CSharp.EmitContext ec) in [0x0036b] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\class.cs:1312) Mono.CSharp.TypeContainer:DefineType () in [0x0007f] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\rootcontext.cs:176) Mono.CSharp.RootContext:ResolveTree () in [0x00529] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\driver.cs:1593) Mono.CSharp.Driver:MainDriver (System.String[] args) in [0x00020] (at C:\cygwin\home\atsushi\svn\mcs\gmcs\driver.cs:289) Mono.CSharp.Driver:Main (System.String[] args) Expected Results: no error (except for "entrypoint not found"). How often does this happen? consistently. Additional Information: - It does not happen when we remove "partial" modifier. - It does not happen when we remove "where" clause. ---- Additional Comments From martin@ximian.com 2005-10-19 14:01:38 MST ---- Fixed in SVN. Unknown operating system unknown. Setting to default OS "Other".