~ubuntu-branches/ubuntu/oneiric/monodevelop/oneiric

« back to all changes in this revision

Viewing changes to src/addins/CSharpBinding/MonoDevelop.CSharp.Parser/mcs/roottypes.cs

  • Committer: Bazaar Package Importer
  • Author(s): Jo Shields
  • Date: 2011-06-27 17:03:13 UTC
  • mto: (1.8.1 upstream)
  • mto: This revision was merged to the branch mainline in revision 54.
  • Revision ID: james.westby@ubuntu.com-20110627170313-6cvz3s19x6e9hqe9
ImportĀ upstreamĀ versionĀ 2.5.92+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
//
 
2
// roottypes.cs: keeps a tree representation of the generated code
 
3
//
 
4
// Authors: Miguel de Icaza (miguel@gnu.org)
 
5
//          Marek Safar  (marek.safar@gmail.com)
 
6
//
 
7
// Dual licensed under the terms of the MIT X11 or GNU GPL
 
8
//
 
9
// Copyright 2001-2003 Ximian, Inc (http://www.ximian.com)
 
10
// Copyright 2003-2008 Novell, Inc.
 
11
//
 
12
 
 
13
using System;
 
14
using System.Collections.Generic;
 
15
using System.Runtime.InteropServices;
 
16
using Mono.CompilerServices.SymbolWriter;
 
17
 
 
18
#if STATIC
 
19
using IKVM.Reflection;
 
20
using IKVM.Reflection.Emit;
 
21
#else
 
22
using System.Reflection;
 
23
using System.Reflection.Emit;
 
24
#endif
 
25
 
 
26
namespace Mono.CSharp
 
27
{
 
28
        //
 
29
        // Module (top-level type) container
 
30
        //
 
31
        public sealed class ModuleContainer : TypeContainer
 
32
        {
 
33
#if STATIC
 
34
                //
 
35
                // Compiler generated container for static data
 
36
                //
 
37
                sealed class StaticDataContainer : CompilerGeneratedClass
 
38
                {
 
39
                        readonly Dictionary<int, Struct> size_types;
 
40
                        new int fields;
 
41
 
 
42
                        public StaticDataContainer (ModuleContainer module)
 
43
                                : base (module, new MemberName ("<PrivateImplementationDetails>" + module.builder.ModuleVersionId.ToString ("B"), Location.Null), Modifiers.STATIC)
 
44
                        {
 
45
                                size_types = new Dictionary<int, Struct> ();
 
46
                        }
 
47
 
 
48
                        public override void CloseType ()
 
49
                        {
 
50
                                base.CloseType ();
 
51
 
 
52
                                foreach (var entry in size_types) {
 
53
                                        entry.Value.CloseType ();
 
54
                                }
 
55
                        }
 
56
 
 
57
                        public FieldSpec DefineInitializedData (byte[] data, Location loc)
 
58
                        {
 
59
                                Struct size_type;
 
60
                                if (!size_types.TryGetValue (data.Length, out size_type)) {
 
61
                                        //
 
62
                                        // Build common type for this data length. We cannot use
 
63
                                        // DefineInitializedData because it creates public type,
 
64
                                        // and its name is not unique among modules
 
65
                                        //
 
66
                                        size_type = new Struct (null, this, new MemberName ("$ArrayType=" + data.Length, Location), Modifiers.PRIVATE | Modifiers.COMPILER_GENERATED, null);
 
67
                                        size_type.CreateType ();
 
68
                                        size_type.DefineType ();
 
69
 
 
70
                                        size_types.Add (data.Length, size_type);
 
71
                                        var ctor = Module.PredefinedMembers.StructLayoutAttributeCtor.Resolve (Location);
 
72
                                        if (ctor != null) {
 
73
                                                var argsEncoded = new AttributeEncoder ();
 
74
                                                argsEncoded.Encode ((short) LayoutKind.Explicit);
 
75
 
 
76
                                                var field_size = Module.PredefinedMembers.StructLayoutSize.Resolve (Location);
 
77
                                                var pack = Module.PredefinedMembers.StructLayoutPack.Resolve (Location);
 
78
                                                if (field_size != null && pack != null) {
 
79
                                                        argsEncoded.EncodeNamedArguments (
 
80
                                                                new[] { field_size, pack },
 
81
                                                                new[] { new IntConstant (Compiler.BuiltinTypes, (int) data.Length, Location), new IntConstant (Compiler.BuiltinTypes, 1, Location) }
 
82
                                                        );
 
83
 
 
84
                                                        size_type.TypeBuilder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), argsEncoded.ToArray ());
 
85
                                                }
 
86
                                        }
 
87
                                }
 
88
 
 
89
                                var name = "$field-" + fields.ToString ("X");
 
90
                                ++fields;
 
91
                                const Modifiers fmod = Modifiers.STATIC | Modifiers.INTERNAL;
 
92
                                var fbuilder = TypeBuilder.DefineField (name, size_type.CurrentType.GetMetaInfo (), ModifiersExtensions.FieldAttr (fmod) | FieldAttributes.HasFieldRVA);
 
93
                                fbuilder.__SetDataAndRVA (data);
 
94
 
 
95
                                return new FieldSpec (CurrentType, null, size_type.CurrentType, fbuilder, fmod);
 
96
                        }
 
97
                }
 
