a575963da9
Former-commit-id: da6be194a6b1221998fc28233f2503bd61dd9d14
34 lines
538 B
C#
34 lines
538 B
C#
using System;
|
|
using System.Reflection;
|
|
|
|
public class TestAttribute : Attribute
|
|
{
|
|
public Type type;
|
|
|
|
public TestAttribute(Type type)
|
|
{
|
|
this.type = type;
|
|
}
|
|
}
|
|
|
|
class C<T>
|
|
{
|
|
[Test(typeof(C<string>))]
|
|
public static void Foo()
|
|
{
|
|
}
|
|
}
|
|
|
|
public class C
|
|
{
|
|
public static int Main ()
|
|
{
|
|
MethodInfo mi = typeof (C<>).GetMethod ("Foo");
|
|
object[] a = mi.GetCustomAttributes (false);
|
|
if (((TestAttribute)a[0]).type.ToString() != "C`1[System.String]")
|
|
return 1;
|
|
|
|
Console.WriteLine("OK");
|
|
return 0;
|
|
}
|
|
} |