public TypeDeclaration(TypeContainer ns, Modifiers mods, Modifiers allowed, MemberName name, VSharpAttributes attr, Location l, TypeKind kind, CompilationSourceFile file) : base(ns, name, l, file) { if (attr != null) { this.AddAttributes(attr); } this.mod_flags = mods; this.mod_flags = ModifiersExtensions.Check(allowed, mods, ns.Name == "default" ? Modifiers.INTERNAL : Modifiers.PRIVATE, l, Report); this.Kind = kind; }
protected MemberContainer(TypeContainer parent, FullNamedExpression type, Modifiers mod, Modifiers allowed_mod, Modifiers def_mod, MemberName name, VSharpAttributes attrs, SymbolKind sym) { caching_flags = Flags.Obsolete_Undetected; this.SymbolKind = sym; this.Parent = parent; this.declaringTypeDefinition = parent; this.name = name.Name; if (parent != null) { this.UnresolvedFile = parent.UnresolvedFile; } this.type_expr = type; this.attribs = attrs; member_name = name; mod_flags = mod; mod_flags = ModifiersExtensions.Check(allowed_mod, mod, def_mod, name.Location, Report); if (DeclaringTypeDefinition.Kind == TypeKind.Interface) { mod_flags |= Modifiers.PUBLIC | Modifiers.ABSTRACT; } if (attrs != null) { foreach (var a in attrs.Attrs) { this.attributes.Add(a); } } this.returnType = type as ITypeReference; if (member_name.ExplicitInterface != null) { ApplyExplicit(null); } }