Zeno's Notes

...

Posts tagged golf

4 notes

Mono 2.6.7 crash competition

When I compile the following code with Mono 2.6.7, the compiler crashes.

class V<T>
{
	T[] d;
	T this [int i]
	{
		get { return d[0]; }
	}
}

class C
{
	void M()
	{
		V<int> m;
		var x = m[0];
	}
}

It is a short piece of code (101 non-whitespace characters) that still can illustrate the problem.

But is it minimal (ignoring whitespace)? A little bit of playing around gave me this:

class V<T>
{
	T[] d;
	T this [int i]
	{
		get { return d[0]; }
	}
}

class C
{
	void M()
	{
		V<int> m;
		x = m[0];
	}
}

Just 98 characters! Can you come up with something smaller that triggers this bug? Something smaller that triggers another bug?

Filed under mono csharp golf dotnet cli crash compiler