98
 
 
99
                StaticDataContainer static_data;
 
100
 
 
101
                //
 
102
                // Makes const data field inside internal type container
 
103
                //
 
104
                public FieldSpec MakeStaticData (byte[] data, Location loc)
 
105
                {
 
106
                        if (static_data == null) {
 
107
                                static_data = new StaticDataContainer (this);
 
108
                                static_data.CreateType ();
 
109
                                static_data.DefineType ();
 
110
 
 
111
                                AddCompilerGeneratedClass (static_data);
 
112
                        }
 
113
 
 
114
                        return static_data.DefineInitializedData (data, loc);
 
115
                }
 
116
#endif
 
117
 
 
118
                public CharSet? DefaultCharSet;
 
119
                public TypeAttributes DefaultCharSetType = TypeAttributes.AnsiClass;
 
120
 
 
121
                readonly Dictionary<int, List<AnonymousTypeClass>> anonymous_types;
 
122
                readonly Dictionary<ArrayContainer.TypeRankPair, ArrayContainer> array_types;
 
123
                readonly Dictionary<TypeSpec, PointerContainer> pointer_types;
 
124
                readonly Dictionary<TypeSpec, ReferenceContainer> reference_types;
 
125
                readonly Dictionary<TypeSpec, MethodSpec> attrs_cache;
 
126
 
 
127
                // Used for unique namespaces/types during parsing
 
128
                Dictionary<MemberName, ITypesContainer> defined_type_containers;
 
129
 
 
130
                AssemblyDefinition assembly;
 
131
                readonly CompilerContext context;
 
132
                readonly RootNamespace global_ns;
 
133
                readonly Dictionary<string, RootNamespace> alias_ns;
 
134
 
 
135
                ModuleBuilder builder;
 
136
 
 
137
                bool has_extenstion_method;
 
138
 
 
139
                PredefinedAttributes predefined_attributes;
 
140
                PredefinedTypes predefined_types;
 
141
                PredefinedMembers predefined_members;
 
142
 
 
143
                static readonly string[] attribute_targets = new string[] { "assembly", "module" };
 
144
 
 
145
                public ModuleContainer (CompilerContext context)
 
146
                        : base (null, null, MemberName.Null, null, 0)
 
147
                {
 
148
                        this.context = context;
 
149
 
 
150
                        caching_flags &= ~(Flags.Obsolete_Undetected | Flags.Excluded_Undetected);
 
151
 
 
152
                        types = new List<TypeContainer> ();
 
153
                        anonymous_types = new Dictionary<int, List<AnonymousTypeClass>> ();
 
154
                        global_ns = new GlobalRootNamespace ();
 
155
                        alias_ns = new Dictionary<string, RootNamespace> ();
 
156
                        array_types = new Dictionary<ArrayContainer.TypeRankPair, ArrayContainer> ();
 
157
                        pointer_types = new Dictionary<TypeSpec, PointerContainer> ();
 
158
                        reference_types = new Dictionary<TypeSpec, ReferenceContainer> ();
 
159
                        attrs_cache = new Dictionary<TypeSpec, MethodSpec> ();
 
160
 
 
161
                        defined_type_containers = new Dictionary<MemberName, ITypesContainer> ();
 
162
                }
 
163
 
 
164
                #region Properties
 
165
 
 
166
                internal Dictionary<ArrayContainer.TypeRankPair, ArrayContainer> ArrayTypesCache {
 
167
                        get {
 
168
                                return array_types;
 
169
                        }
 
170
                }
 
