[interp] Remove unreachable code (#12411)
[mono-project.git] / mono / tests / base-definition.cs
blob770cce3d0a332bebe326f88d7a34ab031f64e041
1 using System;
2 using System.Reflection;
4 abstract class test
6 public static int Main ()
8 MethodInfo m = typeof (SubTestClass).GetMethod ("get_name");
9 MethodInfo bm = m.GetBaseDefinition ();
10 if (bm == null || bm.DeclaringType != typeof (TestClass) || bm.Name != "get_name") return 1;
12 m = typeof (SubTestClass).GetMethod ("get_name2");
13 bm = m.GetBaseDefinition ();
14 if (bm == null || bm.DeclaringType != typeof (TestClass) || bm.Name != "get_name2") return 2;
16 m = typeof (SubTestClass).GetMethod ("get_name3");
17 bm = m.GetBaseDefinition ();
18 if (bm == null || bm.DeclaringType != typeof (BaseTestClass) || bm.Name != "get_name3") return 3;
20 return 0;
24 abstract class BaseTestClass
26 public abstract string name3
28 get;
33 abstract class TestClass : BaseTestClass
35 public abstract string name
37 get;
40 public virtual string name2
42 get { return null; }
46 class SubTestClass : TestClass
48 public override string name
50 get { return ""; }
53 public override string name2
55 get { return ""; }
58 public override string name3
60 get { return ""; }