[Mono-dev] Random "Internal Compiler Error" with extension methods on interfaces?

Jordan Earls earlz at lastyearswishes.com
Sun Feb 3 02:37:57 UTC 2013

Hi, I've been messing with extension methods some in my open source
project. I stumbled across an internal compiler error. The full
message is this:

error CS0584: Internal compiler error: Array index is out of range.
error CS1928: Type `Earlz.BarelyMVC.Caching.ICacheMechanism' does not
contain a member `Setup' and the best extension method overload
Earlz.BarelyMVC.Caching.ICacheMechanism, string,
Earlz.BarelyMVC.Caching.CacheInfo)' has some invalid arguments
(Location of the symbol related to previous error)

The error line looks like this:

			static TestCache()
				Cacher.Setup("Testfoo", new CacheInfo()); //error here
			public static ICacheMechanism Cacher=new MockCacheMechanism();

The implementation of Setup looks like this:

		public static void Setup(this ICacheMechanism cacher, string name,
CacheInfo info)
			cacher.KeyInfo.Add(name, info);

Obviously, this shouldn't cause a compiler error. I've tried to
reproduce it in a small test case, but I couldn't. My project is open
source though, so I could give a full solution file and point to where
the error happens

This happens on Arch linux x86-64. All packages are up to date and
`mono --version`:

[earlz at EarlzAlpha ~]$ mono --version
Mono JIT compiler version 2.10.8 (tarball Sat Oct  6 23:22:30 UTC 2012)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors.
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            Included Boehm (with typed GC and Parallel Mark)

I've tried compiling the git version of mono in the past but it's a
bit more... challenging than I expected, so I'm not sure I'll be able
to repro this with latest.

What should I do? Report a bug with a huge repro?

If anyone wants to see the bug in action, extract
Then, open the solution file in Monodevelop and try to compile the
BarelyMVC.Tests project. You should get the error on line 15 of
CacheTest.cs (please disregard the terrible code quality, it was a bit
of an experiment :) )


More information about the Mono-devel-list mailing list