Browse Source

Add test case for previous commit.

pull/155/head
Daniel Grunwald 15 years ago
parent
commit
6885af6437
  1. 25
      ICSharpCode.Decompiler/Tests/Generics.cs

25
ICSharpCode.Decompiler/Tests/Generics.cs

@ -35,6 +35,31 @@ public static class Generics @@ -35,6 +35,31 @@ public static class Generics
}
}
public interface IInterface
{
void Method1<T>() where T : class;
void Method2<T>() where T : class;
}
public abstract class Base : Generics.IInterface
{
// constraints must be repeated on implicit interface implementation
public abstract void Method1<T>() where T : class;
// constraints must not be specified on explicit interface implementation
void Generics.IInterface.Method2<T>()
{
}
}
public class Derived : Generics.Base
{
// constraints are inherited automatically and must not be specified
public override void Method1<T>()
{
}
}
public static void MethodWithConstraint<T, S>() where T : class, S where S : ICloneable, new()
{
}

Loading…
Cancel
Save