171
 
 
172
                //
 
173
                // Cache for parameter-less attributes
 
174
                //
 
175
                internal Dictionary<TypeSpec, MethodSpec> AttributeConstructorCache {
 
176
                        get {
 
177
                                return attrs_cache;
 
178
                        }
 
179
                }
 
180
 
 
181
                public override AttributeTargets AttributeTargets {
 
182
                        get {
 
183
                                return AttributeTargets.Assembly;
 
184
                        }
 
185
                }
 
186
 
 
187
                public ModuleBuilder Builder {
 
188
                        get {
 
189
                                return builder;
 
190
                        }
 
191
                }
 
192
 
 
193
                public override CompilerContext Compiler {
 
194
                        get {
 
195
                                return context;
 
196
                        }
 
197
                }
 
198
 
 
199
                public override AssemblyDefinition DeclaringAssembly {
 
200
                        get {
 
201
                                return assembly;
 
202
                        }
 
203
                }
 
204
 
 
205
                internal DocumentationBuilder DocumentationBuilder {
 
206
                        get; set;
 
207
                }
 
208
 
 
209
                public Evaluator Evaluator {
 
210
                        get; set;
 
211
                }
 
212
 
 
213
                public bool HasDefaultCharSet {
 
214
                        get {
 
215
                                return DefaultCharSet.HasValue;
 
216
                        }
 
217
                }
 
218
 
 
219
                public bool HasExtensionMethod {
 
220
                        get {
 
221
                                return has_extenstion_method;
 
222
                        }
 
223
                        set {
 
224
                                has_extenstion_method = value;
 
225
                        }
 
226
                }
 
227
 
 
228
                public bool HasTypesFullyDefined {
 
229
                        get; set;
 
230
                }
 
231
 
 
232
                //
 
233
                // Returns module global:: namespace
 
234
                //
 
235
                public RootNamespace GlobalRootNamespace {
 
236
                    get {
 
237
                        return global_ns;
 
238
                    }
 
239
                }
 
240
 
 
241
                public override ModuleContainer Module {
 
242
                        get {
 
243
                                return this;
 
244
                        }
 
245
                }
 
246
 
 
247
                internal Dictionary<TypeSpec, PointerContainer> PointerTypesCache {
 
248
                        get {
 
249
                                return pointer_types;
 
250
                        }
 
251
                }
 
252
 
 
253
                internal PredefinedAttributes PredefinedAttributes {
 
254
                        get {
 
255
                                return predefined_attributes;
 
256
                        }
 
257
                }
 
258
 
 
259
                internal PredefinedMembers PredefinedMembers {
 
260
                        get {
 
261
                                return predefined_members;
 
262
                        }
 
263
                }
 
264
 
 
265
                internal PredefinedTypes PredefinedTypes {
 
266
                        get {
 
267
                                return predefined_types;
 
268
                        }
 
269
                }
 
270
 
 
271
                internal Dictionary<TypeSpec, ReferenceContainer> ReferenceTypesCache {
 
272
                        get {
 
273
                                return reference_types;
 
274
                        }
 
275
                }
 
276
 
 
277
                public override string[] ValidAttributeTargets {
 
278
                        get {
 
279
                                return attribute_targets;
 
280
                        }
 
281
                }
 
282
 
 
283
                #endregion
 
284
 
 
285
                public override void Accept (StructuralVisitor visitor)
 
286
                {
 
287
                        visitor.Visit (this);
 
288
                }
 
289
 
 
290
                public void AddAnonymousType (AnonymousTypeClass type)
 
291
                {
 
292
                        List<AnonymousTypeClass> existing;
 
293
                        if (!anonymous_types.TryGetValue (type.Parameters.Count, out existing))
 
294
                        if (existing == null) {
 
295
                                existing = new List<AnonymousTypeClass> ();
 
296
                                anonymous_types.Add (type.Parameters.Count, existing);
 
297
                        }
 
298
 
 
299
                        existing.Add (type);
 
300
                }
 
301
 
 
302
                public void AddAttribute (Attribute attr, IMemberContext context)
 
303
                {
 
304
                        attr.AttachTo (this, context);
 
305
 
 
306
                        if (attributes == null) {
 
307
                                attributes = new Attributes (attr);
 
308
                                return;
 
309
                        }
 
310
 
 
311
                        attributes.AddAttribute (attr);
 
312
                }
 
