PageRenderTime 55ms CodeModel.GetById 29ms RepoModel.GetById 0ms app.codeStats 0ms

/mcs/tests/gtest-169.cs

https://bitbucket.org/danipen/mono
C# | 20 lines | 18 code | 2 blank | 0 comment | 2 complexity | c0ce8d5bb020b88952283be6474bafa9 MD5 | raw file
Possible License(s): Unlicense, Apache-2.0, LGPL-2.0, MPL-2.0-no-copyleft-exception, CC-BY-SA-3.0, GPL-2.0
  1. class list <A> {
  2. public class Cons <T> : list <T> { }
  3. public class Nil <T> : list <T> { }
  4. }
  5. class C {
  6. public static void Rev<T> (list <T> y) {
  7. if (y is list<object>.Cons<T>)
  8. System.Console.WriteLine ("Cons");
  9. if (y is list<object>.Nil<T>)
  10. System.Console.WriteLine ("Nil");
  11. }
  12. }
  13. class M {
  14. public static void Main () {
  15. C.Rev (new list<object>.Cons <string> ());
  16. C.Rev (new list<object>.Nil <string> ());
  17. }
  18. }