#define compileErrorsNot

using System;
using System.Data;
using System.Data.SqlTypes;

class app
{
	static void Main()
	{

		SqlSingle s = 4.5F;
		SqlDouble d = 4.5F;
		// the following lines will compile without error
		// but will cause a runtime error
		try
		{
			Console.WriteLine(d.CompareTo("asdfasdf"));
		}
		catch
		{
			Console.WriteLine("asdfasdf failed");
		}
		// this will cause a runtime time error
		try
		{
			Console.WriteLine(d.CompareTo(4.5));
		}
		catch
		{
			Console.WriteLine("4.5 failed");
		}
		// this will cause a runtime error
		try
		{
			Console.WriteLine(d.CompareTo(s));
		}
		catch
		{
			Console.WriteLine("s failed");
		}
		// this will work as expected
		Console.WriteLine(d.CompareTo((SqlDouble)s));
		SqlDouble sd = 4.5;
			Console.WriteLine(sd);
		// this will cause a runtime error
		try
		{
			Console.WriteLine(sd.CompareTo((SqlSingle)0.0));
		}
		catch
		{
			Console.WriteLine("(SqlSingle)0.0 failed");
		}
		Console.WriteLine(sd.CompareTo((SqlDouble)4.5));
	}
}


