**** Merged r41348 from MCS ****
[mono.git] / mcs / gmcs / ChangeLog
1 2005-03-02  Martin Baulig  <martin@ximian.com>
2
3         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4         static constructor in static classes.
5
6 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
7
8         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
9         sizeParamIndex is not specified.
10
11 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
12
13         Fix #73117
14         * report.cs (WarningMessage.IsEnabled): Missing null check.
15
16 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
17
18         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
19         in the fields and not in the properties.
20
21 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
22
23         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
24         fields as well.
25
26 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
27
28         * attribute.cs: Small refactoring (improved robustness).
29         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
30         (ValidateGuid): Removed.
31         (Resolve): Removed referenced to above mentioned.
32         (GetAttributeUsage): Made private and changed to work without
33         class assistance.
34         (GetIndexerAttributeValue): Don't crash.
35         (GetConditionalAttributeValue): Ditto.
36         (GetClsCompliantAttributeValue): Ditto.
37         (ExtractSecurityPermissionSet): All attributes exceptions are
38         error 648.
39         (GetPropertyValue): New helper.
40         (GetMethodImplOptions): New method.
41         (DefinePInvokeMethod): Reuse common code. Implemented handling of
42         some missing properties.
43         
44         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
45         (Method.ApplyAttributeBuilder): Updated.
46         
47         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
48         exception.
49
50 2005-02-28  Raja R Harinath  <rharinath@novell.com>
51
52         Fix #73052.
53         * report.cs (Report.SymbolRelatedToPreviousError): Handle
54         non-simple types (array, pointer, reference).
55
56 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
57
58         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
59
60         * class.cs (MethodCore.IsDuplicateImplementation): Special error
61         for operators.
62         (Method.CheckBase): Catch wrong destructor here.
63         (MethodData.Define): Add errors 550, 668.
64
65         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
66
67         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
68
69         * pending.cs (VerifyPendingMethods): Add error 551.
70
71         * typemanager.cs (CSharpName): Next error report helper.
72
73 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
74
75         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
76         attributes. Removed useless attribute double check.
77         It saves almost 2MBs for corlib.
78
79 2005-02-25  Raja R Harinath  <rharinath@novell.com>
80
81         Fix #72924.
82         * statement.cs (ExpressionStatement.Resolve): Make robust to being
83         called twice in case of error.
84
85 2005-02-23  Chris Toshok  <toshok@ximian.com>
86
87         Fix compiler portions of #72827.
88         * statement.cs (Block.Emit): call Begin/EndScope on the
89         EmitContext instead of the ILGenerator.
90
91         * codegen.cs (EmitContext.BeginScope): new method, call
92         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
93         we have one.)
94         (EmitContext.BeginScope): same, but EndScope and CloseScope
95
96         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
97         offset and call the superclass's OpenScope(int) with it.
98         (SymbolWriter.CloseScope): get the current il
99         offset and call superclass's CloseScope(int) with it.
100
101 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
102
103         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
104         CS1677 for out and ref as well.
105
106         * class.cs (Method.Define): Add error CS1599 detection.
107         
108         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
109         
110         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
111         
112         * delegate.cs (Delegate.Define): Add error CS1599 detection.
113         
114         * support.cs.cs (ModifierDesc): New helper method.
115
116 2005-02-23  Raja R Harinath  <rharinath@novell.com>
117             Abin Thomas  <projectmonokochi@rediffmail.com>
118             Anoob V E  <projectmonokochi@rediffmail.com>
119             Harilal P R  <projectmonokochi@rediffmail.com>
120
121         Fix #57851, #72718.
122         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
123         MemberLookup (used for error reporting) actually returns a result.
124         Fix error report number (122, not 112).
125
126 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
127             Anoob V E  <projectmonokochi@rediffmail.com>
128             Harilal P R  <projectmonokochi@rediffmail.com>
129
130         Fix #71134.
131         * pending.cs (PendingImplementation.GetAbstractMethods):
132         Find NonPublic members too.
133
134 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
135
136         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
137         Fixed error 217.
138         
139         * class.cs (MethodCore.CheckMethodAgainstBase):
140         Add error 239 report.
141
142 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
143
144         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
145         
146         * class.cs (Operator.Define): Add error 217 report.
147         
148 2005-02-21  Raja R Harinath  <rharinath@novell.com>
149
150         Fix #68955.
151         * expression.cs (Invocation.IsApplicable): Make public.
152         (Invocation.IsParamsMethodApplicable): Likewise.
153         * delegate.cs (Delegate.VerifyApplicability): Don't use
154         Invocation.VerifyArgumentCompat for parameter applicability
155         testing.  Use Invocation.IsApplicable and
156         Invocation.IsParamsMethodApplicable.
157
158 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
159
160         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
161         
162         * class.cs (Operator.Define): Add error 217 report.
163         
164 2005-02-21  Raja R Harinath  <rharinath@novell.com>
165
166         * namespace.cs (UsingEntry.Resolve): Undo change below.
167
168 2005-02-21  Raja R Harinath  <rharinath@novell.com>
169
170         Fix #72756.
171         * ecore.cs (Expression.MemberLookupFailed): Add argument to
172         disable the error message when the extended MemberLookup also
173         fails.
174         (Expression.MemberLookupFinal): Update.
175         (SimpleName.DoSimpleNameResolve): Update.
176         * expression.cs (MemberAccess.ResolveNamespaceOrType):
177         Don't use MemberLookupFinal.
178         (New.DoResolve): Update.
179         (BaseAccess.CommonResolve): Update.
180
181 2005-02-21  Raja R Harinath  <rharinath@novell.com>
182
183         Fix #72732.
184         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
185         occured previously, don't resolve again.
186
187 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
188
189         Fix #69949
190         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
191         argument. Call ResolveAttributeUsage for unresolved.
192         when types doesn't match ctor arguments.
193         
194         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
195         for nested attribute classes.
196         (Class.attribute_usage): Removed.
197         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
198         for attribute class.
199         
200         * ecore.cs (IsAttribute): Removed.
201         
202         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
203         
204         * rootcontext.cs (RegisterAttribute): Removed, attributes are
205         now normal types.
206         (attribute_types): Removed.
207         (EmitCode): Global attributes are emited as the latest.
208
209 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
210
211         * class.cs (EmitFieldInitializers): Don't emit field initializer
212         for default values when optimilization is on.
213         
214         * constant.cs (Constant.IsDefaultValue): New property.
215         
216         * driver.cs: Add /optimize handling.
217         
218         * constant.cs,
219         * ecore.cs,
220         * literal.cs: Implement new IsDefaultValue property.
221         
222         * rootcontext.cs (Optimize): New field, holds /optimize option.
223
224 2005-02-18  Raja R Harinath  <rharinath@novell.com>
225
226         Fix crasher in re-opened #72347.
227         * namespace.cs (Namespace.Lookup): Return null if
228         DeclSpace.DefineType returns null.
229
230         Fix #72678.
231         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
232
233 2005-02-18  Raja R Harinath  <rharinath@novell.com>
234
235         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
236         now returns null if it cannot resolve to an lvalue.
237         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
238         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
239         returned null.  Remove check for SimpleName.
240         (EventExpr.DoResolveLValue): New.
241         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
242         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
243         error from ...
244         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
245         avoid CS0131 error.
246         (Unary.ResolveOperator): Move CS0211 check ...
247         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
248         CS0131 error.
249         (Unary.DoResolveLValue): Simplify.
250         (AddressOf.DoResolveLValue): New.
251         (ArrayAccess.DoResolveLValue): New.
252
253 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
254
255         * attribute.cs (Attribute.Resolve): Add arguments casting for
256         when types doesn't match ctor arguments.
257
258 2005-02-16  Raja R Harinath  <rharinath@novell.com>
259
260         Fix parts of #63202.
261         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
262         lookup of operator in base type.  Ensure that all checks happen
263         when the operator resolves to an "op_..." method.
264
265 2005-02-15  Raja R Harinath  <rharinath@novell.com>
266
267         Fix #71992.
268         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
269         'ignore_cs0104' parameter.  Pass it to ...
270         (NamespaceEntry.Lookup): ... this.
271         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
272         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
273         (TypeLookupExpression.DoResolveAsTypeStep): Update.
274         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
275         Update.  Request that cs0104 errors be ignored.
276         (ComposedCast.ResolveAsTypeStep): Update.
277
278 2005-02-14  Raja R Harinath  <rharinath@novell.com>
279
280         Fix #59209.
281         * expression.cs (Invocation.BetterFunction): Remove support for
282         comparing virtual functions and their overrides.
283         (Invocation.IsOverride): New.
284         (Invocation.OverloadResolve): Don't consider 'override' functions
285         during candidate selection.  Store them in a lookaside list.
286         If the selected method is a 'virtual' function, use the list to
287         find any overrides that are closer to the LHS type.
288
289 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
290
291         * expression.cs (New.DoResolve): Add complex core type reduction.
292         (New.Constantify): Converts complex core type syntax like 'new int ()'
293         to simple constant.
294         
295 2005-02-14  Raja R Harinath  <rharinath@novell.com>
296
297         * decl.cs (EntryType.EntryType): New constructor to create an
298         updated copy of a cache entry.
299         (MemberCache.AddMethods): Use it.
300         (MemberCache.ClearDeclaredOnly): Remove.
301         (MemberCache.MemberCache): Update.
302
303 2005-02-11  Miguel de Icaza  <miguel@novell.com>
304
305         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
306         variable.  This one is represents the actual low-level declaration
307         of the method, as opposed to the semantic level `IsStatic'.   
308
309         An anonymous method which is hosted into a static method might be
310         actually an instance method.  IsStatic would reflect the
311         container, while MethodIsStatic represents the actual code
312         generated.
313
314         * expression.cs (ParameterReference): Use the new MethodIsStatic
315         instead of IsStatic.
316
317         * anonymous.cs (AnonymousMethod.Compatible): Pass the
318         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
319         set on the current EmitContext. 
320
321         * expression.cs (Cast): Overload DoResolveLValue so we can pass
322         resolve our casted expression as an LValue.  This triggers the
323         proper LValue processing that is later required by Assign.
324
325         This fixes 72347.
326
327         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
328
329 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
330
331         C# 2.0 Fixed buffer implementation
332
333         * anonymous.cs: Update after RegisterHelperClass renaming.
334
335         * attribute.cs (AttributeTester.fixed_buffer_cache):
336         Cache of external fixed buffers.
337         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
338         implementation if field is fixed buffer else null.
339
340         * class.cs
341         (TypeContainer.AddField): Accept FieldMember instead of Field.
342         (FieldBase.IsFieldClsCompliant): Extracted code from
343         VerifyClsCompliance descendant customization.
344         (FixedField): New class handles fixed buffer fields.
345         (FixedFieldExternal): Keeps information about imported fixed
346         buffer.
347         (IFixedField): Make access to internal or external fixed buffer
348         same.
349
350         * cs-parser.jay: Add fixed buffer parsing.
351
352         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
353         buffer.
354
355         * expression.cs (Indirection): Extended implementation to accept
356         fixed buffer field.
357         (PointerArithmetic.Emit): Get element from fixed buffer as well.
358         (ElementAccess.MakePointerAccess): Get type as parameter.
359         (DoResolve): Add fixed buffer field expression conversion.
360         (DoResolveLValue): Ditto.
361         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
362         (ArrayPtr): Derives from FixedBufferPtr.
363         (ArrayPtr.Emit): Add extra emit for array elements.
364
365         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
366
367         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
368         for compiler generated types.
369         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
370
371         * statement.cs (Fixed): Refactored to be easier add fixed buffer
372         and consume less memory.
373         (Fixed.Resolve): Add fixed buffer case.
374
375         * typemanager.cs (compiler_generated_attr_ctor,
376         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
377         (HasElementType): Add our own implementation to work on every
378         runtime.
379
380 2005-02-11  Miguel de Icaza  <miguel@novell.com>
381
382         * anonymous.cs (CaptureContext): Track whether `this' has been
383         referenced.   
384
385         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
386         only captured `this' if it was implicitly done (instance
387         methods/variables were used). 
388
389         * codegen.cs (EmitContext.CaptureThis): New method to flag that
390         `this' must be captured.
391
392 2005-01-30  Miguel de Icaza  <miguel@novell.com>
393  
394         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
395         is null it means that there has been no need to capture anything,
396         so we just create a sibling.
397
398         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
399
400         Just a partial fix.  The other half is fairly elusive.
401         
402 2005-02-10  Raja R Harinath  <rharinath@novell.com>
403
404         Fix #52586, cs0121-4.cs.
405         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
406         and return a hashtable.
407         (MemberCache.ClearDeclaredOnly): New.
408         (MemberCache.MemberCache): Update to change.  Make a deep copy of
409         the method_hash of a base type too.
410         (MemberCache.AddMethods): Adapt to having a deep copy of the base
411         type methods.  Overwrite entries with the same MethodHandle so
412         that the ReflectedType is correct.  The process leaves in base
413         virtual functions and their overrides as distinct entries.
414         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
415         matters since it was boxed in a ArrayList before.
416         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
417         modifier.
418         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
419         case of a virtual function and its override (choose the overload
420         as better).
421         (Invocation.OverloadResolve): Avoid 'override' members during
422         'applicable_type' calculation.
423
424 2005-03-28  Raja R Harinath  <rharinath@novell.com>
425
426         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
427         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
428         GetTypeHandle.  It is possible for a reflected type to derive from
429         a TypeBuilder (e.g., int[] derives from the TypeBuilder
430         System.Array during mscorlib compilation).
431         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
432         contain a method_hash, don't create one either.  Don't create a
433         deep copy of the base cache's method_hash.
434         (MemberCache.SetupCache): Rename back from DeepCopy.
435         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
436         already initialized.  If we see an override function, add its
437         underlying base virtual function to the member_hash too.
438
439 2005-02-09  Raja R Harinath  <rharinath@novell.com>
440
441         Combine two near-redundant caches.
442         * typemanager.cs (method_params): Rename from method_internal_params.
443         (TypeManager.GetParameterData): New.  Replace
444         Invocation.GetParameterData.
445         (TypeManager.LookupParametersByBuilder): Remove.
446         * expression.cs (Invocation.method_parameter_cache): Remove.
447         (Invocation.GetParameterData): Remove.
448         Update to changes.
449         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
450         Update to changes.
451
452 2005-02-08  Raja R Harinath  <rharinath@novell.com>
453
454         Fix #72015.
455         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
456         TypeManager.multicast_delegate_type is null, resolve it by looking
457         up "System.MulticastDelegate".
458         * rootcontext.cs (RootContext.ResolveCore): Simplify.
459
460 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
461             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
462             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
463
464         Fix cs0164.cs.
465         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
466         (LabeledStatement.AddReference): New.  Set 'referenced'.
467         (Goto.Resolve): Use it.
468
469 2005-02-05  John Luke  <john.luke@gmail.com>
470
471         * driver.cs: remove duplicate -doc line in Usage ()
472
473 2005-02-04  Raja R Harinath  <rharinath@novell.com>
474
475         * location.cs (Location.AddFile): Fix CS2002 error report.
476
477 2005-02-02  Martin Baulig  <martin@ximian.com>
478
479         * delegate.cs (Delegate.DefineType): Report an internal error if
480         TypeManager.multicast_delegate_type is null.  See bug #72015 for
481         details.        
482
483 2005-02-02  Raja R Harinath  <rharinath@novell.com>
484
485         Fix a crasher in a variant of #31984.
486         * const.cs (Constant.CheckBase): New override that defers the
487         new-or-override check in case the base type hasn't been populated
488         yet.
489         (Constant.Define): Ensure the new-or-override check is performed.
490
491 2005-02-01  Duncan Mak  <duncan@ximian.com>
492
493         * const.cs (LookupConstantValue): Check that `ce' is not null
494         before calling GetValue ().
495
496 2005-02-01  Raja R Harinath  <rharinath@novell.com>
497
498         Fix test-334.cs (#69519).
499         * cs-parser.jay (using_alias_directive): Pass in an expression to
500         NamespaceEntry.UsingAlias.
501         (using_namespace_directive): Pass in an expression to
502         NamespaceEntry.Using.
503         (namespace_name): Don't flatten to a string.
504         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
505         (NamespaceEntry.AliasEntry.Resolve): Lookup using
506         ResolveAsTypeStep.
507         (NamespaceEntry.UsingEntry): Likewise.
508         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
509         changes.
510         (NamespaceEntry.LookupForUsing): Remove.
511         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
512         names.
513         (NamespaceEntry.Lookup): Remove support for dotted names.
514
515 2005-02-01  Raja R Harinath  <rharinath@novell.com>
516
517         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
518         split into two.
519         (NamespaceEntry.ImplicitParent): Compute on demand.
520         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
521         parallels the current.
522         (NamespaceEntry.LookupForUsing): Use it.
523         (NamespaceEntry.Lookup): If the current namespace-entry is
524         implicit, don't search aliases and using tables.
525
526 2005-02-01  Raja R Harinath  <rharinath@novell.com>
527
528         Fix #31984.
529         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
530         BaseCache here.
531         (TypeContainer.BaseCache): Compute on demand.
532         (TypeContainer.FindMembers): Define constants and types if they're
533         not already created.
534         (FieldMember.Define): Move resetting of ec.InUnsafe before error
535         check.
536         * const.cs (Constant.Define): Make idempotent.
537
538 2005-01-29  Miguel de Icaza  <miguel@novell.com>
539
540         * pending.cs: Produce better code (no nops produced by using Ldarg
541         + value).
542         
543         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
544         i - 1' it should be arg + 1.
545
546         Fixes bug #71819.
547
548 2005-01-28  Raja R Harinath  <rharinath@novell.com>
549
550         * attribute.cs (Attribute.CheckAttributeType): Make private
551         non-virtual.
552         (Attribute.ResolveType): Make virtual.
553         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
554         handling of RootContext.Tree.Types.
555
556 2005-01-27  Raja R Harinath  <rharinath@novell.com>
557
558         Update attribute-handling to use the SimpleName/MemberAccess
559         mechanisms.
560         * cs-parser.jay (attribute): Pass in an expression to the
561         constructors of Attribute and GlobalAttribute.
562         * attribute.cs (Attribute): Take an expression for the name.
563         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
564         passed in attribute name expression.
565         (Attribute.CheckAttributeType): Use it.
566         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
567         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
568         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
569         argument to prevent error messages if the lookup fails.
570
571 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
572
573         * expression.cs (Indirection): Implemented IVariable interface
574         to support indirection in AddressOf operator.
575         (PointerArithmetic.Emit): Add optimalization for case where
576         result can be precomputed.
577
578 2005-01-26  Martin Baulig  <martin@ximian.com>
579
580         * class.cs (TypeContainer.AttributeTargets): Return the correct
581         AttributeTargets depending on our `Kind' instead of throwing an
582         exception; fixes #71632.
583
584 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
585
586         Fix #71257
587         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
588         constant members.
589
590 2005-03-17  Martin Baulig  <martin@ximian.com>
591
592         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
593         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
594
595 2005-03-17  Martin Baulig  <martin@ximian.com>
596
597         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
598         to bool so we can return an error condition.
599         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
600         returned an error.
601
602 2005-03-17  Martin Baulig  <martin@ximian.com>
603
604         * generic.cs (TypeMananager.IsIEnumerable): New public method.
605
606         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
607         converting from an array-type of T to `IEnumerable<T>'.
608
609 2005-03-16  Martin Baulig  <martin@ximian.com>
610
611         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
612         (Nullable.LiftedUnaryMutator): New public class.
613
614         * expression.cs (UnaryMutator.DoResolve): Added support for
615         Nullable Types.
616
617 2005-03-14  Martin Baulig  <martin@ximian.com>
618
619         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
620
621 2005-03-14  Martin Baulig  <martin@ximian.com>
622
623         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
624         the comparision operators `<', `>', `<=' and `>='.
625
626 2005-03-13  Martin Baulig  <martin@ximian.com>
627
628         * generic.cs
629         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
630         avoid confusion with the `NullLiteral'.
631         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
632
633 2005-03-13  Martin Baulig  <martin@ximian.com>
634
635         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
636         comparing arbitrary types with the null literal.
637
638 2005-03-13  Martin Baulig  <martin@ximian.com>
639
640         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
641         boolean operators '&&', '||', '&' and '|'.
642         (Nullable.OperatorTrueOrFalse): New public class.
643
644         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
645         instead of a `StaticCallExpr'; added support for nullables.
646
647 2005-03-10  Martin Baulig  <martin@ximian.com>
648
649         * expression.cs
650         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
651         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
652
653 2005-03-07  Martin Baulig  <martin@ximian.com>
654
655         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
656         it work if `expr' is not an IMemoryLocation.
657         (Nullable.Lifted): Implement IMemoryLocation.
658         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
659         target type.
660
661 2005-03-05  Martin Baulig  <martin@ximian.com>
662
663         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
664         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
665         (Nullable): Added support for lifted unary and binary operators.
666
667         * expression.cs (Unary.DoResolve): Added support for nullable types.
668         (Binary.DoResolve): Likewise.
669         (Conditional.DoResolve): Likewise.
670
671 2005-03-02  Martin Baulig  <martin@ximian.com>
672
673         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
674
675         * class.cs (ClassPart.SetParameterInfo): Override this.
676         (PartialContainer.SetParameterInfo): Override this.
677         (TypeContainer.CheckConstraints): New protected method.
678         (PartialContainer.CheckConstraints): Override this and check
679         whether the same contraints were specified in all parts of a
680         partial generic type definition.
681         (PartialContainer.UpdateConstraints): New public method.
682
683         * generic.cs (TypeParameter.UpdateConstraints): New public method.
684
685 2005-03-02  Martin Baulig  <martin@ximian.com>
686
687         Committing a patch from Carlos Alberto Cortez to fix #72887.
688
689         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
690         casts from `T []' to `int []'.
691
692 2005-03-02  Martin Baulig  <martin@ximian.com>
693
694         * generic.cs (TypeManager.IsEqual): Make this symmetric.
695
696         * expression.cs (Binary.ResolveOperator): When resolving a
697         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
698         `=='.  Fixes #71866.  See gen-127.cs.
699
700 2005-03-02  Martin Baulig  <martin@ximian.com>
701
702         * class.cs (TypeContainer.DoDefineMembers): We also need a default
703         static constructor in static classes.
704
705 2005-03-02  Martin Baulig  <martin@ximian.com>
706
707         * generic.cs
708         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
709         (Nullable.LiftedConversion): Added support for user-defined
710         conversions.
711
712         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
713
714         * cs-parser.jay: Use ComposedCast everywhere instead of
715         NullableType, so we don't need to check for NullableType
716         everywhere.
717         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
718         case where we'll be resolved into a `parenthesized_expression_0'
719         afterwards.
720
721         * convert.cs
722         (Convert.UserDefinedConversion): Added nullable conversions.
723
724 2005-02-28  Martin Baulig  <martin@ximian.com>
725
726         * generic.cs (TypeManager.IsNullableType): New static method.
727         (Nullable): New abstract class.
728         (Nullable.NullLiteral): New public class.
729         (Nullable.LiftedConversion): New public class.
730
731         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
732         `builtin_types opt_nullable'.
733
734         * convert.cs
735         (Convert.ImplicitConversionStandard): Added nullable conversions.
736         (Convert.ExplicitConversionStandard): Likewise.
737         (Convert.ExplicitConversion): Likewise.
738
739 2005-02-26  Martin Baulig  <martin@ximian.com>
740
741         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
742         begin with a "?", for instance "?[]".  Don't do a type lookup if
743         `dim' is empty.
744
745 2005-02-25  Martin Baulig  <martin@ximian.com>
746
747         The first part of Nullable Types :-)
748
749         * generic.cs (NullableType): New public class.
750         (NullCoalescingOperator): New public class.
751         (TypeArguments.Resolve): Add a CS0306 check.
752
753         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
754         (opt_nullable): New rule.
755         (type): Added `opt_nullable' to `namespace_or_type_name',
756         `builtin_types' and `pointer_type'.
757         (array_type): Added `opt_nullable'.
758         (opt_rank_specifier_or_nullable): New rule; this is the
759         combination of `opt_rank_specifier' and `opt_nullable'.
760         (opt_error): New rule; catch errors here.
761         (nullable_type_or_conditional): New rule; we use this to check for
762         nullable and still detect the conditional operator.
763         (local_variable_type): Use `opt_rank_specifier_or_nullable'
764         instead `opt_rank_specifier'.
765
766         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
767         for nullables.
768
769 2005-02-24  Martin Baulig  <martin@ximian.com>
770
771         * README, README.Changes: Removed; they're old and obsolete.
772
773 2005-02-22  Martin Baulig  <martin@ximian.com>
774
775         * generic.cs (TypeParameter.Resolve): If resolving the constraints
776         returned an error, set `constraints' to null to avoid a crash
777         later on.
778         (TypeParameter.ResolveType): Likewise.
779
780 2005-02-22  Martin Baulig  <martin@ximian.com>
781
782         * generic.cs
783         (Constraints.ResolveTypes): Protect against being called twice.
784         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
785         (TypeParameter.ResolveType): New public method; calls
786         constraints.ResolveTypes().
787         (TypeParameter.DefineType): Moved constraints.ResolveType() out
788         into the new ResolveType().
789         (GenericMethod.Define): Call ResolveType() on all our
790         TypeParameter's.        
791
792 2005-02-21  Martin Baulig  <martin@ximian.com>
793
794         * generic.cs
795         (TypeManager.generic_nullable_type): New static public field.
796         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
797
798         * rootcontext.cs
799         (RootContext.ResolveCore): Resolve "System.Nullable`1".
800
801 2005-02-15  Martin Baulig  <martin@ximian.com>
802
803         * generic.cs (ConstructedType.Constraints): Correctly check
804         constraints if the argument type is a type parameter; fixes
805         #72326. 
806
807 2005-02-02  Martin Baulig  <martin@ximian.com>
808
809         * delegate.cs (Delegate.DefineType): Report an internal error if
810         TypeManager.multicast_delegate_type is null.  See bug #72015 for
811         details.        
812
813 2005-01-29  Miguel de Icaza  <miguel@novell.com>
814
815         * pending.cs: Produce better code (no nops produced by using Ldarg
816         + value).
817         
818         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
819         i - 1' it should be arg + 1.
820
821         Fixes bug #71819.
822         
823 2005-01-26  Martin Baulig  <martin@ximian.com>
824
825         * cs-parser.jay (indexer_declarator): Don't report an error if we
826         have type parameters since we can be an explicit interface
827         implementation; fixes #71449.
828
829 2005-01-26  Martin Baulig  <martin@ximian.com>
830
831         * class.cs (TypeContainer.AttributeTargets): Return the correct
832         AttributeTargets depending on our `Kind' instead of throwing an
833         exception; fixes #71632.
834
835 2005-01-26  Martin Baulig  <martin@ximian.com>
836
837         * delegate.cs (Delegate.DefineType): Correctly define our type
838         parameters.  Fixes #71483.
839
840 2005-01-25  Raja R Harinath  <rharinath@novell.com>
841
842         Fix #71602.
843         * expression.cs (MemberAccess.DoResolve): Don't complain with
844         cs0572 when the LHS of a member access has identical name and type
845         name.
846
847 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
848
849         Fix #71651, #71675
850         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
851         CreatePermission.
852         Create custom PermissionSet only for PermissionSetAttribute.
853
854 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
855
856         Fix #71649
857         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
858         delegates in static class.
859
860 2005-01-24  Martin Baulig  <martin@ximian.com>
861
862         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
863         merging an implicit block, just use its reachability.
864
865         * statement.cs (Block.Resolve): Make the unreachable code check
866         work wrt. implicit blocks; see test-337 from #63842.
867
868 2005-01-21  Alp Toker  <alp@atoker.com>
869  
870         * cs-parser.jay: destructor_declaration's container is PartialContainer
871         not Class when partial types are used, so use Kind prop instead of
872         'is'.
873         
874 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
875
876         * cs-parser.jay: Improve error reporting when an interface
877         declares new types.
878
879 2005-01-20  Dick Porter  <dick@ximian.com>
880
881         * support.cs: SeekableStreamReader fix from Sandor Dobos
882         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
883         chars are read.  Fixes bug 70369.
884
885 2005-01-20  Raja R Harinath  <rharinath@novell.com>
886
887         * cs-parser.jay (catch_clause): Simplify current_block handling
888         somewhat.
889
890 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
891
892         * convert.cs (ImplicitStandardConversionExists): Synchronize the
893         code with ImplicitStandardConversion to handle the implicit
894         conversion of method groups into valid delegate invocations. 
895
896         The problem is that in parameter handling we were using this code
897         path.  Fixes bug #64698
898
899 2005-01-19  Raja R Harinath  <rharinath@novell.com>
900
901         * cs-parser.jay: Fix several infelicities.
902         - Avoid assigning to the parser value stack.  Code like 
903           '$3 = null' is unclean.  Synthesize a value for the code block
904           instead. 
905         - Avoid using oob_stack for storing location information.  Use ...
906         (_mark_): ... this.  New (empty) rule.  Saves the current location
907         in $$.
908         (foreach_statement): Avoid using oob_stack for current_block
909         handling.  Use technique used in for_statement and
910         using_statement.  Synthesize a value for the code block to store
911         additional intermediate information.
912
913 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
914
915         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
916         of a different type is only allowed to private fields of a
917         containing type, not on fields of a base class.
918
919         See test-174.cs and error cs0122-9.cs
920
921 2005-01-13  Raja R Harinath  <rharinath@novell.com>
922
923         Fix test-335.cs (bug #58126).
924         * cs-parser.jay (argument): Split out non-expression parts of the
925         rule into 'non_simple_argument'.
926         (invocation_expression): Support parenthesized invocations with
927         multiple arguments, and with single non-simple arguments.
928
929 2005-01-13  Raja R Harinath  <rharinath@novell.com>
930
931         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
932         places.
933
934 2005-01-12  Raja R Harinath  <rharinath@novell.com>
935
936         Fix cs0038-1.cs, cs1640-6.cs.
937         * ecore.cs (Expression.Resolve): Remove special-case for
938         SimpleName in error-handling.
939         (Expression.almostMatchedMembers): Relax access permission to
940         protected.
941         (Expression.MemberLookupFailed): Handle duplicates in
942         almostMatchedMembers list.
943         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
944         * expression.cs (New.DoResolve): Report CS1540 for more cases.
945         * typemanager.cs (GetFullNameSignature): Use the MethodBase
946         overload if the passed in MemberInfo is a MethodBase.
947
948 2005-01-25  Martin Baulig  <martin@ximian.com>
949
950         * doc.cs
951         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
952
953 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
954
955         Fix #70749
956         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
957         for non-CAS & merge permission sets properly.
958
959 2005-01-11  Raja R Harinath  <rharinath@novell.com>
960
961         Improve standard-compliance of simple name and member access 
962         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
963         * ecore.cs (FullNamedExpression): New abstract base class 
964         for Namespaces and TypeExpressions.
965         (ResolveFlags.SimpleName): Remove.
966         (SimpleName): Remove support for dotted names.
967         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
968         DeclSpace.FindType and DeclSpace.LookupType.
969         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
970         (Expression.ExprClassName): Make member function.
971         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
972         a namespace.  Remove creation of dotted "SimpleName"s.
973         (MemberAccess.DoResolve): Likewise.
974         * decl.cs (DeclSpace.Cache): Make private.
975         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
976         (DeclSpace.FindType): Update.
977         (DeclSpace.LookupType): Move here from RootContext.  Return a 
978         FullNamedExpression.
979         * namespace.cs (Namespace): Derive from FullNamedExpression
980         so that it can be part of expression resolution.
981         (Namespace.Lookup): Return an FullNamedExpression.
982         (NamespaceEntry.LookupAlias): Lookup aliases only in current
983         namespace.
984         * rootcontext.cs (NamespaceLookup): Remove.
985         (LookupType): Move to DeclSpace.
986         * attribute.cs (CheckAttributeType): Update.
987         * doc.cs (FindDocumentedType): Remove allowAlias argument.
988         (FindDocumentedTypeNonArray): Likewise.
989
990 2005-01-11  Raja R Harinath  <rharinath@novell.com>
991
992         Fix cs0509.cs, cs1632.cs.
993         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
994         is the same as IsInterface.
995         (TypeContainer.GetClassBases): Likewise.
996         * statement.cs (LabeledStatement.ig): New field.
997         (LabeledStatement.LabelTarget): Save ILGenerator which created the
998         label.
999         (LabeledStatement.DoEmit): Check that the label was created with
1000         the same ILGenerator.
1001
1002 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
1003
1004         Fix #71058
1005         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
1006         accessors to its properties.
1007
1008         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
1009         from accessors to property.
1010         
1011 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
1012
1013         Fix #70722
1014         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
1015         only for overrides.
1016         
1017 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
1018
1019         * attribute.cs: Check for null and empty strings.  
1020
1021         I have lost another battle to Paolo.
1022
1023 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
1024
1025         Fix #70942
1026         * class.cs (PropertyMethod): Set Parent field in ctors.
1027         (SetMethod.InternalParameters): Add unsafe switch hack.
1028         Override MarkForDuplicationCheck where it is appropriate.
1029
1030         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
1031         It says whether container allows members with the same name.
1032         Base default is no.
1033         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
1034         Removed is_method parameter.
1035
1036 2005-01-06  Duncan Mak  <duncan@ximian.com>
1037
1038         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
1039         because the previous change led to incorrect reporting of CS1032
1040         ("Cannot define/undefine preprocessor symbols after first token in
1041         file"). Instead of using `tokens_seen' as the only flag that
1042         triggers CS1040, introduce `comments_seen'. This new flag is used
1043         to signify having seen comments on the current line, so it is
1044         unset after a newline.
1045
1046 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1047
1048         * doc.cs : When searching for a type, find nested type too.
1049           This fixes bug #71040.
1050
1051 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
1052
1053         * doc.cs :
1054           - Warn missing member comment on those classes which also does not
1055             have doc comments. Fixed bug #71041.
1056           - Don't warn missing doc comment on default constructor.
1057             Fixed bug #71042.
1058
1059 2005-01-06  Duncan Mak  <duncan@ximian.com>
1060
1061         * cs-tokenizer.cs (xtoken): After handling traditional C-style
1062         comments, set `tokens_seen' to true. This allows us to detect
1063         misplaced preprocessor directives (i.e. not at the beginning of
1064         the a line, nor after whitespaces). In that case, report error
1065         CS1040. This fixes bug #56460.
1066
1067         * cs-parser.jay (interface_member_declaration): Add checks for
1068         IsExplicitImpl, and report CS0541 error if an interface member is
1069         defined as an explicit interface declaration.
1070
1071 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
1072
1073         Fix #70817
1074         * class.cs (PropertyMethod): Set Parent field in ctors.
1075         (SetMethod.InternalParameters): Add unsafe switch hack.
1076         
1077         * decl.cs (MemberCore.Parent): Cannot be readonly.
1078
1079 2005-01-06  Raja R Harinath  <rharinath@novell.com>
1080
1081         * decl.cs (DeclSpace.ResolveType): Remove.
1082         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
1083         Merge in code from ...
1084         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
1085         * class.cs, enum.cs: Update to changes.
1086
1087 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
1088
1089         * anonymous.cs: Ensure that we init the scope of our parent if it
1090         has not been initialized yet.
1091
1092 2004-12-30  Duncan Mak  <duncan@ximian.com>
1093
1094         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
1095         if field.FieldBuilder is null. Fixes #70758.
1096
1097         * convert.cs: Fixed some typos and updated some of the comments.
1098         (ImplicitStandardConversionExists):
1099         (TryImplicitIntConversion): If `target_type' is an interface and
1100         the type of `ic' implements this interface, return true or a new
1101         BoxedCast instead of null. This fixes #70468.
1102
1103 2004-12-29  Duncan Mak  <duncan@ximian.com>
1104
1105         * expression.cs (Argument.Emit): Check that Expr is
1106         IMemoryLocation before casting to it, and report CS1510 otherwise.
1107
1108         This fixes #70402.
1109
1110 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
1111
1112         * statement.cs (Block.ThisVariable): remove the recursion here, to
1113         make the --profile more sane.
1114
1115 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
1116
1117         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
1118         assembly, by JB Evain.
1119
1120 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1121
1122         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
1123           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
1124         "parent" refers to enclosing type/class.  "base" refers to superclass.
1125
1126 2004-12-17  Raja R Harinath  <rharinath@novell.com>
1127
1128         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1129         Ensure that we only have GlobalAttributes.
1130         * attribute.cs (Attribute.Emit): Make non-virtual.
1131         (GlobalAttribute.Emit): Remove.
1132         (Attribute.Resolve): Make virtual.
1133         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
1134         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
1135         the argument. Don't create one.
1136         (Attribute.GetObsoleteAttribute): Likewise.
1137         (Attribute.GetClsCompliantAttributeValue): Likewise.
1138         * class.cs, decl.cs: Update to changes.
1139
1140 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
1141
1142         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
1143         
1144         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
1145         
1146         * statement.cs (Foreach.Resolve): Add error 186 report.
1147
1148 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
1149
1150         * expression.cs (Conditional.DoResolve): Add warning 429.
1151         
1152         * statement.cs (If.Resolve): Add warning 665.
1153
1154 2004-12-16  Raja R Harinath  <rharinath@novell.com>
1155
1156         New invariant: RootContext.Tree.Types.NamespaceEntry == null
1157         except when in the parser, and in GlobalAttribute.
1158         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
1159         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
1160         RootContext.Tree.Types.NamespaceEntry once work is done.
1161         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
1162         and resets RootContext.Tree.Types.NamespaceEntry.
1163
1164 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
1165
1166         * cs-parser.jay: Don't create a block for every variable.
1167
1168 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
1169
1170         * location.cs: Provide extra information.
1171
1172         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
1173         variables from the captured environment, it is the ldarg_0.
1174
1175 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1176
1177         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
1178         find a conclusion.
1179         
1180         * class.cs: Changed warning level for 169 to avoid developer
1181         displeasure from warning flooding. It will be changed back when they
1182         fix most of current BCL warnings.
1183         
1184         * RootContext.cs: Pushed default WarningLevel to 3.
1185         
1186         * statement.cs: Removed unused variable.
1187
1188 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
1189
1190         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
1191         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
1192         Add error 502 report.
1193         (StaticClass.DefineType): Add error 441 report.
1194         (Class.AllowedModifiersProp): New virtual property as temporary
1195         extension to AllowedModifiers.
1196         (Class.DefineType): Add error 418 report. Moved ModFlags check here
1197         to share implementation with StaticClass and don't call virtual
1198         methods from ctor.
1199         
1200         * driver.cs (MainDriver): Add error 1558 test.
1201
1202         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
1203         report. Moved error 36 test here.
1204
1205         * statement.cs (Throw.Resolve): Add error 724 report.
1206
1207         * typemanager.cs: Add out_attribute_type core type.
1208         
1209 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
1210
1211         * class.cs (TypeContainer.VerifyClsCompliance): Add error
1212         3018 report.
1213         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
1214
1215         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
1216         3017 report.
1217         
1218         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
1219
1220         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
1221         Add error 3023 report.
1222         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
1223
1224         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
1225         implementation.
1226
1227 2004-12-12  John Luke  <john.luke@gmail.com>
1228
1229         * driver.cs (AddArgs): take -- into account when
1230         adding arguments, fixes bug 65710 
1231
1232 2004-12-12  Martin Baulig  <martin@ximian.com>
1233
1234         * expression.cs (Unary.TryReduceNegative): Added support for
1235         SByteConstant and ByteConstant.
1236         (Unary.Reduce): Check error values from TryReduceNegative().
1237
1238 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
1239
1240         * attributes.cs (Attribute.Resolve): Avoid multiple error report
1241         and report exception as error 182.
1242
1243 2004-12-10  Raja R Harinath  <rharinath@novell.com>
1244
1245         * driver.cs (Main): Fix message when there are warnings.
1246
1247 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
1248
1249         * delegate.cs: Fixed my fix from yesterday, sorry about that.
1250
1251 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
1252
1253         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
1254         Reduced number of warnings.
1255         
1256         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
1257
1258 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
1259
1260         * driver.cs: Removed message.
1261
1262         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
1263
1264 2004-12-08    <vargaz@freemail.hu>
1265
1266         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
1267
1268 2004-12-08  Martin Baulig  <martin@ximian.com>
1269
1270         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1271         instead of a CS3002 for properties and indexer.
1272
1273 2004-12-08  Martin Baulig  <martin@ximian.com>
1274
1275         * decl.cs (MemberName.ToString): Make this work again.
1276
1277 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
1278
1279         * attribute.cs (Resolve): Add error 591 detection.
1280
1281         * class.cs (FieldMember.Define): Add error 1547 detection.
1282         (Indexer.Define): Add error 620 detection.
1283         (Operator.Define): Add error 590 detection.
1284
1285         * ecore.cs: Missing argument for error 79.
1286
1287         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
1288         detection.
1289
1290 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
1291
1292         Fix #70106
1293         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
1294         only.
1295
1296 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1297
1298         * cs-parser.jay : handle doc comments on implicit/explicit operators.
1299           Some operator comments were suppressed.
1300         * doc.cs : Implicit/explicit operator name in doc comments are like
1301           "op_Explicit(type)~returnType", so added suffix handling.
1302
1303 2005-01-21  Alp Toker  <alp@atoker.com>
1304
1305         * cs-parser.jay: destructor_declaration's container is PartialContainer
1306         not Class when partial types are used, so use Kind prop instead of 'is'.
1307
1308 2004-12-12  Martin Baulig  <martin@ximian.com>
1309
1310         * expression.cs (Unary.TryReduceNegative): Added support for
1311         SByteConstant and ByteConstant.
1312         (Unary.Reduce): Check error values from TryReduceNegative().
1313
1314 2004-12-11  Martin Baulig  <martin@ximian.com>
1315
1316         * support.cs (ReflectionParameters.ParameterName): If we have a
1317         `gpd', call `ParameterName' on it.
1318
1319         * parameter.cs (Parameter.GetParameterAttributes): New static method.
1320
1321         * pending.cs (PendingImplementation.DefineProxy): Call
1322         DefineParameter() for all of the MethodBuilder's arguments.
1323
1324 2004-12-09  Martin Baulig  <martin@ximian.com>
1325
1326         * doc.cs (DocUtil): Make this a static class.
1327
1328 2004-12-09  Martin Baulig  <martin@ximian.com>
1329
1330         * expression.cs (Invocation.InferType): Moved the type inference
1331         implementation into TypeManager.
1332
1333         * generics.cs (TypeManager): Moved the type inference
1334         implementation here.
1335
1336 2004-12-09  Martin Baulig  <martin@ximian.com>
1337
1338         * typemanager.cs (TypeManager): Make this a partial class.
1339
1340         * generics.cs
1341         (TypeManager): Move the generics part of `TypeManager' here.
1342
1343 2004-12-08  Martin Baulig  <martin@ximian.com>
1344
1345         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
1346         instead of a CS3002 for properties and indexer.  Added CS3024
1347         check for generic interfaces.
1348
1349         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
1350         instances are not CLS-compliant.
1351
1352 2004-12-08  Martin Baulig  <martin@ximian.com>
1353
1354         * cs-parser.jay
1355         (void_pointer_expression): New rule for `void*', `void**' etc.
1356         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
1357
1358 2004-12-08  Martin Baulig  <martin@ximian.com>
1359
1360         * expression.cs (Invocation.InferType): Removed the hack for
1361         MethodCore.MayUnify().  
1362
1363         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
1364         this actually work.
1365
1366         * class.cs (MethodCore.MayUnify): Use
1367         TypeManager.MayBecomeEqualGenericTypes().       
1368
1369 2004-12-08  Martin Baulig  <martin@ximian.com>
1370
1371         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
1372         parameter, box it.  Fixes #69233.
1373
1374 2004-12-08  Martin Baulig  <martin@ximian.com>
1375
1376         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
1377         have the ctor constraint.  Fixes #68326.
1378
1379 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
1380
1381         * cs-parser.jay : interface comment was not consumed because of
1382           extra opt_semicolon before doc handling.
1383
1384 2004-12-03  Raja R Harinath  <rharinath@novell.com>
1385
1386         Fix test-327.cs, test-328.cs, and put in early infrastructure
1387         for eventually fixing #52697.
1388         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
1389         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
1390         from other methods.
1391         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
1392         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
1393         (VerifyUsing, error246): Update.
1394         * rootcontext.cs (RootContext.NamespaceLookup): Just use
1395         'NamespaceEntry.LookupNamespaceOrType'.
1396
1397 2004-12-07  Martin Baulig  <martin@ximian.com>
1398
1399         * driver.cs: Call it "BETA SOFTWARE" :-)
1400
1401 2004-12-06  Raja R Harinath  <rharinath@novell.com>
1402
1403         Fix crash on cs0657-17.cs.
1404         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
1405         Use RootContext.Tree.Types, not 'new RootTypes ()'.
1406         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
1407         the case where the NamespaceEntry gets overwritten.
1408
1409 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
1410
1411         Fixed #69195, #56821
1412         * ecore.cs (ResolveBoolean): Tiny refactoring.
1413
1414         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
1415         of right expression resolving when left is false constant and
1416         operator is LogicalAnd OR true constant and operator is LogicalOr.
1417
1418         * statement.cs (ResolveUnreachable): Always reports warning.
1419
1420 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
1421
1422         * class.cs: Distinguish between 1721 and 1722 (just a little help
1423         for the programmer).
1424
1425 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
1426
1427         * delegate.cs: Only allow this on new versions of the language. 
1428
1429 2004-12-02  Duncan Mak  <duncan@ximian.com>
1430
1431         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
1432         Expression class.
1433         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
1434         here as a static method. Take an additional bool out parameter
1435         `must_do_cs1540_check' for signaling to InstanceResolve.
1436         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
1437         member field from PropertyExpr class and made it an argument of
1438         the method instead.
1439         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
1440         check for MarshalByRefObject, and report CS0122 instead of CS1540.
1441         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
1442         and `remove_accessor' as well as InstanceResolve: report CS0122
1443         where applicable.
1444
1445         Fixes #70129.
1446
1447 2004-12-07  Martin Baulig  <martin@ximian.com>
1448
1449         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
1450         and CS0692 where appropriate.
1451
1452 2004-12-06  Martin Baulig  <martin@ximian.com>
1453
1454         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
1455         IsDuplicateImplementation() and improved it.
1456
1457         * expression.cs (Invocation.InferTypeArguments): Added
1458         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
1459         and removed the "ref" modifier from `infered_types'.
1460
1461         * decl.cs (MemberName.ToString): Removed the exception.
1462
1463 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
1464
1465         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
1466           comments are allowed.
1467
1468 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1469
1470         * delegate.cs: Add checks for subtypes in paramaters and return values
1471         in VerifyMethod () to add support for Covariance/Contravariance
1472         in delegates.
1473         
1474 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1475
1476         * report.cs: Remove extra closing parenthesis.
1477
1478         * convert.cs (Error_CannotImplicitConversion): If the name of the
1479         types are the same, provide some extra information.
1480
1481 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
1482
1483         Fix bug #70102
1484         * attribute.cs (Resolve): Improved implementation of params
1485         attribute arguments.
1486
1487         * support.cs (ParameterData): Add HasParams to be faster.
1488
1489 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
1490
1491         all things are for /doc support:
1492
1493         * doc.cs: new file that supports XML documentation generation.
1494         * mcs.exe.sources: added doc.cs.
1495         * driver.cs:
1496           Handle /doc command line option.
1497           Report error 2006 instead of 5 for missing file name for /doc.
1498           Generate XML documentation when required, after type resolution.
1499         * cs-tokenizer.cs:
1500           Added support for picking up documentation (/// and /** ... */),
1501           including a new XmlCommentState enumeration.
1502         * cs-parser.jay:
1503           Added lines to fill Documentation element for field, constant,
1504           property, indexer, method, constructor, destructor, operator, event
1505           and class, struct, interface, delegate, enum.
1506           Added lines to warn incorrect comment.
1507         * rootcontext.cs :
1508           Added Documentation field (passed only when /doc was specified).
1509         * decl.cs:
1510           Added DocComment, DocCommentHeader, GenerateDocComment() and
1511           OnGenerateDocComment() and some supporting private members for
1512           /doc feature to MemberCore.
1513         * class.cs:
1514           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
1515         * delegate.cs:
1516           Added overriden DocCommentHeader.
1517         * enum.cs:
1518           Added overriden DocCommentHeader and GenerateDocComment().
1519
1520 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
1521
1522         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
1523         unwrapping the enumeration values, chain to
1524         DoConstantNumericPromotions again, so we can promote things to the
1525         fundamental types (takes care of enums that are bytes, sbytes).
1526
1527         Fixes bug #62054.
1528
1529 2004-12-01  Raja R Harinath  <rharinath@novell.com>
1530
1531         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
1532         Fix long-standing bug in type-lookup.  Use FindType instead of
1533         LookupType when ec.ResolvingTypeTree.
1534         (Attribute.ResolveType, Attribute.Resolve)
1535         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
1536         Update to changes.
1537         (Attributes.Search): Remove internal version.  Update.
1538         (Attributes.SearchMulti): Update.
1539         (Attributes.GetClsCompliantAttribute): Remove.
1540         (Attributes.GetIndexerNameAttribute): Remove.
1541         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
1542         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
1543         * class.cs (Indexer.Define): Likewise.
1544
1545 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
1546
1547         Fix bug #68790
1548         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
1549         MarshallByReference members access.
1550
1551         * expression.cs: Use CheckMarshallByRefAccess;
1552         Better error CS0197 message.
1553
1554         * report.cs: Print whole related error message.
1555
1556 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1557
1558         * class (GetClassBases): Better error 60 report.
1559         (EventProperty): Disabled warning 67 detection.
1560
1561 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1562
1563         Fix bug #60324
1564         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
1565
1566         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
1567         precise values.
1568
1569 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
1570
1571         Fix bug #49488
1572         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
1573
1574         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
1575
1576 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
1577
1578         * attribute.cs (Attribute.Resolve): Refine error reporting and
1579         report a cs0117 if the identifier does not exist, to distinguish
1580         from 0617 which is a miss-use of the actual identifier.
1581
1582         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
1583         between cs0070 and cs0079.
1584
1585         * class.cs (MemberBase.DoDefine): When reporting a wrong
1586         accessibility level, we use MethodCore to compare instead of
1587         Method (this was a regression in some refactoring effort).
1588
1589         So now we correctly report cs0056 again.
1590
1591         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
1592         testing the target_type (which was known to be object_type) and
1593         not the source type (which is anonymous_method).
1594
1595         Fixed reporting of error cs1660.
1596
1597         * expression.cs (UserCast.Source): Expose the underlying cast.
1598
1599         * statement.cs (Switch.SwitchGoverningType): Sort the list of
1600         allowed types to find a match to int32 first (most common).
1601
1602         In addition, it ignores any ImplicitUserConversions that did an
1603         internal implicit conversion (as the switch statement allows only
1604         one integral conversion to exist).
1605
1606         * class.cs (PartialContainer.Create): rename `name' to
1607         `member_name' for clarity.  Then replace the string calls with a
1608         call to MemberName.GetPartialName, as now using
1609         MemberName.ToString is an error (this is due to the side effects
1610         it had, that were fixed in the past).
1611
1612         This will restore the error reporting on a number of partial class
1613         errors that were missusing this (and getting an exception as a
1614         results, which is now just a plain textual warning, because
1615         yyparse debug output would crash otherwise).
1616
1617 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1618
1619         * Makefile (PROGRAM_INSTALL_DIR): Remove.
1620
1621 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1622
1623         * rootcontext.cs (LookupType): Make sure to cache lookups that
1624         don't give us a negative result. This saves about 5% of corlib
1625         compilation time.
1626
1627 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1628
1629         * report.cs (AbstractMessage.Print): messages are sent to stderr
1630
1631         * class.cs (TypeContainer.GetClassBases): It is an error to have a
1632         non-interface in the list of interfaces (at this point, either
1633         parent was properly set, or a base class is being listed in the
1634         interfaces section).
1635
1636         This flags error 1722, and resolves the crash from bug 69259.
1637
1638 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
1639
1640         * statement.cs (Using.EmitExpressionFinally): make this work right
1641         for valuetypes. Fixes 69926.
1642
1643 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1644
1645         * const.cs (Const.ChangeType): Cope with the "0 literal can be
1646         converted to an enum" here, before we try to change the underlying
1647         type.  This code exists, but it is a different code path than the
1648         one used while encoding constants.
1649
1650         (ImplicitReferenceConversionExists): In addition, resynchronized
1651         the code here, so it matches the same code in
1652         ImplicitReferenceConversionExists for the `from any class-type S
1653         to any interface-type T'.       
1654
1655 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
1656
1657         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
1658
1659 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
1660
1661         * cs-parser.jay: Use verbosity accordingly. 
1662
1663 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1664
1665         * expression.cs (Unary.ResolveOperator): Do not report warning;
1666         AddressOf reads from variable.
1667         
1668         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
1669
1670 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
1671
1672         Fix bug #69462
1673
1674         * attribute.cs (Attributable): Removed CheckTargets.
1675         (Attributes.Emit): Explicit attribute targets are tested here.
1676
1677         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
1678         not enabled for interfaces.
1679
1680         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
1681         (GetAssemblyName): Ouch next bug there.
1682
1683 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1684
1685         * expression.cs: Error 275 added.
1686         
1687 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
1688
1689         Fix bug #69177 (Implemented decimal constant support)
1690
1691         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
1692         (BinaryFold): Add DecimalConstant.
1693
1694         * const.cs (Define): Decimal constant 
1695         (is not constant.
1696         (ChangeType): Add decimal type handling.
1697         (LookupConstantValue): Don't set value for decimal type but
1698         emit DecimalConstantAttribute. Needed for constant optimization.
1699
1700         * constant.cs (ToDecimal): New method.
1701         (ConvertToDecimal): New method.
1702         (IntConstant): Implemented ConvertToDecimal.
1703         (DecimalConstant.Emit): Emit optimized version for decimals in
1704         int range.
1705
1706         * expression.cs (ResolveOperator): Changed order of constant
1707         reduction to work correctly with native types which have
1708         overloaded operators.
1709         (ResolveMemberAccess): Extract constant value from attribute
1710         for decimal type.
1711
1712         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
1713
1714         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
1715         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
1716         (ChangeType): Decimal is special.
1717         (TypeToCoreType): Add decimal type.
1718
1719 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1720
1721         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
1722         decimal types.
1723
1724 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
1725
1726         * class.cs (EventField.ApplyAttributeBuilder): Fix error
1727         test cs1667-5.cs.
1728
1729 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1730
1731         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
1732
1733         * pending.cs (PendingImplementation): Grab only interfaces.
1734
1735 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
1736
1737         * statement.cs (ForeachHelperMethods): Add location member and
1738         error 202 detection.
1739
1740 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
1741
1742         * expression.cs (DoResolveBase): Fixed wrong warning for out
1743         variables.
1744
1745 2004-12-04  Martin Baulig  <martin@ximian.com>
1746
1747         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
1748         to check whether the conversion is ok.
1749
1750         * typemanager.cs (TypeManager.GetTypeArguments): Just return
1751         `Type.EmptyTypes' if we're not a generic TypeContainer.
1752
1753 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
1754
1755         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
1756         old bug: when converting from the null literal to a pointer,
1757         return an EmptyCast, not the NullLiteral.
1758
1759         This fixes #69921, the recent null_type changes probably made this
1760         bug more prominent.
1761
1762 2004-12-03  Martin Baulig  <martin@ximian.com>
1763
1764         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1765         method as our child, call AnonymousMethod.Compatible() on it.
1766
1767 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
1768
1769         * class.cs (FieldBase): Use an unused bit field from the field to
1770         encode the `has_offset' property from the FieldMember.  This saves
1771         a couple of Ks on bootstrap compilation.
1772
1773         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
1774         method as our child, return the AnonymousMethod resolved
1775         expression.
1776
1777         * expression.cs (New.DoResolve): Allow return values from
1778         NewDelegate to also include AnonymousMethods.
1779
1780         Fixes #70150.
1781
1782 2004-11-29  Raja R Harinath  <rharinath@novell.com>
1783
1784         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
1785         cs1648 report.
1786         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
1787         System.Runtime.InteropServices._Exception, since it's a base
1788         interface of the core type System.Exception in the net_2_0 profile.
1789
1790 2004-11-27  Martin Baulig  <martin@ximian.com>
1791
1792         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
1793
1794 2004-11-26  Raja R Harinath  <rharinath@novell.com>
1795
1796         * Makefile: Convert to use executable.make.
1797         * gmcs.exe.sources: New.
1798
1799 2004-11-25  Martin Baulig  <martin@ximian.com>
1800
1801         * expression.cs (Invocation.InferType): Added support for byref types.
1802
1803 2004-11-25  Martin Baulig  <martin@ximian.com>
1804
1805         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
1806         in TypeManager.TypeToCoreType().
1807
1808 2004-11-25  Martin Baulig  <martin@ximian.com>
1809
1810         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
1811         "Dispose" method from the `current_type'.
1812         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
1813         DoDefineMembers() instead of using the MethodBuilder; this is
1814         required for generic iterators.
1815
1816         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
1817
1818 2004-11-24  Martin Baulig  <martin@ximian.com>
1819
1820         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
1821
1822 2004-11-20  Martin Baulig  <martin@ximian.com>
1823
1824         * expression.cs (Invocation.InferType): Correctly infer generic
1825         instances; see gen-103.cs.
1826         (Invocation.InferTypeArguments): If a generic method doesn't have
1827         any unbound type parameters, we don't need to infer anything.
1828
1829 2004-11-19  Raja R Harinath  <rharinath@novell.com>
1830
1831         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
1832
1833 2004-11-17  Raja R Harinath  <rharinath@novell.com>
1834
1835         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
1836         (TypeHandle.GetMemberCache): New.
1837         (TypeHandle.TypeHandle): Update.
1838         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
1839         (TypeManager.LookupParentInterfacesCache):
1840         Rename from LookupInterfaceCache.  Optimize slightly.
1841         (TypeManager.MemberLookup_FindMembers): Update.
1842         * decl.cs (MemberCache.MemberCache): Set Container to null in the
1843         multi-type variant.
1844         (AddCacheContents): Rename from AddHashtable.
1845         * class.cs (TypeContainer.parent_container): Remove.
1846         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
1847         (TypeContainer.DoDefineMembers): Don't initialize it.
1848         Update to name changes.
1849         
1850 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
1851
1852         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
1853         that factors the code to check access modifiers on override.  
1854
1855         (PropertyBase): Use the code here.
1856
1857         Patch from Lluis S'anchez, fixes bug #69361.
1858
1859 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
1860
1861         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
1862         routine that is used to report the use of a captured variable
1863         whose address has been taken.
1864
1865         There are two checks: one when variables are being captured and
1866         the other check is when the address of a variable is taken. 
1867         
1868         (because an anonymous methods might be resolved before *or* after
1869         the address has been taken) and 
1870
1871         * expression.cs (Conditional.DoResolve): Remove the special
1872         casing that Martin added to trueExpr and falseExpr being both
1873         NullLiteral.  We get the right behavior now just by introducing
1874         the null_type into the compiler. 
1875
1876         * convert.cs (ExplicitConversion): Change the code to use
1877         null_type instead of testing `expr is NullLiteral'.
1878         (ImplicitConversionStandard): use null_type too.
1879         (ImplicitReferenceConversionExists): use null_type too.
1880         (ImplicitReferenceConversion): use null_type too.
1881
1882         * literal.cs: The type of `NullLiteral' is now null_type instead
1883         of object_type. 
1884         (Resolve): Set the type here.
1885
1886         * typemanager.cs: Introduce null_type.
1887
1888 2004-11-18  Martin Baulig  <martin@ximian.com>
1889
1890         * rootcontext.cs
1891         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
1892
1893 2004-11-18  Martin Baulig  <martin@ximian.com>
1894
1895         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
1896
1897 2004-11-18  Martin Baulig  <martin@ximian.com>
1898
1899         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
1900         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
1901         call ResolveConstructedType() on it to resolve it without checking
1902         constraints.
1903         (Constraints.ResolveTypes): Check them here.
1904         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
1905         but don't check constraints.
1906         (ConstructedType.ResolveAsTypeTerminal): Override this and also
1907         check constraints here.
1908         (ConstructedType.ResolveConstructedType): New public method.  This
1909         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
1910         resolve ourselves without checking constraints.
1911
1912         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
1913
1914 2004-11-18  Martin Baulig  <martin@ximian.com>
1915
1916         * decl.cs
1917         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
1918
1919         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
1920
1921 2004-11-18  Martin Baulig  <martin@ximian.com>
1922
1923         * ecore.cs (TypeExpr.ResolveType): Removed.
1924         (Expression.ResolveAsTypeTerminal): We always return a fully
1925         resolved `TypeExpr', so we can just access its `Type'.
1926
1927         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
1928
1929 2004-11-17  Martin Baulig  <martin@ximian.com>
1930
1931         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
1932         sure we don't return any unresolved TypeExpr's.
1933         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
1934         a `TypeExpr'.
1935         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
1936
1937         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
1938         unresolved `ConstructedType's.
1939
1940 2004-11-17  Martin Baulig  <martin@ximian.com>
1941
1942         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
1943
1944 2004-11-17  Martin Baulig  <martin@ximian.com>
1945
1946         * ecore.cs
1947         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
1948
1949         * decl.cs (DeclSpace.ResolveType): Removed.
1950         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
1951
1952 2004-11-17  Martin Baulig  <martin@ximian.com>
1953
1954         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
1955         direction, like FindMembers() does.  Fixes #69546, testcase is in
1956         test-315.cs.    
1957
1958 2004-11-16  Martin Baulig  <martin@ximian.com>
1959
1960         This is based on a patch from Marek Safar, see bug #69082.
1961         Fixes bugs #63705 and #67130.
1962
1963         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
1964         method; create a MemberCache for an interface type and cache the
1965         result.
1966
1967         * decl.cs (IMemberContainer.ParentContainer): Removed.
1968         (IMemberContainer.ParentCache): New property.
1969         (MemberCache.SetupCacheForInterface): Removed.
1970         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
1971         to create a cache for an interface's "parent".
1972
1973         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
1974         interfaces too.
1975
1976 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
1977
1978         * statement.cs: Avoid adding bools to a hashtable.
1979
1980 2004-11-15  Martin Baulig  <martin@ximian.com>
1981
1982         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
1983
1984 2004-11-11  Martin Baulig  <martin@ximian.com>
1985
1986         * typemanager.cs (TypeManager.GetMethodName): New method.
1987
1988         * class.cs (MethodData.Define): Include the generic arity in the
1989         name of an explicit interface; also add it to the method name.
1990
1991         * pending.cs (PendingImplementation.InterfaceMethod): The method
1992         name now includes the generic arity.
1993
1994 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
1995
1996         * expression.cs (Invocation.OverloadResolve): Flag error if we are
1997         calling an unsafe method from a safe location.
1998
1999 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
2000
2001         Fix #69167
2002         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
2003
2004 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
2005
2006         * namespace.cs (VerifyUsing): use GetPartialName instead of
2007         ToString. 
2008
2009 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
2010
2011         * statement.cs (Return.Resolve): Fix regression in typo: if
2012         `in_exc', we have to request a NeedReturnLabel, this was a typo
2013         introduced in the anonymous method check-in.  Fixes #69131.
2014
2015         * Indexers were using the ShortName when defining themselves,
2016         causing a regression in the compiler bootstrap when applying the
2017         patch from 2004-11-02 (first part), now they use their full name
2018         and the bug is gone.
2019
2020 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
2021
2022         * driver.cs: Strip the path from the names of embedded resources. Fixes
2023         #68519.
2024
2025 2004-11-04  Raja R Harinath  <rharinath@novell.com>
2026
2027         Fix error message regression: cs0104-2.cs.
2028         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
2029         (AliasEntry.Resolve): Update.
2030         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
2031         'silent' flag.
2032         (RootContext.LookupType): Update.
2033
2034 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
2035
2036         * cs-parser.jay: Add support for handling accessor modifiers
2037         * class: Add support port accessor modifiers and error checking,
2038         define PropertyMethod.Define as virtual (not abstract anymore)
2039         * ecore.cs: Add checking for proeprties access with access modifiers
2040         * iterators.cs: Modify Accessor constructor call based in the modified
2041         constructor
2042 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
2043
2044         * expression.cs (StringConcat): Handle being called twice,
2045         as when we have a concat in a field init with more than two
2046         ctors in the class
2047
2048 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
2049
2050         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
2051         special case explicit implementations, we should always produce
2052         the .property or .event declaration.
2053         
2054         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
2055         since it will not return correct data if people use this
2056         unresolved in the presence of using statements (see test-313).
2057
2058         * class.cs (MethodData.Define): If we are an explicit interface
2059         implementation, set the method name to the full name of the
2060         interface plus the name of the method.  
2061
2062         Notice that using the method.MethodName.GetFullName() does not
2063         work, as it will only contain the name as declared on the source
2064         file (it can be a shorthand in the presence of using statements)
2065         and not the fully qualifed type name, for example:
2066
2067         using System;
2068
2069         class D : ICloneable {
2070                 object ICloneable.Clone ()  {
2071                 }
2072         }
2073
2074         Would produce a method called `ICloneable.Clone' instead of
2075         `System.ICloneable.Clone'.
2076
2077         * namespace.cs (Alias.Resolve): Use GetPartialName.
2078         
2079 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2080
2081         * cs-parser.jay: Add error 1055 report.
2082
2083 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
2084
2085         * assign.cs (Assign.DoResolve): Only do the transform of
2086         assignment into a New if the types are compatible, if not, fall
2087         through and let the implicit code deal with the errors and with
2088         the necessary conversions. 
2089
2090 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
2091
2092         * cs-parser.jay: Add error 1031 report.
2093
2094         * cs-tokenizer.cs: Add location for error 1038.
2095
2096 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2097
2098         * cs-parser.jay: Add error 1016 report.
2099
2100 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2101
2102         * cs-parser.jay: Add errors 1575,1611 report.
2103
2104 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2105
2106         * cs-parser.jay: Add error 1001 report.
2107
2108 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2109
2110         Fix #68850
2111         * attribute.cs (GetMarshal): Add method argument for
2112         caller identification.
2113
2114         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
2115         agument for GetMarshal and RuntimeMissingSupport.
2116
2117 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
2118
2119         * attribute.cs (ExtractSecurityPermissionSet): Removed
2120         TypeManager.code_access_permission_type.
2121
2122         * typemanager.cs: Removed TypeManager.code_access_permission_type.
2123
2124 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
2125
2126         * expression.cs (LocalVariableReference.DoResolveLValue): Check
2127         for obsolete use of a variable here.   Fixes regression on errors
2128         cs0619-25 and cs0619-26.
2129
2130 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
2131
2132         Fix #62358, implemented security attribute encoding.
2133
2134         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
2135         Tests permitted SecurityAction for assembly or other types.
2136         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
2137         data from SecurityPermissionAttribute to PermisionSet class.
2138
2139         * class.cs (ApplyAttributeBuilder): Added special handling
2140         for System.Security.Permissions.SecurityAttribute based types.
2141
2142         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
2143         special handling for System.Security.Permissions.SecurityAttribute
2144         based types.
2145
2146         * enum.cs (ApplyAttributeBuilder): Added special handling
2147         for System.Security.Permissions.SecurityAttribute based types.
2148
2149         * parameter.cs (ApplyAttributeBuilder): Added special handling
2150         for System.Security.Permissions.SecurityAttribute based types.
2151
2152         * rootcontext.cs: Next 2 core types.
2153
2154         * typemanager.cs (TypeManager.security_permission_attr_type):
2155         Built in type for the SecurityPermission Attribute.
2156         (code_access_permission_type): Build in type.
2157
2158 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
2159
2160         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
2161         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
2162         all of this information into
2163         EmitContext.EmitCapturedVariableInstance.
2164         
2165         * codegen.cs (EmitCapturedVariableInstance): move here the
2166         funcionality of emitting an ldarg.0 in the presence of a
2167         remapping.   This centralizes the instance emit code.
2168
2169         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
2170         then emit a load of this: it means that we have reached the
2171         topmost ScopeInfo: the one that contains the pointer to the
2172         instance of the class hosting the anonymous method.
2173
2174         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
2175         captures to the topmost CaptureContext.
2176
2177 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
2178
2179         * expression.cs (LocalVariableReference): Move the knowledge about
2180         the iterators into codegen's EmitCapturedVariableInstance.
2181
2182 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
2183
2184         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
2185         all code paths return a value from an anonymous method (it is the
2186         same as the 161 error, but for anonymous methods).
2187
2188 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
2189
2190         The introduction of anonymous methods in the compiler changed
2191         various ways of doing things in the compiler.  The most
2192         significant one is the hard split between the resolution phase
2193         and the emission phases of the compiler.
2194
2195         For instance, routines that referenced local variables no
2196         longer can safely create temporary variables during the
2197         resolution phase: they must do so from the emission phase,
2198         since the variable might have been "captured", hence access to
2199         it can not be done with the local-variable operations from the runtime.
2200         
2201         * statement.cs 
2202
2203         (Block.Flags): New flag `IsTopLevel' to indicate that this block
2204         is a toplevel block.
2205
2206         (ToplevelBlock): A new kind of Block, these are the blocks that
2207         are created by the parser for all toplevel method bodies.  These
2208         include methods, accessors and anonymous methods.
2209
2210         These contain some extra information not found in regular blocks:
2211         A pointer to an optional CaptureContext (for tracking captured
2212         local variables and parameters).  A pointer to the parent
2213         ToplevelBlock.
2214         
2215         (Return.Resolve): Catch missmatches when returning a value from an
2216         anonymous method (error 1662).
2217         Invoke NeedReturnLabel from the Resolve phase instead of the emit
2218         phase.
2219
2220         (Break.Resolve): ditto.
2221
2222         (SwitchLabel): instead of defining the labels during the
2223         resolution phase, we now turned the public ILLabel and ILLabelCode
2224         labels into methods called GetILLabelCode() and GetILLabel() that
2225         only define the label during the Emit phase.
2226
2227         (GotoCase): Track the SwitchLabel instead of the computed label
2228         (its contained therein).  Emit the code by using
2229         SwitchLabel.GetILLabelCode ().
2230
2231         (LocalInfo.Flags.Captured): A new flag has been introduce to track
2232         whether the Local has been captured or not.
2233
2234         (LocalInfo.IsCaptured): New property, used to tell whether the
2235         local has been captured.
2236         
2237         * anonymous.cs: Vastly updated to contain the anonymous method
2238         support.
2239
2240         The main classes here are: CaptureContext which tracks any
2241         captured information for a toplevel block and ScopeInfo used to
2242         track the activation frames for various local variables.   
2243
2244         Each toplevel block has an optional capture context associated
2245         with it.  When a method contains an anonymous method both the
2246         toplevel method and the anonymous method will create a capture
2247         context.   When variables or parameters are captured, they are
2248         recorded on the CaptureContext that owns them, for example:
2249
2250         void Demo () {
2251              int a;
2252              MyDelegate d = delegate {
2253                  a = 1;
2254              }
2255         }
2256
2257         Here `a' will be recorded as captured on the toplevel
2258         CapturedContext, the inner captured context will not have anything
2259         (it will only have data if local variables or parameters from it
2260         are captured in a nested anonymous method.
2261
2262         The ScopeInfo is used to track the activation frames for local
2263         variables, for example:
2264
2265         for (int i = 0; i < 10; i++)
2266                 for (int j = 0; j < 10; j++){
2267                    MyDelegate d = delegate {
2268                         call (i, j);
2269                    }
2270                 }
2271
2272         At runtime this captures a single captured variable `i', but it
2273         captures 10 different versions of the variable `j'.  The variable
2274         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
2275         recorded on a child.  
2276
2277         The toplevel ScopeInfo will also track information like the `this'
2278         pointer if instance variables were referenced (this is necessary
2279         as the anonymous method lives inside a nested class in the host
2280         type of the method). 
2281
2282         (AnonymousMethod): Expanded to track the Toplevel, implement
2283         `AnonymousMethod.Compatible' to tell whether an anonymous method
2284         can be converted to a target delegate type. 
2285
2286         The routine now also produces the anonymous method content
2287
2288         (AnonymousDelegate): A helper class that derives from
2289         DelegateCreation, this is used to generate the code necessary to
2290         produce the delegate for the anonymous method that was created. 
2291
2292         * assign.cs: API adjustments for new changes in
2293         Convert.ImplicitStandardConversionExists.
2294
2295         * class.cs: Adjustments to cope with the fact that now toplevel
2296         blocks are of type `ToplevelBlock'. 
2297
2298         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
2299         insteda of standard blocks.
2300
2301         Flag errors if params arguments are passed to anonymous methods.
2302
2303         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
2304         `CurrentAnonymousMethod' which points to the current Anonymous
2305         Method.  The variable points to the AnonymousMethod class that
2306         holds the code being compiled.  It is set in the new EmitContext
2307         created for the anonymous method.
2308
2309         (EmitContext.Phase): Introduce a variable and an enumeration to
2310         assist in enforcing some rules about when and where we are allowed
2311         to invoke certain methods (EmitContext.NeedsReturnLabel is the
2312         only one that enfonces this right now).
2313
2314         (EmitContext.HaveCaptureInfo): new helper method that returns
2315         whether we have a CapturedContext initialized.
2316
2317         (EmitContext.CaptureVariable): New method used to register that a
2318         LocalInfo must be flagged for capturing. 
2319
2320         (EmitContext.CapturedParameter): New method used to register that a
2321         parameters must be flagged for capturing. 
2322         
2323         (EmitContext.CapturedField): New method used to register that a
2324         field must be flagged for capturing. 
2325
2326         (EmitContext.HaveCapturedVariables,
2327         EmitContext.HaveCapturedFields): Return whether there are captured
2328         variables or fields. 
2329
2330         (EmitContext.EmitMethodHostInstance): This is used to emit the
2331         instance for the anonymous method.  The instance might be null
2332         (static methods), this (for anonymous methods that capture nothing
2333         and happen to live side-by-side with the current method body) or a
2334         more complicated expression if the method has a CaptureContext.
2335
2336         (EmitContext.EmitTopBlock): Routine that drives the emission of
2337         code: it will first resolve the top block, then emit any metadata
2338         and then emit the code.  The split is done so that we can extract
2339         any anonymous methods and flag any captured variables/parameters.
2340         
2341         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
2342         during this phase, the ILGenerator should not be used as labels
2343         and local variables declared here might not be accessible to any
2344         code that is part of an anonymous method.  
2345
2346         Exceptions to this include the temporary variables that are
2347         created by some statements internally for holding temporary
2348         variables. 
2349         
2350         (EmitContext.EmitMeta): New routine, in charge of emitting all the
2351         metadata for a cb
2352
2353         (EmitContext.TemporaryReturn): This method is typically called
2354         from the Emit phase, and its the only place where we allow the
2355         ReturnLabel to be defined other than the EmitMeta.  The reason is
2356         that otherwise we would have to duplicate a lot of logic in the
2357         Resolve phases of various methods that today is on the Emit
2358         phase. 
2359
2360         (EmitContext.NeedReturnLabel): This no longer creates the label,
2361         as the ILGenerator is not valid during the resolve phase.
2362
2363         (EmitContext.EmitThis): Extended the knowledge in this class to
2364         work in anonymous methods in addition to iterators. 
2365
2366         (EmitContext.EmitCapturedVariableInstance): This emits whatever
2367         code is necessary on the stack to access the instance to a local
2368         variable (the variable will be accessed as a field).
2369
2370         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
2371         EmitContext.EmitAddressOfParameter): Routines to support
2372         parameters (not completed at this point). 
2373         
2374         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
2375         will also remove the parameters.
2376
2377         * convert.cs (Convert): Define a `ConstantEC' which points to a
2378         null.  This is just to prefity some code that uses
2379         ImplicitStandardConversion code and do not have an EmitContext
2380         handy.
2381
2382         The idea is to flag explicitly that at that point in time, it is
2383         known that the conversion will not trigger the delegate checking
2384         code in implicit conversions (which requires a valid
2385         EmitContext). 
2386
2387         Everywhere: pass new EmitContext parameter since
2388         ImplicitStandardConversionExists now requires it to check for
2389         anonymous method conversions. 
2390
2391         (Convert.ImplicitStandardConversionExists): If the type of an
2392         expression is the anonymous_method_type, and the type is a
2393         delegate, we invoke the AnonymousMethod.Compatible method to check
2394         whether an implicit conversion is possible. 
2395
2396         (Convert.ImplicitConversionStandard): Only do implicit method
2397         group conversions if the language level is not ISO_1.
2398
2399         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
2400         MethodInfo for the Invoke method.  used by Delegate and
2401         AnonymousDelegate.
2402
2403         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
2404         method conversions if the target type is a delegate.
2405
2406         Removed extra debugging nops.
2407
2408         (LocalVariableReference): Turn the `local_info' into a public
2409         field. 
2410
2411         Add `prepared' field, the same hack used for FieldExprs to cope
2412         with composed assignments, as Local variables do not necessarily
2413         operate purely on the stack as they used to: they can be captured
2414         fields. 
2415
2416         Add `temp' for a temporary result, like fields.
2417
2418         Refactor DoResolve and DoResolveLValue into DoResolveBase.
2419
2420         It now copes with Local variables that are captured and emits the
2421         proper instance variable to load it from a field in the captured
2422         case. 
2423
2424         (ParameterReference.DoResolveBase): During the resolve phase,
2425         capture parameters if we are in an anonymous method.
2426
2427         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
2428         anonymous method, use the EmitContext helper routines to emit the
2429         parameter reference.
2430
2431         * iterators.cs: Set RemapToProxy to true/false during the
2432         EmitDispose class.
2433
2434         * parameters.cs (GetParameterByName): New helper method. 
2435
2436         * typemanager.cs (anonymous_method_type) a new type that
2437         represents an anonyous method.  This is always an internal type,
2438         used as a fencepost to test against the anonymous-methodness of an
2439         expression. 
2440         
2441 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
2442
2443         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
2444         561 report.
2445         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
2446
2447 2004-11-10  Martin Baulig  <martin@ximian.com>
2448
2449         * expression.cs (Invocation.BetterFunction): If two methods have
2450         equal parameter types, but only one of them is generic, the
2451         non-generic one wins.
2452         (New.DoResolve): Don't set `is_struct' to false if we're a generic
2453         instance; just use `Type.IsValueType' to determine whether
2454         something is a struct or not.
2455         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
2456         so we can be called multiple times.
2457
2458 2004-11-10  Martin Baulig  <martin@ximian.com>
2459
2460         * generic.cs (TypeParameter.DefineConstraints): New public method.
2461         (TypeParameter.CheckAccessLevel): Override this and return true.
2462         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
2463         override ResolveType() anymore.
2464         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
2465
2466 2004-11-10  Martin Baulig  <martin@ximian.com>
2467
2468         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
2469         call DeclSpace.ResolveNestedType() on it.
2470
2471 2004-11-10  Martin Baulig  <martin@ximian.com>
2472
2473         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
2474         non-null, call ParameterModifier() on it.
2475
2476 2004-11-10  Martin Baulig  <martin@ximian.com>
2477
2478         * iterators.cs
2479         (Iterators): Added `current_type' and `this_type' fields.
2480         (Iterators.DefineIterator): Create a new EmitContext and store it
2481         in `ec'; compute `this_type'.
2482
2483 2004-11-10  Martin Baulig  <martin@ximian.com>
2484
2485         * typemanager.cs
2486         (TypeManager.IsPrivateAccessible): New public method.
2487         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
2488
2489 2004-11-10  Martin Baulig  <martin@ximian.com>
2490
2491         * class.cs (TypeContainer.DefineType): Call
2492         TypeBuilder.DefineGenericParameters() before resolving the type
2493         parameters.
2494         (MethodData.parent_method): New protected field.
2495         (MethodData..ctor): Added `MethodInfo parent_method' argument.
2496         (MethodData.Define): Compute `parent_method'.
2497
2498         * decl.cs
2499         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
2500         (MemberCore.GetClsCompliantAttributeValue): Likewise.
2501         (DeclSpace.ec): New protected field; store the EmitContext here.
2502         (DeclSpace.EmitContext): New public property.
2503         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
2504         (DeclSpace.ResolveNestedType): New public method.
2505         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
2506         (DeclSpace.NestedAccessible): Added `Type tb' argument.
2507         (DeclSpace.FamilyAccessible): Likewise.
2508         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
2509         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
2510         EmitContext.
2511
2512         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
2513         field.
2514
2515         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
2516         (Enum.Emit): Don't create a new EmitContext.
2517
2518 2004-10-18  Martin Baulig  <martin@ximian.com>
2519
2520         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
2521         `Type' directly, but call ResolveType() on it.
2522         (Catch.Resolve): Likewise.
2523         (Foreach.Resolve): Likewise.
2524
2525 2004-10-18  Martin Baulig  <martin@ximian.com>
2526
2527         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
2528         `Type' directly, but call ResolveType() on it.
2529         (Probe.DoResolve): Likewise.
2530         (ArrayCreation.LookupType): Likewise.
2531         (TypeOf.DoResolve): Likewise.
2532         (SizeOf.DoResolve): Likewise.
2533
2534 2004-10-18  Raja R Harinath  <rharinath@novell.com>
2535
2536         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
2537         the ResolveType.
2538
2539 2004-10-17  John Luke  <john.luke@gmail.com>
2540
2541         * class.cs (Operator.GetSignatureForError): use CSharpName
2542
2543         * parameter.cs (Parameter.GetSignatureForError): Returns
2544         correct name even if was not defined.
2545
2546 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2547
2548         Fix #65816.
2549         * class.cs (TypeContainer.EmitContext): New property.
2550         (DefineNestedTypes): Create an emitcontext for each part.
2551         (MethodCore.DoDefineParameters): Use container's emitcontext.
2552         Pass type array to InternalParameters.
2553         (MemberBase.DoDefine): Use container's emitcontext.
2554         (FieldMember.Define): Likewise.
2555         (Event.Define): Likewise.
2556         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2557         Pass type array to InternalParameters.
2558         (SetIndexerMethod.GetParameterInfo): Likewise.
2559         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2560         * delegate.cs (Define): Pass emitcontext to
2561         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2562         array to InternalParameters.
2563         * expression.cs (ParameterReference.DoResolveBase): Pass
2564         emitcontext to GetParameterInfo.
2565         (ComposedCast.DoResolveAsTypeStep): Remove check on
2566         ec.ResolvingTypeTree.
2567         * parameter.cs (Parameter.Resolve): Change argument to
2568         EmitContext.  Use ResolveAsTypeTerminal.
2569         (Parameter.GetSignature): Change argument to EmitContext.
2570         (Parameters.ComputeSignature): Likewise.
2571         (Parameters.ComputeParameterTypes): Likewise.
2572         (Parameters.GetParameterInfo): Likewise.
2573         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2574         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2575         * support.cs (InternalParameters..ctor): Remove variant that takes
2576         a DeclSpace.
2577         * typemanager.cs (system_intptr_expr): New.
2578         (InitExpressionTypes): Initialize it.
2579
2580 2004-10-12  Chris Toshok  <toshok@ximian.com>
2581
2582         * cs-parser.jay: fix location for try_statement and catch_clause.
2583
2584 2004-10-18  Martin Baulig  <martin@ximian.com>
2585
2586         * class.cs (FieldMember.Define): Don't access the TypeExpr's
2587         `Type' directly, but call ResolveType() on it.
2588         (MemberBase.DoDefine): Likewise.
2589
2590         * expression.cs (New.DoResolve): Don't access the TypeExpr's
2591         `Type' directly, but call ResolveType() on it.
2592         (ComposedCast.DoResolveAsTypeStep): Likewise.
2593
2594         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
2595         `Type' directly, but call ResolveType() on it.
2596
2597 2004-10-17  John Luke  <john.luke@gmail.com>
2598
2599         * class.cs (Operator.GetSignatureForError): use CSharpName
2600
2601         * parameter.cs (Parameter.GetSignatureForError): Returns
2602         correct name even if was not defined.
2603
2604 2004-10-13  Raja R Harinath  <rharinath@novell.com>
2605
2606         Fix #65816.
2607         * class.cs (TypeContainer.EmitContext): New property.
2608         (DefineNestedTypes): Create an emitcontext for each part.
2609         (MethodCore.DoDefineParameters): Use container's emitcontext.
2610         Pass type array to InternalParameters.
2611         (MemberBase.DoDefine): Use container's emitcontext.
2612         (FieldMember.Define): Likewise.
2613         (Event.Define): Likewise.
2614         (SetMethod.GetParameterInfo): Change argument to EmitContext.
2615         Pass type array to InternalParameters.
2616         (SetIndexerMethod.GetParameterInfo): Likewise.
2617         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
2618         * delegate.cs (Define): Pass emitcontext to
2619         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
2620         array to InternalParameters.
2621         * expression.cs (ParameterReference.DoResolveBase): Pass
2622         emitcontext to GetParameterInfo.
2623         (ComposedCast.DoResolveAsTypeStep): Remove check on
2624         ec.ResolvingTypeTree.
2625         * parameter.cs (Parameter.Resolve): Change argument to
2626         EmitContext.  Use ResolveAsTypeTerminal.
2627         (Parameter.GetSignature): Change argument to EmitContext.
2628         (Parameters.ComputeSignature): Likewise.
2629         (Parameters.ComputeParameterTypes): Likewise.
2630         (Parameters.GetParameterInfo): Likewise.
2631         (Parameters.ComputeAndDefineParameterTypes): Likewise.
2632         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
2633         * support.cs (InternalParameters..ctor): Remove variant that takes
2634         a DeclSpace.
2635         * typemanager.cs (system_intptr_expr): New.
2636         (InitExpressionTypes): Initialize it.
2637
2638 2004-10-12  Chris Toshok  <toshok@ximian.com>
2639
2640         * cs-parser.jay: fix location for try_statement and catch_clause.
2641
2642 2004-10-07  Raja R Harinath  <rharinath@novell.com>
2643
2644         More DeclSpace.ResolveType avoidance.
2645         * decl.cs (MemberCore.InUnsafe): New property.
2646         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
2647         with newly created EmitContext.
2648         (FieldMember.Define): Likewise.
2649         * delegate.cs (Delegate.Define): Likewise.
2650         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
2651         only if normal name-lookup fails.
2652         (TypeExpr.DoResolve): Enable error-checking.
2653         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
2654         (SizeOf.DoResolve): Likewise.
2655         (ComposedCast.DoResolveAsTypeStep): Likewise.
2656         (StackAlloc.DoResolve): Likewise.
2657         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
2658         (Block.Unsafe): New property.
2659         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
2660         (Unsafe): Set 'unsafe' flag of contained block.
2661         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
2662         (Fixed.Resolve): Likewise.
2663         (Catch.Resolve): Likewise.
2664         (Using.ResolveLocalVariableDecls): Likewise.
2665         (Foreach.Resolve): Likewise.
2666
2667 2004-10-05  John Luke <john.luke@gmail.com>
2668
2669         * cs-parser.jay: add location to error CS0175
2670
2671 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
2672
2673         * ecore.cs (Expression.Constantity): Add support for turning null
2674         into a constant.
2675
2676         * const.cs (Const.Define): Allow constants to be reference types
2677         as long as the value is Null.
2678
2679 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
2680
2681         * namespace.cs (NamespaceEntry.Using): No matter which warning
2682         level is set, check if this namespace name has already been added.
2683
2684 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
2685
2686         * expression.cs: reftype [!=]= null should always use br[true,false].
2687         # 67410
2688
2689 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
2690
2691         Fix #67108
2692         * attribute.cs: Enum conversion moved to 
2693         GetAttributeArgumentExpression to be applied to the all
2694         expressions.
2695
2696 2004-10-01  Raja R Harinath  <rharinath@novell.com>
2697
2698         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
2699         * class.c (TypeContainer.DefineType): Flag error if
2700         base types aren't accessible due to access permissions.
2701         * decl.cs (DeclSpace.ResolveType): Move logic to
2702         Expression.ResolveAsTypeTerminal.
2703         (DeclSpace.ResolveTypeExpr): Thin layer over
2704         Expression.ResolveAsTypeTerminal.
2705         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
2706         Refactor code into NestedAccess.  Use it.
2707         (DeclSpace.NestedAccess): New.
2708         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
2709         argument to silence errors.  Check access permissions.
2710         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
2711         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
2712         (Cast.DoResolve): Likewise.
2713         (New.DoResolve): Likewise.
2714         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
2715         (TypeOf.DoResolve): Likewise.
2716
2717         * expression.cs (Invocation.BetterConversion): Return the Type of
2718         the better conversion.  Implement section 14.4.2.3 more faithfully.
2719         (Invocation.BetterFunction): Make boolean.  Make correspondence to
2720         section 14.4.2.2 explicit.
2721         (Invocation.OverloadResolve): Update.
2722         (Invocation): Remove is_base field.
2723         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
2724         (Invocation.Emit): Likewise.
2725
2726 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
2727
2728         * cs-parser.jay: Reverted 642 warning fix.
2729
2730 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2731
2732         Fix bug #66615
2733         * decl.cs (FindMemberWithSameName): Indexer can have more than
2734         1 argument.
2735
2736 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2737
2738         * expression.cs (LocalVariableReference.DoResolveLValue):
2739         Do not report warning 219 for out values.
2740         (EmptyExpression.Null): New member to avoid extra allocations.
2741
2742 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2743
2744         * cs-parser.jay: Fix wrong warning 642 report.
2745
2746         * cs-tokenizer.cs (CheckNextToken): New helper;
2747         Inspect next character if is same as expected.
2748
2749 2004-09-23  Martin Baulig  <martin@ximian.com>
2750
2751         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2752         (Convert.ImplicitReferenceConversionExists): Likewise.
2753
2754 2004-11-09  Raja R Harinath  <rharinath@novell.com>
2755
2756         * Makefile (DISTFILES): Comment out a few missing files.
2757
2758 2004-10-29  Raja R Harinath  <rharinath@novell.com>
2759
2760         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
2761         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
2762         (gmcs.exe): Invoke bootstrap-libs.
2763         (clean-local): Clean the net_2_0_bootstrap profile too.
2764         (PROGRAM_INSTALL_DIR): New.
2765         (install-local): Use it.
2766
2767 2004-10-13  Martin Baulig  <martin@ximian.com>
2768
2769         * generic.cs (TypeManager.InflatedConstraints): New nested class.
2770         (TypeParameter.DefineType): If we're a method type parameter and
2771         that method is overriding something, "inflate" its constraints.
2772
2773 2004-10-12  Martin Baulig  <martin@ximian.com>
2774
2775         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
2776         and have type arguments, create and resolve a ConstructedType.
2777
2778 2004-10-12  Martin Baulig  <martin@ximian.com>
2779
2780         * decl.cs (MemberCache.FindMemberToOverride): Use
2781         TypeManager.IsEqual() to compare the parameters and Type.Equals()
2782         to compare the invocationType.
2783
2784         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
2785         When comparing two type parameters, only do the signature-only
2786         comparision for method type parameters.
2787
2788 2004-10-11  Martin Baulig  <martin@ximian.com>
2789
2790         * report.cs: Don't make --fatal abort on warnings, we have
2791         -warnaserror for that.
2792
2793 2004-10-11  Martin Baulig  <martin@ximian.com>
2794
2795         * typemanager.cs
2796         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
2797         (TypeManager.IsEqual): Call ourself recursively instead of using
2798         Type.IsEqual(). 
2799
2800 2004-10-11  Martin Baulig  <martin@ximian.com>
2801
2802         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
2803         on our own type parameters, not on the ones we inherit from a containing
2804         class.
2805
2806         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
2807         the comparision.
2808
2809         * generic.cs (TypeParameter.Define): We may only be called once.
2810
2811         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
2812         instead of TypeManager.IsEqual().
2813
2814 2004-09-28  Martin Baulig  <martin@ximian.com>
2815
2816         * generic.cs
2817         (GenericConstraints.EffectiveBaseClass): New public property.
2818         (TypeParameter.GenericConstraints): New public property.
2819         (ConstructedType.CheckConstraints): Improved.
2820
2821         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
2822         (Convert.TypeParameterConversion): New private method; use this in
2823         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
2824         for all conversions related to type parameters.
2825
2826 2004-09-24  Martin Baulig  <martin@ximian.com>
2827
2828         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
2829         type parameter conversions for type parameters which are known to
2830         be reference types.
2831
2832 2004-09-24  Martin Baulig  <martin@ximian.com>
2833
2834         * generic.cs (GenericConstraints): Added `IsReferenceType' and
2835         `IsValueType' properties.
2836
2837         * support.cs (ReflectionConstraints): Use
2838         Type.GetGenericParameterConstraints() instead of the old hack.
2839
2840 2004-09-24  Martin Baulig  <martin@ximian.com>
2841
2842         * generic.cs (GenericConstraints): Moved here and made it an
2843         abstract class.
2844
2845         * support.cs (GenericConstraints): Moved to generic.cs.
2846
2847 2004-09-24  Martin Baulig  <martin@ximian.com>
2848
2849         * support.cs
2850         (ReflectionConstraints): Un-nested this class and made it public.
2851
2852         * typemanager.cs
2853         (TypeManager.GetTypeParameterConstraints): New public method.
2854         (TypeManager.HasConstructorConstraint): Use the attributes.
2855
2856 2004-09-24  Martin Baulig  <martin@ximian.com>
2857
2858         * support.cs (GenericConstraints): Replaced `HasConstructor',
2859         `IsReferenceType' and `IsValueType' with `Attributes'.
2860         (ReflectionParameters.ReflectionConstraints): Removed the Create()
2861         method and made the .ctor public.
2862
2863         * generic.cs (Constraints.Attributes): New public property.
2864         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
2865         `IsReferenceType' -> `HasReferenceTypeConstraint' and
2866         `IsValueType' -> `HasValueTypeConstraint'.
2867
2868 2004-09-23  Martin Baulig  <martin@ximian.com>
2869
2870         * generic.cs (Constraints): Reflect latest runtime changes.
2871
2872 2004-09-23  Martin Baulig  <martin@ximian.com>
2873
2874         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
2875         (Convert.ImplicitReferenceConversionExists): Likewise.
2876
2877 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
2878
2879         * class.cs (Operator.Define): Add error 448 and 559 report.
2880         
2881 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2882
2883         * class.cs (MemberBase.IsTypePermitted): New protected
2884         method for checking error CS0610.
2885
2886 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2887
2888         * class.cs (TypeContainer.HasExplicitLayout): New property
2889         Returns whether container has StructLayout attribute set Explicit.
2890         (FieldMember): New abstract class for consts and fields.
2891         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
2892         (Field): Reuse FieldMember.
2893
2894         * const.cs (Const): Reuse FieldMember.
2895
2896         * rootcontext.cs: EmitConstants call moved to class.
2897
2898 2004-09-22  Martin Baulig  <martin@ximian.com>
2899
2900         Marek and me just fixed one of our oldest bugs: #28562 :-)
2901
2902         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
2903
2904         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
2905         we're an EnumConstant, just return that.
2906         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
2907         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
2908         to get the value which'll actually be written into the attribute.
2909         However, we have to use GetValue() to access the attribute's value
2910         in the compiler.        
2911
2912 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
2913
2914         * constant.cs (Constant.IsNegative): New abstract property
2915         IsNegative.
2916
2917         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
2918         (StackAlloc.DoResolve): Reused IsNegative.
2919
2920 2004-09-22  Martin Baulig  <martin@ximian.com>
2921
2922         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
2923         public method; like LookupTypeContainer, but also works for
2924         generic instances.
2925
2926         * report.cs (Report.SymbolRelatedToPreviousError): Use
2927         TypeManager.LookupGenericTypeContainer().       
2928
2929 2004-09-22  Martin Baulig  <martin@ximian.com>
2930
2931         Thanks to Peter Sestoft for this bug report.
2932
2933         * expression.cs (Conditional): If both the `trueExpr' and the
2934         `falseExpr' is a NullLiteral, return a NullLiteral.
2935
2936 2004-09-22  Martin Baulig  <martin@ximian.com>
2937
2938         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
2939         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
2940         for the "get_Current" call.
2941
2942 2004-09-21  Martin Baulig  <martin@ximian.com>
2943
2944         * convert.cs (Convert.ImplicitReferenceConversion): When
2945         converting to an interface type, first check whether we're
2946         converting from a reference type.
2947
2948 2004-09-14  Martin Baulig  <martin@ximian.com>
2949
2950         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
2951
2952 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
2953
2954         Fixed bug #61902
2955         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
2956         called and is obsolete then this member suppress message
2957         when call is inside next [Obsolete] method or type.
2958
2959         * expression.cs: Use TestObsoleteMethodUsage member.
2960
2961 2004-09-14  Martin Baulig  <martin@ximian.com>
2962
2963         * genericparser.cs: Removed.
2964
2965 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
2966
2967         * class.cs (MethodCore.CheckBase): Fix bug #65757.
2968
2969 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
2970
2971         * attribute.cs (Attribute.Resolve): Add error 653 report.
2972
2973         * class.cs (Class.ApplyAttributeBuilder): Add error 641
2974         report.
2975         (Method.ApplyAttributeBuilder): Add error 685 report.
2976         (Operator.Define): Add error 564 report.
2977
2978         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
2979
2980         * expression.cs (Invocation.DoResolve): Add error
2981         245 and 250 report.
2982
2983         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
2984         error 674 report.
2985
2986 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2987
2988         * class.cs (ConstructorInitializer.Resolve):
2989         Wrong error number (515->516).
2990
2991 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2992
2993         * class.cs (Indexer.Define): Add error 631 report.
2994
2995 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
2996
2997         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
2998
2999 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
3000
3001         * expression.cs (Probe.DoResolve): Add error CS0241 report.
3002
3003 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
3004
3005         * cs-parser.jay: Added error CS0241 report.
3006
3007 2004-09-10  Raja R Harinath  <rharinath@novell.com>
3008
3009         * cs-parser.jay (fixed_statement): Introduce a scope for the
3010         declaration in the 'fixed' statement.
3011
3012 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3013
3014         * cs-parser.jay: Added CS0230 error report.
3015
3016 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3017
3018         * cs-parser.jay: Added errors CS0231 and CS0257 report.
3019
3020 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3021
3022         * expression.cs (Argument.Resolve): Added error CS0192 and
3023         CS0199 report.
3024
3025 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
3026
3027         C# 2.0 #pragma warning feature
3028
3029         * cs-tokenizer.cs (PreProcessPragma): New method; 
3030         Handles #pragma directive.
3031
3032         * report.cs (WarningRegions): New class; Support
3033         class for #pragma warning directive. It tests whether
3034         warning is enabled for a given line.
3035
3036 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
3037
3038         * const.cs: Add more descriptive error report, tahnks to
3039         Sebastien. 
3040
3041 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
3042
3043         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
3044
3045 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
3046
3047         * expression.cs: Apply patch from Ben: Remove dead code from
3048         ArrayCreation, and remove the TurnintoConstant call in const.cs,
3049         as that code just threw an exception anwyays.
3050
3051         * const.cs: Remove the call to the turnintoconstant, for details
3052         see bug: #63144
3053         
3054         * literal.cs: The type of the null-literal is the null type;  So
3055         we use a placeholder type (literal.cs:System.Null, defined here)
3056         for it.
3057
3058         * expression.cs (Conditional.DoResolve): Remove some old code that
3059         is no longer needed, conversions have been fixed.
3060
3061         (ArrayCreationExpression.DoResolve): Return false if we fail to
3062         resolve the inner expression.
3063
3064 2004-09-07  Raja R Harinath  <rharinath@novell.com>
3065
3066         Fix test-290.cs.
3067         * cs-parser.jay (delegate_declaration): Record a delegate
3068         declaration as a type declaration.
3069         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
3070
3071 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
3072
3073         * parameter.cs: Do not crash if the type can not be resolved. 
3074
3075         * expression.cs: Report errors with unsafe pointers, fixes #64896
3076
3077 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
3078
3079         * expression.cs: Pointer arith always needs to do a conv.i
3080         if the operand is a long. fix 65320
3081
3082 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3083
3084         Fixed cs0619-37.cs, cs0619-38.cs
3085
3086         * enum.cs (GetObsoleteAttribute): Removed.
3087
3088         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
3089         on Enum member is double staged. The first is tested member
3090         and then enum.
3091
3092 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
3093
3094         Fixed #56986, #63631, #65231
3095
3096         * class.cs: (TypeContainer.AddToMemberContainer): New method,
3097         adds member to name container.
3098         (TypeContainer.AddToTypeContainer): New method, adds type to
3099         name container.
3100         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
3101         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
3102         AddOperator): Simplified by reusing AddToMemberContainer.
3103         (TypeContainer.UserDefinedStaticConstructor): Changed to property
3104         instead of field.
3105         (Method.CheckForDuplications): Fixed implementation to test all
3106         possibilities.
3107         (MemberBase): Detection whether member is explicit interface
3108         implementation is now in constructor.
3109         (MemberBase.UpdateMemberName): Handles IndexerName.
3110         (Accessor): Changed to keep also location information.
3111         (AbstractPropertyEventMethod): Is derived from MemberCore.
3112         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
3113         will be emited or not.
3114         (PropertyBase.AreAccessorsDuplicateImplementation):
3115         Tests whether accessors are not in collision with some method.
3116         (Operator): Is derived from MethodCore to simplify common
3117         operations.
3118
3119         * decl.cs (Flags.TestMethodDuplication): Test for duplication
3120         must be performed.
3121         (DeclSpace.AddToContainer): Adds the member to defined_names
3122         table. It tests for duplications and enclosing name conflicts.
3123
3124         * enum.cs (EnumMember): Clean up to reuse the base structures
3125
3126 2004-09-03  Martin Baulig  <martin@ximian.com>
3127
3128         Merged latest changes into gmcs.  Please keep this comment in
3129         here, it makes it easier for me to see what changed in MCS since
3130         the last time I merged.
3131
3132 2004-09-03  Martin Baulig  <martin@ximian.com>
3133
3134         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
3135         into TypeContainer, to make partial classes work again.
3136
3137 2004-09-03  Martin Baulig  <martin@ximian.com>
3138
3139         * rootcontext.cs (RootContext.V2): Removed.
3140
3141 2004-03-23  Martin Baulig  <martin@ximian.com>
3142
3143         * expression.cs (Invocation.OverloadResolve): Added `bool
3144         may_fail' argument and use it instead of the Location.IsNull() hack.
3145
3146 2004-09-09  Martin Baulig  <martin@ximian.com>
3147
3148         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
3149
3150 2004-09-09  Martin Baulig  <martin@ximian.com>
3151
3152         * generic.cs (TypeParameter.DefineType): Added support for
3153         explicit interface methods.
3154
3155 2004-09-09  Martin Baulig  <martin@ximian.com>
3156
3157         * README.Changes: New document.  Started to list important changes
3158         between MCS and GMCS here.
3159
3160 2004-09-08  Martin Baulig  <martin@ximian.com>
3161
3162         * class.cs
3163         (TypeContainer.CheckRecursiveDefinition): New protected method.
3164         (TypeContainer.DefineType): Move the CS0146 check into
3165         CheckRecursiveDefinition().     
3166
3167 2004-09-06  Martin Baulig  <martin@ximian.com>
3168
3169         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
3170         types for the constructor constraint.
3171
3172 2004-09-03  Martin Baulig  <martin@ximian.com>
3173
3174         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
3175         into TypeContainer, to make partial classes work again.
3176
3177 2004-09-03  Martin Baulig  <martin@ximian.com>
3178
3179         * rootcontext.cs (RootContext.V2): Removed.
3180
3181 2004-03-23  Martin Baulig  <martin@ximian.com>
3182
3183         * expression.cs (Invocation.OverloadResolve): Added `bool
3184         may_fail' argument and use it instead of the Location.IsNull() hack.
3185
3186 2004-09-03  Martin Baulig  <martin@ximian.com>
3187
3188         Merged latest changes into gmcs.  Please keep this comment in
3189         here, it makes it easier for me to see what changed in MCS since
3190         the last time I merged.
3191
3192 2004-09-03  Raja R Harinath  <rharinath@novell.com>
3193
3194         Fix #61128.
3195         * expression.cs (BetterConversion): Don't allow either conversion 
3196         to be null.  Remove redundant implicit conversion test when 'q ==
3197         null' -- when this function is invoked, we already know that the
3198         implicit conversion exists.
3199         (BetterFunction): Assume that 'best' is non-null.  Remove
3200         redundant reimplementation of IsApplicable when 'best' is null.
3201         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
3202         number of arguments.
3203         (IsAncestralType): Extract from OverloadResolve.
3204         (OverloadResolve): Make robust to the MethodGroupExpr being
3205         unsorted.  Implement all the logic of Section 14.5.5.1, and
3206         support overloading of methods from multiple applicable types.
3207         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
3208
3209         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
3210         (RealError, Warning): Append type of report to related symbol.
3211
3212 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
3213
3214         * enum.cs: Fixed CLS-Compliance checks for enum members.
3215         Error tests cs3008-8.cs, cs3014-8.cs
3216
3217 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3218
3219         Fixed bug #62342, #63102
3220         * class.cs: ImplementIndexer uses member.IsExplicitImpl
3221         like ImplementMethod.
3222
3223 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
3224
3225         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3226         Fixed bug #65170.
3227
3228 2004-09-02  Martin Baulig  <martin@ximian.com>
3229
3230         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3231         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3232         on the MethodBase.
3233
3234 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
3235
3236         C# 2.0 Static classes implemented
3237
3238         * class.cs (TypeContainer): instance_constructors,
3239         initialized_fields, initialized_static_fields,
3240         default_constructor, base_inteface_types are protected to be
3241         accessible from StaticClass.
3242         (TypeContainer.DefineDefaultConstructor): New virtual method
3243         for custom default constructor generating
3244         (StaticClass): New class to handle "Static classes" feature.
3245
3246         * cs-parser.jay: Handle static keyword on class like instance
3247         of StaticClass.
3248
3249         * driver.cs: Added "/langversion" command line switch with two
3250         options (iso-1, default).
3251
3252 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
3253
3254         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
3255
3256 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
3257
3258         * delegate.cs: Style.
3259
3260 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
3261
3262         * delegate.cs: Add seperate instance expr field for miguel.
3263
3264 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3265
3266         * PointerArithmetic (Resolve): make sure we are not doing
3267         pointer arith on void*. Also, make sure we are resolved
3268         by not setting eclass until resolve.
3269
3270         All callers: Make sure that PointerArithmetic gets resolved.
3271
3272 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
3273
3274         * ArrayCreation (LookupType): If the type does not resolve 
3275         to an array, give an error.
3276
3277 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
3278
3279         * statement.cs (Try.Resolve): Fixed bug #64222
3280
3281 2004-08-27  Martin Baulig  <martin@ximian.com>
3282
3283         * class.cs
3284         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3285         crash here.     
3286
3287 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3288
3289         * ecore.cs (Constantify): Get underlying type via
3290         System.Enum.GetUnderlyingType to avoid StackOverflow on the
3291         Windows in special cases.
3292
3293 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
3294
3295         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
3296         for obtaining also private methods.
3297         (GetRemoveMethod): Used GetRemoveMethod (true)
3298         for obtaining also private methods.
3299
3300 2004-09-02  Martin Baulig  <martin@ximian.com>
3301
3302         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
3303         TypeManager.GetArgumentTypes() rather than calling GetParameters()
3304         on the MethodBase.
3305
3306 2004-08-27  Martin Baulig  <martin@ximian.com>
3307
3308         * class.cs
3309         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
3310         crash here.     
3311
3312 2004-08-25  Martin Baulig  <martin@ximian.com>
3313
3314         * support.cs (ReflectionParameters..ctor): If this is a generic
3315         method, retrieve and store its type parameters.
3316         (InternalParameters..ctor): Added `TypeParameter[]' argument.
3317         (ReflectionParameters.GenericConstraints): The argument specifies
3318         the type parameter, not the method parameter.
3319         (InternalParameters.GenericConstraints): Likewise.
3320
3321         * generic.cs (TypeParameter.DefineType): Correctly handle
3322         constraints wrt. generic methods in interfaces and their
3323         implementations.        
3324
3325 2004-08-24  Martin Baulig  <martin@ximian.com>
3326
3327         * generic.cs (TypeParameter.IsSubclassOf): New public method.
3328         (Constraints.IsSubclassOf): New internal method.
3329
3330         * typemanager.cs (TypeManager.FindMembers): Added special support
3331         for GenericTypeParameterBuilder's.      
3332         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
3333         type parameters.
3334
3335 2004-08-24  Martin Baulig  <martin@ximian.com>
3336
3337         * typemanager.cs
3338         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
3339         this for accessibility checks.
3340         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
3341         IsNestedFamilyAccessible.
3342         (TypeManager.IsSubclassOf): New method, do what the name actually
3343         says.   
3344
3345 2004-08-24  Martin Baulig  <martin@ximian.com>
3346
3347         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
3348         as a SimpleName, include the generic arity.
3349
3350 2004-08-24  Martin Baulig  <martin@ximian.com>
3351
3352         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
3353         MethodAttributes.HideBySig for operators.
3354
3355 2004-08-23  Martin Baulig  <martin@ximian.com>
3356
3357         Back to the old error reporting system :-)
3358
3359         * report.cs (Message): Removed.
3360         (Report.MessageData, ErrorData, WarningData): Removed.
3361         (Report.Error, Warning): Back to the old system.
3362
3363 2004-08-23  Martin Baulig  <martin@ximian.com>
3364
3365         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
3366
3367         * class.cs (TypeContainer.ParentContainer): New public virtual
3368         method; replaces the explicit interface implementation.
3369         (ClassPart.ParentContainer): Override.
3370
3371 2004-08-23  Martin Baulig  <martin@ximian.com>
3372
3373         * statement.cs (Switch): Added support for constant switches; see
3374         #59428 or test-285.cs.
3375
3376 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3377
3378         Fixed bug #62740.
3379         * statement.cs (GetEnumeratorFilter): Removed useless
3380         logic because C# specs is strict. GetEnumerator must be
3381         public.
3382
3383 2004-08-22  Martin Baulig  <martin@ximian.com>
3384
3385         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3386         a switch and may break, reset the barrier.  Fixes #59867.
3387
3388 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
3389
3390         CLS-Compliance speed up (~5% for corlib)
3391
3392         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
3393         New method. Tests container for CLS-Compliant names
3394
3395         * class.cs (TypeContainer.VerifyClsName): New method.
3396         Checks whether container name is CLS Compliant.
3397         (Constructor): Implements IMethodData.
3398
3399         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
3400         low-case table for CLS Compliance test.
3401         (MemberCache.VerifyClsParameterConflict): New method.
3402         Checks method parameters for CS3006 error.
3403
3404         * enum.cs (EnumMember): Is derived from MemberCore.
3405         (Enum.VerifyClsName): Optimized for better performance.
3406
3407 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3408
3409         * report.cs: Renamed Error_T to Error and changed all
3410         references.
3411
3412 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
3413
3414         * class.cs (TypeContainer.IndexerArrayList): New inner class
3415         container for indexers.
3416         (TypeContainer.DefaultIndexerName): New constant for default
3417         indexer name. Replaced all "Item" with this constant.
3418         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
3419
3420         * typemanager.cs (TypeManager.default_member_ctor): Cache here
3421         DefaultMemberAttribute constructor.
3422
3423 2004-08-05  Martin Baulig  <martin@ximian.com>
3424
3425         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3426         Fix bug #59429.
3427
3428 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
3429
3430         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
3431         multi platforms problem.
3432
3433         * compiler.csproj: Included shared files.
3434
3435 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3436
3437         Fix bug 60333, 55971 in the more general way
3438         * attribute.cs (Attribute.GetAttributeArgumentExpression):
3439         Added arg_type argument for constant conversion.
3440         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
3441
3442 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3443
3444         Fix bug #59760
3445         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
3446         OperatorArrayList, MethodCoreArrayList for typecontainer
3447         containers. Changed class member types to these new types.
3448         (MethodArrayList.DefineMembers): Added test for CS0659.
3449
3450 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
3451
3452         * cfold.cs: Synchronize the folding with the code in expression.cs
3453         Binary.DoNumericPromotions for uint operands.
3454
3455         * attribute.cs: Revert patch from Raja, it introduced a regression
3456         while building Blam-1.2.1 (hard to isolate a test case).
3457
3458 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
3459
3460         Fix for #55382
3461         * class.cs:
3462         (TypeContainer.Define): Renamed to DefineContainerMembers because of
3463         name collision.
3464         (MethodCore.parent_method): New member. The method we're overriding
3465         if this is an override method.
3466         (MethodCore.CheckBase): Moved from Method class and made common.
3467         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
3468         private.
3469         (MethodCore.CheckForDuplications): New abstract method. For custom
3470         member duplication search in a container
3471         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
3472         method and its return type.
3473         (Event.conflict_symbol): New member. Symbol with same name in the
3474         parent class.
3475
3476         * decl.cs:
3477         (MemberCache.FindMemberWithSameName): New method. The method
3478         is looking for conflict with inherited symbols.
3479
3480 2004-08-04  Martin Baulig  <martin@ximian.com>
3481
3482         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3483
3484         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3485
3486 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3487
3488         * report.cs (Message): New enum for better error, warning reference in
3489         the code.
3490         (MessageData): New inner abstract class. It generally handles printing of
3491         error and warning messages.
3492         Removed unused Error, Warning, Message methods.
3493
3494 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3495
3496         Fix for cs0592-8.cs test
3497         * attribute.cs
3498         (Attributable.ValidAttributeTargets): Made public.
3499         (Attribute.ExplicitTarget): New member for explicit target value.
3500         (Attribute.CheckTargets): Now we translate explicit attribute
3501         target to Target here.
3502
3503 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
3504
3505         * ecore.cs (MethodGroupExpr): new IsBase property.
3506
3507         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
3508
3509         * delegate.cs (DelegateCreation): store a MethodGroupExpr
3510         rather than an instance expr.
3511
3512         (DelegateCreation.Emit): Use the method group rather than
3513         the instance expression. Also, if you have base.Foo as the
3514         method for a delegate, make sure to emit ldftn, not ldftnvirt.
3515
3516         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
3517
3518         (NewDelegate.DoResolve): Only check for the existance of Invoke
3519         if the method is going to be needed. Use MethodGroupExpr.
3520
3521         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
3522
3523         * expression.cs: For pointer arith., make sure to use
3524         the size of the type, not the size of the pointer to
3525         the type.
3526
3527 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
3528
3529         Fix for #60722
3530         * class.cs (Class): Added error CS0502 test.
3531
3532 2004-08-03  John Luke  <jluke@cfl.rr.com>
3533             Raja R Harinath  <rharinath@novell.com>
3534
3535         Fix for #60997.
3536         * attribute.cs (Attribute.complained_before): New flag.
3537         (Attribute.ResolveType, Attribute.Resolve),
3538         (Attribute.DefinePInvokeMethod): Set it.
3539         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
3540         
3541 2004-08-03  Martin Baulig  <martin@ximian.com>
3542
3543         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3544         use a user-defined operator; we still need to do numeric
3545         promotions in case one argument is a builtin type and the other
3546         one has an implicit conversion to that type.  Fixes #62322.
3547
3548 2004-08-18  Martin Baulig  <martin@ximian.com>
3549
3550         * class.cs (Method.Define): Use the correct method name when
3551         creating the MethodBuilder for a generic method.
3552
3553 2004-08-17  Martin Baulig  <martin@ximian.com>
3554
3555         * generic.cs (Constraints): Support type parameter constraints.
3556
3557 2004-08-16  Martin Baulig  <martin@ximian.com>
3558
3559         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
3560         (Token.GENERIC_DIMENSION): New token; this is returned if we
3561         encounter an unbound generic type in a typeof() expression.
3562
3563         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
3564         this token is only generated while parsing a typeof() expression.
3565         (typeof_expression): Removed the old unbound_type hack.
3566
3567         * generic.cs (TypeArguments.IsUnbound): New public property.
3568
3569         * decl.cs (MemberName): Added support for unbound types.
3570
3571 2004-08-14  Martin Baulig  <martin@ximian.com>
3572
3573         * typemanager.cs
3574         (TypeManager.IsEqualGenericInstance): New static method.
3575         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
3576         just used to check accessibility, so follow the rules of 26.1.6.        
3577
3578         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
3579         ConstructedType instead of a TypeExpression if we have type arguments.
3580
3581         * cs-parser.jay (typeof_expression): Support unbound generic types.
3582
3583         * ecore.cs (UnboundTypeExpression): New public class.
3584
3585 2004-08-12  Martin Baulig  <martin@ximian.com>
3586
3587         * typemanager.cs (TypeManager.IsNestedChildOf): Use
3588         TypeManager.IsEqual() rather than `=='.
3589
3590         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
3591         generic instances as well.
3592
3593 2004-08-12  Martin Baulig  <martin@ximian.com>
3594
3595         * expression.cs (Invocation.InferType): We can only infer method
3596         type parameters.  Fixes #62647.
3597
3598 2004-08-11  Martin Baulig  <martin@ximian.com>
3599
3600         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
3601         before resolving the base classes.
3602
3603 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
3604
3605         * Makefile: install .mdb file too.
3606
3607 2004-08-05  Martin Baulig  <martin@ximian.com>
3608
3609         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
3610         initializer, the current type is just the TypeBuilder, not the
3611         instantiated generic type.
3612         (FieldExpr.IsFieldInitializer): New public property.
3613
3614 2004-08-04  Martin Baulig  <martin@ximian.com>
3615
3616         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
3617
3618         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
3619
3620 2004-08-03  Martin Baulig  <martin@ximian.com>
3621
3622         * class.cs (MethodData.Define): If we're an explicit
3623         implementation, remove the generic arity from the type name.
3624
3625 2004-08-03  Martin Baulig  <martin@ximian.com>
3626
3627         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
3628         use a user-defined operator; we still need to do numeric
3629         promotions in case one argument is a builtin type and the other
3630         one has an implicit conversion to that type.  Fixes #62322.
3631
3632 2004-08-02  Martin Baulig  <martin@ximian.com>
3633
3634         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
3635         `TypeExpr[]' array.
3636         (TypeContainer.GetClassBases): Return the unexpanded list of
3637         interfaces; we expand them later.
3638         (TypeContainer.DefineType): After creating the TypeBuilder, call
3639         TypeManager.ExpandInterfaces() to get an expanded and resolved
3640         list of interfaces.
3641
3642         * ecore.cs (TypeExpr.GetInterfaces): Removed
3643
3644         * generics.cs (Constraints.InterfaceConstraints): Remove.
3645         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
3646         register the interface constraints.
3647
3648         * typemanager.cs
3649         (TypeManager.AddUserType): Removed the `ifaces' argument.
3650         (TypeManager.AddTypeParameter): Likewise.
3651         (TypeManager.AddUserInterface): Removed, was unused.
3652         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
3653         `TypeExpr[]' array for the interfaces.
3654         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
3655         has been defined, returns a list of the resolved interfaces types.
3656         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
3657         (TypeManager.GetExplicitInterfaces): Likewise.  
3658
3659 2004-08-02  Martin Baulig  <martin@ximian.com>
3660
3661         * expression.cs (Invocation.EmitCall): If we're invoking a method
3662         on a type parameter, use the new `Constrained' prefix opcode.
3663
3664 2004-08-02  Martin Baulig  <martin@ximian.com>
3665
3666         * statement.cs (LocalInfo.Flags): Added `IsThis'.
3667         (LocalInfo.IsThis): New public property.
3668         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
3669
3670 2004-08-01  Martin Baulig  <martin@ximian.com>
3671
3672         * class.cs (TypeContainer.GetClassBases): Don't set the default
3673         here since we may get called from GetPartialBases().
3674         (TypeContainer.DefineType): If GetClassBases() didn't return a
3675         parent, use the default one.
3676
3677 2004-07-30  Martin Baulig  <martin@ximian.com>
3678
3679         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
3680
3681         * class.cs (SourceMethod): New public class, derive from the
3682         symbol writer's ISourceMethod.
3683         (Method): Use the new symbol writer API.
3684
3685         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
3686         as argument and use the new symbol writer.
3687
3688         * location.cs
3689         (SourceFile): Implement the symbol writer's ISourceFile.
3690         (Location.SymbolDocument): Removed.
3691         (Location.SourceFile): New public property.
3692
3693         * symbolwriter.cs: Use the new symbol writer API.
3694
3695 2004-07-30  Raja R Harinath  <rharinath@novell.com>
3696
3697         * Makefile (install-local): Remove.  Functionality moved to
3698         executable.make.
3699
3700 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
3701
3702         * Makefile: Install mcs.exe.config file together with mcs.exe.
3703         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
3704         correct runtime version.
3705         
3706 2004-07-25  Martin Baulig  <martin@ximian.com>
3707
3708         * class.cs
3709         (TypeContainer.RegisterOrder): Removed, this was unused.
3710         (TypeContainer, interface_order): Removed.
3711         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
3712         TypeContainer as argument since we can also be called with a
3713         `PartialContainer' for a partial class/struct/interface.
3714         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
3715         of checking whether we're an `Interface' - we could be a
3716         `PartialContainer'.
3717         (PartialContainer.Register): Override; call
3718         AddClass()/AddStruct()/AddInterface() on our parent.
3719
3720         * cs-parser.jay (interface_member_declaration): Add things to the
3721         `current_container', not the `current_class'.
3722
3723         * rootcontext.cs (RegisterOrder): The overloaded version which
3724         takes an `Interface' was unused, removed.
3725
3726         * typemanager.cs (TypeManager.LookupInterface): Return a
3727         `TypeContainer', not an `Interface'.
3728         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
3729         contain a `PartialContainer' for an interface, so check it's
3730         `Kind' to figure out what it is.
3731
3732 2004-07-25  Martin Baulig  <martin@ximian.com>
3733
3734         * class.cs (Class.DefaultTypeAttributes): New public constant.
3735         (Struct.DefaultTypeAttributes): Likewise.
3736         (Interface.DefaultTypeAttributes): Likewise.
3737         (PartialContainer.TypeAttr): Override this and add the
3738         DefaultTypeAttributes.
3739
3740 2004-07-25  Martin Baulig  <martin@ximian.com>
3741
3742         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
3743         we can just use the `Parent' field instead.
3744
3745 2004-07-25  Martin Baulig  <martin@ximian.com>
3746
3747         * class.cs (TypeContainer.Emit): Renamed to EmitType().
3748
3749 2004-07-25  Martin Baulig  <martin@ximian.com>
3750
3751         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
3752         our parts before defining any methods.
3753         (TypeContainer.VerifyImplements): Make this virtual.
3754         (ClassPart.VerifyImplements): Override and call VerifyImplements()
3755         on our PartialContainer.
3756
3757 2004-07-25  Martin Baulig  <martin@ximian.com>
3758
3759         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
3760
3761         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
3762         argument, we can just use the `Parent' field instead.
3763
3764         * class.cs
3765         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
3766         (MemberBase.DoDefine): Likewise.
3767
3768 2004-07-24  Martin Baulig  <martin@ximian.com>
3769
3770         * decl.cs (MemberCore.Parent): New public field.
3771         (DeclSpace.Parent): Moved to MemberCore.
3772
3773         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
3774         (MemberBase.ctor): Added TypeContainer argument, pass it to our
3775         parent's .ctor.
3776         (FieldBase, Field, Operator): Likewise.
3777         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
3778         (EventField, Event): Likewise.
3779
3780 2004-07-23  Martin Baulig  <martin@ximian.com>
3781
3782         * class.cs (PartialContainer): New public class.
3783         (ClassPart): New public class.
3784         (TypeContainer): Added support for partial classes.
3785         (TypeContainer.GetClassBases): Splitted some of the functionality
3786         out into GetNormalBases() and GetPartialBases().
3787
3788         * cs-tokenizer.cs (Token.PARTIAL): New token.
3789         (Tokenizer.consume_identifier): Added some hacks to recognize
3790         `partial', but only if it's immediately followed by `class',
3791         `struct' or `interface'.
3792
3793         * cs-parser.jay: Added support for partial clases.
3794
3795 2004-07-23  Martin Baulig  <martin@ximian.com>
3796
3797         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
3798         a `DeclSpace' and also made it readonly.
3799         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
3800         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
3801         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
3802
3803         * cs-parser.jay: Pass the `current_class', not the
3804         `current_container' (at the moment, this is still the same thing)
3805         to a new Method, Property, Event, Indexer or Constructor.
3806
3807 2004-07-23  Martin Baulig  <martin@ximian.com>
3808
3809         * cs-parser.jay (CSharpParser): Added a new `current_class' field
3810         and removed the `current_interface' one.
3811         (struct_declaration, class_declaration, interface_declaration):
3812         Set `current_class' to the newly created class/struct/interface;
3813         set their `Bases' and call Register() before parsing their body.
3814
3815 2004-07-23  Martin Baulig  <martin@ximian.com>
3816
3817         * class.cs (Kind): New public enum.
3818         (TypeContainer): Made this class abstract.
3819         (TypeContainer.Kind): New public readonly field.
3820         (TypeContainer.CheckDef): New public method; moved here from
3821         cs-parser.jay.
3822         (TypeContainer.Register): New public abstract method.
3823         (TypeContainer.GetPendingImplementations): New public abstract
3824         method.
3825         (TypeContainer.GetClassBases): Removed the `is_class' and
3826         `is_iface' parameters.
3827         (TypeContainer.DefineNestedTypes): Formerly known as
3828         DoDefineType().
3829         (ClassOrStruct): Made this class abstract.
3830
3831         * tree.cs (RootTypes): New public type. 
3832
3833 2004-07-20  Martin Baulig  <martin@ximian.com>
3834
3835         * tree.cs (Tree.RecordNamespace): Removed.
3836         (Tree.Namespaces): Removed.
3837
3838         * rootcontext.cs (RootContext.IsNamespace): Removed.
3839
3840         * cs-parser.jay (namespace_declaration): Just create a new
3841         NamespaceEntry here.
3842
3843 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
3844
3845         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
3846         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
3847         entry to make sure it runs in the correct runtime version.
3848         
3849 2004-07-18  Martin Baulig  <martin@ximian.com>
3850
3851         * generic.cs (ConstructedType.CheckConstraints): Improved
3852         constraints checking.
3853
3854 2004-07-18  Martin Baulig  <martin@ximian.com>
3855
3856         * expression.cs (Invocation.BetterMethod): Call
3857         TypeManager.TypeToCoreType() on all types and removed my previous
3858         hack; we're already doig the right thing here.
3859
3860 2004-07-17  Martin Baulig  <martin@ximian.com>
3861
3862         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
3863
3864 2004-07-16  Martin Baulig  <martin@ximian.com>
3865
3866         * iterators.cs: Added generics support.
3867
3868 2004-07-16  Martin Baulig  <martin@ximian.com>
3869
3870         * iterators.cs: Rewrote this.  We're now using one single Proxy
3871         class for both the IEnumerable and the IEnumerator interface and
3872         `Iterator' derives from Class so we can use the high-level API.
3873
3874         * class.cs (TypeContainer.AddIterator): New method.
3875         (TypeContainer.DoDefineType): New protected virtual method, which
3876         is called from DefineType().
3877         (TypeContainer.DoDefineMembers): Call DefineType() and
3878         DefineMembers() on all our iterators.
3879         (TypeContainer.Emit): Call Emit() on all our iterators.
3880         (TypeContainer.CloseType): Call CloseType() on all our iterators.
3881
3882         * codegen.cs (EmitContext.CurrentIterator): New public field.
3883
3884 2004-07-15  Martin Baulig  <martin@ximian.com>
3885
3886         * typemanager.cs
3887         (TypeManager.not_supported_exception_type): New type.   
3888
3889 2004-07-14  Martin Baulig  <martin@ximian.com>
3890
3891         * typemanager.cs
3892         (TypeManager.generic_ienumerable_type): New type.
3893         (TypeManager.generic_ienumerator_type): New type.
3894
3895         * rootcontext.cs
3896         (RootContext.interfaces_first_stage): Added
3897         "System.Collections.Generic.IEnumerator`1" and
3898         "System.Collections.Generic.IEnumerable`1".     
3899
3900 2004-07-14  Martin Baulig  <martin@ximian.com>
3901
3902         * iterators.cs: Use real error numbers.
3903
3904 2004-07-14  Martin Baulig  <martin@ximian.com>
3905
3906         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
3907         requires this to be a System.Collection.IEnumerable and not a
3908         class implementing that interface.
3909         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
3910
3911 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
3912
3913         * class.cs: Fixed previous fix, it broke some error tests.
3914
3915 2004-07-12  Martin Baulig  <martin@ximian.com>
3916
3917         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
3918         Fixes #61293.
3919
3920 2004-07-14  Martin Baulig  <martin@ximian.com>
3921
3922         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
3923         an exclamation mark (!) for the generic arity to reflect the
3924         latest spec changes; ie. use "System.Collections.Generic.IList`1".
3925
3926 2004-07-13  Martin Baulig  <martin@ximian.com>
3927
3928         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
3929         specifiers being part of a type argument.
3930
3931 2004-07-13  Martin Baulig  <martin@ximian.com>
3932
3933         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
3934         name for generic types.
3935
3936 2004-07-13  Martin Baulig  <martin@ximian.com>
3937
3938         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
3939         bit to fix #60119.
3940
3941 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
3942
3943         * assign.cs (LocalTemporary): Add new argument: is_address,If
3944         `is_address' is true, then the value that we store is the address
3945         to the real value, and not the value itself.
3946         
3947         * ecore.cs (PropertyExpr): use the new local temporary
3948         stuff to allow us to handle X.Y += z (where X is a struct)
3949
3950 2004-07-08  Martin Baulig  <martin@ximian.com>
3951
3952         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
3953         not always return, just like we're doing in Using.Resolve().
3954
3955 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
3956
3957         * cs-parser.jay (fixed_statement): flag this as Pinned.
3958
3959 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
3960
3961         * typemanager.cs (TypeManager): Removed MakePinned method, this
3962         mechanism is replaced with the .NET 2.x compatible mechanism of
3963         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
3964
3965         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
3966         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
3967         `IsFixed' property which has a different meaning.
3968
3969 2004-07-02  Raja R Harinath  <rharinath@novell.com>
3970
3971         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
3972         visible from inside a nested class, not just the names of the
3973         immediately enclosing class.
3974         Fix for bug #60730.
3975
3976 2004-06-24  Raja R Harinath  <rharinath@novell.com>
3977
3978         * expression.cs (BetterConversion): Remove buggy special-case
3979         handling of "implicit constant expression conversions".  At this
3980         point, we already know that the conversion is possible -- we're
3981         only checking to see which is better.
3982
3983 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3984
3985         * cs-parser.jay: Added error CS0210 test.
3986
3987 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3988
3989         * cs-parser.jay: Added error CS0134 test.
3990
3991 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3992
3993         Fix bug #52507
3994         * cs-parser.jay: Added error CS0145 test.
3995
3996 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
3997
3998         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
3999
4000 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
4001         
4002         * expression.cs (StackAlloc.Resolve): The argument may not
4003         be a constant; deal with this case.
4004         
4005 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
4006
4007         * attribute.cs (IndexerName_GetIndexerName): Renamed to
4008         GetIndexerAttributeValue.
4009         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
4010
4011         * class.cs (Indexer.Define): Added error tests for CS0415,
4012         CS0609.
4013
4014 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
4015
4016         * attribute.cs (Attribute.Resolve): Keep field code in sync with
4017         property code.
4018
4019 2004-06-23  Martin Baulig  <martin@ximian.com>
4020
4021         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
4022         neither return nor throw, reset the barrier as well.  Fixes #60457.
4023
4024 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
4025
4026         * class.cs : EventAttributes is now set to None by default.
4027           This fixes bug #60459.
4028
4029 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
4030
4031         Fix bug #60219
4032         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4033         Don't throw exception but return null (it's sufficient now).
4034
4035 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
4036
4037         * typemanager.cs (GetArgumentTypes): Faster implementation.
4038
4039 2004-06-18  Martin Baulig  <martin@ximian.com>
4040
4041         * attribute.cs (Attribute.Resolve): Check whether we're an
4042         EmptyCast which a Constant child.  Fixes #60333.
4043
4044 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
4045
4046         * statement.cs (EmitCollectionForeach): Account for the fact that
4047         not all valuetypes are in areas which we can take the address of.
4048         For these variables, we store to a temporary variable. Also, make
4049         sure that we dont emit a `callvirt' on a valuetype method.
4050
4051 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4052
4053         * expression.cs (StackAlloc.DoReSolve): Added test for
4054         negative parameter (CS0247).
4055
4056 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4057
4058         Fix bug #59792
4059         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
4060
4061 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
4062
4063         Fix bug #59781
4064         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
4065         ulong.
4066
4067 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
4068
4069         Fix bug #58254 & cs1555.cs, cs1556.cs
4070         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
4071
4072 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
4073
4074         * cs-parser.jay: Added error CS1669 test for indexers.
4075
4076 2004-06-18  Martin Baulig  <martin@ximian.com>
4077
4078         * generics.cs (GenericMethod.ctor): Don't take an Attributes
4079         argument.  Fixes #60441.
4080
4081 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
4082         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
4083         The name needs to have the actual name of the method in order
4084         for other tests (such as the one in OverloadResolve for Invoke
4085         on a delegate) to work. As well, it does not really help
4086         error reporting because the method group had multiple methods.
4087         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
4088         Make profiling work.
4089         
4090 2004-06-13  Martin Baulig  <martin@ximian.com>
4091
4092         * cs-parser.jay: Don't allow generic attributes.
4093
4094 2004-06-13  Martin Baulig  <martin@ximian.com>
4095
4096         * class.cs (MemberBase.DoDefineBase): New protected method.
4097         (MemberBase.DoDefine): Compute the `flags' in the new
4098         DoDefineBase() which must be called first.
4099         (Method.Define): Call DoDefineBase() first so we have the flags
4100         when defining the generic method.
4101
4102         * cs-parser.jay (interface_method_declaration): Support generic methods.
4103
4104 2004-06-13  Martin Baulig  <martin@ximian.com>
4105
4106         * decl.cs (TypeName): Removed.
4107         (MemberName): Removed TypeName and MemberNow; now we just have
4108         MemberName.
4109
4110         * cs-parser.jay: Don't distinguish between type arguments and type
4111         parameters in the grammar and simplified the rules a bit.  The
4112         reduce/reduce conflicts are now gone (except the one we inherited
4113         from mcs).
4114
4115 2004-06-11  Martin Baulig  <martin@ximian.com>
4116
4117         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
4118         call this twice: for params and varargs methods.
4119
4120 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4121
4122         * class.cs:
4123         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
4124
4125 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
4126
4127         * attribute.cs (Attribute.GetValidTargets): Made public.
4128
4129         * class.cs: 
4130         (AbstractPropertyEventMethod): New class for better code sharing.
4131         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
4132         CS1667 report.
4133         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
4134
4135 2004-06-09  Martin Baulig  <martin@ximian.com>
4136
4137         * cs-parser.jay: Removed a reduce/reduce conflict.
4138
4139 2004-06-03  Martin Baulig  <martin@ximian.com>
4140
4141         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
4142         GetSimpleName() and return a SimpleName.
4143
4144         * ecore.cs (SimpleName.Arguments): New public field.
4145         (SimpleName): Added overloaded ctor which takes an additional
4146         TypeArguments argument.
4147         (SimpleName.SimpleNameResolve): Added support for generic methods.
4148         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
4149         formerly in MemberAccess.DoResolve(), but we also need it in
4150         SimpleNameResolve().
4151
4152         * expression.cs (MemberAccess.DoResolve): Use the new
4153         MethodGroupExpr.ResolveGeneric().       
4154
4155 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4156
4157         * decl.cs: If possible, use lookuptypedirect here. We can only do
4158         this if there is no `.' after the namespace. Avoids using
4159         LookupType, which does lots of slow processing.
4160         (FindNestedType) New method, does what it says :-).
4161         * namespace.cs: use LookupTypeDirect.
4162         * rootcontext.cs: use membercache, if possible.
4163         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4164
4165 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4166
4167         * expression.cs:
4168         According to the spec, 
4169
4170         In a member access of the form E.I, if E is a single identifier,
4171         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4172         field, property, localvariable, or parameter with the same type as
4173         the meaning of E as a type-name (§3.8), then both possible
4174         meanings of E are permitted.
4175
4176         We did not check that E as a simple-name had the same type as E as
4177         a type name.
4178
4179         This trivial check gives us 5-7% on bootstrap time.
4180
4181 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4182
4183         * expression.cs (Invocation.OverloadResolve): Avoid the
4184         use of hashtables and boxing here by allocating on demand.
4185
4186 2004-05-30  Martin Baulig  <martin@ximian.com>
4187
4188         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4189         we're doing a silent lookup.  Don't try to lookup nested types in
4190         TypeManager.object_type (thanks to Ben Maurer).
4191
4192 2004-05-30  Martin Baulig  <martin@ximian.com>
4193
4194         Committing a patch from Ben Maurer.
4195
4196         * rootcontext.cs (RootContext.LookupType): Cache negative results.
4197
4198 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4199
4200         * convert.cs: add a trivial cache for overload operator resolution.
4201
4202 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
4203
4204         * attribute.cs
4205         (AttributeTester.GetObsoleteAttribute): Returns instance of
4206         ObsoleteAttribute when type is obsolete.
4207
4208         * class.cs
4209         (TypeContainer.VerifyObsoleteAttribute): Override.
4210         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
4211         (MethodCode.VerifyObsoleteAttribute): Override.
4212         (MemberBase.VerifyObsoleteAttribute): Override.
4213
4214         * decl.cs
4215         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
4216         and report proper error.
4217
4218         *delegate.cs
4219         (Delegate.VerifyObsoleteAttribute): Override.
4220
4221         * ecore.cs
4222         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
4223         and report proper error.
4224         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
4225
4226         * enum.cs
4227         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
4228         and enum member.
4229
4230         * expression.cs
4231         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
4232         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
4233         Added test for ObsoleteAttribute.
4234
4235         * statement.cs
4236         (Catch): Derived from Statement.
4237
4238 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4239
4240         * decl.cs: If possible, use lookuptypedirect here. We can only do
4241         this if there is no `.' after the namespace. Avoids using
4242         LookupType, which does lots of slow processing.
4243         (FindNestedType) New method, does what it says :-).
4244         * namespace.cs: use LookupTypeDirect.
4245         * rootcontext.cs: use membercache, if possible.
4246         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
4247
4248 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4249
4250         * expression.cs:
4251         According to the spec, 
4252
4253         In a member access of the form E.I, if E is a single identifier,
4254         and if the meaning of E as a simple-name (§7.5.2) is a constant,
4255         field, property, localvariable, or parameter with the same type as
4256         the meaning of E as a type-name (§3.8), then both possible
4257         meanings of E are permitted.
4258
4259         We did not check that E as a simple-name had the same type as E as
4260         a type name.
4261
4262         This trivial check gives us 5-7% on bootstrap time.
4263
4264 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4265
4266         Fixed bug #59071 & cs0160.cs
4267         * statement.cs (Try.Resolve): Check here whether order of catch
4268         clauses matches their dependencies.
4269
4270 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
4271
4272         Fixed bug #58624
4273         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
4274         unsafe type.
4275
4276 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
4277
4278         * expression.cs (Invocation.OverloadResolve): Avoid the
4279         use of hashtables and boxing here by allocating on demand.
4280
4281 2004-05-30  Martin Baulig  <martin@ximian.com>
4282
4283         * rootcontext.cs (RootContext.LookupType): Don't cache things if
4284         we're doing a silent lookup.  Don't try to lookup nested types in
4285         TypeManager.object_type (thanks to Ben Maurer).
4286
4287 2004-05-30  Martin Baulig  <martin@ximian.com>
4288
4289         Committing a patch from Ben Maurer.
4290
4291         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
4292
4293 2004-05-29  Martin Baulig  <martin@ximian.com>
4294
4295         * class.cs (IMethodData.ShouldIgnore): New method.
4296
4297         * typemanager.cs (TypeManager.MethodFlags): Don't take a
4298         `Location' argument, we don't need it anywhere.  Use
4299         `IMethodData.ShouldIgnore ()' instead of
4300         `MethodData.GetMethodFlags ()'.
4301         (TypeManager.AddMethod): Removed.
4302         (TypeManager.AddMethod2): Renamed to AddMethod.
4303
4304 2004-05-29  Martin Baulig  <martin@ximian.com>
4305
4306         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
4307
4308         * convert.cs (Convert.ImplicitReferenceConversion): If we're
4309         converting from a class type S to an interface type and we already
4310         have an object on the stack, don't box it again.  Fixes #52578.
4311
4312 2004-05-29  Martin Baulig  <martin@ximian.com>
4313
4314         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
4315         Added support for `params' parameters.  Fixes #59267.
4316
4317 2004-05-29  Martin Baulig  <martin@ximian.com>
4318
4319         * literal.cs (NullPointer): Provide a private .ctor which sets
4320         `type' to TypeManager.object_type.  Fixes #59048.
4321
4322 2004-05-29  Martin Baulig  <martin@ximian.com>
4323
4324         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
4325         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
4326
4327         * ecore.cs (EventExpr.instance_expr): Make the field private.
4328
4329 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
4330
4331         Fixed bug #50080 & cs0214-2.cs
4332         * expression.cs (Cast.DoResolve): Check unsafe context here.
4333         
4334         * statement.cs (Resolve.DoResolve): Likewise.
4335
4336 2004-05-26  Martin Baulig  <martin@ximian.com>
4337
4338         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
4339
4340         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
4341         (RootContext.LookupType): Pass down the `silent' flag.
4342
4343 2004-05-25  Martin Baulig  <martin@ximian.com>
4344
4345         * expression.cs
4346         (MethodGroupExpr.IdenticalTypeName): New public property.
4347         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
4348         expression actually refers to a type.
4349
4350 2004-05-25  Martin Baulig  <martin@ximian.com>
4351
4352         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
4353         for #56176 and made it actually work.
4354
4355 2004-05-25  Martin Baulig  <martin@ximian.com>
4356
4357         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
4358         (FieldExpr, PropertyExpr): Override and implement
4359         CacheTemporaries.  Fixes #52279.
4360
4361 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
4362
4363         * location.cs: In the new compiler listing a file twice is a
4364         warning, not an error.
4365
4366 2004-05-24  Martin Baulig  <martin@ximian.com>
4367
4368         * enum.cs (Enum.DefineType): For the `BaseType' to be a
4369         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
4370
4371 2004-05-24  Martin Baulig  <martin@ximian.com>
4372
4373         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
4374         walking the `using' list.  Fixes #53921.
4375
4376 2004-05-24  Martin Baulig  <martin@ximian.com>
4377
4378         * const.cs (Const.LookupConstantValue): Added support for
4379         EmptyCast's; fixes #55251.
4380
4381 2004-05-24  Martin Baulig  <martin@ximian.com>
4382
4383         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
4384         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
4385         which does the CS0135 check.  The reason is that we first need to
4386         check whether the variable actually exists.
4387
4388 2004-05-24  Martin Baulig  <martin@ximian.com>
4389
4390         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
4391         than RootContext.LookupType() to find the explicit interface
4392         type.  Fixes #58584.
4393
4394 2004-05-24  Raja R Harinath  <rharinath@novell.com>
4395
4396         * Makefile: Simplify.  Use executable.make.
4397         * mcs.exe.sources: New file.  List of sources of mcs.exe.
4398
4399 2004-05-24  Anders Carlsson  <andersca@gnome.org>
4400
4401         * decl.cs:
4402         * enum.cs:
4403         Use the invariant culture when doing String.Compare for CLS case
4404         sensitivity.
4405         
4406 2004-05-23  Martin Baulig  <martin@ximian.com>
4407
4408         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
4409         don't have any dots.  Fixes #52622, added cs0246-8.cs.
4410
4411         * namespace.cs (NamespaceEntry.Lookup): Likewise.
4412
4413 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4414
4415         * class.cs (MemberBase.Define): Reuse MemberType member for 
4416         resolved type. Other methods can use it too.
4417
4418 2004-05-23  Martin Baulig  <martin@ximian.com>
4419
4420         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
4421         the variable also exists in the current block (otherwise, we need
4422         to report a CS0103).  Fixes #58670.
4423
4424 2004-05-23  Martin Baulig  <martin@ximian.com>
4425
4426         * flowanalysis.cs (Reachability.Reachable): Compute this
4427         on-the-fly rather than storing it as a field.
4428
4429 2004-05-23  Martin Baulig  <martin@ximian.com>
4430
4431         * flowanalysis.cs (Reachability.And): Manually compute the
4432         resulting `barrier' from the reachability.      
4433        
4434 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
4435
4436         Fix bug #57835
4437         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
4438         instance of ObsoleteAttribute when symbol is obsolete.
4439
4440         * class.cs
4441         (IMethodData): Extended interface for ObsoleteAttribute support.
4442
4443 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4444
4445         * attribute.cs: Fix bug #55970
4446
4447 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
4448
4449         Fix bug #52705
4450         * attribute.cs
4451         (GetObsoleteAttribute): New method. Creates the instance of
4452         ObsoleteAttribute.
4453         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
4454         ObsoleteAttribute when member is obsolete.
4455         (AttributeTester.Report_ObsoleteMessage): Common method for
4456         Obsolete error/warning reporting.
4457
4458         * class.cs
4459         (TypeContainer.base_classs_type): New member for storing parent type.
4460
4461         * decl.cs
4462         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
4463         for this MemberCore.
4464
4465 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4466
4467         * attribute.cs, const.cs: Fix bug #58590
4468
4469 2004-05-21  Martin Baulig  <martin@ximian.com>
4470
4471         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
4472         out parameters if the end of the method is unreachable.  Fixes
4473         #58098. 
4474
4475 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4476
4477         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
4478         Hari was right, why extra method.
4479
4480 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
4481
4482         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
4483
4484 2004-05-20  Martin Baulig  <martin@ximian.com>
4485
4486         * delegate.cs: Convert this file to Unix mode - like the original
4487         version in mcs is.
4488
4489 2004-05-20  Martin Baulig  <martin@ximian.com>
4490
4491         * attribute.cs: Convert this file to Unix mode - like the original
4492         version in mcs is.
4493
4494 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
4495
4496        Fix bug #58688 (MCS does not report error when the same attribute
4497        is assigned twice)
4498
4499        * attribute.cs (Attribute.Emit): Distinction between null and default.
4500
4501 2004-05-19  Raja R Harinath  <rharinath@novell.com>
4502
4503        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
4504        of a top-level attribute without an attribute target.
4505        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
4506        Make non-static.
4507        (Attribute.Conditional_GetConditionName), 
4508        (Attribute.Obsolete_GetObsoleteMessage): Update.
4509        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
4510        part of ScanForIndexerName.
4511        (Attribute.CanIgnoreInvalidAttribute): New function.
4512        (Attribute.ScanForIndexerName): Move to ...
4513        (Attributes.ScanForIndexerName): ... here.
4514        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
4515        (Attributes.Search): New internal variant that can choose not to
4516        complain if types aren't resolved.  The original signature now
4517        complains.
4518        (Attributes.GetClsCompliantAttribute): Use internal variant, with
4519        complaints suppressed.
4520        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
4521        only if it not useful.
4522        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
4523        top-level for attributes that are shared between the assembly
4524        and a top-level class.
4525        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
4526        * class.cs: Update to reflect changes.
4527        (DefineIndexers): Fuse loops.
4528        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
4529        a couple more variants of attribute names.
4530
4531 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
4532
4533         Fix bug #52585 (Implemented explicit attribute declaration)
4534
4535         * attribute.cs:
4536         (Attributable.ValidAttributeTargets): New abstract method. It gets
4537         list of valid attribute targets for explicit target declaration.
4538         (Attribute.Target): It holds target itself.
4539         (AttributeSection): Removed.
4540         (Attribute.CheckTargets): New method. It checks whether attribute
4541         target is valid for the current element.
4542
4543         * class.cs:
4544         (EventProperty): New class. For events that are declared like
4545         property (with add and remove accessors).
4546         (EventField): New class. For events that are declared like field.
4547         class.cs
4548
4549         * cs-parser.jay: Implemented explicit attribute target declaration.
4550
4551         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
4552         Override ValidAttributeTargets.
4553
4554         * parameter.cs:
4555         (ReturnParameter): Class for applying custom attributes on 
4556         the return type.
4557         (ParameterAtribute): New class. Class for applying custom
4558         attributes on the parameter type.
4559
4560 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
4561
4562         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
4563         definitions. 
4564
4565         (Method): Allow UNSAFE here.
4566
4567         * modifiers.cs: Support unsafe reporting.
4568
4569 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
4570
4571         * decl.cs: Fix bug #58478.
4572
4573 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4574
4575         * statement.cs: When checking for unreachable code on an EmptyStatement,
4576         set the location. Fixes bug #58488.
4577
4578 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
4579
4580         * driver.cs: Add -pkg handling.
4581
4582         From Gonzalo: UseShelLExecute=false
4583
4584 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
4585
4586         * attribute.cs:
4587         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
4588         for attribute.
4589         (Attribute.IsClsCompliaceRequired): Moved to base for better
4590         accesibility.
4591         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
4592         when attribute is AttributeUsageAttribute.
4593         (Attribute.GetValidTargets): Simplified.
4594         (Attribute.GetAttributeUsage): New method returns AttributeUsage
4595         attribute for this type.
4596         (Attribute.ApplyAttributes): Method renamed to Emit and make
4597         non-static.
4598         (GlobalAttributeSection): New class for special handling of global
4599         attributes (assembly, module).
4600         (AttributeSection.Emit): New method.
4601
4602         * class.cs: Implemented Attributable abstract methods.
4603         (MethodCore.LabelParameters): Moved to Parameter class.
4604         (Accessor): Is back simple class.
4605         (PropertyMethod): Implemented Attributable abstract class.
4606         (DelegateMethod): Implemented Attributable abstract class.
4607         (Event): New constructor for disctintion between normal Event
4608         and Event with accessors.
4609
4610         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
4611
4612         * codegen.cs, const.cs, decl.cs, delegate.cs:
4613         (CommonAssemblyModulClass): Implemented Attributable abstract class
4614         and simplified.
4615
4616         * enum.cs: Implement IAttributeSupport interface.
4617         (EnumMember): New class for emum members. Implemented Attributable
4618         abstract class
4619
4620         * parameter.cs:
4621         (ParameterBase): Is abstract.
4622         (ReturnParameter): New class for easier [return:] attribute handling.
4623
4624         * typemanager.cs: Removed builder_to_attr.
4625
4626 2004-05-11  Raja R Harinath  <rharinath@novell.com>
4627
4628         Fix bug #57151.
4629         * attribute.cs (Attribute.GetPositionalValue): New function.
4630         * class.cs (TypeContainer.VerifyMembers): New function.
4631         (TypeContainer.Emit): Use it.
4632         (ClassOrStruct): New base class for Class and Struct.
4633         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
4634         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
4635         class.
4636         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
4637         then each non-static field should have a FieldOffset attribute.
4638         Otherwise, none of the fields should have a FieldOffset attribute.
4639         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
4640         and FieldOffset attributes.
4641         * typemanager.cs (TypeManager.struct_layout_attribute_type)
4642         (TypeManager.field_offset_attribute_type): New core types.
4643         (TypeManager.InitCoreTypes): Initialize them.
4644
4645 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
4646
4647         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
4648         Return correct type.
4649         From bug #58270.
4650
4651 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
4652
4653         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
4654         be implicitly converted to ulong.
4655         
4656         * expression.cs: The logic for allowing operator &, | and ^ worked
4657         was wrong, it worked before because we did not report an error in
4658         an else branch.  Fixes 57895.
4659
4660         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
4661         allow volatile fields to be reference types.
4662
4663 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
4664
4665         * driver.cs: Add support for /debug-
4666
4667 2004-05-07  Raja R Harinath  <rharinath@novell.com>
4668
4669         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
4670         Add a 'complain' parameter to silence errors.
4671         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
4672         silently overlooked type-resolutions.
4673         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
4674         to reflect changes.
4675         (Attributes.Search): New function.
4676         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
4677         (Attributes.GetAttributeFullName): Remove hack.
4678         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
4679         Update to reflect changes.
4680         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
4681         Use Attributes.Search instead of nested loops.
4682
4683 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
4684
4685         * decl.cs:
4686         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
4687         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
4688         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
4689
4690         * report.cs: (Report.Warning): Renamed to Warning_T because of
4691         parameter collision.
4692
4693 2004-05-05  Raja R Harinath  <rharinath@novell.com>
4694
4695         * expression.cs (MemberAccess.ResolveMemberAccess):
4696         Exit with non-zero status after Report.Error.
4697         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
4698         Likewise.
4699         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
4700
4701 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4702
4703         * support.cs: Don't hang when the file is empty.
4704
4705 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
4706
4707         * support.cs: In SeekableStreamReader, compute the preamble size of the
4708           underlying stream. Position changes should take into account that initial
4709           count of bytes.
4710
4711 2004-05-03  Todd Berman  <tberman@sevenl.net>
4712
4713         * driver.cs: remove unused GetSysVersion function.
4714
4715 2004-05-03  Todd Berman  <tberman@sevenl.net>
4716
4717         * driver.cs: Remove the hack from saturday, as well as the hack
4718         from jackson (LoadAssemblyFromGac), also adds the CWD to the
4719         link_paths to get that bit proper.
4720
4721 2004-05-01  Todd Berman  <tberman@sevenl.net>
4722
4723         * driver.cs: Try a LoadFrom before a Load, this checks the current
4724         path. This is currently a bug in mono that is be fixed, however, this
4725         provides a workaround for now. This will be removed when the bug
4726         is fixed.
4727
4728 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
4729
4730         * CryptoConvert.cs: Updated to latest version. Fix issue with 
4731         incomplete key pairs (#57941).
4732
4733 2004-05-01  Todd Berman  <tberman@sevenl.net>
4734
4735         * driver.cs: Remove '.' from path_chars, now System.* loads properly
4736         from the GAC
4737
4738 2004-04-30  Jackson Harper  <jackson@ximian.com>
4739
4740         * codegen.cs: Open keys readonly.
4741         
4742 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
4743
4744         * typemanager.cs: don't report cyclic struct layout when a struct
4745         contains 2 or more fields of the same type. Failed for Pango.AttrShape
4746         which has 2 Pango.Rectangle fields.
4747
4748 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
4749
4750         * expression.cs: Handle IntPtr comparisons with IL code
4751         rather than a method call.
4752
4753 2004-04-29  Martin Baulig  <martin@ximian.com>
4754
4755         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
4756         the list of PropertyInfo's in class hierarchy and find the
4757         accessor.  Fixes #56013.
4758
4759 2004-04-29  Martin Baulig  <martin@ximian.com>
4760
4761         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
4762
4763 2004-04-29  Martin Baulig  <martin@ximian.com>
4764
4765         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4766
4767         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
4768
4769 2004-04-29  Martin Baulig  <martin@ximian.com>
4770
4771         * class.cs (ConstructorInitializer.Resolve): Check whether the
4772         parent .ctor is accessible.  Fixes #52146.
4773
4774 2004-04-29  Martin Baulig  <martin@ximian.com>
4775
4776         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
4777
4778         * statement.cs (Using.EmitLocalVariableDecls): Use
4779         TypeManager.idisposable_type, not typeof (IDisposable).
4780         (Foreach.EmitCollectionForeach): Added support for valuetypes.
4781
4782 2004-04-29  Martin Baulig  <martin@ximian.com>
4783
4784         * class.cs (Event.Define): Don't emit the field and don't set
4785         RTSpecialName and SpecialName for events on interfaces.  Fixes
4786         #57703. 
4787
4788 2004-04-29  Raja R Harinath  <rharinath@novell.com>
4789
4790         Refactor Attribute.ApplyAttributes.
4791         * attribute.cs (Attributable): New base class for objects that can
4792         have Attributes applied on them.
4793         (Attribute): Make AttributeUsage fields public.
4794         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
4795         (Attribute.IsInternalCall): New property.
4796         (Attribute.UsageAttr): Convert to a public read-only property.
4797         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
4798         (Attribute.ResolveType, Attribute.Resolve)
4799         (Attribute.ScanForIndexerName): Update to reflect changes.
4800         (Attribute.CheckAttributeTarget): Re-format.
4801         (Attribute.ApplyAttributes): Refactor, to various
4802         Attributable.ApplyAttributeBuilder methods.
4803         * decl.cs (MemberCore): Make Attributable.
4804         * class.cs (Accessor): Make Attributable.
4805         (MethodData.ApplyAttributes): Use proper attribute types, not
4806         attribute names.
4807         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
4808         (TypeContainer.ApplyAttributeBuilder)
4809         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
4810         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
4811         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
4812         (Operator.ApplyAttributeBuilder): New factored-out methods.
4813         * const.cs (Const.ApplyAttributeBuilder): Likewise.
4814         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
4815         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
4816         * parameter.cs (ParameterBase): New Attributable base class
4817         that can also represent Return types.
4818         (Parameter): Update to the changes.
4819
4820 2004-04-29  Jackson Harper  <jackson@ximian.com>
4821
4822         * driver.cs: Prefer the corlib system version when looking for
4823         assemblies in the GAC. This is still a hack, but its a better hack
4824         now.
4825         
4826 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
4827
4828         * decl.cs, enum.cs: Improved error 3005 reporting.
4829   
4830         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
4831         (related_symbols): New private member for list of symbols
4832         related to reported error/warning.
4833         
4834         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
4835
4836 2004-04-29  Martin Baulig  <martin@ximian.com>
4837
4838         * ecore.cs (Expression.Constantify): If we're an enum and
4839         TypeManager.TypeToCoreType() doesn't give us another type, use
4840         t.UnderlyingSystemType.  Fixes #56178.  
4841
4842 2004-04-29  Martin Baulig  <martin@ximian.com>
4843
4844         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
4845         interfaces and for each interface, only add members directly
4846         declared in that interface.  Fixes #53255.
4847
4848 2004-04-28  Martin Baulig  <martin@ximian.com>
4849
4850         * expression.cs (ConditionalLogicalOperator): Use a temporary
4851         variable for `left' to avoid that we evaluate it more than once;
4852         bug #52588.
4853
4854 2004-04-28  Martin Baulig  <martin@ximian.com>
4855
4856         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
4857         `void[]' (CS1547).
4858
4859 2004-04-28  Martin Baulig  <martin@ximian.com>
4860
4861         * statement.cs (LocalInfo.Resolve): Check whether the type is not
4862         void (CS1547).
4863
4864         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
4865         whether the type is not void (CS1547).
4866
4867 2004-04-28  Martin Baulig  <martin@ximian.com>
4868
4869         * expression.cs (Unary.DoResolveLValue): Override this and report
4870         CS0131 for anything but Operator.Indirection.
4871
4872 2004-04-28  Martin Baulig  <martin@ximian.com>
4873
4874         Committing a patch from Ben Maurer; see bug #50820.
4875
4876         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4877         check for classes.
4878
4879         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4880         classes.        
4881
4882 2004-04-28  Martin Baulig  <martin@ximian.com>
4883
4884         Committing a patch from Ben Maurer; see bug #50820.
4885
4886         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
4887         check for classes.
4888
4889         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
4890         classes.        
4891
4892 2004-04-28  Martin Baulig  <martin@ximian.com>
4893
4894         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
4895         (Block.AddLabel): Call DoLookupLabel() to only search in the
4896         current block.
4897
4898 2004-04-28  Martin Baulig  <martin@ximian.com>
4899
4900         * cfold.cs (ConstantFold.BinaryFold): Added special support for
4901         comparing StringConstants and NullLiterals in Equality and Inequality.
4902
4903 2004-04-28  Jackson Harper  <jackson@ximian.com>
4904
4905         * driver.cs: Attempt to load referenced assemblies from the
4906         GAC. This is the quick and dirty version of this method that
4907         doesnt take into account versions and just takes the first
4908         canidate found. Will be good enough for now as we will not have more
4909         then one version installed into the GAC until I update this method.
4910
4911 2004-04-28  Martin Baulig  <martin@ximian.com>
4912
4913         * typemanager.cs (TypeManager.CheckStructCycles): New public
4914         static method to check for cycles in the struct layout.
4915
4916         * rootcontext.cs (RootContext.PopulateTypes): Call
4917         TypeManager.CheckStructCycles() for each TypeContainer.
4918         [Note: We only need to visit each type once.]
4919
4920 2004-04-28  Martin Baulig  <martin@ximian.com>
4921
4922         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
4923
4924         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
4925         success and added `out object value'.  Use a `bool resolved' field
4926         to check whether we've already been called rather than
4927         `ConstantValue != null' since this breaks for NullLiterals.
4928
4929 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4930
4931         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
4932         setting of this flag, since the 'set' method may be non-public.
4933
4934 2004-04-28  Raja R Harinath  <rharinath@novell.com>
4935
4936         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
4937         check on current_vector.Block.
4938
4939 2004-04-27  Martin Baulig  <martin@ximian.com>
4940
4941         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
4942         a field initializer.  Fixes #56459.
4943
4944 2004-04-27  Martin Baulig  <martin@ximian.com>
4945
4946         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
4947         we're not attempting to use an indexer.  Fixes #52154.
4948
4949 2004-04-27  Martin Baulig  <martin@ximian.com>
4950
4951         * statement.cs (Return): Don't create a return label if we don't
4952         need it; reverts my change from January 20th.  Thanks to Ben
4953         Maurer for this.
4954
4955 2004-04-27  Martin Baulig  <martin@ximian.com>
4956
4957         According to the spec, `goto' can only leave a nested scope, but
4958         never enter it.
4959
4960         * statement.cs (Block.LookupLabel): Only lookup in the current
4961         block, don't recurse into parent or child blocks.
4962         (Block.AddLabel): Check in parent and child blocks, report
4963         CS0140/CS0158 if we find a duplicate.
4964         (Block): Removed this indexer for label lookups.
4965         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
4966         this already does the error reporting for us.
4967
4968         * flowanalysis.cs
4969         (FlowBranching.UsageVector.Block): New public variable; may be null.
4970         (FlowBranching.CreateSibling): Added `Block' argument.
4971         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
4972         label for the target of a `goto' and check whether we're not
4973         leaving a `finally'.
4974
4975 2004-04-27  Martin Baulig  <martin@ximian.com>
4976
4977         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4978         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
4979         just for returns).
4980
4981 2004-04-27  Martin Baulig  <martin@ximian.com>
4982
4983         * statement.cs (Block.AddLabel): Also check for implicit blocks
4984         and added a CS0158 check.
4985
4986 2004-04-27  Martin Baulig  <martin@ximian.com>
4987
4988         * flowanalysis.cs (FlowBranchingLoop): New class.
4989         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
4990         UsageVector's instead of an ArrayList.
4991         (FlowBranching.Label): Likewise.
4992         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
4993         (FlowBranching.AddBreakVector): New method.
4994
4995 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
4996
4997         * attribute.cs: Small regression fix: only convert the type if we
4998         the type is different, fixes System.Drawing build.
4999
5000 2004-04-27  Martin Baulig  <martin@ximian.com>
5001
5002         * attribute.cs (Attribute.Resolve): If we have a constant value
5003         for a named field or property, implicity convert it to the correct
5004         type.
5005
5006 2004-04-27  Raja R Harinath  <rharinath@novell.com>
5007
5008         * statement.cs (Block.Block): Implicit blocks share
5009         'child_variable_names' fields with parent blocks.
5010         (Block.AddChildVariableNames): Remove.
5011         (Block.AddVariable): Mark variable as "used by a child block" in
5012         every surrounding block.
5013         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
5014         been used in a child block, complain about violation of "Invariant
5015         meaning in blocks" rule.
5016         * cs-parser.jay (declare_local_variables): Don't use
5017         AddChildVariableNames.
5018         (foreach_statement): Don't create an implicit block: 'foreach'
5019         introduces a scope.
5020
5021 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
5022
5023         * convert.cs (ImplicitNumericConversion): 0 is also positive when
5024         converting from 0L to ulong.  Fixes 57522.
5025
5026 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
5027
5028         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
5029         derived class hides via 'new' keyword field from base class (test-242.cs).
5030         TODO: Handle this in the more general way.
5031         
5032         * class.cs (CheckBase): Ditto.
5033
5034 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
5035
5036         * decl.cs (caching_flags): New member for storing cached values
5037         as bit flags.
5038         (MemberCore.Flags): New enum where bit flags for caching_flags
5039         are defined.
5040         (MemberCore.cls_compliance): Moved to caching_flags.
5041         (DeclSpace.Created): Moved to caching_flags.
5042
5043         * class.cs: Use caching_flags instead of DeclSpace.Created
5044         
5045 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
5046
5047         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
5048         if we are only a derived class, not a nested class.
5049
5050         * typemanager.cs: Same as above, but do this at the MemberLookup
5051         level (used by field and methods, properties are handled in
5052         PropertyExpr).   Allow for the qualified access if we are a nested
5053         method. 
5054
5055 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
5056
5057         * class.cs: Refactoring.
5058         (IMethodData): New inteface; Holds links to parent members
5059         to avoid member duplication (reduced memory allocation).
5060         (Method): Implemented IMethodData interface.
5061         (PropertyBase): New inner classes for get/set methods.
5062         (PropertyBase.PropertyMethod): Implemented IMethodData interface
5063         (Event): New inner classes for add/remove methods.
5064         (Event.DelegateMethod): Implemented IMethodData interface.
5065
5066         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
5067         EmitContext (related to class.cs refactoring).
5068
5069 2004-04-21  Raja R Harinath  <rharinath@novell.com>
5070
5071         * delegate.cs (Delegate.VerifyApplicability): If the number of
5072         arguments are the same as the number of parameters, first try to
5073         verify applicability ignoring  any 'params' modifier on the last
5074         parameter.
5075         Fixes #56442.
5076
5077 2004-04-08  Martin Baulig  <martin@ximian.com>
5078
5079         Merged latest changes into gmcs.  Please keep this comment in
5080         here, it makes it easier for me to see what changed in MCS since
5081         the last time I merged.
5082
5083 2004-04-16  Raja R Harinath  <rharinath@novell.com>
5084
5085         * class.cs (TypeContainer.AddIndexer): Use
5086         'ExplicitInterfaceName' to determine if interface name was
5087         explicitly specified.  'InterfaceType' is not initialized at this time.
5088         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
5089         Indexers array is already in the required order.  Initialize
5090         'IndexerName' only if there are normal indexers.
5091         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
5092         (TypeContainer.Emit): Emit DefaultMember attribute only if
5093         IndexerName is initialized.
5094         Fixes #56300.
5095
5096 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
5097
5098         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
5099         Fixes #57007
5100
5101 2004-04-15  Raja R Harinath  <rharinath@novell.com>
5102
5103         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
5104         attributes.
5105         Fix for #56456.
5106
5107         * attribute.cs (Attribute.Resolve): Check for duplicate named
5108         attributes.
5109         Fix for #56463.
5110
5111 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
5112
5113         * iterators.cs (MarkYield): track whether we are in an exception,
5114         and generate code accordingly.  Use a temporary value to store the
5115         result for our state.
5116
5117         I had ignored a bit the interaction of try/catch with iterators
5118         since their behavior was not entirely obvious, but now it is
5119         possible to verify that our behavior is the same as MS .NET 2.0
5120
5121         Fixes 54814
5122
5123 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
5124
5125         * iterators.cs: Avoid creating temporaries if there is no work to
5126         do. 
5127
5128         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
5129         Enumerations, use TypeManager.EnumToUnderlying and call
5130         recursively. 
5131
5132         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
5133         bug #57013
5134
5135         (This.Emit): Use EmitContext.EmitThis to emit our
5136         instance variable.
5137
5138         (This.EmitAssign): Ditto.
5139
5140         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
5141         codepaths, we will move all the functionality into
5142         Mono.CSharp.This 
5143
5144         (FieldExpr.EmitAssign): Ditto.
5145
5146         This fixes several hidden bugs that I uncovered while doing a code
5147         review of this today.
5148
5149         * codegen.cs (EmitThis): reworked so the semantics are more clear
5150         and also support value types "this" instances.
5151
5152         * iterators.cs: Changed so that for iterators in value types, we
5153         do not pass the value type as a parameter.  
5154
5155         Initialization of the enumerator helpers is now done in the caller
5156         instead of passing the parameters to the constructors and having
5157         the constructor set the fields.
5158
5159         The fields have now `assembly' visibility instead of private.
5160
5161 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
5162
5163         * expression.cs (Argument.Resolve): Check if fields passed as ref
5164         or out are contained in a MarshalByRefObject.
5165
5166         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
5167         another compiler type.
5168
5169 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
5170
5171         * class.cs (Indexer.Define): use the new name checking method.
5172         Also, return false on an error.
5173         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
5174         (is_identifier_[start/part]_character): make static.
5175
5176 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
5177
5178         * expression.cs (Binary.ResolveOperator): Do no append strings
5179         twice: since we can be invoked more than once (array evaluation)
5180         on the same concatenation, take care of this here.  Based on a fix
5181         from Ben (bug #56454)
5182
5183 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5184
5185         * codegen.cs: Fix another case where CS1548 must be reported (when 
5186         delay-sign isn't specified and no private is available #56564). Fix
5187         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
5188         error when MCS is used on the MS runtime and we need to delay-sign 
5189         (which seems unsupported by AssemblyBuilder - see #56621).
5190
5191 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
5192
5193         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
5194         (TypeManager.ComputeNamespaces): Faster implementation for
5195         Microsoft runtime.
5196
5197         * compiler.csproj: Updated AssemblyName to mcs.
5198
5199 2004-05-11  Jackson Harper  <jackson@ximian.com>
5200
5201         * Makefile: Preserve MONO_PATH
5202         
5203 2004-05-11  Jackson Harper  <jackson@ximian.com>
5204
5205         * Makefile: Use mono and mcs to build gmcs
5206         
5207 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
5208
5209         * codegen.cs: Add patch from Robert Shade
5210         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
5211         sync with mcs.
5212
5213 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
5214
5215         * CryptoConvert.cs: Updated to latest version. Fix issue with 
5216         incomplete key pairs (#57941).
5217
5218 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
5219
5220         * codegen.cs: Fix another case where CS1548 must be reported (when 
5221         delay-sign isn't specified and no private is available #56564). Fix
5222         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
5223         error when MCS is used on the MS runtime and we need to delay-sign 
5224         (which seems unsupported by AssemblyBuilder - see #56621).
5225
5226 2004-04-29  Jackson Harper  <jackson@ximian.com>
5227
5228         * Makefile: Set MONO_PATH to use the bootstrap corlib
5229         * driver.cs: Check the GAC for referenced assemblies.
5230                 
5231 2004-04-29  Martin Baulig  <martin@ximian.com>
5232
5233         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
5234
5235 2004-04-07  Martin Baulig  <martin@ximian.com>
5236
5237         * expression.cs (Binary.ResolveOperator): Added special case for
5238         Equality/Inequality between a type parameter and a null literal.
5239
5240 2004-04-07  Martin Baulig  <martin@ximian.com>
5241
5242         * convert.cs: Check null literal -> type parameter conversions.
5243
5244 2004-04-07  Martin Baulig  <martin@ximian.com>
5245
5246         * generic.cs (ConstructedType.CheckConstraints): Enforce the
5247         `class' and `struct' constraints.
5248
5249 2004-04-07  Martin Baulig  <martin@ximian.com>
5250
5251         * generic.cs (SpecialConstraint): New public enum.
5252         (Constraints.Resolve): Added support for the `class' and `struct'
5253         constraints.
5254
5255         * cs-parser.jay (type_parameter_constraint): Added support for the
5256         `class' and `struct' constraints.
5257
5258 2004-04-07  Martin Baulig  <martin@ximian.com>
5259
5260         * support.cs (GenericConstraints): Replaced `Types' by
5261         `ClassConstraint' and `InterfaceConstraints'; added
5262         `HasClassConstraint'.   
5263
5264 2004-04-07  Martin Baulig  <martin@ximian.com>
5265
5266         * generic.cs
5267         (Constraints.InterfaceConstraints): New public property.
5268         (Constraints.Types): Make this property public
5269         (TypeParameter): Implement IMemberContainer.
5270         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
5271         instead of a TypeBuilder/MethodBuilder; pass the interface
5272         constraints to TypeManager.AddTypeParameter().
5273         (TypeParameter.DefineType): Just take an EmitContext and no
5274         TypeBuilder/MethodBuilder.  Use the new public API.
5275
5276         * typemanager.cs (TypeManager.AddTypeParameter): Added
5277         `TypeExpr[]' argument; add the interfaces to the
5278         `builder_to_ifaces' hash.
5279         (TypeManager.LookupMemberContainer): For
5280         GenericTypeParameterBuilders, get the TypeParameter from the
5281         `builder_to_type_param'.
5282         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
5283         the TypeParameter and call FindMembers on it.
5284
5285 2004-04-07  Martin Baulig  <martin@ximian.com>
5286
5287         * class.cs
5288         (MethodCore.GenericMethod): Moved this field here from Method.
5289         (MethodCore.IsDuplicateImplementation): Take the number of type
5290         parameters into account if we're a generic method.
5291
5292         * expression.cs (Invocation.InferTypeArguments): Don't return true
5293         if `arguments' is null; we still need to check whether we actually
5294         don't need to infer anything in this case.
5295         (MemberAccess): Merged the functionality from GenericMemberAccess
5296         into this class.
5297
5298         * generic.cs (GenericMemberAccess): Removed.
5299
5300 2004-04-05  Martin Baulig  <martin@ximian.com>
5301
5302         * decl.cs (MemberCore): For generic classes, interfaces and
5303         structs, `Name' now includes the number of type parameters
5304         ("Stack!1.Node!1").
5305         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
5306         encode the number of type arguments in the type name.
5307
5308         * expression.cs (Expression.MemberLookup): Removed the
5309         `num_type_args' argument; we now encode the number of type
5310         arguments in the type name.
5311
5312         * ecore.cs (SimpleName): Encode the number of type arguments in
5313         the type name itself.
5314
5315         * generic.cs (ConstructedType): Likewise.
5316
5317         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
5318         `MemberName'; we now include the number of type parameters in the
5319         type name.
5320
5321         * typemanager.cs (TypeManager.CheckGeneric): Removed.
5322         (TypeManager.MemberLookup): Removed the
5323         `num_type_args' argument; we now encode the number of type
5324         arguments in the type name.     
5325
5326 2004-04-03  Martin Baulig  <martin@ximian.com>
5327
5328         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
5329         (MemberCore.MemberName): Moved here from MemberBase.
5330         (DeclSpace.SetParameterInfo): Just take the constraints as an
5331         ArrayList; we already have the type parameters in our
5332         `MemberName'; also do the CS0080 reporting here.
5333
5334         * cs-parser.jay (struct_declaration): Use `member_name' instead of
5335         `IDENTIFIER opt_type_parameter_list'; when constructing our
5336         `MemberName', it'll already include our type parameters.
5337         (class_declaration, interface_declaration): Likewise.
5338         (delegate_declaration): Likewise.
5339         (MakeName): Take a MemberName and return a MemberName.
5340         The following two changes are required to avoid shift/reduce conflicts:
5341         (member_name): Don't include a TypeName anymore; ie. this is now
5342         just 'IDENTIFIER opt_type_parameter_list'.
5343         (property_declaration, event_declaration): Use a
5344         `namespace_or_type_name' instead of a `member_name'.            
5345
5346 2004-04-03  Martin Baulig  <martin@ximian.com>
5347
5348         * decl.cs (MemberName): Renamed to `TypeName' and created a new
5349         `MemberName' class.
5350         (TypeName): Formerly known as MemberName.
5351
5352         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
5353         instead of a `MemberName'.
5354
5355         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
5356         (member_name): New rule; create a MemberName.
5357
5358 2004-04-02  Martin Baulig  <martin@ximian.com>
5359
5360         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
5361         (CS0305 and CS0308).
5362
5363 2004-04-02  Martin Baulig  <martin@ximian.com>
5364
5365         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
5366         support for nested types.
5367
5368 2004-04-02  Martin Baulig  <martin@ximian.com>
5369
5370         * ecore.cs (IAlias): New public interface.
5371         (TypeExpr, TypeExpression): Implement IAlias.
5372         (TypeAliasExpression): New public class.
5373
5374         * namespace.cs (Namespace): Implement IAlias.
5375         (Namespace.Lookup): Return an IAlias instead on an object.
5376         (Namespace.DefineName): Take an IAlias instead of an object.
5377         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
5378         an object.
5379         (NamespaceEntry.UsingAlias): Take a Membername instead of an
5380         Expression.
5381         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
5382         object.
5383         (NamespaceEntry.Lookup): Likewise.
5384
5385         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
5386         instead of a Type.      
5387
5388         * decl.cs (DeclSpace): Implement IAlias.
5389         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
5390
5391         * generic.cs (ConstructedType): Improved error checking.
5392
5393 2004-04-02  Martin Baulig  <martin@ximian.com>
5394
5395         * convert.cs: Added type parameter conversions.
5396
5397         * ecore.cs
5398         (UnboxCast.Emit): Emit an `unbox.any' for type params.
5399         (ClassCast.Emit): If the source type is a type parameter, box it.
5400         If the target type is a type parameter, emit an `unbox.any'
5401         instead of a `classcast'.1      
5402
5403 2004-04-01  Martin Baulig  <martin@ximian.com>
5404
5405         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
5406
5407 2004-04-01  Martin Baulig  <martin@ximian.com>
5408
5409         * generic.cs (ConstructedType.CheckConstraints): Use
5410         Convert.ImplicitStandardConversionExists(); user-defined implicit
5411         conversions are not allowed according to the spec.
5412
5413 2004-03-30  Martin Baulig  <martin@ximian.com>
5414
5415         * expression.cs (New): Added support for type parameters.
5416
5417         * typemanager.cs
5418         (TypeManager.activator_type): New public static field.
5419         (TypeManager.activator_create_instance): Likewise.
5420
5421 2004-03-30  Martin Baulig  <martin@ximian.com>
5422
5423         * typemanager.cs (TypeManager.HasConstructorConstraint): New
5424         public method.
5425
5426 2004-03-30  Martin Baulig  <martin@ximian.com>
5427
5428         * generic.cs (ConstructedType.CheckConstraints): Actually follow
5429         the spec here: the argument type must be convertible to the
5430         constraints.
5431
5432 2004-03-30  Martin Baulig  <martin@ximian.com>
5433
5434         * generic.cs
5435         (TypeParameter.Define, TypeParameter.DefineMethod): Call
5436         TypeManager.AddTypeParameter().
5437         (ConstructedType.CheckConstraints): Re-enable this and actually
5438         check whether we have a constructor constraint.
5439
5440         * typemanager.cs
5441         (TypeManager.builder_to_type_param): New static field.
5442         (TypeManager.AddTypeParameter): New static method.
5443         (TypeManager.LookupTypeParameter): New public method.
5444
5445 2004-03-30  Martin Baulig  <martin@ximian.com>
5446
5447         * generic.cs (TypeParameter.DefineType): Return a boolean and use
5448         the new API to actually define the constructor constraint.
5449
5450         * typemanager.cs
5451         (TypeManager.new_constraint_attr_type): New static field.
5452         (TypeManager.InitCoreTypes): Initialize it.
5453
5454 2004-03-30  Martin Baulig  <martin@ximian.com>
5455
5456         * generic.cs (Constraints): Completed error checking, use correct
5457         error numbers.
5458
5459 2004-03-29  Martin Baulig  <martin@ximian.com>
5460
5461         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
5462
5463         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5464         public version which takes a `ParameterData pd' instead of an
5465         `ArrayList args'.
5466
5467 2004-03-29  Martin Baulig  <martin@ximian.com>
5468
5469         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
5470         not a MethodInfo.       
5471
5472 2004-03-29  Martin Baulig  <martin@ximian.com>
5473
5474         * expression.cs (Argument.ResolveMethodGroup): If we're a
5475         ConstructedType, call GetMemberAccess() on it.  
5476
5477 2004-03-29  Martin Baulig  <martin@ximian.com>
5478
5479         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
5480         (MethodCore.CheckGenericOverride): When overriding a generic
5481         method, check whether the constraints match.
5482
5483         * support.cs (GenericConstraints): New public interface.
5484         (ParameterData.GenericConstraints): New public method.
5485
5486         * parameter.cs (Parameter.Resolve): Check whether we're a generic
5487         method parameter and compute our constraints if appropriate.
5488         (Parameter.GenericConstraints): New public property.
5489
5490         * generic.cs (Constraints): Implement GenericConstraints.
5491
5492 2004-03-29  Martin Baulig  <martin@ximian.com>
5493
5494         * decl.cs (MemberCache.FindMemberToOverride): Use
5495         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
5496
5497 2004-03-29  Martin Baulig  <martin@ximian.com>
5498
5499         * generic.cs (GenericMethod.Define): Resolve our type parameters.
5500
5501 2004-03-29  Martin Baulig  <martin@ximian.com>
5502
5503         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
5504         not allowed on non-generic declarations").
5505
5506 2004-03-29  Martin Baulig  <martin@ximian.com>
5507
5508         * expression.cs (Invocation.InferTypeArguments): Added overloaded
5509         public version of this method.
5510
5511         * class.cs (MethodCore.IsDuplicateImplementation): Use
5512         Invocation.InferTypeArguments() to check this.
5513
5514 2004-03-29  Martin Baulig  <martin@ximian.com>
5515
5516         * convert.cs: Use TypeManager.IsDelegateType() instead of
5517         comparing types correctly.
5518
5519 2004-03-29  Martin Baulig  <martin@ximian.com>
5520
5521         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
5522         types directly to make it work for generic instances.
5523
5524         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
5525
5526 2004-03-29  Martin Baulig  <martin@ximian.com>
5527
5528         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
5529         support for arrays.     
5530
5531 2004-03-24  Martin Baulig  <martin@ximian.com>
5532
5533         * decl.cs (DeclSpace.FindType): Also use
5534         TypeManager.CheckGeneric() for types from the using clauses.
5535
5536 2004-03-23  Martin Baulig  <martin@ximian.com>
5537
5538         * expression.cs (Invocation.OverloadResolve): Added `bool
5539         may_fail' argument and use it instead of the Location.IsNull() hack.
5540
5541 2004-03-23  Martin Baulig  <martin@ximian.com>
5542
5543         * expression.cs (Invocation.InferType): Use correct type inference
5544         rules here.     
5545
5546 2004-03-23  Martin Baulig  <martin@ximian.com>
5547
5548         * ecore.cs (MethodGroupExpr.Name): Use
5549         TypeManager.CSharpSignature() instead of just the name.
5550
5551         * expression.cs (Invocation.OverloadResolve): Provide better error
5552         reporting.
5553         (Invocation.DoResolve): OverloadResolve() never returns null
5554         without reporting an error, so removed the error -6 reporting here.
5555
5556 2004-03-23  Martin Baulig  <martin@ximian.com>
5557
5558         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
5559         generic methods.
5560
5561         * cs-parser.jay (delegate_declaration): Support generic delegates.
5562
5563         * delegate.cs: Support generic delegates.
5564
5565 2004-03-22  Martin Baulig  <martin@ximian.com>
5566
5567         * expression.cs (Invocation.InferParamsTypeArguments): New static
5568         method; does type inference for params arguments.
5569
5570 2004-03-21  Martin Baulig  <martin@ximian.com>
5571
5572         * typemanager.cs (TypeManager.IsGenericMethod): New public static
5573         method; checks whether a method is a generic method.    
5574
5575         * expression.cs (Invocation.InferTypeArguments): New static method;
5576         infer type arguments for generic method invocation.
5577
5578         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
5579         property; we set this to true if we're resolving a generic method
5580         invocation and the user specified type arguments, ie. we're not
5581         doing type inference.
5582
5583 2004-03-20  Martin Baulig  <martin@ximian.com>
5584
5585         * class.cs (MethodData.DeclaringType): New public property.
5586         (MethodData.Define): Set DeclaringType here.
5587         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
5588         instead of OperatorMethodBuilder.DeclaringType.
5589
5590 2004-03-20  Martin Baulig  <martin@ximian.com>
5591
5592         * cs-tokenizer.cs (xtoken): Return a special
5593         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
5594
5595         * cs-parser.jay (default_value_expression): Switch to the new
5596         syntax (14.5.13).
5597
5598 2004-03-19  Martin Baulig  <martin@ximian.com>
5599
5600         * decl.cs (MemberName): New class.  We use this to "construct"
5601         namespace_or_type_name's.
5602
5603         * generics.cs (TypeArguments.GetDeclarations): New public method;
5604         returns the type arguments as a string[] and reports a CS0081 if
5605         one of them is not an identifier.
5606
5607         * class.cs (MemberBase): The .ctor now takes the name as a
5608         MemberName instead of a string.
5609         (MemberBase.ExplicitInterfaceName): Changed type from string to
5610         Expression.
5611         (MemberBase.DoDefine): If we're an explicit implementation, the
5612         InterfaceType may be a generic instance.
5613
5614         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
5615         (namespace_name): Call MemberName.GetName () to transform the
5616         MemberName into a string and ensure we don't have any type
5617         arguments.
5618         (type_name): Call MemberName.GetTypeExpression() to transfrom the
5619         MemberName into an expression.
5620         (method_header): Use namespace_or_type_name instead of member_name.     
5621
5622 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
5623
5624         * rootcontext.cs: Add new types to the boot resolution.
5625
5626         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
5627         MulticastDelegate is not allowed.
5628
5629         * typemanager.cs: Add new types to lookup: System.TypedReference
5630         and ArgIterator.
5631
5632         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
5633         check for TypedReference or ArgIterator, they are not allowed. 
5634
5635         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
5636         makes us properly catch 1510 in some conditions (see bug 56016 for
5637         details). 
5638
5639 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
5640
5641         * CryptoConvert.cs: update from corlib version
5642         with endian fixes.
5643
5644 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
5645
5646         * class.cs (Indexer.Define): Check indexername declaration
5647
5648 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
5649
5650         * attribute.cs (IsClsCompliant): Fixed problem with handling
5651         all three states (compliant, not-compliant, undetected).
5652
5653 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
5654
5655         * attribute.cs (Attribute): Location is now public.
5656         (Resolve): Store resolved arguments (pos_values) in attribute class.
5657         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
5658         (GetClsCompliantAttributeValue): New method that gets
5659         CLSCompliantAttribute value.
5660         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
5661         if exists else null.
5662         (AttributeTester): New class for CLS-Compliant verification routines.
5663
5664         * class.cs (Emit): Add CLS-Compliant verification.
5665         (Method.GetSignatureForError): Implemented.
5666         (Constructor.GetSignatureForError): Implemented
5667         (Constructor.HasCompliantArgs): Returns if constructor has
5668         CLS-Compliant arguments.
5669         (Constructor.Emit): Override.
5670         (Construcor.IsIdentifierClsCompliant): New method; For constructors
5671         is needed to test only parameters.
5672         (FieldBase.GetSignatureForError): Implemented.
5673         (TypeContainer): New member for storing base interfaces.
5674         (TypeContainer.FindMembers): Search in base interfaces too.
5675
5676         * codegen.cs (GetClsComplianceAttribute): New method that gets
5677         assembly or module CLSCompliantAttribute value.
5678         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
5679         for assembly.
5680         (ModuleClass.Emit): Add error 3012 test.
5681
5682         * const.cs (Emit): Override and call base for CLS-Compliant tests.
5683
5684         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
5685         state for all decl types.
5686         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
5687         if CLS-Compliant tests are required.
5688         (IsClsCompliaceRequired): New method. Analyze whether code
5689         must be CLS-Compliant.
5690         (IsExposedFromAssembly): New method. Returns true when MemberCore
5691         is exposed from assembly.
5692         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
5693         value or gets cached value.
5694         (HasClsCompliantAttribute): New method. Returns true if MemberCore
5695         is explicitly marked with CLSCompliantAttribute.
5696         (IsIdentifierClsCompliant): New abstract method. This method is
5697         used to testing error 3005.
5698         (IsIdentifierAndParamClsCompliant): New method. Common helper method
5699         for identifier and parameters CLS-Compliant testing.
5700         (VerifyClsCompliance): New method. The main virtual method for
5701         CLS-Compliant verifications.
5702         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
5703         null. I don't know why is null (too many public members !).
5704         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
5705         and get value of first CLSCompliantAttribute that found.
5706
5707         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
5708         (VerifyClsCompliance): Override and add extra tests.
5709
5710         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
5711         clscheck- disable CLS-Compliant verification event if assembly is has
5712         CLSCompliantAttribute(true).
5713
5714         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
5715         ApllyAttribute is now called in emit section as in the other cases.
5716         Possible future Emit integration.
5717         (IsIdentifierClsCompliant): New override.
5718         (VerifyClsCompliance): New override.
5719         (GetEnumeratorName): Returns full enum name.
5720
5721         * parameter.cs (GetSignatureForError): Implemented.
5722
5723         * report.cs (WarningData): New struct for Warning message information.
5724         (LocationOfPreviousError): New method.
5725         (Warning): New method. Reports warning based on the warning table.
5726         (Error_T): New method. Reports error based on the error table.
5727
5728         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
5729         verifications are done here.
5730
5731         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
5732
5733         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
5734         CLSCompliantAttribute.
5735         (all_imported_types): New member holds all imported types from other
5736         assemblies.
5737         (LoadAllImportedTypes): New method fills static table with exported types
5738         from all referenced assemblies.
5739         (Modules): New property returns all assembly modules.
5740
5741 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
5742
5743         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
5744         throwing a parser error.
5745
5746         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
5747         which removes the hardcoded get_/set_ prefixes for properties, as
5748         IL allows for the properties to be named something else.  
5749
5750         Bug #56013
5751
5752         * expression.cs: Do not override operand before we know if it is
5753         non-null.  Fix 56207
5754
5755 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5756
5757         * typemanager.cs: support for pinned variables.
5758
5759 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5760
5761         * decl.cs, typemanager.cs: Avoid using an arraylist
5762         as a buffer if there is only one result set.
5763
5764 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
5765
5766         * expression.cs: Make sure you cant call a static method
5767         with an instance expression, bug #56174.
5768
5769 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
5770
5771         * class.cs (IsDuplicateImplementation): Improve error reporting to
5772         flag 663 (method only differs in parameter modifier).
5773
5774         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
5775         in preprocessor directives.
5776
5777         * location.cs (LookupFile): Allow for the empty path.
5778
5779         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
5780         better approach for some of that patch, but its failing with the
5781         CharSet enumeration.  For now try/catch will do.
5782
5783         * typemanager.cs: Do not crash if a struct does not have fields.
5784         Fixes 56150.
5785
5786 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5787
5788         * expression.cs: cs0213, cant fix a fixed expression.
5789         fixes 50231.
5790
5791 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5792
5793         * cs-parser.jay: detect invalid embeded statements gracefully.
5794         bug #51113.
5795
5796 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
5797
5798         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
5799         As a regex:
5800         s/
5801         the invocation type may not be a subclass of the tye of the item/
5802         The type of the item must be a subclass of the invocation item.
5803         /g
5804
5805         Fixes bug #50820.
5806
5807 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
5808
5809         * attribute.cs: Added methods to get a string and a bool from an
5810         attribute. Required to information from AssemblyKeyFileAttribute,
5811         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
5812         * codegen.cs: Modified AssemblyName creation to include support for
5813         strongnames. Catch additional exceptions to report them as CS1548.
5814         * compiler.csproj: Updated include CryptoConvert.cs.
5815         * compiler.csproj.user: Removed file - user specific configuration.
5816         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
5817         Mono.Security assembly. The original class is maintained and tested in
5818         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
5819         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
5820         like CSC 8.0 (C# v2) supports.
5821         * Makefile: Added CryptoConvert.cs to mcs sources.
5822         * rootcontext.cs: Added new options for strongnames.
5823
5824 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
5825
5826         * driver.cs: For --expect-error, report error code `2'
5827         if the program compiled with no errors, error code `1' if
5828         it compiled with an error other than the one expected.
5829
5830 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
5831
5832         * compiler.csproj: Updated for Visual Studio .NET 2003.
5833         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
5834         * compiler.sln: Updated for Visual Studio .NET 2003.
5835
5836 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
5837
5838         * expression.cs: Fix bug #47234. We basically need to apply the
5839         rule that we prefer the conversion of null to a reference type
5840         when faced with a conversion to 'object' (csc behaviour).
5841
5842 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5843
5844         * statement.cs: Shorter form for foreach, eliminates
5845         a local variable. r=Martin.
5846
5847 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5848
5849         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
5850         checks if we can use brtrue/brfalse to test for 0.
5851         * expression.cs: use the above in the test for using brtrue/brfalse.
5852         cleanup code a bit.
5853
5854 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5855
5856         * expression.cs: Rewrite string concat stuff. Benefits:
5857
5858         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
5859         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
5860         rather than a concat chain.
5861
5862         * typemanager.cs: Add lookups for more concat overloads.
5863
5864 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
5865
5866         * expression.cs: Emit shorter il code for array init.
5867
5868         newarr
5869         dup
5870         // set 1
5871
5872         // set 2
5873
5874         newarr
5875         stloc.x
5876
5877         ldloc.x
5878         // set 1
5879
5880         ldloc.x
5881         // set 2
5882
5883 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
5884
5885         * statement.cs: Before, two switch blocks would be merged if the
5886         total size of the blocks (end_item - begin_item + 1) was less than
5887         two times the combined sizes of the blocks.
5888
5889         Now, it will only merge if after the merge at least half of the
5890         slots are filled.
5891
5892         fixes 55885.
5893
5894 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
5895
5896         * class.cs : csc build fix for GetMethods(). See bug #52503.
5897
5898 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
5899
5900         * expression.cs: Make sure fp comparisons work with NaN.
5901         This fixes bug #54303. Mig approved this patch a long
5902         time ago, but we were not able to test b/c the runtime
5903         had a related bug.
5904
5905 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
5906
5907         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
5908
5909 2004-03-19  Martin Baulig  <martin@ximian.com>
5910
5911         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
5912         two overloads may unify for some type parameter substitutions and
5913         report a CS0408 if appropriate.
5914
5915 2004-03-19  Martin Baulig  <martin@ximian.com>
5916
5917         * class.cs (MemberCore.IsDuplicateImplementation): Report the
5918         error here and not in our caller.
5919
5920 2004-03-19  Martin Baulig  <martin@ximian.com>
5921
5922         * interface.cs: Completely killed this file.
5923         (Interface): We're now a TypeContainer and live in class.cs.
5924
5925         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
5926         argument; we're now also called for interfaces.
5927         (TypeContainer.DefineMembers): Allow this method being called
5928         multiple times.
5929         (TypeContainer.GetMethods): New public method; formerly known as
5930         Interface.GetMethod().  This is used by PendingImplementation.
5931         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
5932         it's now private and non-static.
5933         (Interface): Moved this here; it's now implemented similar to
5934         Class and Struct.
5935         (Method, Property, Event, Indexer): Added `bool is_interface'
5936         argument to their .ctor's.
5937         (MemberBase.IsInterface): New public field.
5938
5939         * cs-parser.jay: Create normal Method, Property, Event, Indexer
5940         instances instead of InterfaceMethod, InterfaceProperty, etc.
5941         (opt_interface_base): Removed; we now use `opt_class_base' instead.
5942         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
5943
5944 2004-03-19  Martin Baulig  <martin@ximian.com>
5945
5946         * class.cs (MethodCore.IsDuplicateImplementation): New private
5947         method which does the CS0111 checking.
5948         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
5949         Use IsDuplicateImplementation().
5950
5951 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
5952
5953         * decl.cs (FindMemberToOverride): New method to find the correct
5954         method or property to override in the base class.
5955         * class.cs
5956             - Make Method/Property use the above method to find the
5957               version in the base class.
5958             - Remove the InheritableMemberSignatureCompare as it is now
5959               dead code.
5960
5961         This patch makes large code bases much faster to compile, as it is
5962         O(n) rather than O(n^2) to do this validation.
5963
5964         Also, it fixes bug 52458 which is that nested classes are not
5965         taken into account when finding the base class member.
5966
5967         Reviewed/Approved by Martin.
5968
5969 2004-03-17  Martin Baulig  <martin@ximian.com>
5970
5971         * expression.cs (MemberAccess.DoResolve): Take the parent's number
5972         of type arguments into account; use the `real_num_type_args'
5973         approach like in DoResolveAsTypeStep().
5974
5975         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
5976         nested types.
5977
5978 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
5979
5980         * interface.cs: In all interface classes removed redundant
5981         member initialization.
5982
5983 2004-03-16  Martin Baulig  <martin@ximian.com>
5984
5985         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
5986
5987 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
5988
5989         * decl.cs (DefineTypeAndParents): New helper method to define a
5990         type's containers before the type itself is defined;  This is a
5991         bug exposed by the recent changes to Windows.Forms when an
5992         implemented interface was defined inside a class that had not been
5993         built yet.   
5994
5995         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
5996
5997         (Check): Loop correctly to report errors modifiers
5998         (UNSAFE was not in the loop, since it was the same as TOP).
5999
6000         * interface.cs: Every interface member now takes a ModFlags,
6001         instead of a "is_new" bool, which we set on the base MemberCore. 
6002
6003         Every place where we called "UnsafeOk" in the interface, now we
6004         call the proper member (InterfaceMethod.UnsafeOK) instead to get
6005         the unsafe settings from the member declaration instead of the
6006         container interface. 
6007
6008         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
6009
6010         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
6011         `set_indexer_name' to the pending bits (one per type).
6012
6013         We fixed a bug today that was picking the wrong method to
6014         override, since for properties the existing InterfaceMethod code
6015         basically ignored the method name.  Now we make sure that the
6016         method name is one of the valid indexer names.
6017
6018 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
6019  
6020         * support.cs (SeekableStreamReader): Keep track of stream byte
6021         positions and don't mix them with character offsets to the buffer.
6022
6023         Patch from Gustavo Giráldez
6024
6025 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
6026
6027         * interface.cs (InterfaceSetGetBase): Removed double member
6028         initialization, base class does it as well.
6029
6030 2004-03-13  Martin Baulig  <martin@ximian.com>
6031
6032         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
6033         when compiling corlib.
6034
6035 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
6036
6037         * convert.cs (ExplicitConversion): We were reporting an error on
6038         certain conversions (object_type source to a value type, when the
6039         expression was `null') before we had a chance to pass it through
6040         the user defined conversions.
6041
6042         * driver.cs: Replace / and \ in resource specifications to dots.
6043         Fixes 50752
6044
6045         * class.cs: Add check for duplicate operators.  Fixes 52477
6046
6047 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
6048
6049         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
6050         that are in the middle of the statements, not only at the end.
6051         Fixes #54987
6052
6053         * class.cs (TypeContainer.AddField): No longer set the
6054         `HaveStaticConstructor' flag, now we call it
6055         `UserDefineStaticConstructor' to diferentiate the slightly
6056         semantic difference.
6057
6058         The situation is that we were not adding BeforeFieldInit (from
6059         Modifiers.TypeAttr) to classes that could have it.
6060         BeforeFieldInit should be set to classes that have no static
6061         constructor. 
6062
6063         See:
6064
6065         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
6066
6067         And most importantly Zoltan's comment:
6068
6069         http://bugzilla.ximian.com/show_bug.cgi?id=44229
6070
6071         "I think beforefieldinit means 'it's ok to initialize the type sometime 
6072          before its static fields are used', i.e. initialization does not need
6073          to be triggered by the first access to the type. Setting this flag
6074          helps the JIT to compile better code, since it can run the static
6075          constructor at JIT time, and does not need to generate code to call it
6076          (possibly lots of times) at runtime. Unfortunately, mcs does not set
6077          this flag for lots of classes like String. 
6078          
6079          csc sets this flag if the type does not have an explicit static 
6080          constructor. The reasoning seems to be that if there are only static
6081          initalizers for a type, and no static constructor, then the programmer
6082          does not care when this initialization happens, so beforefieldinit
6083          can be used.
6084          
6085          This bug prevents the AOT compiler from being usable, since it 
6086          generates so many calls to mono_runtime_class_init that the AOT code
6087          is much slower than the JITted code. The JITted code is faster, 
6088          because it does not generate these calls if the vtable is type is
6089          already initialized, which is true in the majority of cases. But the
6090          AOT compiler can't do this."
6091
6092 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
6093
6094         * class.cs (MethodData.Emit): Refactor the code so symbolic
6095         information is generated for destructors;  For some reasons we
6096         were taking a code path that did not generate symbolic information
6097         before. 
6098
6099 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
6100
6101         * class.cs: Create a Constructor.CheckBase method that
6102         takes care of all validation type code. The method
6103         contains some code that was moved from Define.
6104
6105         It also includes new code that checks for duplicate ctors.
6106         This fixes bug #55148.
6107
6108 2004-03-09  Joshua Tauberer <tauberer@for.net>
6109
6110         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
6111         a { ... }-style array creation invokes EmitStaticInitializers
6112         which is not good for reference-type arrays.  String, decimal
6113         and now null constants (NullCast) are not counted toward
6114         static initializers.
6115
6116 2004-03-05  Martin Baulig  <martin@ximian.com>
6117
6118         * location.cs (SourceFile.HasLineDirective): New public field;
6119         specifies whether the file contains or is referenced by a "#line"
6120         directive.
6121         (Location.DefineSymbolDocuments): Ignore source files which
6122         either contain or are referenced by a "#line" directive.        
6123
6124 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
6125
6126         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
6127         direct access to our parent, so check the method inline there.
6128
6129 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6130
6131         * expression.cs (Invocation.EmitCall): Miguel's last commit
6132         caused a regression. If you had:
6133
6134             T t = null;
6135             t.Foo ();
6136
6137         In Foo the implict this would be null.
6138
6139 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
6140
6141         * expression.cs (Invocation.EmitCall): If the method is not
6142         virtual, do not emit a CallVirt to it, use Call.
6143
6144         * typemanager.cs (GetFullNameSignature): Improve the method to
6145         cope with ".ctor" and replace it with the type name.
6146
6147         * class.cs (ConstructorInitializer.Resolve): Now the method takes
6148         as an argument the ConstructorBuilder where it is being defined,
6149         to catch the recursive constructor invocations.
6150
6151 2004-03-16  Martin Baulig  <martin@ximian.com>
6152
6153         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
6154         ConstructedType, call ResolveType() on it to get the type rather
6155         than just using `expr.Type'.
6156
6157 2004-03-16  Martin Baulig  <martin@ximian.com>
6158
6159         * generics.cs (ConstructedType.GetMemberAccess): Take the
6160         EmitContext instead on the TypeExpr and use
6161         ec.TypeContainer.CurrentType/ec.ContainerType.
6162
6163 2004-03-16  Martin Baulig  <martin@ximian.com>
6164
6165         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
6166         parameters before aliases.
6167
6168 2004-03-16  Martin Baulig  <martin@ximian.com>
6169
6170         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
6171         New oublic function; checks whether two generic instances may become
6172         equal under some instantiations (26.3.1).
6173
6174         * class.cs (TypeContainer.Define): Call
6175         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
6176         error.
6177
6178 2004-03-16  Martin Baulig  <martin@ximian.com>
6179
6180         * class.cs (TypeContainer.GetClassBases): Moved
6181         Error_TypeParameterAsBase() here and also check whether the base
6182         class is not an attribute.
6183
6184 2004-03-16  Martin Baulig  <martin@ximian.com>
6185
6186         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
6187
6188 2004-03-16  Martin Baulig  <martin@ximian.com>
6189
6190         * class.cs (Error_TypeParameterAsBase): Use correct error number
6191         here (CS0689).  
6192
6193 2004-03-16  Martin Baulig  <martin@ximian.com>
6194
6195         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
6196         for generics.
6197
6198         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
6199         error reporting.
6200
6201 2004-03-15  Martin Baulig  <martin@ximian.com>
6202
6203         * typemanager.cs (TypeManager.GetFullName): New public method.
6204         (TypeManager.MemberLookup): Added `int_num_type_arguments'
6205         argument; only return members with the correct number of type
6206         arguments.
6207         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
6208         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
6209         whether the number of type arguments matches.
6210
6211         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
6212         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
6213
6214         * expression.cs (MemberAccess): Added public `NumTypeArguments'
6215         field; it's set by the protected .ctor when we're actually a
6216         GenericMemberAccess.
6217         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
6218         arguments and pass it to MemberLookupFinal ().
6219
6220         * ecore.cs (Expression.MemberLookup): Added `int
6221         num_type_arguments' argument; only return members with the correct
6222         number of type arguments.
6223         (Expression.MemberLookupFailed): Check whether the MemberLookup
6224         failed because we did not have the correct number of type
6225         arguments; report CS0305 in this case.
6226
6227         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
6228         `e.ResolveAsTypeTerminal()' already did so.
6229
6230 2004-03-15  Martin Baulig  <martin@ximian.com>
6231
6232         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
6233         we're a ConstructedType; in this case, the caller must report an
6234         error (for instance CS0131).
6235
6236         * generic.cs (TypeArguments): Added Location argument to the .ctor.
6237         (TypeArguments.Resolve): Actually report errors here.
6238
6239 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
6240
6241         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
6242         `set_indexer_name' to the pending bits (one per type).
6243
6244         We fixed a bug today that was picking the wrong method to
6245         override, since for properties the existing InterfaceMethod code
6246         basically ignored the method name.  Now we make sure that the
6247         method name is one of the valid indexer names.
6248
6249 2004-03-15  Martin Baulig  <martin@ximian.com>
6250
6251         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
6252         for generic instances.
6253
6254 2004-03-13  Martin Baulig  <martin@ximian.com>
6255
6256         * class.cs (TypeContainer.DefineType): Call
6257         TypeManager.AddUserType() immediately after creating the
6258         TypeBuilder; pass all type parameters when creating the
6259         CurrentType.
6260
6261         * decl.cs (DeclSpace.FindNestedType): New public method.
6262         (DeclSpace.FindType): Added `int num_type_args' argument; only
6263         return types with the correct number of type parameters.
6264         (DeclSpace.CountTypeParams): New public property.
6265
6266         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
6267         the number of type parameters; defaults to zero.
6268
6269         * generic.cs (TypeArguments.Count): New public property.
6270         (ConstructedType.DoResolveAsTypeStep): First call
6271         ds.FindNestedType() to find out whether we're nested in the
6272         current generic type; in this case, we inherit all type parameters
6273         from the current class.
6274
6275         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
6276         num_type_args' argument.
6277         (RootContext.LookupType): Added overloaded version which takes the
6278         number of type arguments; only return types with the correct
6279         number of type arguments.
6280
6281         * typemanager.cs (TypeManager.CheckGeneric): New public function;
6282         checks whether `Type t' has `int num_type_args'.
6283
6284 2004-03-13  Martin Baulig  <martin@ximian.com>
6285
6286         * generic.cs (GenericMethod.DefineType): New method; calls
6287         DefineType() on all the type parameters.
6288
6289         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
6290         (MethodData.Define): If we're a generic method, call
6291         GenericMethod.DefineType() to define the type parameters.       
6292
6293 2004-03-10  Martin Baulig  <martin@ximian.com>
6294
6295         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
6296         instead of IsAssignableFrom.    
6297
6298 2004-03-10  Martin Baulig  <martin@ximian.com>
6299
6300         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
6301
6302         * support.cs (ParameterData.HasArrayParameter): New property.
6303         (ReflectionParameters.ctor): Take a MethodBase instead of a
6304         ParameterInfo[].  If we have any type parameters, get the generic
6305         method definition and ask it whether we have variable arguments.
6306
6307 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
6308
6309         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
6310         routines to check if a type is an enumerable/enumerator allow
6311         classes that implement the IEnumerable or IEnumerator interfaces.
6312
6313         * class.cs (Property, Operator): Implement IIteratorContainer, and
6314         implement SetYields.
6315
6316         (Property.Define): Do the block swapping for get_methods in the
6317         context of iterators.   We need to check if Properties also
6318         include indexers or not.
6319
6320         (Operator): Assign the Block before invoking the
6321         OperatorMethod.Define, so we can trigger the Iterator code
6322         replacement. 
6323
6324         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
6325         Property and Operator classes are not created when we parse the
6326         declarator but until we have the block completed, so we use a
6327         singleton SimpleIteratorContainer.Simple to flag whether the
6328         SetYields has been invoked.
6329
6330         We propagate this setting then to the Property or the Operator to
6331         allow the `yield' to function.
6332
6333 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
6334
6335         * codegen.cs: Implemented attribute support for modules.
6336         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
6337         Assembly/Module functionality.
6338
6339         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
6340         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
6341         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
6342
6343 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
6344
6345         * interface.cs (FindMembers): The operation is performed on all base
6346         interfaces and not only on the first. It is required for future CLS Compliance patch.
6347
6348 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
6349
6350         * statement.cs, codegen.cs:
6351         This patch deals with patterns such as:
6352
6353         public class List : IEnumerable {
6354
6355                 public MyEnumerator GetEnumerator () {
6356                         return new MyEnumerator(this);
6357                 }
6358
6359                 IEnumerator IEnumerable.GetEnumerator () {
6360                         ...
6361                 }
6362                 
6363                 public struct MyEnumerator : IEnumerator {
6364                         ...
6365                 }
6366         }
6367
6368         Before, there were a few things we did wrong:
6369         1) we would emit callvirt on a struct, which is illegal
6370         2) we emited ldarg when we needed to emit ldarga
6371         3) we would mistakenly call the interface methods on an enumerator
6372         type that derived from IEnumerator and was in another assembly. For example:
6373
6374         public class MyEnumerator : IEnumerator
6375
6376         Would have the interface methods called, even if there were public impls of the
6377         method. In a struct, this lead to invalid IL code.
6378
6379 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
6380
6381         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
6382           renamed to Emit.
6383
6384         * delegate.cs (Define): Fixed crash when delegate type is undefined.
6385
6386 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
6387
6388         * cs-parser.jay: Fix small regression: we were not testing V2
6389         compiler features correctly.
6390
6391         * interface.cs: If the emit context is null, then create one
6392
6393 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
6394
6395         * decl.cs (GetSignatureForError): New virtual method to get full name
6396           for error messages.
6397
6398         * attribute.cs (IAttributeSupport): New interface for attribute setting.
6399           Now it is possible to rewrite ApplyAttributes method to be less if/else.
6400
6401         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
6402           Duplicated members and code in these classes has been removed.
6403           Better encapsulation in these classes.
6404
6405 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
6406
6407         * assign.cs (Assign.DoResolve): When dealing with compound
6408         assignments, there is a new rule in ECMA C# 2.4 (might have been
6409         there before, but it is documented here) that states that in:
6410
6411         a op= b;
6412
6413         If b is of type int, and the `op' is a shift-operator, then the
6414         above is evaluated as:
6415
6416         a = (int) a op b 
6417
6418         * expression.cs (Binary.ResolveOperator): Instead of testing for
6419         int/uint/long/ulong, try to implicitly convert to any of those
6420         types and use that in pointer arithmetic.
6421
6422         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
6423         method to print information for from the type, not from the
6424         null-method we were given.
6425
6426 2004-02-01  Duncan Mak  <duncan@ximian.com>
6427
6428         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
6429         parsing for cmd, fixes bug #53694.
6430
6431 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
6432
6433         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
6434         in the member name duplication tests. Property and operator name duplication
6435         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
6436
6437 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
6438
6439         * interface.cs (PopulateMethod): Fixed crash when interface method
6440         returns not existing type (error test cs0246-3.cs).
6441
6442 2004-02-02  Ravi Pratap M <ravi@ximian.com>
6443
6444         * cs-parser.jay (interface_accessors): Re-write actions to also
6445         store attributes attached to get and set methods. Fix spelling
6446         while at it.
6447
6448         (inteface_property_declaration): Modify accordingly.
6449
6450         (InterfaceAccessorInfo): New helper class to store information to pass
6451         around between rules that use interface_accessors.
6452
6453         * interface.cs (Emit): Apply attributes on the get and set
6454         accessors of properties and indexers too.
6455
6456         * attribute.cs (ApplyAttributes): Modify accordingly to use the
6457         right MethodBuilder when applying attributes to the get and set accessors.
6458
6459 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
6460
6461         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
6462
6463 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
6464
6465         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
6466
6467 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
6468
6469         * cs-parser.jay: Remove YIELD token, instead use the new grammar
6470         changes that treat `yield' specially when present before `break'
6471         or `return' tokens.
6472
6473         * cs-tokenizer.cs: yield is no longer a keyword.
6474
6475 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
6476
6477         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
6478         setting for default constructors.
6479         For default constructors are almost every time set wrong Modifier. The
6480         generated IL code has been alright. But inside mcs this values was
6481         wrong and this was reason why several of my CLS Compliance tests
6482         failed.
6483
6484 2004-02-27  Martin Baulig  <martin@ximian.com>
6485
6486         * generics.cs (ConstructedType.ResolveType): Make the nested type
6487         stuff actually work.
6488
6489 2004-02-25  Martin Baulig  <martin@ximian.com>
6490
6491         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
6492         property; returns the type parameters just from the current type,
6493         ie. with the ones from outer classes.
6494         (DeclSpace.LookupGeneric): First search in the current class, then
6495         in outer classes.
6496         (DeclSpace.initialize_type_params): When hiding a type parameter
6497         from an outer class, put it into the `type_param_list' anyways.
6498
6499         * expression.cs (MemberAccess.expr): Made this field protected.
6500
6501         * class.cs (TypeContainer.Define): The `CurrentType' just contains
6502         the type parameters from the current class.
6503
6504         * generic.cs (ConstructedType.ResolveType): Support nested generic
6505         types by taking the type parameters which we inherit from outer
6506         classes into account.
6507         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
6508         support for nested generic types.
6509
6510 2004-02-23  Martin Baulig  <martin@ximian.com>
6511
6512         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
6513         field and check whether we're nested inside a generic type.
6514         (DeclSpace.ResolveType): If we're resolving to a generic type
6515         definition, create a ConstructedType and return its resolved type.
6516         (DeclSpace.initialize_type_params): New private method;
6517         initializes the `type_param_list' field from the type parameters
6518         from this and all enclosing classes.
6519         (DeclSpace.TypeParameters): Call initialize_type_params() unless
6520         we're already initialized.
6521
6522 2004-02-23  Martin Baulig  <martin@ximian.com>
6523
6524         * class.cs (Method.Define): Create the generic method before
6525         calling DoDefine().
6526         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
6527         the TypeContainer one); we use this for generic methods.
6528
6529         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
6530         parent's TypeBuilder.
6531
6532 2004-02-18  Martin Baulig  <martin@ximian.com>
6533
6534         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
6535         to check for equality.
6536
6537 2004-02-05  Martin Baulig  <martin@ximian.com>
6538
6539         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
6540         `ec.TypeContainer.CurrentType', use it instead of
6541         `ec.ContainerType' to check whether we're in the type's ctor.
6542
6543 2004-01-29  Martin Baulig  <martin@ximian.com>
6544
6545         * expression.cs (Invocation.DoResolve): If we're a
6546         `ConstructedType', then we're actually a generic method, so
6547         rewrite the expr as a GenericMemberAccess.
6548
6549         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
6550         here; manually parse it into a string.
6551
6552 2004-01-28  Martin Baulig  <martin@ximian.com>
6553
6554         * typemanager.cs (TypeManager.IsEqual): New static method.
6555         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
6556         check for equality instead of using `=='.
6557
6558 2004-01-26  Martin Baulig  <martin@ximian.com>
6559
6560         * decl.cs (DeclSpace.CurrentType): New public field.
6561
6562         * expression.cs (This.ResolveBase): If we have an
6563         `ec.TypeContainer.CurrentType', use it instead of
6564         `ec.ContainerType'.
6565
6566         * class.cs (TypeContainer.DefineType): If we're a generic type,
6567         create the `CurrentType' (unresolved).
6568         (TypeContainer.GenericType): New private field.
6569         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
6570         it and store it in `GenericType' before creating the MemberCache.
6571         (TypeContainer.GetMembers): If we have a `GenericType', call
6572         TypeManager.FindMembers() on it.
6573
6574         * interface.cs (Interface.GenericType): New private field.
6575         (Interface.DefineType): If we're a generic type, create the
6576         `CurrentType' (unresolved).
6577         (Interface.DefineMembers): If we have a `CurrentType', resolve it
6578         and store it in `GenericType' before creating the MemberCache.
6579         (Interface.GetMembers): If we have a `GenericType', call
6580         TypeManager.FindMembers() on it.
6581
6582 2004-01-22  Martin Baulig  <martin@ximian.com>
6583
6584         * cs-parser.jay (namespace_or_type_name): Return an Expression,
6585         not a QualifiedIdentifier.  This is what `type_name_expression'
6586         was previously doing.
6587         (type_name_expression): Removed; the code is now in
6588         `namespace_or_type_name'.
6589         (qualified_identifier): Removed, use `namespace_or_type_name'
6590         instead.
6591         (QualifiedIdentifier): Removed this class.      
6592
6593 2004-01-22  Martin Baulig  <martin@ximian.com>
6594
6595         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
6596         not a string as alias name.
6597
6598 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
6599
6600         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
6601         #52730 bug, and instead compute correctly the need to use a
6602         temporary variable when requesting an address based on the
6603         static/instace modified of the field and the constructor.
6604  
6605 2004-01-21  Martin Baulig  <martin@ximian.com>
6606
6607         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
6608         class and namespace before looking up aliases.  Fixes #52517.
6609
6610 2004-01-21  Martin Baulig  <martin@ximian.com>
6611
6612         * flowanalysis.cs (UsageVector.Merge): Allow variables being
6613         assinged in a 'try'; fixes exception4.cs.
6614
6615 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6616         * class.cs : Implemented parameter-less constructor for TypeContainer
6617
6618         * decl.cs: Attributes are now stored here. New property OptAttributes
6619
6620         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
6621
6622         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
6623
6624 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6625
6626         * typemanager.cs (CSharpSignature): Now reports also inner class name.
6627           (CSharpSignature): New method for indexer and property signature.
6628
6629 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6630
6631         * pending.cs (IsVirtualFilter): Faster implementation.
6632
6633 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6634
6635         * typemanager.cs: Avoid inclusion of same assembly more than once.
6636
6637 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6638
6639         * cs-parser.jay: Fixed problem where the last assembly attribute
6640           has been applied also to following declaration (class, struct, etc.)
6641           
6642 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
6643
6644         * class.cs: Added error CS0538, CS0539 reporting.
6645         Fixed crash on Microsoft runtime when field type is void.
6646
6647         * cs-parser.jay: Added error CS0537 reporting.
6648
6649         * pending.cs: Added error CS0535 reporting.
6650         Improved error report for errors CS0536, CS0534.
6651
6652 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
6653
6654         Merge a few bits from the Anonymous Method MCS tree.
6655
6656         * statement.cs (ToplevelBlock): New class for toplevel methods,
6657         will hold anonymous methods, lifted variables.
6658
6659         * cs-parser.jay: Create toplevel blocks for delegates and for
6660         regular blocks of code. 
6661
6662 2004-01-20  Martin Baulig  <martin@ximian.com>
6663
6664         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
6665         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
6666         and `NeedExplicitReturn'; added `IsLastStatement'.
6667         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
6668         have a `ReturnLabel' or we're not unreachable.
6669
6670         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
6671         child's reachability; don't just override ours with it.  Fixes
6672         #58058 (lluis's example).
6673         (FlowBranching): Added public InTryOrCatch(), InCatch(),
6674         InFinally(), InLoop(), InSwitch() and
6675         BreakCrossesTryCatchBoundary() methods.
6676
6677         * statement.cs (Return): Do all error checking in Resolve().
6678         Unless we are the last statement in a top-level block, always
6679         create a return label and jump to it.
6680         (Break, Continue): Do all error checking in Resolve(); also make
6681         sure we aren't leaving a `finally'.
6682         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
6683         statement in a top-level block.
6684         (Block.Flags): Added `IsDestructor'.
6685         (Block.IsDestructor): New public property.
6686
6687 2004-01-20  Martin Baulig  <martin@ximian.com>
6688
6689         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
6690
6691 2004-01-20  Martin Baulig  <martin@ximian.com>
6692
6693         * statement.cs (Statement.ResolveUnreachable): New public method.
6694         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
6695         (Block.Resolve): Resolve unreachable statements.
6696
6697 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6698
6699         * expression.cs: We need to fix the case where we do
6700         not have a temp variable here.
6701
6702         * assign.cs: Only expression compound assignments need
6703         temporary variables.
6704
6705 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
6706
6707         * flowanalysis.cs: Reduce memory allocation in a few ways:
6708           - A block with no variables should not allocate a bit
6709             vector for itself.
6710           - A method with no out parameters does not need any tracking
6711             for assignment of the parameters, so we need not allocate
6712             any data for it.
6713           - The arrays:
6714                 public readonly Type[] VariableTypes;
6715                 public readonly string[] VariableNames;
6716             Are redundant. The data is already stored in the variable
6717             map, so we need not allocate another array for it.
6718           - We need to add alot of checks for if (params | locals) == null
6719             due to the first two changes.
6720
6721 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
6722
6723         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
6724         implement IMemoryLocation, we store a copy on a local variable and
6725         take the address of it.  Patch from Benjamin Jemlich
6726
6727         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
6728         to use a special "type_name_expression" rule which reduces the
6729         number of "QualifiedIdentifier" classes created, and instead
6730         directly creates MemberAccess expressions.
6731
6732 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
6733
6734         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
6735         that fixes #52853.  Null literal assignment to ValueType
6736
6737         * class.cs (MethodData.Emit): Instead of checking the name of the
6738         method to determine if its a destructor, create a new derived
6739         class from Method called Destructor, and test for that.  
6740
6741         * cs-parser.jay: Create a Destructor object instead of a Method.  
6742
6743         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
6744
6745         Fixes: 52933
6746
6747 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
6748
6749         * expression.cs (Binary.ResolveOperator): Perform an implicit
6750         conversion from MethodGroups to their delegate types on the
6751         Addition operation.
6752
6753         * delegate.cs: Introduce a new class DelegateCreation that is the
6754         base class for `NewDelegate' and `ImplicitDelegateCreation',
6755         factor some code in here.
6756
6757         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
6758         conversion from MethodGroups to compatible delegate types. 
6759
6760         * ecore.cs (Expression.Resolve): Do not flag error 654
6761         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
6762         we allow conversions from MethodGroups to delegate types now.
6763
6764         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
6765         assignments in v2 either.
6766
6767 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
6768
6769         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
6770         static read-only fields in ctors.
6771
6772         Applied patch from Benjamin Jemlich 
6773
6774         * expression.cs (UnaryMutator): Avoid leaking local variables. 
6775
6776 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
6777
6778         * cs-tokenizer.cs (IsCastToken): Allow the various native types
6779         here to return true, as they can be used like this:
6780
6781                 (XXX) int.MEMBER ()
6782
6783         Fixed 49836 and all the other dups
6784
6785 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
6786
6787         * driver.cs: Implement /win32res and /win32icon.
6788
6789 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
6790
6791         * cs-parser.jay: Add a rule to improve error handling for the
6792         common mistake of placing modifiers after the type.
6793
6794 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
6795
6796         * cs-parser.jay (interface_event_declaration): Catch
6797         initialization of events on interfaces, and report cs0068
6798
6799         * cs-parser.jay (interface_event_declaration): Catch
6800         initialization of events. 
6801
6802         * ecore.cs: Better report missing constructors.
6803
6804         * expression.cs (Binary.ResolveOperator): My previous bug fix had
6805         the error reporting done in the wrong place.  Fix.
6806
6807         * expression.cs (Binary.ResolveOperator): Catch the 
6808         operator + (E x, E y) error earlier, and later allow for implicit
6809         conversions in operator +/- (E e, U x) from U to the underlying
6810         type of E.
6811
6812         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
6813         52596, if the container class is abstract, the default constructor
6814         is protected otherwise its public (before, we were always public).
6815
6816         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
6817         fixed statement.
6818
6819         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
6820         Jemlich that fixes bug #52597, MCS was generating invalid code for
6821         idisposable structs.   Thanks to Ben for following up with this
6822         bug as well.
6823
6824 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
6825
6826         * driver.cs: Allow assemblies without code to be generated, fixes
6827         52230.
6828
6829 2004-01-07  Nick Drochak <ndrochak@gol.com>
6830
6831         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
6832
6833 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
6834
6835         * cs-parser.jay: Add rules to improve error reporting if fields or
6836         methods are declared at the namespace level (error 116)
6837
6838         * Add rules to catch event add/remove
6839
6840 2004-01-04  David Sheldon <dave-mono@earth.li>
6841
6842   * expression.cs: Added matching ")" to error message for 
6843   CS0077
6844
6845 2004-01-03 Todd Berman <tberman@gentoo.org>
6846
6847         * ecore.cs, attribute.cs:
6848         Applying fix from #52429.
6849
6850 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6851
6852         * ecore.cs, expression.cs, statement.cs:
6853         Total rewrite of how we handle branching. We
6854         now handle complex boolean expressions with fewer
6855         jumps. As well if (x == 0) no longer emits a ceq.
6856
6857         if (x is Foo) is much faster now, because we generate
6858         better code.
6859
6860         Overall, we get a pretty big improvement on our benchmark
6861         tests. The code we generate is smaller and more readable.
6862
6863         I did a full two-stage bootstrap. The patch was reviewed
6864         by Martin and Miguel.
6865
6866 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6867
6868         * cs-parser.jay: Make primary_expression not take a QI.
6869         we dont need this because the member_access rule covers
6870         us here. So we replace the rule with just IDENTIFIER.
6871
6872         This has two good effects. First, we remove a s/r conflict.
6873         Second, we allocate many fewer QualifiedIdentifier objects.
6874
6875 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6876
6877         * attribute.cs: Handle MarshalAs attributes as pseudo, and
6878         set the correct information via SRE. This prevents
6879         hanging on the MS runtime. Fixes #29374.
6880
6881 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
6882
6883         * convert.cs: correctly handle conversions to value types
6884         from Enum and ValueType as unboxing conversions.
6885
6886         Fixes bug #52569. Patch by Benjamin Jemlich.
6887
6888 2004-01-02  Ravi Pratap  <ravi@ximian.com>
6889
6890         * expression.cs (BetterConversion): Prefer int -> uint
6891         over int -> ulong (csc's behaviour). This fixed bug #52046.
6892
6893 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
6894
6895         * decl.cs (MemberCache.FindMembers): now returns a
6896         MemberInfo [].
6897
6898         * typemanager.cs: In general, go with with ^^.
6899         (CopyNewMethods): take an IList.
6900         (RealMemberLookup): Only allocate an arraylist
6901         if we copy from two sets of methods.
6902
6903         This change basically does two things:
6904         1) Fewer array lists allocated due to CopyNewMethods.
6905         2) the explicit cast in MemberList costed ALOT.
6906
6907 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
6908
6909         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
6910         a hashtable to avoid needless string allocations when an identifier is
6911         used more than once (the common case).
6912
6913 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6914
6915         * pending.cs: MS's TypeBuilder.GetInterfaces ()
6916         is broken, it will not return anything. So, we
6917         have to use the information we have in mcs to
6918         do the task.
6919
6920         * typemanager.cs: Add a cache for GetInterfaces,
6921         since this will now be used more often (due to ^^)
6922
6923         (GetExplicitInterfaces) New method that gets the
6924         declared, not effective, interfaces on a type
6925         builder (eg, if you have interface IFoo, interface
6926         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
6927         { IBar }.
6928
6929         This patch makes MCS able to bootstrap itself on
6930         Windows again.
6931
6932 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
6933
6934         * expression.cs: Remove the Nop's that Miguel put
6935         in by mistake.
6936
6937 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6938
6939         * report.cs, codegen.cs: Give the real stack trace to
6940         the error when an exception is thrown.
6941
6942 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6943
6944         * decl.cs: only allocate hashtables for ifaces if 
6945         it is an iface!
6946
6947 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6948
6949         * expression.cs: fix the error from cs0121-2.cs
6950         (a parent interface has two child interfaces that
6951         have a function with the same name and 0 params
6952         and the function is called through the parent).
6953
6954 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
6955
6956         * class.cs, rootcontext.cs, typmanager.cs: do not
6957         leak pointers.
6958
6959 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
6960
6961         * codegen.cs: remove stack for the ec flow branching.
6962         It is already a linked list, so no need.
6963
6964 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
6965
6966         * Makefile: Allow custom profiler here.
6967
6968 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6969
6970         * typemanager.cs (LookupType):
6971           - Use a static char [], because split takes
6972             a param array for args, so it was allocating
6973             every time.
6974           - Do not store true in a hashtable, it boxes.
6975
6976 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
6977
6978         * flowanalysis.cs: bytify common enums.
6979
6980 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6981
6982         * modifiers.cs: Add a new set of flags for the
6983         flags allowed on explicit interface impls.
6984         * cs-parser.jay: catch the use of modifiers in
6985         interfaces correctly.
6986         * class.cs: catch private void IFoo.Blah ().
6987
6988         All related to bug #50572.
6989
6990 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6991
6992         * decl.cs: Rewrite the consistant accessability checking.
6993         Accessability is not linear, it must be implemented in
6994         a tableish way. Fixes #49704.
6995
6996 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
6997
6998         * expression.cs: Handle negation in a checked context.
6999         We must use subtraction from zero. Fixes #38674.
7000
7001 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7002
7003         * class.cs: Ignore static void main in DLLs.
7004         * rootcontext.cs: Handle the target type here,
7005         since we are have to access it from class.cs
7006         * driver.cs: account for the above.
7007
7008 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
7009
7010         * report.cs: Give line numbers and files if available.
7011
7012 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
7013
7014         * driver.cs: Implement /addmodule.
7015
7016         * typemanager.cs:  Change 'modules' field so it now contains Modules not
7017         ModuleBuilders.
7018
7019 2003-12-20  Martin Baulig  <martin@ximian.com>
7020
7021         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
7022         (FieldBase.IsAssigned): Removed this field.
7023         (FieldBase.SetAssigned): New public method.
7024         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
7025
7026 2003-12-20  Martin Baulig  <martin@ximian.com>
7027
7028         * expression.cs (LocalVariableReference.DoResolve): Don't set
7029         `vi.Used' if we're called from DoResolveLValue().
7030
7031         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
7032         returns the usage vector it just merged into the current one -
7033         pass this one to UsageWarning().
7034         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
7035         of the `EmitContext', don't call this recursively on our children.
7036
7037 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
7038
7039         * driver.cs: Implement /target:module.
7040
7041 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
7042
7043         * support.cs (CharArrayHashtable): New helper class.
7044
7045         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
7046         char arrays, not strings, so we can avoid creating a string in
7047         consume_identifier if the identifier is a keyword.
7048
7049 2003-12-16  Martin Baulig  <martin@ximian.com>
7050
7051         * statement.cs (LocalInfo.Assigned): Removed this property.
7052         (LocalInfo.Flags): Removed `Assigned'.
7053         (LocalInfo.IsAssigned): New public method; takes the EmitContext
7054         and uses flow analysis.
7055         (Block.UsageWarning): Made this method private.
7056         (Block.Resolve): Call UsageWarning() if appropriate.
7057
7058         * expression.cs (LocalVariableReference.DoResolve): Always set
7059         LocalInfo.Used here.
7060
7061 2003-12-13  Martin Baulig  <martin@ximian.com>
7062
7063         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
7064         any value here; we're now using flow analysis to figure out
7065         whether a statement/block returns a value.
7066
7067 2003-12-13  Martin Baulig  <martin@ximian.com>
7068
7069         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
7070         working again.
7071         (FlowBranching.MergeFinally): Don't call
7072         `branching.CheckOutParameters()' here, this is called in
7073         MergeTopBlock().
7074         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
7075         when adding the `finally' vector.       
7076
7077 2003-12-13  Martin Baulig  <martin@ximian.com>
7078
7079         * flowanalysis.cs
7080         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
7081         actually work and also fix #48962.
7082
7083 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
7084
7085         * decl.cs: Do not check System.Object for nested types,
7086         since we know it does not have any. Big bang for buck:
7087
7088         BEFORE:
7089            Run 1:   8.35 seconds
7090            Run 2:   8.32 seconds
7091            corlib:  17.99 seconds
7092         AFTER:
7093            Run 1:   8.17 seconds
7094            Run 2:   8.17 seconds
7095            corlib:  17.39 seconds
7096
7097 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
7098
7099         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
7100         time we are returning 0 members, so we save alot here.
7101
7102 2003-12-11  Martin Baulig  <martin@ximian.com>
7103
7104         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
7105         `MergeChild()', also just take the `FlowBranching' as argument;
7106         call Merge() on it and return the result.
7107         (FlowBranching.Merge): We don't need to do anything if we just
7108         have one sibling.
7109
7110 2003-12-11  Martin Baulig  <martin@ximian.com>
7111
7112         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
7113         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
7114         Maurer for this idea.
7115
7116 2003-12-11  Martin Baulig  <martin@ximian.com>
7117
7118         * flowanalysis.cs (MergeResult): This class is now gone; we now
7119         use the `UsageVector' for this.  The reason for this is that if a
7120         branching just has one sibling, we don't need to "merge" them at
7121         all - that's the next step to do.
7122         (FlowBranching.Merge): We now return a `UsageVector' instead of a
7123         `MergeResult'.
7124
7125 2003-12-11  Martin Baulig  <martin@ximian.com>
7126
7127         Reworked flow analyis and made it more precise and bug-free.  The
7128         most important change is that we're now using a special `Reachability'
7129         class instead of having "magic" meanings of `FlowReturns'.  I'll
7130         do some more cleanups and optimizations and also add some more
7131         documentation this week.
7132
7133         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
7134         largely reworked this class.
7135         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
7136         the new `Reachability' class instead of having "magic" values here.
7137         (FlowBranching): We're now using an instance of `Reachability'
7138         instead of having separate `Returns', `Breaks' etc. fields.
7139
7140         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
7141         based on flow analysis; ignore the return value of block.Emit ().
7142
7143 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
7144
7145         * driver.cs typemanager.cs: Find the mono extensions to corlib even
7146         if they are private.
7147
7148 2003-12-09  Martin Baulig  <martin@ximian.com>
7149
7150         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
7151         call them directly on the UsageVector.
7152
7153 2003-12-09  Martin Baulig  <martin@ximian.com>
7154
7155         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
7156         Changed return type from `FlowReturns' to `Reachability'.
7157
7158 2003-12-09  Martin Baulig  <martin@ximian.com>
7159
7160         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
7161         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
7162         `Reachable' fields with a single `Reachability' one.
7163
7164 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7165
7166         * class.cs (FindMembers): Remove foreach's.
7167
7168         Bootstrap times:
7169
7170         BEFORE
7171                 Run 1:   8.74 seconds
7172                 Run 2:   8.71 seconds
7173
7174         AFTER
7175                 Run 1:   8.64 seconds
7176                 Run 2:   8.58 seconds
7177
7178
7179 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7180
7181         * cs-parser.jay:
7182         * gen-treedump.cs:
7183         * statement.cs:
7184         This patch does a few things:
7185                 1. EmptyStatement is now a singleton, so it is never reallocated.
7186                 2. All blah is EmptyStatement constructs have been changed to
7187                    blah == EmptyStatement.Value, which is much faster and valid
7188                    now that EmptyStatement is a singleton.
7189                 3. When resolving a block, rather than allocating a new array for
7190                    the non-empty statements, empty statements are replaced with
7191                    EmptyStatement.Value
7192                 4. Some recursive functions have been made non-recursive.
7193         Mainly the performance impact is from (3), however (1) and (2) are needed for
7194         this to work. (4) does not make a big difference in normal situations, however
7195         it makes the profile look saner.
7196
7197         Bootstrap times:
7198
7199         BEFORE
7200         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7201         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
7202         Total memory allocated: 56397 KB
7203
7204         AFTER
7205         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
7206         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
7207         Total memory allocated: 55666 KB
7208
7209 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7210
7211         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
7212         than the hashtable in a hashtable version
7213
7214         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
7215         we always end up concating a string. This results in a huge perf
7216         loss, because many strings have to be tracked by the GC. In this
7217         patch, we first use a hashtable that works with two keys, so that
7218         the strings do not need to be concat'ed.
7219
7220         Bootstrap times:
7221         BEFORE
7222                 Run 1:   8.74 seconds
7223                 Run 2:   8.71 seconds
7224
7225         AFTER
7226                 Run 1:   8.65 seconds
7227                 Run 2:   8.56 seconds
7228
7229 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
7230
7231         * Makefile: Add a new target `do-time' that does a quick and simple
7232         profile, leaving easy to parse output.
7233
7234 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
7235
7236         * codegen.cs (Init): Create the dynamic assembly with 
7237         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
7238
7239 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7240
7241         * support.cs: Make the PtrHashtable use only one
7242         instance of its comparer.
7243
7244 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
7245
7246         * typemanager.cs: Fix lookup of GetNamespaces.
7247
7248 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
7249
7250         * expression.cs: Removed redundant line.
7251
7252         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
7253         ArrayLists, use for loops with bounds.  
7254
7255         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
7256         arraylist.
7257
7258         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
7259         arraylists, use for loop with bounds.
7260
7261         The above three changes give us a 0.071 second performance
7262         improvement out of 3.294 seconds down to 3.223.  On my machine
7263         the above changes reduced the memory usage by 1,387 KB during
7264         compiler bootstrap.
7265
7266         * cs-parser.jay (QualifiedIdentifier): New class used to represent
7267         QualifiedIdentifiers.  Before we created a new string through
7268         concatenation, and mostly later on, the result would be
7269         manipulated by DecomposeQI through string manipulation.
7270
7271         This reduced the compiler memory usage for bootstrapping from
7272         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
7273         compile times in 0.05 seconds.
7274
7275 2003-11-28  Dick Porter  <dick@ximian.com>
7276
7277         * support.cs: Do string compares with the Invariant culture.
7278
7279         * rootcontext.cs: 
7280         * gen-treedump.cs: 
7281         * expression.cs: 
7282         * driver.cs: 
7283         * decl.cs: 
7284         * codegen.cs: 
7285         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
7286         the comparison is done with the Invariant culture.
7287
7288 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
7289
7290         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
7291         GetEnumerator method.
7292
7293         (ProbeCollectionType): Iterate starting at the most specific type
7294         upwards looking for a GetEnumerator
7295
7296         * expression.cs: Shift count can be up to 31 for int/uint and 63
7297         for long/ulong.
7298
7299 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
7300
7301         * statement.cs (Block.LookupLabel): Also look for the label on the
7302         children blocks.  Use a hash table to keep track of visited
7303         nodes. 
7304
7305         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
7306         we actually did transform the other operand, otherwise fall back
7307         to the common codepath that casts to long.
7308
7309         * cs-tokenizer.cs: Use the same code pattern as the int case.
7310         Maybe I should do the parsing myself, and avoid depending on the
7311         Parse routines to get this done.
7312
7313 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
7314
7315         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7316         which fixes bug 51347.  This time test it.
7317
7318         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
7319         attributes for example can not tell the difference between these.
7320         The difference was only a syntax feature of the language. 
7321
7322         * attribute.cs: Apply attributes to delegates.
7323
7324         * delegate.cs: Call the apply attributes method.
7325
7326 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
7327
7328         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
7329         comparing 0 vs Byte.MinValue, not the value
7330
7331         (ImplicitConversionRequired): When reporting a conversion error,
7332         use error 31 to print out the constant error instead of the
7333         simpler 29.
7334
7335         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
7336         which fixes bug 51347.
7337
7338 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
7339
7340         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
7341         which fixes the -warnaserror command line option.
7342
7343 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
7344
7345         * cfold.cs (DoNumericPromotions): During constant folding of
7346         additions on UIntConstant, special case intconstants with
7347         IntConstants like we do on the expression binary operator. 
7348
7349 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
7350
7351         * convert.cs (ImplicitReferenceConversion): We were missing a case
7352         (System.Enum are not value types or class types, so we need to
7353         classify them separatedly).
7354
7355         * driver.cs: We do not support error 2007.
7356
7357 2003-11-12 Jackson Harper <jackson@ximian.com>
7358
7359         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
7360         system directory. Also use the full file name so users can
7361         libraries names mscorlib-o-tron.dll in a non system dir.
7362         
7363 2004-01-04  David Sheldon <dave-mono@earth.li>
7364
7365         * expression.cs: Added matching ")" to error message for CS0077.
7366
7367 2003-12-19  Martin Baulig  <martin@ximian.com>
7368
7369         * typemanager.cs (TypeManager.IsEqualGenericType): New public
7370         static method; see documentation in the method.
7371         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
7372
7373         * convert.cs (Convert.ImplicitReferenceConversion,
7374         Convert.ImplicitReferenceConversionExists): Add support for
7375         generic type declarations; see gen-36.cs.
7376
7377 2003-12-19  Martin Baulig  <martin@ximian.com>
7378
7379         * pending.cs (Pending.InterfaceMethod): Use
7380         `Type.IsAssignableFrom()' instead of `=='.
7381
7382 2003-12-18  Martin Baulig  <martin@ximian.com>
7383
7384         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
7385         byref types first.
7386
7387         * convert.cs (Convert.ImplicitStandardConversionExists): Use
7388         `expr_type.Equals (target_type)' instead of `=='.
7389
7390 2003-12-08  Martin Baulig  <martin@ximian.com>
7391
7392         * generics.cs (Constraints.Types): Removed.
7393         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
7394         to Type's.
7395         (Constraints.ResolveTypes): New public method; resolves the
7396         TypeExpr's to Type's.
7397         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
7398         longer takes the constraints.
7399         (TypeParameter.DefineMethod): Likewise.
7400         (TypeParameter.DefineType): New public method.  Calls
7401         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
7402         the constraints.
7403
7404 2003-12-08  Martin Baulig  <martin@ximian.com>
7405
7406         * convert.cs (Convert.ImplicitConversionStandard): Use
7407         `expr_type.Equals (target_type)' instead of `=='.
7408
7409 2003-12-08  Martin Baulig  <martin@ximian.com>
7410
7411         * typemanager.cs (TypeManager.GetReferenceType): Call
7412         `Type.MakeByRefType ()'.
7413
7414 2003-12-08  Martin Baulig  <martin@ximian.com>
7415
7416         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
7417         just has some special meaning in some situations.  For instance,
7418         it is allowed to use `where' as the name of a variable etc.
7419
7420 2003-12-04  Martin Baulig  <martin@ximian.com>
7421
7422         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
7423         `Type.MakeArrayType()' for array types.
7424
7425 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
7426
7427         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
7428         debugging message.
7429
7430         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
7431         corlib to compile.
7432
7433 2003-11-16  Martin Baulig  <martin@ximian.com>
7434
7435         * codegen.cs (EmitContext.IsGeneric): Removed.
7436
7437         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
7438         ResolveGeneric() on the DeclSpace.
7439
7440 2003-11-16  Martin Baulig  <martin@ximian.com>
7441
7442         * generic.cs (TypeArguments.Resolve):
7443         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
7444         `ResolveType()' on it to get the Type.
7445
7446 2003-11-15  Martin Baulig  <martin@ximian.com>
7447
7448         * generic.cs (ConstructedType.GetInterfaces): Override this.
7449
7450 2003-11-14  Martin Baulig  <martin@ximian.com>
7451
7452         * interface.cs (Interface.DefineType): Define all type parameters
7453         before adding the interfaces we inherit.
7454
7455 2003-11-11  Martin Baulig  <martin@ximian.com>
7456
7457         * generic.cs (ConstructedType.ResolveType): Always call
7458         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
7459
7460 2003-11-10  Martin Baulig  <martin@ximian.com>
7461
7462         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
7463         (TypeManager.InitCoreTypes): Initialize them here, but instead of
7464         calling `ResolveType()' on them, directly assign their `Type'.
7465
7466 2003-11-08  Martin Baulig  <martin@ximian.com>
7467
7468         * generic.cs (ConstructedType): Override `IsClass' etc.
7469
7470 2003-11-08  Martin Baulig  <martin@ximian.com>
7471
7472         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
7473         return value and the `out parent' parameter.
7474         (TypeContainer.DefineType): Moved the CS0644 check into
7475         GetClassBases().  Don't pass the interface types to the
7476         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
7477         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
7478
7479         * ecore.cs (TypeExpr.IsAttribute): New property.
7480         (TypeExpr.GetInterfaces): New method.
7481
7482         * interface.cs (Interface.GetInterfaceTypeByName): Return a
7483         TypeExpr instead of a Type.
7484         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
7485         (Interface.DefineType): Don't pass the interface types to the
7486         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
7487         them later and then call `TypeBulider.AddInterfaceImplementation()'.
7488
7489         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
7490         instead of a `Type[]'.
7491         (TypeManager.RegisterBuilder): Likewise.
7492         (TypeManager.AddUserInterface): Likewise.
7493         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
7494         `Type[]' and also return a `TypeExpr[]'.
7495         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
7496
7497 2003-11-08  Martin Baulig  <martin@ximian.com>
7498
7499         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
7500         Expression.     
7501
7502 2003-11-08  Martin Baulig  <martin@ximian.com>
7503
7504         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
7505         TypeManager.ResolveExpressionTypes().
7506
7507         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
7508         instead of an Expression.
7509         (TypeExpr): This is now an abstract base class for `TypeExpression'.
7510         (TypeExpression): New public class; formerly known as `TypeExpr'.
7511
7512         * expression.cs (ComposedCast): Derive from TypeExpr.
7513
7514         * typemanager.cs (TypeManager.system_*_expr): These are now
7515         TypExpr's instead of Expression's.
7516         (TypeManager.ResolveExpressionTypes): New public static function;
7517         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
7518         of them.        
7519
7520 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
7521
7522         * expression.cs (New.DoResolve): Do not dereference value that
7523         might be a null return.
7524
7525         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
7526         sure that the constant value has the right type.  Fixes an
7527         unreported bug, similar to 50425.
7528
7529         * const.cs (Const.LookupConstantValue): Call
7530         ImplicitStandardConversionExists before doing a conversion to
7531         avoid havng the TypeManager.ChangeType do conversions.
7532
7533         Reduced the number of casts used
7534
7535         (Const.ChangeType): New routine to enable reuse of the constant
7536         type changing code from statement.
7537
7538         * typemanager.cs (ChangeType): Move common initialization to
7539         static global variables.
7540
7541         Fixes #50425.
7542
7543         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
7544         every value type to go through, even if it was void.  Fix that. 
7545
7546         * cs-tokenizer.cs: Use is_identifier_start_character on the start
7547         character of the define, and the is_identifier_part_character for
7548         the rest of the string.
7549
7550 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
7551
7552         * expression.cs (UnaryMutator.EmitCode): When I updated
7553         LocalVariableReference.DoResolve, I overdid it, and dropped an
7554         optimization done on local variable references.
7555
7556 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
7557
7558         * ecore.cs: Convert the return from Ldlen into an int.
7559
7560 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
7561
7562         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
7563         the accessibility, this is a special case for toplevel non-public
7564         classes (internal for instance).
7565
7566 2003-10-20  Nick Drochak <ndrochak@gol.com>
7567
7568         * ecore.cs: Fix typo and build.  Needed another right paren.
7569
7570 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
7571
7572         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
7573         `internal' case regular and protected, but not allowing protected
7574         to be evaluated later.  Bug 49840
7575
7576 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
7577
7578         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
7579         to kb.Nlast, and not the kb.nFirst to isolate the switch
7580         statement.
7581
7582         Extract the underlying type, so enumerations of long/ulong are
7583         treated like long/ulong.
7584
7585 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
7586
7587         * expression.cs (New): Overload the meaning of RequestedType to
7588         track the possible creation of the NewDelegate type, since
7589         DoResolve is invoked more than once for new constructors on field
7590         initialization.
7591
7592         See bugs: #48800 and #37014
7593
7594         * cs-parser.jay (declare_local_constants): Take an arraylist
7595         instead of a single constant.
7596
7597         (local_constant_declaration): It should take a
7598         constant_declarators, not a constant_declarator.  Fixes 49487
7599
7600         * convert.cs: Fix error report.
7601
7602 2003-10-13 Jackson Harper <jackson@ximian.com>
7603
7604         * typemanager.cs (TypeToCoreType): Add float and double this fixes
7605         bug #49611
7606         
7607 2003-11-03  Martin Baulig  <martin@ximian.com>
7608
7609         * expression.cs (ArrayAccess.GetStoreOpcode): Added
7610         `out bool has_type_arg'; if set, we need to pass the type to
7611         ig.Emit().
7612         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
7613         Stelem_Any/Ldelem_Any for generic parameters.   
7614
7615 2003-11-02  Martin Baulig  <martin@ximian.com>
7616
7617         * expression.cs (Invocation.EmitCall): Use
7618         `TypeManager.IsValueType()' to check whether it's a value type.
7619         Don't set `struct_call' when calling a method on a type parameter.
7620
7621 2003-11-02  Martin Baulig  <martin@ximian.com>
7622
7623         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
7624         and removed the TypeBuilder argument.
7625
7626         * typemanager.cs (TypeManager.IsValueType): Return
7627         `t.IsGenericParameter || t.IsValueType'.
7628
7629 2003-10-25  Martin Baulig  <martin@ximian.com>
7630
7631         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
7632         call ConstructedType.Resolve() on it.
7633
7634         * generic.cs (ConstructedType.Resolve): Set `type' on success.
7635
7636 2003-10-25  Martin Baulig  <martin@ximian.com>
7637
7638         * class.cs (TypeContainer.GetClassBases): Changed
7639         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
7640         CS8214 reporting here.
7641         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
7642         instead of a `Type' for our parent.  In case of a recursive
7643         declaration (see tests/gen-23.cs for an example), our parent is a
7644         ConstructedType and it doesn't have its type set.  So, first
7645         create our own TypeBuilder, then call constructed.Resolve() to get
7646         the parent's type and finally TypeBuilder.SetParent() it.
7647
7648         * ecore.cs (TypeExpr.Name): New public virtual property.
7649
7650         * generic.cs
7651         (ConstructedType): We're now a TypeExpr and not just an Expression.
7652         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
7653         arguments here; this is done later.
7654         (ConstructedType.Resolve): New public method to resolve the type
7655         arguments and bind them.
7656
7657 2003-10-21  Martin Baulig  <martin@ximian.com>
7658
7659         * convert.cs: Use `TypeManager.IsValueType' instead of
7660         'type.IsValueType' everywhere.
7661
7662         * typemanager.cs (TypeManager.IsValueType): Return true for type
7663         parameters.  The reason for this is that we need to box a type
7664         parameter when converting it to a reference type.
7665
7666         * cs-parser.jay: Added support for default value expressions.
7667
7668         * generics.cs (DefaultValueExpression): New public class.       
7669
7670 2003-10-17  Martin Baulig  <martin@ximian.com>
7671
7672         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
7673         TypeContainer so we can also use this for Interfaces.
7674         (TypeParameter.Resolve): Likewise.
7675
7676         * interface.cs (Interface.DefineType): Added support for generic
7677         interfaces.
7678
7679         * cs-parser.jay: Added support for generic structs and interfaces.
7680
7681 2003-10-17  Martin Baulig  <martin@ximian.com>
7682
7683         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
7684         call generic methods :-)
7685
7686 2003-10-16  Martin Baulig  <martin@ximian.com>
7687
7688         * cs-parser.jay (namespace_or_type_name): Only create a
7689         GenericMemberAccess if we actually have type arguments.
7690
7691 2003-10-13  Martin Baulig  <martin@ximian.com>
7692
7693         * class.cs (Method.Define): If we're a generic method, call
7694         TypeBuilder.DefineGenericMethod () before resolving
7695         the parameters.
7696         (MethodData): Added .ctor which takes an additional MethodBuilder
7697         argument; this is used for generic methods.
7698         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
7699         we already have a MethodBuilder.
7700
7701 2003-10-10  Martin Baulig  <martin@ximian.com>
7702
7703         * class.cs (Method): Added .ctor which takes a `GenericMethod'
7704         instead of a `DeclSpace'.  This is used for generic methods.
7705
7706         * cs-parser.jay (method_header): Added support for generic
7707         methods; create a `GenericMethod' instance and pass it to the
7708         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
7709         parameters and locals.
7710
7711         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
7712         since we already have the location.  Check whether we're a generic
7713         type declaration or a generic method and create the correct type
7714         parameter.
7715
7716         * generic.cs (TypeParameter.DefineMethod): New public method.
7717         (GenericMethod): New public class; derives from DeclSpace and is
7718         used for generic methods.       
7719
7720 2003-10-09  Martin Baulig  <martin@ximian.com>
7721
7722         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
7723         to the .ctor.
7724         (MethodCore.DoDefineParameters): Removed the TypeContainer
7725         argument; use the DeclSpace which was passed to the .ctor instead.
7726         (MethodCore.CheckParameter): Take a DeclSpace instead of a
7727         TypeContainer; we only need a DeclSpace here.
7728
7729 2003-10-09  Martin Baulig  <martin@ximian.com>
7730
7731         * class.cs (MethodData): Added additional `DeclSpace ds' argument
7732         to the .ctor.
7733         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
7734         EmitContext's .ctor.    
7735
7736 2003-10-09  Martin Baulig  <martin@ximian.com>
7737
7738         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
7739         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
7740         AsAccessible(), moved them as well.
7741
7742         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
7743
7744 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
7745
7746         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
7747         generation for >=, as spotted by Paolo, bug 48679.  
7748         Patch from David Waite.
7749
7750         * cs-tokenizer.cs: Add handling for #pragma.
7751
7752         * cs-parser.jay: Allow for both yield and yield return in the
7753         syntax.  The anti-cobolization of C# fight will go on!
7754
7755         * class.cs (TypeBuilder.DefineType): Catch error condition here
7756         (Parent.DefineType erroring out and returning null).
7757
7758         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
7759         coping with enumerations variables, we were mistakenly processing
7760         them as a regular value type instead of built-in types.  Fixes the
7761         bug #48063
7762
7763         * typemanager.cs (IsBuiltinOrEnum): New method.
7764
7765 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
7766
7767         * cs-parser.jay: Upgrade: yield now needs the return clause.
7768
7769 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
7770
7771         * cs-parser.jay : Renamed yyName to yyNames related to jay.
7772
7773 2003-09-29  Martin Baulig  <martin@ximian.com>
7774
7775         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
7776         inflated generic methods.
7777
7778         * generics.cs (ConstructedType): Distinguish between open and
7779         closed constructed types; correctly resolve the arguments.
7780
7781 2003-09-22  Martin Baulig  <martin@ximian.com>
7782
7783         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
7784         all type arguments meet their constraints.
7785
7786 2003-09-19  Martin Baulig  <martin@ximian.com>
7787
7788         * decl.cs (MemberCache.SetupCacheForInterface): Take a
7789         `MemberCache parent' argument.  Normally, an interface doesn't
7790         have a parent type except System.Object, but we use this in gmcs
7791         for generic type parameters.
7792
7793 2003-09-18  Martin Baulig  <martin@ximian.com>
7794
7795         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
7796         on `type.IsInterface'; don't check whether the type has a parent
7797         to determine whether it's an interface.
7798
7799 2003-09-17  Martin Baulig  <martin@ximian.com>
7800
7801         * generic.cs (ConstructedType.ToString): Always use `name' as the
7802         type name.
7803
7804 2003-09-15  Martin Baulig  <martin@ximian.com>
7805
7806         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
7807
7808         * generic.cs (Constraints.Resolve): New public method; this is
7809         called to resolve the constraint types and to check whether all
7810         the constraints are correct.
7811         (Constraints.Types): New public property.
7812         (TypeParameter.Resolve): New public method; resolves all the
7813         type's constraints.
7814
7815         * class.cs (TypeContainer.DefineType): Call
7816         TypeParameter.Resolve() before actually defining the type.
7817
7818 2003-09-15  Martin Baulig  <martin@ximian.com>
7819
7820         * class.cs (TypeContainer.DefineType): Added an error flag to
7821         avoid reporting duplicate CS0146's ("class definition is
7822         circular.").
7823
7824         * driver.cs (Driver.MainDriver): Abort if
7825         RootContext.ResolveTree() reported any errors.
7826
7827 2003-09-07  Martin Baulig  <martin@ximian.com>
7828
7829         * report.cs (Error, Warning): Added overloaded versions which take
7830         a `params object[] args' and call String.Format().
7831
7832 2003-09-07  Martin Baulig  <martin@ximian.com>
7833
7834         * decl.cs (DeclSpace..ctor): Don't call
7835         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
7836         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
7837         (DeclSpace.RecordDecl): New method.
7838
7839         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
7840
7841 2003-09-02  Ravi Pratap  <ravi@ximian.com>
7842
7843         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
7844         value attributes to be applied to ParameterBuilders.
7845
7846         * class.cs (MethodCore.LabelParameters): Make static and more
7847         generic so that it can be used from other places - like interface
7848         methods, for instance.
7849
7850         * interface.cs (Interface.Emit): Call LabelParameters before
7851         emitting attributes on the InterfaceMethod.
7852
7853 2003-09-07  Martin Baulig  <martin@ximian.com>
7854
7855         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
7856         if the number of type parameters doesn't match.
7857
7858 2003-09-04  Martin Baulig  <martin@ximian.com>
7859
7860         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
7861         for arrays of generic type params (ie. `!0[]').
7862
7863 2003-09-04  Martin Baulig  <martin@ximian.com>
7864
7865         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
7866         for the moment.
7867
7868 2003-09-04  Martin Baulig  <martin@ximian.com>
7869
7870         * decl.cs (DeclSpace.LookupGeneric): New method.
7871         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
7872         moment.
7873
7874         * generic.cs (TypeParameterExpr): Take a TypeParameter as
7875         argument, not just a string.
7876         (TypeParameter.Define): New public method; this is called to
7877         actually define the generic parameter; after this, you can use the
7878         new `Type' property to get the type.
7879
7880 2003-09-04  Martin Baulig  <martin@ximian.com>
7881
7882         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
7883         is now an ArrayList; initialize the result of the `TypeParameters'
7884         property here.
7885         (DeclSpace.GetGenericData): Removed.
7886         (DeclSpace.LookupGeneric): Temporarily removed; we need to
7887         implement this in a different way.
7888         (DeclSpace.GetTypeParameters): Removed; there's now a
7889         `TypeParameters' property.
7890         (DeclSpace.TypeParameters): New public property.
7891
7892         * generic.cs (Constraints): Make this class public.
7893         (TypeParameter): New public class.
7894
7895 2003-09-04  Martin Baulig  <martin@ximian.com>
7896
7897         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
7898         generic parameters.
7899
7900         * class.cs (TypeContainer.DefineType): Call
7901         TypeBuilder.DefineGenericParameter () on all generic parameters if
7902         this is a generic type.
7903
7904 2003-08-28  Martin Baulig  <martin@ximian.com>
7905
7906         * sample-stack.il: Compile this with ilasm: "ilasm /dll
7907         sample-stack.il".
7908
7909         * sample-hello.cs: Compile this with gmcs: "gmcs
7910         /r:sample-stack.dll sample-hello.cs".
7911
7912 2003-08-28  Martin Baulig  <martin@ximian.com>
7913
7914         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
7915         the parameters to the generic type.
7916
7917 2003-08-28  Martin Baulig  <martin@ximian.com>
7918
7919         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
7920
7921 2003-08-28  Martin Baulig  <martin@ximian.com>
7922
7923         * cs-parser.jay (opt_type_argument_list): Use
7924         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
7925         (primary_expression): Replace `qualified_identifier' with `type_name'.
7926         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
7927
7928         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
7929         parser to check whether it is syntactically a type parameter list;
7930         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
7931         this case.
7932
7933 2003-08-26  Martin Baulig  <martin@ximian.com>
7934
7935         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
7936         resolving aliases; fixes #47927.
7937
7938 2003-08-26  Martin Baulig  <martin@ximian.com>
7939
7940         * statement.cs (Using.DoResolve): This is internally emitting a
7941         try/finally clause, so we need to set ec.NeedExplicitReturn if we
7942         do not always return.  Fixes #47681.
7943
7944 2003-08-26  Martin Baulig  <martin@ximian.com>
7945
7946         * decl.cs (MemberCore): Moved WarningNotHiding(),
7947         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
7948         into MemberBase.
7949         (AdditionResult): Make this nested in DeclSpace.
7950         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
7951         argument; call NamespaceEntry.Define() unless we're nested in a
7952         class or struct.
7953
7954         * namespace.cs (Namespace.DefineName): New public function.  This
7955         is called from DeclSpace's .ctor to add 
7956         (Namespace.Lookup): Include DeclSpaces in the lookup.
7957
7958         * class.cs (Operator): Derive from MemberBase, not MemberCore.
7959
7960         * const.cs (Const): Derive from MemberBase, not MemberCore.     
7961
7962 2003-08-25  Martin Baulig  <martin@ximian.com>
7963
7964         * convert.cs (Convert.ExplicitReferenceConversion): When
7965         converting from an interface type to a class, unbox if the target
7966         type is a struct type.  Fixes #47822.
7967
7968 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
7969
7970         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
7971         #47854.
7972
7973 2003-08-22  Martin Baulig  <martin@ximian.com>
7974
7975         * class.cs (TypeManager.DefineType): When defining a nested type,
7976         call DefineType() on our parent; fixes #47801.
7977
7978 2003-08-22  Martin Baulig  <martin@ximian.com>
7979
7980         * class.cs (MethodData.Define): While checking if a method is an
7981         interface implementation, improve the test a bit more to fix #47654.
7982
7983 2003-08-22  Martin Baulig  <martin@ximian.com>
7984
7985         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
7986         correctly; fixes #47722.
7987
7988 2003-08-22  Martin Baulig  <martin@ximian.com>
7989
7990         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
7991         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
7992
7993         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
7994
7995 2003-08-22  Martin Baulig  <martin@ximian.com>
7996
7997         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
7998         can only be assigned in static constructors.  Fixes #47161.
7999
8000 2003-08-22  Martin Baulig  <martin@ximian.com>
8001
8002         Rewrote and improved the flow analysis code.
8003
8004         * flowbranching.cs (FlowBranching): Make this class abstract.
8005         (FlowBranching.CreateBranching): New static function to create a
8006         new flow branching.
8007         (FlowBranchingBlock, FlowBranchingException): New classes.
8008         (FlowBranching.UsageVector.Type): New public readonly field.
8009         (FlowBranching.UsageVector.Breaks): Removed the setter.
8010         (FlowBranching.UsageVector.Returns): Removed the setter.
8011         (FlowBranching.UsageVector): Added Break(), Return(),
8012         NeverReachable() and Throw() methods to modify the reachability.
8013         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
8014         done by FlowBranching.Merge().
8015         (FlowBranching.UsageVector.MergeChild): New method; merges the
8016         merge result into the current vector.
8017         (FlowBranching.Merge): New abstract method to merge a branching.
8018
8019 2003-08-12  Martin Baulig  <martin@ximian.com>
8020
8021         * expression.cs (Indirection.CacheTemporaries): Create the
8022         LocalTemporary with the pointer type, not its element type.
8023
8024 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
8025
8026         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
8027         token was a keyword or not.
8028
8029         Add `error' options where an IDENTIFIER was expected;  Provide
8030         CheckToken and CheckIdentifierToken convenience error reporting
8031         functions. 
8032
8033         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
8034
8035         * decl.cs: Rename `NamespaceEntry Namespace' public field into
8036         NameSpaceEntry NameSpaceEntry.
8037
8038         (LookupInterfaceOrClass): Avoid creating a full qualified name
8039         from namespace and name: avoid doing lookups when we know the
8040         namespace is non-existant.   Use new Tree.LookupByNamespace which
8041         looks up DeclSpaces based on their namespace, name pair.
8042
8043         * driver.cs: Provide a new `parser verbose' to display the
8044         exception thrown during parsing.  This is turned off by default
8045         now, so the output of a failure from mcs is more graceful.
8046
8047         * namespace.cs: Track all the namespaces defined in a hashtable
8048         for quick lookup.
8049
8050         (IsNamespace): New method
8051
8052 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
8053
8054         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
8055         we know that we need to concatenate (full typename can never be
8056         null). 
8057
8058         * class.cs: ditto.
8059
8060         * statement.cs: Use a bitfield;  Do not initialize to null things
8061         which are done by the constructor by default.
8062
8063         * cs-parser.jay: bug fix, parameter was 4, not 3.
8064
8065         * expression.cs: Just use the property;
8066
8067         * statement.cs: No need for GetVariableInfo method.
8068
8069 2003-08-08  Martin Baulig  <martin@ximian.com>
8070
8071         * flowanalysis.cs (FlowReturns): This is now nested in the
8072         `FlowBranching' class.
8073         (MyBitVector): Moved this here from statement.cs.
8074         (FlowBranching.SiblingType): New enum type.
8075         (FlowBranching.CreateSibling): Added `SiblingType' argument.
8076
8077 2003-08-07  Martin Baulig  <martin@ximian.com>
8078
8079         * flowanalysis.cs (FlowBranchingType): This is now nested in the
8080         `FlowBranching' class and called `BranchingType'.
8081
8082 2003-08-07  Martin Baulig  <martin@ximian.com>
8083
8084         * flowanalysis.cs: Moved all the control flow analysis code into
8085         its own file.
8086
8087 2003-08-07  Martin Baulig  <martin@ximian.com>
8088
8089         * assign.cs (Assign.DoResolve): `target' must either be an
8090         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
8091         #37319.
8092
8093 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
8094
8095         * expression.cs (BinaryMethod): This kind of expression is created by the
8096         Binary class if it determines that the operator has to be handled
8097         by a method.
8098
8099         (BinaryDelegate): This kind of expression is created if we are
8100         dealing with a + or - operator on delegates.
8101
8102         (Binary): remove method, argumetns, and DelegateOperator: when
8103         dealing with methods, 
8104
8105         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
8106
8107         * statement.cs (Block): use bitfields for the three extra booleans
8108         we had in use.   Remove unused topblock parameter.
8109
8110         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
8111
8112         * assign.cs: Drop extra unneeded tests.
8113
8114 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
8115
8116         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
8117
8118         * statement.cs (Foreach): Use VariableStorage instead of
8119         LocalBuilders.   
8120
8121         * codegen.cs (VariableStorage): New class used by clients that
8122         require a variable stored: locals or fields for variables that
8123         need to live across yield.
8124
8125         Maybe provide a convenience api for EmitThis+EmitLoad?
8126
8127         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
8128         these bad boys.
8129
8130 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
8131
8132         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
8133         RemapParameterLValue): New methods that are used to turn a
8134         precomputed FieldInfo into an expression like this:
8135
8136                 instance.FieldInfo
8137
8138         The idea is to use this instead of making LocalVariableReference
8139         have more than one meaning.
8140
8141         * cs-parser.jay: Add error production to BASE.
8142
8143         * ecore.cs: Deal with TypeManager.GetField returning null, which
8144         is now a valid return value.
8145
8146         (FieldExprNoAddress): New expression for Fields whose address can
8147         not be taken.
8148
8149         * expression.cs (LocalVariableReference): During the resolve
8150         phases, create new expressions if we are in a remapping context.
8151         Remove code that dealt with remapping here.
8152
8153         (ParameterReference): same.
8154
8155         (ProxyInstance): New expression, like the `This' expression, but
8156         it is born fully resolved.  We know what we are doing, so remove
8157         the errors that are targeted to user-provided uses of `this'.
8158
8159         * statement.cs (Foreach): our variable is now stored as an
8160         Expression;  During resolution, follow the protocol, dont just
8161         assume it will return this.
8162
8163 2003-08-06  Martin Baulig  <martin@ximian.com>
8164
8165         * support.cs (SeekableStreamReader.cs): New public class.
8166
8167         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
8168         SeekableStreamReader instead of the normal StreamReader.
8169
8170 2003-08-04  Martin Baulig  <martin@ximian.com>
8171
8172         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
8173         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
8174         deambiguate casts and delegate invocations.
8175         (parenthesized_expression): Use the new tokens to ensure this is
8176         not a cast of method invocation.
8177
8178         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
8179         when reading a `)' and Deambiguate_CloseParens () was previously
8180         called.
8181
8182         * expression.cs (ParenthesizedExpression): New class.  This is
8183         just used for the CS0075 test.
8184         (Binary.DoResolve): Check for CS0075.   
8185
8186 2003-07-29  Ravi Pratap  <ravi@ximian.com>
8187
8188         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
8189         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
8190         reference comparison.
8191
8192         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
8193         examine the ReturnType for equality - this is necessary in the
8194         cases of implicit and explicit operators whose signature also
8195         includes the return type.
8196
8197 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
8198
8199         * namespace.cs: Cache the result of the namespace computation,
8200         instead of computing it every time.
8201
8202 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8203
8204         * decl.cs: Use a global arraylist that we reuse over invocations
8205         to avoid excesive memory consumption.  Reduces memory usage on an
8206         mcs compile by one meg (45 average).
8207
8208         * typemanager.cs (LookupTypeReflection): In .NET pointers are
8209         private, work around that.
8210
8211 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
8212
8213         * literal.cs (IntLiteral): Define Zero and One static literals. 
8214
8215         * cs-parser.jay (integer_literal): use static literals to reduce
8216         memory usage for the most used literals (0, 1 and -1).  211kb
8217         reduced in memory usage.
8218
8219         Replace all calls to `new ArrayList' with `new
8220         ArrayList(4)' which is a good average number for most allocations,
8221         and also requires only 16 bytes of memory for its buffer by
8222         default. 
8223
8224         This reduced MCS memory usage in seven megabytes for the RSS after
8225         bootstrapping.
8226
8227 2003-07-28  Ravi Pratap  <ravi@ximian.com>
8228
8229         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
8230         handle params methods the correct way by forming only one
8231         applicable set with params and normal methods in them. Earlier we
8232         were looking at params methods only if we found no normal methods
8233         which was not the correct thing to do.
8234
8235         (Invocation.BetterFunction): Take separate arguments indicating
8236         when candidate and the best method are params methods in their
8237         expanded form.
8238
8239         This fixes bugs #43367 and #46199.
8240
8241         * attribute.cs: Documentation updates.
8242
8243         (CheckAttribute): Rename to CheckAttributeTarget.
8244         (GetValidPlaces): Rename to GetValidTargets.
8245
8246         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
8247         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
8248
8249         Fixes bug #44468.
8250
8251 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
8252
8253         * codegen.cs: Compute IsGeneric correctly.
8254
8255         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
8256         resolution. 
8257
8258         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
8259         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
8260         regressions, and I was chasing more bugs than I required.
8261
8262         * interface.cs: Use expressions for base type names (like classes
8263         and structs have been doing for a while now), and resolve that.
8264         This patch should probably go into head as well.
8265
8266         This makes it one less user of FindType.
8267
8268 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
8269
8270         This compiler can not self host currently.  Need to fix that.
8271         
8272         * Makefile: compile to `gmcs.exe'
8273
8274         * driver.cs: Turn on v2 by default on gmcs.
8275
8276         * generic.cs (ConstructedType): Does no longer take a container
8277         type argument;  That will be taken care of later.
8278
8279         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
8280         Use SimpleName to resolve for now, so we can continue the work on
8281         the parser, until we get Type.GetType that understands generics.
8282
8283         (ConstructedType.ToString): Implement
8284
8285         (TypeArguments.Resolve): Resolve the child expressions as types. 
8286         
8287         * cs-parser.jay: Rename interface_constraints to
8288         type_parameter_constraints
8289
8290         (namespace_or_type_name): Only use constructed types for the basic
8291         construction, we will deal with identifier<...> later.
8292
8293         (type/type_name): No longer call DecomposeQI, as
8294         namespace_or_type_name is always decoded now.
8295         
8296 2003-07-22  Ravi Pratap  <ravi@ximian.com>
8297
8298         * expression.cs (Invocation.OverloadResolve): Follow the spec more
8299         closely: we eliminate methods in base types when we have an
8300         applicable method in a top-level type.
8301
8302         Please see section 14.5.5.1 for an exact description of what goes
8303         on. 
8304
8305         This fixes bug #45127 and a host of other related to corlib compilation.
8306
8307         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
8308         array is the method corresponding to the top-level type (this is
8309         because of the changes made to icall.c) so we change this
8310         accordingly.
8311
8312         (MethodGroupExpr.Name): This too.
8313
8314         * typemanager.cs (GetElementType): New method which does the right
8315         thing when compiling corlib. 
8316
8317         * everywhere: Make use of the above in the relevant places.
8318
8319 2003-07-22  Martin Baulig  <martin@ximian.com>
8320
8321         * cs-parser.jay (invocation_expression): Moved
8322         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
8323         `cast_expression', but create a InvocationOrCast which later
8324         resolves to either an Invocation or a Cast.
8325
8326         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
8327         method; call this before EmitStatement() to make sure that this
8328         expression can be used as a statement.
8329
8330         * expression.cs (InvocationOrCast): New class; resolves to either
8331         an Invocation or a Cast.
8332
8333         * statement.cs (StatementExpression): Call ResolveStatement() on
8334         the ExpressionStatement before emitting it.
8335
8336 2003-07-21  Martin Baulig  <martin@ximian.com>
8337
8338         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
8339         `ref' and `out' attributes match; fixes #46220.
8340         (MemberAccess.ResolveMemberAccess): You can't reference a type
8341         through an expression; fixes #33180.
8342         (Indexers.GetIndexersForType): Don't return the indexers from
8343         interfaces the class implements; fixes #46502.
8344
8345 2003-07-21  Martin Baulig  <martin@ximian.com>
8346
8347         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
8348         CS0661 checks; fixes bug #30442.
8349
8350 2003-07-21  Martin Baulig  <martin@ximian.com>
8351
8352         * decl.cs (AdditionResult): Added `Error'.
8353
8354         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
8355
8356         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
8357         cs0031.cs actually work.
8358
8359  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8360  
8361         * cs-parser.jay (namespace_name): do not use
8362         namespace_or_type_name, use qualified_identifier, because
8363         namespace_or_type_name will soon return a composed expression
8364         instead of a string.
8365  
8366         (namespace_or_type_name): Instead of returning a string, now this
8367         production returns an expression.
8368  
8369         * codegen.cs (EmitContext): Setup IsGeneric property based on
8370         whether our DeclSpace is generic, our the method is generic.
8371  
8372         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
8373         the method is generic.
8374  
8375         * cs-parser.jay (type_arguments, opt_type_argument_list,
8376         type_parameters, type_parameter_list, opt_type_parameter_list,
8377         type_parameter,, opt_type_parameter_constraints_clauses,
8378         type_parameter_constraints_clauses,
8379         type_parameter_constraint_clause, type_parameter_constraint,
8380         interface_constraints): Add new production
8381  
8382         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
8383         DeclSpace is generic or not.
8384  
8385         (DeclSpace.SetParameterInfo): New routine, used to set the
8386         parameter info for a type.
8387  
8388         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
8389         returns a GenericTypeExpr
8390  
8391         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
8392         generic, lookup the generic argument.
8393  
8394         * attribute.cs: Do not allow TypeParameterExpressions in
8395         Attributes.
8396  
8397         * class.cs: Do not allow the Main method to be defined in a
8398         Generic container.
8399  
8400         * expression.cs (SizeOf): Do not allow generic types to be used as
8401         arguments to sizeof.
8402  
8403         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
8404         it: whether a type is generic or not.  Only works for types we are
8405         currently building for now.
8406         
8407 2003-07-20  Martin Baulig  <martin@ximian.com>
8408
8409         * namespace.cs: Fixed that bug which caused a crash when compiling
8410         the debugger's GUI.
8411
8412 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
8413
8414         * typemanager.cs (LookupTypeReflection): Never expose types which
8415         are NotPublic, NestedPrivate, NestedAssembly, or
8416         NestedFamANDAssem.  We used to return these, and later do a check
8417         that would report a meaningful error, but the problem is that we
8418         would not get the real match, if there was a name override.
8419
8420 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
8421
8422         * namespace.cs (Namespace, Name): Do not compute the namespace
8423         name dynamically, compute it in the constructor.  This reduced
8424         memory usage by 1697 KB.
8425
8426         * driver.cs: Use --pause to pause at the end.
8427
8428 2003-07-17  Peter Williams  <peter@newton.cx>
8429
8430         * Makefile: Change the name of the test target so that it doesn't
8431         conflict with the recursive test target.
8432
8433 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
8434
8435         * expression.cs (LocalVariableReference.Emit, EmitAssign,
8436         AddressOf): Do not use EmitThis, that was wrong, use the actual
8437         this pointer.
8438
8439 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
8440
8441         * class.cs (MethodData.Define): While checking if a method is an
8442         interface implementation, improve the test: If we are not public
8443         (use new test here: use the computed MethodAttributes directly,
8444         instead of the parsed modifier flags) check if the `implementing'
8445         method comes from an interface or not.
8446
8447         * pending.cs (VerifyPendingMethods): Slightly better error
8448         message.
8449
8450         * makefile: add test target that does the mcs bootstrap.
8451
8452 2003-07-16  Ravi Pratap  <ravi@ximian.com>
8453
8454         * interface.cs (Define): Do nothing here since there are no
8455         members to populate etc. Move the attribute emission out of here
8456         since this was just totally the wrong place to put it. Attribute
8457         application happens during the 'Emit' phase, not in the 'Define'
8458         phase.
8459
8460         (Emit): Add this method and move the attribute emission here
8461
8462         * rootcontext.cs (EmitCode): Call the Emit method on interface
8463         types too.
8464
8465 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8466
8467         * expression.cs (OverloadResolve): Report error only if Location
8468         is not 'Null' which means that there was a probe going on.
8469
8470 2003-07-14  Martin Baulig  <martin@ximian.com>
8471
8472         * expression.cs (ConditionalLogicalOperator): New public class to
8473         implement user defined conditional logical operators.
8474         This is section 14.11.2 in the spec and bug #40505.
8475
8476 2003-07-14  Martin Baulig  <martin@ximian.com>
8477
8478         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
8479
8480 2003-07-14  Martin Baulig  <martin@ximian.com>
8481
8482         * codegen.cs (EmitContext.InFixedInitializer): New public field.
8483
8484         * ecore.cs (IVariable.VerifyFixed): New interface method.
8485
8486         * expression.cs (Unary.ResolveOperator): When resolving the `&'
8487         operator, check whether the variable is actually fixed.  Fixes bug
8488         #36055.  Set a variable definitely assigned when taking its
8489         address as required by the spec.
8490
8491         * statement.cs (LocalInfo.IsFixed): New field.
8492         (LocalInfo.MakePinned): Set `IsFixed' to true.
8493
8494 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
8495
8496         * attribute.cs (Attribute.Resolve): While doing a Member lookup
8497         for .ctors, ensure that we only ask for members declared in the
8498         attribute type (BindingFlags.DeclaredOnly).
8499
8500         Fixes bug #43632.
8501
8502         * expression.cs (Error_WrongNumArguments): Report error 1501
8503         correctly the way CSC does.
8504
8505 2003-07-13  Martin Baulig  <martin@ximian.com>
8506
8507         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
8508         lookup on the fully qualified name, to make things like "X.X" work
8509         where "X.X" is a fully qualified type name, but we also have a
8510         namespace "X" in the using list.  Fixes #41975.
8511
8512 2003-07-13  Martin Baulig  <martin@ximian.com>
8513
8514         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
8515         function. If we're a CompoundAssign, we need to create an embedded
8516         CompoundAssign, not an embedded Assign.
8517         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
8518         Fixes #45854.
8519
8520 2003-07-13  Martin Baulig  <martin@ximian.com>
8521
8522         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
8523         work to fix bug #46088.
8524
8525 2003-07-13  Ravi Pratap <ravi@ximian.com>
8526
8527         * class.cs (Operator.Emit): Do not emit attributes here - it is
8528         taken care of by the Method class that we delegate too. This takes
8529         care of bug #45876.
8530
8531 2003-07-10  Martin Baulig  <martin@ximian.com>
8532
8533         * expression.cs (TypeOfVoid): New class.
8534         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
8535
8536 2003-07-10  Martin Baulig  <martin@ximian.com>
8537
8538         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
8539         bug #35957.
8540
8541 2003-07-10  Martin Baulig  <martin@ximian.com>
8542
8543         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
8544         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
8545
8546         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
8547
8548         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
8549
8550 2003-07-10  Martin Baulig  <martin@ximian.com>
8551
8552         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
8553         of decimal.  Fixes #42850.
8554
8555         NOTE: I also fixed the created byte blob, but this doesn't work on
8556         the MS runtime and csc never produces any byte blobs for decimal
8557         arrays.
8558
8559 2003-07-10  Martin Baulig  <martin@ximian.com>
8560
8561         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
8562         structs; fixes #32068.
8563         (Block.AddChildVariableNames): Fixed #44302.
8564
8565 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8566
8567         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
8568
8569 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8570
8571         * attribute.cs: And this test is onger needed.
8572
8573 2003-07-08  Martin Baulig  <martin@ximian.com>
8574
8575         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
8576         inaccessible types.  Fixes #36313.
8577
8578         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
8579
8580         * namespace.cs (NamespaceEntry): Create implicit entries for all
8581         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
8582         implicit entries for N1.N2 and N1.
8583
8584 2003-07-08  Martin Baulig  <martin@ximian.com>
8585
8586         Rewrote the handling of namespaces to fix a lot of the issues
8587         wrt. `using' aliases etc.
8588
8589         * namespace.cs (Namespace): Splitted this class into a
8590         per-assembly `Namespace' and a per-file `NamespaceEntry'.
8591
8592         * typemanager.cs (TypeManager.IsNamespace): Removed.
8593         (TypeManager.ComputeNamespaces): Only compute namespaces from
8594         loaded assemblies here, not the namespaces from the assembly we're
8595         currently compiling.
8596
8597 2003-07-08  Martin Baulig  <martin@ximian.com>
8598
8599         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
8600
8601 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8602
8603         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
8604         already fixed it.  
8605
8606         I thought about the memory savings here, but LookupTypeReflection
8607         is used under already very constrained scenarios.  Compiling
8608         corlib or mcs only exposes one hit, so it would not really reduce
8609         any memory consumption.
8610
8611 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8612
8613         * typemanager.cs: fixes bug #45889 by only adding public types from
8614         other assemblies to the list of known types.
8615
8616 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
8617
8618         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
8619         on the type we resolved.
8620
8621 2003-07-05  Martin Baulig  <martin@ximian.com>
8622
8623         * pending.cs (PendingImplementation.ParentImplements): Don't
8624         create the proxy if the parent is abstract.
8625
8626         * class.cs (TypeContainer.DefineIndexers): Process explicit
8627         interface implementations first.  Fixes #37714.
8628
8629 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
8630
8631         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
8632         defined recursively;  but since we modify the input parameters
8633         (left is set to `this' temporarily), we reset this value if the
8634         left_is_explicit is false, which gives the original semantics to
8635         the code.  
8636
8637         * literal.cs (NullPointer): new class used to represent a null
8638         literal in a pointer context.
8639
8640         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
8641         type is a pointer, use a NullPointer object instead of a
8642         NullLiteral.   Closes 43687
8643
8644         (ExplicitConversion): Convert pointer values using
8645         the conv opcode to the proper type.
8646
8647         * ecore.cs (New): change ValueTypeVariable property into a method,
8648         that returns whether the valuetype is suitable for being used.
8649
8650         * expression.cs (Binary.DoNumericPromotions): Only return if we
8651         the int constant was a valid uint, and we can return both left and
8652         right as uints.  If not, we continue processing, to trigger the
8653         type conversion.  This fixes 39018.
8654
8655         * statement.cs (Block.EmitMeta): During constant resolution, set
8656         the CurrentBlock property on the emitcontext, so that we resolve
8657         constants propertly.
8658
8659 2003-07-02  Martin Baulig  <martin@ximian.com>
8660
8661         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
8662         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
8663
8664         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
8665         than emitting it here.
8666
8667         * statement.cs: Fixed some more flow analysis bugs.
8668
8669 2003-07-02  Martin Baulig  <martin@ximian.com>
8670
8671         * class.cs (MethodData.Define): When implementing interface
8672         methods, set Final unless we're Virtual.
8673
8674         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
8675         check work for interface methods.
8676
8677 2003-07-01  Martin Baulig  <martin@ximian.com>
8678
8679         * ecore.cs (EmitContext.This): Replaced this property with a
8680         GetThis() method which takes a Location argument.  This ensures
8681         that we get the correct error location for a CS0188.
8682
8683 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
8684
8685         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
8686         ImplicitStandardConversion.
8687
8688         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
8689
8690 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
8691
8692         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
8693         optimization.
8694
8695 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
8696
8697         * class.cs (Constructor.Define): Turn off initlocals for unsafe
8698         constructors.
8699
8700         (MethodData.Define): Turn off initlocals for unsafe methods.
8701
8702 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
8703
8704         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
8705         complete;  Fixes #37521.
8706
8707         * delegate.cs: Use Modifiers.TypeAttr to compute the
8708         TypeAttributes, instead of rolling our own.  This makes the flags
8709         correct for the delegates.
8710
8711 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
8712
8713         * class.cs (Constructor.Define): Set the private flag for static
8714         constructors as well.
8715
8716         * cs-parser.jay (statement_expression): Set the return value to
8717         null, to avoid a crash when we catch an error.
8718
8719 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
8720
8721         * cs-parser.jay: Applied patch from Jackson that adds support for
8722         extern and unsafe modifiers to destructor declarations.
8723
8724         * expression.cs: Report error 21 if the user is trying to index a
8725         System.Array.
8726
8727         * driver.cs: Add an error message, suggested by the bug report.
8728
8729         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
8730         if we do not have a ": this ()" constructor initializer.  Fixes 45149
8731
8732 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
8733
8734         * namespace.cs: Add some information to reduce FAQs.
8735
8736 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
8737
8738         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
8739         underlying enumeration types.  Fixes #43915.
8740
8741         * expression.cs: Treat ushort/short as legal values to be used in
8742         bitwise operations.
8743
8744 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
8745
8746         * delegate.cs: transfer custom attributes for paramenters from
8747         the delegate declaration to Invoke and BeginInvoke.
8748
8749 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
8750
8751         * attribute.cs: handle custom marshalers and emit marshal info
8752         for fields, too.
8753
8754 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
8755
8756         * makefile.gnu: Added anonymous.cs to the compiler sources.
8757
8758 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
8759
8760         * iterators.cs: Change the name of the proxy class to include two
8761         underscores.
8762
8763         * cs-parser.jay: Update grammar to include anonymous methods.
8764
8765         * anonymous.cs: new file.
8766
8767 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
8768
8769         * class.cs (Field.Define): Add missing test for pointers and
8770         safety. 
8771
8772 2003-05-27  Ravi Pratap  <ravi@ximian.com>
8773
8774         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
8775         we use the stobj opcode.
8776
8777         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
8778         since it wasn't the correct fix. 
8779
8780         It still is puzzling that we are required to use stobj for IntPtr
8781         which seems to be a ValueType.
8782
8783 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
8784
8785         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
8786         during regular simple name resolution.   Now, the trick is that
8787         instead of returning for processing the simplename, we do a
8788         TypeManager.LookupType (ie, a rooted lookup as opposed to a
8789         contextual lookup type).   If a match is found, return that, if
8790         not, return for further composition.
8791
8792         This fixes long-standing 30485.
8793
8794         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
8795         using the address to initialize an object, do an Stobj instead of
8796         using the regular Stelem.
8797
8798         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
8799         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
8800         Because if we are a BaseIndexerAccess that value will be true.
8801         Fixes 43643.
8802
8803         * statement.cs (GotoCase.Resolve): Return after reporting an
8804         error, do not attempt to continue. 
8805
8806         * expression.cs (PointerArithmetic.Emit): If our operand is a
8807         long, convert our constants to match the operand before
8808         multiplying.  Convert to I type before adding.   Fixes 43670.
8809
8810 2003-05-14  Ravi Pratap  <ravi@ximian.com>
8811
8812         * enum.cs (ImplicitConversionExists) : Rename to
8813         ImplicitEnumConversionExists to remove ambiguity. 
8814
8815         * ecore.cs (NullCast): New type of cast expression class which
8816         basically is very similar to EmptyCast with the difference being
8817         it still is a constant since it is used only to cast a null to
8818         something else
8819         (eg. (string) null)
8820
8821         * convert.cs (ImplicitReferenceConversion): When casting a null
8822         literal, we return a NullCast.
8823
8824         * literal.cs (NullLiteralTyped): Remove - I don't see why this
8825         should be around anymore.
8826
8827         The renaming (reported was slightly wrong). Corrections:
8828
8829         ConvertImplicitStandard -> ImplicitConversionStandard
8830         ConvertExplicitStandard -> ExplicitConversionStandard
8831
8832         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
8833         before passing them in !
8834
8835         * convert.cs (ImplicitConversionStandard): When comparing for
8836         equal expr and target types, ensure that expr is not a
8837         NullLiteral.
8838
8839         In general, we must not be checking (expr_type ==
8840         target_type) in the top level conversion methods
8841         (ImplicitConversion, ExplicitConversion etc). This checking is
8842         done in the methods that they delegate to.
8843
8844 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
8845
8846         * convert.cs: Move Error_CannotConvertType,
8847         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
8848         ImplicitNumericConversion, ImplicitConversionExists,
8849         ImplicitUserConversionExists, StandardConversionExists,
8850         FindMostEncompassedType, FindMostSpecificSource,
8851         FindMostSpecificTarget, ImplicitUserConversion,
8852         ExplicitUserConversion, GetConversionOperators,
8853         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
8854         TryImplicitIntConversion, Error_CannotConvertImplicit,
8855         ConvertImplicitRequired, ConvertNumericExplicit,
8856         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
8857         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
8858         its own file.
8859
8860         Perform the following renames:
8861
8862         StandardConversionExists -> ImplicitStandardConversionExists
8863         ConvertImplicit -> ImplicitConversion
8864         ConvertImplicitStandard -> ImplicitStandardConversion
8865         TryImplicitIntConversion -> ImplicitIntConversion
8866         ConvertImplicitRequired -> ImplicitConversionRequired
8867         ConvertNumericExplicit -> ExplicitNumericConversion
8868         ConvertReferenceExplicit -> ExplicitReferenceConversion
8869         ConvertExplicit -> ExplicitConversion
8870         ConvertExplicitStandard -> ExplicitStandardConversion
8871
8872 2003-05-19  Martin Baulig  <martin@ximian.com>
8873
8874         * statement.cs (TypeInfo.StructInfo): Made this type protected.
8875         (TypeInfo): Added support for structs having structs as fields.
8876
8877         * ecore.cs (FieldExpr): Implement IVariable.
8878         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
8879         VariableInfo for the field.
8880
8881 2003-05-18  Martin Baulig  <martin@ximian.com>
8882
8883         * expression.cs (This.DoResolve): Report a CS0027 if we're
8884         emitting a field initializer.
8885
8886 2003-05-18  Martin Baulig  <martin@ximian.com>
8887
8888         * expression.cs (This.ResolveBase): New public function.
8889         (This.DoResolve): Check for CS0188.
8890
8891         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
8892         This.Resolve().
8893
8894         * ecore.cs (MethodGroupExpr.DoResolve): Set the
8895         `instance_expression' to null if we don't have any non-static
8896         methods.
8897
8898 2003-05-18  Martin Baulig  <martin@ximian.com>
8899
8900         Reworked the way how local variables and parameters are handled by
8901         the flow analysis code.
8902
8903         * statement.cs (TypeInfo, VariableMap): New public classes.
8904         (VariableInfo): New public class.  This is now responsible for
8905         checking whether a variable has been assigned.  It is used for
8906         parameters and local variables.
8907         (Block.EmitMeta): Take the InternalParameters as argument; compute
8908         the layout of the flow vectors here.
8909         (Block.LocalMap, Block.ParameterMap): New public properties.
8910         (FlowBranching): The .ctor doesn't get the InternalParameters
8911         anymore since Block.EmitMeta() now computes the layout of the flow
8912         vector.
8913         (MyStructInfo): This class is now known as `StructInfo' and nested
8914         in `TypeInfo'; we don't access this directly anymore.
8915
8916         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
8917         property and removed IsAssigned(), IsFieldAssigned(),
8918         SetAssigned() and SetFieldAssigned(); we now call them on the
8919         VariableInfo so we don't need to duplicate this code everywhere.
8920
8921         * expression.cs (ParameterReference): Added `Block block' argument
8922         to the .ctor.
8923         (LocalVariableReference, ParameterReference, This): The new
8924         VariableInfo class is now responsible for all the definite
8925         assignment stuff.
8926
8927         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
8928         IsParameterAssigned, SetParameterAssigned): Removed.
8929
8930 2003-05-18  Martin Baulig  <martin@ximian.com>
8931
8932         * typemanager.cs (InitCoreTypes): Try calling
8933         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
8934         the 3-args-version.  Corlib now also needs our `void_type'.
8935         (GetMethod): Added overloaded version which takes an optional
8936         `bool report_errors' to allow lookups of optional methods.
8937
8938 2003-05-12  Martin Baulig  <martin@ximian.com>
8939
8940         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
8941         only used for locals and not for parameters.
8942
8943 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
8944
8945         * support.cs (InternalParameters.ParameterType): Return the
8946         ExternalType of the parameter.
8947
8948         * parameter.cs (Parameter.ExternalType): drop the two arguments,
8949         they were unused.
8950
8951 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
8952
8953         * class.cs (MethodData.Define): Do not set the `newslot' on
8954         interface members, if they are also flagged as "override".
8955
8956         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
8957         better code for ++i and i++.  This only works for static fields
8958         and local variables.
8959
8960         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
8961         want to pull the DeclSpace out of the builder_to_declspace instead
8962         of the TypeBuilder (like in TypeContainer.FindMembers).
8963
8964         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
8965         instead of LookupTypeContainer.  Fixes the crash on .NET for
8966         looking up interface members.
8967
8968         * const.cs: Create our own emit context during the Definition
8969         stage, so that constants are evaluated in the proper context, when
8970         a recursive definition happens.
8971
8972 2003-05-11  Martin Baulig  <martin@ximian.com>
8973
8974         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
8975         new block for a switch section.
8976         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
8977         the adding/lookup in the switch block.  Fixes #39828.
8978
8979 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
8980
8981         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
8982         functionality: I needed to convert the data after I had performed
8983         the add/sub operation into the operands type size.
8984
8985         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
8986         pass the type for the box operation, otherwise the resulting
8987         object would have been of type object.
8988
8989         (BoxedCast): Add constructor to specify the type to box as.
8990
8991 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
8992
8993         * iterators.cs: I was reusing the `count' variable inadvertently,
8994         take steps to not allow this to happen.
8995
8996 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
8997
8998         * attribute.cs (Attribute.Resolve): Params attributes are encoded
8999         by creating an array at the point where the params starts and
9000         putting all those arguments there, then adjusting the size of the
9001         array.
9002
9003 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
9004
9005         * expression.cs (New.AddressOf): Implement interface
9006         IMemoryLocation.  This is used when the `new' operator is used in
9007         the context of an invocation to a method on a value type.
9008
9009         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
9010         example. 
9011
9012         * namespace.cs: Also check the using aliases here.
9013
9014         * driver.cs: Move the test for using validity after the types have
9015         been entered, so we do a single pass that also includes the using
9016         aliases. 
9017
9018         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
9019         in the regular case.   CreateSiblingForFinally is doing extra
9020         error checking.
9021
9022         * attribute.cs (GetAttributeArgumentExpression): Store the result
9023         on an out value, and use the return value to indicate failure
9024         instead of using null (which is a valid return for Constant.GetValue).
9025
9026         * statement.cs: Perform the analysis flow for the increment
9027         portion after the statement, because this will be the real flow of
9028         execution.  Fixes #42385
9029
9030         * codegen.cs (EmitContext.EmitArgument,
9031         EmitContext.EmitStoreArgument): New helper functions when the
9032         RemapToProxy flag is set.
9033
9034         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
9035         function.
9036
9037         Add support for remapping parameters. 
9038
9039         * iterators.cs: Propagate parameter values;  Store parameter
9040         values in the proxy classes.
9041
9042 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
9043
9044         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
9045         need a proxy reference;  I do not know what I was thinking
9046
9047         * cs-parser.jay (constructor_initializer): catch another error,
9048         and display nice message.
9049
9050         (field_declaration): catch void field declaration
9051         to flag a better error. 
9052
9053         * class.cs (MemberBase.CheckBase): Report an error instead of a
9054         warning if a new protected member is declared in a struct. 
9055         (Field.Define): catch the error of readonly/volatile.
9056
9057         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
9058
9059         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
9060         volatile variable is taken
9061
9062 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
9063
9064         * statement.cs (Fixed.Resolve): Report an error if we are not in
9065         an unsafe context.
9066
9067 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
9068
9069         * typemanager.cs: reuse the code that handles type clashes for
9070         delegates and enumerations.
9071
9072         * class.cs (Report28): Always report.
9073
9074         * expression.cs (EncodeAsAttribute): Allow nulls here.
9075
9076 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
9077
9078         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
9079         the functionality for testing whether an expression is valid for
9080         an attribute here.  Also handle the case of arrays of elements
9081         being stored. 
9082
9083         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
9084         encoding a linear array into an array of objects that are suitable
9085         to be passed to an CustomAttributeBuilder.
9086
9087         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
9088
9089         * ecore.cs: (FieldExpr): Handle field remapping here.
9090
9091         * iteratators.cs: Pass the instance variable (if the method is an
9092         instance method) to the constructors, so we can access the field
9093         variables on the class.
9094
9095         TODO: Test this with structs.  I think the THIS variable on
9096         structs might have to be a pointer, and not a refenrece
9097
9098 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
9099
9100         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
9101         local variables to fields in a proxy class.
9102
9103         * iterators.cs (PopulateProxy): Rename our internal fields to
9104         <XXX>.  
9105         Create a <THIS> field if we are an instance method, so we can
9106         reference our parent container variables.
9107         (MapVariable): Called back from the EmitContext code to enter a
9108         new variable to field mapping into the proxy class (we just create
9109         a FieldBuilder).
9110
9111         * expression.cs
9112         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
9113         for using the remapped locals to fields.
9114
9115         I placed the code here, because that gives the same semantics to
9116         local variables, and only changes the Emit code.
9117
9118         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
9119         statements inside iterators.
9120         (VariableInfo): Add a FieldBuilder for the cases when we are
9121         remapping local variables to fields in a proxy class
9122
9123         * ecore.cs (SimpleNameResolve): Avoid testing two times for
9124         current_block != null.
9125
9126         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
9127         not cope with strings, as it has been moved to the
9128         TableSwitchEmit.  Fixed bug in switch generation.
9129
9130         * expression.cs (New.DoResolve): Provide more context for the user
9131         when reporting an error.
9132
9133         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
9134         pointers. 
9135
9136         * expression.cs (MemberAccess.DoResolve): When we get a type back,
9137         check the permissions for it.  Note than in a type-resolution
9138         context the check was already present in DeclSpace.ResolveType,
9139         but was missing from the MemberAccess.
9140
9141         (ArrayCreation.CheckIndices): warn if the user has
9142         more nested levels of expressions, but there are no more
9143         dimensions specified.  Avoids crash on bug 41906.
9144
9145 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
9146
9147         * statement.cs (Block): replace Implicit bool, for a generic
9148         flags.   
9149         New flag: `Unchecked'.  This is used during the EmitMeta phase
9150         (which is out-of-line with the regular Resolve/Emit process for a
9151         statement, as this is done ahead of time, but still gets a chance
9152         to call constant resolve).
9153
9154         (Block.Flags): new enum for adding a new flag.
9155
9156         (Block.EmitMeta): track the state of unchecked.
9157
9158         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
9159         to enable constant resolution to work there as well.
9160
9161 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
9162
9163         * typemanager.cs (ienumerable_type): Also look up
9164         System.Collections.IEnumerable. 
9165
9166 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
9167
9168         TODO: Test more than one conditional per method.
9169
9170         * class.cs (Indexer.Define): Report the location where the user is
9171         referencing the unsupported feature.
9172
9173         (MethodData): Overload the use of `conditionals' to
9174         minimize the creation of needless ArrayLists.   This saves roughly
9175         212kb on my machine.
9176
9177         (Method): Implement the new IIteratorContainer interface.
9178         (Method.SetYields): Implement the method by setting the ModFlags
9179         to contain METHOD_YIELDS.
9180
9181         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
9182         which just got set to null.
9183
9184         * iterators.cs: New file.
9185
9186         (Yield, YieldBreak): New statements.
9187
9188         * statement.cs (Return.Resolve): Flag an error if we are used in
9189         an iterator method.
9190
9191         * codegen.cs (InIterator): New flag set if the code is being
9192         compiled in an iterator method.
9193
9194         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
9195         internal modifier, and we just use it to avoid adding extra
9196         fields, as this is seldom used.  
9197
9198         * cs-parser.jay: Add yield_statement (yield and yield break).
9199
9200         * driver.cs: New flag -v2 to turn on version 2 features. 
9201
9202         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
9203         hashtable when v2 is enabled.
9204
9205 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
9206
9207         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
9208         there is already a namespace defined with this name.
9209
9210         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
9211         people upgraded their corlibs.
9212
9213         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
9214         always use fully qualified types, no need to use the compiler
9215         front end.
9216
9217         (TypeManager.IsNamespace): Use binarysearch.
9218
9219         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
9220         AddDelegate): I did not quite use the new IsValid API properly: I
9221         have to pass the short-name and the fullname.  I was passing only
9222         the basename instead of the fullname sometimes. 
9223
9224         (TypeContainer.DefineType): call NamespaceClash.
9225
9226         * interface.cs (Interface.DefineType): use NamespaceClash before
9227         defining the type.
9228
9229         * delegate.cs (Delegate.DefineType): use NamespaceClash before
9230         defining the type.
9231
9232         * enum.cs: (Enum.DefineType): use NamespaceClash before
9233         defining the type.
9234
9235         * typemanager.cs (: 3-line patch that gives us some tasty 11%
9236         speed increase.  First, use the negative_hits cache when we get a
9237         negative.  Second, add the type with its full original name
9238         instead of the new . and + encoded name (reflection uses + to
9239         separate type from a nested type).  Use LookupTypeReflection
9240         directly which bypasses the type->name hashtable (that we already
9241         know does not contain the type.
9242
9243         * decl.cs (DeclSpace.ResolveTypeExpr): track the
9244         location/container type. 
9245
9246         * driver.cs: When passing utf8, use directly the UTF8Encoding.
9247
9248 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
9249
9250         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
9251
9252         * delegate.cs (NewDelegate.Resolve): Test whether an instance
9253         method is being referenced in the method group from a static
9254         context, and report error 120 if so.
9255
9256         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
9257         Error118. 
9258
9259         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
9260         is created, we create the A namespace).
9261
9262         * cs-parser.jay: A namespace also introduces a DeclarationFound.
9263         Fixes #41591
9264
9265 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
9266
9267         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
9268         invocation to ModuleBuilder.GetType with the same values will
9269         return a new type instance, so we need to cache its return
9270         values. 
9271
9272         * expression.cs (Binary.ResolveOperator): Only allow the compare
9273         operators on enums if they are of the same type.
9274
9275         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
9276         types of ValueType on their own case.  Before we were giving them
9277         the same treatment as objects.
9278
9279         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
9280         fullname.  Short name is used to compare against container name.
9281         Fullname is used to check against defined namespace names.
9282
9283         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
9284         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
9285
9286         (Method.CheckBase): Call parent.
9287         (MemberBase.CheckBase): Check for protected members on sealed
9288         classes.
9289         (PropertyBase.CheckBase): Call parent.
9290         (Field.Define): Call parent.
9291
9292         * report.cs: Negative error codes are now mapped to 8000 - code,
9293         so that the display is render more nicely.
9294
9295         * typemanager.cs: Do not use try/catch, instead report a regular
9296         error. 
9297
9298         (GetPointerType, GetReferenceType): These methods provide
9299         mechanisms to obtain the T* and T& from a T.  We had the code
9300         previously scattered around the code base, and it also used
9301         TypeManager.LookupType that would go through plenty of caches.
9302         This one goes directly to the type source.
9303
9304         In some places we did the Type.GetType followed by
9305         ModuleBuilder.GetType, but not in others, so this unifies the
9306         processing as well.
9307
9308         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
9309         statements now that we have namespace information.
9310
9311         * typemanager.cs (IsNamespace): New method, returns whether the
9312         string presented is a namespace or not.
9313
9314         (ComputeNamespaces): New public entry point, computes the list of
9315         available namespaces, using the GetNamespaces API call in Mono, or
9316         the slower version in MS.NET.   
9317
9318         Now before we start the semantic analysis phase, we have a
9319         complete list of namespaces including everything that the user has
9320         provided.
9321
9322         Deleted old code to cache namespaces in .nsc files.
9323
9324 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
9325
9326         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
9327         class/struct location definition Location for the implicit
9328         constructor location.
9329
9330         (Operator.Define): Use the location of the operator for the
9331         implicit Method definition.
9332
9333         (Constructor.Emit): use the constructor location for the implicit
9334         base initializer constructor.
9335
9336         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
9337         and the Expression class now contains two new methods:
9338
9339         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
9340         isolate type lookup from the rest of the resolution process.
9341
9342         Since we use Expressions to hold type definitions due to the way
9343         we parse the input we have historically overloaded Resolve to
9344         perform the Type lookups if a special flag is passed.  Now this is
9345         eliminated and two methods take their place. 
9346
9347         The differences in the two methods between xStep and xTerminal is
9348         that xStep is involved in our current lookup system that uses
9349         SimpleNames to compose a name, while xTerminal is used just to
9350         catch the case where the simplename lookup failed.
9351
9352 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
9353
9354         * expression.cs (ResolveMemberAccess): Remove redundant code.
9355         TypeExpr expressions are always born fully resolved.
9356
9357         * interface.cs (PopulateMethod): Do not lookup the types twice.
9358         We were doing it once during SemanticAnalysis and once during
9359         PopulateMethod.
9360
9361         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
9362         in local variable type definitions, were being returned as a
9363         SimpleName (we decomposed everything into a string), that is
9364         because primary_expression was being used instead of a type in the
9365         grammar (reduce/reduce conflicts).
9366
9367         The part that was wrong is that we converted the expression into a
9368         string (an oversimplification in one hand, compounded with primary
9369         expressions doing string concatenation).
9370
9371         So things like:
9372
9373         A.B.C [] x;
9374
9375         Would return "A.B.C[]" as a SimpleName.  This stopped things like
9376         using clauses from working on this particular context.  And a type
9377         was being matched directly against "A.B.C[]".
9378
9379         We now use the correct approach, and allow for ComposedCast to be
9380         part of the unary expression.  So the "A.B.C []" become a composed
9381         cast of "A.B.C" (as a nested group of MemberAccess with a
9382         SimpleName at the end) plus the rank composition "[]". 
9383
9384         Also fixes 35567
9385
9386 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
9387
9388         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
9389         for the access level checking.
9390
9391         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
9392         `TypeContainer container', because I kept getting confused when I
9393         was debugging this code.
9394
9395         * expression.cs (Indexers): Instead of tracking getters/setters,
9396         we now track them in parallel.  We create one arraylist less, but
9397         most importantly it is possible now for the LValue code to find a
9398         matching get for a set.
9399
9400         (IndexerAccess.DoResolveLValue): Update the code.
9401         GetIndexersForType has been modified already to extract all the
9402         indexers from a type.  The code assumed it did not.
9403
9404         Also make the code set the correct return type for the indexer.
9405         This was fixed a long time ago for properties, but was missing for
9406         indexers.  It used to be void_type.
9407
9408         (Binary.Emit): Test first for doubles instead of
9409         floats, as they are more common.
9410
9411         (Binary.EmitBranchable): Use the .un version of the branch opcodes
9412         when dealing with floats and the <=, >= operators.  This fixes bug
9413         #39314 
9414
9415         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
9416         to load the array value by emitting a load on the foreach variable
9417         type.  This was incorrect.  
9418
9419         We now emit the code to load an element using the the array
9420         variable type, and then we emit the conversion operator.
9421
9422         Fixed #40176
9423
9424 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
9425
9426         * attribute.cs: Avoid allocation of ArrayLists in the common case.
9427
9428 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
9429
9430         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
9431         test for protection before we test for signatures. 
9432
9433         (MethodSignature.ToString): implement.
9434
9435         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
9436         to the case where we reduced into a LongConstant.
9437
9438         * decl.cs (CheckAccessLevel): If the type is an array, we can not
9439         depend on whether the information is acurrate, because the
9440         Microsoft runtime will always claim that the array type is public,
9441         regardless of the real state.
9442
9443         If the type is a pointer, another problem happens: the type is
9444         reported as non-public in Microsoft.  
9445
9446         In both cases we have to call CheckAccessLevel recursively with
9447         the underlying type as the argument to be tested.
9448
9449 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
9450
9451         * assign.cs (Assign.Emit): If we are dealing with a compound
9452         assignment expression, we should use the code path that stores the
9453         intermediate result in a temporary value.  This fixes #40903.
9454
9455         *expression.cs (Indirection.ToString): Provide ToString method for
9456         debugging. 
9457
9458 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
9459
9460         * class.cs: Null out fields holding references to Block objects so
9461         they can be garbage collected.
9462
9463         * expression.cs (OverloadResolve): Remove unused local.
9464
9465 2003-04-07  Martin Baulig  <martin@ximian.com>
9466
9467         * codegen.cs (EmitContext.CurrentFile): New public field.
9468         (EmitContext.Mark): Use the CurrentFile to check whether the
9469         location is in the correct file.
9470         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
9471
9472 2003-04-07  Martin Baulig  <martin@ximian.com>
9473
9474         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
9475
9476         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
9477         location.  [FIXME: The location argument which gets passed to this
9478         method is sometimes wrong!]
9479
9480 2003-04-07  Nick Drochak <ndrochak@gol.com>
9481
9482         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
9483
9484 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
9485
9486         * expression.cs (Indirection.EmitAssign): We were using the
9487         temporary, but returning immediately instead of continuing the
9488         EmitAssing flow.
9489
9490 2003-04-06  Martin Baulig  <martin@ximian.com>
9491
9492         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
9493         if it's a nested child, but also deriving from the outer class.
9494         See test 190.cs.
9495
9496         * typemanager.cs (IsNestedChildOf): Make this work if it's a
9497         nested child, but also deriving from the outer class.  See
9498         test-190.cs.
9499         (FilterWithClosure): We may access private members of the outer
9500         class if we're a nested child and deriving from the outer class.
9501         (RealMemberLookup): Only set `closure_private_ok' if the
9502         `original_bf' contained BindingFlags.NonPublic.
9503
9504 2003-04-05  Martin Baulig  <martin@ximian.com>
9505
9506         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
9507         probe if its a type parameter, and if so, flag an error.
9508
9509         * decl.cs: Move here the SetParameterInfo code from class.cs.
9510         Handle IsGeneric here.
9511
9512         Handle a variety of errors in the parameter info definition.
9513
9514         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
9515         type parameters here.
9516
9517         * cs-parser.jay (class_declaration): report errors for parameters
9518         here as well.
9519
9520 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
9521
9522         * generic.cs: New file, contains support code for generics.
9523
9524         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
9525         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
9526
9527         Update parser for the above removals.
9528
9529         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
9530         now taken care of in the parser.
9531
9532 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
9533
9534         * class.cs (Event.Define): Do not allow abstract events to have
9535         initializers. 
9536
9537 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
9538
9539         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
9540         block in event declarations.
9541
9542         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
9543         value type, get its address.
9544
9545         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
9546         leaving a class on the stack instead of a boolean value (int
9547         0/1).  Change the code so we compare against null, and then the
9548         result against zero.
9549
9550         * class.cs (TypeContainer.GetClassBases): We were checking for the
9551         parent class being sealed too late.
9552
9553         * expression.cs (Binary.Emit): For <= and >= when dealing with
9554         floating point values, use cgt.un and clt.un instead of cgt and
9555         clt alone.
9556
9557 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
9558
9559         * statement.cs: Apply the same optimization as MS: skip the 
9560         GetEnumerator returning an IEnumerator, and use the one returning a 
9561         CharEnumerator instead. This allows us to avoid the try-finally block 
9562         and the boxing.
9563
9564 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
9565
9566         * cs-parser.jay: Attributes cannot be applied to
9567                          namespaces. Fixes #40473
9568
9569 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9570
9571         * class.cs:
9572         (Add*): check if the name is valid using the full name for constants,
9573         fields, properties and events.
9574
9575 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
9576
9577         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
9578         char constants to be part of the enumeration.
9579
9580         * expression.cs (Conditional.DoResolve): Add support for operator
9581         true. Implements the missing functionality from 14.12
9582
9583         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
9584         operator true/false as required by the spec.
9585
9586         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
9587         implicit conversion to boolean.
9588
9589         * statement.cs (Statement.ResolveBoolean): A boolean expression is
9590         also one where the type implements `operator true'. 
9591
9592         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
9593         get an expression that will invoke operator true based on an
9594         expression.  
9595
9596         (GetConversionOperators): Removed the hack that called op_True
9597         here.  
9598
9599         (Expression.ResolveBoolean): Move this from Statement.
9600
9601 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
9602
9603         * ecore.cs (FieldExpr): do not allow initialization of initonly
9604         fields on derived classes
9605
9606 2003-03-13  Martin Baulig  <martin@ximian.com>
9607
9608         * statement.cs (Block.Emit): Call ig.BeginScope() and
9609         ig.EndScope() when compiling with debugging info; call
9610         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
9611
9612 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
9613
9614         * expression.cs (Indexers): Do not construct immediately, allow
9615         for new members to be appended as we go.  Fixes 38143
9616
9617 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9618
9619         * expression.cs: save/restore context when resolving an unchecked
9620         expression.
9621
9622 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
9623
9624         * cfold.cs: Catch division by zero in modulus operator during
9625         constant folding.
9626
9627 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
9628
9629         * interface.cs (Interface.DefineMembers): Avoid defining members
9630         twice. 
9631
9632 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
9633
9634         * driver.cs: handle the +/- options for -noconfig
9635
9636         * statement.cs (Unckeched.Resolve): Also track the state of
9637         unchecked in the Resolve phase.
9638
9639 2003-02-27  Martin Baulig  <martin@ximian.com>
9640
9641         * ecore.cs (Expression.MemberLookup): Don't create a
9642         MethodGroupExpr for something which is not a method.  Fixes #38291.
9643
9644 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
9645
9646         * class.cs (MemberBase.CheckParameters): Also check that the type
9647         is unmanaged if it is a pointer.
9648
9649         * expression.cs (SizeOf.Resolve): Add location information.
9650
9651         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
9652         a managed type is declared.
9653
9654         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
9655         parameter modifiers as well.  Fixes bug 38606
9656
9657         * class.cs: Very sad.  Am backing out the speed up changes
9658         introduced by the ArrayList -> Array in the TypeContainer, as they
9659         were not actually that much faster, and introduced a bug (no error
9660         reports on duplicated methods).
9661
9662         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
9663         source first, this will guarantee that we have a valid expression
9664         before calling in lower levels functions that will require a
9665         resolved object.  Then use this original_source in the
9666         target.ResolveLValue instead of the original source that was
9667         passed to us.
9668
9669         Another change.  Use target.Resolve instead of LValueResolve.
9670         Although we are resolving for LValues, we will let the Assign code
9671         take care of that (it will be called again from Resolve).  This
9672         basically allows code like this:
9673
9674         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
9675         class Y { void A (X x) { x [0] += o; }
9676
9677         The problem was that the indexer was trying to resolve for
9678         set_Item (idx, object o) and never finding one.  The real set_Item
9679         was set_Item (idx, X).  By delaying the process we get the right
9680         semantics. 
9681
9682         Fixes bug 36505
9683
9684 2003-02-23  Martin Baulig  <martin@ximian.com>
9685
9686         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
9687         while calling DoEmit ().
9688
9689         * codegen.cs (EmitContext.Mark): Don't mark locations in other
9690         source files; if you use the #line directive inside a method, the
9691         compiler stops emitting line numbers for the debugger until it
9692         reaches the end of the method or another #line directive which
9693         restores the original file.
9694
9695 2003-02-23  Martin Baulig  <martin@ximian.com>
9696
9697         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
9698
9699 2003-02-23  Martin Baulig  <martin@ximian.com>
9700
9701         * statement.cs (Block.AddChildVariableNames): We need to call this
9702         recursively, not just for our immediate children.
9703
9704 2003-02-23  Martin Baulig  <martin@ximian.com>
9705
9706         * class.cs (Event.Define): Always make the field private, like csc does.
9707
9708         * typemanager.cs (TypeManager.RealMemberLookup): Make events
9709         actually work, fixes bug #37521.
9710
9711 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
9712
9713         * delegate.cs: When creating the various temporary "Parameters"
9714         classes, make sure that we call the ComputeAndDefineParameterTypes
9715         on those new parameters (just like we do with the formal ones), to
9716         allow them to be resolved in the context of the DeclSpace.
9717
9718         This fixes the bug that Dick observed in Bugzilla #38530.
9719
9720 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
9721
9722         * expression.cs (ResolveMemberAccess): When resolving a constant,
9723         do not attempt to pull a constant if the value was not able to
9724         generate a valid constant.
9725
9726         * const.cs (LookupConstantValue): Do not report more errors than required.
9727
9728 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9729
9730         * expression.cs: fixes bug #38328.
9731
9732 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9733
9734         * class.cs: Changed all the various members that can be part of a
9735         class from being an ArrayList to be an Array of the right type.
9736         During the DefineType type_list, interface_list, delegate_list and
9737         enum_list are turned into types, interfaces, delegates and enums
9738         arrays.  
9739
9740         And during the member population, indexer_list, event_list,
9741         constant_list, field_list, instance_constructor_list, method_list,
9742         operator_list and property_list are turned into their real arrays.
9743
9744         Although we could probably perform this operation earlier, for
9745         good error reporting we need to keep the lists and remove the
9746         lists for longer than required.
9747
9748         This optimization was triggered by Paolo profiling the compiler
9749         speed on the output of `gen-sample-program.pl' perl script. 
9750
9751         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
9752         not crash in methods like MemberLookupFailed that use this field.  
9753
9754         This problem arises when the compiler fails to resolve a type
9755         during interface type definition for example.
9756
9757 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
9758
9759         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
9760         inherit from System.Object, so we have to stop at null, not only
9761         when reaching System.Object.
9762
9763 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
9764
9765         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
9766         DeclaredOnly because the parent indexer might have had a different
9767         name, but did not loop until the top of the hierarchy was reached.
9768
9769         The problem this one fixes is 35492: when a class implemented an
9770         indexer from an interface, we were getting the interface method
9771         (which was abstract) and we were flagging an error (can not invoke
9772         abstract method).
9773
9774         This also keeps bug 33089 functioning, and test-148 functioning.
9775
9776         * typemanager.cs (IsSpecialMethod): The correct way of figuring
9777         out if a method is special is to see if it is declared in a
9778         property or event, or whether it is one of the predefined operator
9779         names.   This should fix correctly #36804.
9780
9781 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
9782
9783         The goal here is to remove the dependency on EmptyCast.Peel ().
9784         Killing it completely.
9785
9786         The problem is that currently in a number of places where
9787         constants are expected, we have to "probe" for an EmptyCast, and
9788         Peel, which is not the correct thing to do, as this will be
9789         repetitive and will likely lead to errors. 
9790
9791         The idea is to remove any EmptyCasts that are used in casts that
9792         can be reduced to constants, so we only have to cope with
9793         constants. 
9794
9795         This bug hunt was triggered by Bug 37363 and the desire to remove
9796         the duplicate pattern where we were "peeling" emptycasts to check
9797         whether they were constants.  Now constants will always be
9798         constants.
9799
9800         * ecore.cs: Use an enumconstant here instead of wrapping with
9801         EmptyCast.  
9802
9803         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
9804         throwing me off.  By handling this we can get rid of a few hacks.
9805
9806         * statement.cs (Switch): Removed Peel() code.
9807
9808 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
9809
9810         * class.cs: Location information for error 508
9811
9812         * expression.cs (New.DoResolve): Add a guard against double
9813         resolution of an expression.  
9814
9815         The New DoResolve might be called twice when initializing field
9816         expressions (see EmitFieldInitializers, the call to
9817         GetInitializerExpression will perform a resolve on the expression,
9818         and later the assign will trigger another resolution
9819
9820         This leads to bugs (#37014)
9821
9822         * delegate.cs: The signature for EndInvoke should contain any ref
9823         or out parameters as well.  We were not doing this in the past. 
9824
9825         * class.cs (Field.Define): Do not overwrite the type definition
9826         inside the `volatile' group.  Turns out that volatile enumerations
9827         were changing the type here to perform a validity test, which
9828         broke conversions. 
9829
9830 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
9831
9832         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
9833         and structs, we do not want to load the instance variable
9834
9835         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
9836         enum_type has to be handled like an object reference (implicit
9837         conversions exists from this to object), but the regular IsClass
9838         and IsValueType tests will never return true for this one.
9839
9840         Also we use TypeManager.IsValueType instead of type.IsValueType,
9841         just for consistency with the rest of the code (this is only
9842         needed if we ever use the construct exposed by test-180.cs inside
9843         corlib, which we dont today).
9844
9845 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
9846
9847         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
9848         just InternalCall.
9849
9850 2003-02-09  Martin Baulig  <martin@ximian.com>
9851
9852         * namespace.cs (Namespace..ctor): Added SourceFile argument.
9853         (Namespace.DefineNamespaces): New static public method; this is
9854         called when we're compiling with debugging to add all namespaces
9855         to the symbol file.
9856
9857         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
9858         pass it to the Namespace's .ctor.
9859
9860         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
9861         and MethodBase arguments; pass the namespace ID to the symwriter;
9862         pass the MethodBase instead of the token to the symwriter.
9863         (SymbolWriter.DefineNamespace): New method to add a namespace to
9864         the symbol file.
9865
9866 2003-02-09  Martin Baulig  <martin@ximian.com>
9867
9868         * symbolwriter.cs: New file.  This is a wrapper around
9869         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
9870         methods here in near future.
9871
9872 2003-02-09  Martin Baulig  <martin@ximian.com>
9873
9874         * codegen.cs (EmitContext.Mark): Just pass the arguments to
9875         ILGenerator.MarkSequencePoint() which are actually used by the
9876         symbol writer.
9877
9878 2003-02-09  Martin Baulig  <martin@ximian.com>
9879
9880         * location.cs (SourceFile): New public sealed class.  This
9881         contains the name and an index which is used in the location's token.
9882         (Location): Reserve an appropriate number of bits in the token for
9883         the source file instead of walking over that list, this gives us a
9884         really huge performance improvement when compiling with debugging.
9885
9886         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
9887         `SourceFile' argument instead of a string.
9888         (Driver.ProcessFile): Add all the files via Location.AddFile(),
9889         but don't parse/tokenize here, we need to generate the list of all
9890         source files before we do that.
9891         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
9892         the files.
9893
9894         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
9895         instead of a string.
9896
9897         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
9898         of a string.
9899
9900 2003-02-09  Martin Baulig  <martin@ximian.com>
9901
9902         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
9903         filename on `#line default'.
9904
9905 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
9906
9907         * statement.cs: don't clear the pinned var when the fixed statement
9908         returns from the method (fixes bug#37752).
9909
9910 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
9911
9912         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
9913         to IsValueType.
9914
9915 2003-02-07  Martin Baulig  <martin@ximian.com>
9916
9917         * driver.cs: Removed the `--debug-args' command line argument.
9918
9919         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
9920         automatically by the AsssemblyBuilder.
9921         (CodeGen.InitializeSymbolWriter): We don't need to call any
9922         initialization function on the symbol writer anymore.  This method
9923         doesn't take any arguments.
9924
9925 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
9926
9927         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
9928         from referenced assemblies as well.
9929
9930 2003-02-02  Martin Baulig  <martin@ximian.com>
9931
9932         * class.cs (MethodData.Emit): Generate debugging info for external methods.
9933
9934 2003-02-02  Martin Baulig  <martin@ximian.com>
9935
9936         * class.cs (Constructor.Emit): Open the symbol writer before
9937         emitting the constructor initializer.
9938         (ConstructorInitializer.Emit): Call ec.Mark() to allow
9939         single-stepping through constructor initializers.
9940
9941 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
9942
9943         * class.cs: Handle error 549: do not allow virtual methods in
9944         sealed classes. 
9945
9946 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
9947
9948         * decl.cs: Check access levels when resolving types
9949
9950 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
9951
9952         * statement.cs: Add parameters and locals set in catch blocks that might 
9953         return to set vector
9954
9955 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
9956
9957         * class.cs (Operator): Set the SpecialName flags for operators.
9958
9959         * expression.cs (Invocation.DoResolve): Only block calls to
9960         accessors and operators on SpecialName methods.
9961
9962         (Cast.TryReduce): Handle conversions from char constants.
9963
9964
9965 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
9966
9967         * statement.cs: small memory and time optimization in FlowBranching.
9968
9969 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
9970
9971         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
9972         problem that the last fix but in the other sid (Set).
9973
9974         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
9975         access when there is no indexer in the hierarchy.
9976
9977 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
9978
9979         * class.cs: Combine some if statements.
9980
9981 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9982
9983         * driver.cs: fixed bug #37187.
9984
9985 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
9986
9987         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
9988         any indexer, it's needed to build a list with all the indexers in the
9989         hierarchy (AllGetters), else we have problems. Fixes #35653.
9990
9991 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
9992
9993         * class.cs (MethodData.Define): It is wrong for an interface
9994         implementation to be static in both cases: explicit and implicit.
9995         We were only handling this in one case.
9996
9997         Improve the if situation there to not have negations.
9998
9999         * class.cs (Field.Define): Turns out that we do not need to check
10000         the unsafe bit on field definition, only on usage.  Remove the test.
10001
10002 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10003
10004         * driver.cs: use assembly.Location instead of Codebase (the latest
10005         patch made mcs fail when using MS assemblies).
10006
10007 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
10008
10009         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
10010         get the path to *corlib.dll.
10011
10012 2003-01-21  Nick Drochak <ndrochak@gol.com>
10013
10014         * cs-tokenizer.cs:
10015         * pending.cs:
10016         * typemanager.cs: Remove compiler warnings
10017
10018 2003-01-20  Duncan Mak  <duncan@ximian.com>
10019
10020         * AssemblyInfo.cs: Bump the version number to 0.19.
10021
10022 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10023
10024         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
10025
10026 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
10027
10028         * class.cs (Constructor::Emit): Emit debugging info for constructors.
10029
10030 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
10031
10032         * cs-parser.jay: Small fix: we were not comparing the constructor
10033         name correctly.   Thanks to Zoltan for the initial pointer.
10034
10035 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
10036
10037         * cs-tokenizer.cs: Set file name when specified with #line
10038
10039 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
10040
10041         * cs-parser.jay: Only perform the constructor checks here if we
10042         are named like the class;  This will help provider a better
10043         error.  The constructor path is taken when a type definition is
10044         not found, but most likely the user forgot to add the type, so
10045         report that rather than the constructor error.
10046
10047 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
10048
10049         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
10050         allocations.
10051
10052 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10053
10054         * cs-parser.jay: Add cleanup call.
10055
10056 2003-01-13  Duncan Mak  <duncan@ximian.com>
10057
10058         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
10059         consistent with other methods.
10060
10061 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
10062
10063         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
10064
10065 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
10066
10067         * attribute.cs: only set GuidAttr to true when we have a
10068         GuidAttribute.
10069
10070 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10071
10072         * ecore.cs:
10073         * expression.cs:
10074         * typemanager.cs: fixes to allow mcs compile corlib with the new
10075         Type.IsSubclassOf fix.
10076
10077 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
10078
10079         * expression.cs (LocalVariableReference.DoResolve): Classify a
10080         constant as a value, not as a variable.   Also, set the type for
10081         the variable.
10082
10083         * cs-parser.jay (fixed_statement): take a type instead of a
10084         pointer_type, so we can produce a better error message later.
10085
10086         * statement.cs (Fixed.Resolve): Flag types that are not pointers
10087         as an error.  
10088
10089         (For.DoEmit): Make inifinite loops have a
10090         non-conditional branch back.
10091
10092         (Fixed.DoEmit): First populate the pinned variables, then emit the
10093         statement, then clear the variables.  Before I was emitting the
10094         code once for each fixed piece.
10095
10096
10097 2003-01-08  Martin Baulig  <martin@ximian.com>
10098
10099         * statement.cs (FlowBranching.MergeChild): A break in a
10100         SWITCH_SECTION does not leave a loop.  Fixes #36155.
10101
10102 2003-01-08  Martin Baulig  <martin@ximian.com>
10103
10104         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
10105         lives in the same number space than `param_map'.  Fixes #36154.
10106
10107 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
10108
10109         * cs-parser.jay (constructor_declaration): Set the
10110         Constructor.ModFlags before probing for it.  This makes the
10111         compiler report 514, 515 and 132 (the code was there, but got
10112         broken). 
10113
10114         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
10115         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
10116         (GotoCase.Resolve): Set `Returns' to ALWAYS.
10117
10118 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
10119
10120         * enum.cs: create the enum static fields using the enum type.
10121
10122 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
10123
10124         * class.cs: don't try to create the ParamBuilder for the return
10125         type if it's not needed (and handle it breaking for the ms runtime
10126         anyway).
10127
10128 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
10129
10130         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
10131
10132 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
10133
10134         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
10135         the command.   This showed up while compiling the JANET source
10136         code, which used \r as its only newline separator.
10137
10138 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
10139
10140         * class.cs (Method.Define): If we are an operator (because it
10141         reuses our code), then set the SpecialName and HideBySig.  #36128
10142
10143 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
10144
10145         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
10146         exception, report error 120 `object reference required'.
10147
10148         * driver.cs: Add --pause option, used during to measure the size
10149         of the process as it goes with --timestamp.
10150
10151         * expression.cs (Invocation.DoResolve): Do not allow methods with
10152         SpecialName to be invoked.
10153
10154 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
10155
10156         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
10157         number before adding it.
10158
10159 2002-12-21  Ravi Pratap  <ravi@ximian.com>
10160
10161         * ecore.cs (StandardImplicitConversion): When in an unsafe
10162         context, we allow conversion between void * to any other pointer
10163         type. This fixes bug #35973.
10164
10165 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
10166
10167         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
10168         is not thrown when extensionless outputs are used 
10169
10170 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10171
10172         * rootcontext.cs: fixed compilation of corlib.
10173
10174 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
10175
10176         * attribute.cs (Attributes.Contains): Add new method.
10177
10178         * class.cs (MethodCore.LabelParameters): if the parameter is an
10179         `out' parameter, check that no attribute `[In]' has been passed.
10180
10181         * enum.cs: Handle the `value__' name in an enumeration.
10182
10183 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
10184
10185         * decl.cs: Added special case to allow overrides on "protected
10186         internal" methods
10187
10188 2002-12-18  Ravi Pratap  <ravi@ximian.com>
10189
10190         * attribute.cs (Attributes.AddAttributeSection): Rename to this
10191         since it makes much more sense.
10192
10193         (Attributes.ctor): Don't require a Location parameter.
10194
10195         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
10196
10197         * attribute.cs (ApplyAttributes): Remove extra Location parameters
10198         since we already have that information per attribute.
10199
10200         * everywhere : make appropriate changes.
10201
10202         * class.cs (LabelParameters): Write the code which actually
10203         applies attributes to the return type. We can't do this on the MS
10204         .NET runtime so we flag a warning in the case an exception is
10205         thrown.
10206
10207 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
10208
10209         * const.cs: Handle implicit null conversions here too.
10210
10211 2002-12-17  Ravi Pratap  <ravi@ximian.com>
10212
10213         * class.cs (MethodCore.LabelParameters): Remove the extra
10214         Type [] parameter since it is completely unnecessary. Instead
10215         pass in the method's attributes so that we can extract
10216         the "return" attribute.
10217
10218 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
10219
10220         * cs-parser.jay (parse): Use Report.Error to flag errors instead
10221         of ignoring it and letting the compile continue.
10222
10223         * typemanager.cs (ChangeType): use an extra argument to return an
10224         error condition instead of throwing an exception.
10225
10226 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
10227
10228         * expression.cs (Unary.TryReduce): mimic the code for the regular
10229         code path.  Perform an implicit cast in the cases where we can
10230         implicitly convert to one of the integral types, and then reduce
10231         based on that constant.   This fixes bug #35483.
10232
10233 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10234
10235         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
10236
10237 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10238
10239         * namespace.cs: fixed bug #35489.
10240
10241 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
10242
10243         * class.cs: Remove some dead code.
10244
10245         * cs-parser.jay: Estimate the number of methods needed
10246         (RootContext.MethodCount);
10247
10248         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
10249         numbers instead of StringBuilders.
10250
10251         * support.cs (PtrHashtable): Add constructor with initial size;
10252         We can now reduce reallocations of the method table.
10253
10254 2002-12-10  Ravi Pratap  <ravi@ximian.com>
10255
10256         * attribute.cs (ApplyAttributes): Keep track of the emitted
10257         attributes on a per-target basis. This fixes bug #35413.
10258
10259 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
10260
10261         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
10262         default to the Windows 1252 encoding.
10263
10264         (UnixParseOption): Support version, thanks to Alp for the missing
10265         pointer. 
10266
10267         * AssemblyInfo.cs: Add nice assembly information.
10268
10269         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
10270         (bug 35169).
10271
10272         * cs-parser.jay: Allow a trailing comma before the close bracked
10273         in the attribute_section production.
10274
10275         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
10276         address of the instance was being taken, I will take this out,
10277         because we take the address of the object immediately here.
10278
10279 2002-12-09  Ravi Pratap  <ravi@ximian.com>
10280
10281         * typemanager.cs (AreMultipleAllowed): Take care of the most
10282         obvious case where attribute type is not in the current assembly -
10283         stupid me ;-)
10284
10285 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
10286
10287         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
10288         definitions, instead of doing that afterwards.  
10289
10290         Also we use a nice little hack, depending on the constructor, we
10291         know if we are a "composed" name or a simple name.  Hence, we
10292         avoid the IndexOf test, and we avoid 
10293
10294         * codegen.cs: Add code to assist in a bug reporter to track down
10295         the source of a compiler crash. 
10296
10297 2002-12-07  Ravi Pratap  <ravi@ximian.com>
10298
10299         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
10300         types have been emitted for a given element and flag an error
10301         if something which does not have AllowMultiple set is used more
10302         than once.
10303
10304         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
10305         attribute types and their corresponding AllowMultiple properties
10306
10307         (AreMultipleAllowed): Check the property for a given type.
10308
10309         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
10310         property in the case we have a TypeContainer.
10311
10312         (Attributes.AddAttribute): Detect duplicates and just skip on
10313         adding them. This trivial fix catches a pretty gross error in our
10314         attribute emission - global attributes were being emitted twice!
10315
10316         Bugzilla bug #33187 is now fixed.
10317
10318 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
10319
10320         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
10321         instead of pp_and).
10322
10323         * expression.cs (Binary.ResolveOperator): I can only use the
10324         Concat (string, string, string) and Concat (string, string,
10325         string, string) if the child is actually a concatenation of
10326         strings. 
10327
10328 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
10329
10330         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
10331         context where we need a 2-character lookahead.
10332
10333         * pending.cs (PendingImplementation): Rework so we can keep track
10334         of interface types all the time, and flag those which were
10335         implemented by parents as optional.
10336
10337 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
10338
10339         * expression.cs (Binary.ResolveOperator): Use
10340         String.Concat(string,string,string) or
10341         String.Concat(string,string,string,string) when possible. 
10342
10343         * typemanager: More helper methods.
10344
10345
10346 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
10347
10348         * pending.cs: remove the bogus return from GetMissingInterfaces()
10349         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
10350
10351 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10352
10353         * namespace.cs: avoid duplicated 'using xxx' being added to
10354         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
10355         when we get more than one 'using' statement for the same namespace.
10356         Report a CS0105 warning for it.
10357
10358 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
10359
10360         * cs-tokenizer.cs (consume_identifier): use read directly, instead
10361         of calling getChar/putback, uses internal knowledge of it.    
10362
10363         (xtoken): Reorder tokenizer so most common patterns are checked
10364         first.  This reduces the compilation time in another 5% (from 8.11s
10365         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
10366
10367         The parsing time is 22% of the compilation in mcs, and from that
10368         64% is spent on the tokenization process.  
10369
10370         I tried using a binary search for keywords, but this is slower
10371         than the hashtable.  Another option would be to do a couple of
10372         things:
10373
10374                 * Not use a StringBuilder, instead use an array of chars,
10375                   with a set value.  Notice that this way we could catch
10376                   the 645 error without having to do it *afterwards*.
10377
10378                 * We could write a hand-parser to avoid the hashtable
10379                   compares altogether.
10380
10381         The identifier consumption process takes 37% of the tokenization
10382         time.  Another 15% is spent on is_number.  56% of the time spent
10383         on is_number is spent on Int64.Parse:
10384
10385                 * We could probably choose based on the string length to
10386                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
10387                   computations. 
10388
10389         Another 3% is spend on wrapping `xtoken' in the `token' function.
10390
10391         Handle 0xa0 as whitespace (#34752)
10392
10393 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
10394
10395         * typemanager.cs (IsCLRType): New routine to tell whether a type
10396         is one of the builtin types.  
10397
10398         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
10399         typecode in more places instead of doing pointer comparissions.
10400         We could leverage some knowledge about the way the typecodes are
10401         laid out.
10402
10403         New code to cache namespaces in assemblies, it is currently not
10404         invoked, to be used soon.
10405
10406         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
10407
10408         * expression.cs (Binary.ResolveOperator): specially handle
10409         strings, and do not perform user-defined operator overloading for
10410         built-in types.
10411
10412 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
10413
10414         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
10415         internalcall as it is a pretty simple operation;  Avoid whenever
10416         possible to call Char.IsLetter.
10417
10418         (consume_identifier): Cut by half the number of
10419         hashtable calls by merging the is_keyword and GetKeyword behavior.
10420
10421         Do not short-circuit, because if we do, we
10422         report errors (ie, #if false && true would produce an invalid
10423         directive error);
10424
10425
10426 2002-11-24  Martin Baulig  <martin@ximian.com>
10427
10428         * expression.cs (Cast.TryReduce): If we're in checked syntax,
10429         check constant ranges and report a CS0221.  Fixes #33186.
10430
10431 2002-11-24  Martin Baulig  <martin@ximian.com>
10432
10433         * cs-parser.jay: Make this work for uninitialized variable
10434         declarations in the `for' initializer.  Fixes #32416.
10435
10436 2002-11-24  Martin Baulig  <martin@ximian.com>
10437
10438         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
10439         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
10440
10441 2002-11-24  Martin Baulig  <martin@ximian.com>
10442
10443         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
10444         argument; if true, we also check for user-defined conversions.
10445         This is only needed if both arguments are of a user-defined type.
10446         Fixes #30443, added test-175.cs.
10447         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
10448
10449         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
10450
10451 2002-11-24  Martin Baulig  <martin@ximian.com>
10452
10453         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
10454         function to get the store opcode.
10455         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
10456         only emit the Ldelema if the store opcode is Stobj.  You must run
10457         both test-34 and test-167 to test this.  Fixes #34529.
10458
10459 2002-11-23  Martin Baulig  <martin@ximian.com>
10460
10461         * ecore.cs (Expression.MemberLookup): Added additional
10462         `qualifier_type' argument which is used when we're being called
10463         from MemberAccess.DoResolve() and null if we're called from a
10464         SimpleName lookup.
10465         (Expression.MemberLookupFailed): New method to report errors; this
10466         does the CS1540 check and reports the correct error message.
10467
10468         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
10469         argument for the CS1540 check and redone the way how we're dealing
10470         with private members.  See the comment in the source code for details.
10471         (FilterWithClosure): Reverted this back to revision 1.197; renamed
10472         `closure_start_type' to `closure_qualifier_type' and check whether
10473         it's not null.  It was not this filter being broken, it was just
10474         being called with the wrong arguments.
10475
10476         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
10477         and pass it the correct `qualifier_type'; this also does the error
10478         handling for us.
10479
10480 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
10481
10482         * expression.cs (Invocation.EmitParams): If the we are dealing
10483         with a non-built-in value type, load its address as well.
10484
10485         (ArrayCreation): Use a a pretty constant instead
10486         of the hardcoded value 2.   Use 6 instead of 2 for the number of
10487         static initializers.  
10488
10489         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
10490         because they are not really value types, just glorified integers. 
10491
10492         * driver.cs: Do not append .exe, the CSC compiler does not do it.
10493
10494         * ecore.cs: Remove redundant code for enumerations, make them use
10495         the same code path as everything else, fixes the casting issue
10496         with enumerations in Windows.Forms.
10497
10498         * attribute.cs: Do only cast to string if it is a string, the
10499         validation happens later.
10500
10501         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
10502         people upgrade their corlibs.
10503
10504         * ecore.cs: Oops, enumerations were not following the entire code path
10505
10506 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
10507
10508         * typemanager.cs (FilterWithClosure): Commented out the test for
10509         1540 in typemanager.cs, as it has problems when accessing
10510         protected methods from a parent class (see test-174.cs). 
10511
10512         * attribute.cs (Attribute.ValidateGuid): new method.
10513         (Attribute.Resolve): Use above.
10514
10515 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
10516
10517         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
10518
10519         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
10520         handling for enumerations, as we only needed the TypeContainer
10521         functionality to begin with (this is required for the fix below to
10522         work for enums that reference constants in a container class for
10523         example). 
10524
10525         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
10526
10527         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
10528         a valid TypeBuilder to perform lookups on.o
10529
10530         * class.cs (InheritableMemberSignatureCompare): Use true in the
10531         call to GetGetMethod and GetSetMethod, because we are comparing
10532         the signature, and we need to get the methods *even* if they are
10533         private. 
10534
10535         (PropertyBase.CheckBase): ditto.
10536
10537         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
10538         GotoCase.Resolve): Use Peel on EmpytCasts.
10539
10540         * ecore.cs (EmptyCast): drop child, add Peel method.
10541
10542 2002-11-17  Martin Baulig  <martin@ximian.com>
10543
10544         * ecore.cs (EmptyCast.Child): New public property.
10545
10546         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
10547         label resolved to an EmptyCast.  Fixes #34162.
10548         (GotoCase.Resolve): Likewise.
10549         (Block.EmitMeta): Likewise.
10550
10551 2002-11-17  Martin Baulig  <martin@ximian.com>
10552
10553         * expression.cs (Invocation.BetterConversion): Prefer int over
10554         uint; short over ushort; long over ulong for integer literals.
10555         Use ImplicitConversionExists instead of StandardConversionExists
10556         since we also need to check for user-defined implicit conversions.
10557         Fixes #34165.  Added test-173.cs.
10558
10559 2002-11-16  Martin Baulig  <martin@ximian.com>
10560
10561         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
10562         with the `true' and `false' literals.  Fixes #33151.
10563
10564 2002-11-16  Martin Baulig  <martin@ximian.com>
10565
10566         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
10567         October 22nd; don't do the cs1540 check for static members.
10568
10569         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
10570         now using our own filter here and doing the cs1540 check again.
10571
10572 2002-11-16  Martin Baulig  <martin@ximian.com>
10573
10574         * support.cs (InternalParameters): Don't crash if we don't have
10575         any fixed parameters.  Fixes #33532.
10576
10577 2002-11-16  Martin Baulig  <martin@ximian.com>
10578
10579         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
10580         when looking up static methods to make this work on Windows.
10581         Fixes #33773.
10582
10583 2002-11-16  Martin Baulig  <martin@ximian.com>
10584
10585         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
10586         a setter rather than using PropertyInfo.CanWrite.
10587
10588 2002-11-15  Nick Drochak  <ndrochak@gol.com>
10589
10590         * class.cs: Allow acces to block member by subclasses. Fixes build
10591         breaker.
10592
10593 2002-11-14  Martin Baulig  <martin@ximian.com>
10594
10595         * class.cs (Constructor.Emit): Added the extern/block check.
10596         Fixes bug #33678.
10597
10598 2002-11-14  Martin Baulig  <martin@ximian.com>
10599
10600         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
10601         iteration while looking for indexers, this is needed because the
10602         indexer may have a different name in our base classes.  Fixed the
10603         error reporting (no indexers at all, not get accessor, no
10604         overloaded match).  Fixes bug #33089.
10605         (IndexerAccess.DoResolveLValue): Likewise.
10606
10607 2002-11-14  Martin Baulig  <martin@ximian.com>
10608
10609         * class.cs (PropertyBase.CheckBase): Make this work for multiple
10610         indexers.  Fixes the first part of bug #33089.
10611         (MethodSignature.InheritableMemberSignatureCompare): Added support
10612         for properties.
10613
10614 2002-11-13  Ravi Pratap  <ravi@ximian.com>
10615
10616         * attribute.cs (Attribute.Resolve): Catch the
10617         NullReferenceException and report it since it isn't supposed to
10618         happen. 
10619
10620 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
10621
10622         * expression.cs (Binary.EmitBranchable): Also handle the cases for
10623         LogicalOr and LogicalAnd that can benefit from recursively
10624         handling EmitBranchable.  The code now should be nice for Paolo.
10625
10626 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
10627
10628         * typemanager.cs (LookupType): Added a negative-hit hashtable for
10629         the Type lookups, as we perform quite a number of lookups on
10630         non-Types.  This can be removed once we can deterministically tell
10631         whether we have a type or a namespace in advance.
10632
10633         But this might require special hacks from our corlib.
10634
10635         * TODO: updated.
10636
10637         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
10638         and double which avoids a conversion from an integer to a double.
10639
10640         * expression.cs: tiny optimization, avoid calling IsConstant,
10641         because it effectively performs the lookup twice.
10642
10643 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
10644
10645         But a bogus return here to keep the semantics of the old code
10646         until the Mono runtime is fixed.
10647
10648         * pending.cs (GetMissingInterfaces): New method used to remove all
10649         the interfaces that are already implemented by our parent
10650         classes from the list of pending methods. 
10651
10652         * interface.cs: Add checks for calls after ResolveTypeExpr.
10653
10654 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
10655
10656         * class.cs (Class.Emit): Report warning 67: event not used if the
10657         warning level is beyond 3.
10658
10659         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
10660         being a NullLiteral.
10661
10662         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
10663         specifiers. 
10664
10665         * class.cs (TypeContainer.GetClassBases): Cover a missing code
10666         path that might fail if a type can not be resolved.
10667
10668         * expression.cs (Binary.Emit): Emit unsigned versions of the
10669         operators. 
10670
10671         * driver.cs: use error 5.
10672
10673 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
10674
10675         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
10676
10677 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
10678
10679         * cs-parser.jay (switch_section): A beautiful patch from Martin
10680         Baulig that fixed 33094.
10681
10682 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
10683
10684         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
10685         Check whether the base is abstract and report an error if so.
10686
10687         * expression.cs (IndexerAccess.DoResolveLValue,
10688         IndexerAccess.DoResolve): ditto. 
10689
10690         (Invocation.DoResolve): ditto.
10691
10692         (Invocation.FullMethodDesc): Improve the report string.
10693
10694         * statement.cs (Block): Eliminate IsVariableDefined as it is
10695         basically just a wrapper for GetVariableInfo.
10696
10697         * ecore.cs (SimpleName): Use new 
10698
10699         * support.cs (ReflectionParamter.ParameterType): We unwrap the
10700         type, as we return the actual parameter ref/unref state on a
10701         different call.
10702
10703 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
10704
10705         * support.cs: Return proper flags REF/OUT fixing the previous
10706         commit.  
10707
10708         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
10709         not used to mean `ref' but `ref or out' in ParameterReference
10710
10711         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
10712         full type signature instead of calling TypeManger.CSharpName
10713         ourselves. 
10714
10715         * support.cs (InternalParameters.ParameterDesc): Do not compare
10716         directly to the modflags, because REF/OUT will actually be bitsets
10717         if set. 
10718
10719         * delegate.cs (VerifyMethod): Check also the modifiers.
10720
10721         * cs-tokenizer.cs: Fix bug where floating point values with an
10722         exponent where a sign was missing was ignored.
10723
10724         * driver.cs: Allow multiple assemblies to be specified in a single
10725         /r: argument
10726
10727 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
10728
10729         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
10730         because identifiers after a parenthesis would end up in this kind
10731         of production, and we needed to desamiguate it for having casts
10732         like:
10733
10734                 (UserDefinedType *) xxx
10735
10736 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
10737
10738         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
10739         we should set on the Bindingflags.NonPublic, but not turn on
10740         private_ok.  private_ok controls whether a Private member is
10741         returned (this is chekced on the filter routine), while the
10742         BindingFlags.NonPublic just controls whether private/protected
10743         will be allowed.   This fixes the problem part of the problem of
10744         private properties being allowed to be used in derived classes.
10745
10746         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
10747         so we can call the children DoResolveLValue method (this will
10748         properly signal errors on lvalue assignments to base properties)
10749
10750         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
10751         getter are null, and we have a property info, we know that this
10752         happened because the lookup failed, so we report an error 122 for
10753         protection level violation.
10754
10755         We also silently return if setter and getter are null in the
10756         resolve functions, this condition only happens if we have flagged
10757         the error before.  This is the other half of the problem. 
10758
10759         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
10760         not have accessibility information, that is why we were returning
10761         true in the filter function in typemanager.cs.
10762
10763         To properly report 122 (property is inaccessible because of its
10764         protection level) correctly, we report this error in ResolveAccess
10765         by failing if both the setter and the getter are lacking (ie, the
10766         lookup failed). 
10767
10768         DoResolve and DoLResolve have been modified to check for both
10769         setter/getter being null and returning silently, the reason being
10770         that I did not want to put the knowledge about this error in upper
10771         layers, like:
10772
10773         int old = Report.Errors;
10774         x = new PropertyExpr (...);
10775         if (old != Report.Errors)
10776                 return null;
10777         else
10778                 return x;
10779
10780         So the property expr is returned, but it is invalid, so the error
10781         will be flagged during the resolve process. 
10782
10783         * class.cs: Remove InheritablePropertySignatureCompare from the
10784         class, as we no longer depend on the property signature to compute
10785         whether it is possible to implement a method or not.
10786
10787         The reason is that calling PropertyInfo.GetGetMethod will return
10788         null (in .NET, in Mono it works, and we should change this), in
10789         cases where the Get Method does not exist in that particular
10790         class.
10791
10792         So this code:
10793
10794         class X { public virtual int A { get { return 1; } } }
10795         class Y : X { }
10796         class Z : Y { public override int A { get { return 2; } } }
10797
10798         Would fail in Z because the parent (Y) would not have the property
10799         defined.  So we avoid this completely now (because the alternative
10800         fix was ugly and slow), and we now depend exclusively on the
10801         method names.
10802
10803         (PropertyBase.CheckBase): Use a method-base mechanism to find our
10804         reference method, instead of using the property.
10805
10806         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
10807         routines are gone now.
10808
10809         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
10810         names, they were incorrectly named.
10811
10812         * cs-tokenizer.cs: Return are more gentle token on failure. 
10813
10814         * pending.cs (PendingImplementation.InterfaceMethod): This routine
10815         had an out-of-sync index variable, which caused it to remove from
10816         the list of pending methods the wrong method sometimes.
10817
10818 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
10819
10820         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
10821         CanWrite, because those refer to this particular instance of the
10822         property, and do not take into account the fact that we can
10823         override single members of a property.
10824
10825         Constructor requires an EmitContext.  The resolution process does
10826         not happen here, but we need to compute the accessors before,
10827         because the resolution does not always happen for properties.
10828
10829         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
10830         subclass, before we did not update this flag, but we did update
10831         bindingflags. 
10832
10833         (GetAccessors): Drop this routine, as it did not work in the
10834         presence of partially overwritten set/get methods. 
10835
10836         Notice that this broke the cs1540 detection, but that will require
10837         more thinking. 
10838
10839 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10840
10841         * class.cs:
10842         * codegen.cs:
10843         * driver.cs: issue a warning instead of an error if we don't support
10844         debugging for the platform. Also ignore a couple of errors that may
10845         arise when trying to write the symbols. Undo my previous patch.
10846
10847 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10848
10849         * driver.cs: ignore /debug switch except for Unix platforms.
10850
10851 2002-10-23  Nick Drochak  <ndrochak@gol.com>
10852
10853         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
10854
10855 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
10856
10857         * driver.cs: Do not make mcs-debug conditional, so we do not break
10858         builds that use it.
10859
10860         * statement.cs (UsageVector.MergeChildren): I would like Martin to
10861         review this patch.  But basically after all the children variables
10862         have been merged, the value of "Breaks" was not being set to
10863         new_breaks for Switch blocks.  I think that it should be set after
10864         it has executed.  Currently I set this to the value of new_breaks,
10865         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
10866         conservative, but I do not understand this code very well.
10867
10868         I did not break anything in the build, so that is good ;-)
10869
10870         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
10871
10872 2002-10-20  Mark Crichton  <crichton@gimp.org>
10873
10874         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
10875
10876 2002-10-20  Nick Drochak  <ndrochak@gol.com>
10877
10878         * cfold.cs: Fixed compile blocker.
10879
10880 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
10881
10882         * driver.cs: I was chekcing the key, not the file.
10883
10884 2002-10-19  Ravi Pratap  <ravi@ximian.com>
10885
10886         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
10887         message that we were generating - we just need to silently return
10888         a null.
10889
10890 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
10891
10892         * class.cs (Event.Define): Change my previous commit, as this
10893         breaks the debugger.  This is a temporary hack, as it seems like
10894         the compiler is generating events incorrectly to begin with.
10895
10896         * expression.cs (Binary.ResolveOperator): Added support for 
10897         "U operator - (E x, E y)"
10898
10899         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
10900         y)".
10901
10902         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
10903         init-only variables, but this path did not take into account that
10904         there might be also instance readonly variables.  Correct this
10905         problem. 
10906
10907         This fixes bug 32253
10908
10909         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
10910         delegates as well.
10911
10912         * driver.cs: Change the extension for modules to `netmodule'
10913
10914         * cs-parser.jay: Improved slightly the location tracking for
10915         the debugger symbols.
10916
10917         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
10918         modifiers that were specified instead of the hardcoded value
10919         (FamAndAssem).  This was basically ignoring the static modifier,
10920         and others.  Fixes 32429.
10921
10922         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
10923         fixed a bug in the process (32476)
10924
10925         * expression.cs (ArrayAccess.EmitAssign): Patch from
10926         hwang_rob@yahoo.ca that fixes bug 31834.3
10927
10928 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
10929
10930         * driver.cs: Make the module extension .netmodule.
10931
10932 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
10933
10934         * driver.cs: Report an error if the resource file is not found
10935         instead of crashing.
10936
10937         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
10938         false, like Emit does.
10939
10940 2002-10-16  Nick Drochak  <ndrochak@gol.com>
10941
10942         * typemanager.cs: Remove unused private member.  Also reported mcs
10943         bug to report this as a warning like csc.
10944
10945 2002-10-15  Martin Baulig  <martin@gnome.org>
10946
10947         * statement.cs (Statement.Emit): Made this a virtual method; emits
10948         the line number info and calls DoEmit().
10949         (Statement.DoEmit): New protected abstract method, formerly knows
10950         as Statement.Emit().
10951
10952         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
10953
10954 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
10955
10956         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
10957         have fixed a remaining problem: not every AddXXXX was adding a
10958         fully qualified name.  
10959
10960         Now everyone registers a fully qualified name in the DeclSpace as
10961         being defined instead of the partial name.  
10962
10963         Downsides: we are slower than we need to be due to the excess
10964         copies and the names being registered this way.  
10965
10966         The reason for this is that we currently depend (on the corlib
10967         bootstrap for instance) that types are fully qualified, because
10968         we dump all the types in the namespace, and we should really have
10969         types inserted into the proper namespace, so we can only store the
10970         basenames in the defined_names array.
10971
10972 2002-10-10  Martin Baulig  <martin@gnome.org>
10973
10974         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
10975         from bug #31834, see the bug report for a testcase which is
10976         miscompiled.
10977
10978 2002-10-10  Martin Baulig  <martin@gnome.org>
10979
10980         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
10981         flow analysis code for this.
10982
10983         * statement.cs (Do, While, For): Tell the flow analysis code about
10984         infinite loops.
10985         (FlowBranching.UsageVector): Added support for infinite loops.
10986         (Block.Resolve): Moved the dead code elimination here and use flow
10987         analysis to do it.
10988
10989 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
10990
10991         * class.cs (Field.Define): Catch cycles on struct type
10992         definitions. 
10993
10994         * typemanager.cs (IsUnmanagedtype): Do not recursively check
10995         fields if the fields are static.  We only need to check instance
10996         fields. 
10997
10998         * expression.cs (As.DoResolve): Test for reference type.
10999
11000         * statement.cs (Using.ResolveExpression): Use
11001         ConvertImplicitRequired, not ConvertImplicit which reports an
11002         error on failture
11003         (Using.ResolveLocalVariableDecls): ditto.
11004
11005         * expression.cs (Binary.ResolveOperator): Report errors in a few
11006         places where we had to.
11007
11008         * typemanager.cs (IsUnmanagedtype): Finish implementation.
11009
11010 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
11011
11012         * expression.cs: Use StoreFromPtr instead of extracting the type
11013         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
11014
11015         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
11016         an enumeration value to a System.Enum, but System.Enum is not a
11017         value type, but an class type, so we need to box.
11018
11019         (Expression.ConvertExplicit): One codepath could return
11020         errors but not flag them.  Fix this.  Fixes #31853
11021
11022         * parameter.cs (Resolve): Do not allow void as a parameter type.
11023
11024 2002-10-06  Martin Baulig  <martin@gnome.org>
11025
11026         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
11027         if it's a class type and not a struct.  Fixes #31815.
11028
11029 2002-10-06  Martin Baulig  <martin@gnome.org>
11030
11031         * statement.cs: Reworked the flow analysis code a bit to make it
11032         usable for dead code elimination.
11033
11034 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11035
11036         * cs-parser.jay: allow empty source files. Fixes bug #31781.
11037
11038 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11039
11040         * expression.cs (ComposedCast.DoResolveType): A quick workaround
11041         to fix the test 165, will investigate deeper.
11042
11043 2002-10-04  Martin Baulig  <martin@gnome.org>
11044
11045         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
11046         finally blocks actually work.
11047         (Try.Resolve): We don't need to create a sibling for `finally' if
11048         there is no finally block.
11049
11050 2002-10-04  Martin Baulig  <martin@gnome.org>
11051
11052         * class.cs (Constructor.Define): The default accessibility for a
11053         non-default constructor is private, not public.
11054
11055 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
11056
11057         * class.cs (Constructor): Make AllowedModifiers public, add
11058         EXTERN.
11059
11060         * cs-parser.jay: Perform the modifiers test here, as the
11061         constructor for the Constructor class usually receives a zero
11062         because of the way we create it (first we create, later we
11063         customize, and we were never checking the modifiers).
11064
11065         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
11066         is a version of LookupTypeReflection that includes the type-name
11067         cache.  This can be used as a fast path for functions that know
11068         the fully qualified name and are only calling into *.GetType() to
11069         obtain a composed type.
11070
11071         This is also used by TypeManager.LookupType during its type
11072         composition.
11073
11074         (LookupType): We now also track the real type name, as sometimes
11075         we can get a quey for the real type name from things like
11076         ComposedCast.  This fixes bug 31422.
11077
11078         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
11079         complete type fullname, it does not have to go through the type
11080         resolution system to obtain the composed version of the type (for
11081         obtaining arrays or pointers).
11082
11083         (Conditional.Emit): Use the EmitBoolExpression to
11084         generate nicer code, as requested by Paolo.
11085
11086         (ArrayCreation.CheckIndices): Use the patch from
11087         hwang_rob@yahoo.ca to validate the array initializers. 
11088
11089 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
11090
11091         * class.cs (ConstructorInitializer.Emit): simplify code by using
11092         Invocation.EmitCall, and at the same time, fix the bugs in calling
11093         parent constructors that took variable arguments. 
11094
11095         * ecore.cs (Expression.ConvertNumericExplicit,
11096         Expression.ImplicitNumericConversion): Remove the code that
11097         manually wrapped decimal (InternalTypeConstructor call is now gone
11098         as well).
11099
11100         * expression.cs (Cast.TryReduce): Also handle decimal types when
11101         trying to perform a constant fold on the type.
11102
11103         * typemanager.cs (IsUnmanagedtype): Partially implemented.
11104
11105         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
11106         that only turned off an error report, and did nothing else. 
11107
11108 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
11109
11110         * driver.cs: Handle and ignore /fullpaths
11111
11112 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
11113
11114         * expression.cs (Binary.ResolveOperator): Catch the case where
11115         DoNumericPromotions returns true, 
11116
11117         (Binary.DoNumericPromotions): Simplify the code, and the tests.
11118
11119 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
11120
11121         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
11122         report error 70.
11123
11124 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
11125
11126         * ecore.cs (ConvertNumericExplicit): It is not enough that the
11127         conversion exists, but it is also required that the conversion be
11128         performed.  This manifested in "(Type64Enum) 2".  
11129
11130         * class.cs (TypeManager.AddMethod): The fix is not to change
11131         AddEnum, because that one was using a fully qualified name (every
11132         DeclSpace derivative does), but to change the AddMethod routine
11133         that was using an un-namespaced name.  This now correctly reports
11134         the duplicated name.
11135
11136         Revert patch until I can properly fix it.  The issue
11137         is that we have a shared Type space across all namespaces
11138         currently, which is wrong.
11139
11140         Options include making the Namespace a DeclSpace, and merge
11141         current_namespace/current_container in the parser.
11142
11143 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
11144
11145         * cs-parser.jay: Improve error reporting when we get a different
11146         kind of expression in local_variable_type and
11147         local_variable_pointer_type. 
11148
11149         Propagate this to avoid missleading errors being reported.
11150
11151         * ecore.cs (ImplicitReferenceConversion): treat
11152         TypeManager.value_type as a target just like object_type.   As
11153         code like this:
11154
11155         ValueType v = 1;
11156
11157         Is valid, and needs to result in the int 1 being boxed before it
11158         is assigned to the value type v.
11159
11160         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
11161         to validate the enumeration name.
11162
11163         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
11164         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
11165         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
11166
11167         * ecore.cs (TryImplicitIntConversion): When doing an
11168         implicit-enumeration-conversion, check if the type is 64-bits and
11169         perform a conversion before passing to EnumConstant.
11170
11171 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
11172
11173         * decl.cs (Error_AmbiguousTypeReference); New routine used to
11174         report ambiguous type references.  Unlike the MS version, we
11175         report what the ambiguity is.   Innovation at work ;-)
11176
11177         (DeclSpace.FindType): Require a location argument to
11178         display when we display an ambiguous error.
11179
11180         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
11181
11182         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
11183
11184         * expression.cs (EmitDynamicInitializers): Apply patch from
11185         hwang_rob@yahoo.ca that fixes the order in which we emit our
11186         initializers. 
11187
11188 2002-09-21  Martin Baulig  <martin@gnome.org>
11189
11190         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
11191         delegate takes no arguments.
11192
11193 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
11194
11195         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
11196         from integers.
11197
11198         * expression.cs: Extract the underlying type.
11199
11200         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
11201
11202         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
11203
11204 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
11205
11206         * class.cs (TypeContainer.DefineType): We can not use the nice
11207         PackingSize with the size set to 1 DefineType method, because it
11208         will not allow us to define the interfaces that the struct
11209         implements.
11210
11211         This completes the fixing of bug 27287
11212
11213         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
11214         means also structs.  This fixes part of the problem. 
11215         (Expresion.ImplicitReferenceConversionExists): ditto.
11216
11217         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
11218         error if there were no errors reported during the type lookup
11219         process, to avoid duplicates or redundant errors.  Without this
11220         you would get an ambiguous errors plus a type not found.  We have
11221         beaten the user enough with the first error.  
11222
11223         (DeclSparce.FindType): Emit a warning if we have an ambiguous
11224         reference. 
11225
11226         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
11227         during the resolution process, stop the lookup, this avoids
11228         repeated error reports (same error twice).
11229
11230         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
11231
11232         * typemanager.cs (LookupType): Redo the type lookup code to match
11233         the needs of System.Reflection.  
11234
11235         The issue is that System.Reflection requires references to nested
11236         types to begin with a "+" sign instead of a dot.  So toplevel
11237         types look like: "NameSpace.TopLevelClass", and nested ones look
11238         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
11239         levels. 
11240
11241 2002-09-19  Martin Baulig  <martin@gnome.org>
11242
11243         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
11244         says that a method always returns or always throws an exception,
11245         don't report the CS0161.
11246
11247         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
11248         set `Returns = new_returns'.
11249
11250 2002-09-19  Martin Baulig  <martin@gnome.org>
11251
11252         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
11253         to an enum constant, check for a CS0176.
11254
11255 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
11256
11257         * class.cs (TypeContainer.CheckPairedOperators): Now we check
11258         for operators that must be in pairs and report errors.
11259
11260         * ecore.cs (SimpleName.DoResolveType): During the initial type
11261         resolution process, when we define types recursively, we must
11262         check first for types in our current scope before we perform
11263         lookups in the enclosing scopes.
11264
11265         * expression.cs (MakeByteBlob): Handle Decimal blobs.
11266
11267         (Invocation.VerifyArgumentsCompat): Call
11268         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
11269         I thought we were supposed to always call this, but there are a
11270         few places in the code where we dont do it.
11271
11272 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
11273
11274         * driver.cs: Add support in -linkres and -resource to specify the
11275         name of the identifier.
11276
11277 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11278
11279         * ecore.cs (StandardConversionExists): Sync with the conversion
11280         code: allow anything-* to void* conversions.
11281
11282         (FindMostSpecificSource): Use an Expression argument
11283         instead of a Type, because we might be handed over a Literal which
11284         gets a few more implicit conversions that plain types do not.  So
11285         this information was being lost.
11286
11287         Also, we drop the temporary type-holder expression when not
11288         required.
11289
11290 2002-09-17  Martin Baulig  <martin@gnome.org>
11291
11292         * class.cs (PropertyBase.CheckBase): Don't check the base class if
11293         this is an explicit interface implementation.
11294
11295 2002-09-17  Martin Baulig  <martin@gnome.org>
11296
11297         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
11298         different `IndexerName' attributes.
11299
11300         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
11301         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
11302         virtual CommonResolve().
11303
11304 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
11305
11306         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
11307         and convert that to the UnderlyingType.
11308
11309         * statement.cs (Foreach.Resolve): Indexers are just like variables
11310         or PropertyAccesses.
11311
11312         * cs-tokenizer.cs (consume_string): Track line numbers and columns
11313         inside quoted strings, we were not doing this before.
11314
11315 2002-09-16  Martin Baulig  <martin@gnome.org>
11316
11317         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
11318         resolve it.  This is needed for the definite assignment check of the
11319         instance expression, fixes bug #29846.
11320         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
11321
11322 2002-09-16  Nick Drochak  <ndrochak@gol.com>
11323
11324         * parameter.cs: Fix compile error.  Cannot reference static member
11325         from an instance object.  Is this an mcs bug?
11326
11327 2002-09-14  Martin Baulig  <martin@gnome.org>
11328
11329         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
11330         multiple times.  Fixes bug #30295, added test-166.cs.
11331
11332 2002-09-14  Martin Baulig  <martin@gnome.org>
11333
11334         * statement.cs (Block.Emit): Don't emit unreachable code.
11335         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
11336         `break' statements.
11337         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
11338
11339 2002-09-14  Martin Baulig  <martin@gnome.org>
11340
11341         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
11342         is set.
11343
11344 2002-09-14  Martin Baulig  <martin@gnome.org>
11345
11346         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
11347         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
11348         be false on the ms runtime.
11349
11350 2002-09-13  Martin Baulig  <martin@gnome.org>
11351
11352         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
11353         the CS0038 error message.
11354
11355 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
11356
11357         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
11358         constant inside, return it.
11359
11360 2002-09-12  Martin Baulig  <martin@gnome.org>
11361
11362         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
11363         implicit conversion can be done between enum types.
11364
11365         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
11366         check whether an implicit conversion to the current enum's UnderlyingType
11367         exists and report an error if not.
11368
11369         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
11370         without debugging support.
11371
11372         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
11373         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
11374
11375 2002-09-12  Martin Baulig  <martin@gnome.org>
11376
11377         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
11378
11379         * ecore.cs (IMemberExpr.DeclaringType): New property.
11380         (SimpleName.SimpleNameResolve): Check whether we're accessing a
11381         nonstatic member of an outer type (CS0038).
11382
11383 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
11384
11385         * driver.cs: Activate the using-error detector at warning level
11386         4 (at least for MS-compatible APIs).
11387
11388         * namespace.cs (VerifyUsing): Small buglett fix.
11389
11390         * pending.cs (PendingImplementation): pass the container pointer. 
11391
11392         * interface.cs (GetMethods): Allow for recursive definition.  Long
11393         term, I would like to move every type to support recursive
11394         definitions, not the current ordering mechanism that we have right
11395         now.
11396
11397         The situation is this: Attributes are handled before interfaces,
11398         so we can apply attributes to interfaces.  But some attributes
11399         implement interfaces, we will now handle the simple cases
11400         (recursive definitions will just get an error).  
11401
11402         * parameter.cs: Only invalidate types at the end if we fail to
11403         lookup all types.  
11404
11405 2002-09-09  Martin Baulig  <martin@gnome.org>
11406
11407         * ecore.cs (PropertyExpr.Emit): Also check for
11408         TypeManager.system_int_array_get_length so this'll also work when
11409         compiling corlib.  Fixes #30003.
11410
11411 2002-09-09  Martin Baulig  <martin@gnome.org>
11412
11413         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
11414         and throw an exception if we can't get the type's size.  Fixed #30040,
11415         added test-165.cs.
11416
11417 2002-09-09  Martin Baulig  <martin@gnome.org>
11418
11419         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
11420
11421         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
11422         context.  Fixes bug #30027.
11423
11424         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
11425         virtual functions.  Fixes bug #30043, added test-164.cs.
11426
11427 2002-09-08  Ravi Pratap  <ravi@ximian.com>
11428
11429         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
11430
11431 2002-09-08  Nick Drochak  <ndrochak@gol.com>
11432
11433         * driver.cs: Use an object to get the windows codepage since it's not a
11434         static property.
11435
11436 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
11437
11438         * statement.cs (For.Emit): for infinite loops (test == null)
11439         return whether there is a break inside, not always "true".
11440
11441         * namespace.cs (UsingEntry): New struct to hold the name of the
11442         using definition, the location where it is defined, and whether it
11443         has been used in a successful type lookup.
11444
11445         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
11446         strings.
11447
11448         * decl.cs: ditto.
11449
11450 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11451
11452         * attribute.cs : Fix incorrect code which relied on catching
11453         a NullReferenceException to detect a null being passed in
11454         where an object was expected.
11455
11456 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
11457
11458         * statement.cs (Try): flag the catch variable as assigned
11459
11460         * expression.cs (Cast): Simplified by using ResolveType instead of
11461         manually resolving.
11462
11463         * statement.cs (Catch): Fix bug by using ResolveType.
11464
11465 2002-09-06  Ravi Pratap  <ravi@ximian.com>
11466
11467         * expression.cs (BetterConversion): Special case for when we have
11468         a NullLiteral as the argument and we have to choose between string
11469         and object types - we choose string the way csc does.
11470
11471         * attribute.cs (Attribute.Resolve): Catch the
11472         NullReferenceException and report error #182 since the Mono
11473         runtime no more has the bug and having this exception raised means
11474         we tried to select a constructor which takes an object and is
11475         passed a null.
11476
11477 2002-09-05  Ravi Pratap  <ravi@ximian.com>
11478
11479         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
11480         message (1502, 1503) when we can't locate a method after overload
11481         resolution. This is much more informative and closes the bug
11482         Miguel reported.
11483
11484         * interface.cs (PopulateMethod): Return if there are no argument
11485         types. Fixes a NullReferenceException bug.
11486
11487         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
11488         expressions too. Previously we were checking only in one place for
11489         positional arguments leaving out named arguments.
11490
11491         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
11492         type to the enum type is not allowed. Remove code corresponding to
11493         that.
11494
11495         (ConvertNumericExplicit): Allow explicit conversions from
11496         the underlying type to enum type. This precisely follows the spec
11497         and closes a bug filed by Gonzalo.
11498
11499 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11500
11501         * compiler.csproj:
11502         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
11503
11504 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
11505
11506         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
11507         it was important that we stored the right value after the
11508         reduction in `converted'.
11509
11510 2002-09-04  Martin Baulig  <martin@gnome.org>
11511
11512         * location.cs (Location.SymbolDocument): Use full pathnames for the
11513         source files.
11514
11515 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
11516
11517         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
11518         of the expression resolve mechanism, because that will catch the
11519         SimpleName error failures.
11520
11521         (Conditional): If we can not resolve the
11522         expression, return, do not crash.
11523
11524 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11525
11526         * cs-tokenizer.cs:
11527         (location): display token name instead of its number.
11528
11529 2002-08-28  Martin Baulig  <martin@gnome.org>
11530
11531         * expression.cs (Binary.ResolveOperator): Don't silently return
11532         but return an error if an operator cannot be applied between two
11533         enum types.
11534
11535 2002-08-28  Martin Baulig  <martin@gnome.org>
11536
11537         * class.cs (Constructor.Define): Set the permission attributes
11538         correctly instead of making all constructors public.
11539
11540 2002-08-28  Martin Baulig  <martin@gnome.org>
11541
11542         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
11543         for private members before reporting a CS0103; if we find anything,
11544         it's a CS0122.
11545
11546 2002-08-28  Martin Baulig  <martin@gnome.org>
11547
11548         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
11549         to check whether `closure_start_type == closure_invocation_type',
11550         we also need to check whether `m.DeclaringType == closure_invocation_type'
11551         before bypassing the permission checks.  We might be accessing
11552         protected/private members from the base class.
11553         (TypeManager.RealMemberLookup): Only set private_ok if private
11554         members were requested via BindingFlags.NonPublic.
11555
11556         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
11557
11558         * expression.cs (MemberAccess.ResolveMemberAccess): Set
11559         MethodGroupExpr.IsExplicitImpl if appropriate.
11560         (Invocation.DoResolve): Don't report the CS0120 for explicit
11561         interface implementations.
11562
11563 2002-08-27  Martin Baulig  <martin@gnome.org>
11564
11565         * expression.cs (Invocation.DoResolve): If this is a static
11566         method and we don't have an InstanceExpression, we must report
11567         a CS0120.
11568
11569 2002-08-25  Martin Baulig  <martin@gnome.org>
11570
11571         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
11572         `==' between a valuetype and an object.
11573
11574 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
11575
11576         * ecore.cs (TypeExpr): Provide a ToString method.
11577
11578 2002-08-24  Martin Baulig  <martin@gnome.org>
11579
11580         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
11581         now called proggie.dbg and it's a binary file.
11582
11583 2002-08-23  Martin Baulig  <martin@gnome.org>
11584
11585         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
11586
11587 2002-08-23  Martin Baulig  <martin@gnome.org>
11588
11589         * struct.cs (MyStructInfo.ctor): Make this work with empty
11590         structs; it's not allowed to use foreach() on null.
11591
11592 2002-08-23  Martin Baulig  <martin@gnome.org>
11593
11594         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
11595         writer the full pathname of the generated assembly.
11596
11597 2002-08-23  Martin Baulig  <martin@gnome.org>
11598
11599         * statements.cs (FlowBranching.UsageVector.MergeChildren):
11600         A `finally' block never returns or breaks; improved handling of
11601         unreachable code.
11602
11603 2002-08-23  Martin Baulig  <martin@gnome.org>
11604
11605         * statement.cs (Throw.Resolve): Allow `throw null'.
11606
11607 2002-08-23  Martin Baulig  <martin@gnome.org>
11608
11609         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
11610         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
11611         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
11612         MemberLookup would return a wrong event if this is an explicit
11613         interface implementation and the class has an event with the same
11614         name.
11615
11616 2002-08-23  Martin Baulig  <martin@gnome.org>
11617
11618         * statement.cs (Block.AddChildVariableNames): New public method.
11619         (Block.AddChildVariableName): Likewise.
11620         (Block.IsVariableNameUsedInChildBlock): Likewise.
11621         (Block.AddVariable): Check whether a variable name has already
11622         been used in a child block.
11623
11624         * cs-parser.jay (declare_local_variables): Mark all variable names
11625         from the current block as being used in a child block in the
11626         implicit block.
11627
11628 2002-08-23  Martin Baulig  <martin@gnome.org>
11629
11630         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
11631         find the symbol writer.
11632
11633         * driver.cs: csc also allows the arguments to /define being
11634         separated by commas, not only by semicolons.
11635
11636 2002-08-23  Martin Baulig  <martin@gnome.org>
11637
11638         * interface.cs (Interface.GetMembers): Added static check for events.
11639
11640 2002-08-15  Martin Baulig  <martin@gnome.org>
11641
11642         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
11643         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
11644
11645         * ecore.cs (Expression.MemberLookup): Added documentation and explained
11646         why the MethodData.EmitDestructor() change was necessary.
11647
11648 2002-08-20  Martin Baulig  <martin@gnome.org>
11649
11650         * class.cs (TypeContainer.FindMembers): Added static check for events.
11651
11652         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
11653
11654         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
11655         use Type.GetEvents(), not Type.FindMembers().
11656
11657 2002-08-20  Martin Baulig  <martin@gnome.org>
11658
11659         * decl.cs (MemberCache): Added a special method cache which will
11660         be used for method-only searched.  This ensures that a method
11661         search will return a MethodInfo with the correct ReflectedType for
11662         inherited methods.      
11663
11664 2002-08-20  Martin Baulig  <martin@gnome.org>
11665
11666         * decl.cs (DeclSpace.FindMembers): Made this public.
11667
11668 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11669
11670         * delegate.cs: fixed build on windows.
11671         [FIXME:  Filed as bug #29150: MCS must report these errors.]
11672
11673 2002-08-19  Ravi Pratap  <ravi@ximian.com>
11674
11675         * ecore.cs (StandardConversionExists): Return a false
11676         if we are trying to convert the void type to anything else
11677         since that is not allowed.
11678
11679         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
11680         we flag error 70 in the event an event is trying to be accessed
11681         directly from outside the declaring type.
11682
11683 2002-08-20  Martin Baulig  <martin@gnome.org>
11684
11685         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
11686         MemberCache from typemanager.cs to decl.cs.
11687
11688 2002-08-19  Martin Baulig  <martin@gnome.org>
11689
11690         * class.cs (TypeContainer): Implement IMemberContainer.
11691         (TypeContainer.DefineMembers): Create the MemberCache.
11692         (TypeContainer.FindMembers): Do better BindingFlags checking; only
11693         return public members if BindingFlags.Public was given, check
11694         whether members are static.
11695
11696 2002-08-16  Martin Baulig  <martin@gnome.org>
11697
11698         * decl.cs (DeclSpace.Define): Splitted this in Define and
11699         DefineMembers.  DefineMembers is called first and initializes the
11700         MemberCache.
11701
11702         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
11703         DefineMembers() on all our DeclSpaces.
11704
11705         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
11706         but call DefineMembers() on all nested interfaces.  We call their
11707         Define() in our new Define() function.
11708
11709         * interface.cs (Interface): Implement IMemberContainer.
11710         (Interface.Define): Moved all code except the attribute stuf to
11711         DefineMembers().
11712         (Interface.DefineMembers): Initialize the member cache.
11713
11714         * typemanager.cs (IMemberFinder): Removed this interface, we don't
11715         need this anymore since we can use MemberCache.FindMembers directly.
11716
11717 2002-08-19  Martin Baulig  <martin@gnome.org>
11718
11719         * typemanager.cs (MemberCache): When creating the cache for an
11720         interface type, add all inherited members.
11721         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
11722         to `out bool used_cache' and documented it.
11723         (TypeManager.MemberLookup): If we already used the cache in the first
11724         iteration, we don't need to do the interfaces check.
11725
11726 2002-08-19  Martin Baulig  <martin@gnome.org>
11727
11728         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
11729         here from IMemberFinder and don't implement this interface anymore.
11730         (DeclSpace.MemberCache): Moved here from IMemberFinder.
11731
11732         * typemanager.cs (IMemberFinder): This interface is now only used by
11733         classes which actually support the member cache.
11734         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
11735         since we only put DeclSpaces into this Hashtable.
11736         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
11737         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
11738
11739 2002-08-16  Martin Baulig  <martin@gnome.org>
11740
11741         * typemanager.cs (ICachingMemberFinder): Removed.
11742         (IMemberFinder.MemberCache): New property.
11743         (TypeManager.FindMembers): Merged this with RealFindMembers().
11744         This function will never be called from TypeManager.MemberLookup()
11745         so we can't use the cache here, just the IMemberFinder.
11746         (TypeManager.MemberLookup_FindMembers): Check whether the
11747         IMemberFinder has a MemberCache and call the cache's FindMembers
11748         function.
11749         (MemberCache): Rewrote larger parts of this yet another time and
11750         cleaned it up a bit.
11751
11752 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
11753
11754         * driver.cs (LoadArgs): Support quoting.
11755
11756         (Usage): Show the CSC-like command line arguments.
11757
11758         Improved a few error messages.
11759
11760 2002-08-15  Martin Baulig  <martin@gnome.org>
11761
11762         * typemanager.cs (IMemberContainer.Type): New property.
11763         (IMemberContainer.IsInterface): New property.
11764
11765         The following changes are conditional to BROKEN_RUNTIME, which is
11766         defined at the top of the file.
11767
11768         * typemanager.cs (MemberCache.MemberCache): Don't add the base
11769         class'es members, but add all members from TypeHandle.ObjectType
11770         if we're an interface.
11771         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
11772         is the current type.
11773         (MemberCache.CacheEntry.Container): Removed this field.
11774         (TypeHandle.GetMembers): Include inherited members.
11775
11776 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11777
11778         * typemanager.cs: fixed compilation and added a comment on a field that
11779         is never used.
11780
11781 2002-08-15  Martin Baulig  <martin@gnome.org>
11782
11783         * class.cs (ConstructorInitializer.Resolve): In the
11784         Expression.MemberLookup call, use the queried_type as
11785         invocation_type.
11786
11787         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
11788         declared' attribute, it's always true.
11789         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
11790         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
11791         temporary wrapper for FindMembers which tells MemberLookup whether
11792         members from the base classes are included in the return value.
11793         This will go away soon.
11794         (TypeManager.MemberLookup): Use this temporary hack here; once the
11795         new MemberCache is completed, we don't need to do the DeclaredOnly
11796         looping here anymore since the MemberCache will take care of this.
11797         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
11798         (MemberCache): When creating the MemberCache for a class, get
11799         members from the current class and all its base classes.
11800         (MemberCache.CacheEntry.Container): New field.  This is a
11801         temporary hack until the Mono runtime is fixed to distinguish
11802         between ReflectedType and DeclaringType.  It allows us to use MCS
11803         with both the MS runtime and the unfixed Mono runtime without
11804         problems and without accecting performance.
11805         (MemberCache.SearchMembers): The DeclaredOnly looping from
11806         TypeManager.MemberLookup is now done here.      
11807
11808 2002-08-14  Martin Baulig  <martin@gnome.org>
11809
11810         * statement.cs (MyStructInfo.MyStructInfo): Don't call
11811         Type.GetFields on dynamic types but get the fields from the
11812         corresponding TypeContainer.
11813         (MyStructInfo.GetStructInfo): Added check for enum types.
11814
11815         * typemanager.cs (MemberList.IsSynchronized): Implemented.
11816         (MemberList.SyncRoot): Implemented.
11817         (TypeManager.FilterWithClosure): No need to check permissions if
11818         closure_start_type == closure_invocation_type, don't crash if
11819         closure_invocation_type is null.
11820
11821 2002-08-13  Martin Baulig  <martin@gnome.org>
11822
11823         Rewrote TypeContainer.FindMembers to use a member cache.  This
11824         gives us a speed increase of about 35% for the self-hosting MCS
11825         build and of about 15-20% for the class libs (both on GNU/Linux).
11826
11827         * report.cs (Timer): New class to get enhanced profiling.  This
11828         whole class is "TIMER" conditional since it remarkably slows down
11829         compilation speed.
11830
11831         * class.cs (MemberList): New class.  This is an IList wrapper
11832         which we're now using instead of passing MemberInfo[]'s around to
11833         avoid copying this array unnecessarily.
11834         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
11835         (ICachingMemberFinder, IMemberContainer): New interface.
11836         (TypeManager.FilterWithClosure): If `criteria' is null, the name
11837         has already been checked, otherwise use it for the name comparision.
11838         (TypeManager.FindMembers): Renamed to RealMemberFinder and
11839         provided wrapper which tries to use ICachingMemberFinder.FindMembers
11840         if possible.  Returns a MemberList, not a MemberInfo [].
11841         (TypeHandle): New class, implements IMemberContainer.  We create
11842         one instance of this class per type, it contains a MemberCache
11843         which is used to do the member lookups.
11844         (MemberCache): New class.  Each instance of this class contains
11845         all members of a type and a name-based hash table.
11846         (MemberCache.FindMembers): This is our new member lookup
11847         function.  First, it looks up all members of the requested name in
11848         the hash table.  Then, it walks this list and sorts out all
11849         applicable members and returns them.
11850
11851 2002-08-13  Martin Baulig  <martin@gnome.org>
11852
11853         In addition to a nice code cleanup, this gives us a performance
11854         increase of about 1.4% on GNU/Linux - not much, but it's already
11855         half a second for the self-hosting MCS compilation.
11856
11857         * typemanager.cs (IMemberFinder): New interface.  It is used by
11858         TypeManager.FindMembers to call FindMembers on a TypeContainer,
11859         Enum, Delegate or Interface.
11860         (TypeManager.finder_to_member_finder): New PtrHashtable.
11861         (TypeManager.finder_to_container): Removed.
11862         (TypeManager.finder_to_delegate): Removed.
11863         (TypeManager.finder_to_interface): Removed.
11864         (TypeManager.finder_to_enum): Removed.
11865
11866         * interface.cs (Interface): Implement IMemberFinder.
11867
11868         * delegate.cs (Delegate): Implement IMemberFinder.
11869
11870         * enum.cs (Enum): Implement IMemberFinder.
11871
11872         * class.cs (TypeContainer): Implement IMemberFinder.
11873
11874 2002-08-12  Martin Baulig  <martin@gnome.org>
11875
11876         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
11877
11878 2002-08-12  Martin Baulig  <martin@gnome.org>
11879
11880         * ecore.cs (ITypeExpression): New interface for expressions which
11881         resolve to a type.
11882         (TypeExpression): Renamed to TypeLookupExpression.
11883         (Expression.DoResolve): If we're doing a types-only lookup, the
11884         expression must implement the ITypeExpression interface and we
11885         call DoResolveType() on it.
11886         (SimpleName): Implement the new ITypeExpression interface.
11887         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
11888         hack, the situation that we're only looking up types can't happen
11889         anymore when this method is called.  Moved the type lookup code to
11890         DoResolveType() and call it.
11891         (SimpleName.DoResolveType): This ITypeExpression interface method
11892         is now doing the types-only lookup.
11893         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
11894         (ResolveFlags): Added MaskExprClass.
11895
11896         * expression.cs (MemberAccess): Implement the ITypeExpression
11897         interface.
11898         (MemberAccess.DoResolve): Added support for a types-only lookup
11899         when we're called via ITypeExpression.DoResolveType().
11900         (ComposedCast): Implement the ITypeExpression interface.
11901
11902         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
11903         Expression.Resolve() with ResolveFlags.Type instead.
11904
11905 2002-08-12  Martin Baulig  <martin@gnome.org>
11906
11907         * interface.cs (Interface.Define): Apply attributes.
11908
11909         * attribute.cs (Attribute.ApplyAttributes): Added support for
11910         interface attributes.
11911
11912 2002-08-11  Martin Baulig  <martin@gnome.org>
11913
11914         * statement.cs (Block.Emit): Only check the "this" variable if we
11915         do not always throw an exception.
11916
11917         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
11918         whether the property has a set accessor.
11919
11920 2002-08-11  Martin Baulig  <martin@gnome.org>
11921
11922         Added control flow analysis support for structs.
11923
11924         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
11925         with control flow analysis turned off.
11926         (IVariable): New interface.
11927         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
11928         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
11929         (FieldExpr.DoResolve): Resolve the instance expression with flow
11930         analysis turned off and do the definite assignment check after the
11931         resolving when we know what the expression will resolve to.
11932
11933         * expression.cs (LocalVariableReference, ParameterReference):
11934         Implement the new IVariable interface, only call the flow analysis
11935         code if ec.DoFlowAnalysis is true.
11936         (This): Added constructor which takes a Block argument.  Implement
11937         the new IVariable interface.
11938         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
11939         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
11940         This does the definite assignment checks for struct members.
11941
11942         * class.cs (Constructor.Emit): If this is a non-static `struct'
11943         constructor which doesn't have any initializer, call
11944         Block.AddThisVariable() to tell the flow analysis code that all
11945         struct elements must be initialized before control returns from
11946         the constructor.
11947
11948         * statement.cs (MyStructInfo): New public class.
11949         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
11950         argument to this indexer.  If non-zero, check an individual struct
11951         member, not the whole struct.
11952         (FlowBranching.CheckOutParameters): Check struct members.
11953         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
11954         overloaded versions of these methods which take an additional
11955         `int field_idx' argument to check struct members.
11956         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
11957         overloaded versions of these methods which take an additional
11958         `string field_name' argument to check struct member.s
11959         (VariableInfo): Implement the IVariable interface.
11960         (VariableInfo.StructInfo): New public property.  Returns the
11961         MyStructInfo instance of the variable if it's a struct or null.
11962         (Block.AddThisVariable): New public method.  This is called from
11963         Constructor.Emit() for non-static `struct' constructor which do
11964         not have any initializer.  It creates a special variable for the
11965         "this" instance variable which will be checked by the flow
11966         analysis code to ensure that all of the struct's fields are
11967         initialized before control returns from the constructor.
11968         (UsageVector): Added support for struct members.  If a
11969         variable/parameter is a struct with N members, we reserve a slot
11970         in the usage vector for each member.  A struct is considered fully
11971         initialized if either the struct itself (slot 0) or all its
11972         members are initialized.
11973
11974 2002-08-08  Martin Baulig  <martin@gnome.org>
11975
11976         * driver.cs (Driver.MainDriver): Only report an error CS5001
11977         if there were no compilation errors.
11978
11979         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
11980         `UnsafeContext' property to determine whether the parent is in
11981         unsafe context rather than checking the parent's ModFlags:
11982         classes nested in an unsafe class are unsafe as well.
11983
11984 2002-08-08  Martin Baulig  <martin@gnome.org>
11985
11986         * statement.cs (UsageVector.MergeChildren): Distinguish between
11987         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
11988         we return.  Added test17() and test18() to test-154.cs.
11989
11990 2002-08-08  Martin Baulig  <martin@gnome.org>
11991
11992         * typemanager.cs (TypeManager.FilterWithClosure): If we have
11993         Family access, make sure the invoking type isn't a subclass of the
11994         queried type (that'd be a CS1540).
11995
11996         * ecore.cs (Expression.MemberLookup): Added overloaded version of
11997         this method which takes an additional `Type invocation_type'.
11998
11999         * expression.cs (BaseAccess.DoResolve): Use the base type as
12000         invocation and query type.
12001         (MemberAccess.DoResolve): If the lookup failed and we're about to
12002         report a CS0122, try a lookup with the ec.ContainerType - if this
12003         succeeds, we must report a CS1540.
12004
12005 2002-08-08  Martin Baulig  <martin@gnome.org>
12006
12007         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
12008         (MethodGroupExpr): Implement the IMemberExpr interface.
12009
12010         * expression (MemberAccess.ResolveMemberAccess): No need to have
12011         any special code for MethodGroupExprs anymore, they're now
12012         IMemberExprs.   
12013
12014 2002-08-08  Martin Baulig  <martin@gnome.org>
12015
12016         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
12017         Family, FamANDAssem and FamORAssem permissions.
12018         (TypeManager.IsSubclassOrNestedChildOf): New public method.
12019
12020 2002-08-08  Martin Baulig  <martin@gnome.org>
12021
12022         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
12023         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
12024         or loop block.
12025
12026 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
12027
12028         * driver.cs: implemented /resource option to embed managed resources.
12029
12030 2002-08-07  Martin Baulig  <martin@gnome.org>
12031
12032         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
12033         (FieldBase.HasFieldInitializer): New public property.
12034         (FieldBase.GetInitializerExpression): New public method.  Resolves and
12035         returns the field initializer and makes sure it is only resolved once.
12036         (TypeContainer.EmitFieldInitializers): Call
12037         FieldBase.GetInitializerExpression to get the initializer, this ensures
12038         that it isn't resolved multiple times.
12039
12040         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
12041         the resolving process (SimpleName/MemberLookup) that we're currently
12042         emitting a field initializer (which must not access any instance members,
12043         this is an error CS0236).
12044
12045         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
12046         argument, if the `IsFieldInitializer' flag is set, we must report and
12047         error CS0236 and not an error CS0120.   
12048
12049 2002-08-07  Martin Baulig  <martin@gnome.org>
12050
12051         * ecore.cs (IMemberExpr): New public interface.
12052         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
12053         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
12054         if the expression is an IMemberExpr.
12055
12056         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
12057         to be null, implicitly default to `this' if we're non-static in
12058         this case.  Simplified the code a lot by using the new IMemberExpr
12059         interface.  Also fixed bug #28176 here.
12060
12061 2002-08-06  Martin Baulig  <martin@gnome.org>
12062
12063         * cs-parser.jay (SimpleLookup): Removed.  We need to create
12064         ParameterReferences during semantic analysis so that we can do a
12065         type-only search when resolving Cast, TypeOf and SizeOf.
12066         (block): Pass the `current_local_parameters' to the Block's
12067         constructor.
12068
12069         * class.cs (ConstructorInitializer): Added `Parameters parameters'
12070         argument to the constructor.
12071         (ConstructorInitializer.Resolve): Create a temporary implicit
12072         block with the parameters.
12073
12074         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
12075         references here if we aren't doing a type-only search.
12076
12077         * statement.cs (Block): Added constructor which takes a
12078         `Parameters parameters' argument.
12079         (Block.Parameters): New public property.
12080
12081         * support.cs (InternalParameters.Parameters): Renamed `parameters'
12082         to `Parameters' and made it public readonly.
12083
12084 2002-08-06  Martin Baulig  <martin@gnome.org>
12085
12086         * ecore.cs (Expression.Warning): Made this public as well.
12087
12088         * report.cs (Report.Debug): Print the contents of collections.
12089
12090 2002-08-06  Martin Baulig  <martin@gnome.org>
12091
12092         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
12093         used to tell Resolve() which kinds of expressions it may return.
12094         (Expression.Resolve): Added overloaded version of this method which
12095         takes a `ResolveFlags flags' argument.  This can be used to tell
12096         Resolve() which kinds of expressions it may return.  Reports a
12097         CS0118 on error.
12098         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
12099         ResolveFlags.SimpleName.
12100         (Expression.Error118): Added overloaded version of this method which
12101         takes a `ResolveFlags flags' argument.  It uses the flags to determine
12102         which kinds of expressions are allowed.
12103
12104         * expression.cs (Argument.ResolveMethodGroup): New public method.
12105         Resolves an argument, but allows a MethodGroup to be returned.
12106         This is used when invoking a delegate.
12107
12108         * TODO: Updated a bit.
12109
12110 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12111
12112         Fixed compilation with csc.
12113
12114         * ecore.cs: Expression.Error made public. Is this correct? Should
12115         Warning be made public too?
12116
12117         * expression.cs: use ea.Location instead of ea.loc.
12118         [FIXME:  Filed as bug #28607: MCS must report these errors.]
12119
12120 2002-08-06  Martin Baulig  <martin@gnome.org>
12121
12122         * ecore.cs (Expression.loc): Moved the location here instead of
12123         duplicating it in all derived classes.
12124         (Expression.Location): New public property.
12125         (Expression.Error, Expression.Warning): Made them non-static and
12126         removed the location argument.
12127         (Expression.Warning): Added overloaded version which takes an
12128         `int level' argument.
12129         (Expression.Error118): Make this non-static and removed the
12130         expression and location arguments.
12131         (TypeExpr): Added location argument to the constructor.
12132
12133         * expression.cs (StaticCallExpr): Added location argument to
12134         the constructor.
12135         (Indirection, PointerArithmetic): Likewise.
12136         (CheckedExpr, UnCheckedExpr): Likewise.
12137         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
12138         (StringPtr): Likewise.
12139
12140
12141 2002-08-05  Martin Baulig  <martin@gnome.org>
12142
12143         * expression.cs (BaseAccess.DoResolve): Actually report errors.
12144
12145         * assign.cs (Assign.DoResolve): Check whether the source
12146         expression is a value or variable.
12147
12148         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
12149         while resolving the corresponding blocks.
12150
12151         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
12152         an error, don't silently return null.
12153
12154         * statement.cs (Block.AddVariable): Do the error reporting here
12155         and distinguish between CS0128 and CS0136.
12156         (Block.DoResolve): Report all unused labels (warning CS0164).
12157         (LabeledStatement): Pass the location to the constructor.
12158         (LabeledStatement.HasBeenReferenced): New property.
12159         (LabeledStatement.Resolve): Set it to true here.
12160
12161         * statement.cs (Return.Emit): Return success even after reporting
12162         a type mismatch error (CS0126 or CS0127), this is what csc does and
12163         it avoids confusing the users with any consecutive errors.
12164
12165 2002-08-05  Martin Baulig  <martin@gnome.org>
12166
12167         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
12168
12169         * const.cs (Const.LookupConstantValue): Catch circular definitions.
12170
12171         * expression.cs (MemberAccess.DoResolve): Silently return if an
12172         error has already been reported.
12173
12174         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
12175         error has already been reported.
12176
12177 2002-08-05  Martin Baulig  <martin@gnome.org>
12178
12179         * statement.cs (UsageVector): Only initialize the `parameters'
12180         vector if we actually have any "out" parameters.
12181
12182 2002-08-05  Martin Baulig  <martin@gnome.org>
12183
12184         * expression.cs (Binary.ResolveOperator): When combining delegates,
12185         they must have the same type.
12186
12187 2002-08-05  Martin Baulig  <martin@gnome.org>
12188
12189         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
12190         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
12191         work with the ms runtime and we also don't need it: if we're a
12192         PropertyBuilder and not in the `indexer_arguments' hash, then we
12193         are a property and not an indexer.
12194
12195         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
12196         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
12197         since the latter one doesn't work with the ms runtime.
12198
12199 2002-08-03  Martin Baulig  <martin@gnome.org>
12200
12201         Fixed bugs #27998 and #22735.
12202
12203         * class.cs (Method.IsOperator): New public field.
12204         (Method.CheckBase): Report CS0111 if there's already a method
12205         with the same parameters in the current class.  Report CS0508 when
12206         attempting to change the return type of an inherited method.
12207         (MethodData.Emit): Report CS0179 if a method doesn't have a body
12208         and it's not marked abstract or extern.
12209         (PropertyBase): New abstract base class for Property and Indexer.
12210         (PropertyBase.CheckBase): Moved here from Property and made it work
12211         for indexers.
12212         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
12213         the same so we can reuse it there.
12214         (Property, Indexer): Derive from PropertyBase.
12215         (MethodSignature.inheritable_property_signature_filter): New delegate
12216         to find properties and indexers.
12217
12218         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
12219         argument and improved error reporting.
12220
12221         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
12222         EmptyReadOnlyParameters and made it a property.
12223
12224         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
12225         version of this method which takes a `PropertyInfo indexer'.
12226         (TypeManager.RegisterIndexer): New method.
12227
12228         * class.cs: Added myself as author of this file :-)
12229
12230 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12231
12232         * class.cs: fixed compilation on windoze.
12233
12234 2002-08-03  Martin Baulig  <martin@gnome.org>
12235
12236         * interface.cs (Interface.GetInterfaceBases): Check whether all
12237         base interfaces are at least as accessible than the current one.
12238
12239         * class.cs (TypeContainer.GetClassBases): Check whether base types
12240         are at least as accessible than the current type.
12241         (TypeContainer.AsAccessible): Implemented and made non-static.
12242         (MemberBase.CheckParameters): Report errors if the accessibility
12243         checks fail.
12244
12245         * delegate.cs (Delegate.Delegate): The default visibility is
12246         internal for top-level types and private for nested types.
12247         (Delegate.Define): Report errors if the accessibility checks fail.
12248
12249         * enum.cs (Enum.Enum): The default visibility is internal for
12250         top-level types and private for nested types.
12251         (Enum.DefineType): Compute the correct visibility.
12252
12253         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
12254         function which takes a `bool is_toplevel' instead of a TypeContainer.
12255
12256         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
12257         builtin type.
12258
12259 2002-08-02  Martin Baulig  <martin@gnome.org>
12260
12261         * expression.cs (LocalVariableReferenc): Added constructor which
12262         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
12263         (LocalVariableReference.IsReadOnly): New property.
12264         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
12265         variable is readonly, use our own readonly flag to do this; you can
12266         use the new constructor to get a writable reference to a read-only
12267         variable.
12268
12269         * cs-parser.jay (foreach_statement, using_statement): Get a writable
12270         reference to the local variable.
12271
12272 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
12273
12274         * rootcontext.cs (ResolveCore): Also include System.Exception
12275
12276         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
12277         we reach an EmptyStatement.
12278
12279         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
12280         is also fine.
12281
12282         * expression.cs (Binary.ResolveOperator): Check error result in
12283         two places.
12284
12285         use brtrue/brfalse directly and avoid compares to null.
12286
12287 2002-08-02  Martin Baulig  <martin@gnome.org>
12288
12289         * class.cs (TypeContainer.Define): Define all nested interfaces here.
12290         Fixes bug #28407, added test-155.cs.
12291
12292 2002-08-01  Martin Baulig  <martin@gnome.org>
12293
12294         * class.cs (Event.EmitDefaultMethod): Make this work with static
12295         events.  Fixes #28311, added verify-3.cs.
12296
12297 2002-08-01  Martin Baulig  <martin@gnome.org>
12298
12299         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
12300         `is_disposable' fields.
12301         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
12302         `hm.is_disposable' if we're using the collection pattern.
12303         (Foreach.EmitCollectionForeach): Use the correct type for the
12304         enumerator's local variable, only emit the try/finally block if
12305         necessary (fixes #27713).
12306
12307 2002-08-01  Martin Baulig  <martin@gnome.org>
12308
12309         * ecore.cs (Expression.report118): Renamed to Error118 and made
12310         it public static.
12311
12312         * statement.cs (Throw.Resolve): Check whether the expression is of
12313         the correct type (CS0118) and whether the type derives from
12314         System.Exception (CS0155).
12315         (Catch.Resolve): New method.  Do the type lookup here and check
12316         whether it derives from System.Exception (CS0155).
12317         (Catch.CatchType, Catch.IsGeneral): New public properties.
12318
12319         * typemanager.cs (TypeManager.exception_type): Added.
12320
12321 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
12322
12323         * driver.cs: Updated About function.
12324
12325 2002-07-31  Martin Baulig  <martin@gnome.org>
12326
12327         Implemented Control Flow Analysis.
12328
12329         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
12330         (EmitContext.CurrentBranching): Added.
12331         (EmitContext.StartFlowBranching): Added.
12332         (EmitContext.EndFlowBranching): Added.
12333         (EmitContext.KillFlowBranching): Added.
12334         (EmitContext.IsVariableAssigned): Added.
12335         (EmitContext.SetVariableAssigned): Added.
12336         (EmitContext.IsParameterAssigned): Added.
12337         (EmitContext.SetParameterAssigned): Added.
12338         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
12339         Added control flow analysis stuff here.
12340
12341         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
12342         resolve the expression as lvalue.
12343         (LocalVariableReference.DoResolve): Check whether the variable has
12344         already been assigned.
12345         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
12346         the parameter as assigned here.
12347         (ParameterReference.DoResolve): Check whether the parameter has already
12348         been assigned.
12349         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
12350         expression as lvalue.
12351
12352         * statement.cs (FlowBranching): New class for the flow analysis code.
12353         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
12354         (LabeledStatement.IsDefined): New public property.
12355         (LabeledStatement.AddUsageVector): New public method to tell flow
12356         analyis that the label may be reached via a forward jump.
12357         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
12358         flow analysis.
12359         (VariableInfo.Number): New public field.  This is used by flow analysis
12360         to number all locals of a block.
12361         (Block.CountVariables): New public property.  This is the number of
12362         local variables in this block (including the locals from all parent
12363         blocks).
12364         (Block.EmitMeta): Number all the variables.
12365
12366         * statement.cs: Added flow analysis support to all classes.
12367
12368 2002-07-31  Martin Baulig  <martin@gnome.org>
12369
12370         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
12371         To get debugging messages, compile mcs with /define:MCS_DEBUG and
12372         then use this argument.
12373
12374         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
12375
12376         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
12377         use this to specify /define options.
12378
12379 2002-07-29  Martin Baulig  <martin@gnome.org>
12380
12381         * statement.cs (Fixed): Moved all code that does variable lookups
12382         and resolvings from Emit to Resolve.
12383
12384         * statement.cs (For): Moved all code that does variable lookups
12385         and resolvings from Emit to Resolve.
12386
12387         * statement.cs (Using): Moved all code that does variable lookups
12388         and resolvings from Emit to Resolve.
12389
12390 2002-07-29  Martin Baulig  <martin@gnome.org>
12391
12392         * attribute.cs (Attribute.Resolve): Explicitly catch a
12393         System.NullReferenceException when creating the
12394         CustromAttributeBuilder and report a different warning message.
12395
12396 2002-07-29  Martin Baulig  <martin@gnome.org>
12397
12398         * support.cs (ParameterData.ParameterName): Added method to
12399         get the name of a parameter.
12400
12401         * typemanager.cs (TypeManager.IsValueType): New public method.
12402
12403 2002-07-29  Martin Baulig  <martin@gnome.org>
12404
12405         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
12406         is a flag which specifies that it's either ref or out.
12407         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
12408         the out parameter to `out Parameter.Modifier mod', also set the
12409         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
12410
12411         * support.cs (InternalParameters.ParameterModifier): Distinguish
12412         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12413         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12414
12415         * expression.cs (Argument.GetParameterModifier): Distinguish
12416         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
12417         Parameter.Modifier.ISBYREF flag if it's either ref or out.
12418
12419 2002-07-29  Martin Baulig  <martin@gnome.org>
12420
12421         * expression.cs (ParameterReference.ParameterReference): Added
12422         `Location loc' argument to the constructor.
12423
12424         * cs-parser.jay: Pass location to ParameterReference.
12425
12426 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
12427
12428         * statement.cs (Try): Initialize the location.
12429
12430         * cs-parser.jay: pass location to Try.
12431
12432         * expression.cs (Unary.Reduce): Change the prototype to return
12433         whether a constant fold could be performed or not.  The result is
12434         returned in an out parameters.  In the case of Indirection and
12435         AddressOf, we want to perform the full tests.
12436
12437 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
12438
12439         * statement.cs (Statement.Emit): Flag dead code.
12440
12441 2002-07-27  Andrew Birkett  <andy@nobugs.org>
12442
12443         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
12444
12445 2002-07-27  Martin Baulig  <martin@gnome.org>
12446
12447         * class.cs (MethodData.Define): Put back call to
12448         TypeManager.AddMethod(), accidentally commented this out.
12449
12450         * report.cs (Debug): New public method to print debugging information,
12451         this is `[Conditional ("DEBUG")]'.
12452
12453 2002-07-26  Martin Baulig  <martin@gnome.org>
12454
12455         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
12456         (switch_statement): Push the current_block to the switch_stack and
12457         pop it again when we're done with the switch.
12458         (switch_section): The new block is a child of the current_block.
12459         Fixes bug #24007, added test-152.cs.
12460
12461 2002-07-27  Martin Baulig  <martin@gnome.org>
12462
12463         * expression.cs (Invocation.EmitArguments): When calling a varargs
12464         function with only its fixed arguments, we need to pass an empty
12465         array.
12466
12467 2002-07-27  Martin Baulig  <martin@gnome.org>
12468
12469         Mono 0.13 has been released.
12470
12471 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
12472
12473         * driver.cs: Rename --resource to --linkres, because that is what
12474         we do currently, we dont support --resource yet.
12475
12476         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
12477
12478 2002-07-25  Martin Baulig  <martin@gnome.org>
12479
12480         * class.cs (MethodData): New public class.  This is a `method builder'
12481         class for a method or one accessor of a Property/Indexer/Event.
12482         (MethodData.GetMethodFlags): Moved here from MemberBase.
12483         (MethodData.ApplyAttributes): Likewise.
12484         (MethodData.ApplyObsoleteAttribute): Likewise.
12485         (MethodData.ApplyConditionalAttribute): Likewise.
12486         (MethodData.ApplyDllImportAttribute): Likewise.
12487         (MethodData.CheckAbstractAndExternal): Likewise.
12488         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
12489         (MethodData.Emit): Formerly known as Method.Emit().
12490         (MemberBase): Moved everything which was specific to a single
12491         accessor/method to MethodData.
12492         (Method): Create a new MethodData and call Define() and Emit() on it.
12493         (Property, Indexer, Event): Create a new MethodData objects for each
12494         accessor and call Define() and Emit() on them.
12495
12496 2002-07-25  Martin Baulig  <martin@gnome.org>
12497
12498         Made MethodCore derive from MemberBase to reuse the code from there.
12499         MemberBase now also checks for attributes.
12500
12501         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
12502         (MemberBase.GetMethodFlags): Moved here from class Method and marked
12503         as virtual.
12504         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
12505         `CallingConventions cc' and `Attributes opt_attrs' arguments.
12506         (MemberBase.ApplyAttributes): New virtual method; applies the
12507         attributes to a method or accessor.
12508         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
12509         (MemberBase.ApplyConditionalAttribute): Likewise.
12510         (MemberBase.ApplyDllImportAttribute): Likewise.
12511         (MemberBase.CheckAbstractAndExternal): Likewise.
12512         (MethodCore.ParameterTypes): This is now a property instead of a
12513         method, it's initialized from DoDefineParameters().
12514         (MethodCore.ParameterInfo): Removed the set accessor.
12515         (MethodCore.DoDefineParameters): New protected virtual method to
12516         initialize ParameterTypes and ParameterInfo.
12517         (Method.GetReturnType): We can now simply return the MemberType.
12518         (Method.GetMethodFlags): Override the MemberBase version and add
12519         the conditional flags.
12520         (Method.CheckBase): Moved some code from Define() here, call
12521         DoDefineParameters() here.
12522         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
12523         here to avoid some larger code duplication.
12524         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
12525         ensure that abstract and external accessors don't declare a body.
12526
12527         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
12528         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
12529         lookup in the attribute's parent classes, so we need to abort as soon
12530         as we found the first match.
12531         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
12532         the attribute has no arguments.
12533
12534         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
12535         of a Method.
12536
12537 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12538
12539         * cs-parser.jay: reverted previous patch.
12540
12541 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12542
12543         * cs-parser.jay: fixed bug #22119.
12544
12545 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12546
12547         * attribute.cs: fixed compilation. The error was:
12548         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
12549         be assigned to before control leaves the current method."
12550         [FIXME:  Filed as bug #28186: MCS must report this error.]
12551
12552 2002-07-25  Martin Baulig  <martin@gnome.org>
12553
12554         * attribute.cs (Attribute.Conditional_GetConditionName): New static
12555         method to pull the condition name ouf of a Conditional attribute.
12556         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
12557         the obsolete message and error flag out of an Obsolete attribute.
12558
12559         * class.cs (Method.GetMethodFlags): New public method to get the
12560         TypeManager.MethodFlags for this method.
12561         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
12562         private methods.
12563         (Method.Define): Get and apply the Obsolete and Conditional attributes;
12564         if we're overriding a virtual function, set the new private variable
12565         `parent_method'; call the new TypeManager.AddMethod().
12566
12567         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
12568         the MethodBuilder and the Method in a PtrHashtable.
12569         (TypeManager.builder_to_method): Added for this purpose.
12570         (TypeManager.MethodFlags): Added IsObsoleteError.
12571         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
12572         Obsolete and Conditional arguments in MethodBuilders.  If we discover
12573         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
12574         the message from the attribute.
12575
12576 2002-07-24  Martin Baulig  <martin@gnome.org>
12577
12578         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
12579         preprocessor directives, ensure that the argument to #define/#undef is
12580         exactly one identifier and that it's actually an identifier.
12581
12582         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
12583         did not work ....
12584
12585 2002-07-24  Martin Baulig  <martin@gnome.org>
12586
12587         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
12588         initialize it to TypeManager.object_type in the constructor.
12589         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
12590         of the `hm.get_current' method if we're using the collection pattern.
12591         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
12592         for the explicit conversion to make it work when we're using the collection
12593         pattern and the `Current' property has a different return type than `object'.
12594         Fixes #27713.
12595
12596 2002-07-24  Martin Baulig  <martin@gnome.org>
12597
12598         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
12599         does not match, but don't report any errors.  This method is called in
12600         order for all methods in a MethodGroupExpr until a matching method is
12601         found, so we don't want to bail out if the first method doesn't match.
12602         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
12603         matches, report the 123.  Fixes #28070.
12604
12605 2002-07-24  Martin Baulig  <martin@gnome.org>
12606
12607         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
12608         TypeManager.TypeToCoreType() to the top of the method so the
12609         following equality checks will work.  Fixes #28107.
12610
12611 2002-07-24  Martin Baulig  <martin@gnome.org>
12612
12613         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
12614         operand is of type uint, and the other operand is of type sbyte,
12615         short or int, the operands are converted to type long." -
12616         Actually do what this comment already told us.  Fixes bug #28106,
12617         added test-150.cs.
12618
12619 2002-07-24  Martin Baulig  <martin@gnome.org>
12620
12621         * class.cs (MethodBase): New abstract class.  This is now a base
12622         class for Property, Indexer and Event to avoid some code duplication
12623         in their Define() and DefineMethods() methods.
12624         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
12625         generic methods for Define() and DefineMethods().
12626         (FieldBase): Derive from MemberBase, not MemberCore.
12627         (Property): Derive from MemberBase, not MemberCore.
12628         (Property.DefineMethod): Moved all the code from this method to the
12629         new MethodBase.DefineAccessor(), just call it with appropriate
12630         argumetnts.
12631         (Property.Define): Call the new Property.DoDefine(), this does some
12632         sanity checks and we don't need to duplicate the code everywhere.
12633         (Event): Derive from MemberBase, not MemberCore.
12634         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
12635         accessors, this will also make them work with interface events.
12636         (Indexer): Derive from MemberBase, not MemberCore.
12637         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
12638         (Indexer.Define): Use the new MethodBase functions.
12639
12640         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
12641         argument to the constructor.
12642         (Interface.FindMembers): Added support for interface events.
12643         (Interface.PopluateEvent): Implemented.
12644
12645         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
12646
12647 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
12648
12649         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
12650         but this is required to check for a method name being the same as
12651         the containing class.  
12652
12653         Handle this now.
12654
12655 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12656
12657         * interface.cs: initialize variable.
12658
12659 2002-07-23  Martin Baulig  <martin@gnome.org>
12660
12661         Implemented the IndexerName attribute in interfaces.
12662
12663         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
12664         name if this is an explicit interface implementation.
12665         (Indexer.InterfaceIndexerName): New public variable.  If we're
12666         implementing an interface indexer, this is the IndexerName in that
12667         interface.  Otherwise, it's the IndexerName.
12668         (Indexer.DefineMethod): If we're implementing interface indexer,
12669         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
12670         and Pending.ImplementIndexer methods.
12671         (Indexer.Define): Also define the PropertyBuilder if we're
12672         implementing an interface indexer and this is neither an explicit
12673         interface implementation nor do the IndexerName match the one in
12674         the interface.
12675
12676         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
12677         If a method is defined here, then we always need to create a proxy
12678         for it.  This is used when implementing interface indexers.
12679         (Pending.IsInterfaceIndexer): New public method.
12680         (Pending.ImplementIndexer): New public method.
12681         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
12682         This is used when implementing interface indexers to define a proxy
12683         if necessary.
12684         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
12685         define a proxy if necessary.
12686
12687         * interface.cs (Interface.IndexerName): New public variable.
12688         (Interface.PopulateIndexer): Set the IndexerName.
12689         (Interface.DefineIndexers): New private method.  Populate all the
12690         indexers and make sure their IndexerNames match.
12691
12692         * typemanager.cs (IndexerPropertyName): Added support for interface
12693         indexers.
12694
12695 2002-07-22  Martin Baulig  <martin@gnome.org>
12696
12697         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
12698         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
12699         ret if HasReturnLabel.
12700         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
12701         variables.
12702
12703         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
12704         and set the ec.LoopBeginTryCatchLevel.
12705         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
12706         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
12707         the current ec.TryCatchLevel, the branch goes out of an exception
12708         block.  In this case, we need to use Leave and not Br.
12709
12710 2002-07-22  Martin Baulig  <martin@gnome.org>
12711
12712         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
12713         block unless the block does not always return or it is contained in
12714         another try { ... } catch { ... } block.  Fixes bug #26506.
12715         Added verify-1.cs to the test suite.
12716
12717 2002-07-22  Martin Baulig  <martin@gnome.org>
12718
12719         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
12720         then we do not always return.  Fixes bug #24985.
12721
12722 2002-07-22  Martin Baulig  <martin@gnome.org>
12723
12724         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
12725         lookup on a per-class level; ie. walk up the class hierarchy until we
12726         found at least one applicable method, then choose the best among them.
12727         Fixes bug #24463 and test-29.cs.
12728
12729 2002-07-22  Martin Baulig  <martin@gnome.org>
12730
12731         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
12732         return types of the methods.  The return type is not part of the
12733         signature and we must not check it to make the `new' modifier work.
12734         Fixes bug #27999, also added test-147.cs.
12735         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
12736
12737         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
12738         on the method's return type.
12739
12740 2002-07-21  Martin Baulig  <martin@gnome.org>
12741
12742         * assign.cs: Make this work if the rightmost source is a constant and
12743         we need to do an implicit type conversion.  Also adding a few more tests
12744         to test-38.cs which should have caught this.
12745
12746         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
12747         target in the makefile for this.  The makefile.gnu is primarily intended
12748         for end-users who don't want to debug the compiler.
12749
12750 2002-07-21  Martin Baulig  <martin@gnome.org>
12751
12752         * assign.cs: Improved the Assign class so it can now handle embedded
12753         assignments (X = Y = Z = something).  As a side-effect this'll now also
12754         consume less local variables.  test-38.cs now passes with MCS, added
12755         a few new test cases to that test.
12756
12757 2002-07-20  Martin Baulig  <martin@gnome.org>
12758
12759         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
12760         instructions.  Fixes bug #27977, also added test-146.cs.
12761
12762 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12763
12764         * cs-tokenizer.cs: fixed getHex ().
12765
12766 2002-07-19  Martin Baulig  <martin@gnome.org>
12767
12768         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
12769         not Type.GetType() to lookup the array type.  This is needed when
12770         we're constructing an array of a user-defined type.
12771         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
12772         single-dimensional arrays, but also for single-dimensial arrays of
12773         type decimal.
12774
12775 2002-07-19  Martin Baulig  <martin@gnome.org>
12776
12777         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
12778         this function is called, it's not allowed to share LocalBuilders
12779         among ILGenerators.
12780
12781 2002-07-19  Martin Baulig  <martin@gnome.org>
12782
12783         * expression.cs (Argument.Resolve): Report an error 118 when trying
12784         to pass a type as argument.
12785
12786 2002-07-18  Martin Baulig  <martin@gnome.org>
12787
12788         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
12789         Conv_R_Un for the signed `long' type.
12790
12791 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
12792
12793         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
12794         `expr' for the temporary result, as that will fail if we do
12795         multiple resolves on the same expression.
12796
12797 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
12798
12799         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
12800         ec.TypeContainer for looking up aliases. 
12801
12802         * class.cs (TypeContainer): Remove LookupAlias from here.
12803
12804         * decl.cs (DeclSpace); Move here.
12805
12806 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
12807
12808         * class.cs (FindMembers): Only call filter if the constructor
12809         bulider is not null.
12810
12811         Also handle delegates in `NestedTypes' now.  Now we will perform
12812         type lookups using the standard resolution process.  This also
12813         fixes a bug.
12814
12815         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
12816         This uses Expressions (the limited kind that can be parsed by the
12817         tree) instead of strings.
12818
12819         * expression.cs (ComposedCast.ToString): Implement, used to flag
12820         errors since now we have to render expressions.
12821
12822         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
12823         FormArrayType. 
12824
12825         * ecore.cs (SimpleName.ToString): ditto.
12826
12827         * cs-parser.jay: Instead of using strings to assemble types, use
12828         Expressions to assemble the type (using SimpleName, ComposedCast,
12829         MemberAccess).  This should fix the type lookups in declarations,
12830         because we were using a different code path for this.
12831
12832         * statement.cs (Block.Resolve): Continue processing statements
12833         even when there is an error.
12834
12835 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
12836
12837         * class.cs (Event.Define): Also remove the `remove' method from
12838         the list of pending items.
12839
12840         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
12841         generate more compact code. 
12842
12843 2002-07-17  Martin Baulig  <martin@gnome.org>
12844
12845         * const.cs (Const.LookupConstantValue): Add support for constant
12846         `unchecked' and `checked' expressions.
12847         Also adding test case test-140.cs for this.
12848
12849 2002-07-17  Martin Baulig  <martin@gnome.org>
12850
12851         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
12852         check whether mi.ReturnType implements the IEnumerator interface; the
12853         `==' and the IsAssignableFrom() will fail in this situation.
12854
12855 2002-07-16  Ravi Pratap  <ravi@ximian.com>
12856
12857         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
12858         here too.
12859
12860 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12861
12862         * expression.cs: fixed bug #27811.
12863
12864 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
12865
12866         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
12867         Molaro: when we are a ref, the value already contains a pointer
12868         value, do not take the address of it.
12869
12870 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
12871         * removed mb-parser.jay and mb-tokenizer.cs
12872
12873 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
12874
12875         * expression.cs: check against the building corlib void type.
12876
12877 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
12878
12879         * ecore.cs: fix for valuetype static readonly fields: when 
12880         initializing them, we need their address, not the address of a copy.
12881
12882 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
12883
12884         * typemanager.cs: register also enum_type in corlib.
12885
12886 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
12887
12888         * class.cs: allow calling this (but not base) initializers in structs.
12889
12890 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
12891
12892         * ecore.cs: make sure we compare against the building base types
12893         in GetTypeSize ().
12894
12895 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
12896
12897         * typemanager.cs: fix TypeToCoreType() to handle void and object
12898         (corlib gets no more typerefs after this change).
12899
12900 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
12901
12902         * expression.cs (ArrayCreation.EmitArrayArguments): use
12903         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
12904
12905         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
12906         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
12907         array indexes, the runtime actually forbids them.
12908
12909         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
12910         for array arguments here.
12911
12912         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
12913         instead of the default for ValueTypes.
12914
12915         (New.DoEmit): Use IsValueType instead of
12916         IsSubclassOf (value_type)
12917         (New.DoResolve): ditto.
12918         (Invocation.EmitCall): ditto.
12919
12920         * assign.cs (Assign): ditto.
12921
12922         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
12923         Statements *are* currently doing part of their resolution during
12924         Emit.  
12925
12926         Expressions do always resolve during resolve, but statements are
12927         only required to propagate resolution to their children.
12928
12929 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
12930
12931         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
12932
12933         (LoadAssembly): Do not add the dll if it is already specified
12934
12935         (MainDriver): Add the System directory to the link path at the end,
12936         after all the other -L arguments. 
12937
12938         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
12939         wrong opcode for loading bytes and bools (ldelem.i1 instead of
12940         ldelem.u1) and using the opposite for sbytes.
12941
12942         This fixes Digger, and we can finally run it.
12943
12944         * driver.cs (UnixParseOption): Move the option parsing here.  
12945         (CSCParseOption): Implement CSC-like parsing of options.
12946
12947         We now support both modes of operation, the old Unix way, and the
12948         new CSC-like way.  This should help those who wanted to make cross
12949         platform makefiles.
12950
12951         The only thing broken is that /r:, /reference: and /lib: are not
12952         implemented, because I want to make those have the same semantics
12953         as the CSC compiler has, and kill once and for all the confussion
12954         around this.   Will be doing this tomorrow.
12955
12956         * statement.cs (Unsafe.Resolve): The state is checked during
12957         resolve, not emit, so we have to set the flags for IsUnsfe here.
12958
12959 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12960
12961         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
12962         not catch the Error_ObjectRefRequired in SimpleName (as it is
12963         possible to have a class/instance variable name that later gets
12964         deambiguated), we have to check this here.      
12965
12966 2002-07-10  Ravi Pratap  <ravi@ximian.com>
12967
12968         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
12969         make static and put into Expression.
12970
12971         (Event.Define): Register the private field of the event with the 
12972         TypeManager so that GetFieldFromEvent can get at it.
12973
12974         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
12975         keep track of the private field associated with an event which
12976         has no accessors.
12977
12978         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
12979         private field.
12980
12981         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
12982
12983 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
12984
12985         * expression.cs (Binary.EmitBranchable): this routine emits the
12986         Binary expression in a branchable context.  This basically means:
12987         we need to branch somewhere, not just get the value on the stack.
12988
12989         This works together with Statement.EmitBoolExpression.
12990
12991         * statement.cs (Statement.EmitBoolExpression): Use
12992         EmitBranchable. 
12993
12994 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
12995
12996         * statement.cs (For): Reduce the number of jumps in loops.
12997
12998         (For): Implement loop inversion for the For statement.
12999
13000         (Break): We can be breaking out of a Try/Catch controlled section
13001         (foreach might have an implicit try/catch clause), so we need to
13002         use Leave instead of Br.
13003
13004         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
13005         now).  If the instace expression supports IMemoryLocation, we use
13006         the AddressOf method from the IMemoryLocation to extract the
13007         address instead of emitting the instance.
13008
13009         This showed up with `This', as we were emitting the instance
13010         always (Emit) instead of the Address of This.  Particularly
13011         interesting when This is a value type, as we dont want the Emit
13012         effect (which was to load the object).
13013
13014 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
13015
13016         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
13017
13018         * statement.cs (Checked): Set the CheckedState during the resolve
13019         process too, as the ConvCast operations track the checked state on
13020         the resolve process, and not emit.
13021
13022         * cs-parser.jay (namespace_member_declaration): Flag that we have
13023         found a declaration when we do.  This is used to flag error 1529
13024
13025         * driver.cs: Report ok when we display the help only.
13026
13027 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
13028
13029         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
13030
13031 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
13032
13033         * cs-tokenizer.cs (define): We also have to track locally the
13034         defines.  AllDefines is just used for the Conditional Attribute,
13035         but we also need the local defines for the current source code. 
13036
13037 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
13038
13039         * statement.cs (While, For, Do): These loops can exit through a
13040         Break statement, use this information to tell whether the
13041         statement is the last piece of code.
13042
13043         (Break): Flag that we break.
13044
13045         * codegen.cs (EmitContexts): New `Breaks' state variable.
13046
13047 2002-07-03  Martin Baulig  <martin@gnome.org>
13048
13049         * class.cs (TypeContainer.MethodModifiersValid): Allow override
13050         modifiers in method declarations in structs.  Otherwise, you won't
13051         be able to override things like Object.Equals().
13052
13053 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13054
13055         * class.cs (Method, Property, Indexer): Do not allow the public
13056         modifier to be used in explicit interface implementations.
13057
13058         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
13059         override modifiers in method declarations in structs
13060
13061 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
13062
13063         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
13064         integer or real overflow, report an error
13065
13066 2002-07-02  Martin Baulig  <martin@gnome.org>
13067
13068         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
13069         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
13070         to tell the runtime about our newly created System.Object and
13071         System.ValueType types.
13072
13073 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
13074
13075         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
13076         struct instead of Ldarg/Starg.
13077
13078 2002-07-02  Martin Baulig  <martin@gnome.org>
13079
13080         * expression.cs (Indirection.Indirection): Call
13081         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
13082
13083 2002-07-02  Martin Baulig  <martin@gnome.org>
13084
13085         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
13086         ValueType, call TypeManager.TypeToCoreType() on it.
13087         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
13088         the OpCodes.Newarr argument.
13089
13090 2002-07-02  Martin Baulig  <martin@gnome.org>
13091
13092         * expression.cs (Invocation.EmitCall): When compiling corlib,
13093         replace all calls to the system's System.Array type to calls to
13094         the newly created one.
13095
13096         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
13097         System.Array methods.
13098         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
13099         from the system's System.Array type which must be replaced.
13100
13101 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
13102
13103         * typemanager.cs: load unverifiable_code_ctor so we can build
13104         corlib using the correct type. Avoid using GetTypeCode() with
13105         TypeBuilders.
13106         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
13107         TypeManager.object_type to allow building corlib.
13108
13109 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
13110
13111         * ecore.cs: handle System.Enum separately in LoadFromPtr().
13112
13113 2002-07-01  Martin Baulig  <martin@gnome.org>
13114
13115         * class.cs: Make the last change actually work, we need to check
13116         whether `ifaces != null' to avoid a crash.
13117
13118 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
13119
13120         * class.cs: when we build structs without fields that implement
13121         interfaces, we need to add the interfaces separately, since there is
13122         no API to both set the size and add the interfaces at type creation
13123         time.
13124
13125 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
13126
13127         * expression.cs: the dimension arguments to the array constructors
13128         need to be converted if they are a long.
13129
13130 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
13131
13132         * class.cs: don't emit ldarg.0 if there is no parent constructor
13133         (fixes showstopper for corlib).
13134
13135 2002-06-29  Martin Baulig  <martin@gnome.org>
13136
13137         MCS now compiles corlib on GNU/Linux :-)
13138
13139         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
13140         ie. check for MethodImplOptions.InternalCall.
13141
13142         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
13143         and TypeManager.attribute_type are null, so we must explicitly check
13144         whether parent is not null to find out whether it's an attribute type.
13145         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
13146         and SetBuilder, not only if the property is neither abstract nor external.
13147         This is necessary to set the MethodImplOptions on the accessor methods.
13148         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
13149         SetBuilder, see Property.Emit().
13150
13151         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
13152         populate "System.Object", "System.ValueType" and "System.Attribute" since
13153         they've already been populated from BootCorlib_PopulateCoreTypes().
13154
13155 2002-06-29  Martin Baulig  <martin@gnome.org>
13156
13157         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
13158         is the NullLiteral, we also need to make sure that target_type is not
13159         an enum type.   
13160
13161 2002-06-29  Martin Baulig  <martin@gnome.org>
13162
13163         * rootcontext.cs (RootContext.ResolveCore): We must initialize
13164         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
13165         before calling BootstrapCorlib_ResolveDelegate ().
13166
13167 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13168
13169         * statement.cs: fixed build-breaker. All tests passed ok.
13170
13171 2002-06-27  Martin Baulig  <martin@gnome.org>
13172
13173         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
13174         for System.Decimal when compiling corlib.
13175
13176 2002-06-27  Martin Baulig  <martin@gnome.org>
13177
13178         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
13179         switch blocks which contain nothing but a default clause.
13180
13181 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
13182
13183        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
13184
13185 2002-06-27  Martin Baulig  <martin@gnome.org>
13186
13187         * ecore.cs (PropertyExpr.PropertyExpr): Call
13188         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
13189
13190         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
13191         is already a TypeBuilder.
13192
13193 2002-06-27  Martin Baulig  <martin@gnome.org>
13194
13195         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
13196         `target_type == TypeManager.array_type', not IsAssignableFrom() in
13197         the "from an array-type to System.Array" case.  This makes it work
13198         when compiling corlib.
13199
13200 2002-06-27  Martin Baulig  <martin@gnome.org>
13201
13202         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
13203         non-static PropertyExpr, set its InstanceExpression.  This makes
13204         the `ICollection.Count' property work in System/Array.cs.
13205
13206 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
13207
13208         * driver.cs: Made error handling more consistent.  Errors now
13209         tracked by Report class, so many methods which used to return int
13210         now return void.  Main() now prints success/failure and 
13211         errors/warnings message.
13212
13213         Renamed '--probe' compiler argument to '--expect-error'.  Removed
13214         the magic number return values (123 and 124).  Now, if the
13215         expected error occurs, the compiler exits with success (exit value
13216         0).  If the compilation completes without seeing that particular
13217         error, the compiler exits with failure (exit value 1).  The
13218         makefile in mcs/errors has been changed to handle the new behaviour.
13219
13220         * report.cs: Made 'expected error' number a property and renamed
13221         it from 'Probe' to 'ExpectedError'.
13222
13223         * genericparser.cs: Removed error handling support, since it is
13224         now all done by Report class.
13225
13226         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
13227         class, so parse() no longer returns an int.
13228
13229         * namespace.cs: Use Report.Error instead of GenericParser.error
13230
13231 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
13232
13233         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
13234         TypeContainer.AddOperator): At the front of the list put the
13235         explicit implementations, so they get resolved/defined first. 
13236
13237 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
13238
13239         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
13240         interface type is implemented by this TypeContainer.  Used during
13241         explicit interface implementation.
13242
13243         (Property.Define, Indexer.Define, Method.Define): Validate that
13244         the given interface in the explicit implementation is one of the
13245         base classes for the containing type.
13246
13247         Also if we are explicitly implementing an interface, but there is
13248         no match in the pending implementation table, report an error.
13249
13250         (Property.Define): Only define the property if we are
13251         not explicitly implementing a property from an interface.  Use the
13252         correct name also for those properties (the same CSC uses,
13253         although that is really not needed).
13254
13255         (Property.Emit): Do not emit attributes for explicitly implemented
13256         properties, as there is no TypeBuilder.
13257
13258         (Indexer.Emit): ditto.
13259
13260         Hiding then means that we do not really *implement* a pending
13261         implementation, which makes code fail.
13262
13263 2002-06-22  Martin Baulig  <martin@gnome.org>
13264
13265         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
13266         the return value of Object.GetType().  [FIXME: we need to do this whenever
13267         we get a type back from the reflection library].
13268
13269 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
13270
13271         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
13272
13273 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
13274
13275         * attribute.cs: Return null if we can not look up the type.
13276
13277         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
13278         the interface types found.
13279
13280         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
13281         interface types found.
13282
13283         * typemanager.cs (GetInterfaces): Make this routine returns alll
13284         the interfaces and work around the lame differences between
13285         System.Type and System.Reflection.Emit.TypeBuilder in the results
13286         result for GetInterfaces.
13287
13288         (ExpandInterfaces): Given an array of interface types, expand and
13289         eliminate repeated ocurrences of an interface.  This expands in
13290         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
13291         be IA, IB, IC.
13292
13293 2002-06-21  Martin Baulig  <martin@gnome.org>
13294
13295         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
13296         on System.Enum.
13297
13298 2002-06-21  Martin Baulig  <martin@gnome.org>
13299
13300         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
13301         and called with one of the core types, return the corresponding typebuilder for
13302         that type.
13303
13304         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
13305         element type.
13306
13307 2002-06-21  Martin Baulig  <martin@gnome.org>
13308
13309         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
13310         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
13311         (Expression.ConvertReferenceExplicit): Likewise.
13312
13313         * expression.cs (ElementAccess.DoResolve): Likewise.
13314         (ElementAccess.DoResolveLValue): Likewise.
13315
13316 2002-06-10  Martin Baulig  <martin@gnome.org>
13317
13318         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
13319         add the "value" parameter to the parameter list.
13320
13321         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
13322         to our caller.
13323
13324 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
13325
13326         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
13327         the argument to an int, uint, long or ulong, per the spec.  Also
13328         catch negative constants in array creation.
13329
13330 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
13331
13332         * class.cs: do not allow the same interface to appear twice in
13333         the definition list.
13334
13335 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
13336
13337         * ecore.cs: don't use ldlen with System.Array.
13338
13339 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
13340
13341         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
13342
13343 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
13344
13345         * modifiers.cs: produce correct field attributes for protected
13346         internal. Easy fix so miguel can work on ther harder stuff:-)
13347
13348 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
13349
13350         * pending.cs: New file.  Move the code from class.cs here.
13351         Support clearning the pending flag for all methods (when not doing
13352         explicit interface implementation).
13353
13354 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
13355
13356         * rootcontext.cs: added a couple more types needed to bootstrap.
13357
13358 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
13359
13360         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
13361         constructor in the type, instead of any constructor in the type
13362         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
13363         a bug in the Mono runtime when applying the params attribute). 
13364
13365 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
13366         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
13367
13368 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
13369
13370         * expression.cs (Unary.ResolveOperator): Use TypeManager
13371         to resolve the type.
13372
13373 2002-06-13  Ravi Pratap  <ravi@ximian.com>
13374
13375         * cs-parser.jay (enum_member_declaration): Pass in the attributes
13376         attached.
13377
13378         * enum.cs (AddEnumMember): Add support to store the attributes associated 
13379         with each member too.
13380
13381         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
13382         field builders too - this takes care of the enum member case.
13383
13384 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
13385
13386         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
13387         address-of operator on both value types and pointers.
13388
13389 2002-06-10  Martin Baulig  <martin@gnome.org>
13390
13391         * interface.cs (Interface.PopulateIndexer): Add the indexer's
13392         PropertyBuilder to the `property_builders' list.
13393
13394         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
13395         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
13396         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
13397         find any indexers which are inherited from an interface.
13398
13399 2002-06-09  Martin Baulig  <martin@gnome.org>
13400
13401         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
13402         the same type as the constant if necessary.  There's also a test-130.cs
13403         for this.
13404
13405         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
13406
13407         * typemanager.cs (TypeManager.ChangeType): Previously known as
13408         Enum.ChangeEnumType().
13409
13410 2002-06-09  Martin Baulig  <martin@gnome.org>
13411
13412         * expression.cs (Cast.TryReduce): Added support for consts.
13413
13414 2002-06-08  Ravi Pratap  <ravi@ximian.com>
13415
13416         * class.cs (Accessor): Hold attributes information so we can pass
13417         it along.
13418
13419         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
13420         Modify to pass in attributes attached to the methods.
13421
13422         (add_accessor_declaration, remove_accessor_declaration): Ditto.
13423
13424         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
13425         to handle the Accessor kind :-)
13426
13427         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
13428
13429 2002-06-08  Martin Baulig  <martin@gnome.org>
13430
13431         * expression.cs (Unary.TryReduceNegative): Added support for
13432         ULongConstants.
13433
13434 2002-06-08  Martin Baulig  <martin@gnome.org>
13435
13436         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
13437         name can't be found in the `defined_names' - the caller will do a
13438         MemberLookup in this case and thus find methods in System.Enum
13439         such as Enum.IsDefined().
13440
13441 2002-06-08  Martin Baulig  <martin@gnome.org>
13442
13443         * enum.cs (Enum.ChangeEnumType): This is a custom version of
13444         Convert.ChangeType() which works with TypeBuilder created types.
13445         (Enum.LookupEnumValue, Enum.Define): Use it here.
13446
13447         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
13448         `TypeBuilder.BaseType != null' check.
13449         (TypeContainer.FindMembers): Only lookup parent members if we
13450         actually have a parent.
13451         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
13452         (ConstructorInitializer.Resolve): Likewise.
13453
13454         * interface.cs (Interface.FindMembers): Added
13455         `TypeBuilder.BaseType != null' check.
13456
13457         * rootcontext.cs (RootContext.ResolveCore): Added
13458         "System.Runtime.CompilerServices.IndexerNameAttribute" to
13459         classes_second_stage.
13460
13461         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
13462         debug_type and trace_type when compiling with --nostdlib.       
13463
13464 2002-06-07  Martin Baulig  <martin@gnome.org>
13465
13466         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
13467         (AddField): Set it to true when adding a non-static field.
13468         (DefineType): Use `have_nonstatic_fields' to find out whether we
13469         have non-static fields, not `Fields != null'.
13470
13471 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
13472
13473         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
13474         dereferencing a null on the static-field code path)
13475
13476 2002-05-30  Martin Baulig  <martin@gnome.org>
13477
13478         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
13479         to take command line arguments.  Use reflection to call the new
13480         custom `Initialize' function on the symbol writer and pass it the
13481         command line arguments.
13482
13483         * driver.cs (--debug-args): New command line argument to pass command
13484         line arguments to the symbol writer.
13485
13486 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
13487
13488         * assign.cs (DoResolve): Forgot to do the implicit conversion to
13489         the target type for indexers and properties.  Thanks to Joe for
13490         catching this.
13491
13492 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
13493
13494         * typemanager.cs (MethodFlags): returns the method flags
13495         (Obsolete/ShouldIgnore) that control warning emission and whether
13496         the invocation should be made, or ignored. 
13497
13498         * expression.cs (Invocation.Emit): Remove previous hack, we should
13499         not do this on matching a base type, we should do this based on an attribute
13500
13501         Only emit calls to System.Diagnostics.Debug and
13502         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
13503         on the command line.
13504
13505         * rootcontext.cs: Global settings for tracing and debugging.
13506
13507         * cs-tokenizer.cs (define): New utility function to track
13508         defines.   Set the global settings for TRACE and DEBUG if found.
13509
13510 2002-05-25  Ravi Pratap  <ravi@ximian.com>
13511
13512         * interface.cs (Populate*): Pass in the TypeContainer as well as
13513         the DeclSpace as parameters so that we can create EmitContexts and
13514         then use that to apply attributes etc.
13515
13516         (PopulateMethod, PopulateEvent, PopulateProperty)
13517         (PopulateIndexer): Apply attributes everywhere.
13518
13519         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
13520         etc.
13521
13522         (ApplyAttributes): Update accordingly.
13523
13524         We now apply interface attributes for all members too.
13525
13526 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
13527
13528         * class.cs (Indexer.Define); Correctly check if we are explicit
13529         implementation (instead of checking the Name for a ".", we
13530         directly look up if the InterfaceType was specified).
13531
13532         Delay the creation of the PropertyBuilder.
13533
13534         Only create the PropertyBuilder if we are not an explicit
13535         interface implementation.   This means that explicit interface
13536         implementation members do not participate in regular function
13537         lookups, and hence fixes another major ambiguity problem in
13538         overload resolution (that was the visible effect).
13539
13540         (DefineMethod): Return whether we are doing an interface
13541         implementation. 
13542
13543         * typemanager.cs: Temporary hack until we get attributes in
13544         interfaces (Ravi is working on that) and we get IndexerName
13545         support in interfaces.
13546
13547         * interface.cs: Register the indexers as properties.
13548
13549         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
13550         warning, I have verified that this is a bug in the .NET runtime
13551         (JavaScript suffers of the same problem).
13552
13553         * typemanager.cs (MemberLookup): When looking up members for
13554         interfaces, the parent of an interface is the implicit
13555         System.Object (so we succeed in searches of Object methods in an
13556         interface method invocation.  Example:  IEnumerable x;  x.ToString
13557         ()) 
13558
13559 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
13560
13561         * class.cs (Event): Events should also register if they do
13562         implement the methods that an interface requires.
13563
13564         * typemanager.cs (MemberLookup); use the new GetInterfaces
13565         method. 
13566
13567         (GetInterfaces): The code used to lookup interfaces for a type is
13568         used in more than one place, factor it here. 
13569
13570         * driver.cs: Track the errors at the bottom of the file, we kept
13571         on going.
13572
13573         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
13574         instance if the method we are calling is static!
13575
13576 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
13577
13578         * attribute.cs (ApplyAttributes): Make this function filter out
13579         the IndexerName attribute (as that attribute in reality is never
13580         applied) and return the string constant for the IndexerName
13581         attribute. 
13582
13583         * class.cs (TypeContainer.Emit): Validate that all the indexers
13584         have the same IndexerName attribute, and if so, set the
13585         DefaultName attribute on the class. 
13586
13587         * typemanager.cs: The return value might contain other stuff (not
13588         only methods).  For instance, consider a method with an "Item"
13589         property and an Item method.
13590
13591         * class.cs: If there is a problem with the parameter types,
13592         return. 
13593
13594 2002-05-24  Ravi Pratap  <ravi@ximian.com>
13595
13596         * ecore.cs (ImplicitConversionExists): Wrapper function which also
13597         looks at user defined conversion after making a call to 
13598         StandardConversionExists - we need this for overload resolution.
13599
13600         * expression.cs : Update accordingly the various method calls.
13601
13602         This fixes 2 bugs filed against implicit user defined conversions 
13603
13604 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
13605
13606         * statement.cs: Track the result of the assignment.
13607
13608 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
13609
13610         * expression.cs (MemberAccess): Improved error reporting for
13611         inaccessible members.
13612
13613 2002-05-22  Martin Baulig  <martin@gnome.org>
13614
13615         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
13616         itself with debugging support.
13617
13618 2002-05-22  Martin Baulig  <martin@gnome.org>
13619
13620         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
13621         Removed, this isn't needed anymore.
13622
13623 2002-05-20  Martin Baulig  <martin@gnome.org>
13624
13625         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
13626         be underlying type for an enum.
13627
13628 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
13629
13630         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
13631         that splits out the loading of just the core types.
13632
13633         * rootcontext.cs (ResolveCore): Split the struct resolution in
13634         two, so we can load the enumeration underlying types before any
13635         enums are used.
13636
13637         * expression.cs (Is): Bandaid until we fix properly Switch (see
13638         bug #24985 for details).
13639
13640         * typemanager.cs (ImplementsInterface): The hashtable will contain
13641         a null if there are no interfaces implemented.
13642
13643 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
13644
13645         * cs-parser.jay (indexer_declarator): It is fine to have array
13646         parameters
13647
13648 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13649
13650         * typemanager.cs: (RegisterBuilder): New function used to register
13651         TypeBuilders that implement interfaces.  Since
13652         TypeBuilder.GetInterfaces (as usual) does not work with lame
13653         Reflection.Emit. 
13654         (AddUserType): register interfaces.
13655
13656         (ImplementsInterface): Use the builder_to_ifaces hash if we are
13657         dealing with TypeBuilder.  Also, arrays are showing up as
13658         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
13659         methods can not be invoked on them!
13660
13661         * ecore.cs (ExplicitReferenceConversionExists): Made public.
13662         (ImplicitReferenceConversionExists): Split out from
13663         StandardConversionExists. 
13664
13665         * expression.cs (As): We were only implementing one of the three
13666         cases for the as operator.  We now implement them all.
13667         (Is): Implement the various other cases for Is as well.
13668
13669         * typemanager.cs (CACHE): New define used to control if we want or
13670         not the FindMembers cache.  Seems to have a negative impact on
13671         performance currently
13672
13673         (MemberLookup): Nested types have full acess to
13674         enclosing type members
13675
13676         Remove code that coped with instance/static returns for events, we
13677         now catch this in RealFindMembers.
13678
13679         (RealFindMembers): only perform static lookup if the instance
13680         lookup did not return a type or an event.  
13681
13682 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
13683
13684         * assign.cs (CompoundAssign): We pass more semantic information
13685         now to Compound Assignments than we did before: now we have all
13686         the information at hand, and now we resolve the target *before* we
13687         do the expression expansion, which allows the "CacheValue" method
13688         to have the effect we intended (before, a [x] += 1 would generate
13689         two differen ArrayAccess expressions from the ElementAccess,
13690         during the resolution process).
13691
13692         (CompoundAssign.DoResolve): Resolve target and original_source here.
13693
13694 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
13695
13696         * expression.cs (ArrayAccess): dropped debugging information. 
13697
13698         * typemanager.cs: Small bug fix: I was always returning i_members,
13699         instead of one of i_members or s_members (depending on which had
13700         the content).
13701
13702         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
13703         method is invoked before any code generation takes place, and it
13704         is a mechanism to inform that the expression will be invoked more
13705         than once, and that the method should use temporary values to
13706         avoid having side effects
13707
13708         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
13709
13710         * ecore.cs (Expression.CacheTemporaries): Provide empty default
13711         implementation.
13712
13713         * expression.cs (Indirection, ArrayAccess): Add support for
13714         CacheTemporaries in these two bad boys. 
13715
13716         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
13717         ldobj or ldind_ref.  
13718         (StoreFromPtr): Handle stobj as well.
13719
13720         * expression.cs (UnaryMutator): Share more code.
13721
13722         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
13723         down: I was not tracking the Filter function as well, which
13724         was affecting the results of the cache.
13725
13726 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
13727
13728         * attribute.cs: Remove the hack to handle the CharSet property on
13729         StructLayouts. 
13730
13731 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
13732
13733         * attribute.cs (DoResolve): More uglyness, we now only try to
13734         resolve the attribute partially, to extract the CharSet
13735         information (only if we are a StructLayout attribute).  Otherwise 
13736
13737         (GetExtraTypeInfo): Add some code to conditionally kill in the
13738         future this.   I am more and more convinced that the .NET
13739         framework has special code to handle the attribute setting on
13740         certain elements.
13741
13742         * expression.cs (IsParamsMethodApplicable): Revert my previous
13743         foreach change here, it was wrong.
13744
13745 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
13746
13747         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
13748         (pp_expr): do not abort on unknown input, just return.
13749         (eval): abort if there are pending chars.
13750
13751         * attribute.cs (Attribute.Resolve): Positional parameters are
13752         optional.  Deal with that case.
13753
13754         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
13755         the Ansi/Unicode/Auto information for the type.
13756
13757         (TypeContainer.DefineType): instantiate the EmitContext here, as
13758         we will be using it during the type definition (to resolve
13759         attributes) and during the emit phase.
13760
13761         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
13762         to pull type information out of the attributes
13763
13764         (Attribute.Resolve): track the constructor builder, and allow for
13765         multiple invocations (structs and classes will use this).
13766
13767         * ecore.cs (MemberLookupFinal): new version with all the
13768         parameters customizable.
13769
13770         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
13771         constructors.  Return if the result value is null (as the error
13772         would have been flagged already by MemberLookupFinal)
13773
13774         Do not allow instances of abstract classes or interfaces to be
13775         created.
13776
13777         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
13778         We have to compare the assembly property here when dealing with
13779         FamANDAssem and Assembly access modifiers, because we might be
13780         creating an assembly from *modules* (that means that we are not
13781         getting TypeBuilders for types defined in other modules that are
13782         part of this assembly).
13783
13784         (Method.Emit): If the method is marked abstract and has a body,
13785         emit an error. 
13786
13787         (TypeContainer.DefineMembers): If both the defined member and the
13788         parent name match are methods, then do not emit any warnings: let
13789         the Method.Define routine take care of flagging warnings.  But if
13790         there is a mismatch (method overrides something else, or method is
13791         overriwritten by something, then emit warning).
13792
13793         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
13794         set to null, this means `do not check for the return type on the
13795         signature'. 
13796
13797         (Method.Define): set the return type for the method signature to
13798         null, so that we get methods with the same name and parameters and
13799         different return types.  This is used to flag warning 114 (you are
13800         hiding a method, and you probably want to use the new/override
13801         keywords instead).
13802
13803         * typemanager.cs (MemberLookup): Implemented proper access
13804         control, closing a long standing set of bug reports.  The problem
13805         was that the Framework only has two bits: Public and NonPublic,
13806         and NonPublic includes private and protected methods, but we need
13807         to enforce the FamANDAssem, FamOrAssem and Family. 
13808
13809 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
13810
13811         * statement.cs (GotoCase): Return true: Ammounts to giving up
13812         knowledge on whether we return or not, and letting the other case
13813         be responsible for it.
13814
13815 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
13816
13817         * driver.cs: Do not load directories for each file processed, only
13818         do it if there is a pattern.
13819
13820         * ecore.cs: Report readonly assigns here as well, as we might have
13821         been resolved only by MemberAccess.
13822
13823         (SimpleName.SimpleNameResolve): Also be useful for LValue
13824         resolution.   We need this to propagate assign to local readonly variables
13825
13826         * typemanager.cs: Use a ptrhashtable for the criteria, because we
13827         do not want to reuse potential criteria memory.
13828
13829         * class.cs (MyEventBuilder): Set reflected_type;
13830
13831         * ecore.cs (Constantify): Added support for constifying bools.
13832
13833         (RootContext.LookupType): Added a cache for values looked up in
13834         the declaration space.
13835
13836         * typemanager.cs (FindMembers): Now is a front-end to
13837         RealFindMembers, and provides a two-level hashtable-based cache to
13838         the request.  
13839
13840         15% performance improvement: from 22.5 to 19.2 seconds.
13841
13842         * expression.cs (IsParamsMethodApplicable): use foreach.
13843         (Invocation.DoResolve): ditto.
13844         (New.DoResolve): ditto.
13845         (ArrayCreation.DoResolve): ditto.
13846
13847         * ecore.cs (FindMostEncompassingType): use foreach.
13848
13849         * delegate.cs (NewDelegate.DoResolve): Use foreach
13850
13851         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
13852         (RemoveMethods): use foreach.
13853
13854         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
13855         nested foreach statements instead of for, and also break out of
13856         the inner loop once a match is found.
13857
13858         (Invocation.OverloadResolve): Use foreach, simplify the code. 
13859
13860 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
13861
13862         * cfold.cs (BinaryFold): During an enumeration evaluation context,
13863         we actually unwrap the expression to allow for extra information
13864         to be extracted. 
13865
13866         * expression.cs: Use Shr_Un on unsigned operations. 
13867
13868 2002-05-08  Ravi Pratap  <ravi@ximian.com>
13869
13870         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
13871         applicable operators was not being considered correctly. This closes
13872         the bug Miguel reported.
13873
13874 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
13875
13876         * attribute.cs: check that the type derives from System.Attribute
13877         and report the correct error in that case (moved the duplicate code to
13878         its own method, too).
13879
13880 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
13881
13882         * attribute.cs: lookup attribute type name as the spec says: first the
13883         bare attribute name and then name + "Attribute" (nant compiles with
13884         mcs after this fix).
13885
13886 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
13887
13888         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
13889         Because of the way we parse things, we should try to see if a
13890         UIntConstant can fit in an integer.
13891
13892 2002-05-07  Ravi Pratap  <ravi@ximian.com>
13893
13894         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
13895         when we are in an explicit context.
13896
13897         (ConvertReferenceExplicit): When converting from Iface type S to Class
13898         T make sure the rules are implemented as an OR.
13899
13900         * parameter.cs (ParameterType): Make it a property for now although the
13901         purpose really isn't anything immediate.
13902
13903         * expression.cs (Is*Applicable): Do better checking on the parameter type
13904         of a ref/out parameter. The ones from the system assemblies are already 
13905         marked with the correct type so we don't need to do any correction.
13906
13907         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
13908         the object type is standard too so include that.
13909
13910 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13911
13912         * ecore.cs (StandardConversionExists): Augment with missing code:
13913         deal with IntConstant, LongConstants and Enumerations.
13914
13915         * assign.cs: Report the error, instead of failing silently
13916
13917         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
13918         typecontainer that they are declared, because the
13919         typecontainer/namespace will have the list of using clauses that
13920         need to be applied.
13921
13922         Assembly Attributes were escaping the normal registration
13923         mechanism. 
13924
13925         (EmitCode): Apply attributes within an EmitContext that represents
13926         the container they were declared on.
13927
13928         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
13929
13930 2002-05-06  Ravi Pratap  <ravi@ximian.com>
13931
13932         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
13933         Revamp completely - make much cleaner as we now operate only
13934         on a set of Types.
13935
13936         (FindMostSpecificSource, FindMostSpecificTarget): New methods
13937         to implement the logic detailed in the spec more correctly.
13938
13939         (UserDefinedConversion): Update accordingly.
13940
13941 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13942
13943         * statement.cs: Return flow analysis information up.
13944
13945         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
13946         and the default.
13947
13948         (token): Do not consume an extra character before calling
13949         decimal_digits.
13950
13951 2002-05-06  Piers Haken <piersh@friskit.com>
13952
13953         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
13954
13955 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
13956
13957         * class.cs (Constructor.Emit): Set the IsStatic flag in the
13958         EmitContext during the instance constructor initializer
13959         resolution, to stop access to instance variables.
13960
13961         This is mandated by the spec, last paragraph of the `constructor
13962         initializers' section. 
13963
13964 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
13965
13966         * cs-parser.jay, class.cs (Accessor): new class used to represent
13967         an accessor (get or set).  In the past we used `null' to represent
13968         a missing accessor.  But this is ambiguous because there was no
13969         way to tell in abstract indexers/properties if one of them was
13970         specified.
13971
13972         Now there is a way of addressing that.
13973
13974         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
13975         instead of FindMembers.
13976
13977         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
13978         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
13979
13980         * attribute.cs: Treat indexers and properties as the same in terms
13981         of applying attributes
13982
13983         * ecore.cs (FindMostEncompassedType): Use statically initialized
13984         EmptyExpressions()s like we do elsewhere to avoid creating useless
13985         objects (and we take this out of the tight loop).
13986
13987         (GetConversionOperators): Move the code to extract the actual
13988         operators to a separate routine to clean things up.
13989
13990 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
13991
13992         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
13993         events are always registered FieldBuilders.
13994
13995         * class.cs (FieldBase): New class shared by Fields 
13996
13997         * delegate.cs: If we are a toplevel delegate, use our full name.
13998         If we are a nested delegate, then only use our tail name.
13999
14000 2002-05-02  Ravi Pratap  <ravi@ximian.com>
14001
14002         * expression.cs (IsApplicable): Ensure that we add the "&" to
14003         ref/out types before comparing it with the type of the argument.
14004
14005         (IsParamsMethodApplicable): Ditto.
14006
14007         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
14008         silly me ;-)
14009
14010         * delegate.cs : Handle the case when we have more than one applicable
14011         method. Flag an error only when we finish checking all.
14012
14013 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
14014
14015         * expression.cs: Add support for boolean static initializers.
14016
14017 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
14018
14019         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
14020
14021         * parameter.cs (ComputeParameterTypes,
14022         ComputeAndDefineParameterTypes): Better error handling: now we
14023         clear the `types' cache if we fail during any of the type lookups.
14024         We also return the status code correctly to our caller
14025
14026         * delegate.cs: If we fail to define a delegate, abort the extra
14027         steps. 
14028
14029         * expression.cs (Binary.ResolveOperator): for
14030         operator==(object,object) and operator !=(object, object) we also
14031         have to verify that there is an implicit conversion from one to
14032         the other.
14033
14034         (ArrayAccess.DoResolve): Array Access can operate on
14035         non-variables. 
14036
14037 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
14038
14039         * assign.cs (CompoundAssign): A new class used as a "flag" that
14040         the assignment actually is happening as part of a compound
14041         assignment operator.
14042
14043         During compound assignment, a few new rules exist to enable things
14044         like:
14045
14046         byte b |= 1 + 2
14047
14048         From the spec:
14049
14050         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
14051         to the type of x) if y is implicitly convertible to the type of x,
14052         and the operator is a builtin operator and the return type of the
14053         operator is explicitly convertible to the type of x. 
14054
14055         * rootcontext.cs: Reset warning level to 2.  4 catches various
14056         "interesting" features in mcs, we must clean this up at some
14057         point, but currently am trying to kill other bugs ;-)
14058
14059         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
14060         in container classes as well.  
14061
14062         * expression.cs (Binary.ResolveOperator): Handle string case
14063         before anything else (as operator overloading does emit an error
14064         before doing anything else).
14065
14066         This code could go away when we move to a table driven model, but
14067         i could not come up with a good plan last night.
14068
14069 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
14070
14071         * typemanager.cs (CSharpName): reimplementation using regex.
14072         * class.cs: added null check for fields in Emit
14073         * rootcontext.cs: set warninglevel to 4
14074
14075 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
14076
14077         * typemanager.cs (CSharpName): reimplemented with Lupus
14078         suggestion.
14079
14080 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
14081
14082         * statement.cs (If): correclty implement Resolve, because we were
14083         not catching sem errors in there.  The same process is needed
14084         everywhere else. 
14085         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
14086
14087
14088         (Statement.Warning_DeadCodeFound): Factorize code.
14089         (While): Report dead code here too.
14090
14091         (Statement): Added Resolve virtual method to allow
14092         for resolution split from the emit code.
14093
14094 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14095
14096         * statement.cs (EmitBoolExpression): No longer try to resolve the
14097         expression here.    
14098         (MakeBoolean): New utility function that resolve, implicitly
14099         converts to boolean and tags the expression. 
14100
14101
14102         (If, Do): Implement dead code elimination.
14103         (While): Implement loop inversion
14104
14105         (Do, While, For, If): Resolve the expression prior to calling our
14106         code generation.
14107
14108 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
14109
14110         * class.cs:
14111           - added method Report28 (warning: program has more than one entry point)
14112           - added method IsEntryPoint, implements paragraph 10.1 of the spec
14113           - modified method Method.Define, the part at the end of the method
14114
14115         * rootcontext.cs: added static public Location EntryPointLocation;
14116           
14117         * ../errors/cs0028.cs : Add test case for the above warning.              
14118
14119         * typemanager.cs:
14120           - modified method CSharpName to allow arrays of primitive type to
14121             be printed nicely (e.g. instead of System.Int32[][] it now prints
14122             int[][])
14123           - added method CSharpSignature: returns the signature of a method
14124             in string format to be used in reporting errors, warnings, etc.
14125
14126         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
14127         with String.Empty.
14128
14129 2002-04-26  Ravi Pratap  <ravi@ximian.com>
14130
14131         * delegate.cs (Define): Fix extremely silly bug where I was
14132         setting the type of the 'object' parameter of the BeginInvoke
14133         method to System.IAsyncResult instead of System.Object ;-)
14134
14135 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
14136
14137         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
14138         here. 
14139
14140         (Constructor.Emit): return if we fail to initialize the
14141         constructor.  Another door closed!  
14142
14143         * expression.cs (New.DoResolve): Improve error message (from -6 to
14144         1501).  Use DeclaredOnly lookup to find the exact constructor.
14145
14146         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
14147         loop.  This is useful.
14148
14149         * cs-parser.jay: Adjust the default parameters so that destructors
14150         have the proper signature.
14151
14152 2002-04-26  Martin Baulig  <martin@gnome.org>
14153
14154         * driver.cs (LoadAssembly): If `assembly' contains any characters
14155         which are only valid in path names and not in assembly names
14156         (currently slash, backslash and point), use Assembly.LoadFrom ()
14157         instead of Assembly.Load () on the `assembly' (before iteration
14158         over the link_paths).
14159
14160 2002-04-26  Martin Baulig  <martin@gnome.org>
14161
14162         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
14163
14164 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
14165
14166         * class.cs (Property): use the new typemanager.MemberLookup
14167
14168         (TypeContainer.MemberLookup): Implement using the
14169         TypeManager.MemberLookup now. 
14170
14171         * typemanager.cs: Make MemberLookup a function of the TypeManager,
14172         and return MemberInfos, so that these can be used without an
14173         EmitContext (what we had before).
14174
14175 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
14176
14177         * expression.cs: Fix the case where the argument to params if the
14178         type of the params.  I omitted handling this before.   Fixed
14179
14180 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * driver.cs: Call BootCorlib_PopulateCoreType
14183
14184         * class.cs (Property.CheckBase): Check for properties only, not
14185         for all members. 
14186
14187         * interface.cs: Temporary hack: try/catch around the
14188         CustomAttributeBuilder, because I am getting an exception that I
14189         do not understand.
14190
14191         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
14192         types whose definitions are required to be there (attributes are
14193         defined before standard types).
14194
14195         Compute definitions as we boot the various types, as they are used
14196         immediately (value_type class will need object_type, but if we do
14197         not initialize object_type, we will pass a null, which will let
14198         the runtime pick the System.Object from the existing corlib, which
14199         is not what we want).
14200
14201 2002-04-22  Patrik Torstensson <totte@labs2.com>
14202
14203         * cs-tokenizer.cs: fixed a number of trim() issues.
14204
14205 2002-04-22  Ravi Pratap  <ravi@ximian.com>
14206
14207         * expression.cs (Argument.Type): Ensure that we return the correct
14208         type when we have out or ref parameters [in which case we 
14209         append a "&"].
14210
14211 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
14212
14213         * class.cs (Property, Indexer): Allow extern modifier in there. 
14214
14215         * typemanager.cs (InitBaseTypes): Initializes object_type and
14216         value_type, since those will be used early on during the bootstrap
14217         process to compile corlib.
14218
14219         (InitCoreTypes): Move code from here to InitBaseTypes.
14220
14221 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
14222
14223         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
14224         single-dimension arrays as using the ldlen opcode.  
14225
14226         Daniel Lewis discovered this optimization.  
14227
14228         * typemanager.cs: Add signature for System.Array::get_Length
14229
14230 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14231
14232         * statement.cs: report the error when the foreach does not apply to an
14233         array nor a collection.
14234
14235 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
14236
14237         * expression.cs: Add implicit conversions to the operator ~.
14238
14239         * constant.cs (DecimalConstant.Emit): Emit decimal value.
14240
14241         * typemanager.cs: Locate the decimal constructor.
14242
14243 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14244
14245         * attribute.cs: use the new property of TypeOf.
14246         * expression.cs: added 'get' property around typearg.
14247
14248         These changes fix a build breaker reported by NickD. Is this the
14249         correct way to fix?  If not, please, revert my changes and make it
14250         work :-).
14251
14252 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
14253
14254         * attribute.cs: Add support for typeof in attribute invocations.
14255         I am not sure that this is right though.
14256
14257 2002-04-14  Duncan Mak  <duncan@ximian.com>
14258
14259         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
14260         Binary.Operator.Division case.
14261
14262 2002-04-13  Ravi Pratap  <ravi@ximian.com>
14263
14264         * class.cs (DefineType): Ensure that we do a proper check on
14265         attribute types and also register it with the TypeManager.
14266
14267         (TypeContainer.Targets): The default for attribute types is
14268         AttributeTargets.All.
14269
14270         * attribute.cs (ApplyAttributes): Registering the attribute type
14271         is done elsewhere, not when we discover we have a Usage attribute.
14272
14273 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14274
14275         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
14276         and get rid of is_delegate parameter.
14277
14278         * everywhere : update.
14279
14280 2002-04-12  Ravi Pratap  <ravi@ximian.com>
14281
14282         * cs-parser.jay (compilation_unit): Revamp completely to use
14283         some new ideas that I got from Rhys' grammar to solve the problems
14284         with assembly level attributes.
14285
14286         (outer_declaration): New grammar production.
14287
14288         (attribute_sections): Add.
14289
14290         (opt_attributes): Base on attribute_sections
14291
14292         (namespace_declaration): Allow opt_attributes to tackle the case
14293         when we have assembly level attributes - we are clever in this
14294         regard now ;-)
14295
14296         * attribute.cs (ApplyAttributes): Do not worry about assembly 
14297         attributes in the non-global context.
14298
14299         * rootcontext.cs (AddGlobalAttributes): Go back to using this
14300         instead of SetGlobalAttributes.
14301
14302         * class.cs, rootcontext.cs : Ensure we define and generate 
14303         attribute types before anything else.
14304
14305         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
14306         and flag the new error -20 for the case when the attribute type
14307         does not have valid targets specified. csc does not catch this.
14308
14309         * ../errors/errors.txt : update for error # -20
14310
14311 2002-04-11  Ravi Pratap  <ravi@ximian.com>
14312
14313         * support.cs (InternalParameters.ParameterModifier): Do some null
14314         checking and return sane values.
14315
14316         * class.cs (Method.Define): If we are a PInvoke method, ensure
14317         that we are static and extern. Report error # 601
14318
14319         * ../errors/cs0601.cs : Add test case for the above error.
14320
14321 2002-04-07  Ravi Pratap  <ravi@ximian.com>
14322
14323         * rootcontext.cs (attribute_types): We need to keep type of
14324         all attribute types separately and emit code for them first.
14325
14326         (RegisterAttribute) : Implement.
14327
14328         * class.cs (DefineType): Check if the current Type is a custom
14329         attribute type and register it accordingly.
14330
14331         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
14332         adding the first attribute twice and rename to
14333
14334         (SetGlobalAttributes): this.
14335
14336         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
14337         lookups.
14338
14339         * attribute.cs (ApplyAttributes): Take an additional argument telling us
14340         if we are processing global arguments. Hmm, I am unsure of this.
14341
14342 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14343
14344         * expression.cs: added static array of strings to avoid calling
14345         Enum.ToString () for Operator in Binary. Significant recover of
14346         performance.
14347
14348 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
14349
14350         * class.cs (FindMembers): Allow the Builders of the various
14351         members to be null.  If they are skip them.  This only happens
14352         during the PInvoke declaration.
14353
14354 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
14355
14356         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
14357         failure, so we do not keep going afterwards.
14358
14359         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
14360         wanted to pass `false' as the `is_delegate' argument.  If this is
14361         the case, why not use delegate_type == null to mean `is_delegate =
14362         false' and anything else as is_delegate = true.
14363
14364 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
14365
14366         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
14367         code for the section, not the beginning of the tests.
14368
14369 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * cfold.cs: Handle operator + (Enum x, Underlying x) 
14372
14373         * expression.cs (Binary): same.  Warn about errors where we have
14374         Enum/Enum in operator + as well.
14375
14376 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
14377
14378         * statement.cs:
14379                 - added support for switch(bool)
14380                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
14381                 - add TableSwitchEmit() to handle table-based switch statements
14382
14383 2002-04-05  Ravi Pratap  <ravi@ximian.com>
14384
14385         * expression.cs (Invocation.OverloadResolve): Factor out code which
14386         does parameter compatibility checking with arguments so that we can 
14387         re-use the code even from Delegate.VerifyApplicability
14388
14389         (VerifyArgumentsCompat): Move above code here.
14390
14391         * delegate.cs (VerifyApplicability): Get rid of duplicate code
14392         and instead make a call to the above method.
14393
14394 2002-03-31  Ravi Pratap  <ravi@ximian.com>
14395
14396         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
14397         We use it to keep track of classes which are attribute types.
14398
14399 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
14400
14401         * delegate.cs (Delegate.Define): Correctly define the types in the
14402         presence of fixed and array parameters.
14403
14404         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
14405         doing FindMembers.
14406
14407         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
14408         include NonPublic after the first iteration.
14409
14410         * class.cs (Indexer.CheckBase): Only check if both parents are
14411         non-null. 
14412
14413         * cs-parser.jay (accessor_body): If empty, set to null.
14414
14415         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
14416         same code path here to resolve constants names that we did have in
14417         MemberAccess.DoResolve.  There is too much code duplicated here.
14418
14419 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
14420
14421         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
14422
14423         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
14424         to MakeUnionSet.
14425
14426         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
14427         tokens, numbers and strings.
14428
14429         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
14430         parenthesis.
14431
14432         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
14433         asyncronous parameters and the regular parameters.  
14434
14435         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
14436         specify the target directory.
14437
14438         * expression.cs: (This.DoResolve): Simplify
14439         (As.Emit): Optimize, do not generate IsInst if the expression is
14440         always of the given type.
14441
14442         (Is.DoResolve): Bug fix, we were reporting both always/never for
14443         the is expression.
14444
14445         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
14446         creating too many unnecessary arrays.
14447
14448 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
14449
14450         * class.cs (EmitFieldInitializer): Use Assign expression to assign
14451         fields instead of rolling our own initializer.   Takes care of all
14452         implicit conversions, and drops unnecessary static checks/argument.
14453
14454 2002-03-31  Dick Porter  <dick@ximian.com>
14455
14456         * driver.cs: use the GetDirectories() return values properly, and
14457         use "/" as path separator.
14458
14459 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
14460
14461         * expression.cs (Unary): Optimize - - expr into expr.
14462         (Binary): Optimize a + (-b) into a -b.
14463
14464         * codegen.cs (CodeGen): Made all methods static.
14465
14466 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
14467
14468         * rootcontext.cs: 
14469
14470         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
14471         TypeBuilder property.
14472
14473         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
14474         instead. 
14475
14476         * tree.cs: Removed the various RecordXXXX, and replaced with a
14477         single RecordDecl.  Removed all the accessor methods, and just
14478         left a single access point Type 
14479
14480         * enum.cs: Rename DefineEnum to DefineType.
14481
14482         * decl.cs: New abstract method `DefineType' used to unify the
14483         Defines for Enumerations, Interfaces, TypeContainers and
14484         Delegates.
14485
14486         (FindType): Moved LookupInterfaceOrClass here.  Moved the
14487         LookupBaseClasses method that used to live in class.cs and
14488         interface.cs here, and renamed to FindType.
14489
14490         * delegate.cs: Implement DefineType.  Take advantage of the
14491         refactored pattern for locating the parent builder without taking
14492         the parent_builder argument (which we know does not work if we are
14493         nested, and triggering a toplevel definition).
14494
14495 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14496
14497         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
14498         accessibility of a member has changed during override and report
14499         an error if so.
14500
14501         * class.cs (Method.Define, Property.Define): Only complain on
14502         overrides if the method is private, any other accessibility is
14503         fine (and since we just checked the permission is the same, we are
14504         good to go).
14505
14506         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
14507         and elif are processed always.  The other pre-processing
14508         directives are only processed if we are "taking" the path
14509
14510 2002-03-29  Martin Baulig  <martin@gnome.org>
14511
14512         * class.cs (Method.Emit): Only emit symbolic debugging info if the
14513         current location is not Null.
14514
14515         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
14516         a separate method so we can profile it.
14517
14518         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
14519         `span.Seconds' are just seconds, but no minutes or hours.
14520         (MainDriver): Profile the CodeGen.SaveSymbols calls.
14521
14522 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14523
14524         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
14525         Remove the gratuitous set of Final:
14526
14527                                 // If an interface implementation, then we can set Final.
14528                                 if (((flags & MethodAttributes.Abstract) == 0) &&
14529                                     implementing.DeclaringType.IsInterface)
14530                                         flags |= MethodAttributes.Final;
14531
14532         I do not know what I was smoking when I used that.
14533
14534
14535         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
14536         step into fixing the name resolution issues for delegates and
14537         unifying the toplevel name resolution.
14538
14539 2002-03-28  Martin Baulig  <martin@gnome.org>
14540
14541         * class.cs (Method.Emit): If we have a symbol writer, call its
14542         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
14543         tell it about the current method.
14544
14545         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
14546         writer that we're going to emit the first byte of IL code for a new
14547         statement (a new source line).
14548         (EmitContext.EmitTopBlock): If we have a symbol writer, call
14549         EmitContext.Mark() before emitting any code.
14550
14551         * location.cs (SymbolDocument): Return null when we're Null.
14552
14553         * statement.cs (Statement): Moved the `Location loc' variable here.
14554         (Statement.EmitBoolExpression): If we have a symbol writer, call
14555         ec.Mark() before emitting any code to tell it that we're at the
14556         beginning of a new statement.
14557         (StatementExpression): Added `Location' argument to the constructor.
14558         (Block): Added public readonly variable `StartLocation' and public
14559         variable `EndLocation'.  The latter is to be set using SetEndLocation().
14560         (Block): Added constructor which takes a start and end location.
14561         (Block.SetEndLocation): New method. This sets the end location.
14562         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
14563         local variables we create.
14564         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
14565         each statement and do also mark the begin and end of the block.
14566
14567         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
14568         tell it the current lexer.Location, use Location.Null for the end of the
14569         block.
14570         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
14571         current block, set its end location using SetEndLocation().
14572         (statement_expression): StatementExpression constructor now takes the
14573         lexer.Location as additional argument.
14574         (for_statement, declare_local_variables): Likewise.
14575         (declare_local_variables): When creating a new implicit block, use the
14576         new Block constructor and pass it the lexer.Location.
14577
14578 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
14579
14580         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
14581         members also on the parent interfaces recursively.
14582
14583 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
14584
14585         * report.cs: Use new formats, since Gonzalo finished the missing
14586         bits. 
14587
14588         * expression.cs (Binary.ResolveOperator): added missing operator|
14589         operator& and operator^ for bool/bool.
14590
14591         * cs-parser.jay: CheckDef now takes a Location argument that is
14592         used to report errors more precisly (instead of reporting the end
14593         of a definition, we try to track something which is a lot closer
14594         to the source of the problem).
14595
14596         * cs-tokenizer.cs: Track global token use, so we can properly flag
14597         the use of #define/#undef after the first token has been seen.
14598
14599         Also, rename the reportXXXX to Error_DescriptiveName
14600
14601         * decl.cs (DeclSpace.IsTopLevel): Move property here from
14602         TypeContainer, so that Enum and Interface can use this too.
14603
14604         * class.cs (TypeContainer.LookupInterfaceOrClass,
14605         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
14606         `builder' argument.  Typically this was used to pass the parent
14607         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
14608         the definition).  
14609
14610         The problem is that a nested class could trigger the definition of
14611         a toplevel class, and the builder would be obviously wrong in that
14612         case. 
14613
14614         So we drop this argument, and we compute dynamically the
14615         TypeBuilder/ModuleBuilder (the correct information was available
14616         to us anyways from DeclSpace.Parent)
14617
14618         * interface.cs (Interface.DefineInterface): Drop builder
14619         parameter cleanup like class.cs
14620
14621         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
14622         like class.cs
14623
14624         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
14625         values. 
14626
14627         (Try.Emit): Propagate the returns value from the statement.
14628
14629         (Return.Emit): Even if we are leavning 
14630
14631         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
14632
14633         * modifiers.cs: Fix the computation of MethodAttributes flags.
14634
14635 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
14636
14637         * driver.cs: allow compilation of files that start with '/'.
14638         Add a default case when checking the argument of --target.
14639
14640 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
14641
14642         * interface.cs: Implement the same search algorithm for types in
14643         the interface code.
14644
14645         * delegate.cs: Do not allow multiple definition.
14646
14647         * Recovered ChangeLog that got accidentally amputated
14648
14649         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
14650
14651         * rootcontext.cs: Load manually enum to allow core classes to
14652         contain enumerations.
14653
14654         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
14655         Update to new static methods in TypeManager.
14656
14657         * typemanager.cs (GetMethod, GetConstructor): Use our
14658         implementation of FindMembers to find the members, since during
14659         corlib compilation, the types are TypeBuilders and GetMethod and
14660         GetConstructor do not work.
14661
14662         Make all methods in TypeManager static.
14663
14664         (InitCodeHelpers): Split the functionality from
14665         the InitCodeTypes function.
14666
14667         * driver.cs: Call InitCodeHelpers after we have populated the
14668         types. 
14669
14670         * cs-parser.jay (delegate_declaration): we did not used to compute
14671         the delegate name correctly for void delegates.
14672
14673 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
14674
14675         * rootcontext.cs (RootContext): Init the interface_resolve_order
14676         and type_container_resolve_order always.
14677
14678         (ResolveCore, BootstrapCorlib_ResolveClass,
14679         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
14680         compiler when compiling with --nostdlib
14681
14682         * class.cs (TypeContainer.DefineType): Check that our parent is
14683         not null.  This test is most important when we are bootstraping
14684         the core types.
14685
14686         * codegen.cs: Split out the symbol writing code.
14687
14688 2002-03-25  Martin Baulig  <martin@gnome.org>
14689
14690         * driver.cs (-g): Made -g an alias for --debug.
14691
14692 2002-03-24  Martin Baulig  <martin@gnome.org>
14693
14694         * codegen.cs (SymbolWriter): New public variable. Returns the
14695         current symbol writer.
14696         (CodeGen): Added `bool want_debugging_support' argument to the
14697          constructor. If true, tell the ModuleBuild that we want debugging
14698         support and ask it for the ISymbolWriter.
14699         (Save): If we have a symbol writer, call it's Close() method after
14700         saving the assembly.
14701
14702         * driver.c (--debug): New command line argument to create a
14703         debugger information file.
14704
14705         * location.cs (SymbolDocument): New public property. Returns an
14706         ISymbolDocumentWriter object for the current source file or null
14707         if we don't have a symbol writer.
14708
14709 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
14710
14711         * driver.cs (LoadAssembly): Correctly return when all the paths
14712         have been tried and not before.
14713
14714         * statement.cs (Switch.Emit): return the actual coverage for this
14715         statement (returns/not-returns)
14716
14717         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
14718         switch of the statement if we are the last switch section.  That
14719         kills two problems: try/catch problems (we used to emit an empty
14720         nop at the end) and switch statements where all branches would
14721         return. 
14722
14723 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
14724
14725         * driver.cs: Add default assemblies (the equivalent to the
14726         Microsoft CSC.RSP file)
14727
14728         * cs-tokenizer.cs: When updating `cols and setting it to zero,
14729         also update tokens_seen and set it to false.
14730
14731         * driver.cs: Implement --recurse for Mike.
14732
14733         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
14734         correctly splitting out the paths.
14735
14736 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
14737
14738         * interface.cs (Interface.PopulateProperty): Instead of using
14739         `parent' as the declaration space for the set parameters, use
14740         `this' 
14741
14742         * support.cs (InternalParameters): InternalParameters constructor
14743         takes a DeclSpace instead of a TypeContainer.
14744
14745         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
14746         types are being initialized, load the address of it before calling
14747         the function.  
14748
14749         (New): Provide a mechanism to disable the generation of local
14750         value type temporaries when the caller will be providing us with
14751         an address to store it.
14752
14753         (ArrayCreation.EmitDynamicInitializers): Use it.
14754
14755 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
14756
14757         * expression.cs (Invocation.EmitArguments): Only probe for array
14758         property if there is more than one argument.  Sorry about that.
14759
14760         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
14761         empty param arrays.
14762
14763         * class.cs (Method.LabelParameters): Fix incorrect code path that
14764         prevented the `ParamArrayAttribute' from being applied to the
14765         params attribute.
14766
14767 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
14768
14769         * support.cs (ReflectionParameters): Correctly compute whether the
14770         last argument is a params array.  Fixes the problem with
14771         string.Split ('a')
14772
14773         * typemanager.cs: Make the assemblies array always be non-null
14774         (empty, but non-null)
14775
14776         * tree.cs (RecordDecl): New function that abstracts the recording
14777         of names.  This reports error 101, and provides a pointer to the
14778         previous declaration.  Fixes a crash in the compiler.
14779
14780         * cs-parser.jay (constructor_declaration): Update to new grammar,
14781         and provide a constructor_body that can be empty.
14782
14783 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
14784
14785         * driver.cs: Add support for --resources.
14786
14787         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
14788         Make all types for the various array helper methods be integer.
14789
14790         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
14791         CheckState to ConvCast.
14792
14793         (ConvCast): Now it takes a `checked' state argument, to avoid
14794         depending on the emit context for the conversion, and just using
14795         the resolve time setting.
14796
14797         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
14798         instead of Invocation.EmitArguments.  We do not emit the original
14799         arguments, instead we emit those which have been converted to
14800         unsigned int expressions.
14801
14802         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
14803
14804         * codegen.cs: ditto.
14805
14806         * expression.cs (LocalVariableReference): Drop the use of the
14807         Store function that depended on the variable index.
14808
14809         * statement.cs (VariableInfo): Drop the `Idx' property from this
14810         class, as this is not taking into account the indexes for
14811         temporaries tat we generate during the execution, getting the
14812         indexes wrong.
14813
14814         * class.cs: First emit class initializers, then call the parent
14815         constructor. 
14816
14817         * expression.cs (Binary): Fix opcode emision.
14818         (UnaryMutator.EmitCode): Support checked code generation
14819
14820         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
14821         matches for events for both the Static and Instance scans,
14822         pointing to the same element.   Fix that.
14823
14824 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
14825
14826         * rootcontext.cs (ResolveTree): Always set the
14827         interface_resolve_order, because nested interfaces will be calling
14828         into us.
14829
14830         * class.cs (GetInterfaceOrClass): Track the same resolution
14831         process used by TypeManager.LookupType.  This fixes the nested
14832         type lookups in class declarations (separate path from
14833         LookupType). 
14834
14835         (TypeContainer.DefineType): Also define nested interfaces.
14836         (TypeContainer.RegisterOrder): New public function used to
14837         register the order in which child interfaces need to be closed.
14838
14839         Nested interfaces need to be closed after their parents have been
14840         created. 
14841
14842         * interface.cs (InterfaceAttr): Put all the logic for computing
14843         the interface attribute here. 
14844
14845         (DefineInterface): Register our interface order with the
14846         RootContext or with the TypeContainer depending on the case.
14847
14848 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14849
14850         * cs-parser.jay: rework foreach statement to work with the new
14851         changes to the policy on SimpleNames.
14852
14853         * report.cs: support Stacktrace on warnings as well.
14854
14855         * makefile: drop --unsafe and /unsafe from the compile.
14856
14857 2002-03-13  Ravi Pratap  <ravi@ximian.com>
14858
14859         * ecore.cs (StandardConversionExists): Modify to take an Expression
14860         as the first parameter. Ensure we do null -> reference type conversion
14861         checking.
14862
14863         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
14864         temporary Expression objects.
14865
14866 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
14867
14868         * interface.cs: workaround bug in method overloading resolution
14869         (there is already a bugzilla bug for it).
14870
14871 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
14872
14873         We could also solve this problem by having a separate path for
14874         performing type lookups, instead of DoResolve, we could have a
14875         ResolveType entry point, and only participating pieces of the
14876         production (simplename, deref, array) would implement this. 
14877
14878         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
14879         signal SimpleName to only resolve type names and not attempt to
14880         resolve anything else.
14881
14882         * expression.cs (Cast): Set the flag.
14883
14884         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
14885
14886         * class.cs: Only report 108 if there is no `new' modifier.
14887
14888         * cs-parser.jay: rework foreach statement to work with the new
14889         changes to the policy on SimpleNames.
14890         
14891         * report.cs: support Stacktrace on warnings as well.
14892
14893         * makefile: drop --unsafe and /unsafe from the compile.
14894
14895 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
14896
14897         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14898         lookups here, instead of doing that at parse time.  This means
14899         that our grammar will not introduce `LocalVariableReferences' as
14900         expressions at this point.  That solves the problem of code like
14901         this:
14902
14903         class X {
14904            static void Main ()
14905            { int X = 1;
14906             { X x = null }}}
14907
14908         This is only half the fix.  The full fix requires parameters to
14909         also be handled in this way.
14910
14911         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
14912         makes the use more obvious of the DeclSpace.  The
14913         ec.TypeContainer.TypeBuilder is now only used to pull the
14914         TypeBuilder for it.
14915
14916         My theory is that I can get rid of the TypeBuilder completely from
14917         the EmitContext, and have typecasts where it is used (from
14918         DeclSpace to where it matters).  
14919
14920         The only pending problem is that the code that implements Aliases
14921         is on TypeContainer, and probably should go in DeclSpace.
14922
14923         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
14924         lookups here, instead of doing that at parse time.  This means
14925         that our grammar will not introduce `LocalVariableReferences' as
14926         expressions at this point.  That solves the problem of code like
14927         this:
14928
14929         class X {
14930            static void Main ()
14931            { int X = 1;
14932             { X x = null }}}
14933
14934         This is only half the fix.  The full fix requires parameters to
14935         also be handled in this way.
14936
14937         * class.cs (Property.DefineMethod): When implementing an interface
14938         method, set newslot, when implementing an abstract method, do not
14939         set the flag (before we tried never setting it, or always setting
14940         it, which is the difference).
14941         (Indexer.DefineMethod): same.
14942         (Method.DefineMethod): same.
14943
14944         * ecore.cs: Only set the status used flag if we get back a Field.
14945
14946         * attribute.cs: Temporary hack, so Paolo can keep working.
14947
14948 2002-03-08  Ravi Pratap  <ravi@ximian.com>
14949
14950         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
14951         the unmanaged type in the case we have a MarshalAs attribute.
14952
14953         (Resolve): Handle the case when we are parsing the special MarshalAs
14954         attribute [we need to store the unmanaged type to use later]
14955
14956         * typemanager.cs (marshal_as_attr_type): Built in type for the 
14957         MarshalAs Attribute.
14958
14959         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
14960         on parameters and accordingly set the marshalling info.
14961
14962 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
14963
14964         * class.cs: Optimizing slightly by removing redundant code after
14965         we switched to the `NoTypes' return value.
14966         (Property.DefineMethod): use NoTypes here too.
14967
14968         This fixes the bug I introduced in my last batch of changes.
14969
14970 2002-03-05  Ravi Pratap  <ravi@ximian.com>
14971
14972         * tree.cs (RecordEnum): Add. We now keep track of enums too.
14973
14974         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
14975         Enums since those are types too. 
14976
14977         * cs-parser.jay (enum_declaration): Record enums as we parse them.
14978
14979         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
14980         thanks to a call during the lookup process.
14981
14982 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
14983
14984         * statement.cs (Foreach): Lots of work to accomodate a particular
14985         kind of foreach statement that I had not kept in mind.  It is
14986         possible to have foreachs on classes that provide a GetEnumerator
14987         method that return objects that implement the "pattern" for using
14988         a foreach, there is no need to support GetEnumerator
14989         specifically. 
14990
14991         This is needed to compile nant.
14992
14993         * decl.cs: Only report 114 if the member is not `Finalize' and if
14994         the warning level is at least 2.
14995
14996         * class.cs: Moved the compare function from Method to
14997         MethodSignature. 
14998
14999         (MethodSignature.InheritableMemberSignatureCompare): Add new
15000         filter function that is used to extract inheritable methods from a
15001         class. 
15002
15003         (Method.Define): Use the new `inheritable_method_signature_filter'
15004         delegate
15005
15006         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
15007         command. 
15008
15009 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
15010
15011         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
15012
15013         * cs-parser.jay: Add opt_semicolon to the interface declaration.
15014
15015         * expression.cs: Pass location information to
15016         ConvertImplicitStandard. 
15017
15018         * class.cs: Added debugging code to track return values from
15019         interfaces. 
15020
15021 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
15022
15023         * expression.cs (Is.DoResolve): If either side of the `is' is an
15024         interface, do not flag the warning.
15025
15026         * ecore.cs (ImplicitReferenceConversion): We need a separate test
15027         for interfaces
15028
15029         * report.cs: Allow for --fatal to be used with --probe.
15030
15031         * typemanager.cs (NoTypes): Move the definition for the empty Type
15032         array here. 
15033
15034         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
15035         properties. 
15036         (TypeContainer.DefineProxy): New function used to proxy to parent
15037         implementations when implementing interfaces.
15038         (TypeContainer.ParentImplements): used to lookup if our parent
15039         implements a public function that is required by an interface.
15040         (TypeContainer.VerifyPendingMethods): Hook this up.
15041
15042         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
15043         `modules' and `assemblies' arraylists into arrays.  We only grow
15044         these are the very early start up of the program, so this improves
15045         the speedof LookupType (nicely measured).
15046
15047         * expression.cs (MakeByteBlob): Replaced unsafe code with
15048         BitConverter, as suggested by Paolo.
15049
15050         * cfold.cs (ConstantFold.Binary): Special case: perform constant
15051         folding of string concatenation, but if either side is a string,
15052         and the other is not, then return null, and let the runtime use
15053         the concatenation on the string plus the object (using
15054         `Object.ToString'). 
15055
15056 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
15057
15058         Constant Folding has been implemented now.
15059
15060         * expression.cs (Unary.Reduce): Do not throw an exception, catch
15061         the error instead on types that are not supported in one's
15062         complement. 
15063
15064         * constant.cs (Constant and all children): New set of functions to
15065         perform implict and explicit conversions.
15066
15067         * ecore.cs (EnumConstant): Implement the new functions to perform
15068         conversion by proxying to the child expression.
15069
15070         * codegen.cs: (ConstantCheckState): Constant evaluation has its
15071         own separate setting that can not be turned off from the command
15072         line using --unchecked or --checked and is only controlled using
15073         the checked/unchecked statements and expressions.  This setting is
15074         used by the constant folder to flag errors.
15075
15076         * expression.cs (CheckedExpr, UncheckedExpr): Set the
15077         ConstantCheckState as well.   
15078
15079         During Resolve, they also have to flag the state, because the
15080         constant folder runs completely in the Resolve phase.
15081
15082         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
15083         well.
15084
15085 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15086
15087         * cfold.cs: New file, this file contains the constant folder.
15088
15089         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
15090         argument to track whether we are using the resulting address to
15091         load or store a value and provide better error messages. 
15092
15093         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
15094         new AddressOf arguments.
15095
15096         * statement.cs (Foreach.EmitCollectionForeach): Update
15097
15098         * expression.cs (Argument.Emit): Call AddressOf with proper
15099         arguments to track usage.
15100
15101         (New.DoEmit): Call AddressOf with new arguments.
15102
15103         (Unary.Emit): Adjust AddressOf call.
15104
15105 2002-03-01  Ravi Pratap  <ravi@ximian.com>
15106
15107         * cs-parser.jay (member_access): Change the case for pre-defined types
15108         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
15109         this suggestion.
15110
15111         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
15112         a method body.
15113
15114         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
15115         essentially like methods and apply attributes like MethodImplOptions to them too.
15116
15117         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
15118         not being null.
15119
15120         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
15121         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
15122         is the DeclSpace.
15123
15124         * Update code everywhere accordingly.
15125
15126         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
15127
15128         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
15129
15130 2002-02-28  Ravi Pratap  <ravi@ximian.com>
15131
15132         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
15133         try performing lookups against those instead of jumping straight into using
15134         the 'using' clauses.
15135
15136         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
15137
15138         (LookupType): Perform lookups in implicit parents too.
15139
15140         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
15141         sequence as RootContext.LookupType. 
15142
15143         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
15144         the various cases of namespace lookups into this method.
15145
15146 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
15147
15148         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
15149         in positional arguments)
15150
15151         * class.cs (Operator): Update the AllowedModifiers to contain
15152         extern. 
15153
15154         * cs-parser.jay: Update operator declaration to allow for the
15155         operator body to be empty.
15156
15157         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
15158         values. 
15159
15160 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
15161
15162         * class.cs (Method.Emit): Label parameters.
15163
15164         * driver.cs: Return 1 or 0 as the program exit code.
15165
15166 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
15167
15168         * expression.cs: Special case the `null' object when trying to
15169         auto-compute the type, as anything can be explicitly converted to
15170         that. 
15171
15172         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
15173         spotting this Paolo.
15174
15175         (Expression.ImplicitNumericConversion): Perform comparissions of
15176         the type using the underlying type in the case of an enumeration
15177         rather than using the enumeration type for the compare.
15178
15179         Cope with the underlying == type case, which is not possible to
15180         catch before. 
15181
15182         (Expression.ConvertNumericExplicit): Perform comparissions of
15183         the type using the underlying type in the case of an enumeration
15184         rather than using the enumeration type for the compare.
15185
15186         * driver.cs: If the user does not supply an extension, assume .exe
15187
15188         * cs-parser.jay (if_statement): Rewrote so that we can track the
15189         location for the if statement.
15190
15191         * expression.cs (Binary.ConstantFold): Only concat strings when
15192         the operation is "+", not everything ;-)
15193
15194         * statement.cs (Statement.EmitBoolExpression): Take a location
15195         argument. 
15196         (If, While, Do): Track location.
15197
15198         * expression.cs (Binary.ResolveOperator): In the object + string
15199         case, I was missing a call to ConvertImplicit
15200
15201 2002-02-25  Ravi Pratap  <ravi@ximian.com>
15202
15203         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
15204         Location arguments. Ensure we use RootContext.LookupType to do our work
15205         and not try to do a direct Type.GetType and ModuleBuilder.GetType
15206
15207         * interface.cs (PopulateMethod): Handle the type of the parameter being
15208         null gracefully.
15209
15210         * expression.cs (Invocation.BetterFunction): Handle the case when we 
15211         have a params method with no fixed arguments and a call is made with no
15212         arguments.
15213
15214 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
15215
15216         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
15217         the verbatim-string-literal
15218
15219         * support.cs (InternalParameters.ParameterModifier): handle null
15220         fixed parameters.
15221         (InternalParameters.ParameterType): ditto.
15222
15223         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
15224         duplicating the name of the variable parameter.
15225         (GetParameterByName): Fix bug where we were not looking up array
15226         paramters if they were the only present (thanks Paolo!).
15227         (GetParameterInfo): We only have an empty set of types if both
15228         fixed and array are set to null.
15229         (GetParameterInfo-idx): Handle FixedParameter == null
15230
15231         * cs-parser.jay: Handle the case where there is no catch
15232         statements (missing null test).
15233
15234 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
15235
15236         * driver.cs (MainDriver): Be conservative on our command line
15237         handling.
15238
15239         Catch DirectoryNotFoundException when calling GetFiles.
15240
15241         (SplitPathAndPattern): Used to split the input specification into
15242         a path and a pattern that we can feed to Directory.GetFiles.
15243
15244 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
15245
15246         * statement.cs (Fixed): Implement the last case of the Fixed
15247         statement (string handling).
15248
15249         * expression.cs (StringPtr): New class used to return a char * to
15250         a string;  Used by the Fixed statement.
15251
15252         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
15253
15254         * expression.cs (Binary.ResolveOperator): Remove redundant
15255         MemberLookup pn parent type.
15256         Optimize union call, we do not need a union if the types are the same.
15257         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
15258         type.
15259
15260         Specialize the use of MemberLookup everywhere, instead of using
15261         the default settings. 
15262
15263         (StackAlloc): Implement stackalloc keyword.
15264
15265         * cs-parser.jay: Add rule to parse stackalloc.
15266
15267         * driver.cs: Handle /h, /help, /?
15268
15269         * expression.cs (MakeByteBlob): Removed the hacks we had in place
15270         before we supported unsafe code.
15271
15272         * makefile: add --unsafe to the self compilation of mcs.
15273
15274 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
15275
15276         * expression.cs (PointerArithmetic): New class that is used to
15277         perform pointer arithmetic.
15278         (Binary.Resolve): Handle pointer arithmetic
15279         Handle pointer comparission.
15280         (ArrayPtr): Utility expression class that is used to take the
15281         address of an array.
15282
15283         (ElementAccess): Implement array access for pointers
15284
15285         * statement.cs (Fixed): Implement fixed statement for arrays, we
15286         are missing one more case before we are done.
15287
15288         * expression.cs (Indirection): Implement EmitAssign and set the
15289         ExprClass to Variable.  This allows pointer dereferences to be
15290         treated as variables, and to have values assigned to them.
15291
15292         * ecore.cs (Expression.StoreFromPtr): New utility function to
15293         store values dereferencing.
15294
15295 2002-02-20  Ravi Pratap  <ravi@ximian.com>
15296
15297         * expression.cs (Binary.ResolveOperator): Ensure that we are
15298         not trying to operate on a void type - this fixes the reported
15299         bug.
15300
15301         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
15302         the parent implementation is sealed.
15303
15304         * ../errors/cs0239.cs : Add.
15305
15306         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
15307
15308         * typemanager.cs (unverifiable_code_type): Corresponds to 
15309         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
15310         which have unsafe code in them.
15311
15312         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
15313         unsafe context.
15314
15315 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
15316
15317         * cs-tokenizer.cs: Add support for @"litreal strings"
15318
15319         Make tokenizer accept pre-processor directives
15320         on any column (remove the old C-like limitation). 
15321
15322         * rootcontext.cs (EmitCode): Emit any global attributes.
15323         (AddGlobalAttributes): Used to keep track of assembly attributes. 
15324
15325         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
15326
15327         * cs-parser.jay: Add support for global attributes.  
15328
15329 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
15330
15331         * expression.cs (Indirection): New helper class.  Unary will
15332         create Indirection classes to be able to implement the
15333         IMemoryLocation interface on it.
15334
15335 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
15336
15337         * cs-parser.jay (fixed_statement): reference the right statement.
15338
15339         * statement.cs (Fixed.Emit): Finish implementing the fixed
15340         statement for the &x case.
15341
15342 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
15343
15344         * class.cs (Property.Define, Method.Define): Remove newslot when
15345         `implementing'.  
15346
15347         * modifiers.cs: My use of NewSlot when `Abstract' was set was
15348         wrong.  NewSlot should only be used if the `new' keyword is present.
15349
15350         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
15351         locating our system dir.  Sorry about this.
15352
15353 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15354
15355         * driver.cs (GetSystemDir): Compute correctly the location of our
15356         system assemblies.  I was using the compiler directory instead of
15357         the library directory.
15358
15359 2002-02-13  Ravi Pratap  <ravi@ximian.com>
15360
15361         * expression.cs (BetterFunction): Put back in what Miguel commented out
15362         since it is the correct fix. The problem is elsewhere ;-)
15363
15364         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
15365         parameters of the parms method are themselves compatible or not !
15366
15367         (StandardConversionExists): Fix very dangerous bug where we were forgetting
15368         to check that a class implements an interface before saying that an implicit
15369         conversion was allowed. Use ImplementsInterface to do the checking.
15370
15371 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
15372
15373         * class.cs (Method.Define): Track whether we are an explicit
15374         implementation or not.  And only call DefineMethodOverride if we
15375         are an explicit implementation.
15376
15377         (Property.DefineMethod): Ditto.
15378
15379 2002-02-11  Ravi Pratap  <ravi@ximian.com>
15380
15381         * expression.cs (BetterFunction): Catch hideous bug which was
15382          preventing us from detecting ambiguous calls due to implicit casts i.e
15383         cs0121.
15384
15385 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
15386
15387         * support.cs (Pair): Remove un-needed method.  I figured why I was
15388         getting the error in cs-parser.jay, the variable in a foreach loop
15389         is readonly, and the compiler does not really treat this as a variable.
15390
15391         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
15392         instead of EQUALS in grammar.  
15393
15394         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
15395
15396         * expression.cs (Unary.DoResolve): Check whether the argument is
15397         managed or not.
15398
15399 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
15400
15401         * support.cs: Api for Pair to set a value.  Despite the fact that
15402         the variables are public the MS C# compiler refuses to compile
15403         code that accesses the field if the variable is part of a foreach
15404         statement. 
15405
15406         * statement.cs (Fixed): Begin implementation of the fixed
15407         statement.
15408
15409         (Block.AddVariable): Return the VariableInfo on success and null
15410         on failure instead of true/false. 
15411
15412         * cs-parser.jay (foreach): Catch errors on variables already
15413         defined (we were ignoring this value before) and properly unwind
15414         the block hierarchy
15415
15416         (fixed_statement): grammar for the fixed statement.
15417
15418 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
15419
15420         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
15421         pointer types to be incretemented.
15422
15423         (SizeOf): Implement.
15424
15425         * cs-parser.jay (pointer_member_access): Implement
15426         expr->IDENTIFIER production.
15427
15428         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
15429         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
15430         on safe contexts.
15431
15432         (Unary): Implement indirection.
15433
15434         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
15435         use in non-unsafe context).
15436
15437         (SimpleName.DoResolve): Check for pointers in field access on safe
15438         contexts. 
15439
15440         (Expression.LoadFromPtr): Factor the load-indirect code in this
15441         function.  This was duplicated in UnboxCast and ParameterReference
15442
15443 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
15444
15445         * expression.cs (ComposedCast): report an error if a pointer cast
15446         is used in a safe region.
15447
15448         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
15449         pointer type casts in unsafe context.
15450
15451         * codegen.cs (EmitContext): Set up IsUnsafe.
15452
15453         * cs-parser.jay (non_expression_type): Add productions for pointer
15454         casts. 
15455
15456         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
15457         code.  We should not use force into static mode if the method is
15458         not virtual.  Fixes bug in MIS
15459
15460         * statement.cs (Do.Emit, While.Emit, For.Emit,
15461         Statement.EmitBoolExpression): Add support to Do and While to
15462         propagate infinite loop as `I do return' semantics.
15463
15464         Improve the For case to also test for boolean constants.
15465
15466         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
15467         to the list of attributes we can add.
15468
15469         Remove `EmitContext' argument.
15470
15471         * class.cs (Method.Define): Apply parameter attributes.
15472         (Constructor.Define): Apply parameter attributes.
15473         (MethodCore.LabelParameters): Move here the core of labeling
15474         parameters. 
15475
15476         * support.cs (ReflectionParameters.ParameterModifier,
15477         InternalParameters.ParameterModifier): Use IsByRef on the type and
15478         only return the OUT bit for these parameters instead of in/out/ref
15479         flags.
15480
15481         This is because I miss-understood things.  The ParameterInfo.IsIn
15482         and IsOut represent whether the parameter has the [In] and [Out]
15483         attributes set.  
15484
15485 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
15486
15487         * ecore.cs (FieldExpr.Emit): Release temporaries.
15488
15489         * assign.cs (LocalTemporary.Release): new function.
15490
15491         * codegen.cs (EmitContext.GetTemporaryStorage,
15492         EmitContext.FreeTemporaryStorage): Rework the way we deal with
15493         temporary storage.  Now we can "put back" localbuilders when we
15494         are done with them
15495
15496 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
15497
15498         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
15499         need to make a copy of the variable to generate verifiable code.
15500
15501 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
15502
15503         * driver.cs: Compute dynamically the system directory.
15504
15505         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
15506         Slower, but more generally useful.  Used by the abstract
15507         registering implementation. 
15508
15509         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
15510         the rules for the special rule on Type/instances.  First check if
15511         we have the same name, and if so, try that special static path
15512         rather than the instance path.
15513
15514 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
15515
15516         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
15517         for, while and if.
15518
15519         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
15520         Enum, ValueType, Delegate or Array for non-corlib compiles.
15521
15522         * cs-tokenizer.cs: Catch long identifiers (645)
15523
15524         * typemanager.cs (IndexerPropetyName): Ravi never tested this
15525         piece of code.
15526
15527         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
15528         fix, we were returning too early, so we were not registering
15529         pending methods from abstract classes.
15530
15531         Do not register pending methods if the class is abstract.
15532
15533         * expression.cs (Conditional.DoResolve): Report circular implicit
15534         conversions when we neecd to compute it for conditional
15535         expressions. 
15536
15537         (Is.DoResolve): If the expression is always of the provided type,
15538         flag warning 183.  If the expression can not ever be of the
15539         provided type flag warning 184.
15540
15541         * class.cs: Catch 169 as well.
15542
15543         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
15544         read. 
15545
15546 2002-01-18  Nick Drochak  <ndrochak@gol.com>
15547
15548         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
15549
15550 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
15551
15552         * interface.cs: (PopulateMethod): Check for pointers being defined
15553         only if the unsafe context is active.
15554         (PopulateProperty): ditto.
15555         (PopulateIndexer): ditto.
15556
15557         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
15558         specified.  If pointers are present, make sure that they are
15559         present in an unsafe context.
15560         (Constructor, Constructor.Define): ditto.
15561         (Field, Field.Define): ditto.
15562         (Property, Property.Define): ditto.
15563         (Event, Event.Define): ditto.
15564
15565         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
15566         hashtable if there are classes or structs defined.
15567
15568         * expression.cs (LocalVariableReference.DoResolve): Simplify this
15569         code, as the constant resolution moved.
15570
15571         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
15572         the metadata, so we can flag error 133. 
15573
15574         * decl.cs (MemberCore.UnsafeOK): New function to test that a
15575         pointer is being declared in an unsafe context.
15576
15577 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
15578
15579         * modifiers.cs (Modifiers.Check): Require a Location argument.
15580         Report error 227 for Unsafe use.
15581
15582         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
15583
15584         * statement.cs (For.Emit): If the test is null, then report that
15585         we do `return', as we wont reach anything afterwards.
15586
15587         (Switch.SwitchGoverningType): Track the expression that matched
15588         the conversion.
15589
15590         * driver.cs: Allow negative numbers as an error code to flag.
15591
15592         * cs-parser.jay: Handle 1551.
15593
15594         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
15595
15596 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15597
15598         * cs-parser.jay: Report 1518 (type declaration can only contain
15599         class, struct, interface, enum or delegate)
15600
15601         (switch_label): Report 1523 (keywords `case' or `default' must
15602         preced code)
15603
15604         (opt_switch_sections): Report 1522 (empty switch)
15605
15606         * driver.cs: Report 1515 (response file specified multiple times)
15607         Report 1516 (Source file specified multiple times).
15608
15609         * expression.cs (Argument.Resolve): Signal 1510
15610
15611         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
15612         access not allowed in static code)
15613
15614 2002-01-11  Ravi Pratap  <ravi@ximian.com>
15615
15616         * typemanager.cs (IsPointerType): Utility method which we are going
15617         to need a lot.
15618
15619         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
15620         the object type, so we take care of that.
15621
15622         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
15623
15624         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
15625         added to non-params parameters :-)
15626
15627         * typemanager.cs (CSharpName): Include 'void' type too. 
15628
15629         (void_ptr_type): Include in the set of core types.
15630
15631         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
15632         duplicating code.
15633
15634         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
15635         an unsafe context.
15636
15637         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
15638         completely forgotten about it.
15639
15640 2002-01-10  Ravi Pratap  <ravi@ximian.com>
15641
15642         * cs-parser.jay (pointer_type): Add. This begins our implementation
15643         of parsing rules for unsafe code.
15644
15645         (unsafe_statement): Implement.
15646
15647         (embedded_statement): Modify to include the above.
15648
15649         * statement.cs (Unsafe): Implement new class for unsafe blocks.
15650
15651         * codegen.cs (EmitContext.InUnsafe): Add. This determines
15652         if the current context is an unsafe one.
15653
15654         * cs-parser.jay (local_variable_pointer_type): Since local variable types
15655         are handled differently, we need separate rules for them.
15656
15657         (local_variable_declaration): Update to use local_variable_pointer_type
15658         to allow variable declarations of unmanaged pointer types.
15659
15660         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
15661         in unsafe contexts.
15662
15663         * ../errors/cs0214.cs : Add.
15664
15665 2002-01-16  Nick Drochak  <ndrochak@gol.com>
15666
15667         * makefile: remove 'response' file when cleaning.
15668
15669 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
15670
15671         * cs-parser.jay: Report 1524.
15672
15673 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
15674
15675         * typemanager.cs (RegisterMethod): drop checking if we have
15676         registered this from here
15677
15678 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
15679
15680         * class.cs (Method.EmitDestructor): Implement calling our base
15681         destructor. 
15682
15683         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
15684         value of InFinally.
15685
15686         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
15687         this routine and will wrap the call in a try/catch block.  Deal
15688         with the case.
15689
15690 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
15691
15692         * ecore.cs (Expression.MemberLookup): instead of taking a
15693         parameter `same_type' that was used to tell whether we could
15694         access private members we compute our containing type from the
15695         EmitContext.
15696
15697         (FieldExpr): Added partial support for volatile fields.  This does
15698         not work for volatile fields exposed from assemblies, as I can not
15699         figure out how to extract the modreq from it.
15700
15701         Updated all the source files to use this.
15702
15703         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
15704         because it is referenced by MemberLookup very often. 
15705
15706 2002-01-09  Ravi Pratap  <ravi@ximian.com>
15707
15708         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
15709         TypeBuilder.GetCustomAttributes to retrieve what we need.
15710
15711         Get rid of redundant default_member_attr_type as this is the same as
15712         default_member_type which already exists.
15713
15714         * interface.cs, attribute.cs : Update accordingly.
15715
15716 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
15717
15718         * typemanager.cs: Enable IndexerPropertyName again.  It does not
15719         work for TYpeBuilders though.  Ravi, can you please fix this?
15720
15721         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
15722
15723         * expression.cs (Argument.Emit): Handle the case of ref objects
15724         being passed to ref functions;  
15725
15726         (ParameterReference.EmitLoad): Loads the content of the pointer
15727         without dereferencing.
15728
15729 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15730
15731         * cs-tokenizer.cs: Implemented the pre-processing expressions.
15732
15733 2002-01-08  Ravi Pratap  <ravi@ximian.com>
15734
15735         * class.cs (Indexer.DefineMethod): Incorporate the interface
15736         type in the name of the method if we are doing explicit interface
15737         implementation.
15738
15739         * expression.cs (ConversionExists): Remove as it is completely obsolete.
15740
15741         (BetterConversion): Fix extremely trivial bug where we were referring to
15742         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
15743         again !
15744
15745         * ../errors/bug16.cs : Add although we have fixed it.
15746
15747 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
15748
15749         * expression.cs (BaseIndexer): Begin implementation.
15750
15751         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
15752
15753         * cs-parser.jay (indexer_declarator): Use qualified_identifier
15754         production directly to remove a shift/reduce, and implement
15755         explicit interface implementation.
15756
15757         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
15758         after a floating point suffix.
15759
15760         * expression.cs (DoNumericPromotions): Improved the conversion for
15761         uint/uint.  If we have a constant, we avoid doing a typecast to a
15762         larger type.
15763
15764         * class.cs (Indexer): Implement explicit interface implementation
15765         for indexers.
15766
15767 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
15768
15769         * class.cs: make the default instance constructor public and hidebysig.
15770
15771 2001-01-03  Ravi Pratap  <ravi@ximian.com>
15772
15773         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
15774         so we can call it from elsewhere.
15775
15776         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
15777         we emit it internally if the class has a defined indexer; otherwise the user
15778         emits it by decorating the class definition with the DefaultMemberAttribute.
15779
15780         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
15781         attribute is not used on a type which defines an indexer.
15782
15783         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
15784         character when we skip whitespace.
15785
15786         * ../errors/cs0646.cs : Add.
15787
15788 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
15789
15790         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
15791         again. 
15792
15793         * makefile: Add practical target `mcs3.exe' which builds the third
15794         generation compiler. 
15795
15796         * expression.cs (New): Fix structures constructor calling.
15797
15798         * class.cs (Property, Method, Indexer): Emit Final flag on the
15799         method if we are an interface implementation and we are not
15800         abstract. 
15801
15802         * ecore.cs (PropertyExpr): New public field `IsBase', tells
15803         whether this property is referencing a `base' method.
15804
15805         * expression.cs (Invocation.EmitCall): take an extra argument:
15806         is_base, this is used to determine whether the `call' or
15807         `callvirt' opcode should be used.
15808
15809
15810         * delegate.cs: update EmitCall.
15811
15812         * class.cs (Method.Define): Set NewSlot for the cases where we are
15813         not implementing an interface method.
15814
15815         (Property.Define): ditto.
15816
15817 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
15818
15819         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
15820         'r'.  Allows mcs to parse itself fully.
15821
15822 2002-01-02  Ravi Pratap  <ravi@ximian.com>
15823
15824         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
15825         of the number of initializers that require the InitializeArray method.
15826
15827         (CheckIndices): Store the Expression in all cases - not the plain value. Also
15828         update the above field where necessary.
15829
15830         (MakeByteBlob): Update accordingly.
15831
15832         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
15833         greater than 2.
15834
15835         (EmitDynamicInitializers): Update in accordance with the new optimization.
15836
15837         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
15838         same OpCode applies.
15839
15840         * cs-parser.jay : Fix some glaring errors I introduced.
15841
15842 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
15843
15844         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
15845         so that we can check for name clashes there too.
15846
15847         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
15848         for interface indexers.
15849
15850         * interfaces.cs (Define): Emit the default member attribute.
15851
15852         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
15853         variable was being referred to while setting the value ;-)
15854
15855 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
15856
15857         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
15858         byte-by-byte information when we know the data is zero.
15859
15860         Make the block always a multiple of 4, because
15861         DefineInitializedData has a bug.
15862
15863         * assign.cs: Fix, we should assign from the temporary, not from
15864         the source. 
15865
15866         * expression.cs (MakeByteBlob): Fix my incorrect code.
15867
15868 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
15869
15870         * typemanager.cs (EnumToUnderlying): This function is used to get
15871         the underlying type from an enumeration, because it does not
15872         always work. 
15873
15874         * constant.cs: Use the I4_S form for values between -128 and 127.
15875
15876         * statement.cs (Block.LookupLabel): Looks up a label.
15877         (Block): Drop support for labeled blocks.
15878
15879         (LabeledStatement): New kind of statement that represents a label
15880         only.
15881
15882         (Goto): Finally implement this bad boy.
15883
15884         * cs-parser.jay: Update to reflect new mechanism to implement
15885         labels.
15886
15887 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
15888
15889         * codegen.cs (EmitContext.This): a codegen property that keeps the
15890         a single instance of this instead of creating many different this
15891         instances. 
15892
15893         * delegate.cs (Delegate.DoResolve): Update to use the property;
15894
15895         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
15896
15897         * expression.cs (BaseAccess.DoResolve): Ditto.
15898
15899 2001-12-29  Ravi Pratap  <ravi@ximian.com>
15900
15901         * typemanager.cs (methodimpl_attr_type): Add to hold the type
15902         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
15903
15904         (InitCoreTypes): Update accordingly.
15905
15906         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
15907         so we can quickly store the state.
15908
15909         (ApplyAttributes): Set the correct implementation flags
15910         for InternalCall methods.
15911
15912 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
15913
15914         * expression.cs (EmitCall): if a method is not virtual, then do
15915         not use callvirt on it.
15916
15917         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
15918         user defined stuff) requires the use of stobj, which takes an
15919         address on the stack instead of an array and an index.  So emit
15920         the Ldelema operation for it.
15921
15922         (EmitStoreOpcode): Use stobj for valuetypes.
15923
15924         (UnaryMutator.EmitCode): Use the right 1 value depending on
15925         whether we are dealing with int64/uint64, float or doubles.
15926
15927         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
15928         constructors that I implemented last night.
15929
15930         (Constructor.IsDefault): Fix to work properly for static
15931         constructors.
15932
15933         * cs-parser.jay (CheckDef): report method signature errors.
15934         Update error number 103 to be 132.
15935
15936         * decl.cs: New AdditionResult enumeration value: MethodExists.
15937         Although we do this check for methods later on in the semantic
15938         analysis, catching repeated default constructors is so easy that
15939         we catch these here. 
15940
15941         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
15942         promotions code.
15943
15944         (ParameterReference.EmitAssign, Emit): handle
15945         bools as bytes.
15946
15947         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
15948         (ArrayAccess.EmitStoreOpcode): ditto.
15949
15950         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
15951
15952         * expression.cs (MakeByteBlob): Complete all the missing types
15953         (uint, short, ushort, byte, sbyte)
15954
15955         * class.cs: Only init instance field initializers on instance
15956         constructors. 
15957
15958         Rename `constructors' to instance_constructors. 
15959
15960         (TypeContainer.AddConstructor): Only add constructors to the list
15961         if it is not static.
15962
15963         Make sure that we handle default_static_constructor independently
15964         everywhere where we handle instance_constructors
15965
15966 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
15967
15968         * class.cs: Do not lookup or create a base initializer for a
15969         static constructor.
15970
15971         (ConstructorInitializer.Resolve): use the proper type to lookup
15972         for constructors.
15973
15974         * cs-parser.jay: Report error 1585 (modifiers between type and name).
15975
15976         * enum.cs, interface.cs: Remove CloseType, this is taken care by
15977         in DeclSpace. 
15978
15979         * decl.cs: CloseType is now an virtual method, the default
15980         implementation just closes this type.
15981
15982 2001-12-28  Ravi Pratap  <ravi@ximian.com>
15983
15984         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
15985         to PreserveSig by default. Also emit HideBySig on such methods.
15986
15987         Basically, set the defaults to standard values.
15988
15989         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
15990         argument, if candidate is better, it can't be worse than the best !
15991
15992         (Invocation): Re-write bits to differentiate between methods being
15993         applicable in their expanded form and their normal form - for params
15994         methods of course.
15995
15996         Get rid of use_standard everywhere as only standard conversions are allowed
15997         in overload resolution. 
15998
15999         More spec conformance.
16000
16001 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16002
16003         * driver.cs: Add --timestamp, to see where the compiler spends
16004         most of its time.
16005
16006         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
16007         `this' in static code.
16008
16009         (SimpleName.DoResolve): Implement in terms of a helper function
16010         that allows static-references to be passed upstream to
16011         MemberAccess.
16012
16013         (Expression.ResolveWithSimpleName): Resolve specially simple
16014         names when called by MemberAccess to implement the special
16015         semantics. 
16016
16017         (Expression.ImplicitReferenceConversion): Handle conversions from
16018         Null to reference types before others, as Null's type is
16019         System.Object. 
16020
16021         * expression.cs (Invocation.EmitCall): Handle the special case of
16022         calling methods declared on a reference type from a ValueType
16023         (Base classes System.Object and System.Enum)
16024
16025         (MemberAccess.Resolve): Only perform lookups on Enumerations if
16026         the left hand side is a TypeExpr, not on every enumeration. 
16027
16028         (Binary.Resolve): If types are reference types, then do a cast to
16029         object on operators != and == of both arguments.
16030
16031         * typemanager.cs (FindMembers): Extract instance and static
16032         members if requested.
16033
16034         * interface.cs (PopulateProperty): Use void_type instead of null
16035         as the return type for the setter method.
16036
16037         (PopulateIndexer): ditto.
16038
16039 2001-12-27  Ravi Pratap  <ravi@ximian.com>
16040
16041         * support.cs (ReflectionParameters): Fix minor bug where we
16042         were examining the wrong parameter for the ParamArray attribute.
16043
16044         Cope with requests for the type of the parameter at position
16045         greater than the params parameter's. We now return the element
16046         type of the params array as that makes more sense.
16047
16048         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
16049         accordingly as we no longer have to extract the element type
16050         ourselves.
16051
16052         (Invocation.OverloadResolve): Update.
16053
16054 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
16055
16056         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
16057         against IEnumerator, test whether the return value is a descendant
16058         of the IEnumerator interface.
16059
16060         * class.cs (Indexer.Define): Use an auxiliary method to implement
16061         the other bits of the method definition.  Begin support for
16062         explicit interface implementation.
16063
16064         (Property.DefineMethod): Use TypeManager.void_type instead of null
16065         for an empty return value.
16066
16067 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
16068
16069         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
16070         dealing with a FieldExpr which is composed of a FieldBuilder, in
16071         the code path we did extract the constant, but we should have
16072         obtained the underlying value to be able to cast it (otherwise we
16073         end up in an infinite loop, this is what Ravi was running into).
16074
16075         (ArrayCreation.UpdateIndices): Arrays might be empty.
16076
16077         (MemberAccess.ResolveMemberAccess): Add support for section
16078         14.5.4.1 that deals with the special case of E.I when E is a type
16079         and something else, that I can be a reference to a static member.
16080
16081         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
16082         handle a particular array type to create byte blobs, it is just
16083         something we dont generate byteblobs for.
16084
16085         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
16086         arguments. 
16087
16088         * location.cs (Push): remove the key from the hashtable that we
16089         are about to add.   This happens for empty files.
16090
16091         * driver.cs: Dispose files after we have parsed them.
16092
16093         (tokenize): new function that only runs the tokenizer on its
16094         input, for speed testing.
16095
16096 2001-12-26  Ravi Pratap  <ravi@ximian.com>
16097
16098         * class.cs (Event.Define): Define the private field only if there
16099         are no accessors defined.
16100
16101         * expression.cs (ResolveMemberAccess): If there is no associated
16102         field with the event, that means we have an event defined with its
16103         own accessors and we should flag error cs0070 since transforming
16104         ourselves into a field is not valid in that case.
16105
16106         * ecore.cs (SimpleName.DoResolve): Same as above.
16107
16108         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
16109         and charset to sane values.
16110
16111 2001-12-25  Ravi Pratap  <ravi@ximian.com>
16112
16113         * assign.cs (DoResolve): Perform check on events only if they 
16114         are being accessed outside the declaring type.
16115
16116         * cs-parser.jay (event_declarations): Update rules to correctly
16117         set the type of the implicit parameter etc.
16118
16119         (add_accessor, remove_accessor): Set current local parameters.
16120
16121         * expression.cs (Binary): For delegate addition and subtraction,
16122         cast the return value from the method into the appropriate delegate
16123         type.
16124
16125 2001-12-24  Ravi Pratap  <ravi@ximian.com>
16126
16127         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
16128         of these as the workaround is unnecessary.
16129
16130         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
16131         delegate data - none of that is needed at all.
16132
16133         Re-write bits to extract the instance expression and the delegate method
16134         correctly.
16135
16136         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
16137         on delegates too.
16138
16139         * attribute.cs (ApplyAttributes): New method to take care of common tasks
16140         of attaching attributes instead of duplicating code everywhere.
16141
16142         * everywhere : Update code to do attribute emission using the above method.
16143
16144 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16145
16146         * expression.cs (IsParamsMethodApplicable): if there are not
16147         parameters, return immediately.
16148
16149         * ecore.cs: The 0 literal can be implicity converted to an enum
16150         type. 
16151
16152         (SimpleName.DoResolve): First lookup the type, then lookup the
16153         members. 
16154
16155         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
16156         want to get its address.  If the InstanceExpression is not
16157         addressable, store the result in a temporary variable, then get
16158         the address of it.
16159
16160         * codegen.cs: Only display 219 errors on warning level or above. 
16161
16162         * expression.cs (ArrayAccess): Make it implement the
16163         IMemoryLocation interface.
16164
16165         (Binary.DoResolve): handle the operator == (object a, object b)
16166         and operator != (object a, object b) without incurring into a
16167         BoxedCast (because 5 != o should never be performed).
16168
16169         Handle binary enumerator operators.
16170
16171         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
16172         value type, otherwise use Ldelem_ref.
16173
16174         Use precomputed names;
16175
16176         (AddressOf): Implement address of
16177
16178         * cs-parser.jay (labeled_statement): Fix recursive block
16179         addition by reworking the production.
16180
16181         * expression.cs (New.DoEmit): New has a special case:
16182                 
16183                  If we are dealing with a ValueType, we have a few
16184                  situations to deal with:
16185                 
16186                     * The target of New is a ValueType variable, that is
16187                       easy, we just pass this as the variable reference
16188                 
16189                     * The target of New is being passed as an argument,
16190                       to a boxing operation or a function that takes a
16191                       ValueType.
16192                 
16193                       In this case, we need to create a temporary variable
16194                       that is the argument of New.
16195
16196
16197 2001-12-23  Ravi Pratap  <ravi@ximian.com>
16198
16199         * rootcontext.cs (LookupType): Check that current_type is not null before
16200         going about looking at nested types.
16201
16202         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
16203         not implement the IAssignMethod interface any more.
16204
16205         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
16206         where we tranform them into FieldExprs if they are being resolved from within
16207         the declaring type.
16208
16209         * ecore.cs (SimpleName.DoResolve): Do the same here.
16210
16211         * assign.cs (DoResolve, Emit): Clean up code considerably. 
16212
16213         * ../errors/bug10.cs : Add.
16214
16215         * ../errors/cs0070.cs : Add.
16216
16217         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
16218
16219         * assign.cs : Get rid of EventIsLocal everywhere.
16220
16221 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
16222
16223         * ecore.cs (ConvertIntLiteral): finished the implementation.
16224
16225         * statement.cs (SwitchLabel): Convert the value we are using as a
16226         key before looking up the table.
16227
16228 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16229
16230         * codegen.cs (EmitTopBlock): Require a Location argument now.
16231
16232         * cs-parser.jay (constructor_declarator): We need to setup
16233         current_local_parameters before we parse the
16234         opt_constructor_initializer, to allow the variables to be bound
16235         to the constructor arguments.
16236
16237         * rootcontext.cs (LookupType): First lookup nested classes in our
16238         class and our parents before we go looking outside our class.
16239
16240         * expression.cs (ConstantFold): Extract/debox the values at the
16241         beginnning. 
16242
16243         * rootcontext.cs (EmitCode): Resolve the constants first before we
16244         resolve the types.  This is not really needed, but it helps debugging.
16245
16246         * statement.cs: report location.
16247
16248         * cs-parser.jay: pass location to throw statement.
16249
16250         * driver.cs: Small bug fix.
16251
16252         * report.cs: Updated format to be 4-zero filled digits.
16253
16254 2001-12-22  Ravi Pratap  <ravi@ximian.com>
16255
16256         * expression.cs (CheckIndices): Fix minor bug where the wrong
16257         variable was being referred to ;-)
16258
16259         (DoEmit): Do not call EmitStaticInitializers when the 
16260         underlying type is System.Object.
16261
16262 2001-12-21  Ravi Pratap  <ravi@ximian.com>
16263
16264         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
16265         and do the usual workaround for SRE.
16266
16267         * class.cs (MyEventBuilder.EventType): New member to get at the type
16268         of the event, quickly.
16269
16270         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
16271
16272         * assign.cs (Assign.DoResolve): Handle the case when the target
16273         is an EventExpr and perform the necessary checks.
16274
16275         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
16276         interface.
16277
16278         (SimpleName.MemberStaticCheck): Include check for EventExpr.
16279
16280         (EventExpr): Set the type in the constructor itself since we 
16281         are meant to be born fully resolved.
16282
16283         (EventExpr.Define): Revert code I wrote earlier.
16284                 
16285         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
16286         instance expression is null. The instance expression is a This in that case
16287         or a null, depending on whether it is a static method or not.
16288
16289         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
16290         refers to more than one method.
16291
16292         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
16293         and accordingly flag errors.
16294
16295 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16296
16297         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
16298
16299 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
16300
16301         * location.cs (ToString): Provide useful rutine.
16302
16303 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
16304
16305         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
16306         objects, return the actual integral boxed.
16307
16308         * statement.cs (SwitchLabel): define an ILLabel for each
16309         SwitchLabel. 
16310
16311         (Switch.CheckSwitch): If the value is a Literal, extract
16312         the underlying literal.
16313
16314         Also in the unused hashtable we had, add the SwitchLabel so we can
16315         quickly look this value up.
16316
16317         * constant.cs: Implement a bunch of new constants.  Rewrite
16318         Literal based on this.  Made changes everywhere to adapt to this.
16319
16320         * expression.cs (Expression.MakeByteBlob): Optimize routine by
16321         dereferencing array only once, and also copes with enumrations.
16322
16323         bytes are two bytes wide, not one.
16324
16325         (Cast): Perform constant conversions.
16326
16327         * ecore.cs (TryImplicitIntConversion): Return literals instead of
16328         wrappers to the literals here.
16329
16330         * expression.cs (DoNumericPromotions): long literals can converted
16331         to ulong implicity (this is taken care of elsewhere, but I was
16332         missing this spot).
16333
16334         * ecore.cs (Expression.Literalize): Make the return type Literal,
16335         to improve type checking.
16336
16337         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
16338
16339 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16340
16341         * literal.cs: Revert code from ravi that checked the bounds.  The
16342         bounds are sane by the definition of the type itself. 
16343
16344         * typemanager.cs: Fix implementation of ImplementsInterface.  We
16345         need to actually look up in our parent hierarchy for interfaces
16346         implemented. 
16347
16348         * const.cs: Use the underlying type for enumerations
16349
16350         * delegate.cs: Compute the basename for the delegate creation,
16351         that should fix the delegate test case, and restore the correct
16352         Type Lookup semantics in rootcontext
16353
16354         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
16355         referencing a nested type with the Reflection API is using the "+"
16356         sign. 
16357
16358         * cs-parser.jay: Do not require EOF token at the end.
16359
16360 2001-12-20  Ravi Pratap  <ravi@ximian.com>
16361
16362         * rootcontext.cs (LookupType): Concatenate type names with
16363         a '.' instead of a '+' The test suite passes again.
16364
16365         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
16366         field of the enumeration.
16367
16368         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
16369         the case when the member is an EventExpr.
16370
16371         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
16372         static has an associated instance expression.
16373
16374         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
16375
16376         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
16377
16378         * class.cs (Event.Define): Register event and perform appropriate checks
16379         for error #111.
16380
16381         We define the Add and Remove methods even if the use provides none because
16382         in that case, we provide default implementations ourselves.
16383
16384         Define a private field of the type of the event. This is done by the CSC compiler
16385         and we should be doing it too ;-)
16386
16387         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
16388         More methods we use in code we generate.
16389
16390         (multicast_delegate_type, delegate_type): Two separate types since the distinction
16391         is important.
16392
16393         (InitCoreTypes): Update accordingly for the above.
16394
16395         * class.cs (Event.Emit): Generate code for default accessors that we provide
16396
16397         (EmitDefaultMethod): Do the job in the above.
16398
16399         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
16400         appropriate place.
16401
16402 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
16403
16404         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
16405         builders even if we were missing one.
16406
16407         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
16408         pass the Basename as our class name instead of the Name.  The
16409         basename will be correctly composed for us.
16410
16411         * parameter.cs (Paramters): Now takes a Location argument.
16412
16413         * decl.cs (DeclSpace.LookupType): Removed convenience function and
16414         make all the code call directly LookupType in RootContext and take
16415         this chance to pass the Location information everywhere.
16416
16417         * Everywhere: pass Location information.
16418
16419 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
16420
16421         * class.cs (Constructor.Define): Updated way of detecting the
16422         length of the parameters.
16423
16424         (TypeContainer.DefineType): Use basename as the type name for
16425         nested types.
16426
16427         (TypeContainer.Define): Do not recursively define types here, as
16428         definition is taken care in order by the RootContext.
16429
16430         * tree.cs: Keep track of namespaces in a per-file basis.
16431
16432         * parameter.cs (Parameter.ComputeSignature): Update to use
16433         DeclSpace. 
16434
16435         (Parameters.GetSignature): ditto.
16436
16437         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
16438         instead of a TypeContainer.
16439
16440         (Interface.SemanticAnalysis): Use `this' instead of our parent to
16441         resolve names.  Because we need to be resolve in our context, not
16442         our parents.
16443
16444         * driver.cs: Implement response files.
16445
16446         * class.cs (TypeContainer.DefineType): If we are defined, do not
16447         redefine ourselves.
16448
16449         (Event.Emit): Emit the code for add/remove handlers.
16450         (Event.Define): Save the MethodBuilders for add/remove.
16451
16452         * typemanager.cs: Use pair here too.
16453
16454         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
16455         DictionaryEntry requires the first argument to be non-null.  
16456
16457         (enum_declaration): Compute full name for registering the
16458         enumeration.
16459
16460         (delegate_declaration): Instead of using
16461         formal_parameter_list, use opt_formal_parameter_list as the list
16462         can be empty.
16463
16464         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
16465         (EventParsing): New property that controls whether `add' and
16466         `remove' are returned as tokens or identifiers (for events);
16467
16468 2001-12-19  Ravi Pratap  <ravi@ximian.com>
16469
16470         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
16471         use MyEventBuilder only and let it wrap the real builder for us.
16472
16473         (MyEventBuilder): Revamp constructor etc.
16474
16475         Implement all operations that we perform on EventBuilder in precisely the same
16476         way here too.
16477
16478         (FindMembers): Update to use the EventBuilder member.
16479
16480         (Event.Emit): Update accordingly.
16481
16482 2001-12-18  Ravi Pratap  <ravi@ximian.com>
16483
16484         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
16485         by calling the appropriate methods.
16486
16487         (GetCustomAttributes): Make stubs as they cannot possibly do anything
16488         useful.
16489
16490         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
16491
16492 2001-12-17  Ravi Pratap  <ravi@ximian.com>
16493
16494         * delegate.cs (Delegate.Populate): Check that the return type
16495         and various parameters types are indeed accessible.
16496
16497         * class.cs (Constructor.Define): Same here.
16498
16499         (Field.Define): Ditto.
16500
16501         (Event.Define): Ditto.
16502
16503         (Operator.Define): Check that the underlying Method defined itself
16504         correctly - so it's MethodBuilder should not be null.
16505
16506         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
16507         expression happens to be null.
16508
16509         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
16510         members but as of now we don't seem to be able to do anything really useful with it.
16511
16512         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
16513         not the EventBuilder.
16514
16515 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
16516
16517         * cs-tokenizer.cs: Add support for defines.
16518         Add support for #if, #elif, #else, #endif
16519
16520         (eval_var): evaluates a variable.
16521         (eval): stubbed for evaluating functions.
16522
16523         * cs-parser.jay: Pass the defines information
16524
16525         * driver.cs: Add --define command line option.
16526
16527         * decl.cs: Move MemberCore here.
16528
16529         Make it the base class for DeclSpace.  This allows us to catch and
16530         report 108 and 109 for everything now.
16531
16532         * class.cs (TypeContainer.Define): Extract all the members
16533         before populating and emit the warning 108 (new keyword required
16534         to override) instead of having each member implement this.
16535
16536         (MemberCore.Define): New abstract method, we will be using this in
16537         the warning reporting engine in Populate.
16538
16539         (Operator.Define): Adjust to new MemberCore protocol. 
16540
16541         * const.cs (Const): This does not derive from Expression, it is a
16542         temporary object we use to create fields, it is a MemberCore. 
16543
16544         * class.cs (Method.Define): Allow the entry point to be in a
16545         specific class.
16546
16547         * driver.cs: Rewrite the argument handler to clean it up a bit.
16548
16549         * rootcontext.cs: Made it just an auxiliary namespace feature by
16550         making everything static.
16551
16552         * driver.cs: Adapt code to use RootContext type name instead of
16553         instance variable.
16554
16555         * delegate.cs: Remove RootContext argument.
16556
16557         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
16558         argument. 
16559
16560         * class.cs (Event.Define): The lookup can fail.
16561
16562         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
16563
16564         * expression.cs: Resolve the this instance before invoking the code.
16565
16566 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * cs-parser.jay: Add a production in element_access that allows
16569         the thing to become a "type" reference.  This way we can parse
16570         things like "(string [])" as a type.
16571
16572         Note that this still does not handle the more complex rules of
16573         casts. 
16574
16575
16576         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
16577
16578         * ecore.cs: (CopyNewMethods): new utility function used to
16579         assemble the list of methods from running FindMembers.
16580
16581         (MemberLookup): Rework FindMembers so that 
16582
16583 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
16584
16585         * class.cs (TypeContainer): Remove Delegates who fail to be
16586         defined.
16587
16588         * delegate.cs (Populate): Verify that we dont get null return
16589         values.   TODO: Check for AsAccessible.
16590
16591         * cs-parser.jay: Use basename to emit error 574 (destructor should
16592         have the same name as container class), not the full name.
16593
16594         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
16595         possible representation.  
16596
16597         Also implements integer type suffixes U and L.
16598
16599 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
16600
16601         * expression.cs (ArrayCreation.DoResolve): We need to do the
16602         argument resolution *always*.
16603
16604         * decl.cs: Make this hold the namespace.  Hold the root context as
16605         well.
16606         (LookupType): Move here.
16607
16608         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
16609
16610         * location.cs (Row, Name): Fixed the code, it was always returning
16611         references to the first file.
16612
16613         * interface.cs: Register properties defined through interfaces.
16614
16615         * driver.cs: Add support for globbing on the command line
16616
16617         * class.cs (Field): Make it derive from MemberCore as well.
16618         (Event): ditto.
16619
16620 2001-12-15  Ravi Pratap  <ravi@ximian.com>
16621
16622         * class.cs (Event::Define): Check that the type of the event is a delegate
16623         type else flag error #66.
16624
16625         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
16626         same.
16627
16628         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
16629         values of EntryPoint, CharSet etc etc.
16630
16631         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
16632
16633         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
16634         be null and we should ignore this. I am not sure if this is really clean. Apparently,
16635         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
16636         which needs this to do its work.
16637
16638         * ../errors/cs0066.cs : Add.
16639
16640 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
16641
16642         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
16643         helper functions.
16644
16645         * class.cs: (MethodSignature.MethodSignature): Removed hack that
16646         clears out the parameters field.
16647         (MemberSignatureCompare): Cleanup
16648
16649         (MemberCore): New base class used to share code between MethodCore
16650         and Property.
16651
16652         (RegisterRequiredImplementations) BindingFlags.Public requires
16653         either BindingFlags.Instace or Static.  Use instance here.
16654
16655         (Property): Refactored code to cope better with the full spec.
16656
16657         * parameter.cs (GetParameterInfo): Return an empty array instead
16658         of null on error.
16659
16660         * class.cs (Property): Abstract or extern properties have no bodies.
16661
16662         * parameter.cs (GetParameterInfo): return a zero-sized array.
16663
16664         * class.cs (TypeContainer.MethodModifiersValid): Move all the
16665         method modifier validation to the typecontainer so we can reuse
16666         this on properties.
16667
16668         (MethodCore.ParameterTypes): return an empty sized array of types.
16669
16670         (Property.Define): Test property modifier validity.
16671
16672         Add tests for sealed/override too.
16673
16674         (Method.Emit): abstract or extern methods have no bodies.
16675
16676 2001-12-14  Ravi Pratap  <ravi@ximian.com>
16677
16678         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
16679         thing.
16680
16681         (Method::Define, ::Emit): Modify accordingly.
16682
16683         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
16684
16685         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
16686
16687         * makefile: Pass in /unsafe.
16688
16689 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
16690
16691         * class.cs (MakeKey): Kill routine.
16692
16693         * class.cs (TypeContainer.Define): Correctly define explicit
16694         method implementations (they require the full interface name plus
16695         the method name).
16696
16697         * typemanager.cs: Deply the PtrHashtable here and stop using the
16698         lame keys.  Things work so much better.
16699
16700         This of course broke everyone who depended on `RegisterMethod' to
16701         do the `test for existance' test.  This has to be done elsewhere.
16702
16703         * support.cs (PtrHashtable): A hashtable that avoid comparing with
16704         the object stupid Equals method (because, that like fails all over
16705         the place).  We still do not use it.
16706
16707         * class.cs (TypeContainer.SetRequiredInterface,
16708         TypeContainer.RequireMethods): Killed these two routines and moved
16709         all the functionality to RegisterRequiredImplementations.
16710
16711         (TypeContainer.RegisterRequiredImplementations): This routine now
16712         registers all the implementations required in an array for the
16713         interfaces and abstract methods.  We use an array of structures
16714         which can be computed ahead of time to reduce memory usage and we
16715         also assume that lookups are cheap as most classes will not
16716         implement too many interfaces.
16717
16718         We also avoid creating too many MethodSignatures.
16719
16720         (TypeContainer.IsInterfaceMethod): Update and optionally does not
16721         clear the "pending" bit if we find that there are problems with
16722         the declaration.
16723
16724         (TypeContainer.VerifyPendingMethods): Update to report errors of
16725         methods that look like implementations but are not.
16726
16727         (TypeContainer.Define): Add support for explicit interface method
16728         implementation. 
16729
16730 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
16731
16732         * typemanager.cs: Keep track of the parameters here instead of
16733         being a feature of the TypeContainer.
16734
16735         * class.cs: Drop the registration of parameters here, as
16736         InterfaceMethods are also interface declarations.
16737
16738         * delegate.cs: Register methods with the TypeManager not only with
16739         the TypeContainer.  This code was buggy.
16740
16741         * interface.cs: Full registation here.
16742
16743 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
16744
16745         * expression.cs: Remove reducer for binary expressions, it can not
16746         be done this way.
16747
16748         * const.cs: Put here the code that used to go into constant.cs
16749
16750         * constant.cs: Put here the code for constants, this is a new base
16751         class for Literals.
16752
16753         * literal.cs: Make Literal derive from Constant.
16754
16755 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
16756
16757         * statement.cs (Return.Emit): Report error 157 if the user
16758         attempts to return from a finally block.
16759
16760         (Return.Emit): Instead of emitting a return, jump to the end of
16761         the function.
16762
16763         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
16764         LocalBuilder to store the result of the function.  ReturnLabel is
16765         the target where we jump.
16766
16767
16768 2001-12-09  Radek Doulik  <rodo@ximian.com>
16769
16770         * cs-parser.jay: remember alias in current namespace
16771
16772         * ecore.cs (SimpleName::DoResolve): use aliases for types or
16773         namespaces
16774
16775         * class.cs (LookupAlias): lookup alias in my_namespace
16776
16777         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
16778         aliases hashtable
16779         (LookupAlias): lookup alias in this and if needed in parent
16780         namespaces
16781
16782 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
16783
16784         * support.cs: 
16785
16786         * rootcontext.cs: (ModuleBuilder) Made static, first step into
16787         making things static.  I need this to avoid passing the
16788         TypeContainer when calling ParameterType.
16789
16790         * support.cs (InternalParameters.ParameterType): Remove ugly hack
16791         that did string manipulation to compute the type and then call
16792         GetType.  Use Parameter.ParameterType instead.
16793
16794         * cs-tokenizer.cs: Consume the suffix for floating values.
16795
16796         * expression.cs (ParameterReference): figure out whether this is a
16797         reference parameter or not.  Kill an extra variable by computing
16798         the arg_idx during emission.
16799
16800         * parameter.cs (Parameters.GetParameterInfo): New overloaded
16801         function that returns whether a parameter is an out/ref value or not.
16802
16803         (Parameter.ParameterType): The type of the parameter (base,
16804         without ref/out applied).
16805
16806         (Parameter.Resolve): Perform resolution here.
16807         (Parameter.ExternalType): The full type (with ref/out applied).
16808
16809         * statement.cs (Using.Emit, Using.EmitExpression): Implement
16810         support for expressions on the using statement.
16811
16812 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
16813
16814         * statement.cs (Using.EmitLocalVariableDecls): Split the
16815         localvariable handling of the using statement.
16816
16817         (Block.EmitMeta): Keep track of variable count across blocks.  We
16818         were reusing slots on separate branches of blocks.
16819
16820         (Try.Emit): Emit the general code block, we were not emitting it. 
16821
16822         Check the type of the declaration to be an IDisposable or
16823         something that can be implicity converted to it. 
16824
16825         Emit conversions if required.
16826
16827         * ecore.cs (EmptyExpression): New utility class.
16828         (Expression.ImplicitConversionExists): New utility function.
16829
16830 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
16831
16832         * statement.cs (Using): Implement.
16833
16834         * expression.cs (LocalVariableReference): Support read only variables.
16835
16836         * statement.cs: Remove the explicit emit for the Leave opcode.
16837         (VariableInfo): Add a readonly field.
16838
16839 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
16840
16841         * ecore.cs (ConvCast): new class used to encapsulate the various
16842         explicit integer conversions that works in both checked and
16843         unchecked contexts.
16844
16845         (Expression.ConvertNumericExplicit): Use new ConvCast class to
16846         properly generate the overflow opcodes.
16847
16848 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16849
16850         * statement.cs: The correct type for the EmptyExpression is the
16851         element_type, not the variable type.  Ravi pointed this out.
16852
16853 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16854
16855         * class.cs (Method::Define): Handle PInvoke methods specially
16856         by using DefinePInvokeMethod instead of the usual one.
16857
16858         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
16859         above to do the task of extracting information and defining the method.
16860
16861 2001-12-04  Ravi Pratap  <ravi@ximian.com>
16862
16863         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
16864         of the condition for string type.
16865
16866         (Emit): Move that here. 
16867
16868         (ArrayCreation::CheckIndices): Keep string literals in their expression
16869         form.
16870
16871         (EmitDynamicInitializers): Handle strings appropriately.
16872
16873 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
16874
16875         * codegen.cs (EmitContext): Replace multiple variables with a
16876         single pointer to the current Switch statement.
16877
16878         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
16879         EmitContext.
16880
16881 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16882
16883         * statement.cs 
16884
16885         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
16886         default'.
16887
16888         (Foreach.Emit): Foreach on arrays was not setting
16889         up the loop variables (for break/continue).
16890
16891         (GotoCase): Semi-implented.
16892
16893 2001-12-03  Ravi Pratap  <ravi@ximian.com>
16894
16895         * attribute.cs (CheckAttribute): Handle system attributes by using
16896         Attribute.GetAttributes to examine information we need.
16897
16898         (GetValidPlaces): Same here.
16899
16900         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
16901
16902         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
16903
16904         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
16905
16906         (Method::Define): Set appropriate flags if we have a DllImport attribute.
16907
16908         (Method::Emit): Handle the case when we are a PInvoke method.
16909
16910 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
16911
16912         * expression.cs: Use ResolveWithSimpleName on compound names.
16913
16914 2001-12-02  Ravi Pratap  <ravi@ximian.com>
16915
16916         * constant.cs (EmitConstant): Make sure we resolve the associated expression
16917         before trying to reduce it.
16918
16919         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
16920
16921         * constant.cs (LookupConstantValue): Implement.
16922
16923         (EmitConstant): Use the above in emitting the constant.
16924
16925         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
16926         that are user-defined by doing a LookupConstantValue on them.
16927
16928         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
16929         too, like above.
16930
16931 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
16932
16933         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
16934
16935         (BaseAccess.DoResolve): Implement.
16936
16937         (MemberAccess.DoResolve): Split this routine into a
16938         ResolveMemberAccess routine that can be used independently
16939
16940 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
16941
16942         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
16943         As that share bits of the implementation.  Is returns a boolean,
16944         while As returns the Type that is being probed.
16945
16946 2001-12-01  Ravi Pratap  <ravi@ximian.com>
16947
16948         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
16949         instead of a Literal - much easier.
16950
16951         (EnumInTransit): Remove - utterly useless :-)
16952
16953         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
16954
16955         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
16956
16957         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
16958         chain when we have no associated expression.
16959
16960 2001-11-30  Ravi Pratap  <ravi@ximian.com>
16961
16962         * constant.cs (Define): Use Location while reporting the errror.
16963
16964         Also emit a warning when 'new' is used and there is no inherited
16965         member to hide.
16966
16967         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
16968         populated.
16969
16970         (LookupEnumValue): Implement to lookup an enum member's value and define it
16971         if necessary.
16972
16973         (Populate): Re-write accordingly to use the above routine.
16974
16975 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
16976
16977         * expression.cs (This): Fix prototype for DoResolveLValue to
16978         override the base class DoResolveLValue.
16979
16980         * cs-parser.cs: Report errors cs574 and cs575 (destructor
16981         declarations) 
16982
16983         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
16984         (we need to load the address of the field here).  This fixes
16985         test-22. 
16986
16987         (FieldExpr.DoResolveLValue): Call the DoResolve
16988         function to initialize the Instance expression.
16989
16990         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
16991         correctly the GetEnumerator operation on a value type.
16992
16993         * cs-parser.jay: Add more simple parsing error catches.
16994
16995         * statement.cs (Switch): Add support for string switches.
16996         Handle null specially.
16997
16998         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
16999
17000 2001-11-28  Ravi Pratap  <ravi@ximian.com>
17001
17002         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
17003
17004         (declare_local_constant): New helper function.
17005
17006         * statement.cs (AddConstant): Keep a separate record of constants
17007
17008         (IsConstant): Implement to determine if a variable is a constant.
17009
17010         (GetConstantExpression): Implement.
17011
17012         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
17013
17014         * statement.cs (IsVariableDefined): Re-write.
17015
17016 2001-11-27  Ravi Pratap  <ravi@ximian.com>
17017
17018         * class.cs (TypeContainer::FindMembers): Look for constants
17019         in the case when we are looking for MemberTypes.Field
17020
17021         * expression.cs (MemberAccess::DoResolve): Check that in the
17022         case we are a FieldExpr and a Literal, we are not being accessed
17023         by an instance reference.
17024
17025         * cs-parser.jay (local_constant_declaration): Implement.
17026
17027         (declaration_statement): Implement for constant declarations.
17028
17029 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
17030
17031         * statement.cs (Switch): Catch double defaults.
17032
17033         (Switch): More work on the switch() statement
17034         implementation.  It works for integral values now, need to finish
17035         string support.
17036
17037
17038 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17039
17040         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
17041         integer literals into other integer literals.  To be used by
17042         switch. 
17043
17044 2001-11-24  Ravi Pratap  <ravi@ximian.com>
17045
17046         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
17047         some memory.
17048
17049         (EmitDynamicInitializers): Cope with the above since we extract data
17050         directly from ArrayData now.
17051
17052         (ExpectInitializers): Keep track of whether initializers are mandatory
17053         or not.
17054
17055         (Bounds): Make it a hashtable to prevent the same dimension being 
17056         recorded for every element in that dimension.
17057
17058         (EmitDynamicInitializers): Fix bug which prevented the Set array method
17059         from being found.
17060
17061         Also fix bug which was causing the indices to be emitted in the reverse
17062         order.
17063
17064 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
17065
17066         * expression.cs (ArrayCreation): Implement the bits that Ravi left
17067         unfinished.  They do not work, because the underlying code is
17068         sloppy.
17069
17070 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17071
17072         * cs-parser.jay: Remove bogus fixme.
17073
17074         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
17075         on Switch statement.
17076
17077 2001-11-23  Ravi Pratap  <ravi@ximian.com>
17078
17079         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
17080         the same. 
17081
17082         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
17083         parameter. Apparently, any expression is allowed. 
17084
17085         (ValidateInitializers): Update accordingly.
17086
17087         (CheckIndices): Fix some tricky bugs thanks to recursion.
17088
17089         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
17090         I was being completely brain-dead.
17091
17092         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
17093         and re-write acordingly.
17094
17095         (DelegateInvocation): Re-write accordingly.
17096
17097         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
17098
17099         (MakeByteBlob): Handle types more correctly.
17100
17101         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
17102         initialization from expressions but it is incomplete because I am a complete
17103         Dodo :-|
17104
17105 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17106
17107         * statement.cs (If.Emit): Fix a bug that generated incorrect code
17108         on If.  Basically, we have to return `true' (ie, we do return to
17109         our caller) only if both branches of the if return.
17110
17111         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
17112         short-circuit operators, handle them as short circuit operators. 
17113
17114         (Cast.DoResolve): Resolve type.
17115         (Cast.Cast): Take an expression as the target type.
17116
17117         * cs-parser.jay (cast_expression): Remove old hack that only
17118         allowed a limited set of types to be handled.  Now we take a
17119         unary_expression and we resolve to a type during semantic
17120         analysis.
17121
17122         Use the grammar productions from Rhys to handle casts (this is
17123         not complete like Rhys syntax yet, we fail to handle that corner
17124         case that C# has regarding (-x), but we will get there.
17125
17126 2001-11-22  Ravi Pratap  <ravi@ximian.com>
17127
17128         * class.cs (EmitFieldInitializer): Take care of the case when we have a
17129         field which is an array type.
17130
17131         * cs-parser.jay (declare_local_variables): Support array initialization too.
17132
17133         * typemanager.cs (MakeKey): Implement.
17134
17135         (everywhere): Use the above appropriately.
17136
17137         * cs-parser.jay (for_statement): Update for array initialization while
17138         declaring variables.
17139
17140         * ecore.cs : The error message was correct, it's the variable's names that
17141         were misleading ;-) Make the code more readable.
17142
17143         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
17144         the correct type etc.
17145
17146         (ConvertExplicit): Handle Enum types by examining the underlying type.
17147
17148 2001-11-21  Ravi Pratap  <ravi@ximian.com>
17149
17150         * parameter.cs (GetCallingConvention): Always return
17151         CallingConventions.Standard for now.
17152
17153 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
17154
17155         * expression.cs (Binary.ResolveOperator): Update the values of `l'
17156         and `r' after calling DoNumericPromotions.
17157
17158         * ecore.cs: Fix error message (the types were in the wrong order).
17159
17160         * statement.cs (Foreach.ProbeCollectionType): Need to pass
17161         BindingFlags.Instance as well 
17162
17163         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
17164         implicit int literal conversion in an empty cast so that we
17165         propagate the right type upstream.
17166
17167         (UnboxCast): new class used to unbox value types.
17168         (Expression.ConvertExplicit): Add explicit type conversions done
17169         by unboxing.
17170
17171         (Expression.ImplicitNumericConversion): Oops, forgot to test for
17172         the target type before applying the implicit LongLiterals to ULong
17173         literal cast.
17174
17175 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
17176
17177         * cs-parser.jay (for_statement): Reworked the way For works: now
17178         we declare manually any variables that are introduced in
17179         for_initializer to solve the problem of having out-of-band code
17180         emition (that is what got for broken).
17181
17182         (declaration_statement): Perform the actual variable declaration
17183         that used to be done in local_variable_declaration here.
17184
17185         (local_variable_declaration): Do not declare anything, just pass
17186         the information on a DictionaryEntry
17187
17188 2001-11-20  Ravi Pratap  <ravi@ximian.com>
17189
17190         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
17191         re-write of the logic to now make it recursive.
17192
17193         (UpdateIndices): Re-write accordingly.
17194
17195         Store element data in a separate ArrayData list in the above methods.
17196
17197         (MakeByteBlob): Implement to dump the array data into a byte array.
17198
17199 2001-11-19  Ravi Pratap  <ravi@ximian.com>
17200
17201         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
17202         into CheckIndices.
17203
17204         * constant.cs (Define): Implement.
17205
17206         (EmitConstant): Re-write fully.
17207
17208         Pass in location info.
17209
17210         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
17211         respectively.
17212
17213         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
17214         DictionaryEntry since we need location info too.
17215
17216         (constant_declaration): Update accordingly.
17217
17218         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
17219         code into another method : UpdateIndices.
17220
17221 2001-11-18  Ravi Pratap  <ravi@ximian.com>
17222
17223         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
17224         some type checking etc.
17225
17226 2001-11-17  Ravi Pratap  <ravi@ximian.com>
17227
17228         * expression.cs (ArrayCreation::ValidateInitializers): Implement
17229         bits to provide dimension info if the user skips doing that.
17230
17231         Update second constructor to store the rank correctly.
17232
17233 2001-11-16  Ravi Pratap  <ravi@ximian.com>
17234
17235         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
17236         and try to implement.
17237
17238         * ../errors/cs0150.cs : Add.
17239
17240         * ../errors/cs0178.cs : Add.
17241
17242 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
17243
17244         * statement.cs: Implement foreach on multi-dimensional arrays. 
17245
17246         * parameter.cs (Parameters.GetParameterByName): Also lookup the
17247         name of the params argument.
17248
17249         * expression.cs: Use EmitStoreOpcode to get the right opcode while
17250         initializing the array.
17251
17252         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
17253         we can use this elsewhere.
17254
17255         * statement.cs: Finish implementation of foreach for single
17256         dimension arrays.
17257
17258         * cs-parser.jay: Use an out-of-band stack to pass information
17259         around, I wonder why I need this.
17260
17261         foreach_block: Make the new foreach_block the current_block.
17262
17263         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
17264         function used to return a static Parameters structure.  Used for
17265         empty parameters, as those are created very frequently.
17266
17267         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
17268
17269 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17270
17271         * interface.cs : Default modifier is private, not public. The
17272         make verify test passes again.
17273
17274 2001-11-15  Ravi Pratap  <ravi@ximian.com>
17275
17276         * support.cs (ReflectionParameters): Fix logic to determine
17277         whether the last parameter is a params one. Test 9 passes again.
17278
17279         * delegate.cs (Populate): Register the builders we define with
17280         RegisterParameterForBuilder. Test 19 passes again.
17281
17282         * cs-parser.jay (property_declaration): Reference $6 instead
17283         of $$ to get at the location.
17284
17285         (indexer_declaration): Similar stuff.
17286
17287         (attribute): Ditto.
17288
17289         * class.cs (Property): Register parameters for the Get and Set methods
17290         if they exist. Test 23 passes again.
17291
17292         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
17293         call to EmitArguments as we are sure there aren't any params arguments. 
17294         Test 32 passes again.
17295
17296         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
17297         IndexOutOfRangeException. 
17298
17299         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
17300         Test 33 now passes again.
17301
17302 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
17303
17304         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
17305         broke a bunch of things.  Will have to come up with a better way
17306         of tracking locations.
17307
17308         * statement.cs: Implemented foreach for single dimension arrays.
17309
17310 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17311
17312         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
17313         an error.  This removes the lookup from the critical path.
17314
17315         * cs-parser.jay: Removed use of temporary_loc, which is completely
17316         broken. 
17317
17318 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
17319
17320         * support.cs (ReflectionParameters.ParameterModifier): Report
17321         whether the argument is a PARAMS argument or not.
17322
17323         * class.cs: Set the attribute `ParamArrayAttribute' on the
17324         parameter argument.
17325
17326         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
17327         and cons_param_array_attribute (ConstructorInfo for
17328         ParamArrayAttribute)., 
17329
17330         * codegen.cs: Emit the return using the `Return' statement, that
17331         way we can report the error correctly for missing return values. 
17332
17333         * class.cs (Method.Emit): Clean up.
17334
17335         * expression.cs (Argument.Resolve): Take another argument: the
17336         location where this argument is used.  Notice that this is not
17337         part of the "Argument" class as to reduce the size of the
17338         structure (we know the approximate location anyways).
17339
17340         Test if the argument is a variable-reference, if not, then
17341         complain with a 206.
17342
17343         (Argument.Emit): Emit addresses of variables.
17344
17345         (Argument.FullDesc): Simplify.
17346
17347         (Invocation.DoResolve): Update for Argument.Resolve.
17348
17349         (ElementAccess.DoResolve): ditto.
17350
17351         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
17352         method should be virtual, as this method is always virtual.
17353
17354         (NewDelegate.DoResolve): Update for Argument.Resolve.
17355
17356         * class.cs (ConstructorInitializer.DoResolve): ditto.
17357
17358         * attribute.cs (Attribute.Resolve): ditto.
17359
17360 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
17361
17362         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
17363
17364         * expression.cs (ParameterReference): Drop IStackStorage and implement
17365         IAssignMethod instead. 
17366
17367         (LocalVariableReference): ditto.
17368
17369         * ecore.cs (FieldExpr): Drop IStackStorage and implement
17370         IAssignMethod instead. 
17371
17372 2001-11-13  Miguel de Icaza <miguel@ximian.com>
17373
17374         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
17375         enumerations that are used in heavily used structures derive from
17376         byte in a laughable and pathetic attempt to reduce memory usage.
17377         This is the kind of pre-optimzations that you should not do at
17378         home without adult supervision.
17379
17380         * expression.cs (UnaryMutator): New class, used to handle ++ and
17381         -- separatedly from the other unary operators.  Cleans up the
17382         code, and kills the ExpressionStatement dependency in Unary.
17383
17384         (Unary): Removed `method' and `Arguments' from this class, making
17385         it smaller, and moving it all to SimpleCall, so I can reuse this
17386         code in other locations and avoid creating a lot of transient data
17387         strucutres when not required.
17388
17389         * cs-parser.jay: Adjust for new changes.
17390
17391 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
17392
17393         * enum.cs (Enum.Populate): If there is a failure during
17394         definition, return
17395
17396         * cs-parser.jay (opt_enum_base): we used to catch type errors
17397         here, but this is really incorrect.  The type error should be
17398         catched during semantic analysis.
17399
17400 2001-12-11  Ravi Pratap  <ravi@ximian.com>
17401
17402         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
17403         current_local_parameters as expected since I, in my stupidity, had forgotten
17404         to do this :-)
17405
17406         * attribute.cs (GetValidPlaces): Fix stupid bug.
17407
17408         * class.cs (Method::Emit): Perform check on applicability of attributes.
17409
17410         (Constructor::Emit): Ditto.
17411
17412         (Field::Emit): Ditto.
17413
17414         (Field.Location): Store location information.
17415
17416         (Property, Event, Indexer, Operator): Ditto.
17417
17418         * cs-parser.jay (field_declaration): Pass in location for each field.
17419
17420         * ../errors/cs0592.cs : Add.
17421
17422 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17423
17424         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
17425
17426         (InitCoreTypes): Update accordingly.
17427
17428         (RegisterAttrType, LookupAttr): Implement.
17429
17430         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
17431         info about the same.
17432
17433         (Resolve): Update to populate the above as necessary.
17434
17435         (Error592): Helper.
17436
17437         (GetValidPlaces): Helper to the above.
17438
17439         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
17440
17441         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
17442
17443 2001-11-12  Ravi Pratap  <ravi@ximian.com>
17444
17445         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
17446
17447         * ../errors/cs0617.cs : Add.
17448
17449 2001-11-11  Ravi Pratap  <ravi@ximian.com>
17450
17451         * enum.cs (Emit): Rename to Populate to be more consistent with what
17452         we expect it to do and when exactly it is called.
17453
17454         * class.cs, rootcontext.cs : Update accordingly.
17455
17456         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
17457         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
17458
17459         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
17460
17461         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
17462         of a fieldinfo using the above, when dealing with a FieldBuilder.
17463
17464 2001-11-10  Ravi Pratap  <ravi@ximian.com>
17465
17466         * ../errors/cs0031.cs : Add.
17467
17468         * ../errors/cs1008.cs : Add.
17469
17470         * ../errrors/cs0543.cs : Add.
17471
17472         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
17473         enum type.
17474
17475         (FindMembers): Implement.
17476
17477         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
17478         enums and delegates too.
17479
17480         (enum_types): Rename to builder_to_enum.
17481
17482         (delegate_types): Rename to builder_to_delegate.
17483
17484         * delegate.cs (FindMembers): Implement.
17485
17486 2001-11-09  Ravi Pratap  <ravi@ximian.com>
17487
17488         * typemanager.cs (IsEnumType): Implement.
17489
17490         * enum.cs (Emit): Re-write parts to account for the underlying type
17491         better and perform checking etc.
17492
17493         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
17494         of the underlying type.
17495
17496         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
17497         value
17498
17499         * enum.cs (error31): Helper to report error #31.
17500
17501         * cs-parser.jay (enum_declaration): Store location of each member too.
17502
17503         * enum.cs (member_to_location): New hashtable. 
17504
17505         (AddEnumMember): Update location hashtable.
17506
17507         (Emit): Use the location of each member while reporting errors.
17508
17509 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
17510
17511         * cs-parser.jay: A for_initializer if is a
17512         local_variable_declaration really ammount to have an implicit
17513         block with the variable declaration and no initializer for for.
17514
17515         * statement.cs (For.Emit): Cope with null initializers.
17516
17517         This fixes the infinite loop on for initializers.
17518
17519 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
17520
17521         * enum.cs: More cleanup.
17522
17523         * ecore.cs: Remove dead code.
17524
17525         * class.cs (Property.Emit): More simplification.
17526         (Event.Emit): ditto.
17527
17528         Reworked to have less levels of indentation.
17529
17530 2001-11-08  Ravi Pratap  <ravi@ximian.com>
17531
17532         * class.cs (Property): Emit attributes.
17533
17534         (Field): Ditto.
17535
17536         (Event): Ditto.
17537
17538         (Indexer): Ditto.
17539
17540         (Operator): Ditto.
17541
17542         * enum.cs (Emit): Ditto.
17543
17544         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
17545         Enums too.
17546
17547         * class.cs (Field, Event, etc.): Move attribute generation into the
17548         Emit method everywhere.
17549
17550         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
17551         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
17552         as we had no way of defining nested enums !
17553
17554         * rootcontext.cs : Adjust code accordingly.
17555
17556         * typemanager.cs (AddEnumType): To keep track of enum types separately.
17557
17558 2001-11-07  Ravi Pratap  <ravi@ximian.com>
17559
17560         * expression.cs (EvalConstantExpression): Move into ecore.cs
17561
17562         * enum.cs (Enum): Rename some members and make them public and readonly
17563         according to our convention.
17564
17565         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
17566         nothing else.
17567
17568         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
17569
17570         (Enum::Emit): Write a simple version for now which doesn't try to compute
17571         expressions. I shall modify this to be more robust in just a while.
17572
17573         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
17574
17575         (TypeContainer::CloseType): Create the Enum types too.
17576
17577         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
17578
17579         * expression.cs (EvalConstantExpression): Get rid of completely.
17580
17581         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
17582         user-defined values and other cases.
17583
17584         (IsValidEnumLiteral): Helper function.
17585
17586         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
17587         out there in the case we had a literal FieldExpr.
17588
17589         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
17590
17591         (Literalize): Revamp a bit to take two arguments.
17592
17593         (EnumLiteral): New class which derives from Literal to wrap enum literals.
17594
17595 2001-11-06  Ravi Pratap  <ravi@ximian.com>
17596
17597         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
17598
17599         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
17600
17601         (Resolve): Use the above to ensure we have proper initializers.
17602
17603 2001-11-05  Ravi Pratap  <ravi@ximian.com>
17604
17605         * expression.cs (Expression::EvalConstantExpression): New method to 
17606         evaluate constant expressions.
17607
17608         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
17609
17610 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
17611
17612         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
17613         in an array.
17614
17615         (Binary.ResolveOperator): Handle operator != (object a, object b)
17616         and operator == (object a, object b);
17617
17618         (Binary.DoNumericPromotions): Indicate whether the numeric
17619         promotion was possible.
17620
17621         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
17622         Implement.  
17623
17624         Made the ArrayAccess implement interface IAssignMethod instead of
17625         IStackStore as the order in which arguments are passed reflects
17626         this.
17627
17628         * assign.cs: Instead of using expr.ExprClass to select the way of
17629         assinging, probe for the IStackStore/IAssignMethod interfaces.
17630
17631         * typemanager.cs: Load InitializeArray definition.
17632
17633         * rootcontext.cs (RootContext.MakeStaticData): Used to define
17634         static data that can be used to initialize arrays. 
17635
17636 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
17637
17638         * expression.cs: Handle operator== and operator!= for booleans.
17639
17640         (Conditioal.Reduce): Implement reducer for the ?: operator.
17641
17642         (Conditional.Resolve): Implement dead code elimination.
17643
17644         (Binary.Resolve): Catch string literals and return a new
17645         concatenated string.
17646
17647         (Unary.Reduce): Implement reduction of unary expressions.
17648
17649         * ecore.cs: Split out the expression core handling here.
17650
17651         (Expression.Reduce): New method used to perform constant folding
17652         and CSE.  This is needed to support constant-expressions. 
17653
17654         * statement.cs (Statement.EmitBoolExpression): Pass true and false
17655         targets, and optimize for !x.
17656
17657 2001-11-04  Ravi Pratap  <ravi@ximian.com>
17658
17659         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
17660         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
17661         set custom atttributes.
17662
17663         * literal.cs (Literal::GetValue): New abstract method to return the actual
17664         value of the literal, cast as an object.
17665
17666         (*Literal): Implement GetValue method.
17667
17668         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
17669         expressions to the arraylist but objects of type Argument.
17670
17671         * class.cs (TypeContainer::Emit): Emit our attributes too.
17672
17673         (Method::Emit, Constructor::Emit): Ditto.
17674
17675         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
17676         to be ignoring earlier.
17677
17678 2001-11-03  Ravi Pratap  <ravi@ximian.com>
17679
17680         * attribute.cs (AttributeSection::Define): Implement to do the business
17681         of constructing a CustomAttributeBuilder.
17682
17683         (Attribute): New trivial class. Increases readability of code.  
17684
17685         * cs-parser.jay : Update accordingly.
17686
17687         (positional_argument_list, named_argument_list, named_argument): New rules
17688
17689         (attribute_arguments): Use the above so that we are more correct.
17690
17691 2001-11-02  Ravi Pratap  <ravi@ximian.com>
17692
17693         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
17694         to perform all checks for a method with a params parameter.
17695
17696         (Invocation::OverloadResolve): Update to use the above method and therefore
17697         cope correctly with params method invocations.
17698
17699         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
17700         params too.
17701
17702         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
17703         constructors in our parent too because we can't afford to miss out on 
17704         protected ones ;-)
17705
17706         * attribute.cs (AttributeSection): New name for the class Attribute
17707
17708         Other trivial changes to improve readability.
17709
17710         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
17711         use the new class names.
17712
17713 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17714
17715         * class.cs (Method::Define): Complete definition for params types too
17716
17717         (Indexer::Define): Ditto.
17718
17719         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
17720         Cope everywhere with a request for info about the array parameter.
17721
17722 2001-11-01  Ravi Pratap  <ravi@ximian.com>
17723
17724         * tree.cs (RecordNamespace): Fix up to check for the correct key.
17725
17726         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
17727         local_variable_type to extract the string corresponding to the type.
17728
17729         (local_variable_type): Fixup the action to use the new helper method.
17730
17731         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
17732         go.
17733
17734         * expression.cs : Clean out code which uses the above.
17735
17736 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17737
17738         * typemanager.cs (RegisterMethod): Check if we already have an existing key
17739         and bale out if necessary by returning a false.
17740
17741         (RegisterProperty): Ditto.
17742
17743         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
17744         and print out appropriate error messages.
17745
17746         * interface.cs (everywhere): Ditto.
17747
17748         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
17749         location to constructor.
17750
17751         * class.cs (Property, Event, Indexer): Update accordingly.
17752
17753         * ../errors/cs111.cs : Added.
17754
17755         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
17756         of a method, as laid down by the spec.
17757
17758         (Invocation::OverloadResolve): Use the above method.
17759
17760 2001-10-31  Ravi Pratap  <ravi@ximian.com>
17761
17762         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
17763         now take a TypeContainer and a Parameters object.
17764
17765         (ParameterData): Modify return type of ParameterModifier method to be 
17766         Parameter.Modifier and not a string.
17767
17768         (ReflectionParameters, InternalParameters): Update accordingly.
17769
17770         * expression.cs (Argument::GetParameterModifier): Same here.
17771
17772         * support.cs (InternalParameters::ParameterType): Find a better way of determining
17773         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
17774         symbol in it at all so maybe this is only for now.
17775
17776 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17777
17778         * support.cs (InternalParameters): Constructor now takes an extra argument 
17779         which is the actual Parameters class.
17780
17781         (ParameterDesc): Update to provide info on ref/out modifiers.
17782
17783         * class.cs (everywhere): Update call to InternalParameters to pass in
17784         the second argument too.
17785
17786         * support.cs (ParameterData): Add ParameterModifier, which is a method 
17787         to return the modifier info [ref/out etc]
17788
17789         (InternalParameters, ReflectionParameters): Implement the above.
17790
17791         * expression.cs (Argument::ParameterModifier): Similar function to return
17792         info about the argument's modifiers.
17793
17794         (Invocation::OverloadResolve): Update to take into account matching modifiers 
17795         too.
17796
17797         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
17798         a new SetFormalParameters object which we pass to InternalParameters.
17799
17800 2001-10-30  Ravi Pratap  <ravi@ximian.com>
17801
17802         * expression.cs (NewArray): Merge into the ArrayCreation class.
17803
17804 2001-10-29  Ravi Pratap  <ravi@ximian.com>
17805
17806         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
17807         NewUserdefinedArray into one as there wasn't much of a use in having
17808         two separate ones.
17809
17810         * expression.cs (Argument): Change field's name to ArgType from Type.
17811
17812         (Type): New readonly property which returns the proper type, taking into 
17813         account ref/out modifiers.
17814
17815         (everywhere): Adjust code accordingly for the above.
17816
17817         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
17818         whether we are emitting for a ref or out parameter.
17819
17820         * expression.cs (Argument::Emit): Use the above field to set the state.
17821
17822         (LocalVariableReference::Emit): Update to honour the flag and emit the
17823         right stuff.
17824
17825         * parameter.cs (Attributes): Set the correct flags for ref parameters.
17826
17827         * expression.cs (Argument::FullDesc): New function to provide a full desc.
17828
17829         * support.cs (ParameterData): Add method ParameterDesc to the interface.
17830
17831         (ReflectionParameters, InternalParameters): Implement the above method.
17832
17833         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
17834         reporting errors.
17835
17836         (Invocation::FullMethodDesc): Ditto. 
17837
17838 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
17839
17840         * cs-parser.jay: Add extra production for the second form of array
17841         creation. 
17842
17843         * expression.cs (ArrayCreation): Update to reflect the above
17844         change. 
17845
17846         * Small changes to prepare for Array initialization.
17847
17848 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
17849
17850         * typemanager.cs (ImplementsInterface): interface might be null;
17851         Deal with this problem;
17852
17853         Also, we do store negative hits on the cache (null values), so use
17854         this instead of calling t.GetInterfaces on the type everytime.
17855
17856 2001-10-28  Ravi Pratap  <ravi@ximian.com>
17857
17858         * typemanager.cs (IsBuiltinType): New method to help determine the same.
17859
17860         * expression.cs (New::DoResolve): Get rid of array creation code and instead
17861         split functionality out into different classes.
17862
17863         (New::FormArrayType): Move into NewBuiltinArray.
17864
17865         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
17866         quite useless.
17867
17868         (NewBuiltinArray): New class to handle creation of built-in arrays.
17869
17870         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
17871         account creation of one-dimensional arrays.
17872
17873         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
17874
17875         (NewUserdefinedArray::DoResolve): Implement.
17876
17877         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
17878
17879         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
17880         we maintain inside the TypeManager. This is necessary to perform lookups on the
17881         module builder.
17882
17883         (LookupType): Update to perform GetType on the module builders too.     
17884
17885         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
17886
17887         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
17888
17889 2001-10-23  Ravi Pratap  <ravi@ximian.com>
17890
17891         * expression.cs (New::DoResolve): Implement guts of array creation.
17892
17893         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
17894
17895 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * expression.cs: Fix bug I introduced lsat night that broke
17898         Delegates. 
17899
17900         (Expression.Resolve): Report a 246 error (can not resolve name)
17901         if we find a SimpleName in the stream.
17902
17903         (Expression.ResolveLValue): Ditto.
17904
17905         (Expression.ResolveWithSimpleName): This function is a variant of
17906         ResolveName, this one allows SimpleNames to be returned without a
17907         warning.  The only consumer of SimpleNames is MemberAccess
17908
17909 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
17910
17911         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
17912         might arrive here.  I have my doubts that this is correct.
17913
17914         * statement.cs (Lock): Implement lock statement.
17915
17916         * cs-parser.jay: Small fixes to support `lock' and `using'
17917
17918         * cs-tokenizer.cs: Remove extra space
17919
17920         * driver.cs: New flag --checked, allows to turn on integer math
17921         checking. 
17922
17923         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
17924         Threading.Monitor.Exit 
17925
17926 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
17927
17928         * expression.cs (IndexerAccess::DoResolveLValue): Set the
17929         Expression Class to be IndexerAccess.
17930
17931         Notice that Indexer::DoResolve sets the eclass to Value.
17932
17933 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * class.cs (TypeContainer::Emit): Emit code for indexers.
17936
17937         * assign.cs (IAssignMethod): New interface implemented by Indexers
17938         and Properties for handling assignment.
17939
17940         (Assign::Emit): Simplify and reuse code. 
17941
17942         * expression.cs (IndexerAccess, PropertyExpr): Implement
17943         IAssignMethod, clean up old code. 
17944
17945 2001-10-22  Ravi Pratap  <ravi@ximian.com>
17946
17947         * typemanager.cs (ImplementsInterface): New method to determine if a type
17948         implements a given interface. Provides a nice cache too.
17949
17950         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
17951         method.
17952
17953         (ConvertReferenceExplicit): Ditto.
17954
17955         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
17956         various methods, with correct names etc.
17957
17958         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
17959         Operator.UnaryNegation.
17960
17961         * cs-parser.jay (operator_declarator): Be a little clever in the case where
17962         we have a unary plus or minus operator.
17963
17964         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
17965         UnaryMinus.
17966
17967         * everywhere : update accordingly.
17968
17969         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
17970         respectively.
17971
17972         * class.cs (Method::Define): For the case where we are implementing a method
17973         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
17974         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
17975
17976 2001-10-21  Ravi Pratap  <ravi@ximian.com>
17977
17978         * interface.cs (FindMembers): Implement to work around S.R.E
17979         lameness.
17980
17981         * typemanager.cs (IsInterfaceType): Implement.
17982
17983         (FindMembers): Update to handle interface types too.
17984
17985         * expression.cs (ImplicitReferenceConversion): Re-write bits which
17986         use IsAssignableFrom as that is not correct - it doesn't work.
17987
17988         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
17989         and accordingly override EmitStatement.
17990
17991         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
17992         using the correct logic :-)
17993
17994 2001-10-19  Ravi Pratap  <ravi@ximian.com>
17995
17996         * ../errors/cs-11.cs : Add to demonstrate error -11 
17997
17998 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
17999
18000         * assign.cs (Assign::Resolve): Resolve right hand side first, and
18001         then pass this as a hint to ResolveLValue.
18002
18003         * expression.cs (FieldExpr): Add Location information
18004
18005         (FieldExpr::LValueResolve): Report assignment to readonly
18006         variable. 
18007
18008         (Expression::ExprClassFromMemberInfo): Pass location information.
18009
18010         (Expression::ResolveLValue): Add new method that resolves an
18011         LValue. 
18012
18013         (Expression::DoResolveLValue): Default invocation calls
18014         DoResolve. 
18015
18016         (Indexers): New class used to keep track of indexers in a given
18017         Type. 
18018
18019         (IStackStore): Renamed from LValue, as it did not really describe
18020         what this did.  Also ResolveLValue is gone from this interface and
18021         now is part of Expression.
18022
18023         (ElementAccess): Depending on the element access type
18024
18025         * typemanager.cs: Add `indexer_name_type' as a Core type
18026         (System.Runtime.CompilerServices.IndexerNameAttribute)
18027
18028         * statement.cs (Goto): Take a location.
18029
18030 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18031
18032         * delegate.cs (Delegate::VerifyDelegate): New method to verify
18033         if two delegates are compatible.
18034
18035         (NewDelegate::DoResolve): Update to take care of the case when
18036         we instantiate a delegate from another delegate.
18037
18038         * typemanager.cs (FindMembers): Don't even try to look up members
18039         of Delegate types for now.
18040
18041 2001-10-18  Ravi Pratap  <ravi@ximian.com>
18042
18043         * delegate.cs (NewDelegate): New class to take care of delegate
18044         instantiation.
18045
18046         * expression.cs (New): Split the delegate related code out into 
18047         the NewDelegate class.
18048
18049         * delegate.cs (DelegateInvocation): New class to handle delegate 
18050         invocation.
18051
18052         * expression.cs (Invocation): Split out delegate related code into
18053         the DelegateInvocation class.
18054
18055 2001-10-17  Ravi Pratap  <ravi@ximian.com>
18056
18057         * expression.cs (New::DoResolve): Implement delegate creation fully
18058         and according to the spec.
18059
18060         (New::DoEmit): Update to handle delegates differently.
18061
18062         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
18063         because of which we were printing out arguments in reverse order !
18064
18065         * delegate.cs (VerifyMethod): Implement to check if the given method
18066         matches the delegate.
18067
18068         (FullDelegateDesc): Implement.
18069
18070         (VerifyApplicability): Implement.
18071
18072         * expression.cs (Invocation::DoResolve): Update to accordingly handle
18073         delegate invocations too.
18074
18075         (Invocation::Emit): Ditto.
18076
18077         * ../errors/cs1593.cs : Added.
18078
18079         * ../errors/cs1594.cs : Added.
18080
18081         * delegate.cs (InstanceExpression, TargetMethod): New properties.
18082
18083 2001-10-16  Ravi Pratap  <ravi@ximian.com>
18084
18085         * typemanager.cs (intptr_type): Core type for System.IntPtr
18086
18087         (InitCoreTypes): Update for the same.
18088
18089         (iasyncresult_type, asynccallback_type): Ditto.
18090
18091         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
18092         correct.
18093
18094         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
18095         too.
18096
18097         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
18098         the builders for the 4 members of a delegate type :-)
18099
18100         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
18101         type.
18102
18103         * expression.cs (New::DoResolve): Implement guts for delegate creation.
18104
18105         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
18106
18107 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
18108
18109         * statement.cs (Break::Emit): Implement.   
18110         (Continue::Emit): Implement.
18111
18112         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18113         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18114         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
18115         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
18116         end loop
18117
18118         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
18119         properties that track the label for the current loop (begin of the
18120         loop and end of the loop).
18121
18122 2001-10-15  Ravi Pratap  <ravi@ximian.com>
18123
18124         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
18125         use of emitting anything at all.
18126
18127         * class.cs, rootcontext.cs : Get rid of calls to the same.
18128
18129         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
18130
18131         (Populate): Define the constructor correctly and set the implementation
18132         attributes.
18133
18134         * typemanager.cs (delegate_types): New hashtable to hold delegates that
18135         have been defined.
18136
18137         (AddDelegateType): Implement.
18138
18139         (IsDelegateType): Implement helper method.
18140
18141         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
18142
18143         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
18144         and accordingly handle it.
18145
18146         * delegate.cs (Populate): Take TypeContainer argument.
18147         Implement bits to define the Invoke method. However, I still haven't figured out
18148         how to take care of the native int bit :-(
18149
18150         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
18151         Qualify the name of the delegate, not its return type !
18152
18153         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
18154         conversion.
18155
18156         (StandardConversionExists): Checking for array types turns out to be recursive.
18157
18158         (ConvertReferenceExplicit): Implement array conversion.
18159
18160         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
18161
18162 2001-10-12  Ravi Pratap  <ravi@ximian.com>
18163
18164         * cs-parser.jay (delegate_declaration): Store the fully qualified
18165         name as it is a type declaration.
18166
18167         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
18168         readonly.
18169
18170         (DefineDelegate): Renamed from Define. Does the same thing essentially,
18171         as TypeContainer::DefineType.
18172
18173         (Populate): Method in which all the definition of the various methods (Invoke)
18174         etc is done.
18175
18176         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
18177         see.
18178
18179         (CloseDelegate): Finally creates the delegate.
18180
18181         * class.cs (TypeContainer::DefineType): Update to define delegates.
18182         (Populate, Emit and CloseType): Do the same thing here too.
18183
18184         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
18185         delegates in all these operations.
18186
18187 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
18188
18189         * expression.cs: LocalTemporary: a new expression used to
18190         reference a temporary that has been created.
18191
18192         * assign.cs: Handle PropertyAccess back here, so that we can
18193         provide the proper semantic access to properties.
18194
18195         * expression.cs (Expression::ConvertReferenceExplicit): Implement
18196         a few more explicit conversions. 
18197
18198         * modifiers.cs: `NEW' modifier maps to HideBySig.
18199
18200         * expression.cs (PropertyExpr): Make this into an
18201         ExpressionStatement, and support the EmitStatement code path. 
18202
18203         Perform get/set error checking, clean up the interface.
18204
18205         * assign.cs: recognize PropertyExprs as targets, and if so, turn
18206         them into toplevel access objects.
18207
18208 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
18209
18210         * expression.cs: PropertyExpr::PropertyExpr: use work around the
18211         SRE.
18212
18213         * typemanager.cs: Keep track here of our PropertyBuilders again to
18214         work around lameness in SRE.
18215
18216 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
18217
18218         * expression.cs (LValue::LValueResolve): New method in the
18219         interface, used to perform a second resolution pass for LValues. 
18220
18221         (This::DoResolve): Catch the use of this in static methods.
18222
18223         (This::LValueResolve): Implement.
18224
18225         (This::Store): Remove warning, assigning to `this' in structures
18226         is 
18227
18228         (Invocation::Emit): Deal with invocation of
18229         methods on value types.  We need to pass the address to structure
18230         methods rather than the object itself.  (The equivalent code to
18231         emit "this" for structures leaves the entire structure on the
18232         stack instead of a pointer to it). 
18233
18234         (ParameterReference::DoResolve): Compute the real index for the
18235         argument based on whether the method takes or not a `this' pointer
18236         (ie, the method is static).
18237
18238         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
18239         value types returned from functions when we need to invoke a
18240         method on the sturcture.
18241
18242
18243 2001-10-11  Ravi Pratap  <ravi@ximian.com>
18244
18245         * class.cs (TypeContainer::DefineType): Method to actually do the business of
18246         defining the type in the Modulebuilder or Typebuilder. This is to take
18247         care of nested types which need to be defined on the TypeBuilder using
18248         DefineNestedMethod.
18249
18250         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
18251         methods in RootContext, only ported to be part of TypeContainer.
18252
18253         (TypeContainer::GetInterfaceOrClass): Ditto.
18254
18255         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
18256
18257         * interface.cs (Interface::DefineInterface): New method. Does exactly
18258         what RootContext.CreateInterface did earlier, only it takes care of nested types 
18259         too.
18260
18261         (Interface::GetInterfaces): Move from RootContext here and port.
18262
18263         (Interface::GetInterfaceByName): Same here.
18264
18265         * rootcontext.cs (ResolveTree): Re-write.
18266
18267         (PopulateTypes): Re-write.
18268
18269         * class.cs (TypeContainer::Populate): Populate nested types too.
18270         (TypeContainer::Emit): Emit nested members too.
18271
18272         * typemanager.cs (AddUserType): Do not make use of the FullName property,
18273         instead just use the name argument passed in as it is already fully
18274         qualified.
18275
18276         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
18277         to TypeContainer mapping to see if a type is user-defined.
18278
18279         * class.cs (TypeContainer::CloseType): Implement. 
18280
18281         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
18282         the default constructor.
18283
18284         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
18285         twice.
18286
18287         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
18288
18289         * interface.cs (CloseType): Create the type here.
18290
18291         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
18292         the hierarchy.
18293
18294         Remove all the methods which are now in TypeContainer.
18295
18296 2001-10-10  Ravi Pratap  <ravi@ximian.com>
18297
18298         * delegate.cs (Define): Re-write bits to define the delegate
18299         correctly.
18300
18301 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
18302
18303         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
18304
18305         * expression.cs (ImplicitReferenceConversion): handle null as well
18306         as a source to convert to any reference type.
18307
18308         * statement.cs (Return): Perform any implicit conversions to
18309         expected return type.  
18310
18311         Validate use of return statement.  
18312
18313         * codegen.cs (EmitContext): Pass the expected return type here.
18314
18315         * class.cs (Method, Constructor, Property): Pass expected return
18316         type to EmitContext.
18317
18318 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
18319
18320         * expression.cs: Make DoResolve take an EmitContext instead of a
18321         TypeContainer.
18322
18323         Replaced `l' and `location' for `loc', for consistency.
18324
18325         (Error, Warning): Remove unneeded Tc argument.
18326
18327         * assign.cs, literal.cs, constant.cs: Update to new calling
18328         convention. 
18329
18330         * codegen.cs: EmitContext now contains a flag indicating whether
18331         code is being generated in a static method or not.
18332
18333         * cs-parser.jay: DecomposeQI, new function that replaces the old
18334         QualifiedIdentifier.  Now we always decompose the assembled
18335         strings from qualified_identifier productions into a group of
18336         memberaccesses.
18337
18338 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
18339
18340         * rootcontext.cs: Deal with field-less struct types correctly now
18341         by passing the size option to Define Type.
18342
18343         * class.cs: Removed hack that created one static field. 
18344
18345 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18346
18347         * statement.cs: Moved most of the code generation here. 
18348
18349 2001-10-09  Ravi Pratap  <ravi@ximian.com>
18350
18351         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
18352         seem very right.
18353
18354         (ElementAccess): Remove useless bits for now - keep checks as the spec
18355         says.
18356
18357 2001-10-08  Ravi Pratap  <ravi@ximian.com>
18358
18359         * expression.cs (ElementAccess::DoResolve): Remove my crap code
18360         and start performing checks according to the spec.
18361
18362 2001-10-07  Ravi Pratap  <ravi@ximian.com>
18363
18364         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
18365         rank_specifiers instead.
18366
18367         (rank_specifiers): Change the order in which the rank specifiers are stored
18368
18369         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
18370
18371         * expression.cs (ElementAccess): Implement the LValue interface too.
18372
18373 2001-10-06  Ravi Pratap  <ravi@ximian.com>
18374
18375         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
18376         except that user defined conversions are not included.
18377
18378         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
18379         perform the conversion of the return type, if necessary.
18380
18381         (New::DoResolve): Check whether we are creating an array or an object
18382         and accordingly do the needful.
18383
18384         (New::Emit): Same here.
18385
18386         (New::DoResolve): Implement guts of array creation.
18387
18388         (New::FormLookupType): Helper function.
18389
18390 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
18391
18392         * codegen.cs: Removed most of the code generation here, and move the
18393         corresponding code generation bits to the statement classes. 
18394
18395         Added support for try/catch/finalize and throw.
18396
18397         * cs-parser.jay: Added support for try/catch/finalize.
18398
18399         * class.cs: Catch static methods having the flags override,
18400         virtual or abstract.
18401
18402         * expression.cs (UserCast): This user cast was not really doing
18403         what it was supposed to do.  Which is to be born in fully resolved
18404         state.  Parts of the resolution were being performed at Emit time! 
18405
18406         Fixed this code.
18407
18408 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18409
18410         * expression.cs: Implicity convert the result from UserCast.
18411
18412 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18413
18414         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
18415         prevented it from working correctly. 
18416
18417         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
18418         merely ConvertImplicit.
18419
18420 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
18421
18422         * typemanager.cs: Make the LookupTypeContainer function static,
18423         and not per-instance.  
18424
18425         * class.cs: Make static FindMembers (the one that takes a Type
18426         argument). 
18427
18428         * codegen.cs: Add EmitForeach here.
18429
18430         * cs-parser.jay: Make foreach a toplevel object instead of the
18431         inline expansion, as we need to perform semantic analysis on it. 
18432
18433 2001-10-05  Ravi Pratap  <ravi@ximian.com>
18434
18435         * expression.cs (Expression::ImplicitUserConversion): Rename to
18436         UserDefinedConversion.
18437
18438         (Expression::UserDefinedConversion): Take an extra argument specifying 
18439         whether we look for explicit user conversions too.
18440
18441         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
18442
18443         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
18444
18445         (ExplicitUserConversion): Make it a call to UserDefinedConversion
18446         with the appropriate arguments.
18447
18448         * cs-parser.jay (cast_expression): Record location too.
18449
18450         * expression.cs (Cast): Record location info.
18451
18452         (Expression::ConvertExplicit): Take location argument.
18453
18454         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
18455         to determine if we are doing explicit conversions.
18456
18457         (UserCast::Emit): Update accordingly.
18458
18459         (Expression::ConvertExplicit): Report an error if everything fails.
18460
18461         * ../errors/cs0030.cs : Add.
18462
18463 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
18464
18465         * modifiers.cs: If the ABSTRACT keyword is present, also set the
18466         virtual and newslot bits. 
18467
18468         * class.cs (TypeContainer::RegisterRequiredImplementations):
18469         Record methods we need.
18470
18471         (TypeContainer::MakeKey): Helper function to make keys for
18472         MethodBases, since the Methodbase key is useless.
18473
18474         (TypeContainer::Populate): Call RegisterRequiredImplementations
18475         before defining the methods.   
18476
18477         Create a mapping for method_builders_to_methods ahead of time
18478         instead of inside a tight loop.
18479
18480         (::RequireMethods):  Accept an object as the data to set into the
18481         hashtable so we can report interface vs abstract method mismatch.
18482
18483 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18484
18485         * report.cs: Make all of it static.
18486
18487         * rootcontext.cs: Drop object_type and value_type computations, as
18488         we have those in the TypeManager anyways.
18489
18490         Drop report instance variable too, now it is a global.
18491
18492         * driver.cs: Use try/catch on command line handling.
18493
18494         Add --probe option to debug the error reporting system with a test
18495         suite. 
18496
18497         * report.cs: Add support for exiting program when a probe
18498         condition is reached.
18499
18500 2001-10-03  Ravi Pratap  <ravi@ximian.com>
18501
18502         * expression.cs (Binary::DoNumericPromotions): Fix the case when
18503         we do a forcible conversion regardless of type, to check if 
18504         ForceConversion returns a null.
18505
18506         (Binary::error19): Use location to report error.
18507
18508         (Unary::error23): Use location here too.
18509
18510         * ../errors/cs0019.cs : Check in.
18511
18512         * ../errors/cs0023.cs : Check in.
18513
18514         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
18515         case of a non-null MethodInfo object with a length of 0 !
18516
18517         (Binary::ResolveOperator): Flag error if overload resolution fails to find
18518         an applicable member - according to the spec :-)
18519         Also fix logic to find members in base types.
18520
18521         (Unary::ResolveOperator): Same here.
18522
18523         (Unary::report23): Change name to error23 and make first argument a TypeContainer
18524         as I was getting thoroughly confused between this and error19 :-)
18525
18526         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
18527         (::FindMostEncompassedType): Implement.
18528         (::FindMostEncompassingType): Implement.
18529         (::StandardConversionExists): Implement.
18530
18531         (UserImplicitCast): Re-vamp. We now need info about most specific
18532         source and target types so that we can do the necessary conversions.
18533
18534         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
18535         mathematical union with no duplicates.
18536
18537 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
18538
18539         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
18540         in order from base classes to child classes, so that we can in
18541         child classes look up in our parent for method names and
18542         attributes (required for handling abstract, virtual, new, override
18543         constructs: we need to instrospect our base class, and if we dont
18544         populate the classes in order, the introspection might be
18545         incorrect.  For example, a method could query its parent before
18546         the parent has any methods and would determine that the parent has
18547         no abstract methods (while it could have had them)).
18548
18549         (RootContext::CreateType): Record the order in which we define the
18550         classes.
18551
18552 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
18553
18554         * class.cs (TypeContainer::Populate): Also method definitions can
18555         fail now, keep track of this.
18556
18557         (TypeContainer::FindMembers): Implement support for
18558         DeclaredOnly/noDeclaredOnly flag.
18559
18560         (Constructor::Emit) Return the ConstructorBuilder.
18561
18562         (Method::Emit) Return the MethodBuilder. 
18563         Check for abstract or virtual methods to be public.
18564
18565         * rootcontext.cs (RootContext::CreateType): Register all the
18566         abstract methods required for the class to be complete and the
18567         interface methods that must be implemented. 
18568
18569         * cs-parser.jay: Report error 501 (method requires body if it is
18570         not marked abstract or extern).
18571
18572         * expression.cs (TypeOf::Emit): Implement.
18573
18574         * typemanager.cs: runtime_handle_type, new global type.
18575
18576         * class.cs (Property::Emit): Generate code for properties.
18577
18578 2001-10-02  Ravi Pratap  <ravi@ximian.com>
18579
18580         * expression.cs (Unary::ResolveOperator): Find operators on base type
18581         too - we now conform exactly to the spec.
18582
18583         (Binary::ResolveOperator): Same here.
18584
18585         * class.cs (Operator::Define): Fix minor quirk in the tests.
18586
18587         * ../errors/cs0215.cs : Added.
18588
18589         * ../errors/cs0556.cs : Added.
18590
18591         * ../errors/cs0555.cs : Added.
18592
18593 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18594
18595         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
18596         single integer which is really efficient
18597
18598 2001-10-01  Ravi Pratap  <ravi@ximian.com>
18599
18600         *  expression.cs (Expression::ImplicitUserConversion): Use location
18601         even in the case when we are examining True operators.
18602  
18603         * class.cs (Operator::Define): Perform extensive checks to conform
18604         with the rules for operator overloading in the spec.
18605
18606         * expression.cs (Expression::ImplicitReferenceConversion): Implement
18607         some of the other conversions mentioned in the spec.
18608
18609         * typemanager.cs (array_type): New static member for the System.Array built-in
18610         type.
18611
18612         (cloneable_interface): For System.ICloneable interface.
18613
18614         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
18615         we start resolving the tree and populating types.
18616
18617         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
18618  
18619 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
18620
18621         * expression.cs (Expression::ExprClassFromMemberInfo,
18622         Expression::Literalize): Create literal expressions from
18623         FieldInfos which are literals.
18624
18625         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
18626         type casts, because they were wrong.  The test suite in tests
18627         caught these ones.
18628
18629         (ImplicitNumericConversion): ushort to ulong requires a widening
18630         cast. 
18631
18632         Int32 constant to long requires widening cast as well.
18633
18634         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
18635         for integers because the type on the stack is not i4.
18636
18637 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
18638
18639         * expression.cs (report118): require location argument. 
18640
18641         * parameter.cs: Do not dereference potential null value.
18642
18643         * class.cs: Catch methods that lack the `new' keyword when
18644         overriding a name.  Report warnings when `new' is used without
18645         anything being there to override.
18646
18647         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
18648
18649         * class.cs: Only add constructor to hashtable if it is non-null
18650         (as now constructors can fail on define).
18651
18652         (TypeManager, Class, Struct): Take location arguments.
18653
18654         Catch field instance initialization in structs as errors.
18655
18656         accepting_filter: a new filter for FindMembers that is static so
18657         that we dont create an instance per invocation.
18658
18659         (Constructor::Define): Catch errors where a struct constructor is
18660         parameterless 
18661
18662         * cs-parser.jay: Pass location information for various new
18663         constructs. 
18664
18665         * delegate.cs (Delegate): take a location argument.
18666
18667         * driver.cs: Do not call EmitCode if there were problesm in the
18668         Definition of the types, as many Builders wont be there. 
18669
18670         * decl.cs (Decl::Decl): Require a location argument.
18671
18672         * cs-tokenizer.cs: Handle properly hex constants that can not fit
18673         into integers, and find the most appropiate integer for it.
18674
18675         * literal.cs: Implement ULongLiteral.
18676
18677         * rootcontext.cs: Provide better information about the location of
18678         failure when CreateType fails.
18679
18680 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
18681
18682         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
18683         as well.
18684
18685         * expression.cs (Binary::CheckShiftArguments): Add missing type
18686         computation.
18687         (Binary::ResolveOperator): Add type to the logical and and logical
18688         or, Bitwise And/Or and Exclusive Or code paths, it was missing
18689         before.
18690
18691         (Binary::DoNumericPromotions): In the case where either argument
18692         is ulong (and most signed types combined with ulong cause an
18693         error) perform implicit integer constant conversions as well.
18694
18695 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18696
18697         * expression.cs (UserImplicitCast): Method should always be
18698         non-null. 
18699         (Invocation::BetterConversion): Simplified test for IntLiteral.
18700
18701         (Expression::ImplicitNumericConversion): Split this routine out.
18702         Put the code that performs implicit constant integer conversions
18703         here. 
18704
18705         (Expression::Resolve): Become a wrapper around DoResolve so we can
18706         check eclass and type being set after resolve.
18707
18708         (Invocation::Badness): Remove this dead function
18709
18710         (Binary::ResolveOperator): Do not compute the expensive argumnets
18711         unless we have a union for it.
18712
18713         (Probe::Emit): Is needs to do an isinst and then
18714         compare against null.
18715
18716         (::CanConvert): Added Location argument.  If the Location argument
18717         is null (Location.Null), then we do not report errors.  This is
18718         used by the `probe' mechanism of the Explicit conversion.  We do
18719         not want to generate an error for something that the user
18720         explicitly requested to be casted.  But the pipeline for an
18721         explicit cast first tests for potential implicit casts.
18722
18723         So for now, if the Location is null, it means `Probe only' to
18724         avoid adding another argument.   Might have to revise this
18725         strategy later.
18726
18727         (ClassCast): New class used to type cast objects into arbitrary
18728         classes (used in Explicit Reference Conversions).
18729
18730         Implement `as' as well.
18731
18732         Reverted all the patches from Ravi below: they were broken:
18733
18734                 * The use of `level' as a mechanism to stop recursive
18735                   invocations is wrong.  That was there just to catch the
18736                   bug with a strack trace but not as a way of addressing
18737                   the problem.
18738
18739                   To fix the problem we have to *understand* what is going
18740                   on and the interactions and come up with a plan, not
18741                   just get things going.
18742
18743                 * The use of the type conversion cache that I proposed
18744                   last night had an open topic: How does this work across
18745                   protection domains.  A user defined conversion might not
18746                   be public in the location where we are applying the
18747                   conversion, a different conversion might be selected
18748                   (ie, private A->B (better) but public B->A (worse),
18749                   inside A, A->B applies, but outside it, B->A will
18750                   apply).
18751
18752                 * On top of that (ie, even if the above is solved),
18753                   conversions in a cache need to be abstract.  Ie, `To
18754                   convert from an Int to a Short use an OpcodeCast', not
18755                   `To convert from an Int to a Short use the OpcodeCast on
18756                   the variable 5' (which is what this patch was doing).
18757
18758 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18759
18760         * expression.cs (Invocation::ConversionExists): Re-write to use
18761         the conversion cache
18762
18763         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
18764         cache all conversions done, not just user-defined ones.
18765
18766         (Invocation::BetterConversion): The real culprit. Use ConversionExists
18767         to determine if a conversion exists instead of acutually trying to 
18768         perform the conversion. It's faster too.
18769
18770         (Expression::ConvertExplicit): Modify to use ConversionExists to check
18771         and only then attempt the implicit conversion.
18772
18773 2001-09-28  Ravi Pratap  <ravi@ximian.com>
18774
18775         * expression.cs (ConvertImplicit): Use a cache for conversions
18776         already found. Check level of recursion and bail out if necessary.
18777
18778 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
18779
18780         * typemanager.cs (string_concat_string_string, string_concat_object_object):
18781         Export standard methods that we expect for string operations.
18782
18783         * statement.cs (Block::UsageWarning): Track usage of variables and
18784         report the errors for not used variables.
18785
18786         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
18787         operator. 
18788
18789 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18790
18791         * codegen.cs: remove unnneded code 
18792
18793         * expression.cs: Removed BuiltinTypeAccess class
18794
18795         Fix the order in which implicit conversions are
18796         done.  
18797
18798         The previous fixed dropped support for boxed conversions (adding a
18799         test to the test suite now)
18800
18801         (UserImplicitCast::CanConvert): Remove test for source being null,
18802         that code is broken.  We should not feed a null to begin with, if
18803         we do, then we should track the bug where the problem originates
18804         and not try to cover it up here.
18805
18806         Return a resolved expression of type UserImplicitCast on success
18807         rather than true/false.  Ravi: this is what I was talking about,
18808         the pattern is to use a static method as a "constructor" for
18809         objects. 
18810
18811         Also, do not create arguments until the very last minute,
18812         otherwise we always create the arguments even for lookups that
18813         will never be performed. 
18814
18815         (UserImplicitCast::Resolve): Eliminate, objects of type
18816         UserImplicitCast are born in a fully resolved state. 
18817
18818         * typemanager.cs (InitCoreTypes): Init also value_type
18819         (System.ValueType). 
18820
18821         * expression.cs (Cast::Resolve): First resolve the child expression.
18822
18823         (LValue): Add new method AddressOf to be used by
18824         the `&' operator.  
18825
18826         Change the argument of Store to take an EmitContext instead of an
18827         ILGenerator, because things like FieldExpr need to be able to call
18828         their children expression to generate the instance code. 
18829
18830         (Expression::Error, Expression::Warning): Sugar functions for
18831         reporting errors.
18832
18833         (Expression::MemberLookup): Accept a TypeContainer instead of a
18834         Report as the first argument.
18835
18836         (Expression::ResolvePrimary): Killed.  I still want to improve
18837         this as currently the code is just not right.
18838
18839         (Expression::ResolveMemberAccess): Simplify, but it is still
18840         wrong. 
18841
18842         (Unary::Resolve): Catch errors in AddressOf operators.
18843
18844         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
18845         index to a byte for the short-version, or the compiler will choose
18846         the wrong Emit call, which generates the wrong data.
18847
18848         (ParameterReference::Emit, ::Store): same.
18849
18850         (FieldExpr::AddressOf): Implement.
18851
18852         * typemanager.cs: TypeManager: made public variable instead of
18853         property.
18854
18855         * driver.cs: document --fatal.
18856
18857         * report.cs (ErrorMessage, WarningMessage): new names for the old
18858         Error and Warning classes.
18859
18860         * cs-parser.jay (member_access): Turn built-in access to types
18861         into a normal simplename
18862
18863 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18864
18865         * expression.cs (Invocation::BetterConversion): Fix to cope
18866         with q being null, since this was introducing a bug.
18867
18868         * expression.cs (ConvertImplicit): Do built-in conversions first.
18869
18870 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18871
18872         * expression.cs (UserImplicitCast::Resolve): Fix bug.
18873
18874 2001-09-27  Ravi Pratap  <ravi@ximian.com>
18875
18876         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
18877         I had introduced long ago (what's new ?).
18878
18879         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
18880         the work of all the checking. 
18881         (ConvertImplicit): Call CanConvert and only then create object if necessary.
18882         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
18883
18884         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
18885         that is the right way. 
18886
18887         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
18888         overloading resolution. Use everywhere instead of cutting and pasting code.
18889
18890         (Binary::ResolveOperator): Use MakeUnionSet.
18891
18892         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
18893         we have to convert to bool types. Not complete yet.
18894
18895 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
18896
18897         * typemanager.cs (TypeManager::CSharpName): support ushort.
18898
18899         * expression.cs (Expression::TryImplicitIntConversion): Attempts
18900         to provide an expression that performsn an implicit constant int
18901         conversion (section 6.1.6).
18902         (Expression::ConvertImplicitRequired): Reworked to include
18903         implicit constant expression conversions.
18904
18905         (Expression::ConvertNumericExplicit): Finished.
18906
18907         (Invocation::Emit): If InstanceExpression is null, then it means
18908         that we perform a call on this.
18909
18910 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18911
18912         * expression.cs (Unary::Emit): Remove some dead code.
18913         (Probe): Implement Resolve and Emit for `is'.
18914         (Expression::ConvertImplicitRequired): Attempt to do constant
18915         expression conversions here.  Maybe should be moved to
18916         ConvertImplicit, but I am not sure.
18917         (Expression::ImplicitLongConstantConversionPossible,
18918         Expression::ImplicitIntConstantConversionPossible): New functions
18919         that tell whether is it possible to apply an implicit constant
18920         expression conversion.
18921
18922         (ConvertNumericExplicit): Started work on explicit numeric
18923         conversions.
18924
18925         * cs-parser.jay: Update operator constants.
18926
18927         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
18928         (Parameters::GetSignature): Hook up VerifyArgs here.
18929         (Parameters::VerifyArgs): Verifies that no two arguments have the
18930         same name. 
18931
18932         * class.cs (Operator): Update the operator names to reflect the
18933         ones that the spec expects (as we are just stringizing the
18934         operator names).
18935
18936         * expression.cs (Unary::ResolveOperator): Fix bug: Use
18937         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
18938         previous usage did only work for our methods.
18939         (Expression::ConvertImplicit): Handle decimal implicit numeric
18940         conversions as well.
18941         (Expression::InternalTypeConstructor): Used to invoke constructors
18942         on internal types for default promotions.
18943
18944         (Unary::Emit): Implement special handling for the pre/post
18945         increment/decrement for overloaded operators, as they need to have
18946         the same semantics as the other operators.
18947
18948         (Binary::ResolveOperator): ditto.
18949         (Invocation::ConversionExists): ditto.
18950         (UserImplicitCast::Resolve): ditto.
18951
18952 2001-09-26  Ravi Pratap  <ravi@ximian.com>
18953
18954         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
18955         operator, return after emitting body. Regression tests pass again !
18956
18957         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
18958         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
18959         (Invocation::OverloadResolve): Ditto.
18960         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
18961
18962         * everywhere : update calls to the above methods accordingly.
18963
18964 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
18965
18966         * assign.cs (Assign): Make it inherit from ExpressionStatement.
18967
18968         * expression.cs (ExpressionStatement): New base class used for
18969         expressions that can appear in statements, so that we can provide
18970         an alternate path to generate expression that do not leave a value
18971         on the stack.
18972
18973         (Expression::Emit, and all the derivatives): We no longer return
18974         whether a value is left on the stack or not.  Every expression
18975         after being emitted leaves a single value on the stack.
18976
18977         * codegen.cs (EmitContext::EmitStatementExpression): Use the
18978         facilties of ExpressionStatement if possible.
18979
18980         * cs-parser.jay: Update statement_expression.
18981
18982 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
18983
18984         * driver.cs: Change the wording of message
18985
18986 2001-09-25  Ravi Pratap  <ravi@ximian.com>
18987
18988         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
18989         the type of the expression to the return type of the method if
18990         we have an overloaded operator match ! The regression tests pass again !
18991         (Unary::ResolveOperator): Ditto.
18992
18993         * expression.cs (Invocation::ConversionExists): Correct the member lookup
18994         to find "op_Implicit", not "implicit" ;-)
18995         (UserImplicitCast): New class to take care of user-defined implicit conversions.
18996         (ConvertImplicit, ForceConversion): Take TypeContainer argument
18997
18998         * everywhere : Correct calls to the above accordingly.
18999
19000         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
19001         (ConvertImplicit): Do user-defined conversion if it exists.
19002
19003 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
19004
19005         * assign.cs: track location.
19006         (Resolve): Use implicit conversions on assignment.
19007
19008         * literal.cs: Oops.  Not good, Emit of short access values should
19009         pass (Bytes) or the wrong argument will be selected.
19010
19011         * expression.cs (Unary::Emit): Emit code for -expr.
19012
19013         (Unary::ResolveOperator): Handle `Substract' for non-constants
19014         (substract from zero from the non-constants).
19015         Deal with Doubles as well. 
19016
19017         (Expression::ConvertImplicitRequired): New routine that reports an
19018         error if no implicit conversion exists. 
19019
19020         (Invocation::OverloadResolve): Store the converted implicit
19021         expressions if we make them
19022
19023 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19024
19025         * class.cs (ConstructorInitializer): Take a Location argument.
19026         (ConstructorBaseInitializer): Same here.
19027         (ConstructorThisInitializer): Same here.
19028
19029         * cs-parser.jay : Update all calls accordingly.
19030
19031         * expression.cs (Unary, Binary, New): Take location argument.
19032         Update accordingly everywhere.
19033
19034         * cs-parser.jay : Update all calls to the above to take a location
19035         argument.
19036
19037         * class.cs : Ditto.
19038
19039 2001-09-24  Ravi Pratap  <ravi@ximian.com>
19040
19041         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
19042         (Invocation::BetterConversion): Same here
19043         (Invocation::ConversionExists): Ditto.
19044
19045         (Invocation::ConversionExists): Implement.
19046
19047 2001-09-22  Ravi Pratap  <ravi@ximian.com>
19048
19049         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
19050         Also take an additional TypeContainer argument.
19051
19052         * All over : Pass in TypeContainer as argument to OverloadResolve.
19053
19054         * typemanager.cs (CSharpName): Update to check for the string type and return
19055         that too.
19056
19057         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
19058         a given method.
19059
19060 2001-09-21  Ravi Pratap  <ravi@ximian.com>
19061
19062         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
19063         (Invocation::BetterFunction): Implement.
19064         (Invocation::BetterConversion): Implement.
19065         (Invocation::ConversionExists): Skeleton, no implementation yet.
19066
19067         Okay, things work fine !
19068
19069 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
19070
19071         * typemanager.cs: declare and load enum_type, delegate_type and
19072         void_type. 
19073
19074         * expression.cs (Expression::Emit): Now emit returns a value that
19075         tells whether a value is left on the stack or not.  This strategy
19076         might be reveted tomorrow with a mechanism that would address
19077         multiple assignments.
19078         (Expression::report118): Utility routine to report mismatches on
19079         the ExprClass.
19080
19081         (Unary::Report23): Report impossible type/operator combination
19082         utility function.
19083
19084         (Unary::IsIncrementableNumber): Whether the type can be
19085         incremented or decremented with add.
19086         (Unary::ResolveOperator): Also allow enumerations to be bitwise
19087         complemented. 
19088         (Unary::ResolveOperator): Implement ++, !, ~,
19089
19090         (Invocation::Emit): Deal with new Emit convetion.
19091
19092         * All Expression derivatives: Updated their Emit method to return
19093         whether they leave values on the stack or not.
19094
19095         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
19096         stack for expressions that are statements. 
19097
19098 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19099
19100         * expression.cs (LValue): New interface.  Must be implemented by
19101         LValue objects.
19102         (LocalVariableReference, ParameterReference, FieldExpr): Implement
19103         LValue interface.
19104
19105         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
19106         interface for generating code, simplifies the code.
19107
19108 2001-09-20  Ravi Pratap  <ravi@ximian.com>
19109
19110         * expression.cs (everywhere): Comment out return statements in ::Resolve
19111         methods to avoid the warnings.
19112
19113 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
19114
19115         * driver.cs (parse): Report error 2001 if we can not open the
19116         source file.
19117
19118         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
19119         not resolve it.
19120
19121         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
19122         object. 
19123
19124         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
19125         otherwise nested blocks end up with the same index.
19126
19127         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
19128
19129         * expression.cs:  Instead of having FIXMEs in the Resolve
19130         functions, throw exceptions so it is obvious that we are facing a
19131         bug. 
19132
19133         * cs-parser.jay (invocation_expression): Pass Location information.
19134
19135         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
19136         Use a basename for those routines because .NET does not like paths
19137         on them. 
19138
19139         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
19140         already defined.
19141
19142 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
19143
19144         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
19145         are loading the correct data types (throws an exception if not).
19146         (TypeManager::InitCoreTypes): Use CoreLookupType
19147
19148         * expression.cs (Unary::ResolveOperator): return the child
19149         expression for expressions which are just +expr.
19150         (Unary::ResolveOperator): Return negative literals for -LITERAL
19151         expressions (otherwise they are Unary {Literal}).
19152         (Invocation::Badness): Take into account `Implicit constant
19153         expression conversions'.
19154
19155         * literal.cs (LongLiteral): Implement long literal class.
19156         (IntLiteral): export the `Value' of the intliteral. 
19157
19158 2001-09-19  Ravi Pratap  <ravi@ximian.com>
19159
19160         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
19161
19162         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
19163         instead of 'Operator'
19164
19165         * expression.cs (Binary::ResolveOperator): Update accordingly.
19166         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
19167         and 'Minus'
19168
19169         * cs-parser.jay (unary_expression): Update to use the new names.
19170
19171         * gen-treedump.cs (GetUnary): Same here.
19172
19173         * expression.cs (Unary::Resolve): Implement.
19174         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
19175         operators are found instead of making noise ;-)
19176         (Unary::ResolveOperator): New method to do precisely the same thing which
19177         Binary::ResolveOperator does for Binary expressions.
19178         (Unary.method, .Arguments): Add.
19179         (Unary::OperName): Implement.   
19180         (Unary::ForceConversion): Copy and Paste !
19181
19182         * class.cs (Operator::Define): Fix a small bug for the case when we have 
19183         a unary operator.
19184
19185         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
19186         for the inbuilt operators. Only overloading works for now ;-)
19187
19188 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
19189
19190         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
19191         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
19192
19193         * expression.cs (This::Emit): Implement. 
19194         (This::Resolve): Implement.
19195         (TypeOf:Resolve): Implement.
19196         (Expression::ResolveSimpleName): Add an implicit this to instance
19197         field references. 
19198         (MemberAccess::Resolve): Deal with Parameters and Fields. 
19199         Bind instance variable to Field expressions.
19200         (FieldExpr::Instance): New field used to track the expression that
19201         represents the object instance.
19202         (FieldExpr::Resolve): Track potential errors from MemberLookup not
19203         binding 
19204         (FieldExpr::Emit): Implement.
19205
19206         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
19207         the last instruction contains a return opcode to avoid generating
19208         the last `ret' instruction (this generates correct code, and it is
19209         nice to pass the peverify output).
19210
19211         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
19212         initializer for static and instance variables.
19213         (Constructor::Emit): Allow initializer to be null in the case of
19214         static constructors.  Only emit initializer for instance
19215         constructors. 
19216
19217         (TypeContainer::FindMembers): Return a null array if there are no
19218         matches.
19219
19220         Also fix the code for the MemberTypes.Method branch, as it was not
19221         scanning that for operators (or tried to access null variables before).
19222
19223         * assign.cs (Assign::Emit): Handle instance and static fields. 
19224
19225         * TODO: Updated.
19226
19227         * driver.cs: Stop compilation if there are parse errors.
19228
19229         * cs-parser.jay (constructor_declaration): Provide default base
19230         initializer for non-static constructors.
19231         (constructor_declarator): Do not provide a default base
19232         initializers if none was specified.
19233         Catch the fact that constructors should not have parameters.
19234
19235         * class.cs: Do not emit parent class initializers for static
19236         constructors, that should be flagged as an error.
19237
19238 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19239
19240         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
19241         Move back code into TypeContainer::Populate.
19242
19243 2001-09-18  Ravi Pratap  <ravi@ximian.com>
19244
19245         * class.cs (TypeContainer::AddConstructor): Fix the check to
19246         compare against Name, not Basename. 
19247         (Operator::OpType): Change Plus and Minus to Add and Subtract.
19248
19249         * cs-parser.jay : Update accordingly.
19250
19251         * class.cs (TypeContainer::FindMembers): For the case where we are searching
19252         for methods, don't forget to look into the operators too.
19253         (RegisterMethodBuilder): Helper method to take care of this for
19254         methods, constructors and operators.
19255         (Operator::Define): Completely revamp.
19256         (Operator.OperatorMethod, MethodName): New fields.
19257         (TypeContainer::Populate): Move the registering of builders into
19258         RegisterMethodBuilder.
19259         (Operator::Emit): Re-write.
19260
19261         * expression.cs (Binary::Emit): Comment out code path to emit method
19262         invocation stuff for the case when we have a user defined operator. I am
19263         just not able to get it right !
19264
19265 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19266
19267         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
19268         argument. 
19269
19270         (Expression::MemberLookup): Provide a version that allows to
19271         specify the MemberTypes and BindingFlags. 
19272
19273         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
19274         so it was not fetching variable information from outer blocks.
19275
19276         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
19277         Beforefieldinit as it was buggy.
19278
19279         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
19280         that Ravi put here.  
19281
19282         * class.cs (Constructor::Emit): Only emit if block is not null.
19283         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
19284         deal with this by semantically definining it as if the user had
19285         done it.
19286
19287         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
19288         constructors as we now "emit" them at a higher level.
19289
19290         (TypeContainer::DefineDefaultConstructor): Used to define the
19291         default constructors if none was provided.
19292
19293         (ConstructorInitializer): Add methods Resolve and Emit. 
19294
19295         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
19296
19297 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19298
19299         * class.cs (TypeContainer::EmitDefaultConstructor): Register
19300         the default constructor builder with our hashtable for methodbuilders
19301         to methodcores.
19302
19303         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
19304         and argument_count is 0 in which case we have a match.
19305         (Binary::ResolveOperator): More null checking and miscellaneous coding
19306         style cleanup.
19307
19308 2001-09-17  Ravi Pratap  <ravi@ximian.com>
19309
19310         * rootcontext.cs (IsNameSpace): Compare against null.
19311
19312         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
19313
19314         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
19315         and Unary::Operator.
19316
19317         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
19318         accordingly.
19319
19320         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
19321         we have overloaded operators.
19322         (Binary::ResolveOperator): Implement the part which does the operator overload
19323         resolution.
19324
19325         * class.cs (Operator::Emit): Implement.
19326         (TypeContainer::Emit): Emit the operators we have too.
19327
19328         * expression.cs (Binary::Emit): Update to emit the appropriate code for
19329         the case when we have a user-defined operator.
19330
19331 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
19332
19333         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
19334
19335 2001-09-16  Ravi Pratap  <ravi@ximian.com>
19336
19337         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
19338         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
19339         (Constructor::Emit): Implement.
19340         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
19341         if we have no work to do. 
19342         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
19343         Emit method.
19344
19345         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
19346         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
19347
19348         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
19349         of parent.parent.
19350
19351 2001-09-15  Ravi Pratap  <ravi@ximian.com>
19352
19353         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
19354         in the source.
19355         (Tree::RecordNamespace): Method to do what the name says ;-)
19356         (Tree::Namespaces): Property to get at the namespaces hashtable.
19357
19358         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
19359         keep track.
19360
19361         * rootcontext.cs (IsNamespace): Fixed it :-)
19362
19363 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19364
19365         * class.cs (TypeContainer::FindMembers): Add support for
19366         constructors. 
19367         (MethodCore): New class that encapsulates both the shared aspects
19368         of a Constructor and a Method.  
19369         (Method, Constructor): Factored pieces into MethodCore.
19370
19371         * driver.cs: Added --fatal which makes errors throw exceptions.
19372         Load System assembly as well as part of the standard library.
19373
19374         * report.cs: Allow throwing exceptions on errors for debugging.
19375
19376         * modifiers.cs: Do not use `parent', instead use the real type
19377         container to evaluate permission settings.
19378
19379         * class.cs: Put Ravi's patch back in.  He is right, and we will
19380         have to cope with the
19381
19382 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19383
19384         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
19385         FamORAssem, not FamANDAssem.
19386
19387 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
19388
19389         * driver.cs: Added --parse option that only parses its input files
19390         and terminates.
19391
19392         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
19393         incorrect.  IsTopLevel is not used to tell whether an object is
19394         root_types or not (that can be achieved by testing this ==
19395         root_types).  But to see if this is a top-level *class* (not
19396         necessarly our "toplevel" container). 
19397
19398 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19399
19400         * enum.cs (Enum::Define): Modify to call the Lookup method on the
19401         parent instead of a direct call to GetType.
19402
19403 2001-09-14  Ravi Pratap  <ravi@ximian.com>
19404
19405         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
19406         Modifiers.TypeAttr. This should just be a call to that method.
19407
19408         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
19409         object so that we can determine if we are top-level or not.
19410
19411         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
19412         TypeContainer too.
19413
19414         * enum.cs (Enum::Define): Ditto.
19415
19416         * modifiers.cs (FieldAttr): Re-write.
19417
19418         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
19419         (TypeContainer::HaveStaticConstructor): New property to provide access
19420         to precisely that info.
19421
19422         * modifiers.cs (MethodAttr): Re-write.
19423         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
19424
19425         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
19426         of top-level types as claimed.
19427
19428 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19429
19430         * expression.cs (MemberLookup): Fruitless attempt to lookup
19431         constructors.  Maybe I need to emit default constructors?  That
19432         might be it (currently .NET emits this for me automatically).
19433         (Invocation::OverloadResolve): Cope with Arguments == null.
19434         (Invocation::EmitArguments): new function, shared by the new
19435         constructor and us.
19436         (Invocation::Emit): Handle static and instance methods.  Emit
19437         proper call instruction for virtual or non-virtual invocations.
19438         (New::Emit): Implement.
19439         (New::Resolve): Implement.
19440         (MemberAccess:Resolve): Implement.
19441         (MethodGroupExpr::InstanceExpression): used conforming to the spec
19442         to track instances.
19443         (FieldExpr::Resolve): Set type.
19444
19445         * support.cs: Handle empty arguments.
19446                 
19447         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
19448         SimpleLookup): Auxiliary routines to help parse a qualifier
19449         identifier.  
19450
19451         Update qualifier_identifier rule.
19452
19453         * codegen.cs: Removed debugging messages.
19454
19455         * class.cs: Make this a global thing, this acts just as a "key" to
19456         objects that we might have around.
19457
19458         (Populate): Only initialize method_builders_to_methods once.
19459
19460         * expression.cs (PropertyExpr): Initialize type from the
19461         PropertyType. 
19462
19463         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
19464         Resolve pattern.  Attempt to implicitly convert value to boolean.
19465         Emit code.
19466
19467         * expression.cs: Set the type for the int32/int32 argument case.
19468         (Binary::ResolveOperator): Set the return type to boolean for
19469         comparission operators
19470
19471         * typemanager.cs: Remove debugging print code.
19472
19473         (Invocation::Resolve): resolve type.
19474
19475         * class.cs: Allocate a MemberInfo of the correct size, as the code
19476         elsewhere depends on the test to reflect the correct contents.
19477
19478         (Method::) Keep track of parameters, due to System.Reflection holes
19479
19480         (TypeContainer::Populate): Keep track of MethodBuilders to Method
19481         mapping here.
19482
19483         (TypeContainer::FindMembers): Use ArrayList and then copy an array
19484         of the exact size and return that.
19485
19486         (Class::LookupMethodByBuilder): New function that maps
19487         MethodBuilders to its methods.  Required to locate the information
19488         on methods because System.Reflection bit us again.
19489
19490         * support.cs: New file, contains an interface ParameterData and
19491         two implementations: ReflectionParameters and InternalParameters
19492         used to access Parameter information.  We will need to grow this
19493         as required.
19494
19495         * expression.cs (Invocation::GetParameterData): implement a cache
19496         and a wrapper around the ParameterData creation for methods. 
19497         (Invocation::OverloadResolve): Use new code.
19498
19499 2001-09-13  Ravi Pratap  <ravi@ximian.com>
19500
19501         * class.cs (TypeContainer::EmitField): Remove and move into 
19502         (Field::Define): here and modify accordingly.
19503         (Field.FieldBuilder): New member.
19504         (TypeContainer::Populate): Update accordingly.
19505         (TypeContainer::FindMembers): Implement.
19506
19507 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
19508
19509         * statement.cs: (VariableInfo::VariableType): New field to be
19510         initialized with the full type once it is resolved. 
19511
19512 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
19513
19514         * parameter.cs (GetParameterInfo): Use a type cache to compute
19515         things only once, and to reuse this information
19516
19517         * expression.cs (LocalVariableReference::Emit): Implement.
19518         (OpcodeCast::Emit): fix.
19519
19520         (ParameterReference::Resolve): Implement.
19521         (ParameterReference::Emit): Implement.
19522
19523         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
19524         that are expressions need to stay as Expressions.
19525
19526         * typemanager.cs (CSharpName): Returns the C# name of a type if
19527         possible. 
19528
19529         * expression.cs (Expression::ConvertImplicit): New function that
19530         implements implicit type conversions.
19531
19532         (Expression::ImplicitReferenceConversion): Implements implicit
19533         reference conversions.
19534
19535         (EmptyCast): New type for transparent casts.
19536
19537         (OpcodeCast): New type for casts of types that are performed with
19538         a sequence of bytecodes.
19539
19540         (BoxedCast): New type used for casting value types into reference
19541         types.  Emits a box opcode.
19542
19543         (Binary::DoNumericPromotions): Implements numeric promotions of
19544         and computation of the Binary::Type.
19545
19546         (Binary::EmitBranchable): Optimization.
19547
19548         (Binary::Emit): Implement code emission for expressions.
19549
19550         * typemanager.cs (TypeManager): Added two new core types: sbyte
19551         and byte.
19552
19553 2001-09-12  Ravi Pratap  <ravi@ximian.com>
19554
19555         * class.cs (TypeContainer::FindMembers): Method which does exactly
19556         what Type.FindMembers does, only we don't have to use reflection. No
19557         implementation yet.
19558
19559         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
19560         typecontainer objects as we need to get at them.
19561         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
19562
19563         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
19564         typecontainer object.
19565
19566         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
19567         of just a Report object.
19568
19569 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19570
19571         * class.cs (Event::Define): Go back to using the prefixes "add_" and
19572         "remove_"
19573         (TypeContainer::Populate): Now define the delegates of the type too.
19574         (TypeContainer.Delegates): Property to access the list of delegates defined
19575         in the type.
19576
19577         * delegates.cs (Delegate::Define): Implement partially.
19578
19579         * modifiers.cs (TypeAttr): Handle more flags.
19580
19581 2001-09-11  Ravi Pratap  <ravi@ximian.com>
19582
19583         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
19584         and not <=
19585         (Operator::Define): Re-write logic to get types by using the LookupType method
19586         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
19587         (Indexer::Define): Ditto.
19588         (Event::Define): Ditto.
19589         (Property::Define): Ditto.
19590
19591 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19592
19593         * class.cs (TypeContainer::Populate): Now define operators too. 
19594         (TypeContainer.Operators): New property to access the list of operators
19595         in a type.
19596         (Operator.OperatorMethodBuilder): New member to hold the method builder
19597         for the operator we are defining.
19598         (Operator::Define): Implement.
19599
19600 2001-09-10  Ravi Pratap  <ravi@ximian.com>
19601
19602         * class.cs (Event::Define): Make the prefixes of the accessor methods
19603         addOn_ and removeOn_ 
19604
19605         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
19606         of the location being passed in too. Ideally, this should go later since all
19607         error reporting should be done through the Report object.
19608
19609         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
19610         (Populate): Iterate thru the indexers we have and define them too.
19611         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
19612         for the get and set accessors.
19613         (Indexer::Define): Implement.
19614
19615 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
19616
19617         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
19618         my previous implementation, did not work.
19619
19620         * typemanager.cs: Add a couple of missing types (the longs).
19621
19622         * literal.cs: Use TypeManager.bool_type instead of getting it.
19623
19624         * expression.cs (EventExpr): New kind of expressions.
19625         (Expressio::ExprClassFromMemberInfo): finish
19626
19627 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
19628
19629         * assign.cs: Emit stores to static fields differently.
19630
19631 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19632
19633         * Merge in changes and adjust code to tackle conflicts. Backed out my
19634         code in Assign::Resolve ;-) 
19635
19636 2001-09-08  Ravi Pratap  <ravi@ximian.com>
19637
19638         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
19639         instead Report.Error and also pass in the location.
19640         (CSharpParser::Lexer): New readonly property to return the reference
19641         to the Tokenizer object.
19642         (declare_local_variables): Use Report.Error with location instead of plain 
19643         old error.
19644         (CheckDef): Ditto.
19645
19646         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
19647         (Operator.CheckBinaryOperator): Ditto.
19648
19649         * cs-parser.jay (operator_declarator): Update accordingly.
19650
19651         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
19652         (CheckBinaryOperator): Same here.
19653
19654         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
19655         on the name without any prefixes of namespace names etc. This is because we
19656         already might have something already fully qualified like 
19657         'System.Console.WriteLine'
19658
19659         * assign.cs (Resolve): Begin implementation. Stuck ;-)
19660
19661 2001-09-07  Ravi Pratap  <ravi@ximian.com>
19662
19663         * cs-tokenizer.cs (location): Return a string which also contains
19664         the file name.
19665
19666         * expression.cs (ElementAccess): New class for expressions of the
19667         type 'element access.'
19668         (BaseAccess): New class for expressions of the type 'base access.'
19669         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
19670         respectively.
19671
19672         * cs-parser.jay (element_access): Implement action.
19673         (base_access): Implement actions.
19674         (checked_expression, unchecked_expression): Implement.
19675
19676         * cs-parser.jay (local_variable_type): Correct and implement.
19677         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
19678
19679         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
19680
19681         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
19682         name and the specifiers.
19683
19684         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
19685
19686         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
19687         making them all public ;-)
19688
19689         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
19690         class anyways.
19691
19692 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
19693
19694         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
19695         PropertyExprs.
19696         (FieldExpr, PropertyExprs): New resolved expressions.
19697         (SimpleName::MemberStaticCheck): Perform static checks for access
19698         to non-static fields on static methods. Maybe this should be
19699         generalized for MemberAccesses. 
19700         (SimpleName::ResolveSimpleName): More work on simple name
19701         resolution. 
19702
19703         * cs-parser.jay (primary_expression/qualified_identifier): track
19704         the parameter index.
19705
19706         * codegen.cs (CodeGen::Save): Catch save exception, report error.
19707         (EmitContext::EmitBoolExpression): Chain to expression generation
19708         instead of temporary hack.
19709         (::EmitStatementExpression): Put generic expression code generation.
19710
19711         * assign.cs (Assign::Emit): Implement variable assignments to
19712         local variables, parameters and fields.
19713
19714 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
19715
19716         * statement.cs (Block::GetVariableInfo): New method, returns the
19717         VariableInfo for a variable name in a block.
19718         (Block::GetVariableType): Implement in terms of GetVariableInfo
19719
19720         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
19721         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
19722
19723 2001-09-06  Ravi Pratap  <ravi@ximian.com>
19724
19725         * cs-parser.jay (operator_declaration): Continue on my quest : update
19726         to take attributes argument.
19727         (event_declaration): Ditto.
19728         (enum_declaration): Ditto.
19729         (indexer_declaration): Ditto.
19730
19731         * class.cs (Operator::Operator): Update constructor accordingly.
19732         (Event::Event): Ditto.
19733
19734         * delegate.cs (Delegate::Delegate): Same here.
19735
19736         * enum.cs (Enum::Enum): Same here.
19737
19738 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19739
19740         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
19741
19742         * ../tests/cs0658.cs : New file to demonstrate error 0658.
19743
19744         * attribute.cs (Attributes): New class to encapsulate all attributes which were
19745         being passed around as an arraylist.
19746         (Attributes::AddAttribute): Method to add attribute sections.
19747
19748         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
19749         (struct_declaration): Update accordingly.
19750         (constant_declaration): Update.
19751         (field_declaration): Update.
19752         (method_header): Update.
19753         (fixed_parameter): Update.
19754         (parameter_array): Ditto.
19755         (property_declaration): Ditto.
19756         (destructor_declaration): Ditto.
19757
19758         * class.cs (Struct::Struct): Update constructors accordingly.
19759         (Class::Class): Ditto.
19760         (Field::Field): Ditto.
19761         (Method::Method): Ditto.
19762         (Property::Property): Ditto.
19763         (TypeContainer::OptAttribute): update property's return type.
19764
19765         * interface.cs (Interface.opt_attributes): New member.
19766         (Interface::Interface): Update to take the extra Attributes argument.
19767
19768         * parameter.cs (Parameter::Parameter): Ditto.
19769
19770         * constant.cs (Constant::Constant): Ditto.
19771
19772         * interface.cs (InterfaceMemberBase): New OptAttributes field.
19773         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
19774         the attributes as a parameter.
19775         (InterfaceProperty): Update constructor call.
19776         (InterfaceEvent): Ditto.
19777         (InterfaceMethod): Ditto.
19778         (InterfaceIndexer): Ditto.
19779
19780         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
19781         pass the attributes too.
19782         (interface_event_declaration): Ditto.
19783         (interface_property_declaration): Ditto.
19784         (interface_method_declaration): Ditto.
19785         (interface_declaration): Ditto.
19786
19787 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
19788
19789         * class.cs (Method::Define): Track the "static Main" definition to
19790         create an entry point. 
19791
19792         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
19793         EntryPoint if we find it. 
19794
19795         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
19796         (EmitContext::ig): Make this variable public.
19797
19798         * driver.cs: Make the default output file be the first file name
19799         with the .exe extension.  
19800
19801         Detect empty compilations
19802
19803         Handle various kinds of output targets.  Handle --target and
19804         rename -t to --dumper.
19805
19806         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
19807         methods inherited from Expression return now an Expression.  This
19808         will is used during the tree rewriting as we resolve them during
19809         semantic analysis.
19810
19811         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
19812         the spec.  Missing entirely is the information about
19813         accessability of elements of it.
19814
19815         (Expression::ExprClassFromMemberInfo): New constructor for
19816         Expressions that creates a fully initialized Expression based on
19817         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
19818         a Type.
19819
19820         (Invocation::Resolve): Begin implementing resolution of invocations.
19821
19822         * literal.cs (StringLiteral):  Implement Emit.
19823
19824 2001-09-05  Ravi Pratap  <ravi@ximian.com>
19825
19826         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
19827         member.
19828
19829 2001-09-04  Ravi Pratap  <ravi@ximian.com>
19830
19831         * cs-parser.jay (attribute_arguments): Implement actions.
19832         (attribute): Fix bug in production. Implement action.
19833         (attribute_list): Implement.
19834         (attribute_target): Implement.
19835         (attribute_target_specifier, opt_target_specifier): Implement
19836         (CheckAttributeTarget): New method to check if the attribute target
19837         is valid.
19838         (attribute_section): Implement.
19839         (opt_attributes): Implement.
19840
19841         * attribute.cs : New file to handle attributes.
19842         (Attribute): Class to hold attribute info.
19843
19844         * cs-parser.jay (opt_attribute_target_specifier): Remove production
19845         (attribute_section): Modify production to use 2 different rules to 
19846         achieve the same thing. 1 s/r conflict down !
19847         Clean out commented, useless, non-reducing dimension_separator rules.
19848
19849         * class.cs (TypeContainer.attributes): New member to hold list
19850         of attributes for a type.
19851         (Struct::Struct): Modify to take one more argument, the attribute list.
19852         (Class::Class): Ditto.
19853         (Field::Field): Ditto.
19854         (Method::Method): Ditto.
19855         (Property::Property): Ditto.
19856
19857         * cs-parser.jay (struct_declaration): Update constructor call to
19858         pass in the attributes too.
19859         (class_declaration): Ditto.
19860         (constant_declaration): Ditto.
19861         (field_declaration): Ditto.
19862         (method_header): Ditto.
19863         (fixed_parameter): Ditto.
19864         (parameter_array): Ditto.
19865         (property_declaration): Ditto.
19866
19867         * constant.cs (Constant::Constant): Update constructor similarly.
19868         Use System.Collections.
19869
19870         * parameter.cs (Parameter::Parameter): Update as above.
19871
19872 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19873
19874         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
19875         (TypeContainer.delegates): New member to hold list of delegates.
19876
19877         * cs-parser.jay (delegate_declaration): Implement the action correctly 
19878         this time as I seem to be on crack ;-)
19879
19880 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
19881
19882         * rootcontext.cs (RootContext::IsNamespace): new function, used to
19883         tell whether an identifier represents a namespace.
19884
19885         * expression.cs (NamespaceExpr): A namespace expression, used only
19886         temporarly during expression resolution.
19887         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
19888         utility functions to resolve names on expressions.
19889
19890 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
19891
19892         * codegen.cs: Add hook for StatementExpressions. 
19893
19894         * class.cs: Fix inverted test for static flag in methods.
19895
19896 2001-09-02  Ravi Pratap  <ravi@ximian.com>
19897
19898         * class.cs (Operator::CheckUnaryOperator): Correct error number used
19899         to make it coincide with MS' number.
19900         (Operator::CheckBinaryOperator): Ditto.
19901
19902         * ../errors/errors.txt : Remove error numbers added earlier.
19903
19904         * ../errors/cs1019.cs : Test case for error # 1019
19905
19906         * ../errros/cs1020.cs : Test case for error # 1020
19907
19908         * cs-parser.jay : Clean out commented cruft.
19909         (dimension_separators, dimension_separator): Comment out. Ostensibly not
19910         used anywhere - non-reducing rule.
19911         (namespace_declarations): Non-reducing rule - comment out.
19912
19913         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
19914         with TypeContainer::AddEnum.
19915
19916         * delegate.cs : New file for delegate handling classes.
19917         (Delegate): Class for declaring delegates.
19918
19919         * makefile : Update.
19920
19921         * cs-parser.jay (delegate_declaration): Implement.
19922
19923 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
19924
19925         * class.cs (Event::Define): Implement.
19926         (Event.EventBuilder): New member.
19927
19928         * class.cs (TypeContainer::Populate): Update to define all enums and events
19929         we have.
19930         (Events): New property for the events arraylist we hold. Shouldn't we move to using
19931         readonly fields for all these cases ?
19932
19933 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19934
19935         * class.cs (Property): Revamp to use the convention of making fields readonly.
19936         Accordingly modify code elsewhere.
19937
19938         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
19939         the Define method of the Property class.
19940
19941         * class.cs : Clean up applied patch and update references to variables etc. Fix 
19942         trivial bug.
19943         (TypeContainer::Populate): Update to define all the properties we have. Also
19944         define all enumerations.
19945
19946         * enum.cs (Define): Implement.
19947
19948 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
19949
19950         * cs-parser.jay (overloadable_operator): The semantic value is an
19951         enum of the Operator class.
19952         (operator_declarator): Implement actions.
19953         (operator_declaration): Implement.
19954
19955         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
19956         validity of definitions.
19957         (Operator::CheckBinaryOperator): Static method to check for binary operators
19958         (TypeContainer::AddOperator): New method to add an operator to a type.
19959
19960         * cs-parser.jay (indexer_declaration): Added line to actually call the
19961         AddIndexer method so it gets added ;-)
19962
19963         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
19964         already taken care of by the MS compiler ?  
19965
19966 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19967
19968         * class.cs (Operator): New class for operator declarations.
19969         (Operator::OpType): Enum for the various operators.
19970
19971 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
19972
19973         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
19974         ostensibly handle this in semantic analysis.
19975
19976         * cs-parser.jay (general_catch_clause): Comment out
19977         (specific_catch_clauses, specific_catch_clause): Ditto.
19978         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
19979         (catch_args, opt_catch_args): New productions.
19980         (catch_clause): Rewrite to use the new productions above
19981         (catch_clauses): Modify accordingly.
19982         (opt_catch_clauses): New production to use in try_statement
19983         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
19984         and re-write the code in the actions to extract the specific and
19985         general catch clauses by being a little smart ;-)
19986
19987         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
19988         Hooray, try and catch statements parse fine !
19989
19990 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
19991
19992         * statement.cs (Block::GetVariableType): Fix logic to extract the type
19993         string from the hashtable of variables.
19994
19995         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
19996         I end up making that mistake ;-)
19997         (catch_clauses): Fixed gross error which made Key and Value of the 
19998         DictionaryEntry the same : $1 !!
19999
20000 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20001
20002         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
20003
20004         * cs-parser.jay (event_declaration): Correct to remove the semicolon
20005         when the add and remove accessors are specified. 
20006
20007 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
20008
20009         * cs-parser.jay (IndexerDeclaration): New helper class to hold
20010         information about indexer_declarator.
20011         (indexer_declarator): Implement actions.
20012         (parsing_indexer): New local boolean used to keep track of whether
20013         we are parsing indexers or properties. This is necessary because 
20014         implicit_parameters come into picture even for the get accessor in the 
20015         case of an indexer.
20016         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
20017
20018         * class.cs (Indexer): New class for indexer declarations.
20019         (TypeContainer::AddIndexer): New method to add an indexer to a type.
20020         (TypeContainer::indexers): New member to hold list of indexers for the
20021         type.
20022
20023 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20024
20025         * cs-parser.jay (add_accessor_declaration): Implement action.
20026         (remove_accessor_declaration): Implement action.
20027         (event_accessors_declaration): Implement
20028         (variable_declarators): swap statements for first rule - trivial.
20029
20030         * class.cs (Event): New class to hold information about event
20031         declarations.
20032         (TypeContainer::AddEvent): New method to add an event to a type
20033         (TypeContainer::events): New member to hold list of events.
20034
20035         * cs-parser.jay (event_declaration): Implement actions.
20036
20037 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
20038
20039         * cs-parser.jay (dim_separators): Implement. Make it a string
20040         concatenating all the commas together, just as they appear.
20041         (opt_dim_separators): Modify accordingly
20042         (rank_specifiers): Update accordingly. Basically do the same
20043         thing - instead, collect the brackets here.
20044         (opt_rank_sepcifiers): Modify accordingly.
20045         (array_type): Modify to actually return the complete type string
20046         instead of ignoring the rank_specifiers.
20047         (expression_list): Implement to collect the expressions
20048         (variable_initializer): Implement. We make it a list of expressions
20049         essentially so that we can handle the array_initializer case neatly too.
20050         (variable_initializer_list): Implement.
20051         (array_initializer): Make it a list of variable_initializers
20052         (opt_array_initializer): Modify accordingly.
20053
20054         * expression.cs (New::NType): Add enumeration to help us
20055         keep track of whether we have an object/delegate creation
20056         or an array creation.
20057         (New:NewType, New::Rank, New::Indices, New::Initializers): New
20058         members to hold data about array creation.
20059         (New:New): Modify to update NewType
20060         (New:New): New Overloaded contructor for the array creation
20061         case.
20062
20063         * cs-parser.jay (array_creation_expression): Implement to call
20064         the overloaded New constructor.
20065
20066 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
20067
20068         * class.cs (TypeContainer::Constructors): Return member
20069         constructors instead of returning null.
20070
20071 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
20072
20073         * typemanager.cs (InitCoreTypes): Initialize the various core
20074         types after we have populated the type manager with the user
20075         defined types (this distinction will be important later while
20076         compiling corlib.dll)
20077
20078         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
20079         on Expression Classification.  Now all expressions have a method
20080         `Resolve' and a method `Emit'.
20081
20082         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
20083         generation from working.     Also add some temporary debugging
20084         code. 
20085
20086 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
20087
20088         * codegen.cs: Lots of code generation pieces.  This is only the
20089         beginning, will continue tomorrow with more touches of polish.  We
20090         handle the fundamentals of if, while, do, for, return.  Others are
20091         trickier and I need to start working on invocations soon.
20092
20093         * gen-treedump.cs: Bug fix, use s.Increment here instead of
20094         s.InitStatement. 
20095
20096         * codegen.cs (EmitContext): New struct, used during code
20097         emission to keep a context.   Most of the code generation will be
20098         here. 
20099
20100         * cs-parser.jay: Add embedded blocks to the list of statements of
20101         this block.  So code generation proceeds in a top down fashion.
20102
20103 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
20104
20105         * statement.cs: Add support for multiple child blocks.
20106
20107 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
20108
20109         * codegen.cs (EmitCode): New function, will emit the code for a
20110         Block of code given a TypeContainer and its ILGenerator. 
20111
20112         * statement.cs (Block): Standard public readonly optimization.
20113         (Block::Block constructors): Link children. 
20114         (Block::Child): Child Linker.
20115         (Block::EmitVariables): Emits IL variable declarations.
20116
20117         * class.cs: Drop support for MethodGroups here, delay until
20118         Semantic Analysis.
20119         (Method::): Applied the same simplification that I did before, and
20120         move from Properties to public readonly fields.
20121         (Method::ParameterTypes): Returns the parameter types for the
20122         function, and implements a cache that will be useful later when I
20123         do error checking and the semantic analysis on the methods is
20124         performed.
20125         (Constructor::GetCallingConvention): Renamed from CallingConvetion
20126         and made a method, optional argument tells whether this is a class
20127         or a structure to apply the `has-this' bit.
20128         (Method::GetCallingConvention): Implement, returns the calling
20129         convention. 
20130         (Method::Define): Defines the type, a second pass is performed
20131         later to populate the methods.
20132
20133         (Constructor::ParameterTypes): implement a cache similar to the
20134         one on Method::ParameterTypes, useful later when we do semantic
20135         analysis. 
20136
20137         (TypeContainer::EmitMethod):  New method.  Emits methods.
20138
20139         * expression.cs: Removed MethodGroup class from here.
20140
20141         * parameter.cs (Parameters::GetCallingConvention): new method.
20142
20143 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
20144
20145         * class.cs (TypeContainer::Populate): Drop RootContext from the
20146         argument. 
20147
20148         (Constructor::CallingConvention): Returns the calling convention.
20149         (Constructor::ParameterTypes): Returns the constructor parameter
20150         types. 
20151
20152         (TypeContainer::AddConstructor): Keep track of default constructor
20153         and the default static constructor.
20154
20155         (Constructor::) Another class that starts using `public readonly'
20156         instead of properties. 
20157
20158         (Constructor::IsDefault): Whether this is a default constructor. 
20159
20160         (Field::) use readonly public fields instead of properties also.
20161
20162         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
20163         track of static constructors;  If none is used, turn on
20164         BeforeFieldInit in the TypeAttributes. 
20165
20166         * cs-parser.jay (opt_argument_list): now the return can be null
20167         for the cases where there are no arguments. 
20168
20169         (constructor_declarator): If there is no implicit `base' or
20170         `this', then invoke the default parent constructor. 
20171
20172         * modifiers.cs (MethodAttr): New static function maps a set of
20173         modifiers flags into a MethodAttributes enum
20174         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
20175         MethodAttr, TypeAttr to represent the various mappings where the
20176         modifiers are used.
20177         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
20178
20179 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
20180
20181         * parameter.cs (GetParameterInfo): Fix bug where there would be no
20182         method arguments.
20183
20184         * interface.cs (PopulateIndexer): Implemented the code generator
20185         for interface indexers.
20186
20187 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
20188
20189         * interface.cs (InterfaceMemberBase): Now we track the new status
20190         here.  
20191
20192         (PopulateProperty): Implement property population.  Woohoo!  Got
20193         Methods and Properties going today. 
20194
20195         Removed all the properties for interfaces, and replaced them with
20196         `public readonly' fields. 
20197
20198 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
20199
20200         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
20201         initialize their hashtables/arraylists only when they are needed
20202         instead of doing this always.
20203
20204         * parameter.cs: Handle refs and out parameters.
20205
20206         * cs-parser.jay: Use an ArrayList to construct the arguments
20207         instead of the ParameterCollection, and then cast that to a
20208         Parameter[] array.
20209
20210         * parameter.cs: Drop the use of ParameterCollection and use
20211         instead arrays of Parameters.
20212
20213         (GetParameterInfo): Use the Type, not the Name when resolving
20214         types. 
20215
20216 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
20217
20218         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
20219         and instead use public readonly fields.
20220
20221         * class.cs: Put back walking code for type containers.
20222
20223 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
20224
20225         * class.cs (MakeConstant): Code to define constants.
20226
20227         * rootcontext.cs (LookupType): New function.  Used to locate types 
20228
20229
20230 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
20231
20232         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
20233         this System.Reflection code is.  Kudos to Microsoft
20234
20235         * typemanager.cs: Implement a type cache and avoid loading all
20236         types at boot time.  Wrap in LookupType the internals.  This made
20237         the compiler so much faster.  Wow.  I rule!
20238
20239         * driver.cs: Make sure we always load mscorlib first (for
20240         debugging purposes, nothing really important).
20241
20242         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
20243         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
20244
20245         * rootcontext.cs: Lookup types on their namespace;  Lookup types
20246         on namespaces that have been imported using the `using' keyword.
20247
20248         * class.cs (TypeContainer::TypeAttr): Virtualize.
20249         (Class::TypeAttr): Return attributes suitable for this bad boy.
20250         (Struct::TypeAttr): ditto.
20251         Handle nested classes.
20252         (TypeContainer::) Remove all the type visiting code, it is now
20253         replaced with the rootcontext.cs code
20254
20255         * rootcontext.cs (GetClassBases): Added support for structs. 
20256
20257 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
20258
20259         * interface.cs, statement.cs, class.cs, parameter.cs,
20260         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
20261         Drop use of TypeRefs, and use strings instead.
20262
20263 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
20264
20265         * rootcontext.cs: 
20266
20267         * class.cs (Struct::Struct): set the SEALED flags after
20268         checking the modifiers.
20269         (TypeContainer::TypeAttr): new property, returns the
20270         TypeAttributes for a class.  
20271
20272         * cs-parser.jay (type_list): Oops, list production was creating a
20273         new list of base types.
20274
20275         * rootcontext.cs (StdLib): New property.
20276         (GetInterfaceTypeByName): returns an interface by type name, and
20277         encapsulates error handling here.
20278         (GetInterfaces): simplified.
20279         (ResolveTree): Encapsulated all the tree resolution here.
20280         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
20281         types. 
20282
20283         * driver.cs: Add support for --nostdlib, to avoid loading the
20284         default assemblies.
20285         (Main): Do not put tree resolution here. 
20286
20287         * rootcontext.cs: Beginning of the class resolution.
20288
20289 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * rootcontext.cs: Provide better error reporting. 
20292
20293         * cs-parser.jay (interface_base): set our $$ to be interfaces.
20294
20295         * rootcontext.cs (CreateInterface): Handle the case where there
20296         are no parent interfaces.
20297
20298         (CloseTypes): Routine to flush types at the end.
20299         (CreateInterface): Track types.
20300         (GetInterfaces): Returns an array of Types from the list of
20301         defined interfaces.
20302
20303         * typemanager.c (AddUserType): Mechanism to track user types (puts
20304         the type on the global type hash, and allows us to close it at the
20305         end). 
20306
20307 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
20308
20309         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
20310         RecordInterface instead.
20311
20312         * cs-parser.jay: Updated to reflect changes above.
20313
20314         * decl.cs (Definition): Keep track of the TypeBuilder type that
20315         represents this type here.  Not sure we will use it in the long
20316         run, but wont hurt for now.
20317
20318         * driver.cs: Smaller changes to accomodate the new code.
20319
20320         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
20321         when done. 
20322
20323         * rootcontext.cs (CreateInterface):  New method, used to create
20324         the System.TypeBuilder type for interfaces.
20325         (ResolveInterfaces): new entry point to resolve the interface
20326         hierarchy. 
20327         (CodeGen): Property, used to keep track of the code generator.
20328
20329 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
20330
20331         * cs-parser.jay: Add a second production for delegate_declaration
20332         with `VOID'.
20333
20334         (enum_body): Put an opt_comma here instead of putting it on
20335         enum_body or enum_member_declarations so we can handle trailing
20336         commas on enumeration members.  Gets rid of a shift/reduce.
20337
20338         (type_list): Need a COMMA in the middle.
20339
20340         (indexer_declaration): Tell tokenizer to recognize get/set
20341
20342         * Remove old targets.
20343
20344         * Re-add the parser target.
20345
20346 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20347
20348         * cs-parser.jay: Add precendence rules for a number of operators
20349         ot reduce the number of shift/reduce conflicts in the grammar.
20350
20351 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
20352
20353         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
20354         and put it here.
20355
20356         Get rid of old crufty code.
20357
20358         * rootcontext.cs: Use this to keep track of the parsed
20359         representation and the defined types available to the program. 
20360
20361         * gen-treedump.cs: adjust for new convention.
20362
20363         * type.cs: Split out the type manager, and the assembly builder
20364         from here. 
20365
20366         * typemanager.cs: the type manager will live here now.
20367
20368         * cil-codegen.cs: And the code generator here. 
20369
20370 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
20371
20372         * makefile: Fixed up for easy making.
20373
20374 2001-07-13  Simon Cozens <simon@simon-cozens.org>
20375
20376         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
20377         the 
20378
20379         (unary_expression): Expand pre_increment_expression and
20380         post_decrement_expression to reduce a shift/reduce.
20381
20382 2001-07-11  Simon Cozens
20383
20384         * cs-tokenizer.cs: Hex numbers should begin with a 0.
20385
20386         Improve allow_keyword_as_indent name.
20387
20388 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
20389
20390         * Adjustments for Beta2. 
20391
20392 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
20393
20394         * decl.cs: Added `Define' abstract method.
20395         (InTransit): new property, used to catch recursive definitions. 
20396
20397         * interface.cs: Implement `Define'. 
20398
20399         * modifiers.cs: Map Modifiers.constants to
20400         System.Reflection.TypeAttribute flags.
20401
20402         * class.cs: Keep track of types and user-defined types.
20403         (BuilderInit): New method for creating an assembly
20404         (ResolveType): New function to launch the resolution process, only
20405         used by interfaces for now.
20406
20407         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
20408         that are inserted into the name space. 
20409
20410 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
20411
20412         * ARGH.  I have screwed up my tree so many times due to the use of
20413         rsync rather than using CVS.  Going to fix this at once. 
20414
20415         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
20416         load types.
20417
20418 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
20419
20420         * Experiment successful: Use System.Type rather that our own
20421         version of Type.  
20422
20423 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
20424
20425         * cs-parser.jay: Removed nsAliases from here.
20426
20427         Use new namespaces, handle `using XXX;' 
20428
20429         * namespace.cs: Reimplemented namespace handling, use a recursive
20430         definition of the class.  Now we can keep track of using clauses
20431         and catch invalid using clauses.
20432
20433 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
20434
20435         * gen-treedump.cs: Adapted for all the renaming.
20436
20437         * expression.cs (Expression): this class now has a Type property
20438         which returns an expression Type.
20439
20440         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
20441         `Type', as this has a different meaning now in the base
20442
20443 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
20444
20445         * interface.cs, class.cs: Removed from all the sources the
20446         references to signature computation, as we can not do method
20447         signature computation during the parsing time, as we are not
20448         trying to solve at that point distinguishing:
20449
20450         class X {
20451                 void a (Blah x) {}
20452                 void a (NS.Blah x) {}
20453         }
20454
20455         Which depending on the context might be valid or not, as we do not
20456         know if Blah is the same thing as NS.Blah at that point.
20457
20458         * Redid everything so the code uses TypeRefs now instead of
20459         Types.  TypeRefs are just temporary type placeholders, that need
20460         to be resolved.  They initially have a pointer to a string and the
20461         current scope in which they are used.  This is used later by the
20462         compiler to resolve the reference to an actual Type. 
20463
20464         * DeclSpace is no longer a CIR.Type, and neither are
20465         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
20466         are all DeclSpaces, but no Types. 
20467
20468         * type.cs (TypeRefManager): This implements the TypeRef manager,
20469         which keeps track of all the types that need to be resolved after
20470         the parsing has finished. 
20471
20472 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
20473
20474         * ARGH.  We are going to have to store `foreach' as a class rather
20475         than resolving it, as we need to verify error 1579 after name
20476         resolution.   *OR* we could keep a flag that says `This request to
20477         IEnumerator comes from a foreach statement' which we can then use
20478         to generate the error.
20479
20480 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
20481
20482         * class.cs (TypeContainer.AddMethod): we now add methods to the
20483         MethodGroup instead of the method hashtable.  
20484
20485         * expression.cs: Add MethodGroup abstraction, which gets us one
20486         step closer to the specification in the way we handle method
20487         declarations.  
20488
20489         * cs-parser.jay (primary_expression): qualified_identifier now
20490         tried to match up an identifier to a local variable reference or
20491         to a parameter reference.
20492
20493         current_local_parameters is now a parser global variable that
20494         points to the current parameters for the block, used during name
20495         lookup.
20496
20497         (property_declaration): Now creates an implicit `value' argument to
20498         the set accessor.
20499
20500 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
20501
20502         * parameter.cs: Do not use `param' arguments as part of the
20503         signature, per the spec.
20504
20505 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
20506
20507         * decl.cs: Base class for classes, structs and interfaces.  This
20508         is the "Declaration Space" 
20509
20510         * cs-parser.jay: Use CheckDef for checking declaration errors
20511         instead of having one on each function.
20512
20513         * class.cs: Factor out some code for handling error handling in
20514         accordance to the "Declarations" section in the "Basic Concepts"
20515         chapter in the ECMA C# spec.
20516
20517         * interface.cs: Make all interface member classes derive from
20518         InterfaceMemberBase.
20519
20520 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
20521
20522         * Many things: all interfaces are parsed and generated in
20523         gen-treedump.  Support for member variables, constructors,
20524         destructors, properties, constants is there.
20525
20526         Beginning of the IL backend, but very little done, just there for
20527         testing purposes. 
20528
20529 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
20530
20531         * cs-parser.jay: Fix labeled statement.
20532
20533         * cs-tokenizer.cs (escape): Escape " and ' always.
20534         ref_line, ref_name: keep track of the line/filename as instructed
20535         by #line by the compiler.
20536         Parse #line.
20537
20538 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
20539
20540         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
20541         to match the values in System.CodeDOM.
20542
20543         Divid renamed to Divide.
20544
20545         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
20546         statements. 
20547         (Statements.set): remove.
20548
20549         * System.CodeDOM/CodeCatchClause.cs: always have a valid
20550         statements. 
20551
20552         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
20553         falseStatements always have valid values. 
20554
20555         * cs-parser.jay: Use System.CodeDOM now.
20556