[Mono-bugs] [Bug 424012] New: gmcs crashes on compiling generics with multiple constraints

bugzilla_noreply at novell.com bugzilla_noreply at novell.com
Sat Sep 6 01:25:10 EDT 2008


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


           Summary: gmcs crashes on compiling generics with multiple
                    constraints
           Product: Mono: Compilers
           Version: unspecified
          Platform: x86
        OS/Version: Windows XP
            Status: NEW
          Severity: Major
          Priority: P5 - None
         Component: C#
        AssignedTo: mono-bugs at lists.ximian.com
        ReportedBy: vorlon_ra at yahoo.com
         QAContact: mono-bugs at lists.ximian.com
          Found By: Other


Description of Problem:
gmcs crashes on compiling the attached source file

Steps to reproduce the problem:

P:\>gmcs --version
Mono C# compiler version 1.9.1.0

P:\>gmcs -target:library a.cs

Unhandled Exception: Mono.CSharp.InternalErrorException: a.cs(16,21):
Test.Baz.Method<T,V>() ---> System.IndexOutOfRangeException: Array index is out
of range.
  at Mono.CSharp.Constraints.CheckInterfaceMethod
(Mono.CSharp.GenericConstraints gc) [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) [0x00000]
  at Mono.CSharp.MethodOrOperator.Define () [0x00000]
  at Mono.CSharp.Method.Define () [0x00000]
  at Mono.CSharp.TypeContainer+MemberCoreArrayList.DefineContainerMembers ()
[0x00000] --- End of innerexception 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.MainDriver (System.String[] args) [0x00000]
  at Mono.CSharp.Driver.Main (System.String[] args) [0x00000]


Actual Results:
Unhandled exception

Expected Results:
gmcs should go through and produce a usable assembly

How often does this happen? 
If there are constraints on more than one generic argument, all the time

Additional Information:

namespace Test
{
    using System;

    public interface IFoo
    {
    }

    public interface IBar
    {
        void Method<T, V>() where T : IFoo where V : T;
    }

    public class Baz : IBar
    {
        public void Method<T, V>() where T : IBar where V : T
        {
        }
    }
}


-- 
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