tp.Type.TypeArguments = base_tparam.TypeArguments;
// TODO MemberCache: Inflate with different MVAR ?
- tp.Type.Interfaces = base_tparam.Interfaces;
+ if (base_tparam.InterfacesDefined != null)
+ tp.Type.Interfaces = new List<TypeSpec> (base_tparam.InterfacesDefined);
+
tp.Type.BaseType = base_tparam.BaseType;
} else if (MethodData.implementing != null) {
var base_tp = MethodData.implementing.Constraints[i];
if ((modifiers & Modifiers.OVERRIDE) == 0)
flags |= MethodAttributes.NewSlot;
}
- flags |=
- MethodAttributes.Virtual |
- MethodAttributes.HideBySig;
+
+ flags |= MethodAttributes.Virtual | MethodAttributes.HideBySig;
// Set Final unless we're virtual, abstract or already overriding a method.
if ((modifiers & (Modifiers.VIRTUAL | Modifiers.ABSTRACT | Modifiers.OVERRIDE)) == 0)
flags |= MethodAttributes.Final;
+
+ //
+ // clear the pending implementation flag (requires explicit methods to be defined first)
+ //
+ parent.PartialContainer.PendingImplementations.ImplementMethod (method.MethodName,
+ member.InterfaceType, this, member.IsExplicitImpl);
+
+ //
+ // Update indexer accessor name to match implementing abstract accessor
+ //
+ if (!implementing.DeclaringType.IsInterface && !member.IsExplicitImpl && implementing.IsAccessor)
+ method_full_name = implementing.MemberDefinition.Name;
}
DefineMethodBuilder (container, method_full_name, method.ParameterInfo);
method.ParameterInfo.ApplyAttributes (MethodBuilder);
- //
- // clear the pending implementation flag
- //
- if (implementing != null)
- parent.PartialContainer.PendingImplementations.ImplementMethod (method.MethodName,
- member.InterfaceType, this, member.IsExplicitImpl);
-
SourceMethod source = SourceMethod.Create (parent, MethodBuilder, method.Block);
ToplevelBlock block = method.Block;
protected override bool CheckBase ()
{
- if (!base.CheckBase ())
- return false;
+ // Don't check base, the destructor has special syntax
var base_type = Parent.PartialContainer.BaseType;
if (base_type == null)
if (method_expr == null)
throw new NotImplementedException ();
- method_expr.IsBase = true;
+ method_expr.QueriedBaseType = base_type;
method_expr.InstanceExpression = new CompilerGeneratedThis (Parent.Definition, Location);
ToplevelBlock new_block = new ToplevelBlock (Compiler, Block.StartLocation);