Type GenericType;
GenericTypeParameterBuilder[] gen_params;
- public TypeContainer PartialContainer;
ArrayList partial_parts;
/// <remarks>
Attributes attrs, Kind kind)
: base (ns, parent, name, attrs)
{
- // FIXME: Remove the second condition -- will require making RootContext.ToplevelTypes partial
- if (parent != null && parent != RootContext.ToplevelTypes && parent.NamespaceEntry != ns)
+ if (parent != null && parent.NamespaceEntry != ns)
throw new InternalErrorException ("A nested type should be in the same NamespaceEntry as its enclosing class");
this.Kind = kind;
this.PartialContainer = this;
}
- public bool AddToMemberContainer (MemberCore symbol)
+ public bool AddMember (MemberCore symbol)
{
return AddToContainer (symbol, symbol.MemberName.MethodName);
}
- protected virtual bool AddToTypeContainer (DeclSpace ds)
+ protected virtual bool AddMemberType (DeclSpace ds)
{
return AddToContainer (ds, ds.Basename);
}
public void AddConstant (Const constant)
{
- if (!AddToMemberContainer (constant))
+ if (!AddMember (constant))
return;
if (constants == null)
public void AddEnum (Mono.CSharp.Enum e)
{
- if (!AddToTypeContainer (e))
+ if (!AddMemberType (e))
return;
if (enums == null)
enums.Add (e);
}
-
- public bool AddClassOrStruct (TypeContainer c)
- {
- if (!AddToTypeContainer (c))
- return false;
- if (types == null)
- types = new ArrayList (2);
+ public TypeContainer AddTypeContainer (TypeContainer tc, bool is_interface)
+ {
+ if (!AddMemberType (tc))
+ return tc;
- types.Add (c);
- return true;
+ if (is_interface) {
+ if (interfaces == null)
+ interfaces = new MemberCoreArrayList ();
+ interfaces.Add (tc);
+ } else {
+ if (types == null)
+ types = new ArrayList (2);
+ types.Add (tc);
+ }
+ return tc;
}
- public virtual TypeContainer AddPartial (TypeContainer nextPart)
+ public virtual TypeContainer AddPartial (TypeContainer nextPart, bool is_interface)
{
- return AddPartial (nextPart, nextPart.Basename);
+ return AddPartial (nextPart, nextPart.Basename, is_interface);
}
- protected TypeContainer AddPartial (TypeContainer nextPart, string name)
+ protected TypeContainer AddPartial (TypeContainer nextPart, string name, bool is_interface)
{
nextPart.ModFlags |= Modifiers.PARTIAL;
TypeContainer tc = defined_names [name] as TypeContainer;
- if (tc == null) {
- if (nextPart is Interface)
- AddInterface (nextPart);
- else
- AddClassOrStruct (nextPart);
- return nextPart;
- }
+ if (tc == null)
+ return AddTypeContainer (nextPart, is_interface);
if ((tc.ModFlags & Modifiers.PARTIAL) == 0) {
Report.SymbolRelatedToPreviousError (tc);
return tc;
}
+ if (tc.MemberName.IsGeneric) {
+ TypeParameter[] tc_names = tc.TypeParameters;
+ TypeParameterName[] part_names = nextPart.MemberName.TypeArguments.GetDeclarations ();
+
+ for (int i = 0; i < tc_names.Length; ++i) {
+ if (tc_names[i].Name == part_names[i].Name)
+ continue;
+
+ Report.SymbolRelatedToPreviousError (part_names[i].Location, "");
+ Report.Error (264, tc.Location, "Partial declarations of `{0}' must have the same type parameter names in the same order",
+ tc.GetSignatureForError ());
+ return tc;
+ }
+ }
+
if (tc.partial_parts == null)
tc.partial_parts = new ArrayList (1);
public void AddDelegate (Delegate d)
{
- if (!AddToTypeContainer (d))
+ if (!AddMemberType (d))
return;
if (delegates == null)
public void AddMethod (Method method)
{
- if (!AddToMemberContainer (method))
+ if (!AddMember (method))
return;
if (methods == null)
//
public void AppendMethod (Method method)
{
- if (!AddToMemberContainer (method))
+ if (!AddMember (method))
return;
if (methods == null)
return "`{0}' is already defined. Rename this member or use different parameter types";
}
}
-
- public bool AddInterface (TypeContainer iface)
- {
- if (!AddToTypeContainer (iface))
- return false;
-
- if (interfaces == null)
- interfaces = new MemberCoreArrayList ();
-
- interfaces.Add (iface);
- return true;
- }
public void AddField (FieldMember field)
{
- if (!AddToMemberContainer (field))
+ if (!AddMember (field))
return;
if (fields == null)
public void AddProperty (Property prop)
{
- if (!AddToMemberContainer (prop) ||
- !AddToMemberContainer (prop.Get) || !AddToMemberContainer (prop.Set))
+ if (!AddMember (prop) ||
+ !AddMember (prop.Get) || !AddMember (prop.Set))
return;
if (properties == null)
public void AddEvent (Event e)
{
- if (!AddToMemberContainer (e))
+ if (!AddMember (e))
return;
if (e is EventProperty) {
- if (!AddToMemberContainer (e.Add))
+ if (!AddMember (e.Add))
return;
- if (!AddToMemberContainer (e.Remove))
+ if (!AddMember (e.Remove))
return;
}
public void AddOperator (Operator op)
{
- if (!AddToMemberContainer (op))
+ if (!AddMember (op))
return;
if (operators == null)
return base.GetClsCompliantAttributeValue ();
}
+ public void AddBasesForPart (DeclSpace part, ArrayList bases)
+ {
+ // FIXME: get rid of partial_parts and store lists of bases of each part here
+ // assumed, not verified: 'part' is in 'partial_parts'
+ ((TypeContainer) part).Bases = bases;
+ }
+
TypeExpr[] GetNormalBases (out TypeExpr base_class)
{
base_class = null;
// Let's do it as soon as possible, since code below can call DefineType() on classes
// that depend on us to be populated before they are.
//
- if (!(this is Iterator) && !(this is CompilerGeneratedClass))
+ if (!(this is CompilerGeneratedClass))
RootContext.RegisterOrder (this);
if (base_type != null) {
TypeManager.RegisterBuilder (TypeBuilder, ifaces);
}
- if (this is Iterator && !ResolveType ()) {
- return false;
- }
-
return true;
}
}
}
+ if (instance_constructors != null) {
+ foreach (Constructor c in instance_constructors) {
+ if (!c.ResolveMembers ())
+ return false;
+ }
+ }
+
+ if (default_static_constructor != null) {
+ if (!default_static_constructor.ResolveMembers ())
+ return false;
+ }
+
if (operators != null) {
foreach (Operator o in operators) {
if (!o.ResolveMembers ())
bool UpdateTypeParameterConstraints ()
{
- bool ok = true;
- TypeParameter[] current_params = PartialContainer.CurrentTypeParameters;
-
if (constraints == null)
return true;
+ TypeParameter[] current_params = PartialContainer.CurrentTypeParameters;
for (int i = 0; i < current_params.Length; i++) {
if (!current_params [i].UpdateConstraints (this, constraints [i])) {
- Report.Error (265, Location, "Partial declarations of `{0}' have " +
- "inconsistent constraints for type parameter `{1}'.",
- MemberName.GetTypeName (), current_params [i].Name);
- ok = false;
+ Report.SymbolRelatedToPreviousError (Location, "");
+ Report.Error (265, PartialContainer.Location,
+ "Partial declarations of `{0}' have inconsistent constraints for type parameter `{1}'",
+ PartialContainer.GetSignatureForError (), current_params [i].Name);
+ return false;
}
}
- return ok;
+ return true;
}
public bool ResolveType ()
}
}
+ if (!IsTopLevel && !Parent.PartialContainer.CheckRecursiveDefinition (this))
+ return false;
+
InTransit = null;
return true;
}
}
if (!IsTopLevel) {
- MemberInfo conflict_symbol = Parent.MemberCache.FindMemberWithSameName (Basename, false, TypeBuilder);
+ MemberInfo conflict_symbol = Parent.PartialContainer.FindBaseMemberWithSameName (Basename, false);
if (conflict_symbol == null) {
if ((RootContext.WarningLevel >= 4) && ((ModFlags & Modifiers.NEW) != 0))
Report.Warning (109, 4, Location, "The member `{0}' does not hide an inherited member. The new keyword is not required", GetSignatureForError ());
public MemberInfo FindBaseMemberWithSameName (string name, bool ignore_methods)
{
- return BaseCache.FindMemberWithSameName (name, ignore_methods, null);
+ return BaseCache == null ? null : BaseCache.FindMemberWithSameName (name, ignore_methods, null);
}
/// <summary>
// Indicated whether container has StructLayout attribute set Explicit
public bool HasExplicitLayout {
- get {
- return (caching_flags & Flags.HasExplicitLayout) != 0;
- }
- set {
- caching_flags |= Flags.HasExplicitLayout;
- }
+ get { return (caching_flags & Flags.HasExplicitLayout) != 0; }
+ set { caching_flags |= Flags.HasExplicitLayout; }
}
- public override Type FindNestedType (string name)
+ //
+ // Return the nested type with name @name. Ensures that the nested type
+ // is defined if necessary. Do _not_ use this when you have a MemberCache handy.
+ //
+ public Type FindNestedType (string name)
{
if (PartialContainer != this)
- return PartialContainer.FindNestedType (name);
+ throw new InternalErrorException ("should not happen");
ArrayList [] lists = { types, enums, delegates, interfaces };
return true;
// Is null for System.Object while compiling corlib and base interfaces
- if (ParentContainer.BaseCache == null) {
+ if (Parent.PartialContainer.BaseCache == null) {
if ((RootContext.WarningLevel >= 4) && ((ModFlags & Modifiers.NEW) != 0)) {
Report.Warning (109, 4, Location, "The member `{0}' does not hide an inherited member. The new keyword is not required", GetSignatureForError ());
}
}
if (Name == "Equals" && Parameters.Count == 1 && ParameterTypes [0] == TypeManager.object_type)
- ParentContainer.Mark_HasEquals ();
+ Parent.PartialContainer.Mark_HasEquals ();
else if (Name == "GetHashCode" && Parameters.Empty)
- ParentContainer.Mark_HasGetHashCode ();
+ Parent.PartialContainer.Mark_HasGetHashCode ();
if ((ModFlags & Modifiers.OVERRIDE) != 0) {
ObsoleteAttribute oa = AttributeTester.GetMethodObsoleteAttribute (base_method);
return true;
}
- MemberInfo conflict_symbol = ParentContainer.FindBaseMemberWithSameName (Name, !(this is Property));
+ MemberInfo conflict_symbol = Parent.PartialContainer.FindBaseMemberWithSameName (Name, !(this is Property));
if ((ModFlags & Modifiers.OVERRIDE) != 0) {
if (conflict_symbol != null) {
Report.SymbolRelatedToPreviousError (conflict_symbol);
public bool CheckAbstractAndExtern (bool has_block)
{
- if (ParentContainer.Kind == Kind.Interface)
+ if (Parent.PartialContainer.Kind == Kind.Interface)
return true;
if (has_block) {
foreach (Type partype in parameters){
if (partype == TypeManager.void_type) {
- Report.Error (
- 1547, Location, "Keyword 'void' cannot " +
- "be used in this context");
+ // TODO: location is wrong
+ Expression.Error_VoidInvalidInTheContext (Location);
return false;
}
MethodBuilder = Parent.TypeBuilder.DefineMethod (method_name, flags);
- if (!GenericMethod.Define (MethodBuilder))
+ if (!GenericMethod.Define (MethodBuilder, block))
return false;
}
if ((ModFlags & Modifiers.METHOD_YIELDS) != 0) {
iterator = Iterator.CreateIterator (
- this, ParentContainer, GenericMethod, ModFlags);
+ this, Parent.PartialContainer, GenericMethod, ModFlags);
if (iterator == null)
return false;
MethodData = new MethodData (
this, ModFlags, flags, this, MethodBuilder, GenericMethod, base_method);
- if (!MethodData.Define (ParentContainer))
+ if (!MethodData.Define (Parent.PartialContainer))
return false;
MethodBuilder = MethodData.MethodBuilder;
CodeGen.FileName, TypeManager.CSharpSignature(b));
}
- bool IsEntryPoint (MethodBuilder b, Parameters pinfo)
- {
- if (b.ReturnType != TypeManager.void_type &&
- b.ReturnType != TypeManager.int32_type)
- return false;
+ bool IsEntryPoint (Parameters pinfo)
+ {
+ if (ReturnType != TypeManager.void_type &&
+ ReturnType != TypeManager.int32_type)
+ return false;
- if (pinfo.Count == 0)
- return true;
+ if (pinfo.Count == 0)
+ return true;
- if (pinfo.Count > 1)
- return false;
+ if (pinfo.Count > 1)
+ return false;
- Type t = pinfo.ParameterType(0);
- if (t.IsArray &&
- (t.GetArrayRank() == 1) &&
- (TypeManager.GetElementType(t) == TypeManager.string_type) &&
- (pinfo.ParameterModifier(0) == Parameter.Modifier.NONE))
- return true;
- else
- return false;
- }
+ Type t = pinfo.ParameterType (0);
+ if (t.IsArray &&
+ (t.GetArrayRank () == 1) &&
+ (TypeManager.GetElementType (t) == TypeManager.string_type) &&
+ (pinfo.ParameterModifier (0) == Parameter.Modifier.NONE))
+ return true;
+ else
+ return false;
+ }
public override void ApplyAttributeBuilder (Attribute a, CustomAttributeBuilder cb)
{
protected override bool CheckForDuplications ()
{
- ArrayList ar = ParentContainer.Methods;
+ ArrayList ar = Parent.PartialContainer.Methods;
if (ar != null) {
int arLen = ar.Count;
}
}
- ar = ParentContainer.Properties;
+ ar = Parent.PartialContainer.Properties;
if (ar != null) {
for (int i = 0; i < ar.Count; ++i) {
PropertyBase pb = (PropertyBase) ar [i];
}
}
- ar = ParentContainer.Indexers;
+ ar = Parent.PartialContainer.Indexers;
if (ar != null) {
for (int i = 0; i < ar.Count; ++i) {
PropertyBase pb = (PropertyBase) ar [i];
}
}
- ar = ParentContainer.Events;
+ ar = Parent.PartialContainer.Events;
if (ar != null) {
for (int i = 0; i < ar.Count; ++i) {
Event ev = (Event) ar [i];
//
// This is used to track the Entry Point,
//
- if (Name == "Main" &&
- ((ModFlags & Modifiers.STATIC) != 0) && RootContext.NeedsEntryPoint &&
+ if (RootContext.NeedsEntryPoint && ((ModFlags & Modifiers.STATIC) != 0) &&
+ Name == "Main" &&
(RootContext.MainClass == null ||
RootContext.MainClass == Parent.TypeBuilder.FullName)){
- if (IsEntryPoint (MethodBuilder, ParameterInfo)) {
- IMethodData md = TypeManager.GetMethod (MethodBuilder);
- md.SetMemberIsUsed ();
+ if (IsEntryPoint (ParameterInfo)) {
if (RootContext.EntryPoint == null) {
- if (Parent.IsGeneric){
- Report.Error (-201, Location,
- "Entry point can not be defined in a generic class");
- }
+ if (Parent.IsGeneric || MemberName.IsGeneric) {
+ Report.Warning (402, 4, Location, "`{0}': an entry point cannot be generic or in a generic type",
+ GetSignatureForError ());
+ } else {
+ IMethodData md = TypeManager.GetMethod (MethodBuilder);
+ md.SetMemberIsUsed ();
- RootContext.EntryPoint = MethodBuilder;
- RootContext.EntryPointLocation = Location;
+ RootContext.EntryPoint = MethodBuilder;
+ RootContext.EntryPointLocation = Location;
+ }
} else {
Error_DuplicateEntryPoint (RootContext.EntryPoint, RootContext.EntryPointLocation);
Error_DuplicateEntryPoint (MethodBuilder, Location);
}
} else {
- if (RootContext.WarningLevel >= 4)
- Report.Warning (28, 4, Location, "`{0}' has the wrong signature to be an entry point", TypeManager.CSharpSignature(MethodBuilder));
+ Report.Warning (28, 4, Location, "`{0}' has the wrong signature to be an entry point",
+ GetSignatureForError ());
}
}
protected override MethodInfo FindOutBaseMethod (ref Type base_ret_type)
{
- MethodInfo mi = (MethodInfo) ParentContainer.BaseCache.FindMemberToOverride (
+ MethodInfo mi = (MethodInfo) Parent.PartialContainer.BaseCache.FindMemberToOverride (
Parent.TypeBuilder, Name, ParameterTypes, GenericMethod, false);
if (mi == null)
return false;
if (ParameterInfo.Count > 0) {
- ArrayList al = (ArrayList)ParentContainer.MemberCache.Members [Name];
+ ArrayList al = (ArrayList)Parent.PartialContainer.MemberCache.Members [Name];
if (al.Count > 1)
MemberCache.VerifyClsParameterConflict (al, this, MethodBuilder);
}
}
}
- public class Constructor : MethodCore, IMethodData {
+ public class Constructor : MethodCore, IMethodData, IAnonymousHost {
public ConstructorBuilder ConstructorBuilder;
public ConstructorInitializer Initializer;
ListDictionary declarative_security;
+ ArrayList anonymous_methods;
// <summary>
// Modifiers allowed for a constructor.
ConstructorBuilder.SetCustomAttribute (cb);
}
+ public void AddAnonymousMethod (AnonymousMethodExpression anonymous)
+ {
+ if (anonymous_methods == null)
+ anonymous_methods = new ArrayList ();
+ anonymous_methods.Add (anonymous);
+ }
+
+ public bool ResolveMembers ()
+ {
+ if (anonymous_methods != null) {
+ foreach (AnonymousMethodExpression ame in anonymous_methods) {
+ if (!ame.CreateAnonymousHelpers ())
+ return false;
+ }
+ }
+
+ return true;
+ }
+
protected override bool CheckForDuplications ()
{
- ArrayList ar = ParentContainer.InstanceConstructors;
+ ArrayList ar = Parent.PartialContainer.InstanceConstructors;
if (ar != null) {
int arLen = ar.Count;
if (!CheckForDuplications ())
return false;
- if (ParentContainer.Kind == Kind.Struct) {
+ if (Parent.PartialContainer.Kind == Kind.Struct) {
if (ParameterTypes.Length == 0) {
Report.Error (568, Location,
"Structs cannot contain explicit parameterless constructors");
if ((ModFlags & Modifiers.UNSAFE) != 0)
ConstructorBuilder.InitLocals = false;
- if (ParentContainer.IsComImport) {
+ if (Parent.PartialContainer.IsComImport) {
if (!IsDefault ()) {
Report.Error (669, Location, "`{0}': A class with the ComImport attribute cannot have a user-defined constructor",
Parent.GetSignatureForError ());
if (block != null) {
// If this is a non-static `struct' constructor and doesn't have any
// initializer, it must initialize all of the struct's fields.
- if ((ParentContainer.Kind == Kind.Struct) &&
- ((ModFlags & Modifiers.STATIC) == 0) && (Initializer == null))
+ if ((Parent.PartialContainer.Kind == Kind.Struct) &&
+ ((ModFlags & Modifiers.STATIC) == 0) && (Initializer == null))
block.AddThisVariable (Parent, Location);
if (!block.ResolveMeta (ec, ParameterInfo))
}
if ((ModFlags & Modifiers.STATIC) == 0){
- if (ParentContainer.Kind == Kind.Class && Initializer == null)
+ if (Parent.PartialContainer.Kind == Kind.Class && Initializer == null)
Initializer = new GeneratedBaseInitializer (Location);
//
// Classes can have base initializers and instance field initializers.
//
- if (ParentContainer.Kind == Kind.Class){
+ if (Parent.PartialContainer.Kind == Kind.Class){
if ((ModFlags & Modifiers.STATIC) == 0){
//
// do not emit field initializers, they are initialized in the other constructor
//
if (!(Initializer != null && Initializer is ConstructorThisInitializer))
- ParentContainer.EmitFieldInitializers (ec);
+ Parent.PartialContainer.EmitFieldInitializers (ec);
}
}
}
if ((ModFlags & Modifiers.STATIC) != 0)
- ParentContainer.EmitFieldInitializers (ec);
+ Parent.PartialContainer.EmitFieldInitializers (ec);
if (block != null)
ec.EmitResolvedTopBlock (block, unreachable);
get {
CallingConventions cc = Parameters.CallingConvention;
- if (ParentContainer.Kind == Kind.Class)
+ if (Parent.PartialContainer.Kind == Kind.Class)
if ((ModFlags & Modifiers.STATIC) == 0)
cc |= CallingConventions.HasThis;
string name = method.MethodName.Basename;
string method_name = method.MethodName.FullName;
- TypeContainer container = ((TypeContainer) parent).PartialContainer;
+ TypeContainer container = parent.PartialContainer;
PendingImplementation pending = container.PendingImplementations;
if (pending != null){
SourceMethod source = SourceMethod.Create (parent, MethodBuilder, method.Block);
- Report.Debug (64, "METHOD DATA EMIT", this, MethodBuilder,
- method, method.Iterator, block);
-
-#if FIXME
- if (method.Iterator != null) {
- if (!method.Iterator.Resolve (ec))
- throw new InternalErrorException ();
- // method.Iterator.EmitMethod (ec);
- }
-#endif
-
- Report.Debug (64, "METHOD DATA EMIT #1", this, MethodBuilder,
- method, method.Iterator, block);
-
//
// Handle destructors specially
//
set { SetMemberName (new MemberName (MemberName.Left, value, Location)); }
}
- public TypeContainer ParentContainer {
- get { return ((TypeContainer) Parent).PartialContainer; }
- }
-
//
// The type of this property / indexer / event
//
protected virtual bool CheckBase ()
{
- if ((ModFlags & Modifiers.PROTECTED) != 0 && ParentContainer.Kind == Kind.Struct) {
+ if ((ModFlags & Modifiers.PROTECTED) != 0 && Parent.PartialContainer.Kind == Kind.Struct) {
Report.Error (666, Location, "`{0}': new protected member declared in struct", GetSignatureForError ());
return false;
}
MethodAttributes.NewSlot |
MethodAttributes.Virtual;
} else {
- if (!ParentContainer.MethodModifiersValid (this))
+ if (!Parent.PartialContainer.MethodModifiersValid (this))
return false;
flags = Modifiers.MethodAttr (ModFlags);
return false;
}
- if (!ParentContainer.VerifyImplements (this))
+ if (!Parent.PartialContainer.VerifyImplements (this))
return false;
Modifiers.Check (Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location);
return false;
}
- if (!ParentContainer.VerifyImplements (this))
+ if (!Parent.PartialContainer.VerifyImplements (this))
return false;
Modifiers.Check (Modifiers.AllowedExplicitImplFlags, explicit_mod_flags, 0, Location);
if (IsInterface)
return true;
- conflict_symbol = ParentContainer.FindBaseMemberWithSameName (Name, false);
+ conflict_symbol = Parent.PartialContainer.FindBaseMemberWithSameName (Name, false);
if (conflict_symbol == null) {
if ((RootContext.WarningLevel >= 4) && ((ModFlags & Modifiers.NEW) != 0)) {
Report.Warning (109, 4, Location, "The member `{0}' does not hide an inherited member. The new keyword is not required", GetSignatureForError ());
set {
if (value != null) {
this.initializer = value;
- ParentContainer.RegisterFieldForInitialization (this);
+ Parent.PartialContainer.RegisterFieldForInitialization (this);
}
}
}
{
status |= Status.HAS_OFFSET;
- if (!ParentContainer.HasExplicitLayout) {
+ if (!Parent.PartialContainer.HasExplicitLayout) {
Report.Error (636, Location, "The FieldOffset attribute can only be placed on members of types marked with the StructLayout(LayoutKind.Explicit)");
return;
}
return false;
if (MemberType == TypeManager.void_type) {
- Report.Error (1547, Location, "Keyword 'void' cannot be used in this context");
+ // TODO: wrong location
+ Expression.Error_VoidInvalidInTheContext (Location);
return false;
}
OptAttributes.Emit ();
}
- if (((status & Status.HAS_OFFSET) == 0) && (ModFlags & Modifiers.STATIC) == 0 && ParentContainer.HasExplicitLayout) {
+ if (((status & Status.HAS_OFFSET) == 0) && (ModFlags & Modifiers.STATIC) == 0 && Parent.PartialContainer.HasExplicitLayout) {
Report.Error (625, Location, "`{0}': Instance field types marked with StructLayout(LayoutKind.Explicit) must have a FieldOffset attribute.", GetSignatureForError ());
}
Report.Warning (-23, 1, Location, "Only private or internal fixed sized buffers are supported by .NET 1.x");
#endif
- if (ParentContainer.Kind != Kind.Struct) {
+ if (Parent.PartialContainer.Kind != Kind.Struct) {
Report.Error (1642, Location, "`{0}': Fixed size buffer fields may only be members of structs",
GetSignatureForError ());
return false;
FieldAttributes fa = Modifiers.FieldAttr (ModFlags);
- if (ParentContainer.Kind == Kind.Struct &&
+ if (Parent.PartialContainer.Kind == Kind.Struct &&
((fa & FieldAttributes.Static) == 0) &&
MemberType == Parent.TypeBuilder &&
!TypeManager.IsBuiltinType (MemberType)){
if (!method.CheckAbstractAndExtern (block != null))
return null;
- TypeContainer container = ((TypeContainer) parent).PartialContainer;
+ TypeContainer container = parent.PartialContainer;
//
// Check for custom access modifier
protected override bool CheckForDuplications ()
{
- ArrayList ar = ParentContainer.Indexers;
+ ArrayList ar = Parent.PartialContainer.Indexers;
if (ar != null) {
int arLen = ar.Count;
}
}
- ar = ParentContainer.Properties;
+ ar = Parent.PartialContainer.Properties;
if (ar != null) {
int arLen = ar.Count;
// TODO: rename to Resolve......
protected override MethodInfo FindOutBaseMethod (ref Type base_ret_type)
{
- PropertyInfo base_property = ParentContainer.BaseCache.FindMemberToOverride (
+ PropertyInfo base_property = Parent.PartialContainer.BaseCache.FindMemberToOverride (
Parent.TypeBuilder, Name, ParameterTypes, null, true) as PropertyInfo;
if (base_property == null)
ShortName = base_IndexerName;
}
- if (!ParentContainer.AddToMemberContainer (this) ||
- !ParentContainer.AddToMemberContainer (Get) || !ParentContainer.AddToMemberContainer (Set))
+ if (!Parent.PartialContainer.AddMember (this) ||
+ !Parent.PartialContainer.AddMember (Get) || !Parent.PartialContainer.AddMember (Set))
return false;
if (!CheckBase ())
protected override bool CheckForDuplications ()
{
- ArrayList ar = ParentContainer.Operators;
+ ArrayList ar = Parent.PartialContainer.Operators;
if (ar != null) {
int arLen = ar.Count;
}
}
- ar = ParentContainer.Methods;
+ ar = Parent.PartialContainer.Methods;
if (ar != null) {
int arLen = ar.Count;