313
 
 
314
                public override TypeContainer AddPartial (TypeContainer nextPart)
 
315
                {
 
316
                        return AddPartial (nextPart, nextPart.Name);
 
317
                }
 
318
 
 
319
                public override void ApplyAttributeBuilder (Attribute a, MethodSpec ctor, byte[] cdata, PredefinedAttributes pa)
 
320
                {
 
321
                        if (a.Target == AttributeTargets.Assembly) {
 
322
                                assembly.ApplyAttributeBuilder (a, ctor, cdata, pa);
 
323
                                return;
 
324
                        }
 
325
 
 
326
                        if (a.Type == pa.DefaultCharset) {
 
327
                                switch (a.GetCharSetValue ()) {
 
328
                                case CharSet.Ansi:
 
329
                                case CharSet.None:
 
330
                                        break;
 
331
                                case CharSet.Auto:
 
332
                                        DefaultCharSet = CharSet.Auto;
 
333
                                        DefaultCharSetType = TypeAttributes.AutoClass;
 
334
                                        break;
 
335
                                case CharSet.Unicode:
 
336
                                        DefaultCharSet = CharSet.Unicode;
 
337
                                        DefaultCharSetType = TypeAttributes.UnicodeClass;
 
338
                                        break;
 
339
                                default:
 
340
                                        Report.Error (1724, a.Location, "Value specified for the argument to `{0}' is not valid",
 
341
                                                a.GetSignatureForError ());
 
342
                                        break;
 
343
                                }
 
344
                        } else if (a.Type == pa.CLSCompliant) {
 
345
                                Attribute cls = DeclaringAssembly.CLSCompliantAttribute;
 
346
                                if (cls == null) {
 
347
                                        Report.Warning (3012, 1, a.Location,
 
348
                                                "You must specify the CLSCompliant attribute on the assembly, not the module, to enable CLS compliance checking");
 
349
                                } else if (DeclaringAssembly.IsCLSCompliant != a.GetBoolean ()) {
 
350
                                        Report.SymbolRelatedToPreviousError (cls.Location, cls.GetSignatureForError ());
 
351
                                        Report.Warning (3017, 1, a.Location,
 
352
                                                "You cannot specify the CLSCompliant attribute on a module that differs from the CLSCompliant attribute on the assembly");
 
353
                                        return;
 
354
                                }
 
355
                        }
 
356
 
 
357
                        builder.SetCustomAttribute ((ConstructorInfo) ctor.GetMetaInfo (), cdata);
 
358
                }
 
359
 
 
360
                public override void CloseType ()
 
361
                {
 
362
                        foreach (TypeContainer tc in types) {
 
363
                                tc.CloseType ();
 
364
                        }
 
365
 
 
366
                        if (compiler_generated != null)
 
367
                                foreach (CompilerGeneratedClass c in compiler_generated)
 
368
                                        c.CloseType ();
 
369
                }
 
370
 
 
371
                public TypeBuilder CreateBuilder (string name, TypeAttributes attr, int typeSize)
 
372
                {
 
373
                        return builder.DefineType (name, attr, null, typeSize);
 
374
                }
 
375
 
 
376
                //
 
377
                // Creates alias global namespace
 
378
                //
 
379
                public RootNamespace CreateRootNamespace (string alias)
 
380
                {
 
381
                        if (alias == global_ns.Alias) {
 
382
                                NamespaceContainer.Error_GlobalNamespaceRedefined (Location.Null, Report);
 
383
                                return global_ns;
 
384
                        }
 
385
 
 
386
                        RootNamespace rn;
 
387
                        if (!alias_ns.TryGetValue (alias, out rn)) {
 
388
                                rn = new RootNamespace (alias);
 
389
                                alias_ns.Add (alias, rn);
 
390
                        }
 
391
 
 
392
                        return rn;
 
393
                }
 
394
 
 
395
                public void Create (AssemblyDefinition assembly, ModuleBuilder moduleBuilder)
 
396
                {
 
397
                        this.assembly = assembly;
 
398
                        builder = moduleBuilder;
 
399
                }
 
400
 
 
401
                public new void CreateType ()
 
402
                {
 
403
                        // Release cache used by parser only
 
404
                        if (Evaluator == null)
 
405
                                defined_type_containers = null;
 
406
                        else
 
407
                                defined_type_containers.Clear ();
 
408
 
 
409
                        foreach (TypeContainer tc in types)
 
410
                                tc.CreateType ();
 
411
                }
 
