<?xml version="1.0"?>
<ErrorDocumentation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ErrorName>CS0266</ErrorName>
  <Examples>
    <string>// CS0266: Cannot implicitly convert type `A' to `B'. An explicit conversion exists (are you missing a cast?)
// Line: 17

class A
{
	public static A operator -- (A x)
	{
		return new A ();
	}
}

class B : A
{
	static void Main ()
	{
		B b = new B ();
		--b;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `Helper*' to `Obsolete*'. An explicit conversion exists (are you missing a cast?)
// Line: 18
// Compiler options: -unsafe

class Box {
        public Helper o;
}

unsafe struct Obsolete {
}

unsafe struct Helper {}

class MainClass {
        unsafe public static void Main ()
        {
                Box b = new Box ();
                fixed (Obsolete* p = &amp;b.o)
                {
                }
        }
}
</string>
    <string>// CS0266: Cannot implicitly convert type `long' to `uint'. An explicit conversion exists (are you missing a cast?)
// Line: 9

class S
{
	uint Test (uint a)
	{
		int b = 0;
		return a * b;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `Bar' to `X'. An explicit conversion exists (are you missing a cast?)
// Line: 18

public enum Bar
{
	ABar
}

class X
{
	public static explicit operator X (Bar the_bar)
	{
		return new X();
	}
	
	public static void Main ()
	{
		X x = Bar.ABar;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `long' to `int'. An explicit conversion exists (are you missing a cast?)
// Line: 7

public class Test
{
	const uint a = 2147483648;
	const int b = -a;
}</string>
    <string>// CS0266: Cannot implicitly convert type `object' to `bool'. An explicit conversion exists (are you missing a cast?)
// Line: 9

class X
{
	static void Main ()
	{
		object o = true;
		bool b = (o ?? string.Empty);
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `int' to `X.E'. An explicit conversion exists (are you missing a cast?)
// Line : 9

class X {
        enum E { }
        
        static void Main ()
        {
                const E e = 1 - 1;
        }
}



</string>
    <string>// CS0266: Cannot implicitly convert type `Foo.MyEnumType' to `uint'. An explicit conversion exists (are you missing a cast?)
// Line: 11

public class Foo {
  enum MyEnumType { MyValue }

  public void Bar ()
  {
    uint my_uint_var = 0;
    switch (my_uint_var) {
    case MyEnumType.MyValue:
      break;
    default:
      break;
    }
  }

  static void Main () {}
}






</string>
    <string>// CS0266: Cannot implicitly convert type `System.Collections.Generic.IEnumerable&lt;T&gt;' to `System.Collections.Generic.IEnumerable&lt;U&gt;'. An explicit conversion exists (are you missing a cast?)
// Line: 12

using System;
using System.Collections.Generic;

public class Test
{
	static void Bla&lt;T, U&gt; () where T : U
	{
		IEnumerable&lt;T&gt; ita = null;
		IEnumerable&lt;U&gt; itu = ita;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `int?' to `E'. An explicit conversion exists (are you missing a cast?)
// Line: 13

enum E
{
}

class C
{
	public static void Main ()
	{
		E e = 0;
		E r = e - null;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `int' to `char'. An explicit conversion exists (are you missing a cast?)
// Line: 12

class X
{
	public static void Main ()
	{
		char x = 'A';
		char b = +x;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `bool?' to `bool'. An explicit conversion exists (are you missing a cast?)
// Line: 9

class X
{
	static void Main ()
	{
		bool? a = true;
		int? b = a ? 3 : 4;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `long' to `int'. An explicit conversion exists (are you missing a cast?)
// Line : 6

class X {
    const uint a = 2;
    const int b = -a;
}



</string>
    <string>// CS0266: Cannot implicitly convert type `Foo&lt;int&gt;.FooEvent' to `Foo&lt;string&gt;.FooEvent'. An explicit conversion exists (are you missing a cast?)
// Line: 12

class Foo&lt;T&gt; {
	public event FooEvent Event;
	public delegate T FooEvent();
}

class CompilerCrashTest {
	static void Main() {
		Foo&lt;string&gt; foo = new Foo&lt;string&gt;();
		foo.Event += new Foo&lt;int&gt;.FooEvent (() =&gt; 0);
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `System.Collections.Generic.IList&lt;int&gt;' to `Hoge&lt;System.Collections.Generic.IList&lt;int&gt;&gt;'. An explicit conversion exists (are you missing a cast?)
// Line: 20

using System;
using System.Collections.Generic;

public class Hoge&lt;T&gt;
{
	public static implicit operator Hoge&lt;T&gt; (T value)
	{
		return null;
	}
}

public class Test
{
	static void Main ()
	{
		IList&lt;int&gt; x = new List&lt;int&gt; ();
		Hoge&lt;IList&lt;int&gt;&gt; hoge = x;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `B' to `I'. An explicit conversion exists (are you missing a cast?)
// Line: 21

interface I { }

class A : I { }

class B
{
	public static explicit operator A (B from)
	{
		return new A ();
	}
}

class App
{
	public static void Main ()
	{
		B b = new B ();
		I i = b;
	}
}

</string>
    <string>// CS0266: Cannot implicitly convert type `int' to `sbyte'. An explicit conversion exists (are you missing a cast?)
// Line: 33

class A3
{
	public static implicit operator sbyte (A3 mask)
	{
		return 1;
	}

	public static implicit operator uint (A3 mask)
	{
		return 6;
	}
	
	public static implicit operator long (A3 mask)
	{
		return 7;
	}

	public static implicit operator ulong (A3 mask)
	{
		return 8;
	}
}


public class C
{
	public static int Main ()
	{
		A3 a3 = null;
		sbyte sa3 = -a3;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `object' to `System.Collections.ArrayList'. An explicit conversion exists (are you missing a cast?)
// Line: 12

using System.Collections;

class X
{
	static Hashtable h = new Hashtable ();

	public static void Main ()
	{
		ArrayList l = h ["hola"] = new ArrayList ();
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `E2' to `E1'. An explicit conversion exists (are you missing a cast?)
// Line : 8

enum E1 { A }
enum E2 { A }

class X {
    const E1 e = ~E2.A;
}

</string>
    <string>// CS0266: Cannot implicitly convert type `bool?' to `bool'. An explicit conversion exists (are you missing a cast?)
// Line: 9

class X
{
	static void Main ()
	{
		bool? a = true;
		bool b = a &amp; a;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `System.Collections.Generic.IList&lt;dynamic&gt;' to `string[]'. An explicit conversion exists (are you missing a cast?)
// Line: 10
// Compiler options: -r:CS0266-25-lib.dll -noconfig

public class C
{
	public static void Main ()
	{
		var t = new Test ();
		string[] s = t.DynField;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `E?' to `E'. An explicit conversion exists (are you missing a cast?)
// Line: 13

enum E
{
}

class C
{
	public static void Main ()
	{
		E e = 0;
		E r = e + null;
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `object' to `System.Collections.Hashtable'. An explicit conversion exists (are you missing a cast?)
// Line: 17

// This case actually tests that the compiler doesn't crash after reporting the error

using System.Collections;

class X {
        static void Main (string [] install)
        {
                ArrayList order = new ArrayList ();
                Hashtable states = new Hashtable ();

                try {
                        if (install != null){
                                foreach (string inst in order){
                                        Hashtable state = states [inst];
                                }
                        }
                } catch {
                }
        }
}
</string>
    <string>// CS0266: Cannot implicitly convert type `System.IntPtr' to `byte*'. An explicit conversion exists (are you missing a cast?)
// Line: 23
// Compiler options: -unsafe

using System;

public class Pixbuf {
        static void Main (string [] args)
	{
		Bug ();
	}

	public IntPtr Pixels {
		get {
			return IntPtr.Zero;
		}
	}
	public static unsafe void Bug ()
	{
		Pixbuf pixbuf = null;
		//should be:
		//byte *pix = (byte *)pixbuf.Pixels;
		byte *pix = pixbuf.Pixels;
	}
}



</string>
    <string>// CS0266: Cannot implicitly convert type `I' to `C'. An explicit conversion exists (are you missing a cast?)
// Line: 16

interface I
{
}

struct C : I
{
}

class X
{
	static void Main (string[] args)
	{
		C c = default (I);
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `double' to `int'. An explicit conversion exists (are you missing a cast?)
// Line: 8

class Program
{
	static void Main()
	{
		var s = $"{1, 0.0}";
	}
}</string>
    <string>// CS0266: Cannot implicitly convert type `S?' to `A'. An explicit conversion exists (are you missing a cast?)
// Line: 9

struct S
{
	public static int Main ()
	{
		S? s = null;
		A a = s;
		return 0;
	}
}

struct A
{
	public static implicit operator A (S x)
	{
		return new A ();
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `long' to `uint'. An explicit conversion exists (are you missing a cast?)
// Line: 7

namespace MWFTestApplication {
	class MainWindow {
		public enum Testme : uint {
			value   = (1L &lt;&lt; 1)
		}
	}
}
</string>
    <string>// CS0266: Cannot implicitly convert type `void*' to `int*'. An explicit conversion exists (are you missing a cast?)
// Line: 7
// Compiler options: -unsafe

unsafe class MainClass {
	static void *pv = null;
	static int *pi = pv;
        public static void Main () { }
}
</string>
    <string>// CS0266:  Cannot implicitly convert type `int' to `sbyte'. An explicit conversion exists (are you missing a cast?)
// Line: 9

class S
{
	static void Main ()
	{
		sbyte s = 1;
		sbyte r = +s;
	}
}
</string>
  </Examples>
</ErrorDocumentation>