<?xml version="1.0"?>
<ErrorDocumentation xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  <ErrorName>CS0162</ErrorName>
  <Examples>
    <string>// CS0162: Unreachable code detected
// Line: 18
// Compiler options: -warnaserror -warn:2

using System;

class C {
	public enum Flags {
		Removed	= 0,
		Public	= 1
	}

	public Flags	_enumFlags;
		
	internal void Close()
	{	
		if ((_enumFlags &amp; Flags.Removed) != 0)
			Console.WriteLine ("error");
	}
}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 12
// Compiler options: -warnaserror -warn:2

using System;

class E
{
   public void Method&lt;T&gt; () where T : class
   {
      if (default (T) != null)
         throw new ArgumentNullException ();
   }
}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 9
// Compiler options: -warnaserror -warn:2

class Error
{
	void Test ()
	{
		if (1 == 0) {
			try {
			} catch (System.Net.Sockets.SocketException sex) {
				int x = (int)sex.SocketErrorCode;
			}
		}
	}

}</string>
    <string>// CS0162: Unreachable code detected
// Line: 10
// Compiler options: -warnaserror

class C
{
	void Test (int a)
	{
		return;
		if (a &gt; 0) {
			int x = a + 20;
			return;
		}
	}
}</string>
    <string>// CS0162: Unreachable code detected
// Line: 12
// Compiler options: -warnaserror -warn:2

using System;

class X
{
    void Test ()
    {
        var x = true ? throw new NullReferenceException () : 1;
        x = 2;
        return;
    }

	static void Main () 
	{
	}
}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 9
// Compiler options: -warnaserror -warn:2

class Foo {
	static void Main ()
	{
		goto skip;
	a:
		goto a;
	skip:
		return;
	}
}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 10
// Compiler options: -warnaserror -warn:2

class C
{
	static int Main () 
	{
		while (!new bool {});
		return 1;
	}
}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 9
// Compiler options: -warnaserror -warn:2

class C
{
	public static int Main ()
	{
		if (true == false)
			return 1;
		
		return 2;
	}
}</string>
    <string>// CS0162: Unreachable code detected
// Line: 12
// Compiler options: -warnaserror

using System;

public class Driver
{
	public static void Main ()
	{
		int yyTop = 0;
		for (; ; ++yyTop) {
			if (yyTop &gt; 0)
				break;
			else
				return;
		}
	}
}

</string>
    <string>// CS0162: Unreachable code detected
// Line: 9
// Compiler options: -warnaserror -warn:2

class Foo {
	static void Main ()
	{
		goto skip;
	a:
		throw new System.Exception ();
		goto a;
	skip:
		return;
	}
}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 11
// Compiler options: -warnaserror -warn:2

class Error
{
	void Test ()
	{
		switch (10)
		{
			case 9:
				break;
		}
	}

}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 10
// Compiler options: -warnaserror

public class X
{
	public static void Main ()
	{
		return;

		switch (8) {
		case 1:
		case 2:
			break;
		default:
			return;
		}

		return;
	}
}</string>
    <string>// CS0162: Unreachable code detected
// Line: 18
// Compiler options: -warnaserror -warn:2

using System;

class X
{
	public static int Main ()
	{
		try {
			throw new ApplicationException ();
		} catch when (false) {
			return 0;
		}
	}
}</string>
    <string>// CS0162: Unreachable code detected
// Line: 12
// Compiler options: -warnaserror -warn:2

class Program
{
	static int Main ()
	{
		int ctc_f = 0;

		if ((++ctc_f == 0 &amp;&amp; false)) {
			return 1;
		}
		
		return 0;
	}
}

</string>
    <string>// CS0162: Unreachable code detected
// Line: 11
// Compiler options: -warnaserror -warn:2

public class Test
{
	public static void Main ()
	{
		return;

		Test testStr;
		return;
	}
}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 12
// Compiler options: -warnaserror -warn:2

using System;

class E
{
   public void Method (int i)
   {
       throw new ArgumentNullException ();
       Console.WriteLine ("Once upon a time..");
   }
}
</string>
    <string>// CS0162: Unreachable code detected
// Line: 14
// Compiler options: -warnaserror

using System;

class X
{

	public static void Main ()
	{
		goto X;
	A:
		bool b = false;
		if (b) {
			goto A;
		}
	X:
		return;
	}
}</string>
    <string>// CS0162: Unreachable code detected
// Line: 13
// Compiler options: -warnaserror -warn:2

using System;

class C {
	bool T () { return true; }

	void Close()
	{	
		if (T () &amp;&amp; false)
			Console.WriteLine ("error");
	}
}

class XXXX { static void Main () {} }
</string>
    <string>// CS0162: Unreachable code detected
// Line: 10
// Compiler options: -warnaserror

using System;

class C
{
	void Test ()
	{
		return;
		const int a = 0;
		if (a &gt; 0) {
			int x = a + 20;
			return;
		}
	}
}</string>
    <string>// CS0162: Unreachable code detected
// Line: 18
// Compiler options: -warnaserror -warn:2

using System;

class C {
	public enum Flags {
		Removed	= 0,
		Public	= 1
	}

	public Flags	_enumFlags;
		
	internal void Close()
	{	
		if ((Flags.Removed &amp; _enumFlags) != (Flags.Removed &amp; _enumFlags))
			Console.WriteLine ("error");
	}

	static void Main () {}
}
</string>
  </Examples>
</ErrorDocumentation>