412
 
 
413
                public new void Define ()
 
414
                {
 
415
                        foreach (TypeContainer tc in types)
 
416
                                tc.DefineType ();
 
417
 
 
418
                        foreach (TypeContainer tc in types)
 
419
                                tc.ResolveTypeParameters ();
 
420
 
 
421
                        foreach (TypeContainer tc in types) {
 
422
                                try {
 
423
                                        tc.Define ();
 
424
                                } catch (Exception e) {
 
425
                                        throw new InternalErrorException (tc, e);
 
426
                                }
 
427
                        }
 
428
 
 
429
                        HasTypesFullyDefined = true;
 
430
                }
 
431
 
 
432
                public override void Emit ()
 
433
                {
 
434
                        if (OptAttributes != null)
 
435
                                OptAttributes.Emit ();
 
436
 
 
437
                        if (Compiler.Settings.Unsafe) {
 
438
                                var pa = PredefinedAttributes.UnverifiableCode;
 
439
                                if (pa.IsDefined)
 
440
                                        pa.EmitAttribute (builder);
 
441
                        }
 
442
 
 
443
                        foreach (var tc in types)
 
444
                                tc.DefineConstants ();
 
445
 
 
446
                        foreach (TypeContainer tc in types)
 
447
                                tc.EmitType ();
 
448
 
 
449
                        if (Compiler.Report.Errors > 0)
 
450
                                return;
 
451
 
 
452
                        foreach (TypeContainer tc in types)
 
453
                                tc.VerifyMembers ();
 
454
 
 
455
                        if (compiler_generated != null)
 
456
                                foreach (var c in compiler_generated)
 
457
                                        c.EmitType ();
 
458
                }
 
459
 
 
460
                internal override void GenerateDocComment (DocumentationBuilder builder)
 
461
                {
 
462
                        foreach (var tc in types)
 
463
                                tc.GenerateDocComment (builder);
 
464
                }
 
465
 
 
466
                public AnonymousTypeClass GetAnonymousType (IList<AnonymousTypeParameter> parameters)
 
467
                {
 
468
                        List<AnonymousTypeClass> candidates;
 
469
                        if (!anonymous_types.TryGetValue (parameters.Count, out candidates))
 
470
                                return null;
 
471
 
 
472
                        int i;
 
473
                        foreach (AnonymousTypeClass at in candidates) {
 
474
                                for (i = 0; i < parameters.Count; ++i) {
 
475
                                        if (!parameters [i].Equals (at.Parameters [i]))
 
476
                                                break;
 
477
                                }
 
478
 
 
479
                                if (i == parameters.Count)
 
480
                                        return at;
 
481
                        }
 
482
 
 
483
                        return null;
 
484
                }
 
485
 
 
486
                public RootNamespace GetRootNamespace (string name)
 
487
                {
 
488
                        RootNamespace rn;
 
489
                        alias_ns.TryGetValue (name, out rn);
 
490
                        return rn;
 
491
                }
 
492
 
 
493
                public override string GetSignatureForError ()
 
494
                {
 
495
                        return "<module>";
 
496
                }
 
497
 
 
498
                public void InitializePredefinedTypes ()
 
499
                {
 
500
                        predefined_attributes = new PredefinedAttributes (this);
 
501
                        predefined_types = new PredefinedTypes (this);
 
502
                        predefined_members = new PredefinedMembers (this);
 
503
                }
 
504
 
 
505
                public override bool IsClsComplianceRequired ()
 
506
                {
 
507
                        return DeclaringAssembly.IsCLSCompliant;
 
508
                }
 
509
 
 
510
                protected override bool AddMemberType (TypeContainer tc)
 
511
                {
 
512
                        if (AddTypesContainer (tc)) {
 
513
                                if ((tc.ModFlags & Modifiers.PARTIAL) != 0)
 
514
                                        defined_names.Add (tc.Name, tc);
 
515
 
 
516
                                tc.NamespaceEntry.NS.AddType (this, tc.Definition);
 
517
                                return true;
 
518
                        }
 
519
 
 
520
                        return false;
 
521
                }
 
522
 
 
523
                public bool AddTypesContainer (ITypesContainer container)
 
