a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
27 lines
327 B
C#
27 lines
327 B
C#
using System;
|
|
|
|
class Base<T> where T : new ()
|
|
{
|
|
protected readonly T field = new T ();
|
|
}
|
|
|
|
class Derived<T> : Base<T> where T : ICloneable, new ()
|
|
{
|
|
public Derived()
|
|
{
|
|
field.Clone();
|
|
}
|
|
}
|
|
|
|
class C : ICloneable
|
|
{
|
|
public object Clone ()
|
|
{
|
|
return null;
|
|
}
|
|
|
|
public static void Main ()
|
|
{
|
|
var a = new Derived<C> ();
|
|
}
|
|
} |