Bug 320653 (MONO77900) - [GMCS] Crash when checking new() constraint in derived template
Summary: [GMCS] Crash when checking new() constraint in derived template
Status: RESOLVED FIXED
Alias: MONO77900
Product: Mono: Compilers
Classification: Mono
Component: C# (show other bugs)
Version: unspecified
Hardware: Other Other
: P3 - Medium : Normal
Target Milestone: ---
Assignee: Raja R Harinath
QA Contact: Mono Bugs
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-24 20:41 UTC by ewtewuo02
Modified: 2007-09-15 21:24 UTC (History)
0 users

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thomas Wiest 2007-09-15 19:52:50 UTC


---- Reported by ewtewuo02@sneakemail.com 2006-03-24 13:41:12 MST ----

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)



---- Additional Comments From martin@ximian.com 2006-06-21 10:02:45 MST ----

Already fixed in SVN; was a duplicate of #78380.


Unknown operating system unknown. Setting to default OS "Other".