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

44 lines
982 B
C#

using System;
using System.Reflection;
namespace NewslotVirtualFinal
{
internal interface INewslotVirtualFinal
{
void SomeMethod();
void SomeMethod2();
}
internal class NewslotVirtualFinal : INewslotVirtualFinal
{
private NewslotVirtualFinal()
{
}
public void SomeMethod()
{
}
public virtual void SomeMethod2()
{
}
}
class C
{
public static int Main ()
{
Type t = typeof (NewslotVirtualFinal);
MethodInfo mi = t.GetMethod ("SomeMethod");
if (mi.Attributes != (MethodAttributes.PrivateScope | MethodAttributes.Public | MethodAttributes.Final | MethodAttributes.Virtual | MethodAttributes.HideBySig | MethodAttributes.VtableLayoutMask))
return 1;
mi = t.GetMethod ("SomeMethod2");
if (mi.Attributes != (MethodAttributes.PrivateScope | MethodAttributes.Public | MethodAttributes.Virtual | MethodAttributes.HideBySig | MethodAttributes.VtableLayoutMask))
return 2;
Console.WriteLine ("OK");
return 0;
}
}
}