2002-11-19 Miguel de Icaza <miguel@ximian.com>
+ * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
+ handling for enumerations, as we only needed the TypeContainer
+ functionality to begin with (this is required for the fix below to
+ work for enums that reference constants in a container class for
+ example).
+
+ * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
+
+ * enum.cs (Enum.Define): Use `this' instead of parent, so we have
+ a valid TypeBuilder to perform lookups on.o
+
+ * class.cs (InheritableMemberSignatureCompare): Use true in the
+ call to GetGetMethod and GetSetMethod, because we are comparing
+ the signature, and we need to get the methods *even* if they are
+ private.
+
+ (PropertyBase.CheckBase): ditto.
+
* statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
GotoCase.Resolve): Use Peel on EmpytCasts.
parent_property.Name;
MethodInfo get, set, parent_method;
- get = parent_property.GetGetMethod ();
- set = parent_property.GetSetMethod ();
+ get = parent_property.GetGetMethod (true);
+ set = parent_property.GetSetMethod (true);
if (get != null)
parent_method = get;
PropertyInfo pi = m as PropertyInfo;
if (pi != null) {
- mi = pi.GetGetMethod ();
+ mi = pi.GetGetMethod (true);
if (mi == null)
- mi = pi.GetSetMethod ();
+ mi = pi.GetSetMethod (true);
} else
mi = m as MethodInfo;
+ if (mi == null){
+ Console.WriteLine ("Nothing found");
+ }
+
MethodAttributes prot = mi.Attributes & MethodAttributes.MemberAccessMask;
// If only accessible to the current class.
/// </summary>
public class EmitContext {
public DeclSpace DeclSpace;
- public TypeContainer TypeContainer;
+ public DeclSpace TypeContainer;
public ILGenerator ig;
/// <summary>
protected Stack FlowStack;
- public EmitContext (TypeContainer parent, DeclSpace ds, Location l, ILGenerator ig,
+ public EmitContext (DeclSpace parent, DeclSpace ds, Location l, ILGenerator ig,
Type return_type, int code_flags, bool is_constructor)
{
this.ig = ig;
// Stage 2: Lookup members
//
- //
- // For enums, the TypeBuilder is not ec.DeclSpace.TypeBuilder
- // Hence we have two different cases
- //
-
DeclSpace lookup_ds = ec.DeclSpace;
do {
if (lookup_ds.TypeBuilder == null)
if (e != null)
break;
- //
- // Classes/structs keep looking, enums break
- //
- if (lookup_ds is TypeContainer)
- lookup_ds = ((TypeContainer) lookup_ds).Parent;
- else
- break;
+ lookup_ds =lookup_ds.Parent;
} while (lookup_ds != null);
if (e == null && ec.ContainerType != null)
if (TypeBuilder == null)
return false;
- EmitContext ec = new EmitContext (parent, this, Location, null,
+ EmitContext ec = new EmitContext (this, this, Location, null,
UnderlyingType, ModFlags, false);
+
object default_value = 0;