2010-05-27 Jb Evain <jbevain@novell.com>
[mcs.git] / tests / test-139.cs
blobbe84d94fc987a76ef3a65ed9006d2147411fdd95
1 //
2 // This tests two uses of the `This' expression on structs; being used as an argument
3 // and being used implicitly.
4 //
6 struct T {
7 int val;
8 void one () {
11 // First test: Pass this as an argument.
13 two (this);
16 void two (T t) {
17 this = t;
20 void three (ref T t) {
21 two (t);
25 public override int GetHashCode () {
27 // Second test: do we correctly load this?
29 return val.GetHashCode();
32 static int Main()
34 T t = new T ();
36 t.one ();
38 t.GetHashCode ();
40 return 0;