linux-packaging-mono/mcs/tests/gtest-anontype-11.cs
Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

45 lines
674 B
C#

// Compiler options: -checked
using System;
internal sealed class Alpha
{
public Alpha (string value)
{
m_name = value;
}
public override int GetHashCode ()
{
return int.MaxValue & m_name.GetHashCode ();
}
private string m_name;
}
internal sealed class Beta
{
public Beta (string value)
{
m_address = value;
}
public override int GetHashCode ()
{
return int.MaxValue & m_address.GetHashCode ();
}
private string m_address;
}
internal static class Program
{
public static int Main ()
{
var a = new { First = new Alpha ("joe bob"), Second = new Beta ("main street") };
Console.WriteLine ("hash = {0}", a.GetHashCode ());
return 0;
}
}