2010-06-21 Atsushi Enomoto <atsushi@ximian.com>
[mcs.git] / tests / gtest-304.cs
blob8f7c71fd5e4a24548e7198b423adf9b0670eb845
1 //
2 // Second test from bug 80518
3 //
4 using System;
6 namespace test
8 public class BaseClass
10 public BaseClass()
13 public string Hello { get { return "Hello"; } }
16 public abstract class Printer
18 public abstract void Print<T>(object x) where T: BaseClass;
21 public class PrinterImpl: Printer
23 public override void Print<T>(object x)
25 Console.WriteLine((x as T).Hello);
29 public class Starter
31 public static void Main( string[] args )
33 BaseClass bc = new BaseClass();
34 Printer p = new PrinterImpl();
35 p.Print<BaseClass>(bc);