2010-04-06 Jb Evain <jbevain@novell.com>
[mcs.git] / mcs / typespec.cs
blob641e37707edcfd092597ffc06913e1c588590e55
1 //
2 // typespec.cs: Type specification
3 //
4 // Authors: Marek Safar (marek.safar@gmail.com)
5 //
6 // Dual licensed under the terms of the MIT X11 or GNU GPL
7 //
8 // Copyright 2010 Novell, Inc
9 //
11 using System;
12 using System.Collections.Generic;
14 namespace Mono.CSharp
16 public class TypeSpec : MemberSpec
18 Type info;
19 protected MemberCache cache;
21 public TypeSpec (MemberKind kind, ITypeDefinition definition, Type info, string name, Modifiers modifiers)
22 : base (kind, definition, name, modifiers)
24 this.info = info;
27 public TypeSpec BaseType { get; set; }
29 public override Type DeclaringType {
30 get { return info.DeclaringType; }
33 public Type MetaInfo {
34 get { return info; }
37 public MemberCache MemberCache {
38 get {
39 if (cache == null) {
40 // cache = new MemberCache (BaseType);
42 // ((ITypeDefinition) definition).LoadMembers (cache);
45 return cache;
50 public interface ITypeDefinition : IMemberDefinition
52 void LoadMembers (MemberCache cache);
55 class InternalType : TypeSpec
57 public static readonly TypeSpec AnonymousMethod = new InternalType ("anonymous method");
58 public static readonly TypeSpec Arglist = new InternalType ("__arglist");
59 // public static readonly TypeSpec Dynamic = new DynamicType ();
60 public static readonly TypeSpec MethodGroup = new InternalType ("method group");
62 protected InternalType (string name)
63 : base (null, null, name, Modifiers.PUBLIC)
65 // cache = MemberCache.Empty;
68 */