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


           Summary: Compilation of C# involving generically-typed collection
                    classes fails with a System.IndexOutOfRangeException
           Product: Mono: Compilers
           Version: SVN
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Normal
          Priority: P5 - None
         Component: C#
        AssignedTo: [email protected]
        ReportedBy: [email protected]
         QAContact: [email protected]
                CC: [email protected]
          Found By: Community User


Created an attachment (id=260885)
 --> (https://bugzilla.novell.com/attachment.cgi?id=260885)
C# code that produces the compiler error

When compiling C# code with classes based on generically-typed signatures
(based on System.Collections.Generic), the mono C# compiler fails and produces
a "System.IndexOutOfRangeException".  Compilation succeeds on .NET.  

NOTE:  This is a regression from mono version 1.9. (applicable to 2.0, 2.2, and
SVN)

The attached program illustrates this compilation failure when compiled using
gmcs.  For this specific example, the stack trace is as follows:

Exception caught by the compiler while compiling:
   Block that caused the problem begin at: Foo.cs(10,24):
                     Block being compiled: [Foo.cs(11,5):,Foo.cs(17,5):]
System.IndexOutOfRangeException: Array index is out of range.
Internal compiler error at Foo.cs(10,24):: exception caught while emitting
MethodBuilder [Foo::Main]

Unhandled Exception: System.IndexOutOfRangeException: Array index is out of
range.
  at Mono.CSharp.ConstraintChecker.CheckConstraint (IResolveContext ec,
System.Type ptype, Mono.CSharp.Expression expr, System.Type ctype) [0x00000]
  at Mono.CSharp.ConstraintChecker.CheckConstraints (IResolveContext ec, Int32
index) [0x00000]
  at Mono.CSharp.ConstraintChecker.CheckConstraints (IResolveContext ec)
[0x00000]
  at Mono.CSharp.ConstraintChecker.CheckConstraints (Mono.CSharp.EmitContext
ec, System.Reflection.MethodBase definition, System.Reflection.MethodBase
instantiated, Location loc) [0x00000]
  at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext ec,
System.Collections.ArrayList& Arguments, Boolean may_fail, Location loc)
[0x00000]
  at Mono.CSharp.Invocation.DoResolveOverload (Mono.CSharp.EmitContext ec)
[0x00000]
  at Mono.CSharp.Invocation.DoResolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec, ResolveFlags
flags) [0x00000]
  at Mono.CSharp.Expression.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.ExpressionStatement.ResolveStatement (Mono.CSharp.EmitContext
ec) [0x00000]
  at Mono.CSharp.StatementExpression.Resolve (Mono.CSharp.EmitContext ec)
[0x00000]
  at Mono.CSharp.Block.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.ExplicitBlock.Resolve (Mono.CSharp.EmitContext ec) [0x00000]
  at Mono.CSharp.EmitContext.ResolveTopBlock (Mono.CSharp.EmitContext
anonymous_method_host, Mono.CSharp.ToplevelBlock block, Mono.CSharp.Parameters
ip, IMethodData md, System.Boolean& unreachable) [0x00000]


-- 
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.
_______________________________________________
mono-bugs maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-bugs

Reply via email to