mono /mcs/tests/gtest-169.cs

Language C# Lines 21
MD5 Hash c0ce8d5bb020b88952283be6474bafa9 Estimated Cost $398 (why?)
Repository https://bitbucket.org/danipen/mono.git View Raw File View Project SPDX
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
class list <A> {
	public class Cons <T> : list <T> {   }
	public class Nil <T> : list <T> {  }
}

class C {
	public static void Rev<T> (list <T> y) {
		if (y is list<object>.Cons<T>)
			System.Console.WriteLine ("Cons");
		if (y is list<object>.Nil<T>)
			System.Console.WriteLine ("Nil");
	}
}

class M {
	public static void Main () { 
		C.Rev (new list<object>.Cons <string> ());
		C.Rev (new list<object>.Nil <string> ());
	 }
}
Back to Top