[Mono-bugs] [Bug 434835] New: Implementing an interface with a generic method with constraints causes crasher

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Mon Oct 13 12:11:43 EDT 2008


https://bugzilla.novell.com/show_bug.cgi?id=434835


           Summary: Implementing an interface with a generic method with
                    constraints causes crasher
           Product: Mono: Compilers
           Version: 2.0
          Platform: x86-64
        OS/Version: Linux
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: peter at peterjohanson.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: ---


Created an attachment (id=245209)
 --> (https://bugzilla.novell.com/attachment.cgi?id=245209)
Test case

Trying to implement an interface with a generic method with constraints causes
an exception in gmcs:

Unhandled Exception: Mono.CSharp.InternalErrorException:
generic-method-constraints.cs(19,21): GenericConstraints.Method<IFACE,IMPL>()
---> System.IndexOutOfRangeException: Array index is out of range.
  at Mono.CSharp.TypeParameter+InflatedConstraints.inflate (System.Type t)
[0x00000]
  at Mono.CSharp.TypeParameter+InflatedConstraints..ctor
(Mono.CSharp.GenericConstraints gc, System.Type[] dargs) [0x00000]
  at Mono.CSharp.TypeParameter+InflatedConstraints..ctor
(Mono.CSharp.GenericConstraints gc, System.Type declaring) [0x00000]
  at Mono.CSharp.TypeParameter.DefineType (IResolveContext ec,
System.Reflection.Emit.MethodBuilder builder, System.Reflection.MethodInfo
implementing, Boolean is_override) [0x00000]
  at Mono.CSharp.GenericMethod.DefineType (Mono.CSharp.EmitContext ec,
System.Reflection.Emit.MethodBuilder mb, System.Reflection.MethodInfo
implementing, Boolean is_override) [0x00000]
  at Mono.CSharp.MethodData.Define (Mono.CSharp.DeclSpace parent, System.String
method_full_name) [0x00000]
  at Mono.CSharp.MethodOrOperator.Define () [0x00000]
  at Mono.CSharp.Method.Define () [0x00000]
  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers ()
[0x00000]
  --- End of inner exception stack trace ---
  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers ()
[0x00000]
  at Mono.CSharp.TypeContainer.DefineContainerMembers
(Mono.CSharp.MemberCoreArrayList mcal) [0x00000]
  at Mono.CSharp.Class.DefineContainerMembers (Mono.CSharp.MemberCoreArrayList
list) [0x00000]
  at Mono.CSharp.TypeContainer.DoDefineMembers () [0x00000]
  at Mono.CSharp.Class.DoDefineMembers () [0x00000]
  at Mono.CSharp.TypeContainer.DefineMembers () [0x00000]
  at Mono.CSharp.RootContext.PopulateTypes () [0x00000]
  at Mono.CSharp.Driver.Compile () [0x00000]
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]


I will attach a simple test case.


-- 
Configure bugmail: https://bugzilla.novell.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.


More information about the mono-bugs mailing list