[Mono-bugs] [Bug 77900][Blo] New - Crash when checking new() constraint in derived template

bugzilla-daemon at bugzilla.ximian.com bugzilla-daemon at bugzilla.ximian.com
Fri Mar 24 13:41:12 EST 2006


Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by ewtewuo02 at sneakemail.com.

http://bugzilla.ximian.com/show_bug.cgi?id=77900

--- shadow/77900	2006-03-24 13:41:12.000000000 -0500
+++ shadow/77900.tmp.28363	2006-03-24 13:41:12.000000000 -0500
@@ -0,0 +1,82 @@
+Bug#: 77900
+Product: Mono: Compilers
+Version: unspecified
+OS: 
+OS Details: 
+Status: NEW   
+Resolution: 
+Severity: 
+Priority: Blocker
+Component: C#
+AssignedTo: rharinath at novell.com                            
+ReportedBy: ewtewuo02 at sneakemail.com               
+QAContact: mono-bugs at ximian.com
+TargetMilestone: ---
+URL: 
+Cc: 
+Summary: Crash when checking new() constraint in derived template
+
+This happens with recent SVN revisions (58310, 58387).  It does not happen
+with release 1.1.13.2.  When I compile this file (generic-bug-2.cs):
+
+--
+namespace bug {
+
+  public class Base<T>
+  // If you remove the next line, the crash goes away
+  where T : new()
+  {
+  }
+  
+  public class Derived<T>
+    : Base<T>
+    where T : new()
+  {
+  }      
+
+}
+--
+with the command line
+
+gmcs -t:library -out:default.dll generic-bug-2.cs
+
+gmcs crashes with this traceback:
+--
+Unhandled Exception: System.NullReferenceException: Object reference not
+set to an instance of an object
+in <0x00067> Mono.CSharp.TypeParameter:FindMembers (MemberTypes mt,
+BindingFlags bf, System.Reflection.MemberFilter filter, System.Object criteria)
+in <0x001dc> Mono.CSharp.TypeManager:MemberLookup_FindMembers (System.Type
+t, MemberTypes mt, BindingFlags bf, System.String name, System.Boolean
+used_cache)
+in <0x001b2> Mono.CSharp.TypeManager:RealMemberLookup (System.Type
+invocation_type, System.Type qualifier_type, System.Type queried_type,
+MemberTypes mt, BindingFlags original_bf, System.String name, IList
+almost_match)
+in <0x0001f> Mono.CSharp.TypeManager:MemberLookup (System.Type
+invocation_type, System.Type qualifier_type, System.Type queried_type,
+MemberTypes mt, BindingFlags original_bf, System.String name, IList
+almost_match)
+in <0x00038> Mono.CSharp.Expression:MemberLookup (System.Type
+container_type, System.Type qualifier_type, System.Type queried_type,
+System.String name, MemberTypes mt, BindingFlags bf, Location loc)
+in <0x0001b> Mono.CSharp.Expression:MemberLookup (System.Type
+container_type, System.Type queried_type, System.String name, MemberTypes
+mt, BindingFlags bf, Location loc)
+in <0x0025a> Mono.CSharp.ConstraintChecker:HasDefaultConstructor
+(System.Type containerType, System.Type atype)
+in <0x004a6> Mono.CSharp.ConstraintChecker:CheckConstraints
+(IResolveContext ec, Int32 index)
+in <0x00019> Mono.CSharp.ConstraintChecker:CheckConstraints
+(IResolveContext ec)
+in <0x00035> Mono.CSharp.ConstraintChecker:CheckConstraints
+(IResolveContext ec, System.Type gt, System.Type[] gen_params,
+System.Type[] atypes, Location loc)
+in <0x0001a> Mono.CSharp.ConstructedType:CheckConstraints (IResolveContext ec)
+in <0x001d2> Mono.CSharp.Expression:ResolveAsTypeTerminal (IResolveContext
+ec, Boolean silent)
+in <0x0001f> Mono.CSharp.TypeExpr:ResolveType (IResolveContext ec)
+in <0x00086> Mono.CSharp.TypeContainer:ResolveType ()
+in <0x000c8> Mono.CSharp.RootContext:PopulateTypes ()
+in <0x0099d> Mono.CSharp.Driver:MainDriver (System.String[] args)
+in <0x00052> Mono.CSharp.Driver:Main (System.String[] args)


More information about the mono-bugs mailing list