Debian Codegraph @

mcs/tests/gtest-anontype-11.cs

raw symbols SCIP
1 // Compiler options: -checked
2
3 using System;
4
5 internal sealed class Alpha
6 {
7 public Alpha (string value)
8 {
9 m_name = value;
10 }
11
12 public override int GetHashCode ()
13 {
14 return int.MaxValue & m_name.GetHashCode ();
15 }
16
17 private string m_name;
18 }
19
20 internal sealed class Beta
21 {
22 public Beta (string value)
23 {
24 m_address = value;
25 }
26
27 public override int GetHashCode ()
28 {
29 return int.MaxValue & m_address.GetHashCode ();
30 }
31
32 private string m_address;
33 }
34
35 internal static class Program
36 {
37 public static int Main ()
38 {
39 var a = new { First = new Alpha ("joe bob"), Second = new Beta ("main street") };
40 Console.WriteLine ("hash = {0}", a.GetHashCode ());
41 return 0;
42 }
43 }
44