[Mono-dev] Gmcs compiler bug with generics

Tom Philpot tom.philpot at logos.com
Mon Jul 20 19:08:51 EDT 2009

We found the following bug with gmcs ( r138189). I¹ll be filling a bugzilla
report as well, but thought I¹d post it here in case someone wants a head


using System;
using System.Linq;
using System.Collections.Generic;
using System.Collections.ObjectModel;

namespace TestNS
    public class TestCase
        public static int Compare<T>(T[] array1, T[] array2)
            return 0;

        public static void DoSomething<T>(Func<T, T, int> fn)
            Console.WriteLine(fn(default(T), default(T)));

        public static void DoSomethingElse()
            // Does not work
            // Does work
            // DoSomething<byte[]>((a, b) => TestCase.Compare(a, b));

[ tom.philpot]$ gmcs TestCompiler.cs -out:TestCompiler.dll
Internal compiler error at TestCompiler.cs(23,36):: exception caught while
emitting MethodBuilder [TestCase::DoSomethingElse]

Unhandled Exception: Mono.CSharp.InternalErrorException:
VerifyArgumentsCompat didn't find any problem with rejected candidate Void
  at Mono.CSharp.MethodGroupExpr.OverloadResolve (Mono.CSharp.EmitContext
ec, Mono.CSharp.Arguments& Arguments, Boolean may_fail, Location loc)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20090720/eb5b7755/attachment.html 

More information about the Mono-devel-list mailing list