524
                {
 
525
                        var mn = container.MemberName;
 
526
                        ITypesContainer found;
 
527
                        if (!defined_type_containers.TryGetValue (mn, out found)) {
 
528
                                defined_type_containers.Add (mn, container);
 
529
                                return true;
 
530
                        }
 
531
 
 
532
                        if (container is NamespaceContainer && found is NamespaceContainer)
 
533
                                return true;
 
534
 
 
535
                        var container_tc = container as TypeContainer;
 
536
                        var found_tc = found as TypeContainer;
 
537
                        if (container_tc != null && found_tc != null && container_tc.Kind == found_tc.Kind) {
 
538
                                if ((found_tc.ModFlags & container_tc.ModFlags & Modifiers.PARTIAL) != 0) {
 
539
                                        return false;
 
540
                                }
 
541
 
 
542
                                if (((found_tc.ModFlags | container_tc.ModFlags) & Modifiers.PARTIAL) != 0) {
 
543
                                        Report.SymbolRelatedToPreviousError (found_tc);
 
544
                                        Error_MissingPartialModifier (container_tc);
 
545
                                        return false;
 
546
                                }
 
547
                        }
 
548
 
 
549
                        string ns = mn.Left != null ? mn.Left.GetSignatureForError () : Module.GlobalRootNamespace.GetSignatureForError ();
 
550
                        mn = new MemberName (mn.Name, mn.TypeArguments, mn.Location);
 
551
 
 
552
                        Report.SymbolRelatedToPreviousError (found.Location, "");
 
553
                        Report.Error (101, container.Location,
 
554
                                "The namespace `{0}' already contains a definition for `{1}'",
 
555
                                ns, mn.GetSignatureForError ());
 
556
                        return false;
 
557
                }
 
558
 
 
559
                protected override void RemoveMemberType (TypeContainer ds)
 
560
                {
 
561
                        defined_type_containers.Remove (ds.MemberName);
 
562
                        ds.NamespaceEntry.NS.RemoveDeclSpace (ds.Basename);
 
563
                        base.RemoveMemberType (ds);
 
564
                }
 
565
 
 
566
                public Attribute ResolveAssemblyAttribute (PredefinedAttribute a_type)
 
567
                {
 
568
                        Attribute a = OptAttributes.Search ("assembly", a_type);
 
569
                        if (a != null) {
 
570
                                a.Resolve ();
 
571
                        }
 
572
                        return a;
 
573
                }
 
574
 
 
575
                public void SetDeclaringAssembly (AssemblyDefinition assembly)
 
576
                {
 
577
                        // TODO: This setter is quite ugly but I have not found a way around it yet
 
578
                        this.assembly = assembly;
 
579
                }
 
580
        }
 
581
 
 
582
        sealed class RootDeclSpace : TypeContainer {
 
583
                public RootDeclSpace (ModuleContainer module, NamespaceContainer ns)
 
584
                        : base (ns, null, MemberName.Null, null, 0)
 
585
                {
 
586
                        PartialContainer = module;
 
587
                }
 
588
 
 
589
                public override AttributeTargets AttributeTargets {
 
590
                        get { throw new InternalErrorException ("should not be called"); }
 
591
                }
 
592
 
 
593
                public override CompilerContext Compiler {
 
594
                        get {
 
595
                                return PartialContainer.Compiler;
 
596
                        }
 
597
                }
 
598
 
 
599
                public override string DocCommentHeader {
 
600
                        get { throw new InternalErrorException ("should not be called"); }
 
601
                }
 
602
 
 
603
                public override void DefineType ()
 
604
                {
 
605
                        throw new InternalErrorException ("should not be called");
 
606
                }
 
607
 
 
608
                public override ModuleContainer Module {
 
609
                        get {
 
610
                                return PartialContainer.Module;
 
611
                        }
 
612
                }
 
613
 
 
614
                public override void Accept (StructuralVisitor visitor)
 
615
                {
 
616
                        throw new InternalErrorException ("should not be called");
 
617
                }
 
618
 
 
619
                public override bool IsClsComplianceRequired ()
 
620
                {
 
621
                        return PartialContainer.IsClsComplianceRequired ();
 
622
                }
 
623
 
 
624
                public override IList<MethodSpec> LookupExtensionMethod (TypeSpec extensionType, string name, int arity, ref NamespaceContainer scope)
 
625
                {
 
626
                        return null;
 
627
                }
 
628
 
 
629
                public override FullNamedExpression LookupNamespaceAlias (string name)
 
630
                {
 
631
                        return NamespaceEntry.LookupNamespaceAlias (name);
 
632
                }
 
633
        }
 
634
}