[Mono-dev] Re: Need testers for Mono's C# generics compiler.

Peter Sestoft sestoft at dina.kvl.dk
Tue Jan 3 18:25:08 EST 2006


>    I need developers that have generics code to try a new version of the
> C# compiler.  I fixed bugs #72908 and #59289, but am afraid that my
> changes could have introduced regressions.

I tried this gmcs.exe, (with MD5 checksum
af2065334cf83c8f69771353da353736) and it fixes a bug I reported
recently.  However, on most other generics code, like the attached
Bugx.cs, it fails like this:

Unhandled Exception: System.NullReferenceException: Object reference
not set toan instance of an object
in <0x0000c> Mono.CSharp.TypeManager:RemoveGenericArity (System.String
in <0x000d5> Mono.CSharp.TypeManager:GetFullName (System.Type t,
System.Text.StringBuilder sb)
in <0x0006d> Mono.CSharp.TypeManager:GetFullName (System.Type t)
in <0x00415> Mono.CSharp.MethodData:Define (Mono.CSharp.TypeContainer
in <0x00052> Mono.CSharp.PropertyBase+GetMethod:Define
(Mono.CSharp.TypeContainer container)
in <0x0009f> Mono.CSharp.Property:Define ()
in <0x00059>
in <0x00014> Mono.CSharp.TypeContainer:DefineContainerMembers
(Mono.CSharp.MemberCoreArrayList mcal)
in <0x0057b> Mono.CSharp.TypeContainer:DoDefineMembers ()
in <0x0002f> Mono.CSharp.Iterator:DoDefineMembers ()
in <0x0004a> Mono.CSharp.TypeContainer:DefineMembers ()
in <0x00994> Mono.CSharp.TypeContainer:DoDefineMembers ()
in <0x0004a> Mono.CSharp.TypeContainer:DefineMembers ()
in <0x0023c> Mono.CSharp.RootContext:PopulateTypes ()
in <0x00979> Mono.CSharp.Driver:MainDriver (System.String[] args)
in <0x00051> Mono.CSharp.Driver:Main (System.String[] args)

Might this be because my Mono installation is and your
gmcs.exe has version

	 Mono C# compiler version

-------------- next part --------------
// Compiler bug (gmcs): The constraint on T seems not to be copied to
// the class generated for the iterator method Merge<T>.
// sestoft at dina.kvl.dk 

using System;
using System.Collections.Generic;

public class H {
  public static void Main(String[] args) { }

  public static IEnumerable<T> Merge<T>(IEnumerator<T> xEtor) 
    where T : IComparable<T>
    int order = xEtor.Current.CompareTo(xEtor.Current);
    yield return xEtor.Current;

More information about the Mono-devel-list mailing list