Jo Shields a575963da9 Imported Upstream version 3.6.0
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
2014-08-13 10:39:27 +01:00

39 lines
448 B
C#

using System;
static class Program
{
public interface I1
{
string Id { get; }
}
public class BaseClass
{
public int Id {
get {
return 4;
}
}
}
public class Derived : BaseClass, I1
{
public new string Id {
get {
return "aa";
}
}
}
static void Generic<T> (T item) where T : BaseClass, I1
{
if (item.Id != 4)
throw new Exception ("Doom!");
}
static void Main ()
{
Generic (new Derived ());
}
}