<?xml version="1.0"?>
<ErrorDocumentation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ErrorName>CS0151</ErrorName>
  <Examples>
    <string>// CS0151: A switch expression of type `S1?' cannot be converted to an integral type, bool, char, string, enum or nullable type
// Line: 25
// Compiler options: -langversion:5

using System;

struct S1
{
	public static implicit operator int? (S1? s)
	{
		throw new ApplicationException ();
	}

	public static implicit operator int (S1? s)
	{
		throw new ApplicationException ();
	}
}

class C
{
	public static int Main ()
	{
		S1? s1 = new S1 ();
		switch (s1)
		{
			default:
				return 1;
		}
	}
}</string>
    <string>// CS0151: A switch expression of type `Y' cannot be converted to an integral type, bool, char, string, enum or nullable type
// Line: 13

class Y {
	byte b;
}

class X {
	static void Main ()
	{
		Y y = new Y ();

		switch (y){
		case 0:
			break;
		case 1:
			break;
		}
	}
}
</string>
    <string>// CS0151: A switch expression of type `X?' cannot be converted to an integral type, bool, char, string, enum or nullable type
// Line: 19

struct X 
{
	public static implicit operator int? (X x)
	{
		return 1;
	}

	static void Main ()
	{
		X? x = null;
		switch (x) {
		default:
			break;
		}
	}
}
</string>
    <string>// CS0151: A switch expression of type `Y' cannot be converted to an integral type, bool, char, string, enum or nullable type
// Line: 28

class Y {
	byte b;
	
	public static implicit operator int (Y i)
	{
		return i.b;
	}

	public static implicit operator byte (Y i)
	{
		return i.b;
	}

	public Y (byte b)
	{
		this.b = b;
	}			
}

class X {
	static void Main ()
	{
		Y y = new Y (1);

		switch (y){
		case 0:
			break;
		case 1:
			break;
		}

		int a = y;
	}
}
</string>
    <string>// CS0151: A switch expression of type `X?' cannot be converted to an integral type, bool, char, string, enum or nullable type
// Line: 15

struct X 
{
    public static implicit operator int (X x)
    {
        return 1;
    }

	static void Main ()
	{
		X? x = null;
		switch (x) {
		default:
			break;
		}
	}
}
</string>
  </Examples>
</ErrorDocumentation>