Fix #78156
[mono.git] / mcs / gmcs / ChangeLog
1 2006-04-24  Raja R Harinath  <rharinath@novell.com>
2
3         Fix #78156
4         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
5
6 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
7
8         A fix for #49011.
9         constant.cs (FloatConstant.Reduce): Add range checking for checked context.
10         (DoubleConstant.Reduce): Ditto.
11
12 2006-04-23  Raja R Harinath  <rharinath@novell.com>
13
14         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
15         Remove 'lvalue_right_side' argument.  Move parts to ...
16         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
17         (LocalVariable.DoResolveLValue): ... these.
18
19 2006-04-21  Raja R Harinath  <rharinath@novell.com>
20
21         Fix cs1655.cs
22         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
23         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
24         (LocalVariableReference.DoResolveBase): Use it to implement new
25         CS1655 check.
26         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
27         (Argument.Resolve): Simplify.  Move CS1510 check ...
28         * ecore.cs (Expression.ResolveLValue): ... here.
29         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
30         (PropertyExpr.DoResolveLValue): Likewise.
31         (FieldExpr.Report_AssignToReadonly): Likewise.
32         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
33         LValueMemberAccess or LValueMemberOutAccess on instance depending
34         on it.
35         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
36         DoResolve as appropriate.
37
38 2006-04-20  Raja R Harinath  <rharinath@novell.com>
39
40         Fix #75800
41         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
42         implicit conversions on 'out' and 'ref' arguments.
43
44         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
45         improve clarity.  Remove dead code.
46
47         Fix #66031
48         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
49         (Catch.Resolve): Resolve VarBlock if it exists.
50
51 2006-04-19  Miguel de Icaza  <miguel@novell.com>
52
53         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
54         twice, this was some residual code, the enumerator was emitted
55         properly in the two branche of if later.
56
57         Fixes #78031
58         
59         Thanks to Martin for finding the source of the problem
60         
61 2006-04-19  Raja R Harinath  <rharinath@novell.com>
62
63         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
64         cast is never an lvalue.
65         (Cast.DoResolve, Cast.ResolveRest): Combine.
66         (Argument.Emit): Simplify slightly.  Move 'Expr is
67         IMemoryLocation' check ...
68         (Argument.Resolve): ... here.
69         (Argument.Error_LValueRequired): Remove.  Inline into only user.
70
71         Simplifications.  Fix cs0191-2.cs
72         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
73         CS1649 and CS1651 to ...
74         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
75         the actual selection of the error code and message to a lookup
76         table.  Add a dummy return value to simplify callsites.
77         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
78         readonly fields of other instances of the same type.  Move CS0197
79         warning from ...
80         * expression.cs (Argument.Resolve): ... here.  Simplify code.
81         Ensure that ec.InRefOutArgumentResolving is only set during LValue
82         resolution of an out or ref argument.  The code simplification
83         above uses this invariant.
84
85 2006-04-18  Raja R Harinath  <rharinath@novell.com>
86
87         Possibly fix #77752.  Fix cs1690-[4-7].cs.
88         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
89         CheckMarshallByRefAccess.  Drop parameter.
90         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
91         warning.
92         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
93         InstanceExpression.
94         * report.cs (AllWarnings): Add CS1690.
95         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
96         for ref access too.
97         (LocalVariableReference.DoResolveBase): Update.
98
99 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
100
101         class.cs (MethodOrOperator): Moved common parts from method class.
102         detect obsolete attributes.
103         (Method.Define): Simplified as it reuses code from base.
104         (Constructor.ValidAttributeTargets): Fixed issue found during
105         refactoring.
106         (Destructor.ValidAttributeTargets): Fixed issue found during
107         refactoring.
108         (Operator): Finished refactoring set off by #78020. Operator class is now
109         ordinary method class.
110
111         * anonymous.cs: Updated.
112
113 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
114
115         (Constructor.Emit): Don't emit the attributes twice.
116
117 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
118
119         class.cs (Operator.Emit): Extracted code from MethodData to correctly
120         detect obsolete attributes.
121         (Method.CreateEmitContext): Moved to MethodOrOperator.
122
123 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
124
125         A fix for #78048.
126         class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
127         customized exception to make crash detection easier.
128         (MethodOrOperator): Started to work on new base class for methods and
129         operators.
130         (Method): Derives from MethodOrOperator.
131         (Constructor.Emit): Emits its own attributes.
132         (AbstractPropertyEventMethod.Emit): Ditto.
133         (Operator): Derives from MethodOrOperator, will refactor fully in extra
134         patch.
135         (Operator.Emit): It's temporary more tricky than should be.
136         
137         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
138
139         * report.cs (InternalErrorException): Add ctor with inner exception.
140
141 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
142
143         A fix for #76744.
144         ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
145         only not visible.
146
147 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
148
149         A fix for #77916.
150         expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
151         array.
152
153 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
154
155         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
156         attribute is present and Guid not.
157         (Interface.ApplyAttributeBuilder): Ditto.
158
159         * attribute.cs: Add error message.
160
161 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
162
163         A fix for #78020.
164
165         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
166         sources (it's composite) so hold them in extra array as they are used in
167         Emit phase only. It worked in the previous versions by mistake.
168         (Attribute.Emit): Emit attribute for more owners when exist.
169
170         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
171         it has now different behaviour.
172
173 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
174
175         * constant.cs (Constant.IsDefaultInitializer): New method.
176
177         * class.cs: Updated.
178
179         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
180         re-initialize default values. It saves KBs almost for every assembly.
181         Thanks Zoltan for the idea.
182         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
183         (ArrayCreation.DoResolve): Resolve only once.
184         (ArrayCreation.Emit): Emit static initializer only when it is faster.
185         (ArrayCreation.GetAttributableValue): Cope with optimized values.
186
187 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
188
189         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
190         From #77961.
191
192 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
193
194         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
195         in an embedded statement too.
196
197 2006-04-01  Raja R Harinath  <rharinath@novell.com>
198
199         Fix #77929
200         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
201         testing.
202
203         Fix #77958
204         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
205
206         Fix #77962
207         * report.cs (SymbolRelatedToPreviousError): Drop generic type
208         arguments before checking whether a type is reflected or not.
209
210         Fix #77954
211         * expression.cs (Invocation.IsApplicable): Ensure a generic method
212         definition doesn't take part in overload resolution.
213         (Invocation.IsParamsMethodApplicable): Likewise.
214         (Invocation.OverloadResolve): When replacing a reflected override
215         method with its base definition, ensure that type arguments are
216         applied.
217
218 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
219
220         A fix for #77966.
221
222         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
223         was not specified.
224
225         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
226
227 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
228
229         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
230         phase.
231
232         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
233         LocalTemporary change.
234
235         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
236         TypeContainer.
237         (ClassOrStruct.DefineFieldInitializers): Implemented static field
238         initializers optimization.
239         (ClassOrStruct.TypeAttr): Moved from modifiers.
240         (Constructor.CheckBase): Don't crash when static ctor has parameters.
241         (FieldBase.ResolveInitializer): Resolves initializer.
242         (FieldBase.HasDefaultInitializer): New property.
243
244         * cs-parser.jay: Removed message.
245
246         * expression.cs (CompilerGeneratedThis): New specialization.
247
248         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
249
250 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
251
252         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
253
254 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
255
256         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
257         be now EnumConstants only.
258
259 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
260
261         * attribute.cs, driver.cs: Reset more caches.
262
263 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
264
265         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
266
267 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
268
269         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
270         for easier reuse. Updated all overrides.
271         (IntegralConstant): New base class for all integral constants.
272         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
273         of the constant range, report custom error.
274         (UIntConstant.Reduce): Fixed uint conversion.
275
276         * ecore.cs, literal.cs: Reduce updates.
277
278 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
279
280         A fix for #75813.
281
282         * class.cs (Constructor.Define): Removed extra if for default ctors.
283         A patch from Atsushi Enomoto.
284
285 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
286
287         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
288         GetAttributableValue.
289
290         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
291         when required.
292
293         * convert.cs (ImplicitConversionRequired): Error message moved to
294         DoubleLiteral.
295
296         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
297         automatic implicit conversion of an output value.
298         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
299
300         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
301         conversion.
302         (TypeOf.GetAttributableValue): Add extra handling for object type.
303
304         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
305         special error message.
306
307 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
308
309         * class.cs (Constructor.Emit): Don't crash when struct ctor is
310         InternalCall.
311         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
312         compatible with MS runtime.
313
314 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
315
316         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
317         attribute arguments here.
318
319         * class.cs (Indexer.Define): The check was moved to attribute class.
320
321 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
322
323         * expression.cs (StringConcat.Append): Reverted back to no warning state.
324
325 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
326
327         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
328
329         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
330         the blocks too.
331
332 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
333
334         * doc-bootstrap.cs : fix build.
335
336 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
337
338         * expression.cs (StringConcat.Append): Issue a warning when empty string
339         is going to append.
340
341 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
342
343         * assign.cs (CompoundAssign.ResolveSource): Removed.
344
345         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
346         clean up.
347
348         * class.cs (TypeContainer.FindMethods): Removed.
349         (TypeContainer.CheckMemberUsage): Made static.
350
351         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
352
353         * constant.cs (CheckRange): Removed unused type argument.
354         (CheckUnsigned): Removed unused type argument.
355
356         * cs-parser.jay: Updated after MemberAccess clean up.
357         Uses Length for empty string test.
358
359         * cs-tokenizer.cs: Uses Length for empty string test.
360         (IsCastToken): Made static.
361         (is_hex): Made static.
362         (real_type_suffix): Made static.
363
364         * decl.cs (SetupCache): Made static.
365         (OnGenerateDocComment): Removed unused ds argument.
366
367         * delegate.cs (VerifyDelegate): Removed unused argument.
368
369         * doc.cs: Uses Length for empty string test.
370
371         * driver.cs: Uses Length for empty string test.
372
373         * enum.cs (IsValidEnumType): Made static
374
375         * expression.cs (EnumLiftUp): Removed unused argument.
376         (ResolveMethodGroup): Ditto.
377         (BetterConversion): Ditto.
378         (GetVarargsTypes): Ditto.
379         (UpdateIndices): Ditto.
380         (ValidateInitializers): Ditto.
381         (MemberAccess.ctor): Ditto.
382         (GetIndexersForType): Ditto.
383
384         * flowanalysis.cs: (MergeFinally): Removed unused argument.
385
386         * iterators.cs: Updated after MemberAccess clean up.
387
388         * location.cs: Uses Length for empty string test.
389
390         * namespace.cs: Uses Length for empty string test.
391
392          * report.cs (CheckWarningCode): Made static.
393
394         * statement.cs (LabeledStatement): Removed unused argument.
395
396         * typemanager.cs (FilterNone): Removed.
397
398 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
399
400         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
401         obsolete.
402
403         * class.cs: Updated.
404
405 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
406
407         * cs-parser.jay.cs: __arglist is not allowed for delegates.
408
409 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
410
411         A fix for #77816.
412
413         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
414         host container.
415         (AnonymousMethod.ImplicitStandardConversionExists): New method.
416         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
417         Add more error reporting; Fixed issue with params.
418
419         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
420
421         * cs-parser.jay: AnonymousMethod requires host container.
422
423         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
424
425 2006-03-18  Raja R Harinath  <harinath@gmail.com>
426
427         * class.cs: Change 'TypeContainer ds' constructor argument to
428         'DeclSpace parent'.  Some classes were missed below due to
429         different naming convention.
430
431         * class.cs (MemberCore.Parent): Delete.  This makes the
432         ParentContainer changes below enforceable by the compiler.
433
434         Treat pointers to enclosing declaration space as 'DeclSpace', not
435         'TypeContainer'.
436         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
437         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
438
439         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
440         of TypeContainer.
441         (Block.AddThisVariable): Likewise.
442         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
443         (AbstractPropertyEventMethod.Emit): Likewise.
444         (AbstractPropertyEventMethod.EmitMethod): Likewise.
445         (GetMethod.Define, SetMethod.Define): Likewise.
446         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
447         (DelegateMethod.EmitMethod): Likewise.
448
449         Fix regression test-partial-13.cs.
450         Rationalize use of PartialContainer.  Ensure that the partial
451         class semantics can be tied to type-correctness, i.e., any
452         violation will cause a compile error.
453         * class.cs, const.cs: Access all fields that belong to class
454         TypeContainer via ParentContainer.  Arguments of EmitContexts and
455         Resolve()-like functions still use 'Parent'.
456
457         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
458         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
459         (PropertyMethod.CheckModifiers): Remove unused argument.
460         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
461         DeclSpace.
462
463 2006-03-28  Raja R Harinath  <rharinath@novell.com>
464
465         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
466
467 2006-03-17  Raja R Harinath  <harinath@gmail.com>
468
469         Make semantics of PartialContainer simpler.
470         * decl.cs (DeclSpace.IsPartial): Remove.
471         * class.cs (TypeContainer.IsPartial): Likewise.
472         (TypeContainer..ctor): Set PartialContainer to point to self.
473         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
474         (TypeContainer.FindNestedType): Likewise.
475         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
476
477 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
478
479         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
480
481 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
482
483         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
484         classes.
485
486 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
487
488         * class.cs (Operator.Define): An error for base conversion was not
489         reported correctly.
490
491 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
492
493         A fix for #77593, #77574.
494
495         * class.cs (MethodCore.CheckBase): Another if for operator.
496
497 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
498
499         A fix for #77822.
500
501         * expression.cs (VerifyArgumentsCompat): Reverted to double error
502         reporting, it's more tricky than I thought.
503
504 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
505
506         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
507         were not resolved
508
509         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
510         (DelegateCreation.ImplicitStandardConversionExists): New method for just
511         conversion test.
512         
513         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
514         not needed.
515
516 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
517
518         A fix for #77353.
519
520         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
521         (Event.Define): ditto
522         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
523
524         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
525         Removed redundant code and set NewSlot for Invoke method too.
526
527         * parameter.cs (Parameters.ctor): Add custom, type ctor.
528         (Parameters.MergeGenerated): New method. Use this method when you merge
529         compiler generated argument with user arguments.
530
531 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
532
533         * attribute.cs (ResolveAsTypeTerminal): Removed.
534
535         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
536         specialization for predefined types; 30% speed up.
537         Finally placed obsolete check to right place.
538         (Expression.ResolveType): Removed.
539
540         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
541         Updated after ResolveType was removed.
542
543         * expression.cs (Cast.ctor): Check void cast.
544         (Binary.ResolveAsTypeTerminal): Is never type.
545         (Conditional.ResolveAsTypeTerminal): Is never type.
546
547         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
548
549 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
550
551         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
552
553 2006-03-23  Martin Baulig  <martin@ximian.com>
554
555         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
556         type check if either of the types is an open generic type.
557
558 2006-03-23  Martin Baulig  <martin@ximian.com>
559
560         * convert.cs
561         (Convert.ExplicitTypeParameterConversion): New method; implement
562         explicit type parameter conversions.
563
564 2006-03-23  Martin Baulig  <martin@ximian.com>
565
566         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
567         blindly allow all conversions if we do not have any constraints.
568
569 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
570
571         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
572         these two separated members to simplify the code.
573         (Attribute.Resolve): Refactored to use new fields and methods.
574         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
575         implemented obsolete attribute checking.
576         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
577         implemented obsolete checking again. It look line never ending quest ;-)
578         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
579
580         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
581
582         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
583
584         *class.cs (Property.Define): Add RegisterProperty call.
585
586         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
587         argument groups (only 2).
588
589         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
590         encoding expression to arguments.
591         (Expression.ExprClassToResolveFlags): Just turned to property.
592
593         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
594         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
595         optimized as well as implemented support for zero-length attributes.
596
597         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
598         Add caching of PropertyInfo's.
599
600 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
601
602         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
603         error multiple times.
604
605 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
606
607         New partial class implementation.
608         A fix for #77027, #77029, #77403
609
610         * attribute.cs (Attributable): Made attributes protected.
611
612         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
613         the replacements of ClassPart and PartialContainer.
614         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
615         (TypeContainer.AddInterface): Ditto.
616         (TypeContainer.AddPartial): The main method for partial classes. It checks
617         for errors and merges ModFlags and attributes. At the end class is added to
618         partial_parts list.
619         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
620         required here.
621         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
622         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
623         from the rest of partial classes.
624         (TypeContainer.GetClassBases): Simplified.
625         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
626         DefineType.
627         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
628         (TypeContainer.HasExplicitLayout): Uses Flags now.
629         (PartialContainer): Removed.
630         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
631         (StaticClass): Was merged with Class.
632         (Class.GetClassBases): class and static class bases are verified here.
633         (Class.TypeAttr): Added static attributes when class is static.
634         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
635         (MemberBase): In some cases we need to call parent container for partial
636         class. It should be eliminated but it's not easy now.
637
638         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
639
640         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
641         partial classed to accumulate class comments.
642         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
643
644         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
645
646         * driver.cs (MainDriver): Tree.GetDecl was removed.
647
648         * modifiers.cs (Modifiers): Add partial modifier.
649
650         * tree.cs (Tree.decl): Removed.
651         (RootTypes): Started to use this class more often for root types
652         specializations.
653
654 2006-03-23  Raja R Harinath  <rharinath@novell.com>
655
656         * generic.cs (TypeParameter.UpdateConstraints): Update
657         'constraints' if null.
658
659 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
660
661         A fix for #77615
662
663         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
664         external interface does not have an attribute.
665
666 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
667
668         Another prerequisites for new partial classs implementation.
669         
670         * attribute.cs (Attribute.Equal): Implemented.
671         (Attribute.Emit): Changed as attributes can be applied more than twice.
672         (Attributes.Emit): Check for duplicate attributes here.
673
674         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
675         as a parameter, clean-up.
676
677 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
678
679         A fix for #77485
680
681         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
682         contains obsolete attribute check which can in some cases look for base
683         type of current class which is not initialized yet.
684         (TypeContainer.BaseType): Replacement of ptype.
685
686         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
687
688 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
689
690         First of prerequisites for new partial classs implemention.
691         
692         * attribute.cs (Attributable): Extended by ResolveContext;
693         Attributes finally have correct context for resolving in all cases.
694         (AttachTo): Attribute owner is assigned here.
695
696         * codegen.cs (IResolveContext): Introduce new interface to hold
697         all information needed in resolving phase.
698         (EmitContext): Implements IResolveContext; more clean-up needed here.
699         
700         * decl.cs (MemberCore): Implemented IResolveContext.
701
702         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
703         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
704         parameter.cs, statement.cs, tree.cs, typemanager.cs:
705         Refactored to use new IResolveContext instead of EmitContext; cleanup
706
707 2006-03-22  Raja R Harinath  <rharinath@novell.com>
708
709         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
710         mcs to keep code differences small.
711         * attribute.cs (Attribute.GetParameterDefaultValue): New.
712         * typemanager.cs (parameter_default_value_attribute_type): New.
713         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
714         CS1908 check.
715
716 2006-03-22  Martin Baulig  <martin@ximian.com>
717
718         * generic.cs
719         (Nullable.NullableLiteral): Derive from `NullLiteral'.
720
721         * convert.cs
722         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
723         instead of the normal `NullLiteral'.
724
725 2006-03-21  Martin Baulig  <martin@ximian.com>
726
727         Fix #77583.
728         * generic.cs (TypeManager.InferType): If `pt' is a generic
729         parameter, don't check whether `pt == at'.
730
731 2006-03-20  Raja R Harinath  <rharinath@novell.com>
732
733         Fix #77852
734         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
735         (TypeParameter.Resolve): Update to change.
736         (ConstraintChecker.CheckConstraints): Resolve type-argument
737         constraints before use.
738
739 2006-03-16  Martin Baulig  <martin@ximian.com>
740
741         * generic.cs
742         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
743         and don't have any instance constructors, also lookup in the base class.
744         (TypeManager.IsNullableValueType): New public method.
745
746         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
747         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
748         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
749
750         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
751         instead of just TypeManager.IsNullableType() to determine whether
752         a lifted operator exists.
753         (UnaryMutator.DoResolve): Likewise.
754         (Conditional.DoResolve): Likewise.
755         (Binary.DoResolve): A lifted operator only exists if both operands
756         are valuetypes and at least one of them is a nullable type.
757
758 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
759
760         * iterator.cs : yield break is allowed in try statement which has
761           catch clauses. Fixed bug #77767.
762
763 2006-03-12  Martin Baulig  <martin@ximian.com>
764
765         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
766         private IsSignatureEqual() to compare types; see the comment in
767         that method; fixes #77674.
768
769 2006-03-10  Raja R Harinath  <rharinath@novell.com>
770
771         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
772         (Expression.ResolveAsTypeTerminal): Likewise.
773         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
774         * expression.cs, generic.cs, iterators.cs: Likewise.
775         * parameter.cs, statement.cs, typemanager.cs: Likewise.
776
777 2006-03-09  Martin Baulig  <martin@ximian.com>
778
779         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
780         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
781
782 2006-03-09  Martin Baulig  <martin@ximian.com>
783
784         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
785         `prepared' flag is set.
786
787         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
788         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
789         issues; see gtest-254.cs.
790
791 2006-03-07  Martin Baulig  <martin@ximian.com>
792
793         * generic.cs (TypeManager.InferType): Allow infering
794         `IEnumerable<T>' with an array of T; see gtest-251.cs.
795
796 2006-03-06  Martin Baulig  <martin@ximian.com>
797
798         * generic.cs
799         (TypeManager.InferType): Fix gtest-250.cs.
800
801         * typemanager.cs
802         (TypeManager.IsSubclassOf): Also check the base class.
803
804         * expression.cs
805         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
806         fixes gtest-249.cs.
807
808 2006-03-01  Raja R Harinath  <rharinath@novell.com>
809
810         Fix #77679.
811         * expression.cs (ParameterReference.DoResolveBase): Change return
812         type to bool.
813         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
814         Update.
815
816         Fix #77628.
817         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
818
819         Fix #77642.
820         * typemanager.cs (GetFullNameSignature): Don't nullref on
821         protected accessors.
822
823 2006-02-16  Martin Baulig  <martin@ximian.com>
824
825         * generic.cs
826         (TypeManager.GetGenericFieldDefinition): New public method; use it
827         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
828
829 2006-02-14  Martin Baulig  <martin@ximian.com>
830
831         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
832
833 2006-02-14  Martin Baulig  <martin@ximian.com>
834
835         * generic.cs
836         (TypeManager.DropGenericMethodArguments): New public method; don't
837         use GetGenericMethodDefinition() on something which is not a
838         generic method.
839
840 2006-02-14  Martin Baulig  <martin@ximian.com>
841
842         * generic.cs
843         (ConstraintChecker.CheckConstraints): If a type parameter has the
844         `struct' constraint, the type must be a non-nullable valuetype.
845
846 2006-02-10  Martin Baulig  <martin@ximian.com>
847
848         * typemanager.cs
849         (TypeManager.IsOverride): Make this work for instantiated methods
850         in a generic class; fixes #77509.
851         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
852         rather than calling it directly; fixes #77488.  
853
854 2006-02-08  Martin Baulig  <martin@ximian.com>
855
856         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
857         reporting into CheckConstraint() so we can use the correctly
858         instantiated type.
859
860 2006-02-08  Martin Baulig  <martin@ximian.com>
861
862         * expression.cs (BaseAccess): Add support for generic methods.
863
864         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
865         the new MethodGroupExpr.
866
867 2006-02-07  Martin Baulig  <martin@ximian.com>
868
869         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
870         also reference types; fixes #77483.
871
872 2006-02-07  Martin Baulig  <martin@ximian.com>
873
874         * generic.cs
875         (TypeManager.IsGenericMethod): We now return whether something is
876         an instantiated generic method (and not a generic method def).
877         (TypeManager.IsGenericMethodDefinition): New public method.
878
879         * typemanager.cs
880         (TypeManager.CSharpSignature): Only include type arguments for
881         "real" generic methods, not for any instantiated method.
882         (TypeManager.GetMethodName): Likewise, but also allow generic
883         method definitions here.
884
885 2006-02-06  Miguel de Icaza  <miguel@novell.com>
886
887         * codegen.cs (EmitScopeInitFromBlock): check here the
888         capture_context, there is no need to make two calls to the
889         EmitContext. 
890
891         * anonymous.cs: Add some debugging messages that might help me
892         track other instances of this problem in the future (the
893         regression of test 467).
894
895         * cs-parser.jay: track the variable block, as we need to initalize
896         any captured variables declared in this block for the "catch"
897         portion of the "Try" statement.
898
899         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
900         scope initialization for captured variables. 
901
902         Also, move the emit for the variables after the block location has
903         been marked.
904
905 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
906
907        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
908         
909 2006-02-06  Martin Baulig  <martin@ximian.com>
910
911         * class.cs (TypeContainer.DefineType): If we're a struct, pass
912         `TypeManager.value_type' as parent type to
913         ModuleBuilder.DefineType().  Fixes #77358.      
914
915 2006-02-02  Miguel de Icaza  <miguel@novell.com>
916
917         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
918         commit yesterday, the initialization for the roots is necessary.
919         What is not necessary is the scope activation.
920
921 2006-02-02  Raja R Harinath  <rharinath@novell.com>
922
923         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
924         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
925         CS0206 checks.
926         (Argument.Resolve): Remove CS0206 checks.
927
928 2006-02-01  Miguel de Icaza  <miguel@novell.com>
929
930         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
931         scopes for all the roots, the scopes will now be emitted when the
932         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
933
934         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
935         code.  This reduces a lot of existing cruft.
936         
937         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
938         that the ScopeInfo is generated as we enter the scope, not at the
939         time of use, which is what we used to do before.
940
941         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
942         every time a Block is about to be emitted if we have a
943         CaptureContext. 
944
945 2006-02-01  Raja R Harinath  <rharinath@novell.com>
946
947         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
948         attribute for mscorlib too.
949
950         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
951         (Reset): Update.
952         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
953
954         * typemanager.cs (cons_param_array_attribute): Make private.
955         (Reset): Set it to null.
956         (InitCoreHelpers): Don't initialize it.
957         (ConsParamArrayAttribute): New.  Initialize it as needed.
958         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
959
960 2006-01-31  Miguel de Icaza  <miguel@novell.com>
961
962         * expression.cs: There might be errors reported during the
963         selection of applicable methods.  If there are errors, do not
964         continue execution as it will lead the compiler to crash.
965
966 2006-01-30  Miguel de Icaza  <miguel@novell.com>
967
968         * expression.cs: Member access is not allowed on anonymous
969         methods.  Fixes #77402.
970
971 2006-01-30  Raja R Harinath  <rharinath@novell.com>
972
973         Fix #77401
974         * cs-parser.jay (VariableDeclaration): Don't set
975         current_array_type to null.
976         (field_declaration, event_declaration, declaration_statement):
977         Set it to null here.
978
979 2006-01-29  Raja R Harinath  <harinath@gmail.com>
980
981         Fix part of #77397
982         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
983
984 2006-01-28  Raja R Harinath  <harinath@gmail.com>
985
986         * typemanager.cs (GenericParameterPosition): New.
987         * doc.cs: Use it.
988
989 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
990
991         * doc.cs : To process "include" elements, first we should create
992           another list than XmlNodeList, because it could result in node
993           removal, which could result in that the XmlNodeList gives up
994           yielding next node.
995
996 2006-01-25  Miguel de Icaza  <miguel@novell.com>
997
998         * expression.cs: Introduce an error report that we were not
999         catching before.   Gonzalo ran into it.
1000
1001 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1002
1003         A fix for bug: #76957
1004         
1005         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1006         ComputeMethodHost before creating the method, this is a new
1007         requirement. 
1008
1009         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1010         that this method references (RegisterScope).  The actual scope
1011         where the method is hosted is computed with the ComputeMethodHost
1012         before we create the method.
1013
1014         Moved the Deepest routine here.
1015
1016         (AnonymousContainer.ComputeMethodHost): New routine used to
1017         compute the proper ScopeInfo that will host the anonymous method.
1018
1019         (ScopeInfo): Deal with multiple roots.  The problem was that we
1020         did not have a unique root where all ScopeInfos could be hanged
1021         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1022         of roots.  
1023
1024         Remove AdjustMethodScope which is now computed at the end.  Remove
1025         LinkScope which did a partial link, instead link all ScopeInfos
1026         before code generation from the new "LinkScopes" routine. 
1027
1028         Simplify all the Add* routines as they no longer need to maintain
1029         the tree, they just need to record that they are using variables
1030         from a ScopeInfo.
1031
1032         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1033         routines to produce the forest of ScopeInfo trees.
1034
1035         * class.cs (TypeContainer.AppendMethod): This is just like
1036         AddMethod, but ensures that an interface implementation method
1037         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1038         methods, but at the end.
1039
1040         We use this functionality to ensure that the generated MoveNext
1041         method in the iterator class is resolved/emitted before the
1042         enumerator methods created.   
1043
1044         This is required because the MoveNext method computes the right
1045         ScopeInfo for the method.  And the other methods will eventually
1046         need to resolve and fetch information computed from the anonymous
1047         method. 
1048
1049         
1050 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1051
1052         Improve implementation of section 14.4.2.2 (Better function member).
1053         * expression.cs (Invocation.MoreSpecific): Compare all type
1054         arguments before deciding if one type is more specific than
1055         another.  Handle array types too.  Return the more specific type.
1056         (Invocation.BetterFunction): Add more tie-breaking rules from
1057         section 14.4.2.2.  Perform "more specific" check after
1058         other tie-breaking rules.  Compare all parameter types before
1059         choosing the "more specific" method.
1060
1061 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1062             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1063
1064         Fix rest of #76995.
1065         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1066         the 'aliases' hash.
1067         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1068         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1069
1070 2006-01-18  Martin Baulig  <martin@ximian.com>
1071
1072         * class.cs (TypeContainer.AddToMemberContainer): Use
1073         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1074         fixes #77124.
1075
1076 2006-01-18  Martin Baulig  <martin@ximian.com>
1077
1078         Fix #76417: a generic class may now have methods which may unify
1079         for some type parameter substitutions.
1080
1081         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1082         for methods which may unify anymore.
1083
1084         * expression.cs (Invocation.MoreSpecific): New private static
1085         method; checks whether one method is more specific than another
1086         according to 14.4.2.2 of the spec.
1087         (Invocation.BetterFunction): Implement the tie-breaking rules from
1088         14.4.2.2 of the spec: if two methods unify for some type parameter
1089         substitution, we need to pick the more specific one.
1090
1091 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1092
1093         Fix #76656, cs0231-2.cs.
1094         * cs-parser.jay (formal_parameter_list): Make error case catch
1095         more issues.
1096         (parenthesized_expression_0): Add CS1026 check.
1097         (invocation_expression): Remove unused { $$ = lexer.Location }.
1098
1099 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1100
1101         Fix #76824.
1102         * cs-parser.jay (statement_expression): Don't list out the
1103         individual statement-expressions.  Convert syntax error into
1104         CS0201 check.
1105
1106 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1107
1108         Fix #76874.
1109         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1110         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1111         CheckIntermediateModification.
1112         (FieldExpr.DoResolve): Add new two-argument version that
1113         allows us to resolve the InstanceExpression as an lvalue.
1114         The one-argument variant is now just a wrapper.
1115         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1116         Resolve the lhs as an lvalue if the it has a value type.
1117         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1118         from Assign.DoResolve.
1119         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1120         resolved as an lvalue.
1121         (PropertyExpr.DoResolve): Update.
1122         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1123         has a value type.  Move CS1612 check here from
1124         CheckIntermediateModification.
1125         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1126         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1127         'right_side' of a ResolveLValue on an 'out' argument.
1128         (EmptyExpression.LValueMemberAccess): New.  Used as the
1129         'right_side' of a propagated ResolveLValue on a value type.
1130         (LocalVariableReference.DoResolveBase): Recognize
1131         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1132         Add CS1654 check.
1133         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1134         EmptyExpression.Null.
1135
1136 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1137
1138         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1139           Type.IsGenericParameter(). Fixed bug #77183.
1140         * doc.cs : it is now identical to doc.cs in mcs.
1141
1142 2006-01-16  Martin Baulig  <martin@ximian.com>
1143
1144         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1145
1146 2006-01-16  Martin Baulig  <martin@ximian.com>
1147
1148         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1149         ctors; fixes #77250.
1150
1151 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1152
1153         This fixes the problem where we used ldfld instead of ldflda to
1154         load the "THIS" pointer on captured parameters, when THIS is a
1155         value type.  See bug #77205.
1156         
1157         * iterators.cs (CapturedThisReference.Emit): Pass false to
1158         EmitThis (we do not need the address).
1159
1160         * codegen.cs (EmitThis): it needs to know whether we need the
1161         address of `this' or not.  This is used by value types.  
1162
1163         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1164         every other call passes false.
1165
1166 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1167
1168         Fix #77221.
1169         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1170         GetOverride.
1171         * expression.cs (Invocation.OverloadResolve): Update.
1172         (Invocation.DoResolve): Avoid double resolution of invocation.
1173
1174 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1175
1176         Fix #77180.
1177         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1178         unary negation of floating point types as 0-expr; negation cannot
1179         overflow in floating point types.
1180
1181         Fix #77204.
1182         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1183         on operands of 'void' type.
1184
1185         Fix #77200.
1186         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1187         and ExclusiveOr for boolean constants too.
1188
1189 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1190
1191         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1192
1193 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1194
1195         * cs-tokenizer.cs (Position): New class used to save and restore
1196         the position state in the tokenizer.  Before this patch the save
1197         and restore was not complete enough so the line and columns would
1198         start to drift and the debugger and stack traces will get the
1199         wrong data.
1200
1201 2006-01-10  Martin Baulig  <martin@ximian.com>
1202
1203         * generic.cs
1204         (TypeParameter.InflateConstraints): New public method.
1205
1206         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1207         constraints; fixes #77042.
1208
1209 2006-01-10  Martin Baulig  <martin@ximian.com>
1210
1211         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1212         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1213         #77061. 
1214
1215 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1216
1217         Fix #75636.
1218         * expression.cs (Invocation.OverloadResolve): Replace reflected
1219         override methods with their base virtual methods, rather than
1220         skipping over them.
1221         * typemanager.cs (TypeManager.GetOverride): New.
1222
1223 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1224
1225         * driver.cs: Report the case of no source files and no -out:
1226         argument provided.
1227
1228 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1229
1230         Fix #77035.
1231         * expression.cs (ComposedCast.GetSignatureForError): Define.
1232
1233 2006-01-05  Jb Evain  <jbevain@gmail.com>
1234
1235         * class.cs (Property.Define, Indexer.Define): do not tag the
1236         properties as SpecialName | RTSpecialName.
1237
1238 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1239
1240         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1241         doing a low-level comparission of parameter types.  It was lacking
1242         a check for __argslist. 
1243
1244 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1245
1246         * expression.cs (ParameterReference.DoResolveBase): Allow
1247         reference parameters if they are local to this block. 
1248
1249         This allows the ref and out parameters of a delegate to be used in
1250         an anonymous method, for example:
1251
1252         delegate void set (out int x);
1253
1254         set s = delegate (out int x){
1255                 x = 0;
1256         };
1257
1258         This is used by functionality introduced late in the C# language.
1259         
1260         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1261         method that take ref and out parameters. 
1262
1263         Fixes #77119 which was a late change in the spec.
1264
1265 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1266
1267         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1268         parent if its the same scope.  Fixes #77060.
1269
1270 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
1271
1272         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
1273
1274 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1275
1276         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
1277         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
1278         that doesn't contain the full public key. This is a update of the
1279         friend assemblies in .Net 2.0 release.
1280         
1281 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1282
1283         Fix #76995
1284
1285         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1286         ListDictionary, to contain the ExternAliasEntry entries (in
1287         addition to the NamespaceEntry.aliases hashtable). This field is
1288         shared between the original entry and its doppelganger (bodyless 
1289         copy of it).
1290         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1291         extern_aliases field.
1292         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1293         lookup in extern_aliases.
1294
1295 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1296
1297         Fix #77006.
1298         * class.cs (TypeContainer.Mark_HasEquals): New.
1299         (TypeContainer.Mark_HasGetHashCode): New.
1300         (ClassPart): Override them.
1301         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1302
1303         * generic.cs (GenericMethod.DefineMembers): Update to changes.
1304         (TypeParameter.TypeParameter): Change type of 'parent' argument to
1305         DeclSpace.
1306
1307         Fix #77008.
1308         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1309         'parent' argument to the base constructor.
1310
1311         Remove all mention of TypeContainer from decl.cs.
1312         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1313         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1314         (DeclSpace.DeclSpace): Likewise.
1315         (DeclSpace.DefineMembers): Remove unused argument.
1316         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1317         debugging check -- we don't care if the debug code throws an
1318         InvalidCastException instead of an InternalErrorException.
1319         * class.cs (TypeContainer.DefineMembers): Update to changes.
1320         (TypeContainer.DoDefineMembers): Likewise.
1321         (TypeContainer.GetMethods): Likewise.
1322         (PropertyMember.Define): Likewise.
1323         (MemberBase.Parent): New property that forwards to
1324         MemberCore.Parent, but ensures that we get a TypeContainer.
1325         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1326         (RootContext.PopulateTypes): Likewise.  Remove special case code
1327         for !RootContext.StdLib: DefineMembers is idempotent.
1328
1329 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1330
1331         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1332
1333 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1334
1335         * doc.cs : The search for referenced namespace was insufficient to
1336           get global one as it used to do. Fixed bug #76965.
1337
1338 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1339
1340         * doc.cs : check name in cref in the last phase that whether it is
1341           namespace or not.
1342
1343 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1344
1345         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1346           Mono.C5.
1347
1348 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1349
1350         * doc.cs : so it turned out that we cannot skip override check for 
1351           interface members. Fixed bug #76954.
1352
1353 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1354
1355         * cs-tokenizer.cs : fixed bug #75984:
1356           - #warning and #error should not be handled when the source line
1357             is disabled.
1358           - #line is not checked strictly when the source line is disabled.
1359           - #define and #undef is on the other hand checked strictly at any
1360             state.
1361
1362 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1363
1364         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1365           CS1027 report.
1366
1367 2005-12-15  Raja R Harinath  <rharinath@novell.com>
1368
1369         * generic.cs (TypeManager.IsGeneric): Remove unused method.
1370
1371         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
1372         nested types.
1373
1374 2005-12-14  Martin Baulig  <martin@ximian.com>
1375
1376         * typemanager.cs (TypeManager.GetFullName): Make this public;
1377         `Type.Fullname' now never returns null.
1378
1379         * class.cs (Method.Define): Use TypeManager.GetFullName() for
1380         explicit interface implementations; we're now using the same
1381         naming convention than csc does.
1382
1383 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1384
1385         * convert.cs (ExplicitConversionCore): Check the return value from
1386         ExplicitConversionCore which can return null on failure.  Fixes #76914
1387
1388 2005-12-09  Raja R Harinath  <rharinath@novell.com>
1389
1390         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
1391         instead of IsGenericInstance.
1392         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
1393         code that's now covered by the more general test.
1394         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
1395
1396         * generic.cs (DropGenericTypeArguments): New.  Captures the common
1397         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
1398         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
1399         * generic.cs, report.cs, typemanager.cs: Likewise.
1400
1401 2005-12-08  Martin Baulig  <martin@ximian.com>
1402
1403         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
1404
1405         * typemanager.cs (TypeManager.CSharpSignature): Include type
1406         arguments in the signature of a generic method.
1407
1408 2005-12-07  Martin Baulig  <martin@ximian.com>
1409
1410         Add support for custom attributes on type parameters.
1411
1412         * cs-parser.jay (type_arguments): Added `opt_attributes'.
1413
1414         * generic.cs (TypeParameterName): New public class; we use this
1415         instead of a `string' to store the name of a type parameter, so we
1416         can also have `Attributes'.
1417         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
1418         array instead of a `string[]' array.
1419         (TypeParameter.ctor): We now also take an `Attributes' argument.
1420         (TypeParameter.EmitAttributes): New public method; emit our
1421         `OptAttributes' here.
1422         (GenericMethod.EmitAttributes): New public method; emit the custom
1423         attributes on all our type parameters.
1424
1425         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
1426         our type parameters.
1427         (MethodData.Define): If we're a generic method, call
1428         EmitAttributes() on it.
1429
1430 2005-12-07  Martin Baulig  <martin@ximian.com>
1431
1432         * generic.cs
1433         (ConstraintChecker): New public abstract class; move the
1434         constraint checking here from `ConstructedType' and also do
1435         constraint checking for generic methods here.
1436
1437         * expression.cs (Invocation.OverloadResolve): Use
1438         ConstraintChecker.CheckConstraints() if we resolved to a generic
1439         method.  Fix #76806.
1440
1441 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1442
1443         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1444
1445         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1446         event initializers.
1447         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1448         (FieldBase.Initializer): Initializer is now optional.
1449         (EventField.Define): Only event field can have initializer.
1450
1451         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1452
1453         * const.cs (Const): Reuse initializer.
1454
1455         * cs-parser.jay: Updated after FieldBase changes.
1456         Added current_array_type to simplify array initializers.
1457
1458         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1459
1460         * expression.cs, iterators.cs: Updated.
1461
1462         * namespace.cs (NamespaceEntry): Made UsingFound private.
1463
1464 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1465
1466         * parameterCollection.cs: Obsolete, removed.
1467         * parser.cs: Obsolete, removed.
1468
1469 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1470
1471         Fix #76849.
1472         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1473
1474         * enum.cs (Enum.Define): Set obsolete context here.
1475
1476 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1477
1478         * doc.cs :
1479           - FindDocumentedMember() now expects 1) paramList as null
1480             when "we don't have to check the number of parameters" and
1481             2) Type.EmptyTypes when "there is no arguments".
1482           - Introduced FoundMember struct to hold the exact type which was
1483             used to find the documented member (the above change broke
1484             test-xml-044; it might be better just to use DeclaringType than
1485             what MS does, like this change does, but it depends on usage.)
1486
1487 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1488
1489         * doc.cs : documented member might be from DeclaringType for nested
1490           types. Fixed bug #76782.
1491
1492 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1493
1494         * anonymous.cs: Have the param code handle leaving copies on the
1495         stack etc. Allows anonymous params to take part in the assignment
1496         code (++, +=, etc). Fixes bug #76550
1497
1498         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1499         it down to the anon code.
1500
1501         * iterators.cs: Use dummy var here
1502
1503         * codegen.cs: Handle new vars
1504
1505 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1506
1507         Fix #76849.
1508         * class.cs (MethodData.Define): Set proper Obsolete context.
1509
1510         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1511         obsolete context.
1512         (FieldExpr.DoResolve): Ditto.
1513
1514 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1515
1516         Fix #76849.
1517         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1518         parent is not obsolete.
1519
1520 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1521
1522         * doc.cs : (FindDocumentedMember) find parameterless members first
1523           and get CS0419 in the early stage. Fixed first case of bug #76727.
1524
1525 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1526
1527         Fix #76859.
1528         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1529         no error was reported.
1530
1531         *expression.cs (Binary.DoResolve): left can be null.
1532
1533 2005-12-06  Raja R Harinath  <rharinath@novell.com>
1534
1535         * class.cs (MethodCore.CheckGenericOverride): Delete unused
1536         abstract method and all overrides.
1537         * support.cs (ParameterData.GenericConstraints): Delete.
1538         (ReflectionParameters.type_params): Delete.
1539         (ReflectionParameters.ReflectionParameters): Make private.
1540         (ReflectionParameters.GetConstaints): New factory method.
1541         * generic.cs (TypeParameterDefineType): Use it.
1542         (TypeManager.GetTypeParameterConstraints): Likewise.
1543
1544 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1545
1546         Fix #76783.
1547         * class.cs (MethodData.Emit): Parameters should be labeled first.
1548
1549 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1550
1551         Fix #76761.
1552         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1553
1554 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1555
1556         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1557
1558         * class.cs (MethodCore): Parameter clean up.
1559         (IMethodData): Added ParameterInfo.
1560         (MethodData): Parameter clean up.
1561         (Indexer.Define): Parameter clean up.
1562
1563         * anonymous.cs,
1564         * codegen.cs,
1565         * cs-parser.jay,
1566         * decl.cs,
1567         * doc.cs,
1568         * ecore.cs,
1569         * flowanalysis.cs,
1570         * iterators.cs,
1571         * pending.cs,
1572         * statement.cs,
1573         * typemanager.cs: Parameter clean up.
1574
1575         * delegate.cs (Define): Get rid of duplicated code.
1576
1577         * expression.cs (ParameterReference): Removed useless parameters
1578         and simplified.
1579         (Invocation): Ditto.
1580
1581         * parameter.cs (ParamsParameter): New class, params specialization.
1582         (ArglistParameter): Attemp to separate arglist.
1583         (Parameter): Refactored to be reusable and faster.
1584         (Parameter.Modifier): Made understandable.
1585         (Parameters): Changed to be used as a class for `this' assembly
1586         parameters. Refactored to use new specialized classes.
1587
1588         * support.cs (ParameterData): Added Types property.
1589         (InternalParameters): Deleted.
1590
1591 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1592
1593         * doc.cs : the previous patch does not actually fix the bug.
1594           PropertyInfo override check is now implemented and really fixed it.
1595         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1596
1597 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1598
1599         * doc.cs : apply "override filter" also to properties.
1600           Fixed bug #76730.
1601
1602 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1603
1604         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1605           no need to check overrides. For classes, omit those results from 
1606           interfaces since they must exist in the class. Fixed bug #76726.
1607
1608 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1609
1610         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1611           with different parameters. Fixed the second problem in #76685.
1612
1613 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1614
1615         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1616           get expected 'protected' access in CheckValidFamilyAccess()).
1617           Fixed bug #76692.
1618
1619 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1620
1621         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1622           Fixed bug #76705.  CS1569 was incorrectly commented out.
1623
1624 2005-11-23  Martin Baulig  <martin@ximian.com>
1625
1626         * generic.cs (Constraints.Define): Removed.
1627         (TypeParameter.DefineConstraints): Removed.
1628         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
1629         on the GenericTypeParameterBuilder here.
1630
1631 2005-11-23  Martin Baulig  <martin@ximian.com>
1632
1633         * typemanager.cs (TypeManager.GetProperty): Make this public.
1634
1635         * generic.cs (Nullable.NullableInfo.ctor): Use
1636         TypeManager.GetProperty() rather than using reflection directly.
1637
1638 2005-11-17  Martin Baulig  <martin@ximian.com>
1639
1640         * expression.cs (Indexers.GetIndexersForType): Added support for
1641         generic parameters; fixes #76587.
1642
1643 2005-11-17  Martin Baulig  <martin@ximian.com>
1644
1645         * anonymous.cs
1646         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1647         inherit the scope from our parent.  Fixes #76653.
1648
1649 2005-11-15  Martin Baulig  <martin@ximian.com>
1650
1651         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
1652         instead of `ScopeTypeBuilder' to refer to the "current" type.
1653         (AnonymousMethod.CreateScopeType): Correctly create the helper
1654         class if we're inside a generic type definition.
1655
1656 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1657
1658         * doc.cs : use Invocation.IsOverride() to do real override check.
1659         * expression.cs : made Invocation.IsOverride() internal.
1660
1661 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1662
1663         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1664           TypeBuilder.FindMembers() and filter overriden base members out.
1665           Fixed bug #76990.
1666
1667 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1668
1669         * doc.cs : ref/out parameters are represented as '@' (instead of
1670           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1671
1672 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1673
1674         * doc.cs : when there was no '.' in cref to methods in doc comment,
1675           then parameters were missing in the output. Fixed bug #76691.
1676
1677 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1678
1679         * driver.cs : don't output docs when there is an error.
1680           Fixed bug #76693.
1681
1682 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1683
1684         * doc.cs :
1685           Now it should detect indexers. Fixed primary concern in bug #76685.
1686           Fixed CS0419 message to not show the identical member signature in
1687           the message.
1688
1689 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1690
1691         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1692           instead of Type.FindMembers() since it does not handle events.
1693           Fixed bug #71604.
1694
1695 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1696
1697         * codegen.cs: Fixed typo (speficied -> specified).
1698
1699 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1700
1701         Fix #76369.
1702         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1703
1704 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1705
1706         * attribute.cs: Changed error message.
1707
1708         * cs-tokenizer.cs: One more check.
1709
1710 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1711
1712         * statement.cs (Block.Resolve): Ignore empty statement.
1713
1714 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1715
1716         * report.cs: Made error/warning methods more strict to avoid
1717         their misuse.
1718
1719         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1720         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1721         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1722         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1723
1724 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1725
1726         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
1727         Use the more explicit AssemblyName.FullName instead of 
1728         AssemblyName.Name to report errors.
1729         
1730 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1731
1732         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
1733         with mcs.
1734
1735 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1736
1737         * class.cs,
1738         * convert.cs,
1739         * cs-parser.jay,
1740         * decl.cs,
1741         * enum.cs,
1742         * expression.cs,
1743         * generic.cs,
1744         * pending.cs,
1745         * report.cs: Fixed error reporting and typos.
1746
1747         * generic.cs (TypeParameter.GetSignatureForError): New method.
1748         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
1749
1750         * typemanager.cs (GetFullName): Refactored.
1751
1752 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1753
1754         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1755         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1756
1757         * class.cs (TypeContainer.IsComImport): New property.
1758         (Constructor.Define): Create proper ctor for ComImport types.
1759
1760         * expression.cs (New.CheckComImport): Fixed.
1761
1762 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1763
1764         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1765         that a parameter has been captured does not mean that we do not
1766         have to do the rest of the processing.  This fixes the second part
1767         of #76592.  If there was another anonymous method capturing
1768         values in the past, the Scope would never be set for the second
1769         method that captured the same parameter.
1770
1771         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1772         properly manipulate the stack.   Second part of fix for #76592.
1773
1774         * expression.cs (New): Add support for invoking "new" on
1775         interfaces that have been flagged with the ComImport attribute and
1776         the CoClass.  Fixes #76637 
1777
1778         * statement.cs (Try.DoEmit): When a variable is captured, do not
1779         try to emit the vi.LocalBuilder variable as it has been captured.
1780         Create a temporary variable and store the results on the
1781         FieldBuilder.  Fixes #76642
1782
1783 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1784
1785         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1786
1787         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1788
1789         * expression.cs (Binary.DoResolve): Added && optimalization.
1790     
1791         * typemanager.cs (AddUserType): Removed useless argument.
1792
1793 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1794
1795         * statement.cs (Block.variables): Uses ListDictionary.
1796
1797 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1798
1799         Fix #75969.
1800         * class.cs (PartialContainer.EmitType): Customized to emit
1801         security attributes.
1802         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1803         for partial classes.
1804
1805 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1806
1807         Fix #76599.
1808         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1809         access has to be fixed.
1810         
1811         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1812
1813 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1814
1815         Fix #76590.
1816         * ecore.cs (NullCast.Reduce): Implemented.
1817
1818         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1819         constant type.
1820         
1821         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1822         properly.
1823         (Foreach.Resolve): Catch null properly.
1824
1825 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1826  
1827         * cs-tokenizer.cs: Warning text fix.
1828
1829         * driver.cs: AllWarningNumbers exposed on public interface.
1830
1831         * report.cs (): Reviewed warning numbers.
1832         (IsValidWarning): Use binary search.
1833
1834 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1835  
1836         * driver.cs: Implemeted resource visibility.
1837         (Resources): New class for code sharing between /res: and
1838         /linkres:
1839  
1840 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1841
1842         decl.cs (CurrentTypeParameters): Fixed to be public.
1843
1844 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1845
1846         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
1847
1848 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1849
1850         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
1851
1852 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
1853
1854         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
1855
1856 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1857
1858         Add friend assembly access support.
1859         * typemanager.cs: assembly_internals_vis_attrs
1860         cache for friend assembly access. 
1861         (TypeManager.IsFriendAssembly): New method for
1862         checking friend assembly access.
1863         (TypeManager.Error_FriendAccessNameNotMatching): New
1864         helper method.
1865         (TypeManager.CompareKeyTokens): Likewise.
1866         (TypeManager.Filter): Handle friend accessible
1867         members.
1868
1869         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
1870         friend accessible types.
1871
1872         * ecore.cs (Expression.IsAccessorAccessible): Handle
1873         friend accessible properties.
1874
1875         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
1876         accessible types.
1877         
1878 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1879
1880         Fix #76568.
1881         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1882         folding.
1883         
1884         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1885         contants only.
1886         
1887         * ecore.cs (NullCast): Child is contant only.
1888         
1889         * literal.cs (NullLiteral.Reduce): null can be converted to any
1890         reference type.
1891
1892 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1893
1894         * driver.cs: Use Encoding.Default as default code page instead
1895           of ISO-28591.
1896
1897 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1898
1899         Fix #76085.
1900         * expression.cs (Invocation.Error_InvalidArguments): Handle
1901         __arglist parameters.
1902         (Invocation.VerifyArgumentsCompat): Likewise.
1903         * support.cs (ReflectionParameters.GetSignatureForError): Print
1904         __arglist parameters.
1905         (InternalParamters.GetSignatureForError): Likewise.
1906         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1907
1908 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1909
1910         * attribute.cs (GetPropertyValue): Made public.
1911
1912         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1913         Resolve.
1914         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1915         attribute.
1916         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1917         is not defined.
1918         
1919         * driver.cs: Reflect method name change.
1920         
1921         * statement.cs (Try.Resolve): Warn when try has both general
1922         exception handlers.
1923         
1924         * typemanager.cs: runtime_compatibility_attr_type new predefined
1925         type.
1926
1927 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1928
1929         Fix #76419.
1930         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1931         treat it as an empty parameter list.
1932
1933 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1934
1935         Fix #76271.     
1936         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1937         ResolveAsTypeStep silent.
1938         * statement.cs (Block.AddConstant): Mark block as used.
1939         (Block.ResolveMeta): Avoid piling on error messages
1940         if a constant initializer resolution fails.
1941
1942 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1943
1944         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1945         Remove.
1946         (NamespaceEntry.VerifyAllUsing): New.
1947         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1948         behaviour.  Delegates actual resolution of alias to ...
1949         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1950         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1951         Update.
1952         * driver.cs (Driver.MainDriver): Update.
1953         
1954         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1955         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1956         property.
1957         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1958         Remove.
1959         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1960         RootNamespace.DefineNamespacesForAll.
1961
1962 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1963
1964         * typemanager.cs (assemblies, external_aliases, modules)
1965         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1966         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1967         overhead.  Move resposibility ...
1968         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1969         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1970
1971 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1972
1973         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1974         cached_namespaces.  Improve usage.
1975         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1976         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1977         Move from GlobalRootNamespace and simplify.
1978         (RootNamespace.Global): Make instance variable.
1979         (RootNamespace.RootNamespace): Add "alias name" parameter.
1980         (GlobalRootNamespace): Simplify drastically.
1981         (Namespace.Lookup): Don't use GetNamespace.
1982         * typemanager.cs (GetRootNamespace): Rename from
1983         ComputeNamespaceForAlias.
1984         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1985
1986 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1987
1988         * anonymous.cs (AnonymousContainer): Don't crash when container
1989         doesn't exist.
1990
1991 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1992
1993         * expression.cs (Binary.DoResolve): Warn when comparing same
1994         values.
1995
1996 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1997
1998         Fix #76486.
1999         * expression.cs (Binary.DoResolve): It looks like there are no
2000         convetsion rules in enum context.
2001
2002 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2003
2004         Add support for extern alias qualifiers.
2005         * typemanager.cs: Move some LookupTypeReflection code
2006         to namespace.cs, to have cleaner code. Added some methods
2007         to help us keep track of the extern aliased references.
2008         * driver.cs: Add suport for extern alias assemblies on command
2009         line and check for their warnings/errors. Also keep track of the
2010         extern aliased assemblies.
2011         * namespace.cs: Move the global functionality of Namespace
2012         to GlobalRootNamespace/RootNamespace. Now the global namespace
2013         is GlobalRootNamespace.Globa. Also the code moved from 
2014         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2015         Finally added LocalAliasEntry (AliasEntry before) and
2016         ExternAliasEntry, to handle alias statements.
2017         * cs-parser.jay: Add support in the grammar for extern alias
2018         statement.
2019         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2020         Update callings to Namespace (now in GlobalRootNamespace).
2021
2022 2005-10-25  Martin Baulig  <martin@ximian.com>
2023
2024         * convert.cs (ImplicitTypeParameterConversion): Make base
2025         interfaces actually work; fixes #76557.
2026
2027 2005-10-25  Martin Baulig  <martin@ximian.com>
2028
2029         * generic.cs
2030         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2031         all the type parameters; fixes #76551.
2032
2033 2005-10-25  Martin Baulig  <martin@ximian.com>
2034
2035         Fix #76472.
2036
2037         * generic.cs
2038         (GenericMethod.ctor): Added `Expression return_type' and
2039         `Parameters parameters' arguments.
2040         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2041         parameter and return types to check their constraints if they're
2042         generic types.
2043
2044         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2045         boolean field.
2046
2047         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2048         constraints of a generic type if `ec.ResolvingGenericMethod'.
2049
2050         * class.cs (MethodCore.DoDefineParameters): Set
2051         `ec.ResolvingGenericMethod' if we're a generic method.
2052         (MemberBase.MemberType): Likewise.
2053
2054 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2055
2056         * typemanager.cs (TypeManager): Added 
2057         TypeManager.internals_visible_attr_type to cache
2058         S.R.CompilerServices.InternalsVisibleToAttribute.
2059
2060         * codegen.cs (AssemblyClass): Added checks for 
2061         InternalsVisibleToAttribute in new method 
2062         CheckInternalsVisibleAttribute () and also cache the
2063         AssemblyName in AssemblyClass.Name.
2064         
2065 2005-10-24  Martin Baulig  <martin@ximian.com>
2066
2067         * typemanager.cs
2068         (TypeManager.ExpandInterfaces): Added overloaded version which
2069         just takes a `Type[]' array.
2070
2071         * generic.cs
2072         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2073         just use the interfaces which were explicitly specified and not
2074         the interfaces they inherit.  Fixes #76482.
2075         (TypeParameter.FindMembers): Expand the interfaces here.
2076
2077 2005-10-21  Martin Baulig  <martin@ximian.com>
2078
2079         * generic.cs
2080         (Constraints.Resolve): Also resolve the actual types here.
2081         (Constraints.ResolveTypes): Just check the constraints here.
2082         Fixes #76363; see gtest-218.cs.
2083
2084 2005-10-21  Martin Baulig  <martin@ximian.com>
2085
2086         * convert.cs
2087         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2088         instead of a `BoxedCast'; fixes gtest-217.cs.
2089
2090 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2091
2092         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2093           1) "new()" is specified as generic parameter constraint and 2) the
2094           type is TypeBuilder and 3) the type is abstract even if it has a
2095           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2096
2097 2005-10-20  Martin Baulig  <martin@ximian.com>
2098
2099         * generic.cs
2100         (GenericConstraints.TypeParameter): New public property.
2101         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2102         (TypeParameter.DeclSpace): New public property.
2103         (TypeParameter.DefineType): Inflate the constraints if our
2104         `DeclSpace' is an `Iterator'.   
2105
2106 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2107
2108         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2109           GenericMethod argument to compare methods' generic type arguments.
2110           Fixed bug #76382.
2111
2112 2005-10-19  Martin Baulig  <martin@ximian.com>
2113
2114         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2115         not ResolveType() when resolving the base type, so we're not
2116         checking the constraints here.
2117         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2118         if we have any.
2119
2120 2005-10-19  Martin Baulig  <martin@ximian.com>
2121
2122         * generic.cs (ConstructedType.CheckConstraints): Committing
2123         untested fix for #76441.
2124
2125 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2126
2127         Fix #76371.
2128         * class.cs (TypeContainer.DefineType): Move updating of
2129         topological sort earlier in the code.
2130         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2131
2132 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2133
2134         Fix #76273.
2135         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2136         
2137         * constant.cs (Constant.TryReduce): Moved from Cast class.
2138         (Reduce): Made little bit more OO and fixed missing conversions.
2139         
2140         * ecore.cs (Reduce): Implemented.
2141         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2142         
2143         * literal.cs (Reduce): Implemented.
2144         
2145         * class.cs: Reverted Miguel's wrong commit.
2146
2147 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2148
2149         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2150
2151 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2152
2153         * cs-parser.jay, expression.cs : CS0214 was missing error location
2154           for constants. Fixed bug #76404.
2155
2156 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2157
2158         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2159         InstanceExpression.
2160         (PropertyExpr.EmitCall): Likewise.
2161         * expression.cs (Invocation.EmitArguments): Handle case where
2162         arguments == null.
2163         (Invocation.EmitCall): Avoid allocating temporary variable if
2164         there are no arguments.
2165
2166 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2167
2168         Fix #76370.
2169         * convert.cs (ExplicitConversionCore): Fixed object->enum
2170         conversion.
2171
2172 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2173
2174         Fix #76323.
2175         * convert.cs (ImplicitConversionStandard): Move conversion of
2176         void* to arbitrary pointer types ...
2177         (ExplicitConversionStandard): .. here.
2178         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2179         error to always print typenames.
2180
2181 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2182
2183         * convert.cs (GetConversionOperator): Rename from
2184         GetConversionOperators.  Move operator selection code from ...
2185         (UserDefinedConversion): ... here.
2186
2187 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2188
2189         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2190         conversion.
2191
2192 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2193
2194         * assign.cs (Assign.DoResolve): Error method changed.
2195
2196         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2197         
2198         * const.cs (ResolveValue): Reset in_transit immediately.
2199         
2200         * constant.cs: Error method changed.
2201         
2202         * convert.cs: Removed useless location parameter.
2203         (ExplicitNumericConversion): Don't do double enum check.
2204         (ExplicitConversionCore): Renamed from ExplicitConversion.
2205         (ExplicitUnsafe): Extracted from ExplicitConversion.
2206         (ExplicitConversion): Uses for error reporting.
2207         
2208         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2209         error messages.
2210         (ResolveBoolean): Uses common error method.
2211         (CastToDecimal): Get rid of ec.
2212         (CastFromDecimal): Optimized.
2213         (ConvCast): Get rid of ec.
2214         
2215         * enum.cs (ResolveValue): Reset in_transit immediately.
2216         (Emit): Return after first error.
2217         
2218         * expression.cs: Convert changes.
2219         
2220         * literal.cs: Error method changed.
2221         
2222         * statement.cs: Error method changed.
2223
2224 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2225
2226         Fix gtest-131.cs and gtest-211.cs.
2227         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2228         Only emit code for a label if it is used.  Unreachable code can
2229         violate ECMA evaluation stack invariants.
2230
2231 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2232
2233         * anonymous.cs: Implemented ExprClassName.
2234         
2235         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2236         delegate.
2237         
2238         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2239         check.
2240         
2241         * class.cs (StaticClass.DefineContainerMembers): Report protected
2242         members as error.
2243         
2244         * codegen.cs: if(ed) PRODUCTION.
2245         
2246         * convert.cs (Error_CannotImplicitConversion): Better error
2247         distinction.
2248         
2249         * cs-parser.jay: More error checks.
2250         
2251         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2252         
2253         * driver.cs (CSCParseOption): Enabled wrong option check.
2254         
2255         * ecore.cs (Expression.ExprClassName): Turned to property.
2256         (MemberExpr.CheckIntermediateModification): For checking boxed
2257         value types     modification.
2258         
2259         * statement.cs (Fixed.Resolve): Expression type must be
2260         convertible to fixed type.
2261         (CollectionForeach.GetEnumeratorFilter,TryType):
2262         Small refactoring for easier error checking.
2263
2264 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2265
2266         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2267         attributes.
2268         
2269         * class.cs (GeneratedBaseInitializer): New class for customization
2270         compiler generated initializers.
2271         (MemberBase.DoDefine): Check Obsolete attribute here.
2272         (FieldMember.DoDefine): Ditto.
2273         
2274         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2275         constants.
2276         
2277         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2278         (MemberCore.GetObsoleteAttribute): Removed argument.
2279         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2280         (MemberCore.CheckObsoleteType): New helper.
2281         
2282         * delegate.cs,
2283         * enum.cs,
2284         * statement.cs: Updates after MemberCore changes.
2285         
2286         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2287         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2288         
2289         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2290         obsolete attribute for compiler construct.
2291         (As.DoResolve): Cache result.
2292         
2293         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2294
2295 2005-10-01  Miguel de Icaza  <miguel@novell.com>
2296
2297         * expression.cs (Probe): instead of having a "Type probe_type"
2298         keep the extra information as a TypeExpr probe_type_expr since the
2299         "As" operator needs to perform some type checks.
2300
2301         * (As.DoResolve): If the type is a type parameter, ensure that it
2302         is constrained by a class.
2303
2304 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2305
2306         * statement.cs (Lock): Use the TemporaryVariable class instead of
2307         manually using local variables as those do not work when variables
2308         are captured.
2309
2310         * ecore.cs: Moved the TemporaryVariable class from being a nested
2311         class inside Foreach to be a public class that can be employed in
2312         other places. 
2313
2314 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2315
2316         * cs-parser.jay: interface_accessors replaced by
2317         accessor_declarations.
2318
2319         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2320         location.
2321         
2322         * statement.cs (GotoCase.Resolve): Convert null constant to
2323         null case.
2324         (SwitchLabel.ResolveAndReduce): Ditto.
2325         (SwitchLabel.NullStringCase): Custom null stamp.
2326         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2327         
2328         typemanager.cs (CSharpSignature): Don't skip first argument
2329         for full names.
2330
2331 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2332
2333         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2334         expression.cs, iterators.cs, literal.cs: Store constants and
2335         literals location.
2336         
2337         * class.cs (MemberBase.ShortName): Pass location.
2338         
2339         * cs-parser.jay: Some location fixes.
2340         
2341         * ecore.cs (Expression.Location): Made virtual.
2342
2343 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2344
2345         Fix #72930.
2346         * const.cs (Const.ResolveValue): Check for assigning non-null
2347         value to reference type.
2348
2349 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2350
2351         Fix #76133.
2352         * expression.cs (This.VerifyFixed): In a value type T, the type of
2353         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2354         value type R, 'this' is treated as a value parameter.
2355
2356 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2357
2358         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2359         if the underlying types are the same, otherwise we need to produce
2360         code that will do the proper cast.
2361
2362         This was exposed by Marek's constant rewrite which produced
2363         invalid code for the call site:
2364
2365         enum X : long { a }
2366         void Method (X v) {}
2367
2368         Method ((X) 5)
2369
2370         This fixes test-49.cs
2371
2372 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2373
2374         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2375           Type/Object should be allowed as well. Fixed bug #75968.
2376
2377 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2378
2379         * expression.cs : (Binary.DoResolve): when one is enum constant and
2380           another is constant 0, then return enum one *as enum type*.
2381           Fixed bug 74846.
2382
2383 2005-10-04  Martin Baulig  <martin@ximian.com>
2384
2385         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
2386         `SetMemberIsUsed()' work for generics, too.
2387
2388 2005-10-04  Martin Baulig  <martin@ximian.com>
2389
2390         * expression.cs (DelegateInvocation.EmitStatement): Make this work
2391         for corlib.  Fixes #75691.
2392
2393 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2394
2395         Fix #76255.
2396         * driver.cs: Fix compilation files with full root path.
2397
2398 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2399
2400         * report.cs (SymbolRelatedToPreviousError): Format the output so
2401         it does not use an open parenthesis that is never closed. 
2402
2403         * driver.cs: Follow coding guidelines
2404
2405 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2406
2407         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2408
2409         * location.cs (InEmacs): in this mode, do not report column
2410         location as it confuses Emacs.
2411
2412 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2413
2414         * support.cs (SeekableStreamReader.Position): Don't error out when
2415         the requested position is just beyond the end of the current
2416         buffered data.
2417
2418 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2419
2420         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2421         try to keep in sync with the byte count of the underlying Stream.
2422         However, this limits us to a window size of 2048 characters: i.e.,
2423         the maximum lookahead of our lexer/parser can be 2048 characters.
2424
2425 2005-09-22  Martin Baulig  <martin@ximian.com>
2426
2427         * driver.cs: Removed a debugging FIXME.
2428
2429 2005-09-21  Raja R Harinath  <rharinath@novell.com>
2430
2431         * cs-parser.jay (type_arguments): Add CS1644 check.
2432         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
2433
2434 2005-09-15  Raja R Harinath  <rharinath@novell.com>
2435
2436         * Makefile (PROGRAM): Make profile specific.
2437         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
2438         the current directory.
2439
2440         Fix test-455.cs.
2441         * expression.cs (Invocation.EmitCall): Remove optimization on
2442         this_call since it doesn't handle 'this' being a value type.
2443
2444 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
2445
2446         * driver.cs: Ensure file handles are closed after parsing
2447
2448 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2449
2450         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2451         if the underlying types are the same, otherwise we need to produce
2452         code that will do the proper cast.
2453
2454         This was exposed by Marek's constant rewrite which produced
2455         invalid code for the call site:
2456
2457         enum X : long { a }
2458         void Method (X v) {}
2459
2460         Method ((X) 5)
2461
2462         This fixes test-49.cs
2463
2464 2005-09-05  Martin Baulig  <martin@ximian.com>
2465
2466         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
2467         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
2468
2469         * cs-parser.jay (delegate_declaration): Small fix for #75852.
2470
2471 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2472
2473         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
2474           to be a pointer type due to the spec 25.2, so check if declaring
2475           type is generic type definition. Fixed bug #75772.
2476
2477 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2478
2479         Fixed bug #75957.
2480         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
2481           both types are not defined by methods.
2482         * expression.cs : (Invocation.IsApplicable): it should work when
2483           the argument type is equal to the parameter type, not only when
2484           ImplicitConversionExists() returns true.
2485
2486 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2487
2488         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2489         internal.
2490
2491         Fix #75941.
2492         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2493         flow-branching for LocalVariableReferences in case we were invoked
2494         from a MemberAccess.
2495         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2496         Carved out of ...
2497         (LocalVariableReference.DoResolveBase): ... this.
2498         (MemberAccess.Resolve): Do the check that was disabled during
2499         SimpleNameResolve.
2500
2501 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2502
2503         * class.cs :
2504           (PartialContainer.Create): check abstract/sealed/static strictly
2505           but abstract/sealed can exist only at one side. Fixed bug #75883.
2506
2507 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2508
2509         Fix #75945.
2510         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2511         specified, don't default to UnmanagedType.I4.
2512
2513 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2514
2515         * expression.cs : conditional operator should check possibly
2516           incorrect assign expression. Fixed bug #75946.
2517
2518 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2519
2520         Fix #75934.
2521         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2522         (ScopeInfo.EmitScopeType): Use it to construct field names from
2523         names of captured locals.
2524
2525         Fix #75929.
2526         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2527         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2528         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2529         (ExplicitConversion): Remove enum cases already handled by
2530         implicit conversion.  Move implicit conversion check to the beginning.
2531         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2532         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2533         Don't treat System.Enum as a struct.
2534
2535 2005-08-30  Jb Evain  <jbevain@gmail.com>
2536
2537         * attribute.cs: handles as expression in parameters.
2538
2539 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2540
2541         Fix #75802.
2542         * class.cs (TypeContainer.VerifyClsName): Don't use a
2543         PartialContainer when verifying CLS compliance.
2544         (AbstractPropertyEventMethod): Set Parent here, ...
2545         (PropertyMethod): ... not here.
2546
2547 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2548
2549         * attribute.cs : escaped attribute name should not be allowed to be
2550           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2551
2552 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2553
2554         Fix #75927.
2555         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2556         when converting a long constant to unsigned long.
2557         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2558         detect where IsApplicable and VerifyArgumentsCompat disagree.
2559
2560 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2561         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2562
2563         Fix #75848.
2564         * class.cs (TypeContainer.CanElideInitializer): New helper.
2565         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2566         can safely emitting the initializer of a field.
2567
2568 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2569
2570         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2571           allowed inside a switch (without loop). Fixed bug #75433.
2572
2573 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2574
2575         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2576         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2577
2578 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2579
2580         * driver.cs : kinda reverting the default encoding changes (not exact 
2581           revert since I noticed that "codepage:reset" might not work fine).
2582
2583 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2584
2585         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2586           Location. Now getter and setter store location correctly.
2587           (errors/cs0111-12.cs now reports the expected location.)
2588
2589 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2590
2591         * driver.cs : Use default encoding on the environment.
2592           Removed (now that) extra parameter for SeekableStreamReader.
2593         * support.cs : (SeekableStreamReader) third .ctor() argument for
2594           StreamReader is not required (always true). preamble size could
2595           be acquired in simpler and safe way.
2596
2597 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2598
2599         * cs-parser.jay: report CS0642 at warning level 3
2600           and report CS0642 for an if else statement also
2601           fixes bug #74745. Patch by John Luke (and a bit
2602           modified by me).
2603           Removed extra CS0642 warning check for "while",
2604           "for" and "fixed".
2605         * statement.cs: In Block.Resolve(), CS0642 check
2606           is reimplemented to check a sequence of an empty
2607           statement and a block.
2608
2609           Both fix bug #66777.
2610
2611 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2612
2613         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2614         detection until I fix it.
2615         
2616         * cs-tokenizer.cs: Changed error message.
2617         
2618         * cs-parser.jay: Fixed 2 error locations.
2619         
2620         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2621         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2622         properties.
2623         
2624         * enum.cs (GetSignatureForError): Fixed.
2625         
2626         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2627         method detection.
2628         
2629         * class.cs,
2630         * typemanager.cs (RegisterProperty): Removed.
2631         
2632         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2633
2634 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2635
2636         Fix #75874.
2637         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2638         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2639
2640 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2641
2642         * expression.cs : tiny fix is required for not warning positive ulong.
2643           See test-441.cs.
2644
2645 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2646
2647         * expression.cs : add CS0652 check for constant and integral
2648           expression. Fixed bug #53974.
2649
2650 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2651
2652         * expression.cs : in DoNumericPromotions(), check if there is implicit
2653           conversion overload for string (to check CS0034). Fixed bug #52492.
2654
2655 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2656
2657         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2658
2659 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2660
2661         * ecore.cs : report location when it is *not* Null.
2662
2663 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2664
2665         * codegen.cs,
2666           ecore.cs,
2667           flowanalysis.cs,
2668           expression.cs:
2669           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2670           correctly. Fixed bug #75721.
2671
2672 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2673
2674         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2675         loop that performs 'min (pos, char_count)'.
2676
2677         Fix #75862.
2678         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2679         converted value in Operator.OnesComplement.
2680
2681 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2682
2683         * anonymous.cs: If the anon method is pulled into a helper class,
2684         it needs to be `internal' not `private'. Fixes runtime behavior on
2685         msft. bug #75704
2686
2687 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2688
2689         Fix #75803
2690         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2691         is a partial class.
2692
2693 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2694
2695         The big constants rewrite
2696         Fix #75746, #75685 and more
2697         As a side effect saved 1MB for MWF ;-)
2698         
2699         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2700         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2701         enum based for corlib compilation.
2702         
2703         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2704         subtractions.
2705         
2706         * class.cs (FixedField.Define): Use ResolveAsConstant.
2707         
2708         * const.cs (IConstant): Interface constants and enums.
2709         (Const.ResolveValue): New method for constant resolvning.
2710         (ExternalConstant): Constants from imported assemblies.
2711         
2712         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2713         conversion; like enums.
2714         (Constant.ToType): Converts this constant to different type.
2715         (Constant.Increment): Adds 1.
2716         
2717         * convert.cs (ImplicitConversionRequired): Simplified.
2718         
2719         * cs-parser.jay: Create EnumMember directly.
2720         
2721         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2722         
2723         * doc.cs (GenerateEnumDocComment): Removed.
2724         
2725         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2726         (ConvertIntLiteral): Removed.
2727         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2728         
2729         * enum.cs (EnumMember): Implement IConstant.
2730         (Enum.IsValidEnumConstant): Removed.
2731         (Enum.GetNextDefaultValue): Removed.
2732         (Enum.FindMembers): Updated.
2733         (Enum.GenerateDocComment): Iterate enum members.
2734         
2735         * expression.cs (Cast.TryReduce): Handle enums correctly.
2736         (New.Constantify): Made public.
2737         (MemberAccess.DoResolve): Removed contant specific if(s).
2738         
2739         * literal.cs (NullLiteral): Implement new abstract methods.
2740         
2741         * statement.cs (GotoCase.Resolve): Use new constant methods.
2742         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2743         
2744         * typemanager.cs (LookupEnum): Removed.
2745         (IsEnumType): Fixed to work with corlib.
2746         (RegisterConstant): Removed.
2747         (LookupConstant): Removed.
2748         (GetConstant): Changed to work with IConstant.
2749
2750 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2751
2752         * location.cs : Fixed overflown (>255) column number.
2753
2754 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2755
2756         First cut of the qualified-alias-member feature.
2757         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2758         token.
2759         * cs-parser.jay (DOUBLE_COLON): New token.
2760         (namespace_or_type_name): Add rule for recognizing
2761         qualified-alias-members.
2762         (primary_expression): Likewise.
2763         (element_access): Allow QualifiedAliasMember as a possible
2764         type-bearing expression.
2765         (local_variable_type, local_variable_pointer_type): Likewise.
2766         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2767         aliases in the current and enclosing namespace declarations.
2768         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2769         * decl.cs (MemberName.is_double_colon): New.
2770         (MemberName.MemberName): Add new constructor for alias-member.
2771         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2772         * expression.cs (QualifiedAliasMember): New expression type.
2773
2774 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2775
2776         * location.cs : it borked when no argument was specified.
2777
2778 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2779
2780         * location.cs : tiny ToString() format fix.
2781
2782 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2783
2784         * statement.cs : oops, it was missing.
2785
2786 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2787
2788         A set of fixes for precise line/column location.
2789
2790         * location.cs :
2791           "token" field now holds a file/line "delta", a line number offset 
2792           from the segment, and a column number. See also:
2793           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2794           December/009508.html
2795           Removed static IsNull. Use instance IsNull property instead.
2796         * cs-tokenizer.cs :
2797           For some tokens it stores Location. For Identifier it stores
2798           LocatedToken which is a pair of string name and location.
2799           Column numbers are adjusted only at getChar().
2800         * report.cs :
2801           Use Location.ToString() for reporting (it now contains column).
2802         * cs-parser.jay :
2803           Largely modified to use LocatedToken instead of
2804           string (IDENTIFIER), and to acquire Location from some tokens.
2805         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2806           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2807           codegen.cs :
2808           Now MemberName holds Location. DeclSpace.ctor() receives Location
2809           as a parameter. Removed extra parameters to all derived classes.
2810           Replaced Location.IsNull() with instance property.
2811         * assign.cs, expression.cs :
2812           Added .ctor() overload that omits Location.
2813         * attribute.cs :
2814           Added "nameEscaped" flag that indicates the identifier was escaped
2815           in the source file. This fixes bug #57047.
2816
2817 2005-09-02  Martin Baulig  <martin@ximian.com>
2818
2819         * class.cs: Make CS3005 a warning, not an error.
2820
2821 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2822
2823         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2824         New method, looking for lo-case imported cls type.
2825
2826         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2827         here.
2828
2829         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2830
2831         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2832
2833         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2834         all_imported_types.
2835         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2836
2837         Optimized to save 3.5 MB for SWF compilation.
2838
2839 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2840
2841         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2842         (PartialContainer.Create): Moved logic AddToContainer.
2843         (PartialContainer.MarkForDuplicationCheck): Shares name.
2844         
2845         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2846         place.
2847         
2848         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2849         initialization.
2850         (Namespace.GetSignatureForError): New method.
2851         
2852         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2853         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2854
2855 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2856
2857         Fix #75669.
2858         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2859         member lookup rather than qualifier_type, since qualifier_type can
2860         be null.
2861
2862 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2863
2864         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2865         enum member.
2866
2867 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2868
2869         * statement.cs: Copy the local exception into the exception
2870         captured local.  Fixes 75674
2871
2872 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2873
2874         Fix #75658.
2875         * expression.cs (Invocation.OverloadResolve): Don't report error
2876         CS1501 if error CS1502 has been reported.
2877         (New.DoResolve): Delegate CS1501 reporting to
2878         Invocation.OverloadResolve.
2879
2880         Fix #75656.
2881         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2882         invariant-meaning-in-block property in an enclosing block if
2883         necessary.
2884
2885 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2886
2887         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2888         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2889         (Switch.CheckSwitch): Just save 50kb for SWF.
2890
2891 2005-07-27  Martin Baulig  <martin@ximian.com>
2892
2893         * anonymous.cs (CaptureContext.AddField): Added
2894         `AnonymousContainer am' argument; compute its toplevel scope if
2895         it's not already computed.  Fixes #75649.
2896
2897 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2898
2899         Fix #75628.
2900         * class.cs (Constructor.Emit): Reset block to null if the block
2901         resolve fails.
2902
2903 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2904
2905         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2906
2907 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2908
2909         * class.cs (MethodData.Define): Check whether accessor implementing
2910         interface is public.
2911
2912         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2913
2914 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2915
2916         Fix #57245
2917         * namespace.cs (LookupType): Moved same type check to...
2918         
2919         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2920         with the same name.
2921
2922 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2923
2924         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2925         already found a typebuilder.
2926         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2927         MemberNames, not strings.
2928
2929         * const.cs (Error_ExpressionMustBeConst): 
2930         Rename from Error_EpressionMustBeConst.
2931         * const.cs, class.cs, statement.cd: Update.
2932
2933 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2934
2935         Fix #65573
2936
2937         * const.cs (Const.LookupConstantValue): Report missing contant expression
2938         everytime.
2939         (Error_EpressionMustBeConstant): Only one error method.
2940
2941         * class.cs, statement.c: Updated.
2942
2943 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2944
2945         * statement.cs (Block.Flags): Add back HasVarargs.
2946         (Block.flags): Make protected.
2947         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2948
2949         * typemanager.cs (types, typecontainers, user_types): Remove.
2950         (UserTypes, TypeContainers): Likewise.
2951         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2952         (CleanUp, Reset): Update.
2953         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2954         (GetNestedType): Use Type.GetNestedType.
2955         (CoreLookupType): Take two arguments, the namespace and the
2956         basename of the type.  Update to use the Namespace.Lookup
2957         mechanism.
2958         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2959         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2960         string concatenation and substring matches.
2961         * class.cs, enum.cs, delegate.cs: Update to changes.
2962
2963 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2964
2965         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2966         Expression and made virtual.
2967
2968         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2969         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2970
2971         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2972
2973         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2974         error message.
2975
2976         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2977         change.
2978
2979 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2980
2981         Fix #57707
2982         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2983         AssemblyCultureAttribute is not used on executable.
2984
2985         * rootcontext.cs,
2986         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2987
2988 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2989
2990         Fix #60638.
2991         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2992         New.  Reports CS0252/CS0253.
2993         Mostly taken from preliminary patch by Duncak Mak.
2994         (Binary.DoResolveOperator): Store results of operator lookup.
2995         Use them to detect if we need to warn about unintended reference
2996         comparisons.
2997
2998 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2999
3000         Fix #72969.
3001         * namespace.cs (Namespace.Lookup): Add back location parameter.
3002         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3003         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3004
3005         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3006         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3007         (Namespace.LookupType): ... this.
3008         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3009         of namespaces.
3010         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3011         purported to handle pointers.
3012         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3013         CoreLookupType.
3014
3015 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3016
3017         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3018         type as namespace.
3019
3020 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3021
3022         * namespace.cs (Namespace.Lookup): Drop location parameter.
3023         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3024         (NamespaceEntry.Lookup): ... this.
3025         (NamespaceEntry.Error_AmbiguousTypeReference):
3026         Move here from DeclSpace.
3027         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3028         names ...
3029         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3030         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3031         Move to NamespaceEntry.
3032         * delegate.cs, expression.cs: Update to changes.
3033
3034 2005-08-31  Martin Baulig  <martin@ximian.com>
3035
3036         Committing a patch from Atsushi Enomoto for #75850.
3037
3038         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3039         Prefer a generic enumerator over a non-generic one.
3040
3041 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3042
3043         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3044         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3045
3046 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3047
3048         * driver.cs : reverting default encoding change as well as mcs.
3049
3050 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3051
3052         * driver.cs, support.cs : merged r48826.
3053           Marek Safer wrote:
3054           > could you integrate your mcs changes to gmcs otherwise
3055           > gmcs cannot compile some files.
3056
3057 2005-08-20  Martin Baulig  <martin@ximian.com>
3058
3059         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3060         scope if we don't already have it.
3061
3062         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3063         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3064         fixes #75867.
3065
3066 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3067
3068         * statement.cs: Copy the local exception into the exception
3069         captured local.  Fixes 75674
3070
3071 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3072
3073         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3074         type as namespace.
3075
3076 2005-08-12  Martin Baulig  <martin@ximian.com>
3077
3078         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3079         for nested types here to avoid hitting the cache too early.
3080
3081 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3082
3083         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3084         an error. 
3085
3086 2005-08-03  Martin Baulig  <martin@ximian.com>
3087
3088         Make iterators in generic methods work; see gtest-191.cs.
3089
3090         * generic.cs
3091         (Constraints.Resolve): Protect against being called twice.
3092
3093         * class.cs
3094         (TypeContainer.GetClassBases): Make this `protected virtual'.
3095
3096         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3097         (Iterator.GetClassBases): Override this and compute the base
3098         classes here.
3099         (Iterator.DefineNestedTypes): If we're a generic method, all our
3100         method type parameters become class type parameters on the proxy
3101         class.
3102
3103         * statement.cs
3104         (ToplevelBlock.Parameters): Make this a property, not a field.
3105         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3106
3107 2005-08-03  Martin Baulig  <martin@ximian.com>
3108
3109         * typemanager.cs (TypeManager.IsSubclassOf): Use
3110         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3111         (TypeManager.GetFullName_recursed): Improved.
3112
3113 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3114
3115         Fix #75417
3116         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3117         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3118         invocation_type == mi.DeclaringType, since the first one also checks
3119         other condition used by generic instances.
3120         
3121 2005-07-27  Martin Baulig  <martin@ximian.com>
3122
3123         * anonymous.cs (CaptureContext.AddField): Added
3124         `AnonymousContainer am' argument; compute its toplevel scope if
3125         it's not already computed.  Fixes #75649.
3126
3127 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3128
3129         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3130         CheckAttributeType and refactored.
3131         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3132         ResolveAsTypeTerminal error handling.
3133         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3134         handling.
3135         (GetSignatureForError): Print errors in same way.
3136
3137         * class.cs,
3138         * codegen.cs: Reflect attribute GetSignatureForError change.
3139
3140         * ecore.cs,
3141         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3142
3143         * namespace.cs (UsingEntry): Refactored to make fields private.
3144
3145         * assign.cs,
3146         statement.cs: Error_UnexpectedKind has extra parameter.
3147
3148 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3149
3150         * ecore.cs (IAlias): Remove.
3151         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3152         that implement the interface.
3153         * namespace.cs (Namespace): Likewise.
3154         (Namespace.declspaces): Renamed from 'defined_names'.
3155         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3156         DeclSpace instead of an IAlias.
3157         * tree.cs (Tree.AddDecl): Update.
3158
3159 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3160
3161         * statement.cs (Block.Flags); Remove HasVarargs.
3162         (Block.HasVarargs): Move to ToplevelBlock.
3163         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3164         (Block.Variables): Make protected.  Initialize variable hashtable
3165         if necessary.
3166         (Block.AddVariable): Update.
3167         (Block.Resolve): Update to changes.
3168         (ToplevelBlock.HasVarargs): New boolean.
3169         (ToplevelBlock.ThisVariable): Move here from Block.
3170         (ToplevelBlock.AddThisVariable): Likewise.
3171         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3172         * expression.cs (This.ResolveBase): Update to changes.
3173         (ArglistAccess.DoResolve): Likewise.
3174
3175 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3176
3177         Fix #75321
3178         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3179
3180         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3181         not used and not used & assigned.
3182         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3183
3184 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3185
3186         Fix #75053
3187         * expression.cs (Is.DoResolve): null is never provided type.
3188
3189 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3190
3191         Fix #52496
3192         * cs-parser.jay: Less strict event error rule to catch more errors.
3193
3194 2005-07-11  Martin Baulig  <martin@ximian.com>
3195
3196         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3197         for the constructor constraint: we do not only have to check
3198         whether the class has a public constructor, but also ensure that
3199         it's parameterless.  Fixes #75492.
3200
3201 2005-07-11  Martin Baulig  <martin@ximian.com>
3202
3203         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3204         between type parameters if they either have the reference type
3205         constraint or the class constraint.
3206
3207 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3208
3209         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3210
3211 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3212
3213         Fix #74975
3214         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3215         (ExtractSecurityPermissionSet): Cope with self referencing security
3216         attributes properly.
3217
3218         * driver.cs (SetOutputFile): Made public property OutputFile.
3219
3220 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3221
3222         Fix #75486.
3223         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3224         has_nonstatic_fields.  Make into a FieldBase pointer.
3225         (TypeContainer.AddField): Add CS0282 check.
3226         (TypeContainer.EmitType): Update.
3227
3228 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3229
3230         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3231         compare if they start with __.
3232
3233 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3234
3235         * statement.cs (Switch.SwitchGoverningType): Only look at
3236         UserCasts that don't need implicit standard conversions to one of
3237         the allowed switch types (Fixes test-322.cs).
3238         (LocalInfo.Resolve): Re-enable sanity-test.
3239
3240 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3241
3242         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3243         
3244         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3245         
3246         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3247
3248 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3249
3250         Fix #75472.
3251         * ecore.cs (SimpleName.GetSignatureForError): Add.
3252         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3253         (MemberAccess.GetSignatureForError): Add.
3254
3255 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3256  
3257         The big error and warning messages review.
3258         
3259         * anonymous.cs,
3260         * assign.cs,
3261         * attribute.cs,
3262         * class.cs,
3263         * codegen.cs,
3264         * convert.cs,
3265         * cs-parser.jay,
3266         * cs-tokenizer.cs,
3267         * decl.cs,
3268         * delegate.cs,
3269         * doc.cs,
3270         * driver.cs,
3271         * ecore.cs,
3272         * enum.cs,
3273         * expression.cs,
3274         * flowanalysis.cs,
3275         * iterators.cs,
3276         * literal.cs,
3277         * location.cs,
3278         * modifiers.cs,
3279         * namespace.cs,
3280         * parameter.cs,
3281         * pending.cs,
3282         * report.cs,
3283         * rootcontext.cs,
3284         * statement.cs,
3285         * support.cs,
3286         * tree.cs,
3287         * typemanager.cs: Updated.
3288         
3289         * class.cs: (MethodCore.SetYields): Moved here to share.
3290         (PropertyMethod.Define): Moved iterator setup here.
3291         
3292         * iterators.cs: Add orig_method to have full access to parent
3293         container.
3294
3295 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3296
3297         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3298         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3299         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3300         variable of struct type.
3301         * expression.cs (Unary.ResolveOperator): Update to change.
3302         (Indirection.VerifyFixed): Likewise.
3303         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3304         (ParameterReference.VerifyFixed): Value parameters are fixed.
3305         (This.VerifyFixed): Treat 'this' as a value parameter.
3306         * statement.cs (LocalInfo.IsFixed): Remove.
3307
3308 2005-07-01  Martin Baulig  <martin@ximian.com>
3309
3310         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3311         `ec.EmitThis ()' to get the correct scope.
3312
3313 2005-07-01  Martin Baulig  <martin@ximian.com>
3314
3315         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3316         instance is a ParameterReference; fixes #75299.
3317
3318 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3319
3320         Fix #75412.
3321         * expression.cs (Indexers.map): Remove.
3322         (Indexers.Append): Filter out inaccessible setters and getters.
3323         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3324
3325         Fix #75283.
3326         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3327         Refactored from ...
3328         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3329         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3330         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3331         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3332
3333 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3334
3335         Fix #75322
3336         * class.cs (FieldBase.GetInitializerExpression): One more field
3337         for backup.
3338
3339 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3340
3341         * pending.cs: Do not define a proxy if the base method is virtual,
3342         it will be picked up by the runtime (bug 75270).
3343
3344 2005-07-08  Martin Baulig  <martin@ximian.com>
3345
3346         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3347         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3348
3349 2005-07-07  Martin Baulig  <martin@ximian.com>
3350
3351         * generic.cs (ConstructedType.CheckConstraint): Use
3352         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
3353         called recursively; fixes #75329.
3354
3355 2005-07-06  Martin Baulig  <martin@ximian.com>
3356
3357         * generic.cs (TypeManager.InferTypeArguments): Added support for
3358         anonymous methods; fixes #75461.
3359
3360 2005-07-01  Martin Baulig  <martin@ximian.com>
3361
3362         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3363         `ec.EmitThis ()' to get the correct scope.
3364
3365 2005-07-01  Martin Baulig  <martin@ximian.com>
3366
3367         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
3368         instance is `This'; fixes #75299.
3369
3370 2005-06-30  Martin Baulig  <martin@ximian.com>
3371
3372         * class.cs (Indexer): Implement IIteratorContainer; added support
3373         for iterators in indexers.
3374
3375         * codegen.cs
3376         (EmitContext.CurrentIterator): Make this a property, not a field.
3377
3378         * anonymous.cs (AnonymousContainer.Iterator): New public property.
3379
3380 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3381
3382         * pending.cs: Do not define a proxy if the base method is virtual,
3383         it will be picked up by the runtime (bug 75270).
3384
3385 2005-06-28  Martin Baulig  <martin@ximian.com>
3386
3387         * cs-parser.jay (interface_method_declaration): Avoid a
3388         reduce/reduce conflict by moving some of the code into a separate
3389         `interface_method_declaration_body' rule; fixes #75368.
3390
3391 2005-06-28  Martin Baulig  <martin@ximian.com>
3392
3393         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
3394         array check after the check for TypeBuilder's.
3395
3396 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3397
3398         * convert.cs (FindMostEncompassedType): Add two trivial special
3399         cases (number_of_types == 0 || number_of_types == 1).
3400         (FindMostEncompasingType): Likewise.
3401
3402 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3403
3404         Some cleanups preparing for the fix of #75283.
3405         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3406         error testing.
3407         (EventExpr.InstanceResolve): Likewise.
3408         (EventExpr.DoResolve): Remove redundant checks.
3409
3410 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3411
3412         * class.cs: Small fix.
3413
3414 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3415
3416         Fix #75160.
3417         * class.cs (GetPartialBases): Fix return value check of
3418         part.GetClassBases.
3419
3420 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3421
3422         Ensure that partial classes are registered in their enclosing
3423         namespace.  Initial part of fix of #75160.
3424         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3425         Register declspace with namespace here, not in
3426         DeclSpace.RecordDecl.
3427         * cs-parser.jay: Pass namespace to RecordDecl.
3428         * class.cs (PartialContainer.Create): Likewise.
3429         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3430         called.
3431         * decl.cs (Declspace.RecordDecl): Remove.
3432         * namespace.cs (NamespaceEntry.DefineName): Remove.
3433
3434 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3435
3436         * rootcontext.cs: Reset TargetExt as well.
3437
3438 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3439
3440         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3441         -langversion:ISO-1.
3442
3443 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3444
3445         Fix #75080, cs0119.cs.
3446         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3447         of ...
3448         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3449         allowing ExprClass.Type and ExprClass.Namespace for
3450         ResolveFlags.VariableOrValue.
3451         (Expression.Resolve) [1-argument variant]: Change default resolve
3452         flags based on language version.
3453         (Expression.Error_UnexpectedKind): Use a simple string array
3454         rather than an ArrayList.
3455         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3456         not ExprClass.Type.
3457         (TypeOfVoid.DoResolve): Likewise.
3458         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3459         flags argument -- it always has the same value.
3460
3461 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3462
3463         Fix #75081.
3464         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3465         Use it in the error message.
3466         * assign.cs, expression.cs, statement.cs: Update.
3467
3468 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3469
3470         Fix #75088.
3471         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3472         the "almostMatchedMember" case too.
3473         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3474         that failed the accessibility checks to 'almost_match'.
3475
3476 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3477
3478         * attribute.cs: Use internal MethodBuilder methods to set
3479         ExactSpelling and SetLastError on PInvoke methods, instead
3480         of passing them via charset.  Fixes #75060.
3481
3482 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3483
3484         * parameter.cs (Parameter): Remove TODO comment.
3485         (Parameter.DefineParameter): Remove Location parameter.
3486         (Parameters.LabelParameters): Likewise.
3487         * class.cs (Constructor.Emit): Update to change.
3488         (MethodData.Emit): Likewise.
3489         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3490         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3491
3492 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3493
3494         * parameter.cs,
3495           Removed Parameters.Location and added Parameter.Location instead.
3496           Removed Location parameter from Emit() and GetSignature().
3497         * anonymous.cs,
3498           class.cs,
3499           cs-parser.jay,
3500           delegate.cs,
3501           iterators.cs,
3502           statement.cs :
3503           Modified all related calls.
3504
3505 2005-06-21  Martin Baulig  <martin@ximian.com>
3506
3507         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
3508         left-hand side is not a nullable type; fixes #75328.
3509
3510 2005-06-21  Martin Baulig  <martin@ximian.com>
3511
3512         * typemanager.cs
3513         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
3514         (TypeManager.GetFullNameSignature): Likewise.
3515
3516         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
3517         `source.FullName' and `target.FullName' to check whether there are
3518         two conflicting definitions.
3519
3520 2005-06-21  Martin Baulig  <martin@ximian.com>
3521
3522         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
3523         a BoxedCast - also for reference types - to be compatible with csc.
3524
3525 2005-06-21  Martin Baulig  <martin@ximian.com>
3526
3527         * expression.cs (MemberAccess.DoResolve): Add support for nested
3528         types in a generic instance; fixes #75320.
3529
3530 2005-06-20  Martin Baulig  <martin@ximian.com>
3531
3532         * generic.cs (TypeManager.InferType): Also walk the class
3533         hierarchy for generic instances; fixes #75261.
3534
3535 2005-06-17  Martin Baulig  <martin@ximian.com>
3536
3537         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
3538         to make things work for corlib.
3539
3540 2005-06-15  Martin Baulig  <martin@ximian.com>
3541
3542         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
3543         obsolete `SecurityAction' values.
3544
3545 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3546
3547         * rootcontext.cs: Reset TargetExt as well.
3548         
3549 2005-06-09  Martin Baulig  <martin@ximian.com>
3550
3551         * delegate.cs (Delegate.VerifyMethod): Added
3552         `MethodGroupExpr old_mg' argument; inherit its
3553         `HasTypeParameters'; fix #75085.
3554
3555 2005-06-09  Martin Baulig  <martin@ximian.com>
3556
3557         * expression.cs (Invocation.OverloadResolve): Correctly handle
3558         generic methods for the SetMemberIsUsed(); fix #75064.
3559
3560 2005-06-09  Martin Baulig  <martin@ximian.com>
3561
3562         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
3563         fixes #75062.
3564
3565 2005-06-08  Martin Baulig  <martin@ximian.com>
3566
3567         * cs-parser.jay (nullable_type_or_conditional): If we put the
3568         nullable back and our `type' is a `ComposedCast', remove the
3569         nullable from it.  Fixes #75156.
3570
3571         * expression.cs (ComposedCast.RemoveNullable): New public method.
3572
3573 2005-06-08  Martin Baulig  <martin@ximian.com>
3574
3575         The big Iterators rewrite :-)
3576
3577         * iterators.cs: Rewrite this to use the anonymous methods framework.
3578
3579         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3580         before the TypeContainers; see 2test-21.cs.
3581
3582         * class.cs
3583         (TypeContainer.DefineType): Don't create a new EmitContext if we
3584         already have one (this only happens if we're an Iterator).
3585         (TypeContainer.Define): Also call Define() on all our iterators.
3586         (Method.CreateEmitContext): Added support for iterators.
3587
3588         * anonymous.cs
3589         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3590         (AnonymousContainer.CreateMethodHost): Moved here from
3591         AnonymousMethod and made abstract.
3592         (AnonymousContainer.CreateScopeType): New abstract method.
3593         (AnonymousContainer.IsIterator): New public property.
3594         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3595         get the ScopeTypeBuilder rather than manually defining it here. 
3596         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3597         iterators here.
3598
3599         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3600         before RootContext.DefineTypes().
3601
3602         * codegen.cs (EmitContext.RemapToProxy): Removed.
3603         (EmitContext.CurrentAnonymousMethod): Changed type from
3604         AnonymousMethod -> AnonymousContainer.
3605         (EmitContext.ResolveTopBlock): Protect from being called twice.
3606         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3607         (EmitContext.EmitThis): Removed the iterators hacks; use the
3608         anonymous methods framework for that.
3609
3610         * statement.cs
3611         (ToplevelBlock.Container): Make this a property, not a field.
3612         (ToplevelBlock.ReParent): New public method; move the
3613         ToplevelBlock into a new container.
3614         (Foreach.TemporaryVariable): Simplify.
3615
3616 2005-06-05  Martin Baulig  <martin@ximian.com>
3617
3618         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3619         (Block.AddTemporaryVariable): New public method; creates a new
3620         `LocalInfo' for a temporary variable.
3621         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3622         variables here.
3623         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3624         non-iterator variables.
3625
3626 2005-06-05  Martin Baulig  <martin@ximian.com>
3627
3628         * statement.cs (Foreach.TemporaryVariable): Create the
3629         LocalBuilder in the Emit phase and not in Resolve since in some
3630         situations, we don't have an ILGenerator during Resolve; see
3631         2test-19.cs for an example.
3632
3633 2005-06-04  Martin Baulig  <martin@ximian.com>
3634
3635         The big Foreach rewrite - Part II.
3636
3637         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3638         with `PropertyInfo ienumerator_getcurrent'.
3639
3640         * codegen.cs (VariableStorage): Removed.
3641
3642         * statement.cs
3643         (Foreach): Derive from Statement, not ExceptionStatement.
3644         (Foreach.CollectionForeach): New nested class.  Moved all the code
3645         dealing with collection foreach here.
3646         (Foreach.ForeachHelperMethods): Removed.
3647         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3648
3649 2005-05-23  Martin Baulig  <martin@ximian.com>
3650
3651         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3652         don't need to.  Fix #75014.
3653
3654 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3655
3656         Improve user-defined conversion handling.
3657         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3658         applicable operators.
3659         (AddConversionOperators): New.  Helper for GetConversionOperators.
3660         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3661         there is only one most encompassed/encompassing type.
3662         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3663         "applicable operator" handling.
3664         (UserConversion): Move cache here from GetConversionOperators.
3665         Directly cache the chosen operator, rather than the whole
3666         MethodGroup.
3667         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3668         case.  Allow conversion of decimal to sbyte and byte too.
3669         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3670         New static methods.  Used to avoid allocating EmptyExpressions in
3671         convert.cs.
3672
3673 2005-05-24  Duncan Mak  <duncan@novell.com>
3674
3675         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3676         another class, used in Convert.ExplicitNumericConversion.
3677         (CastToDecimal): New class, similar to above, but casts to
3678         System.Decimal, used in Convert.ImplicitNumericConversion and also
3679         in explicit convesion from double/float to decimal.
3680
3681         * convert.cs (ImplicitNumericConversion): Handle implicit
3682         conversions to System.Decimal.
3683         (ExplicitNumericConversion): handle explicit conversions to
3684         System.Decimal.
3685
3686         This fixes #68711.
3687         
3688 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3689
3690         * typemanager.cs: Do not throw an exception in the TypeBuilder
3691         case, we take care of it on the TypeCode.
3692
3693 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3694         
3695         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3696         is back.
3697         
3698         * cs-parser.jay: Catch more lexical errors.
3699         
3700         * report.cs: Add one more Error method.
3701         
3702         * rootcontext.cs,
3703         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3704
3705 2005-05-20  Martin Baulig  <martin@ximian.com>
3706
3707         * class.cs (TypeContainer.CircularDepException): Removed.
3708         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3709         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3710         (CS0146) and interface (CS0529) dependencies here.
3711
3712 2005-05-20  Martin Baulig  <martin@ximian.com>
3713
3714         * expression.cs (New.DoResolve): Move the CS0712 check above the
3715         CS0144 check; otherwise it can never be reached.
3716
3717 2005-05-20  Martin Baulig  <martin@ximian.com>
3718
3719         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
3720
3721 2005-05-20  Martin Baulig  <martin@ximian.com>
3722
3723         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
3724
3725         * typemanager.cs (TypeManager.IsAttributeType): New public method.
3726
3727 2005-05-19  Martin Baulig  <martin@ximian.com>
3728
3729         * delegate.cs
3730         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3731         to disable error reporting.
3732
3733         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3734         here since we don't want to report an error; see the new test-336.cs.
3735
3736 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3737
3738         * statement.cs (ToplevelBlock.GetParameterReference)
3739         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3740         Move here from class Block.
3741         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3742         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3743
3744 2005-05-18  Martin Baulig  <martin@ximian.com>
3745
3746         Fix #74978.
3747
3748         * flowanalysis.cs
3749         (FlowBranching.Reachability): Add non-static public And() and Or()
3750         methods.
3751         (FlowBranchingSwitch): New class; do the `break_origins' thing
3752         like in FlowBranchingLoop.
3753         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3754         reachability, not just locals and parameters.
3755         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3756         switch; MergeBreakOrigins() now takes care of that.
3757
3758 2005-05-18  Martin Baulig  <martin@ximian.com>
3759
3760         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3761         a loop and may leave it, reset the barrier; fixes #74974.
3762
3763 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3764
3765         Fix test-382.cs.  Emit values of decimal constants.
3766         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3767         Carved out of ...
3768         (TypeContainer.AddField): ... this.
3769         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3770         with initializers to include 'Const's.
3771         (ClassPart.RegisterFieldForInitialization): Forward to
3772         PartialContainer.
3773         * const.cs (Const.Const): Pass initializer to base class.
3774         (Const.Define): In case of decimal constants, register them for
3775         initialization in a static constructor.
3776
3777 2005-05-14  Martin Baulig  <martin@ximian.com>
3778
3779         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3780         do not call ResolveUnreachable() on unreachable statements in
3781         here, see the comment in the source code.
3782
3783 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3784
3785         Fix #74934.
3786         * expression.cs (BinaryResolveOperator): If one of the operands of
3787         an equality comparison is 'null' and the other is a pointer type,
3788         convert the null to a NullPointer.
3789         * convert.cs (ImplicitReferenceConversion): If the expression is a
3790         NullLiteral and the target type is a pointer type, return a
3791         NullPointer instead.
3792         (ImplicitConversionStandard): Likewise.
3793
3794 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3795         
3796         * cs-parser.jay: Set readonly context based on special constructs.
3797         
3798         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3799         readonly variable error handling.
3800         
3801         * rootcontext.cs (EmitCode): Don't verify members when error
3802         occurred.
3803         
3804         * statement.cs (LocalInfo): Add reaodnly context information.
3805         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3806
3807 2005-05-17  Martin Baulig  <martin@ximian.com>
3808
3809         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3810         #70970. 
3811
3812 2005-05-13  Martin Baulig  <martin@ximian.com>
3813
3814         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
3815         handle unreachable blocks.
3816
3817 2005-05-13  Martin Baulig  <martin@ximian.com>
3818
3819         * class.cs
3820         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
3821         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
3822         #74905. 
3823
3824 2005-05-13  Martin Baulig  <martin@ximian.com>
3825
3826         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3827         instance variable, not a local.  Fix #74873.
3828         (Block.ResolveUnreachable): Set it to true here.
3829
3830 2005-05-12  Martin Baulig  <martin@ximian.com>
3831
3832         * cs-parser.jay (property_declaration): Pass the `current_class',
3833         not the `current_container' to Property's .ctor.  Fixes #74912.
3834
3835 2005-05-11  Martin Baulig  <martin@ximian.com>
3836
3837         * typemanager.cs (Closure): Copy this from MCS and merge all the
3838         GMCS-specific changes into it.
3839
3840 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3841
3842         Fix #74920.
3843         * typemanager.cs (unmanaged_enclosing_types): New.
3844         (IsUnmanagedType): Avoid infloops by using
3845         'unmanaged_enclosing_types' to talk with recursive invocations.
3846
3847 2005-05-11  Duncan Mak  <duncan@novell.com>
3848
3849         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3850         continuing to process for 'arg'.
3851         (handle_preprocessing_directive): Check the argument of the #endif
3852         directive and report error CS1025 if there are any trailing
3853         characters.
3854
3855         According to the C# spec, having even whitespace after the #endif
3856         directive is illegal; however, because we call arg.TrimEnd ()
3857         beforehand, we have the same behavior as csc, allowing whitespace
3858         after the directive.
3859
3860         Fixes #74892.
3861
3862 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3863
3864         Fix #74863.
3865         
3866         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3867         (Constructor.GetObsoleteAttribute): Implemented correctly.
3868
3869 2005-05-10  Martin Baulig  <martin@ximian.com>
3870
3871         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
3872         resolve the type; fixes #74864.
3873         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
3874         in DoResolve(); fixes #74862.
3875
3876 2005-05-10  Martin Baulig  <martin@ximian.com>
3877
3878         * support.cs (ReflectionParameters.ParameterModifier): Use
3879         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3880         and `ParameterAttributes.In'.  Fixes #74884.
3881
3882 2005-05-10  Martin Baulig  <martin@ximian.com>
3883
3884         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
3885         the cache if we're just looking for `MemberTypes.NestedType' in a
3886         generic instance.
3887
3888         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
3889         constraints if we're still resolving the type tree.
3890         (Expression.MemberLookup): If we're resolving the type tree, only
3891         look for `MemberTypes.NestedType' since we're only interested in
3892         getting types.
3893
3894         * class.cs (TypeContainer.DefineType): Don't resolve the type
3895         parameters here; do this later in ResolveType() after the type
3896         tree has been resolved.
3897         (TypeContainer.ResolveType): New public method; this is called
3898         after the type tree is resolved and before the types are being
3899         populated.  We resolve the generic constraints here.
3900         (TypeContainer.DoDefineMember): Check the constraints on our base
3901         class and interfaces.
3902
3903         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
3904         set the `ResolvingTypeTree' flag on the EmitContext.
3905
3906         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
3907
3908 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3909
3910         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3911         
3912         * expression.cs (Argument.GetParameterModifier): Turned to property.
3913         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3914         
3915         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3916         its C# equivalent.
3917         
3918 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3919
3920         Fix #74852.
3921         * decl.cs (MemberCache.AddMethods): Register override methods,
3922         rather than non-override methods.
3923         * typemanager.cs (RegisterOverride): New.
3924         (IsOverride): Update.
3925
3926 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3927
3928         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
3929
3930 2005-05-06  Martin Baulig  <martin@ximian.com>
3931
3932         * attribute.cs
3933         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
3934         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
3935
3936 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3937
3938         Fix #73105.
3939         
3940         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3941         recursive declaration.
3942         
3943         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3944         
3945 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3946
3947         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3948         
3949         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3950
3951 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3952
3953         Fix #74797.
3954         * decl.cs (DeclSpace.FamilyAccessible): 
3955         Use TypeManager.IsNestedFamilyAccessible.
3956
3957         Fix reopened #64812.
3958         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3959         internal'.
3960
3961 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3962             Abin Thomas  <projectmonokochi@rediffmail.com>
3963             Anoob V E  <projectmonokochi@rediffmail.com>
3964             Harilal P R  <projectmonokochi@rediffmail.com>
3965
3966         Fix #64812.
3967         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3968         allow access to all static members.
3969
3970 2005-05-04  Martin Baulig  <martin@ximian.com>
3971
3972         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3973
3974 2005-05-04  Martin Baulig  <martin@ximian.com>
3975
3976         Fix #74655.
3977
3978         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3979         section at the end; make things work if `default' is not the last
3980         section.        
3981
3982 2005-05-04  Martin Baulig  <martin@ximian.com>
3983
3984         Fix #70400.
3985
3986         * statement.cs (Switch): Replaced the `got_default' field with a
3987         `default_section' one.
3988         (Switch.CheckSwitch): Set `default_section' here.
3989         (Switch.Resolve): If we're a constant switch and the constant is
3990         not found, use the default section.
3991
3992 2005-05-03  Martin Baulig  <martin@ximian.com>
3993
3994         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3995
3996         * statement.cs (Foreach.ArrayForeach): New nested class.
3997         (Foreach.TemporaryVariable): New nested class.
3998         (Foreach.EmitArrayForeach): Removed; this is now in the new
3999         ArrayForeach class.
4000
4001 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4002
4003         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4004         more conservative.
4005         (VerifyPendingMethods): Revert change below.
4006
4007         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4008         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4009         that used to trigger warning -28.  Remove warning -28.
4010         * expression.cs (Invocation.OverloadResolve): Use
4011         TypeManager.IsOverride to distinguish override methods.
4012
4013         Fix #74773.
4014         * pending.cs (VerifyPendingMethods): If a base type implements the
4015         requested interface, don't bother checking individual methods of
4016         the base type.  As a side-effect, this prevents the creation of
4017         unnecessary proxies.
4018
4019 2005-05-02  Martin Baulig  <martin@ximian.com>
4020
4021         Fix #70182.
4022
4023         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4024         Also `And' the locals if the old vector is null.
4025         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4026         null; in this case we basically reset all the variables.        
4027
4028 2005-05-02  Martin Baulig  <martin@ximian.com>
4029
4030         Fix #74529.
4031
4032         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4033         Added `FlowBranching branching' argument; always `and' the
4034         variables instead of `or'ing them unless we're an infinite loop.
4035
4036         * statement.cs (While.Resolve): Create a new sibling unless we're
4037         infinite.       
4038
4039 2005-05-02  Martin Baulig  <martin@ximian.com>
4040
4041         Fix #70140.
4042
4043         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4044         arguments; use it instead of creating a new TopLevelBlock.
4045         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4046         our ConstructorInitializer.
4047
4048         * statement.cs
4049         (TopLevelBlock.TopLevelBranching): New public property.
4050         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4051         and create our `TopLevelBranching'.
4052
4053         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4054         anonymous method host, use `block.TopLevelBranching' rather than
4055         creating a new branching.
4056
4057 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4058
4059         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4060         a ScopeInfo, if any of the current children is a child of the new
4061         entry, move those children there.
4062
4063 2005-04-30  Martin Baulig  <martin@ximian.com>
4064
4065         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4066         at the beginning of a SwitchSection.  Fix #73335.
4067
4068 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4069
4070         Fix #74378
4071         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4072         
4073         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4074         (FieldExpr.DoResolve): Obsolete members are ignored for field
4075         initializers.
4076         
4077 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4078
4079         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4080         of arrays detection.
4081
4082         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4083         verification.
4084         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4085
4086         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4087         arrays report.
4088
4089 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4090
4091         * cs-parser.jay: Use the prefered version of -unsafe in error
4092         message.
4093
4094 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4095
4096         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4097         circumstances.
4098
4099 2005-04-20  John Luke  <john.luke@gmail.com>
4100
4101         * driver.cs: fix typo in error message, --outout to --output
4102
4103 2005-04-30  Martin Baulig  <martin@ximian.com>
4104
4105         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4106         handle the .NET 2.x security attributes.
4107
4108 2005-04-30  Martin Baulig  <martin@ximian.com>
4109
4110         * typemanager.cs
4111         (TypeManager.ExpandInterfaces): Don't add things twice.
4112
4113         * class.cs
4114         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4115
4116 2005-04-29  Martin Baulig  <martin@ximian.com>
4117
4118         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4119
4120         * anonymous.cs: Added support for anonymous generic methods.
4121
4122 2005-04-29  Martin Baulig  <martin@ximian.com>
4123
4124         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4125         generic instances.
4126
4127 2005-04-29  Martin Baulig  <martin@ximian.com>
4128
4129         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4130
4131         * expression.cs (New.DoResolve): Fix the CS0304 check.
4132
4133 2005-04-29  Martin Baulig  <martin@ximian.com>
4134
4135         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4136         naming schema.
4137
4138         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4139         explicit interface implementation, compare the interface types.
4140         (MethodData.Define): Use the new naming scheme from the latest
4141         .NET 2.x beta2.
4142         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4143
4144         * decl.cs (MemberName.GetMemberName): Removed.
4145         (MemberName.MethodName, FullName): New properties.
4146
4147 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4148
4149         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4150
4151 2005-04-22  Martin Baulig  <martin@ximian.com>
4152
4153         * generic.cs (GenericMethod): Create the EmitContext in the
4154         `Define()'; in `Define(MethodBuilder)', create the type parameters
4155         before calling `Define()'.  Fixes #73933.
4156
4157 2005-04-22  Martin Baulig  <martin@ximian.com>
4158
4159         * generic.cs
4160         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4161         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4162
4163         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4164         ConstructedType, check its constraints.
4165
4166 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4167
4168         * codegen.cs (InRefOutArgumentResolving): New field.
4169         
4170         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4171         fields outside contructor.
4172         
4173         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4174         
4175 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4176
4177         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4178         parameter code was not completed ever, so it was not as up-to-date
4179         as local variables.  Must finish it.
4180
4181         The bug fix was to compare the Toplevel of the block, not the
4182         current block.  Thanks for Ben for pointing this out. 
4183
4184 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4185
4186         * decl.cs (AddMethods): Use the declaring type of the problem
4187         method to determine if we want to squash a warning.
4188
4189 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4190
4191         * attribute.cs: Removed debug output.
4192
4193         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4194         
4195         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4196         Report.Stderr.
4197         
4198 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4199
4200         Fix #74481.
4201         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4202         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4203         all null comparisons against reference types.
4204
4205 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4206
4207         Fix# 74565
4208         * class.cs (TypeContainer.CircularDepException) New nested
4209         exception class.
4210         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4211         (TypeContainer.DefineType): Removed error, reset InTransit before
4212         exit.
4213         (Class.DefineType): Throw exception when is in Transit.
4214         Catch exception and report error.
4215         (Struct.DefineType): Throw exception when is in Transit.
4216         Catch exception and report error.
4217         (Interface.DefineType): Throw exception when is in Transit.
4218         Catch exception and report error.
4219
4220         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4221         handle nested exception handlers.
4222
4223         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4224         a catch.
4225
4226         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4227         InFinally and InCatch storage.
4228
4229         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4230         (Catch.Resolve): Set and Restore ec.InCatch.
4231         (Try.Resolve): Set and Restore ec.InFinally.
4232         (Try.HasCatch): True when try has catch.
4233
4234 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4235
4236         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4237           for the same event member, so exclude such cases from warning 419.
4238           Fixed bug #74633.
4239
4240 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4241
4242         * expression.cs (Binary.ResolveOperator): Apply patch from John
4243         Luke to fix bug 59864: operators &, | and ^ on enumerations
4244         require that the same enum type on both sides.
4245
4246         * driver.cs: Add warnings to old flag usage, this is to assist
4247         people who produce Makefiles and hope that the Makefiles will be
4248         used on Windows.
4249
4250         * class.cs (TypeContainer.EmitType): Moved the definition of the
4251         special $PRIVATE$ field from the resolve phase to the Emit phase.
4252         During resolve we do not know if we are a struct with
4253         HasExplicitLayout, we know this only after the attributes for the
4254         type are emitted.
4255
4256         Set the FieldOffset to zero on the dummy field that we create for
4257         the class.   Fixes 74590.
4258
4259 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4260
4261         Fix #73834.
4262         * ecore.cs (PropertyExpr.resolved): New.
4263         (DoResolve): Use it to handle a case of double resolution here.
4264         Handle a case of identical-name-and-type-name.
4265         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4266         resolution by storing the results of expression resolution back
4267         into the "probes" array.
4268
4269 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4270
4271         Fix cs0208-7.cs and cs0208-8.cs.
4272         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4273         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4274         error reporting to point out the reason a struct is not unmanaged.
4275
4276 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4277
4278         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4279           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4280
4281 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4282
4283         Fix #74528.
4284         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4285         IdenticalNameAndTypeName here.
4286         (EventExpr.InstanceResolve): Likewise.
4287
4288 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4289
4290         C# 2.0 DefaultCharSetAttribute implementation
4291         
4292         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4293         which allows us to set GlobalNamespace for every resolve.
4294         (Attribute.ResolveArguments): Cut from Resolve.
4295         (Attribute.GetCharSetValue): Returns CharSet named argument.
4296         (Attribute.DefinePInvokeMethod): Gets default charset from
4297         module settings.
4298         (GlobalAttribute.ResolveAsTypeStep): Override.
4299         (GlobalAttribute.ResolveArguments): Override.
4300         
4301         * class.cs (TypeAttr): Is protected.
4302         
4303         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4304         (ModuleClass.DefaultCharSetType): New memeber.
4305         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4306         
4307         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4308         charset from module.
4309         
4310         * delegate.cs (TypeAttr): Override.
4311         (Delegate.DefineType): Use this TypeAttr.
4312         
4313         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4314         at very early stage (before types are defined) to resolve model
4315         module attributes. It will probably not work with corlib but it
4316         should be ok.
4317         
4318         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4319         charset from module.
4320         
4321         * typemanager.cs (default_charset_type): New type.
4322
4323 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4324
4325         * decl.cs (MemberCache.AddMethods): Don't warn if
4326         System.Object.Finalize has buggy MethodAttributes.
4327
4328         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4329         removed below.
4330
4331 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4332
4333         * doc.cs : detect ambiguous reference to overloaded members.
4334           Fixed bug #71603. MS 1.1 csc does not detect it.
4335
4336 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4337
4338         * doc.cs : delegates must not be referenced with parameters.
4339           Fixed bug #71605.
4340
4341 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4342
4343         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4344
4345 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4346
4347         * driver.cs (MainDriver): Stop processing if the CLS stage found
4348         errors. 
4349
4350         (CompilerCallableEntryPoint.InvokeCompiler): Always
4351         reset after execution;   Take a TextWriter argument for the
4352         output.
4353
4354         * report.cs: Use the error stream instead of hardcoding stderr. 
4355
4356 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4357
4358         * class.cs: Reduce code paths to test, too small of an
4359         optimization to make it worth the extra testing.  Always perform
4360         it. 
4361
4362 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4363
4364         Fix #74510.
4365         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4366         operators that had errors reported on them.
4367
4368 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4369
4370         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4371         argument types.
4372         (Attribute.Resolve): Add named argument type checking.
4373         
4374         * class.cs (FixedField.Define): Use IsPrimitiveType
4375         
4376         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4377         
4378         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4379         unsafe parameter types.
4380         
4381         * statement.cs (Using.ResolveExpression): Add better error description.
4382         
4383         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4384         
4385 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4386
4387         Fix #74484.
4388         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4389         AttributeUsageAttribute in the emitcontext of the attribute class,
4390         not in the emitcontext of the attributable entity it was attached to.
4391         * cs-parser.jay: Use 'current_class', not 'current_container',
4392         when creating a GlobalAttribute.
4393
4394 2005-04-08  Alp Toker  <alp@atoker.com>
4395
4396         * pending.cs: The fix to #58413 failed to compile methods implementing
4397         interfaces with/without params modifiers and vice versa, even though
4398         params modifiers aren't part of the signature. Make the modifier check
4399         less strict as in csc.
4400
4401 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4402             Anoob V E  <projectmonokochi@rediffmail.com>
4403             Harilal P R  <projectmonokochi@rediffmail.com>
4404
4405         Fix #58413.
4406         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4407         modifiers of pending methods.
4408         (PendingImplementation.PendingImplementation): Initialize it.
4409         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4410         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4411         with ParameterData.  Add check for modifiers.
4412         * class.cs (MethodData.Define): Update to changes.
4413
4414 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4415
4416         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4417
4418 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4419
4420         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4421         property.
4422         
4423         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4424         
4425         * rootcontext.cs,
4426         * typemanager.cs: Registered RequiredAttributeAttribute.
4427         
4428 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4429
4430         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4431         Warning CS0169 is back at level 3.
4432         (IMethodData.SetMemberIsUsed): New method.
4433         
4434         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4435         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4436         
4437         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4438
4439         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4440         contants.
4441         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4442         is used.
4443         
4444         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4445         is used.
4446         
4447         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4448         to avoid the problems with nested types.
4449
4450 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4451             Anoob V.E  <projectmonokochi@rediffmail.com>
4452             Harilal P.R  <projectmonokochi@rediffmail.com>
4453             Raja R Harinath  <rharinath@novell.com>
4454
4455         Fix #73820.
4456         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4457         attribute.
4458         * typemanager (GetConstructor): Make public.
4459
4460 2005-04-05  John Luke  <john.luke@gmail.com>
4461             Raja R Harinath  <rharinath@novell.com>
4462
4463         Fix #62232.
4464         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4465         struct too.  Return false quicker in a few cases.
4466         (VerifyUnManaged): Use it.
4467
4468 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4469
4470         Fix #74041.
4471         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4472         not 'unreachable_seen'.
4473
4474 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4475
4476         * attribute.cs (Attribute.GetValue): Removed unused.
4477         
4478         * codegen.cs (CodeGen.TrimExt): Removed unused.
4479         
4480         * cs-parser.jay (output): Removed unused.
4481         
4482         * cs-tokenizer.cs (hex_digits): Removed unused.
4483         
4484         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4485         
4486         * expression.cs (Indirection.LoadExprValue): Removed unused.
4487         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4488         
4489         * iterators.cs (Iterator.param_types): Removed unused.
4490         
4491         * statement.cs (Goto.block): Removed unused.
4492         (ToplevelBlock.did): Removed unused.
4493         (Switch.ResolveConstantSwitch): Removed unused.
4494
4495 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4496
4497         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4498         resetting thingy.
4499
4500 2005-04-19  Martin Baulig  <martin@ximian.com>
4501
4502         Merged r42462 from MCS and made it work for GMCS.
4503
4504         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
4505
4506         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
4507
4508 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4509
4510         Fix #74232 and cs0208-3.cs.
4511         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4512         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4513         unmanaged type.  Don't use FieldBuilders when 't' is a
4514         TypeBuilder.  Use ModFlags and MemberType fields.
4515         * class.cs (MemberBase.member_type): Rename from MemberType.
4516         (MemberBase.MemberType): New property.  Determines member_type on
4517         demand.
4518         (MemberBase.DoDefine): Don't initialize MemberType here.
4519         (FieldMember.Define): Likewise.
4520
4521 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4522
4523         Fix #74241
4524         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4525         Attributes are emitted there.
4526         
4527 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4528
4529         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4530         keyword in 'partial enum' too.
4531         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4532         is not allowed).
4533         Report from Kamil Skalski <nazgul@omega.pl>.
4534
4535         Fix #74309.
4536         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4537         have partial containers too.
4538
4539         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4540         in block' checks to Block.CheckInvariantMeaningInBlock.
4541         * statement.cs (Block.GetKnownVariableInfo): Make private.
4542         (Block.IsVariableUsedInChildBlock): Remove.
4543         (Block.IsVariableUsedInBlock): Likewise.
4544         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4545         conflicting declaration.
4546         (Block.AddVariable): Make error messages less long-winded and more
4547         specific.  Show location of conflicting declaration.
4548         * parameter.cs (Parameters.Location): New readonly property.
4549
4550 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4551
4552         Clean up semantics of invoking ResolveMemberAccess.
4553         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4554         can have an instance, ensure that we pass in a non-TypeExpression
4555         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4556         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4557         argument.  Update to changes and simplify.
4558         (FieldExpr.Emitinstance): Remove CS0120 check.
4559         (PropertyExpr.EmitInstance): Likewise.
4560         * expression.cs (Argument.Resolve): Likewise.
4561         (Invocation.DoResolve): Update to changes in semantics of
4562         InstanceExpression.
4563
4564 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4565
4566         Fix #74241
4567         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4568         customization.
4569         
4570         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4571
4572 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4573
4574         Fix difference in behaviour with commandline invocation.
4575         * driver.cs (Driver.Reset): New.
4576         (CompilerCallableEntryPoint): Call it.
4577
4578         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4579         variable" warnings if the boolean expression failed to resolve.
4580
4581 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4582
4583         * attribute.cs: Fix the union of several permissions when some of them
4584         are unrestricted (so the result isn't an unrestricted permission set).
4585         Fix #74036.
4586
4587 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4588
4589         * ecore.cs (MemberExpr): New class.  Convert from interface
4590         IMemberExpr.
4591         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4592         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4593         error checks.
4594         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4595         (MethodGroupExpr.IsExplicitImpl): Remove.
4596         (Expression.GetFieldFromEvent): Remove.
4597         (SimpleName.MemberStaticCheck): Remove.
4598         (SimpleName.DoSimpleNameResolve): Update to changes.
4599         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4600         (MemberAccess.IdenticalNameAndTypeName): Remove.
4601         (MemberAccess.error176): Move to MemberExpr.
4602         (MemberAccess.DoResolve): Update to changes.
4603         (BaseAccess.DoResolve): Likewise.
4604
4605 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4606
4607         C# 2.0 Conditional attribute class implementation
4608         
4609         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4610         Analyzes class whether it has attribute which has ConditionalAttribute
4611         and its condition is not defined.
4612         
4613         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4614         (Class.IsExcluded): New method. Search for at least one defined
4615         condition in ConditionalAttribute of attribute class.
4616
4617 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4618
4619         * ecore.cs (PropertyExpr): Derive from Expression, not
4620         ExpressionStatement.
4621         (PropertyExpr.EmitStatement): Remove.
4622
4623 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4624
4625         Fix #74060.
4626         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4627         internal field "value__" of an enum be private.  The examples for
4628         "value__" that I found on MSDN all used FieldAttributes.Private.
4629
4630         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4631         Don't mention IL method attribute names.
4632
4633         Fix #47991.  Remove a TODO.
4634         * statement.cs (Block.Toplevel): Make into a field.
4635         (Block.Parameters): Move into ToplevelBlock.
4636         (Block.known_variables): Rename from child_variable_names.
4637         (Block.Block): Remove variants that take Parameters.  Initialize
4638         'Toplevel' with the immediately surrounding toplevel block.
4639         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4640         LocalInfo parameter.
4641         (Block.GetKnownVariableInfo): New.
4642         (Block.IsVariableNameUsedInChildBlock): Update.
4643         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4644         the block, even though it may not be in scope.
4645         (Block.AddVariable): Remove Parameters parameter.  Use
4646         Toplevel.Parameters instead.
4647         (Block.AddConstant): Remove Parameters parameter.
4648         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4649         (Block.IsParamaterReference): Likewise.
4650         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4651         (ToplevelBlock.Parameters): New.  Moved from Block.
4652         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4653         initialize Parameters to a non-null value.
4654         * cs-parser.jay: Update to changes.
4655         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4656         simple names that mean different things in the same block.  Use
4657         Block.IsVariableNameUsedInBlock.
4658
4659 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4660
4661         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4662
4663 2005-03-26  Raja R Harinath  <harinath@acm.org>
4664
4665         Fix #73038.
4666         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4667         fails to resolve, ensure that the LHS is still resolved as an
4668         lvalue.
4669
4670 2005-03-25  Raja R Harinath  <harinath@acm.org>
4671
4672         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4673         ec.ContainerType.
4674         (Enum.current_ec): Remove.
4675         (Enum.LookupEnumValue): Remove EmitContext argument.
4676         Just uses the one created during DefineType.
4677         (Enum.FindMembers): Update.
4678         * expression.cs (MemberAccess.DoResolve): Update.
4679
4680 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4681
4682         * assign.cs (Assign.DoResolve): Check for CS1717 when
4683         source and target are same (uses Equals).
4684
4685         * expression.cs (LocalVariableReference, ParameterReference,
4686         This): Implemented Equals, GetHashCode.
4687
4688         * statement.cs (Block.GetParameterReference): Removed useless
4689         local variable.
4690
4691 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4692
4693         Fix cs0128.cs
4694         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4695         blocks before deciding whether the error is cs0136 or cs0128.
4696
4697         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4698         (using_alias_directive, using_namespace_directive): Pass
4699         MemberName, not an expression to Namespace.UsingAlias and
4700         Namespace.Using.
4701         (MakeName): Use the MemberName of the namespace.
4702         * namespace.cs (Namespace.MemberName): New.
4703         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4704         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4705         Likewise.
4706         * decl.cs (MemberName.Name): Make readonly.
4707         (MemberName.FromDotted): New "constructor".
4708         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4709         (MemberCore.Name): Compute from MemberName on demand.
4710         (MemberCore.SetMemberName): Provide a way to change the
4711         MemberName.
4712         (MemberCore.AddToContainer): Don't take a fullname parameter.
4713         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4714         fully qualified name of the container to the member name.
4715         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4716         only if the type is a member of the root container.
4717         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4718         MemberName.Left rather than searching for an embedded ".".
4719         (PartialContainer.CreatePart): Update to changes in RootContext.
4720         (MemberBase.ShortName): Turn into a property.  Use
4721         MemberCore.SetMemberName.
4722         (MemberBase.ExplicitInterfaceName): Remove.
4723         (MemberBase.UpdateMemberName): Remove.
4724         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4725         (PropertyBase.SetMemberName): New override.
4726         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4727         (Tree.GetDecl): New.
4728         (Tree.AllDecls): Rename from Decls.
4729         * attribute.cs, enum.cs, report.cs: Update to changes.
4730         * driver.cs (MainDriver): Use MemberName.FromDotted on
4731         RootContext.MainClass.
4732
4733 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4734
4735         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4736         checks.
4737
4738         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4739
4740 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4741
4742         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4743         property accessor modifiers.
4744
4745         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4746         fixed buffer attribute (CS1716).
4747         (PropertyMethod.HasCustomAccessModifier): When property accessor
4748         has custom modifier.
4749
4750         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4751         modifiers.
4752         (PropertyExpr.DoResolveLValue): Add CS0272.
4753
4754 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4755
4756         * convert.cs: When converting to a pointer, use the proper Conv.U
4757         or Conv.I depending on the source data type.
4758
4759         * cs-tokenizer.cs: Make the size for large decimal constants,
4760         fixes #72957.
4761
4762 2005-03-17  Martin Baulig  <martin@ximian.com>
4763
4764         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4765         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4766
4767 2005-03-17  Martin Baulig  <martin@ximian.com>
4768
4769         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4770         to bool so we can return an error condition.
4771         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4772         returned an error.
4773
4774 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4775
4776         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4777         attributes.
4778
4779 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4780
4781         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4782         Refactor to avoid traversing the list of assemblies, and to avoid
4783         string concatenation.
4784         * typemanager.cs (guid_attr_type): Remove.
4785         (negative_hits, pointers, references): Remove hashes.
4786         (type_hash): New.
4787         (GetConstructedType): New.  Uses type_hash to handle constructed
4788         types (arrays, references, pointers).
4789         (GetReferenceType, GetPointerType): Use it.
4790         (GetNestedType): New.  Uses type_hash to handle nested types of
4791         reflected types.
4792         (LookupType, LookupTypeDirect): Remove.
4793         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4794         'types' hash and LookupTypeReflection directly.
4795         (params_string, params_object): Use GetConstructedType.
4796         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4797         top-level types.
4798         (Namespace.Lookup): Use cached_types.
4799         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4800         provided by old TypeManager.LookupType.
4801         * rootcontext.cs (MakeFQN): Remove.
4802         * decl.cs (DeclSpace.MakeFQN): Likewise.
4803         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4804         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4805         TypeManager.GetConstructedType.
4806         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4807
4808 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
4809
4810         * cs-parser.jay: Fix build.
4811
4812 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4813
4814         * class.cs (TypeContainer.CircularDepException) New nested
4815         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
4816
4817         * cs-parser.jay: Reports CS1527 for any namespace element.
4818
4819         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4820         Added CS0407.
4821
4822         * expression.cs (ParameterReference.IsAssigned): Changed error to
4823         CS0269.
4824         (Error_WrongNumArguments): Moved CS0245 detection here.
4825
4826         * statement.cs (Return.Resolve): Add CS1622 report.
4827
4828 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4829
4830         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4831
4832 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4833
4834         * attribute.cs expression.cs: Get rid of some allocations.
4835
4836 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4837
4838         * doc.cs : just eliminate the latest change.
4839
4840 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4841
4842         * doc.cs : commented out the latest change. It breaks xml-030.cs
4843
4844 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4845
4846         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4847           fail. So invoke CreateType() in FindDocumentedType().
4848
4849 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4850
4851         * cs-tokenizer.cs : added IsKeyword().
4852         * doc.cs : Detect keyword incorrectly used as identifier.
4853           Allow identifiers prefixed by @.
4854
4855 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4856
4857         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4858         It caused exception in namespace resolving (again!).
4859         
4860         * class.cs (Class.ctor): Removed exit.
4861         (PropertyMethod.ctor): ditto.
4862         
4863         * codegen.cs (Codegen.Reset): Reset static data.
4864         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4865         
4866         * cs-tokenizer.cs (Cleanup): Removed.
4867         
4868         * driver.cs (GetSystemDir): Rewrote to one line command.
4869         It caused problem with unloaded dynamic modules.
4870         (UnixParseOption): Removed Exit.
4871         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4872         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4873         Now can be mcs used as library.
4874         
4875         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4876         empty location.
4877         
4878         * location.cs (Reset): Reset static data.
4879         
4880         * namespace.cs (Reset): Reset static data.
4881         
4882         * report.cs (Report.Reset): Reset static data.
4883         
4884         * rootcontext.cs (RootContext.Reset): Reset static data.
4885         
4886         * tree.cs (RootTypes.ctor): Use Location.Null
4887         
4888         * typemanager.cs (TypeManager.Reset): Reset static data.
4889         (CoreLookupType): Removed Exit.
4890         (TypeHandle.Reset): Reset static data.
4891         
4892 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4893
4894         Fix #73516.
4895         * typemanager.cs (ComputeNamespaces): Import namespaces from
4896         referenced modules too.
4897
4898 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4899
4900         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4901         than '.'.
4902
4903 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4904
4905         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4906         enclosing DeclSpace.  This ensures that a name-lookup populates
4907         more caches and there are fewer 'TypeExpression's.  Carve out
4908         nested type lookup into ...
4909         (LookupNestedTypeInHierarchy): ... this.
4910
4911 2005-04-15  Martin Baulig  <martin@ximian.com>
4912
4913         Merged r41590 from MCS and make it work in the generics land.
4914
4915         * generic.cs (TypeParameter.UpdateConstraints): Removed the
4916         `check' argument.
4917
4918         * class.cs (PartialContainer.UpdateConstraints): Removed.
4919         (PartialContainer.CheckConstraints): Removed.
4920         (PartialContainer.SetParameterInfo): Store the constraints here.
4921         (PartialContainer.DefineTypeParameters): New public method;
4922         resolve the type parameter's constraints here.  Note that the
4923         PartialContainer doesn't have an EmitContext anymore, so we must
4924         do this in the ClassPart.
4925
4926 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4927
4928         Clean up a few partial-class semantics.  
4929         Fixes test-357.cs and cs1618-2.cs.
4930         * cs-parser.jay (struct_declaration): Use 'current_class' as
4931         parent of newly-created struct.  Remove call to Register ().
4932         Use 'pop_current_class' to complete handing the current struct.
4933         (interface_declaration): Likewise.
4934         (class_declaration): Likewise.
4935         (enum_declaration): Use 'current_class' as parent of newly created
4936         enum.
4937         (delegate_declaration): Likewise.
4938         (pop_current_class): New function.  This is used to handle closing
4939         up the 'current_class' and 'current_container', and pointing them
4940         to the enclosing class/container.
4941         (CSharpParser): Initialize 'current_class' too.
4942         * decl.cs (MemberCore): Add check for invariant: a partial
4943         container is not a parsed entity, and thus does not enclose any
4944         parsed members.
4945         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4946         (DeclSpace.BaseTypeExpr): Use it.
4947         (DeclSpace.LookupType): Add check for invariant.
4948         * class.cs (TypeContainer): Add check for invariant: a nested
4949         class should have the same NamespaceEntry as its enclosing class.
4950         (TypeContainer.EmitFieldInitializers): Make virtual.
4951         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4952         MemberCore.
4953         (TypeContainer.Register): Remove.
4954         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4955         null.  Use TypeResolveEmitContext for resolving base types and
4956         interfaces.  Move initialization of Parts.TypeBuilder here from
4957         ...
4958         (TypeContainer.DefineNestedTypes): ... here.
4959         (PartialContainer): Take a Namespace not a NamespaceEntry.
4960         (PartialContainer.Create): Don't use Register.  Call the
4961         appropriate Add... function directly.
4962         (ClassPart): Take both the PartialContainer and the enclosing
4963         class as constructor arguments.
4964         (ClassPart.EmitFieldInitializers): Override.
4965         (ClassPart.PartFindNestedTypes): Remove.
4966         (FieldBase.GetInitializerExpression): Resolve the initializer
4967         expression in the emit context of the enclosing class.
4968         * tree.cs (RootTypes): Remove Register ().
4969         
4970 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4971
4972         * cs-parser.jay: Removed CS0134.
4973         
4974         * driver.cs: Removed CS1901.
4975         
4976         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4977         for predefined types.
4978
4979 2005-03-07  Duncan Mak  <duncan@novell.com>
4980
4981         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4982         well. Fixes bug #73454.
4983
4984 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4985
4986         * cs-tokenizer.cs (xtoken): Add CS1035.
4987         
4988         * class.cs (MethodData.Define): Add CS0683.
4989         (FieldMember.ctor): Add CS0681.
4990
4991 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4992
4993         * ecore.cs (SimpleName.DoResolve): Rename from
4994         SimpleName.DoResolveAllowStatic.
4995         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4996         Pass 'intermediate' flag to MemberStaticCheck.
4997         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4998         of "intermediate" lookups via MemberAccess.
4999         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5000         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5001
5002 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5003
5004         Fix #73394.
5005         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5006         slipped in because of variable names that are identical to a
5007         builtin type's BCL equivalent ('string String;', 'int Int32;').
5008         (PropertyExpr.EmitInstance): Likewise.
5009
5010 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5011
5012         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5013         
5014         * report.cs (warning_ignore_table): Made public.
5015
5016 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5017
5018         Fix #73282.
5019         * class.cs (MethodData.Emit): Pass 'container' to
5020         container.GetObsoleteAttribute instead of 'container.Parent'.
5021
5022 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5023
5024         * cs-parser.jay: Add 1534 error test.
5025
5026         * iterators.cs (Yield.CheckContext): Add error 1629.
5027         (Iterator.ctor): Save unsafe modifier.
5028         (MoveNextMethod.DoEmit): Restore unsafe context.
5029
5030         * namespace.cs (UsingAlias): Better error message.
5031
5032 2005-03-03  Dan Winship  <danw@novell.com>
5033
5034         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5035         the warning message [#73219]
5036
5037 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5038
5039         Fix compile with MCS 1.0.0.0.
5040         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5041         w_restore to not depend on string constant folding.
5042
5043 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5044
5045         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5046         CS0246 check to users who passed 'silent = false'.
5047         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5048         check.
5049         (SimpleName.SimpleNameResolve): Update.
5050         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5051         (MemberAccess.IdenticalNameAndTypeName): Update.
5052         * doc.cs (FindDocumentedTypeNonArray): Update.
5053
5054 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5055
5056         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5057         * parameters.cs (ComputeAndDefineParameters): Remove.
5058         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5059         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5060         Use GetParameterInfo.
5061
5062 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5063
5064         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5065
5066 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5067
5068         Unify DeclSpace.LookupType and DeclSpace.FindType.
5069         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5070         is in charge of defining nested types on demand.
5071         (DeclSpace.LookupType): Use it when the current_type is a
5072         TypeBuilder.  Use LookupTypeDirect for reflected types.
5073         (DeclSpace.FindType): Remove.
5074         (DeclSpace.LookupInterfaceOrClass): Likewise.
5075         (DeclSpace.DefineTypeAndParents): Likewise.
5076         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5077         DeclSpace.LookupType.
5078         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5079         * typemanager.cs (LookupType): Simplify.
5080         (AddUserType): Remove type from negative_hits.
5081         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5082         * class.cs (TypeContainer.FindMembers): Move handling of nested
5083         types ...
5084         (TypeContainer.FindMembers_NestedTypes): ... here.
5085         (TypeContainer.FindNestedType): Implement override.
5086         (ClassPart.FindNestedType): Delegate to PartialContainer.
5087         (ClassPart.PartFindNestedType): Looks up the nested types of the
5088         part alone.
5089
5090 2005-04-14  Martin Baulig  <martin@ximian.com>
5091
5092         * generic.cs (ConstructedType): Moved all the type lookup and
5093         nested class logic into SimpleName.
5094         (ConstructedType.ResolveConstructedType): Our underlying type is
5095         already fully resolved; all the type lookup stuff is in
5096         SimpleName.
5097
5098         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5099         constructed types here instead of in ConstructedType.
5100
5101         * decl.cs (MemberName.GetTypeExpression): Always create a
5102         SimpleName, not a ConstructedType.
5103         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5104
5105 2005-03-02  Martin Baulig  <martin@ximian.com>
5106
5107         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5108         static constructor in static classes.
5109
5110 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5111
5112         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5113         sizeParamIndex is not specified.
5114
5115 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5116
5117         Fix #73117
5118         * report.cs (WarningMessage.IsEnabled): Missing null check.
5119
5120 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5121
5122         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5123         in the fields and not in the properties.
5124
5125 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5126
5127         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5128         fields as well.
5129
5130 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5131
5132         * attribute.cs: Small refactoring (improved robustness).
5133         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5134         (ValidateGuid): Removed.
5135         (Resolve): Removed referenced to above mentioned.
5136         (GetAttributeUsage): Made private and changed to work without
5137         class assistance.
5138         (GetIndexerAttributeValue): Don't crash.
5139         (GetConditionalAttributeValue): Ditto.
5140         (GetClsCompliantAttributeValue): Ditto.
5141         (ExtractSecurityPermissionSet): All attributes exceptions are
5142         error 648.
5143         (GetPropertyValue): New helper.
5144         (GetMethodImplOptions): New method.
5145         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5146         some missing properties.
5147         
5148         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5149         (Method.ApplyAttributeBuilder): Updated.
5150         
5151         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5152         exception.
5153
5154 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5155
5156         Fix #73052.
5157         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5158         non-simple types (array, pointer, reference).
5159
5160 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5161
5162         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5163
5164         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5165         for operators.
5166         (Method.CheckBase): Catch wrong destructor here.
5167         (MethodData.Define): Add errors 550, 668.
5168
5169         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5170
5171         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5172
5173         * pending.cs (VerifyPendingMethods): Add error 551.
5174
5175         * typemanager.cs (CSharpName): Next error report helper.
5176
5177 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5178
5179         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5180         attributes. Removed useless attribute double check.
5181         It saves almost 2MBs for corlib.
5182
5183 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5184
5185         Fix #72924.
5186         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5187         called twice in case of error.
5188
5189 2005-02-23  Chris Toshok  <toshok@ximian.com>
5190
5191         Fix compiler portions of #72827.
5192         * statement.cs (Block.Emit): call Begin/EndScope on the
5193         EmitContext instead of the ILGenerator.
5194
5195         * codegen.cs (EmitContext.BeginScope): new method, call
5196         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5197         we have one.)
5198         (EmitContext.BeginScope): same, but EndScope and CloseScope
5199
5200         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5201         offset and call the superclass's OpenScope(int) with it.
5202         (SymbolWriter.CloseScope): get the current il
5203         offset and call superclass's CloseScope(int) with it.
5204
5205 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5206
5207         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5208         CS1677 for out and ref as well.
5209
5210         * class.cs (Method.Define): Add error CS1599 detection.
5211         
5212         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5213         
5214         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5215         
5216         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5217         
5218         * support.cs.cs (ModifierDesc): New helper method.
5219
5220 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5221             Abin Thomas  <projectmonokochi@rediffmail.com>
5222             Anoob V E  <projectmonokochi@rediffmail.com>
5223             Harilal P R  <projectmonokochi@rediffmail.com>
5224
5225         Fix #57851, #72718.
5226         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5227         MemberLookup (used for error reporting) actually returns a result.
5228         Fix error report number (122, not 112).
5229
5230 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5231             Anoob V E  <projectmonokochi@rediffmail.com>
5232             Harilal P R  <projectmonokochi@rediffmail.com>
5233
5234         Fix #71134.
5235         * pending.cs (PendingImplementation.GetAbstractMethods):
5236         Find NonPublic members too.
5237
5238 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5239
5240         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5241         Fixed error 217.
5242         
5243         * class.cs (MethodCore.CheckMethodAgainstBase):
5244         Add error 239 report.
5245
5246 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5247
5248         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5249         
5250         * class.cs (Operator.Define): Add error 217 report.
5251         
5252 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5253
5254         Fix #68955.
5255         * expression.cs (Invocation.IsApplicable): Make public.
5256         (Invocation.IsParamsMethodApplicable): Likewise.
5257         * delegate.cs (Delegate.VerifyApplicability): Don't use
5258         Invocation.VerifyArgumentCompat for parameter applicability
5259         testing.  Use Invocation.IsApplicable and
5260         Invocation.IsParamsMethodApplicable.
5261
5262 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5263
5264         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5265         
5266         * class.cs (Operator.Define): Add error 217 report.
5267         
5268 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5269
5270         * namespace.cs (UsingEntry.Resolve): Undo change below.
5271
5272 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5273
5274         Fix #72756.
5275         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5276         disable the error message when the extended MemberLookup also
5277         fails.
5278         (Expression.MemberLookupFinal): Update.
5279         (SimpleName.DoSimpleNameResolve): Update.
5280         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5281         Don't use MemberLookupFinal.
5282         (New.DoResolve): Update.
5283         (BaseAccess.CommonResolve): Update.
5284
5285 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5286
5287         Fix #72732.
5288         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5289         occured previously, don't resolve again.
5290
5291 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5292
5293         Fix #69949
5294         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5295         argument. Call ResolveAttributeUsage for unresolved.
5296         when types doesn't match ctor arguments.
5297         
5298         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5299         for nested attribute classes.
5300         (Class.attribute_usage): Removed.
5301         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5302         for attribute class.
5303         
5304         * ecore.cs (IsAttribute): Removed.
5305         
5306         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5307         
5308         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5309         now normal types.
5310         (attribute_types): Removed.
5311         (EmitCode): Global attributes are emited as the latest.
5312
5313 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5314
5315         * class.cs (EmitFieldInitializers): Don't emit field initializer
5316         for default values when optimilization is on.
5317         
5318         * constant.cs (Constant.IsDefaultValue): New property.
5319         
5320         * driver.cs: Add /optimize handling.
5321         
5322         * constant.cs,
5323         * ecore.cs,
5324         * literal.cs: Implement new IsDefaultValue property.
5325         
5326         * rootcontext.cs (Optimize): New field, holds /optimize option.
5327
5328 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5329
5330         Fix crasher in re-opened #72347.
5331         * namespace.cs (Namespace.Lookup): Return null if
5332         DeclSpace.DefineType returns null.
5333
5334         Fix #72678.
5335         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5336
5337 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5338
5339         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5340         now returns null if it cannot resolve to an lvalue.
5341         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5342         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5343         returned null.  Remove check for SimpleName.
5344         (EventExpr.DoResolveLValue): New.
5345         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5346         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5347         error from ...
5348         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5349         avoid CS0131 error.
5350         (Unary.ResolveOperator): Move CS0211 check ...
5351         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5352         CS0131 error.
5353         (Unary.DoResolveLValue): Simplify.
5354         (AddressOf.DoResolveLValue): New.
5355         (ArrayAccess.DoResolveLValue): New.
5356
5357 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5358
5359         * attribute.cs (Attribute.Resolve): Add arguments casting for
5360         when types doesn't match ctor arguments.
5361
5362 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5363
5364         Fix parts of #63202.
5365         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5366         lookup of operator in base type.  Ensure that all checks happen
5367         when the operator resolves to an "op_..." method.
5368
5369 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5370
5371         Fix #71992.
5372         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5373         'ignore_cs0104' parameter.  Pass it to ...
5374         (NamespaceEntry.Lookup): ... this.
5375         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5376         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5377         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5378         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5379         Update.  Request that cs0104 errors be ignored.
5380         (ComposedCast.ResolveAsTypeStep): Update.
5381
5382 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5383
5384         Fix #59209.
5385         * expression.cs (Invocation.BetterFunction): Remove support for
5386         comparing virtual functions and their overrides.
5387         (Invocation.IsOverride): New.
5388         (Invocation.OverloadResolve): Don't consider 'override' functions
5389         during candidate selection.  Store them in a lookaside list.
5390         If the selected method is a 'virtual' function, use the list to
5391         find any overrides that are closer to the LHS type.
5392
5393 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5394
5395         * expression.cs (New.DoResolve): Add complex core type reduction.
5396         (New.Constantify): Converts complex core type syntax like 'new int ()'
5397         to simple constant.
5398         
5399 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5400
5401         * decl.cs (EntryType.EntryType): New constructor to create an
5402         updated copy of a cache entry.
5403         (MemberCache.AddMethods): Use it.
5404         (MemberCache.ClearDeclaredOnly): Remove.
5405         (MemberCache.MemberCache): Update.
5406
5407 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5408
5409         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5410         variable.  This one is represents the actual low-level declaration
5411         of the method, as opposed to the semantic level `IsStatic'.   
5412
5413         An anonymous method which is hosted into a static method might be
5414         actually an instance method.  IsStatic would reflect the
5415         container, while MethodIsStatic represents the actual code
5416         generated.
5417
5418         * expression.cs (ParameterReference): Use the new MethodIsStatic
5419         instead of IsStatic.
5420
5421         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5422         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5423         set on the current EmitContext. 
5424
5425         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5426         resolve our casted expression as an LValue.  This triggers the
5427         proper LValue processing that is later required by Assign.
5428
5429         This fixes 72347.
5430
5431         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5432
5433 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5434
5435         C# 2.0 Fixed buffer implementation
5436
5437         * anonymous.cs: Update after RegisterHelperClass renaming.
5438
5439         * attribute.cs (AttributeTester.fixed_buffer_cache):
5440         Cache of external fixed buffers.
5441         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5442         implementation if field is fixed buffer else null.
5443
5444         * class.cs
5445         (TypeContainer.AddField): Accept FieldMember instead of Field.
5446         (FieldBase.IsFieldClsCompliant): Extracted code from
5447         VerifyClsCompliance descendant customization.
5448         (FixedField): New class handles fixed buffer fields.
5449         (FixedFieldExternal): Keeps information about imported fixed
5450         buffer.
5451         (IFixedField): Make access to internal or external fixed buffer
5452         same.
5453
5454         * cs-parser.jay: Add fixed buffer parsing.
5455
5456         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5457         buffer.
5458
5459         * expression.cs (Indirection): Extended implementation to accept
5460         fixed buffer field.
5461         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5462         (ElementAccess.MakePointerAccess): Get type as parameter.
5463         (DoResolve): Add fixed buffer field expression conversion.
5464         (DoResolveLValue): Ditto.
5465         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5466         (ArrayPtr): Derives from FixedBufferPtr.
5467         (ArrayPtr.Emit): Add extra emit for array elements.
5468
5469         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5470
5471         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5472         for compiler generated types.
5473         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5474
5475         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5476         and consume less memory.
5477         (Fixed.Resolve): Add fixed buffer case.
5478
5479         * typemanager.cs (compiler_generated_attr_ctor,
5480         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5481         (HasElementType): Add our own implementation to work on every
5482         runtime.
5483
5484 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5485
5486         * anonymous.cs (CaptureContext): Track whether `this' has been
5487         referenced.   
5488
5489         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5490         only captured `this' if it was implicitly done (instance
5491         methods/variables were used). 
5492
5493         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5494         `this' must be captured.
5495
5496 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5497  
5498         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5499         is null it means that there has been no need to capture anything,
5500         so we just create a sibling.
5501
5502         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5503
5504         Just a partial fix.  The other half is fairly elusive.
5505         
5506 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5507
5508         Fix #52586, cs0121-4.cs.
5509         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5510         and return a hashtable.
5511         (MemberCache.ClearDeclaredOnly): New.
5512         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5513         the method_hash of a base type too.
5514         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5515         type methods.  Overwrite entries with the same MethodHandle so
5516         that the ReflectedType is correct.  The process leaves in base
5517         virtual functions and their overrides as distinct entries.
5518         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5519         matters since it was boxed in a ArrayList before.
5520         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5521         modifier.
5522         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5523         case of a virtual function and its override (choose the overload
5524         as better).
5525         (Invocation.OverloadResolve): Avoid 'override' members during
5526         'applicable_type' calculation.
5527
5528 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5529
5530         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
5531         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
5532         GetTypeHandle.  It is possible for a reflected type to derive from
5533         a TypeBuilder (e.g., int[] derives from the TypeBuilder
5534         System.Array during mscorlib compilation).
5535         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
5536         contain a method_hash, don't create one either.  Don't create a
5537         deep copy of the base cache's method_hash.
5538         (MemberCache.SetupCache): Rename back from DeepCopy.
5539         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
5540         already initialized.  If we see an override function, add its
5541         underlying base virtual function to the member_hash too.
5542
5543 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5544
5545         Combine two near-redundant caches.
5546         * typemanager.cs (method_params): Rename from method_internal_params.
5547         (TypeManager.GetParameterData): New.  Replace
5548         Invocation.GetParameterData.
5549         (TypeManager.LookupParametersByBuilder): Remove.
5550         * expression.cs (Invocation.method_parameter_cache): Remove.
5551         (Invocation.GetParameterData): Remove.
5552         Update to changes.
5553         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5554         Update to changes.
5555
5556 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5557
5558         Fix #72015.
5559         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5560         TypeManager.multicast_delegate_type is null, resolve it by looking
5561         up "System.MulticastDelegate".
5562         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5563
5564 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5565             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5566             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5567
5568         Fix cs0164.cs.
5569         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5570         (LabeledStatement.AddReference): New.  Set 'referenced'.
5571         (Goto.Resolve): Use it.
5572
5573 2005-02-05  John Luke  <john.luke@gmail.com>
5574
5575         * driver.cs: remove duplicate -doc line in Usage ()
5576
5577 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5578
5579         * location.cs (Location.AddFile): Fix CS2002 error report.
5580
5581 2005-02-02  Martin Baulig  <martin@ximian.com>
5582
5583         * delegate.cs (Delegate.DefineType): Report an internal error if
5584         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5585         details.        
5586
5587 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5588
5589         Fix a crasher in a variant of #31984.
5590         * const.cs (Constant.CheckBase): New override that defers the
5591         new-or-override check in case the base type hasn't been populated
5592         yet.
5593         (Constant.Define): Ensure the new-or-override check is performed.
5594
5595 2005-02-01  Duncan Mak  <duncan@ximian.com>
5596
5597         * const.cs (LookupConstantValue): Check that `ce' is not null
5598         before calling GetValue ().
5599
5600 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5601
5602         Fix test-334.cs (#69519).
5603         * cs-parser.jay (using_alias_directive): Pass in an expression to
5604         NamespaceEntry.UsingAlias.
5605         (using_namespace_directive): Pass in an expression to
5606         NamespaceEntry.Using.
5607         (namespace_name): Don't flatten to a string.
5608         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5609         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5610         ResolveAsTypeStep.
5611         (NamespaceEntry.UsingEntry): Likewise.
5612         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5613         changes.
5614         (NamespaceEntry.LookupForUsing): Remove.
5615         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5616         names.
5617         (NamespaceEntry.Lookup): Remove support for dotted names.
5618
5619 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5620
5621         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5622         split into two.
5623         (NamespaceEntry.ImplicitParent): Compute on demand.
5624         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5625         parallels the current.
5626         (NamespaceEntry.LookupForUsing): Use it.
5627         (NamespaceEntry.Lookup): If the current namespace-entry is
5628         implicit, don't search aliases and using tables.
5629
5630 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5631
5632         Fix #31984.
5633         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5634         BaseCache here.
5635         (TypeContainer.BaseCache): Compute on demand.
5636         (TypeContainer.FindMembers): Define constants and types if they're
5637         not already created.
5638         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5639         check.
5640         * const.cs (Constant.Define): Make idempotent.
5641
5642 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5643
5644         * pending.cs: Produce better code (no nops produced by using Ldarg
5645         + value).
5646         
5647         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5648         i - 1' it should be arg + 1.
5649
5650         Fixes bug #71819.
5651
5652 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5653
5654         * attribute.cs (Attribute.CheckAttributeType): Make private
5655         non-virtual.
5656         (Attribute.ResolveType): Make virtual.
5657         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5658         handling of RootContext.Tree.Types.
5659
5660 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5661
5662         Update attribute-handling to use the SimpleName/MemberAccess
5663         mechanisms.
5664         * cs-parser.jay (attribute): Pass in an expression to the
5665         constructors of Attribute and GlobalAttribute.
5666         * attribute.cs (Attribute): Take an expression for the name.
5667         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5668         passed in attribute name expression.
5669         (Attribute.CheckAttributeType): Use it.
5670         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5671         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5672         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5673         argument to prevent error messages if the lookup fails.
5674
5675 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5676
5677         * expression.cs (Indirection): Implemented IVariable interface
5678         to support indirection in AddressOf operator.
5679         (PointerArithmetic.Emit): Add optimalization for case where
5680         result can be precomputed.
5681
5682 2005-01-26  Martin Baulig  <martin@ximian.com>
5683
5684         * class.cs (TypeContainer.AttributeTargets): Return the correct
5685         AttributeTargets depending on our `Kind' instead of throwing an
5686         exception; fixes #71632.
5687
5688 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5689
5690         Fix #71257
5691         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5692         constant members.
5693
5694 2005-03-17  Martin Baulig  <martin@ximian.com>
5695
5696         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5697         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5698
5699 2005-03-17  Martin Baulig  <martin@ximian.com>
5700
5701         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5702         to bool so we can return an error condition.
5703         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5704         returned an error.
5705
5706 2005-03-17  Martin Baulig  <martin@ximian.com>
5707
5708         * generic.cs (TypeMananager.IsIEnumerable): New public method.
5709
5710         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
5711         converting from an array-type of T to `IEnumerable<T>'.
5712
5713 2005-03-16  Martin Baulig  <martin@ximian.com>
5714
5715         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
5716         (Nullable.LiftedUnaryMutator): New public class.
5717
5718         * expression.cs (UnaryMutator.DoResolve): Added support for
5719         Nullable Types.
5720
5721 2005-03-14  Martin Baulig  <martin@ximian.com>
5722
5723         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
5724
5725 2005-03-14  Martin Baulig  <martin@ximian.com>
5726
5727         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
5728         the comparision operators `<', `>', `<=' and `>='.
5729
5730 2005-03-13  Martin Baulig  <martin@ximian.com>
5731
5732         * generic.cs
5733         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
5734         avoid confusion with the `NullLiteral'.
5735         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
5736
5737 2005-03-13  Martin Baulig  <martin@ximian.com>
5738
5739         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
5740         comparing arbitrary types with the null literal.
5741
5742 2005-03-13  Martin Baulig  <martin@ximian.com>
5743
5744         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
5745         boolean operators '&&', '||', '&' and '|'.
5746         (Nullable.OperatorTrueOrFalse): New public class.
5747
5748         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
5749         instead of a `StaticCallExpr'; added support for nullables.
5750
5751 2005-03-10  Martin Baulig  <martin@ximian.com>
5752
5753         * expression.cs
5754         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
5755         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
5756
5757 2005-03-07  Martin Baulig  <martin@ximian.com>
5758
5759         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
5760         it work if `expr' is not an IMemoryLocation.
5761         (Nullable.Lifted): Implement IMemoryLocation.
5762         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
5763         target type.
5764
5765 2005-03-05  Martin Baulig  <martin@ximian.com>
5766
5767         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
5768         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
5769         (Nullable): Added support for lifted unary and binary operators.
5770
5771         * expression.cs (Unary.DoResolve): Added support for nullable types.
5772         (Binary.DoResolve): Likewise.
5773         (Conditional.DoResolve): Likewise.
5774
5775 2005-03-02  Martin Baulig  <martin@ximian.com>
5776
5777         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
5778
5779         * class.cs (ClassPart.SetParameterInfo): Override this.
5780         (PartialContainer.SetParameterInfo): Override this.
5781         (TypeContainer.CheckConstraints): New protected method.
5782         (PartialContainer.CheckConstraints): Override this and check
5783         whether the same contraints were specified in all parts of a
5784         partial generic type definition.
5785         (PartialContainer.UpdateConstraints): New public method.
5786
5787         * generic.cs (TypeParameter.UpdateConstraints): New public method.
5788
5789 2005-03-02  Martin Baulig  <martin@ximian.com>
5790
5791         Committing a patch from Carlos Alberto Cortez to fix #72887.
5792
5793         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
5794         casts from `T []' to `int []'.
5795
5796 2005-03-02  Martin Baulig  <martin@ximian.com>
5797
5798         * generic.cs (TypeManager.IsEqual): Make this symmetric.
5799
5800         * expression.cs (Binary.ResolveOperator): When resolving a
5801         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
5802         `=='.  Fixes #71866.  See gen-127.cs.
5803
5804 2005-03-02  Martin Baulig  <martin@ximian.com>
5805
5806         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5807         static constructor in static classes.
5808
5809 2005-03-02  Martin Baulig  <martin@ximian.com>
5810
5811         * generic.cs
5812         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
5813         (Nullable.LiftedConversion): Added support for user-defined
5814         conversions.
5815
5816         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
5817
5818         * cs-parser.jay: Use ComposedCast everywhere instead of
5819         NullableType, so we don't need to check for NullableType
5820         everywhere.
5821         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
5822         case where we'll be resolved into a `parenthesized_expression_0'
5823         afterwards.
5824
5825         * convert.cs
5826         (Convert.UserDefinedConversion): Added nullable conversions.
5827
5828 2005-02-28  Martin Baulig  <martin@ximian.com>
5829
5830         * generic.cs (TypeManager.IsNullableType): New static method.
5831         (Nullable): New abstract class.
5832         (Nullable.NullLiteral): New public class.
5833         (Nullable.LiftedConversion): New public class.
5834
5835         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
5836         `builtin_types opt_nullable'.
5837
5838         * convert.cs
5839         (Convert.ImplicitConversionStandard): Added nullable conversions.
5840         (Convert.ExplicitConversionStandard): Likewise.
5841         (Convert.ExplicitConversion): Likewise.
5842
5843 2005-02-26  Martin Baulig  <martin@ximian.com>
5844
5845         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
5846         begin with a "?", for instance "?[]".  Don't do a type lookup if
5847         `dim' is empty.
5848
5849 2005-02-25  Martin Baulig  <martin@ximian.com>
5850
5851         The first part of Nullable Types :-)
5852
5853         * generic.cs (NullableType): New public class.
5854         (NullCoalescingOperator): New public class.
5855         (TypeArguments.Resolve): Add a CS0306 check.
5856
5857         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
5858         (opt_nullable): New rule.
5859         (type): Added `opt_nullable' to `namespace_or_type_name',
5860         `builtin_types' and `pointer_type'.
5861         (array_type): Added `opt_nullable'.
5862         (opt_rank_specifier_or_nullable): New rule; this is the
5863         combination of `opt_rank_specifier' and `opt_nullable'.
5864         (opt_error): New rule; catch errors here.
5865         (nullable_type_or_conditional): New rule; we use this to check for
5866         nullable and still detect the conditional operator.
5867         (local_variable_type): Use `opt_rank_specifier_or_nullable'
5868         instead `opt_rank_specifier'.
5869
5870         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
5871         for nullables.
5872
5873 2005-02-24  Martin Baulig  <martin@ximian.com>
5874
5875         * README, README.Changes: Removed; they're old and obsolete.
5876
5877 2005-02-22  Martin Baulig  <martin@ximian.com>
5878
5879         * generic.cs (TypeParameter.Resolve): If resolving the constraints
5880         returned an error, set `constraints' to null to avoid a crash
5881         later on.
5882         (TypeParameter.ResolveType): Likewise.
5883
5884 2005-02-22  Martin Baulig  <martin@ximian.com>
5885
5886         * generic.cs
5887         (Constraints.ResolveTypes): Protect against being called twice.
5888         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
5889         (TypeParameter.ResolveType): New public method; calls
5890         constraints.ResolveTypes().
5891         (TypeParameter.DefineType): Moved constraints.ResolveType() out
5892         into the new ResolveType().
5893         (GenericMethod.Define): Call ResolveType() on all our
5894         TypeParameter's.        
5895
5896 2005-02-21  Martin Baulig  <martin@ximian.com>
5897
5898         * generic.cs
5899         (TypeManager.generic_nullable_type): New static public field.
5900         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
5901
5902         * rootcontext.cs
5903         (RootContext.ResolveCore): Resolve "System.Nullable`1".
5904
5905 2005-02-15  Martin Baulig  <martin@ximian.com>
5906
5907         * generic.cs (ConstructedType.Constraints): Correctly check
5908         constraints if the argument type is a type parameter; fixes
5909         #72326. 
5910
5911 2005-02-02  Martin Baulig  <martin@ximian.com>
5912
5913         * delegate.cs (Delegate.DefineType): Report an internal error if
5914         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5915         details.        
5916
5917 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5918
5919         * pending.cs: Produce better code (no nops produced by using Ldarg
5920         + value).
5921         
5922         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5923         i - 1' it should be arg + 1.
5924
5925         Fixes bug #71819.
5926         
5927 2005-01-26  Martin Baulig  <martin@ximian.com>
5928
5929         * cs-parser.jay (indexer_declarator): Don't report an error if we
5930         have type parameters since we can be an explicit interface
5931         implementation; fixes #71449.
5932
5933 2005-01-26  Martin Baulig  <martin@ximian.com>
5934
5935         * class.cs (TypeContainer.AttributeTargets): Return the correct
5936         AttributeTargets depending on our `Kind' instead of throwing an
5937         exception; fixes #71632.
5938
5939 2005-01-26  Martin Baulig  <martin@ximian.com>
5940
5941         * delegate.cs (Delegate.DefineType): Correctly define our type
5942         parameters.  Fixes #71483.
5943
5944 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5945
5946         Fix #71602.
5947         * expression.cs (MemberAccess.DoResolve): Don't complain with
5948         cs0572 when the LHS of a member access has identical name and type
5949         name.
5950
5951 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5952
5953         Fix #71651, #71675
5954         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5955         CreatePermission.
5956         Create custom PermissionSet only for PermissionSetAttribute.
5957
5958 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5959
5960         Fix #71649
5961         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5962         delegates in static class.
5963
5964 2005-01-24  Martin Baulig  <martin@ximian.com>
5965
5966         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5967         merging an implicit block, just use its reachability.
5968
5969         * statement.cs (Block.Resolve): Make the unreachable code check
5970         work wrt. implicit blocks; see test-337 from #63842.
5971
5972 2005-01-21  Alp Toker  <alp@atoker.com>
5973  
5974         * cs-parser.jay: destructor_declaration's container is PartialContainer
5975         not Class when partial types are used, so use Kind prop instead of
5976         'is'.
5977         
5978 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5979
5980         * cs-parser.jay: Improve error reporting when an interface
5981         declares new types.
5982
5983 2005-01-20  Dick Porter  <dick@ximian.com>
5984
5985         * support.cs: SeekableStreamReader fix from Sandor Dobos
5986         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5987         chars are read.  Fixes bug 70369.
5988
5989 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5990
5991         * cs-parser.jay (catch_clause): Simplify current_block handling
5992         somewhat.
5993
5994 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5995
5996         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5997         code with ImplicitStandardConversion to handle the implicit
5998         conversion of method groups into valid delegate invocations. 
5999
6000         The problem is that in parameter handling we were using this code
6001         path.  Fixes bug #64698
6002
6003 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6004
6005         * cs-parser.jay: Fix several infelicities.
6006         - Avoid assigning to the parser value stack.  Code like 
6007           '$3 = null' is unclean.  Synthesize a value for the code block
6008           instead. 
6009         - Avoid using oob_stack for storing location information.  Use ...
6010         (_mark_): ... this.  New (empty) rule.  Saves the current location
6011         in $$.
6012         (foreach_statement): Avoid using oob_stack for current_block
6013         handling.  Use technique used in for_statement and
6014         using_statement.  Synthesize a value for the code block to store
6015         additional intermediate information.
6016
6017 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6018
6019         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6020         of a different type is only allowed to private fields of a
6021         containing type, not on fields of a base class.
6022
6023         See test-174.cs and error cs0122-9.cs
6024
6025 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6026
6027         Fix test-335.cs (bug #58126).
6028         * cs-parser.jay (argument): Split out non-expression parts of the
6029         rule into 'non_simple_argument'.
6030         (invocation_expression): Support parenthesized invocations with
6031         multiple arguments, and with single non-simple arguments.
6032
6033 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6034
6035         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6036         places.
6037
6038 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6039
6040         Fix cs0038-1.cs, cs1640-6.cs.
6041         * ecore.cs (Expression.Resolve): Remove special-case for
6042         SimpleName in error-handling.
6043         (Expression.almostMatchedMembers): Relax access permission to
6044         protected.
6045         (Expression.MemberLookupFailed): Handle duplicates in
6046         almostMatchedMembers list.
6047         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6048         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6049         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6050         overload if the passed in MemberInfo is a MethodBase.
6051
6052 2005-01-25  Martin Baulig  <martin@ximian.com>
6053
6054         * doc.cs
6055         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6056
6057 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6058
6059         Fix #70749
6060         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6061         for non-CAS & merge permission sets properly.
6062
6063 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6064
6065         Improve standard-compliance of simple name and member access 
6066         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6067         * ecore.cs (FullNamedExpression): New abstract base class 
6068         for Namespaces and TypeExpressions.
6069         (ResolveFlags.SimpleName): Remove.
6070         (SimpleName): Remove support for dotted names.
6071         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6072         DeclSpace.FindType and DeclSpace.LookupType.
6073         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6074         (Expression.ExprClassName): Make member function.
6075         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6076         a namespace.  Remove creation of dotted "SimpleName"s.
6077         (MemberAccess.DoResolve): Likewise.
6078         * decl.cs (DeclSpace.Cache): Make private.
6079         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6080         (DeclSpace.FindType): Update.
6081         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6082         FullNamedExpression.
6083         * namespace.cs (Namespace): Derive from FullNamedExpression
6084         so that it can be part of expression resolution.
6085         (Namespace.Lookup): Return an FullNamedExpression.
6086         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6087         namespace.
6088         * rootcontext.cs (NamespaceLookup): Remove.
6089         (LookupType): Move to DeclSpace.
6090         * attribute.cs (CheckAttributeType): Update.
6091         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6092         (FindDocumentedTypeNonArray): Likewise.
6093
6094 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6095
6096         Fix cs0509.cs, cs1632.cs.
6097         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6098         is the same as IsInterface.
6099         (TypeContainer.GetClassBases): Likewise.
6100         * statement.cs (LabeledStatement.ig): New field.
6101         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6102         label.
6103         (LabeledStatement.DoEmit): Check that the label was created with
6104         the same ILGenerator.
6105
6106 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6107
6108         Fix #71058
6109         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6110         accessors to its properties.
6111
6112         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6113         from accessors to property.
6114         
6115 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6116
6117         Fix #70722
6118         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6119         only for overrides.
6120         
6121 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6122
6123         * attribute.cs: Check for null and empty strings.  
6124
6125         I have lost another battle to Paolo.
6126
6127 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6128
6129         Fix #70942
6130         * class.cs (PropertyMethod): Set Parent field in ctors.
6131         (SetMethod.InternalParameters): Add unsafe switch hack.
6132         Override MarkForDuplicationCheck where it is appropriate.
6133
6134         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6135         It says whether container allows members with the same name.
6136         Base default is no.
6137         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6138         Removed is_method parameter.
6139
6140 2005-01-06  Duncan Mak  <duncan@ximian.com>
6141
6142         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6143         because the previous change led to incorrect reporting of CS1032
6144         ("Cannot define/undefine preprocessor symbols after first token in
6145         file"). Instead of using `tokens_seen' as the only flag that
6146         triggers CS1040, introduce `comments_seen'. This new flag is used
6147         to signify having seen comments on the current line, so it is
6148         unset after a newline.
6149
6150 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6151
6152         * doc.cs : When searching for a type, find nested type too.
6153           This fixes bug #71040.
6154
6155 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6156
6157         * doc.cs :
6158           - Warn missing member comment on those classes which also does not
6159             have doc comments. Fixed bug #71041.
6160           - Don't warn missing doc comment on default constructor.
6161             Fixed bug #71042.
6162
6163 2005-01-06  Duncan Mak  <duncan@ximian.com>
6164
6165         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6166         comments, set `tokens_seen' to true. This allows us to detect
6167         misplaced preprocessor directives (i.e. not at the beginning of
6168         the a line, nor after whitespaces). In that case, report error
6169         CS1040. This fixes bug #56460.
6170
6171         * cs-parser.jay (interface_member_declaration): Add checks for
6172         IsExplicitImpl, and report CS0541 error if an interface member is
6173         defined as an explicit interface declaration.
6174
6175 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6176
6177         Fix #70817
6178         * class.cs (PropertyMethod): Set Parent field in ctors.
6179         (SetMethod.InternalParameters): Add unsafe switch hack.
6180         
6181         * decl.cs (MemberCore.Parent): Cannot be readonly.
6182
6183 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6184
6185         * decl.cs (DeclSpace.ResolveType): Remove.
6186         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6187         Merge in code from ...
6188         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6189         * class.cs, enum.cs: Update to changes.
6190
6191 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6192
6193         * anonymous.cs: Ensure that we init the scope of our parent if it
6194         has not been initialized yet.
6195
6196 2004-12-30  Duncan Mak  <duncan@ximian.com>
6197
6198         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6199         if field.FieldBuilder is null. Fixes #70758.
6200
6201         * convert.cs: Fixed some typos and updated some of the comments.
6202         (ImplicitStandardConversionExists):
6203         (TryImplicitIntConversion): If `target_type' is an interface and
6204         the type of `ic' implements this interface, return true or a new
6205         BoxedCast instead of null. This fixes #70468.
6206
6207 2004-12-29  Duncan Mak  <duncan@ximian.com>
6208
6209         * expression.cs (Argument.Emit): Check that Expr is
6210         IMemoryLocation before casting to it, and report CS1510 otherwise.
6211
6212         This fixes #70402.
6213
6214 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6215
6216         * statement.cs (Block.ThisVariable): remove the recursion here, to
6217         make the --profile more sane.
6218
6219 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6220
6221         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6222         assembly, by JB Evain.
6223
6224 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6225
6226         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6227           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6228         "parent" refers to enclosing type/class.  "base" refers to superclass.
6229
6230 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6231
6232         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6233         Ensure that we only have GlobalAttributes.
6234         * attribute.cs (Attribute.Emit): Make non-virtual.
6235         (GlobalAttribute.Emit): Remove.
6236         (Attribute.Resolve): Make virtual.
6237         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
6238         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
6239         the argument. Don't create one.
6240         (Attribute.GetObsoleteAttribute): Likewise.
6241         (Attribute.GetClsCompliantAttributeValue): Likewise.
6242         * class.cs, decl.cs: Update to changes.
6243
6244 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
6245
6246         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
6247         
6248         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
6249         
6250         * statement.cs (Foreach.Resolve): Add error 186 report.
6251
6252 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
6253
6254         * expression.cs (Conditional.DoResolve): Add warning 429.
6255         
6256         * statement.cs (If.Resolve): Add warning 665.
6257
6258 2004-12-16  Raja R Harinath  <rharinath@novell.com>
6259
6260         New invariant: RootContext.Tree.Types.NamespaceEntry == null
6261         except when in the parser, and in GlobalAttribute.
6262         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
6263         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
6264         RootContext.Tree.Types.NamespaceEntry once work is done.
6265         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
6266         and resets RootContext.Tree.Types.NamespaceEntry.
6267
6268 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
6269
6270         * cs-parser.jay: Don't create a block for every variable.
6271
6272 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
6273
6274         * location.cs: Provide extra information.
6275
6276         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
6277         variables from the captured environment, it is the ldarg_0.
6278
6279 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6280
6281         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
6282         find a conclusion.
6283         
6284         * class.cs: Changed warning level for 169 to avoid developer
6285         displeasure from warning flooding. It will be changed back when they
6286         fix most of current BCL warnings.
6287         
6288         * RootContext.cs: Pushed default WarningLevel to 3.
6289         
6290         * statement.cs: Removed unused variable.
6291
6292 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
6293
6294         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
6295         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
6296         Add error 502 report.
6297         (StaticClass.DefineType): Add error 441 report.
6298         (Class.AllowedModifiersProp): New virtual property as temporary
6299         extension to AllowedModifiers.
6300         (Class.DefineType): Add error 418 report. Moved ModFlags check here
6301         to share implementation with StaticClass and don't call virtual
6302         methods from ctor.
6303         
6304         * driver.cs (MainDriver): Add error 1558 test.
6305
6306         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
6307         report. Moved error 36 test here.
6308
6309         * statement.cs (Throw.Resolve): Add error 724 report.
6310
6311         * typemanager.cs: Add out_attribute_type core type.
6312         
6313 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
6314
6315         * class.cs (TypeContainer.VerifyClsCompliance): Add error
6316         3018 report.
6317         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
6318
6319         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
6320         3017 report.
6321         
6322         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
6323
6324         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
6325         Add error 3023 report.
6326         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
6327
6328         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
6329         implementation.
6330
6331 2004-12-12  John Luke  <john.luke@gmail.com>
6332
6333         * driver.cs (AddArgs): take -- into account when
6334         adding arguments, fixes bug 65710 
6335
6336 2004-12-12  Martin Baulig  <martin@ximian.com>
6337
6338         * expression.cs (Unary.TryReduceNegative): Added support for
6339         SByteConstant and ByteConstant.
6340         (Unary.Reduce): Check error values from TryReduceNegative().
6341
6342 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
6343
6344         * attributes.cs (Attribute.Resolve): Avoid multiple error report
6345         and report exception as error 182.
6346
6347 2004-12-10  Raja R Harinath  <rharinath@novell.com>
6348
6349         * driver.cs (Main): Fix message when there are warnings.
6350
6351 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
6352
6353         * delegate.cs: Fixed my fix from yesterday, sorry about that.
6354
6355 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
6356
6357         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
6358         Reduced number of warnings.
6359         
6360         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
6361
6362 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
6363
6364         * driver.cs: Removed message.
6365
6366         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
6367
6368 2004-12-08    <vargaz@freemail.hu>
6369
6370         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
6371
6372 2004-12-08  Martin Baulig  <martin@ximian.com>
6373
6374         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6375         instead of a CS3002 for properties and indexer.
6376
6377 2004-12-08  Martin Baulig  <martin@ximian.com>
6378
6379         * decl.cs (MemberName.ToString): Make this work again.
6380
6381 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
6382
6383         * attribute.cs (Resolve): Add error 591 detection.
6384
6385         * class.cs (FieldMember.Define): Add error 1547 detection.
6386         (Indexer.Define): Add error 620 detection.
6387         (Operator.Define): Add error 590 detection.
6388
6389         * ecore.cs: Missing argument for error 79.
6390
6391         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
6392         detection.
6393
6394 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
6395
6396         Fix #70106
6397         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
6398         only.
6399
6400 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6401
6402         * cs-parser.jay : handle doc comments on implicit/explicit operators.
6403           Some operator comments were suppressed.
6404         * doc.cs : Implicit/explicit operator name in doc comments are like
6405           "op_Explicit(type)~returnType", so added suffix handling.
6406
6407 2005-01-21  Alp Toker  <alp@atoker.com>
6408
6409         * cs-parser.jay: destructor_declaration's container is PartialContainer
6410         not Class when partial types are used, so use Kind prop instead of 'is'.
6411
6412 2004-12-12  Martin Baulig  <martin@ximian.com>
6413
6414         * expression.cs (Unary.TryReduceNegative): Added support for
6415         SByteConstant and ByteConstant.
6416         (Unary.Reduce): Check error values from TryReduceNegative().
6417
6418 2004-12-11  Martin Baulig  <martin@ximian.com>
6419
6420         * support.cs (ReflectionParameters.ParameterName): If we have a
6421         `gpd', call `ParameterName' on it.
6422
6423         * parameter.cs (Parameter.GetParameterAttributes): New static method.
6424
6425         * pending.cs (PendingImplementation.DefineProxy): Call
6426         DefineParameter() for all of the MethodBuilder's arguments.
6427
6428 2004-12-09  Martin Baulig  <martin@ximian.com>
6429
6430         * doc.cs (DocUtil): Make this a static class.
6431
6432 2004-12-09  Martin Baulig  <martin@ximian.com>
6433
6434         * expression.cs (Invocation.InferType): Moved the type inference
6435         implementation into TypeManager.
6436
6437         * generics.cs (TypeManager): Moved the type inference
6438         implementation here.
6439
6440 2004-12-09  Martin Baulig  <martin@ximian.com>
6441
6442         * typemanager.cs (TypeManager): Make this a partial class.
6443
6444         * generics.cs
6445         (TypeManager): Move the generics part of `TypeManager' here.
6446
6447 2004-12-08  Martin Baulig  <martin@ximian.com>
6448
6449         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
6450         instead of a CS3002 for properties and indexer.  Added CS3024
6451         check for generic interfaces.
6452
6453         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
6454         instances are not CLS-compliant.
6455
6456 2004-12-08  Martin Baulig  <martin@ximian.com>
6457
6458         * cs-parser.jay
6459         (void_pointer_expression): New rule for `void*', `void**' etc.
6460         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
6461
6462 2004-12-08  Martin Baulig  <martin@ximian.com>
6463
6464         * expression.cs (Invocation.InferType): Removed the hack for
6465         MethodCore.MayUnify().  
6466
6467         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
6468         this actually work.
6469
6470         * class.cs (MethodCore.MayUnify): Use
6471         TypeManager.MayBecomeEqualGenericTypes().       
6472
6473 2004-12-08  Martin Baulig  <martin@ximian.com>
6474
6475         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
6476         parameter, box it.  Fixes #69233.
6477
6478 2004-12-08  Martin Baulig  <martin@ximian.com>
6479
6480         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
6481         have the ctor constraint.  Fixes #68326.
6482
6483 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
6484
6485         * cs-parser.jay : interface comment was not consumed because of
6486           extra opt_semicolon before doc handling.
6487
6488 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6489
6490         Fix test-327.cs, test-328.cs, and put in early infrastructure
6491         for eventually fixing #52697.
6492         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6493         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6494         from other methods.
6495         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6496         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6497         (VerifyUsing, error246): Update.
6498         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6499         'NamespaceEntry.LookupNamespaceOrType'.
6500
6501 2004-12-07  Martin Baulig  <martin@ximian.com>
6502
6503         * driver.cs: Call it "BETA SOFTWARE" :-)
6504
6505 2004-12-06  Raja R Harinath  <rharinath@novell.com>
6506
6507         Fix crash on cs0657-17.cs.
6508         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6509         Use RootContext.Tree.Types, not 'new RootTypes ()'.
6510         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
6511         the case where the NamespaceEntry gets overwritten.
6512
6513 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
6514
6515         Fixed #69195, #56821
6516         * ecore.cs (ResolveBoolean): Tiny refactoring.
6517
6518         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
6519         of right expression resolving when left is false constant and
6520         operator is LogicalAnd OR true constant and operator is LogicalOr.
6521
6522         * statement.cs (ResolveUnreachable): Always reports warning.
6523
6524 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
6525
6526         * class.cs: Distinguish between 1721 and 1722 (just a little help
6527         for the programmer).
6528
6529 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6530
6531         * delegate.cs: Only allow this on new versions of the language. 
6532
6533 2004-12-02  Duncan Mak  <duncan@ximian.com>
6534
6535         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6536         Expression class.
6537         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6538         here as a static method. Take an additional bool out parameter
6539         `must_do_cs1540_check' for signaling to InstanceResolve.
6540         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6541         member field from PropertyExpr class and made it an argument of
6542         the method instead.
6543         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6544         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6545         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6546         and `remove_accessor' as well as InstanceResolve: report CS0122
6547         where applicable.
6548
6549         Fixes #70129.
6550
6551 2004-12-07  Martin Baulig  <martin@ximian.com>
6552
6553         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
6554         and CS0692 where appropriate.
6555
6556 2004-12-06  Martin Baulig  <martin@ximian.com>
6557
6558         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
6559         IsDuplicateImplementation() and improved it.
6560
6561         * expression.cs (Invocation.InferTypeArguments): Added
6562         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
6563         and removed the "ref" modifier from `infered_types'.
6564
6565         * decl.cs (MemberName.ToString): Removed the exception.
6566
6567 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6568
6569         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6570           comments are allowed.
6571
6572 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6573
6574         * delegate.cs: Add checks for subtypes in paramaters and return values
6575         in VerifyMethod () to add support for Covariance/Contravariance
6576         in delegates.
6577         
6578 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6579
6580         * report.cs: Remove extra closing parenthesis.
6581
6582         * convert.cs (Error_CannotImplicitConversion): If the name of the
6583         types are the same, provide some extra information.
6584
6585 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6586
6587         Fix bug #70102
6588         * attribute.cs (Resolve): Improved implementation of params
6589         attribute arguments.
6590
6591         * support.cs (ParameterData): Add HasParams to be faster.
6592
6593 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6594
6595         all things are for /doc support:
6596
6597         * doc.cs: new file that supports XML documentation generation.
6598         * mcs.exe.sources: added doc.cs.
6599         * driver.cs:
6600           Handle /doc command line option.
6601           Report error 2006 instead of 5 for missing file name for /doc.
6602           Generate XML documentation when required, after type resolution.
6603         * cs-tokenizer.cs:
6604           Added support for picking up documentation (/// and /** ... */),
6605           including a new XmlCommentState enumeration.
6606         * cs-parser.jay:
6607           Added lines to fill Documentation element for field, constant,
6608           property, indexer, method, constructor, destructor, operator, event
6609           and class, struct, interface, delegate, enum.
6610           Added lines to warn incorrect comment.
6611         * rootcontext.cs :
6612           Added Documentation field (passed only when /doc was specified).
6613         * decl.cs:
6614           Added DocComment, DocCommentHeader, GenerateDocComment() and
6615           OnGenerateDocComment() and some supporting private members for
6616           /doc feature to MemberCore.
6617         * class.cs:
6618           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6619         * delegate.cs:
6620           Added overriden DocCommentHeader.
6621         * enum.cs:
6622           Added overriden DocCommentHeader and GenerateDocComment().
6623
6624 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6625
6626         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6627         unwrapping the enumeration values, chain to
6628         DoConstantNumericPromotions again, so we can promote things to the
6629         fundamental types (takes care of enums that are bytes, sbytes).
6630
6631         Fixes bug #62054.
6632
6633 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6634
6635         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6636         Fix long-standing bug in type-lookup.  Use FindType instead of
6637         LookupType when ec.ResolvingTypeTree.
6638         (Attribute.ResolveType, Attribute.Resolve)
6639         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6640         Update to changes.
6641         (Attributes.Search): Remove internal version.  Update.
6642         (Attributes.SearchMulti): Update.
6643         (Attributes.GetClsCompliantAttribute): Remove.
6644         (Attributes.GetIndexerNameAttribute): Remove.
6645         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6646         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6647         * class.cs (Indexer.Define): Likewise.
6648
6649 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6650
6651         Fix bug #68790
6652         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6653         MarshallByReference members access.
6654
6655         * expression.cs: Use CheckMarshallByRefAccess;
6656         Better error CS0197 message.
6657
6658         * report.cs: Print whole related error message.
6659
6660 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6661
6662         * class (GetClassBases): Better error 60 report.
6663         (EventProperty): Disabled warning 67 detection.
6664
6665 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6666
6667         Fix bug #60324
6668         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6669
6670         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6671         precise values.
6672
6673 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6674
6675         Fix bug #49488
6676         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6677
6678         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6679
6680 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6681
6682         * attribute.cs (Attribute.Resolve): Refine error reporting and
6683         report a cs0117 if the identifier does not exist, to distinguish
6684         from 0617 which is a miss-use of the actual identifier.
6685
6686         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6687         between cs0070 and cs0079.
6688
6689         * class.cs (MemberBase.DoDefine): When reporting a wrong
6690         accessibility level, we use MethodCore to compare instead of
6691         Method (this was a regression in some refactoring effort).
6692
6693         So now we correctly report cs0056 again.
6694
6695         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6696         testing the target_type (which was known to be object_type) and
6697         not the source type (which is anonymous_method).
6698
6699         Fixed reporting of error cs1660.
6700
6701         * expression.cs (UserCast.Source): Expose the underlying cast.
6702
6703         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6704         allowed types to find a match to int32 first (most common).
6705
6706         In addition, it ignores any ImplicitUserConversions that did an
6707         internal implicit conversion (as the switch statement allows only
6708         one integral conversion to exist).
6709
6710         * class.cs (PartialContainer.Create): rename `name' to
6711         `member_name' for clarity.  Then replace the string calls with a
6712         call to MemberName.GetPartialName, as now using
6713         MemberName.ToString is an error (this is due to the side effects
6714         it had, that were fixed in the past).
6715
6716         This will restore the error reporting on a number of partial class
6717         errors that were missusing this (and getting an exception as a
6718         results, which is now just a plain textual warning, because
6719         yyparse debug output would crash otherwise).
6720
6721 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6722
6723         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6724
6725 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6726
6727         * rootcontext.cs (LookupType): Make sure to cache lookups that
6728         don't give us a negative result. This saves about 5% of corlib
6729         compilation time.
6730
6731 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6732
6733         * report.cs (AbstractMessage.Print): messages are sent to stderr
6734
6735         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6736         non-interface in the list of interfaces (at this point, either
6737         parent was properly set, or a base class is being listed in the
6738         interfaces section).
6739
6740         This flags error 1722, and resolves the crash from bug 69259.
6741
6742 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6743
6744         * statement.cs (Using.EmitExpressionFinally): make this work right
6745         for valuetypes. Fixes 69926.
6746
6747 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6748
6749         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6750         converted to an enum" here, before we try to change the underlying
6751         type.  This code exists, but it is a different code path than the
6752         one used while encoding constants.
6753
6754         (ImplicitReferenceConversionExists): In addition, resynchronized
6755         the code here, so it matches the same code in
6756         ImplicitReferenceConversionExists for the `from any class-type S
6757         to any interface-type T'.       
6758
6759 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6760
6761         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6762
6763 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6764
6765         * cs-parser.jay: Use verbosity accordingly. 
6766
6767 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6768
6769         * expression.cs (Unary.ResolveOperator): Do not report warning;
6770         AddressOf reads from variable.
6771         
6772         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6773
6774 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6775
6776         Fix bug #69462
6777
6778         * attribute.cs (Attributable): Removed CheckTargets.
6779         (Attributes.Emit): Explicit attribute targets are tested here.
6780
6781         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6782         not enabled for interfaces.
6783
6784         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6785         (GetAssemblyName): Ouch next bug there.
6786
6787 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6788
6789         * expression.cs: Error 275 added.
6790         
6791 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6792
6793         Fix bug #69177 (Implemented decimal constant support)
6794
6795         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6796         (BinaryFold): Add DecimalConstant.
6797
6798         * const.cs (Define): Decimal constant 
6799         (is not constant.
6800         (ChangeType): Add decimal type handling.
6801         (LookupConstantValue): Don't set value for decimal type but
6802         emit DecimalConstantAttribute. Needed for constant optimization.
6803
6804         * constant.cs (ToDecimal): New method.
6805         (ConvertToDecimal): New method.
6806         (IntConstant): Implemented ConvertToDecimal.
6807         (DecimalConstant.Emit): Emit optimized version for decimals in
6808         int range.
6809
6810         * expression.cs (ResolveOperator): Changed order of constant
6811         reduction to work correctly with native types which have
6812         overloaded operators.
6813         (ResolveMemberAccess): Extract constant value from attribute
6814         for decimal type.
6815
6816         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6817
6818         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6819         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6820         (ChangeType): Decimal is special.
6821         (TypeToCoreType): Add decimal type.
6822
6823 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6824
6825         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6826         decimal types.
6827
6828 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6829
6830         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6831         test cs1667-5.cs.
6832
6833 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6834
6835         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6836
6837         * pending.cs (PendingImplementation): Grab only interfaces.
6838
6839 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6840
6841         * statement.cs (ForeachHelperMethods): Add location member and
6842         error 202 detection.
6843
6844 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6845
6846         * expression.cs (DoResolveBase): Fixed wrong warning for out
6847         variables.
6848
6849 2004-12-04  Martin Baulig  <martin@ximian.com>
6850
6851         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
6852         to check whether the conversion is ok.
6853
6854         * typemanager.cs (TypeManager.GetTypeArguments): Just return
6855         `Type.EmptyTypes' if we're not a generic TypeContainer.
6856
6857 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6858
6859         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6860         old bug: when converting from the null literal to a pointer,
6861         return an EmptyCast, not the NullLiteral.
6862
6863         This fixes #69921, the recent null_type changes probably made this
6864         bug more prominent.
6865
6866 2004-12-03  Martin Baulig  <martin@ximian.com>
6867
6868         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6869         method as our child, call AnonymousMethod.Compatible() on it.
6870
6871 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6872
6873         * class.cs (FieldBase): Use an unused bit field from the field to
6874         encode the `has_offset' property from the FieldMember.  This saves
6875         a couple of Ks on bootstrap compilation.
6876
6877         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6878         method as our child, return the AnonymousMethod resolved
6879         expression.
6880
6881         * expression.cs (New.DoResolve): Allow return values from
6882         NewDelegate to also include AnonymousMethods.
6883
6884         Fixes #70150.
6885
6886 2004-11-29  Raja R Harinath  <rharinath@novell.com>
6887
6888         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
6889         cs1648 report.
6890         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
6891         System.Runtime.InteropServices._Exception, since it's a base
6892         interface of the core type System.Exception in the net_2_0 profile.
6893
6894 2004-11-27  Martin Baulig  <martin@ximian.com>
6895
6896         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
6897
6898 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6899
6900         * Makefile: Convert to use executable.make.
6901         * gmcs.exe.sources: New.
6902
6903 2004-11-25  Martin Baulig  <martin@ximian.com>
6904
6905         * expression.cs (Invocation.InferType): Added support for byref types.
6906
6907 2004-11-25  Martin Baulig  <martin@ximian.com>
6908
6909         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
6910         in TypeManager.TypeToCoreType().
6911
6912 2004-11-25  Martin Baulig  <martin@ximian.com>
6913
6914         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
6915         "Dispose" method from the `current_type'.
6916         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
6917         DoDefineMembers() instead of using the MethodBuilder; this is
6918         required for generic iterators.
6919
6920         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
6921
6922 2004-11-24  Martin Baulig  <martin@ximian.com>
6923
6924         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
6925
6926 2004-11-20  Martin Baulig  <martin@ximian.com>
6927
6928         * expression.cs (Invocation.InferType): Correctly infer generic
6929         instances; see gen-103.cs.
6930         (Invocation.InferTypeArguments): If a generic method doesn't have
6931         any unbound type parameters, we don't need to infer anything.
6932
6933 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6934
6935         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
6936
6937 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6938
6939         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6940         (TypeHandle.GetMemberCache): New.
6941         (TypeHandle.TypeHandle): Update.
6942         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6943         (TypeManager.LookupParentInterfacesCache):
6944         Rename from LookupInterfaceCache.  Optimize slightly.
6945         (TypeManager.MemberLookup_FindMembers): Update.
6946         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6947         multi-type variant.
6948         (AddCacheContents): Rename from AddHashtable.
6949         * class.cs (TypeContainer.parent_container): Remove.
6950         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6951         (TypeContainer.DoDefineMembers): Don't initialize it.
6952         Update to name changes.
6953         
6954 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6955
6956         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6957         that factors the code to check access modifiers on override.  
6958
6959         (PropertyBase): Use the code here.
6960
6961         Patch from Lluis S'anchez, fixes bug #69361.
6962
6963 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6964
6965         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6966         routine that is used to report the use of a captured variable
6967         whose address has been taken.
6968
6969         There are two checks: one when variables are being captured and
6970         the other check is when the address of a variable is taken. 
6971         
6972         (because an anonymous methods might be resolved before *or* after
6973         the address has been taken) and 
6974
6975         * expression.cs (Conditional.DoResolve): Remove the special
6976         casing that Martin added to trueExpr and falseExpr being both
6977         NullLiteral.  We get the right behavior now just by introducing
6978         the null_type into the compiler. 
6979
6980         * convert.cs (ExplicitConversion): Change the code to use
6981         null_type instead of testing `expr is NullLiteral'.
6982         (ImplicitConversionStandard): use null_type too.
6983         (ImplicitReferenceConversionExists): use null_type too.
6984         (ImplicitReferenceConversion): use null_type too.
6985
6986         * literal.cs: The type of `NullLiteral' is now null_type instead
6987         of object_type. 
6988         (Resolve): Set the type here.
6989
6990         * typemanager.cs: Introduce null_type.
6991
6992 2004-11-18  Martin Baulig  <martin@ximian.com>
6993
6994         * rootcontext.cs
6995         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
6996
6997 2004-11-18  Martin Baulig  <martin@ximian.com>
6998
6999         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7000
7001 2004-11-18  Martin Baulig  <martin@ximian.com>
7002
7003         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7004         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7005         call ResolveConstructedType() on it to resolve it without checking
7006         constraints.
7007         (Constraints.ResolveTypes): Check them here.
7008         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7009         but don't check constraints.
7010         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7011         check constraints here.
7012         (ConstructedType.ResolveConstructedType): New public method.  This
7013         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7014         resolve ourselves without checking constraints.
7015
7016         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7017
7018 2004-11-18  Martin Baulig  <martin@ximian.com>
7019
7020         * decl.cs
7021         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7022
7023         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7024
7025 2004-11-18  Martin Baulig  <martin@ximian.com>
7026
7027         * ecore.cs (TypeExpr.ResolveType): Removed.
7028         (Expression.ResolveAsTypeTerminal): We always return a fully
7029         resolved `TypeExpr', so we can just access its `Type'.
7030
7031         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7032
7033 2004-11-17  Martin Baulig  <martin@ximian.com>
7034
7035         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7036         sure we don't return any unresolved TypeExpr's.
7037         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7038         a `TypeExpr'.
7039         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7040
7041         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7042         unresolved `ConstructedType's.
7043
7044 2004-11-17  Martin Baulig  <martin@ximian.com>
7045
7046         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7047
7048 2004-11-17  Martin Baulig  <martin@ximian.com>
7049
7050         * ecore.cs
7051         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7052
7053         * decl.cs (DeclSpace.ResolveType): Removed.
7054         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7055
7056 2004-11-17  Martin Baulig  <martin@ximian.com>
7057
7058         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7059         direction, like FindMembers() does.  Fixes #69546, testcase is in
7060         test-315.cs.    
7061
7062 2004-11-16  Martin Baulig  <martin@ximian.com>
7063
7064         This is based on a patch from Marek Safar, see bug #69082.
7065         Fixes bugs #63705 and #67130.
7066
7067         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7068         method; create a MemberCache for an interface type and cache the
7069         result.
7070
7071         * decl.cs (IMemberContainer.ParentContainer): Removed.
7072         (IMemberContainer.ParentCache): New property.
7073         (MemberCache.SetupCacheForInterface): Removed.
7074         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7075         to create a cache for an interface's "parent".
7076
7077         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7078         interfaces too.
7079
7080 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7081
7082         * statement.cs: Avoid adding bools to a hashtable.
7083
7084 2004-11-15  Martin Baulig  <martin@ximian.com>
7085
7086         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7087
7088 2004-11-11  Martin Baulig  <martin@ximian.com>
7089
7090         * typemanager.cs (TypeManager.GetMethodName): New method.
7091
7092         * class.cs (MethodData.Define): Include the generic arity in the
7093         name of an explicit interface; also add it to the method name.
7094
7095         * pending.cs (PendingImplementation.InterfaceMethod): The method
7096         name now includes the generic arity.
7097
7098 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7099
7100         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7101         calling an unsafe method from a safe location.
7102
7103 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7104
7105         Fix #69167
7106         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7107
7108 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7109
7110         * namespace.cs (VerifyUsing): use GetPartialName instead of
7111         ToString. 
7112
7113 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7114
7115         * statement.cs (Return.Resolve): Fix regression in typo: if
7116         `in_exc', we have to request a NeedReturnLabel, this was a typo
7117         introduced in the anonymous method check-in.  Fixes #69131.
7118
7119         * Indexers were using the ShortName when defining themselves,
7120         causing a regression in the compiler bootstrap when applying the
7121         patch from 2004-11-02 (first part), now they use their full name
7122         and the bug is gone.
7123
7124 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7125
7126         * driver.cs: Strip the path from the names of embedded resources. Fixes
7127         #68519.
7128
7129 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7130
7131         Fix error message regression: cs0104-2.cs.
7132         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7133         (AliasEntry.Resolve): Update.
7134         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7135         'silent' flag.
7136         (RootContext.LookupType): Update.
7137
7138 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7139
7140         * cs-parser.jay: Add support for handling accessor modifiers
7141         * class: Add support port accessor modifiers and error checking,
7142         define PropertyMethod.Define as virtual (not abstract anymore)
7143         * ecore.cs: Add checking for proeprties access with access modifiers
7144         * iterators.cs: Modify Accessor constructor call based in the modified
7145         constructor
7146 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7147
7148         * expression.cs (StringConcat): Handle being called twice,
7149         as when we have a concat in a field init with more than two
7150         ctors in the class
7151
7152 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7153
7154         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7155         special case explicit implementations, we should always produce
7156         the .property or .event declaration.
7157         
7158         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7159         since it will not return correct data if people use this
7160         unresolved in the presence of using statements (see test-313).
7161
7162         * class.cs (MethodData.Define): If we are an explicit interface
7163         implementation, set the method name to the full name of the
7164         interface plus the name of the method.  
7165
7166         Notice that using the method.MethodName.GetFullName() does not
7167         work, as it will only contain the name as declared on the source
7168         file (it can be a shorthand in the presence of using statements)
7169         and not the fully qualifed type name, for example:
7170
7171         using System;
7172
7173         class D : ICloneable {
7174                 object ICloneable.Clone ()  {
7175                 }
7176         }
7177
7178         Would produce a method called `ICloneable.Clone' instead of
7179         `System.ICloneable.Clone'.
7180
7181         * namespace.cs (Alias.Resolve): Use GetPartialName.
7182         
7183 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7184
7185         * cs-parser.jay: Add error 1055 report.
7186
7187 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7188
7189         * assign.cs (Assign.DoResolve): Only do the transform of
7190         assignment into a New if the types are compatible, if not, fall
7191         through and let the implicit code deal with the errors and with
7192         the necessary conversions. 
7193
7194 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7195
7196         * cs-parser.jay: Add error 1031 report.
7197
7198         * cs-tokenizer.cs: Add location for error 1038.
7199
7200 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7201
7202         * cs-parser.jay: Add error 1016 report.
7203
7204 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7205
7206         * cs-parser.jay: Add errors 1575,1611 report.
7207
7208 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7209
7210         * cs-parser.jay: Add error 1001 report.
7211
7212 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7213
7214         Fix #68850
7215         * attribute.cs (GetMarshal): Add method argument for
7216         caller identification.
7217
7218         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7219         agument for GetMarshal and RuntimeMissingSupport.
7220
7221 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7222
7223         * attribute.cs (ExtractSecurityPermissionSet): Removed
7224         TypeManager.code_access_permission_type.
7225
7226         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7227
7228 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7229
7230         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7231         for obsolete use of a variable here.   Fixes regression on errors
7232         cs0619-25 and cs0619-26.
7233
7234 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
7235
7236         Fix #62358, implemented security attribute encoding.
7237
7238         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
7239         Tests permitted SecurityAction for assembly or other types.
7240         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
7241         data from SecurityPermissionAttribute to PermisionSet class.
7242
7243         * class.cs (ApplyAttributeBuilder): Added special handling
7244         for System.Security.Permissions.SecurityAttribute based types.
7245
7246         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
7247         special handling for System.Security.Permissions.SecurityAttribute
7248         based types.
7249
7250         * enum.cs (ApplyAttributeBuilder): Added special handling
7251         for System.Security.Permissions.SecurityAttribute based types.
7252
7253         * parameter.cs (ApplyAttributeBuilder): Added special handling
7254         for System.Security.Permissions.SecurityAttribute based types.
7255
7256         * rootcontext.cs: Next 2 core types.
7257
7258         * typemanager.cs (TypeManager.security_permission_attr_type):
7259         Built in type for the SecurityPermission Attribute.
7260         (code_access_permission_type): Build in type.
7261
7262 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
7263
7264         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
7265         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
7266         all of this information into
7267         EmitContext.EmitCapturedVariableInstance.
7268         
7269         * codegen.cs (EmitCapturedVariableInstance): move here the
7270         funcionality of emitting an ldarg.0 in the presence of a
7271         remapping.   This centralizes the instance emit code.
7272
7273         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
7274         then emit a load of this: it means that we have reached the
7275         topmost ScopeInfo: the one that contains the pointer to the
7276         instance of the class hosting the anonymous method.
7277
7278         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
7279         captures to the topmost CaptureContext.
7280
7281 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
7282
7283         * expression.cs (LocalVariableReference): Move the knowledge about
7284         the iterators into codegen's EmitCapturedVariableInstance.
7285
7286 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
7287
7288         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
7289         all code paths return a value from an anonymous method (it is the
7290         same as the 161 error, but for anonymous methods).
7291
7292 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
7293
7294         The introduction of anonymous methods in the compiler changed
7295         various ways of doing things in the compiler.  The most
7296         significant one is the hard split between the resolution phase
7297         and the emission phases of the compiler.
7298
7299         For instance, routines that referenced local variables no
7300         longer can safely create temporary variables during the
7301         resolution phase: they must do so from the emission phase,
7302         since the variable might have been "captured", hence access to
7303         it can not be done with the local-variable operations from the runtime.
7304         
7305         * statement.cs 
7306
7307         (Block.Flags): New flag `IsTopLevel' to indicate that this block
7308         is a toplevel block.
7309
7310         (ToplevelBlock): A new kind of Block, these are the blocks that
7311         are created by the parser for all toplevel method bodies.  These
7312         include methods, accessors and anonymous methods.
7313
7314         These contain some extra information not found in regular blocks:
7315         A pointer to an optional CaptureContext (for tracking captured
7316         local variables and parameters).  A pointer to the parent
7317         ToplevelBlock.
7318         
7319         (Return.Resolve): Catch missmatches when returning a value from an
7320         anonymous method (error 1662).
7321         Invoke NeedReturnLabel from the Resolve phase instead of the emit
7322         phase.
7323
7324         (Break.Resolve): ditto.
7325
7326         (SwitchLabel): instead of defining the labels during the
7327         resolution phase, we now turned the public ILLabel and ILLabelCode
7328         labels into methods called GetILLabelCode() and GetILLabel() that
7329         only define the label during the Emit phase.
7330
7331         (GotoCase): Track the SwitchLabel instead of the computed label
7332         (its contained therein).  Emit the code by using
7333         SwitchLabel.GetILLabelCode ().
7334
7335         (LocalInfo.Flags.Captured): A new flag has been introduce to track
7336         whether the Local has been captured or not.
7337
7338         (LocalInfo.IsCaptured): New property, used to tell whether the
7339         local has been captured.
7340         
7341         * anonymous.cs: Vastly updated to contain the anonymous method
7342         support.
7343
7344         The main classes here are: CaptureContext which tracks any
7345         captured information for a toplevel block and ScopeInfo used to
7346         track the activation frames for various local variables.   
7347
7348         Each toplevel block has an optional capture context associated
7349         with it.  When a method contains an anonymous method both the
7350         toplevel method and the anonymous method will create a capture
7351         context.   When variables or parameters are captured, they are
7352         recorded on the CaptureContext that owns them, for example:
7353
7354         void Demo () {
7355              int a;
7356              MyDelegate d = delegate {
7357                  a = 1;
7358              }
7359         }
7360
7361         Here `a' will be recorded as captured on the toplevel
7362         CapturedContext, the inner captured context will not have anything
7363         (it will only have data if local variables or parameters from it
7364         are captured in a nested anonymous method.
7365
7366         The ScopeInfo is used to track the activation frames for local
7367         variables, for example:
7368
7369         for (int i = 0; i < 10; i++)
7370                 for (int j = 0; j < 10; j++){
7371                    MyDelegate d = delegate {
7372                         call (i, j);
7373                    }
7374                 }
7375
7376         At runtime this captures a single captured variable `i', but it
7377         captures 10 different versions of the variable `j'.  The variable
7378         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
7379         recorded on a child.  
7380
7381         The toplevel ScopeInfo will also track information like the `this'
7382         pointer if instance variables were referenced (this is necessary
7383         as the anonymous method lives inside a nested class in the host
7384         type of the method). 
7385
7386         (AnonymousMethod): Expanded to track the Toplevel, implement
7387         `AnonymousMethod.Compatible' to tell whether an anonymous method
7388         can be converted to a target delegate type. 
7389
7390         The routine now also produces the anonymous method content
7391
7392         (AnonymousDelegate): A helper class that derives from
7393         DelegateCreation, this is used to generate the code necessary to
7394         produce the delegate for the anonymous method that was created. 
7395
7396         * assign.cs: API adjustments for new changes in
7397         Convert.ImplicitStandardConversionExists.
7398
7399         * class.cs: Adjustments to cope with the fact that now toplevel
7400         blocks are of type `ToplevelBlock'. 
7401
7402         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
7403         insteda of standard blocks.
7404
7405         Flag errors if params arguments are passed to anonymous methods.
7406
7407         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
7408         `CurrentAnonymousMethod' which points to the current Anonymous
7409         Method.  The variable points to the AnonymousMethod class that
7410         holds the code being compiled.  It is set in the new EmitContext
7411         created for the anonymous method.
7412
7413         (EmitContext.Phase): Introduce a variable and an enumeration to
7414         assist in enforcing some rules about when and where we are allowed
7415         to invoke certain methods (EmitContext.NeedsReturnLabel is the
7416         only one that enfonces this right now).
7417
7418         (EmitContext.HaveCaptureInfo): new helper method that returns
7419         whether we have a CapturedContext initialized.
7420
7421         (EmitContext.CaptureVariable): New method used to register that a
7422         LocalInfo must be flagged for capturing. 
7423
7424         (EmitContext.CapturedParameter): New method used to register that a
7425         parameters must be flagged for capturing. 
7426         
7427         (EmitContext.CapturedField): New method used to register that a
7428         field must be flagged for capturing. 
7429
7430         (EmitContext.HaveCapturedVariables,
7431         EmitContext.HaveCapturedFields): Return whether there are captured
7432         variables or fields. 
7433
7434         (EmitContext.EmitMethodHostInstance): This is used to emit the
7435         instance for the anonymous method.  The instance might be null
7436         (static methods), this (for anonymous methods that capture nothing
7437         and happen to live side-by-side with the current method body) or a
7438         more complicated expression if the method has a CaptureContext.
7439
7440         (EmitContext.EmitTopBlock): Routine that drives the emission of
7441         code: it will first resolve the top block, then emit any metadata
7442         and then emit the code.  The split is done so that we can extract
7443         any anonymous methods and flag any captured variables/parameters.
7444         
7445         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
7446         during this phase, the ILGenerator should not be used as labels
7447         and local variables declared here might not be accessible to any
7448         code that is part of an anonymous method.  
7449
7450         Exceptions to this include the temporary variables that are
7451         created by some statements internally for holding temporary
7452         variables. 
7453         
7454         (EmitContext.EmitMeta): New routine, in charge of emitting all the
7455         metadata for a cb
7456
7457         (EmitContext.TemporaryReturn): This method is typically called
7458         from the Emit phase, and its the only place where we allow the
7459         ReturnLabel to be defined other than the EmitMeta.  The reason is
7460         that otherwise we would have to duplicate a lot of logic in the
7461         Resolve phases of various methods that today is on the Emit
7462         phase. 
7463
7464         (EmitContext.NeedReturnLabel): This no longer creates the label,
7465         as the ILGenerator is not valid during the resolve phase.
7466
7467         (EmitContext.EmitThis): Extended the knowledge in this class to
7468         work in anonymous methods in addition to iterators. 
7469
7470         (EmitContext.EmitCapturedVariableInstance): This emits whatever
7471         code is necessary on the stack to access the instance to a local
7472         variable (the variable will be accessed as a field).
7473
7474         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
7475         EmitContext.EmitAddressOfParameter): Routines to support
7476         parameters (not completed at this point). 
7477         
7478         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
7479         will also remove the parameters.
7480
7481         * convert.cs (Convert): Define a `ConstantEC' which points to a
7482         null.  This is just to prefity some code that uses
7483         ImplicitStandardConversion code and do not have an EmitContext
7484         handy.
7485
7486         The idea is to flag explicitly that at that point in time, it is
7487         known that the conversion will not trigger the delegate checking
7488         code in implicit conversions (which requires a valid
7489         EmitContext). 
7490
7491         Everywhere: pass new EmitContext parameter since
7492         ImplicitStandardConversionExists now requires it to check for
7493         anonymous method conversions. 
7494
7495         (Convert.ImplicitStandardConversionExists): If the type of an
7496         expression is the anonymous_method_type, and the type is a
7497         delegate, we invoke the AnonymousMethod.Compatible method to check
7498         whether an implicit conversion is possible. 
7499
7500         (Convert.ImplicitConversionStandard): Only do implicit method
7501         group conversions if the language level is not ISO_1.
7502
7503         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
7504         MethodInfo for the Invoke method.  used by Delegate and
7505         AnonymousDelegate.
7506
7507         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
7508         method conversions if the target type is a delegate.
7509
7510         Removed extra debugging nops.
7511
7512         (LocalVariableReference): Turn the `local_info' into a public
7513         field. 
7514
7515         Add `prepared' field, the same hack used for FieldExprs to cope
7516         with composed assignments, as Local variables do not necessarily
7517         operate purely on the stack as they used to: they can be captured
7518         fields. 
7519
7520         Add `temp' for a temporary result, like fields.
7521
7522         Refactor DoResolve and DoResolveLValue into DoResolveBase.
7523
7524         It now copes with Local variables that are captured and emits the
7525         proper instance variable to load it from a field in the captured
7526         case. 
7527
7528         (ParameterReference.DoResolveBase): During the resolve phase,
7529         capture parameters if we are in an anonymous method.
7530
7531         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
7532         anonymous method, use the EmitContext helper routines to emit the
7533         parameter reference.
7534
7535         * iterators.cs: Set RemapToProxy to true/false during the
7536         EmitDispose class.
7537
7538         * parameters.cs (GetParameterByName): New helper method. 
7539
7540         * typemanager.cs (anonymous_method_type) a new type that
7541         represents an anonyous method.  This is always an internal type,
7542         used as a fencepost to test against the anonymous-methodness of an
7543         expression. 
7544         
7545 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
7546
7547         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
7548         561 report.
7549         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
7550
7551 2004-11-10  Martin Baulig  <martin@ximian.com>
7552
7553         * expression.cs (Invocation.BetterFunction): If two methods have
7554         equal parameter types, but only one of them is generic, the
7555         non-generic one wins.
7556         (New.DoResolve): Don't set `is_struct' to false if we're a generic
7557         instance; just use `Type.IsValueType' to determine whether
7558         something is a struct or not.
7559         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
7560         so we can be called multiple times.
7561
7562 2004-11-10  Martin Baulig  <martin@ximian.com>
7563
7564         * generic.cs (TypeParameter.DefineConstraints): New public method.
7565         (TypeParameter.CheckAccessLevel): Override this and return true.
7566         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
7567         override ResolveType() anymore.
7568         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
7569
7570 2004-11-10  Martin Baulig  <martin@ximian.com>
7571
7572         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
7573         call DeclSpace.ResolveNestedType() on it.
7574
7575 2004-11-10  Martin Baulig  <martin@ximian.com>
7576
7577         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
7578         non-null, call ParameterModifier() on it.
7579
7580 2004-11-10  Martin Baulig  <martin@ximian.com>
7581
7582         * iterators.cs
7583         (Iterators): Added `current_type' and `this_type' fields.
7584         (Iterators.DefineIterator): Create a new EmitContext and store it
7585         in `ec'; compute `this_type'.
7586
7587 2004-11-10  Martin Baulig  <martin@ximian.com>
7588
7589         * typemanager.cs
7590         (TypeManager.IsPrivateAccessible): New public method.
7591         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
7592
7593 2004-11-10  Martin Baulig  <martin@ximian.com>
7594
7595         * class.cs (TypeContainer.DefineType): Call
7596         TypeBuilder.DefineGenericParameters() before resolving the type
7597         parameters.
7598         (MethodData.parent_method): New protected field.
7599         (MethodData..ctor): Added `MethodInfo parent_method' argument.
7600         (MethodData.Define): Compute `parent_method'.
7601
7602         * decl.cs
7603         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
7604         (MemberCore.GetClsCompliantAttributeValue): Likewise.
7605         (DeclSpace.ec): New protected field; store the EmitContext here.
7606         (DeclSpace.EmitContext): New public property.
7607         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
7608         (DeclSpace.ResolveNestedType): New public method.
7609         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
7610         (DeclSpace.NestedAccessible): Added `Type tb' argument.
7611         (DeclSpace.FamilyAccessible): Likewise.
7612         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
7613         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
7614         EmitContext.
7615
7616         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
7617         field.
7618
7619         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
7620         (Enum.Emit): Don't create a new EmitContext.
7621
7622 2004-10-18  Martin Baulig  <martin@ximian.com>
7623
7624         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
7625         `Type' directly, but call ResolveType() on it.
7626         (Catch.Resolve): Likewise.
7627         (Foreach.Resolve): Likewise.
7628
7629 2004-10-18  Martin Baulig  <martin@ximian.com>
7630
7631         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
7632         `Type' directly, but call ResolveType() on it.
7633         (Probe.DoResolve): Likewise.
7634         (ArrayCreation.LookupType): Likewise.
7635         (TypeOf.DoResolve): Likewise.
7636         (SizeOf.DoResolve): Likewise.
7637
7638 2004-10-18  Raja R Harinath  <rharinath@novell.com>
7639
7640         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
7641         the ResolveType.
7642
7643 2004-10-17  John Luke  <john.luke@gmail.com>
7644
7645         * class.cs (Operator.GetSignatureForError): use CSharpName
7646
7647         * parameter.cs (Parameter.GetSignatureForError): Returns
7648         correct name even if was not defined.
7649
7650 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7651
7652         Fix #65816.
7653         * class.cs (TypeContainer.EmitContext): New property.
7654         (DefineNestedTypes): Create an emitcontext for each part.
7655         (MethodCore.DoDefineParameters): Use container's emitcontext.
7656         Pass type array to InternalParameters.
7657         (MemberBase.DoDefine): Use container's emitcontext.
7658         (FieldMember.Define): Likewise.
7659         (Event.Define): Likewise.
7660         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7661         Pass type array to InternalParameters.
7662         (SetIndexerMethod.GetParameterInfo): Likewise.
7663         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7664         * delegate.cs (Define): Pass emitcontext to
7665         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7666         array to InternalParameters.
7667         * expression.cs (ParameterReference.DoResolveBase): Pass
7668         emitcontext to GetParameterInfo.
7669         (ComposedCast.DoResolveAsTypeStep): Remove check on
7670         ec.ResolvingTypeTree.
7671         * parameter.cs (Parameter.Resolve): Change argument to
7672         EmitContext.  Use ResolveAsTypeTerminal.
7673         (Parameter.GetSignature): Change argument to EmitContext.
7674         (Parameters.ComputeSignature): Likewise.
7675         (Parameters.ComputeParameterTypes): Likewise.
7676         (Parameters.GetParameterInfo): Likewise.
7677         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7678         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7679         * support.cs (InternalParameters..ctor): Remove variant that takes
7680         a DeclSpace.
7681         * typemanager.cs (system_intptr_expr): New.
7682         (InitExpressionTypes): Initialize it.
7683
7684 2004-10-12  Chris Toshok  <toshok@ximian.com>
7685
7686         * cs-parser.jay: fix location for try_statement and catch_clause.
7687
7688 2004-10-18  Martin Baulig  <martin@ximian.com>
7689
7690         * class.cs (FieldMember.Define): Don't access the TypeExpr's
7691         `Type' directly, but call ResolveType() on it.
7692         (MemberBase.DoDefine): Likewise.
7693
7694         * expression.cs (New.DoResolve): Don't access the TypeExpr's
7695         `Type' directly, but call ResolveType() on it.
7696         (ComposedCast.DoResolveAsTypeStep): Likewise.
7697
7698         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
7699         `Type' directly, but call ResolveType() on it.
7700
7701 2004-10-17  John Luke  <john.luke@gmail.com>
7702
7703         * class.cs (Operator.GetSignatureForError): use CSharpName
7704
7705         * parameter.cs (Parameter.GetSignatureForError): Returns
7706         correct name even if was not defined.
7707
7708 2004-10-13  Raja R Harinath  <rharinath@novell.com>
7709
7710         Fix #65816.
7711         * class.cs (TypeContainer.EmitContext): New property.
7712         (DefineNestedTypes): Create an emitcontext for each part.
7713         (MethodCore.DoDefineParameters): Use container's emitcontext.
7714         Pass type array to InternalParameters.
7715         (MemberBase.DoDefine): Use container's emitcontext.
7716         (FieldMember.Define): Likewise.
7717         (Event.Define): Likewise.
7718         (SetMethod.GetParameterInfo): Change argument to EmitContext.
7719         Pass type array to InternalParameters.
7720         (SetIndexerMethod.GetParameterInfo): Likewise.
7721         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
7722         * delegate.cs (Define): Pass emitcontext to
7723         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
7724         array to InternalParameters.
7725         * expression.cs (ParameterReference.DoResolveBase): Pass
7726         emitcontext to GetParameterInfo.
7727         (ComposedCast.DoResolveAsTypeStep): Remove check on
7728         ec.ResolvingTypeTree.
7729         * parameter.cs (Parameter.Resolve): Change argument to
7730         EmitContext.  Use ResolveAsTypeTerminal.
7731         (Parameter.GetSignature): Change argument to EmitContext.
7732         (Parameters.ComputeSignature): Likewise.
7733         (Parameters.ComputeParameterTypes): Likewise.
7734         (Parameters.GetParameterInfo): Likewise.
7735         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7736         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7737         * support.cs (InternalParameters..ctor): Remove variant that takes
7738         a DeclSpace.
7739         * typemanager.cs (system_intptr_expr): New.
7740         (InitExpressionTypes): Initialize it.
7741
7742 2004-10-12  Chris Toshok  <toshok@ximian.com>
7743
7744         * cs-parser.jay: fix location for try_statement and catch_clause.
7745
7746 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7747
7748         More DeclSpace.ResolveType avoidance.
7749         * decl.cs (MemberCore.InUnsafe): New property.
7750         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7751         with newly created EmitContext.
7752         (FieldMember.Define): Likewise.
7753         * delegate.cs (Delegate.Define): Likewise.
7754         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7755         only if normal name-lookup fails.
7756         (TypeExpr.DoResolve): Enable error-checking.
7757         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7758         (SizeOf.DoResolve): Likewise.
7759         (ComposedCast.DoResolveAsTypeStep): Likewise.
7760         (StackAlloc.DoResolve): Likewise.
7761         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7762         (Block.Unsafe): New property.
7763         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7764         (Unsafe): Set 'unsafe' flag of contained block.
7765         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7766         (Fixed.Resolve): Likewise.
7767         (Catch.Resolve): Likewise.
7768         (Using.ResolveLocalVariableDecls): Likewise.
7769         (Foreach.Resolve): Likewise.
7770
7771 2004-10-05  John Luke <john.luke@gmail.com>
7772
7773         * cs-parser.jay: add location to error CS0175
7774
7775 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7776
7777         * ecore.cs (Expression.Constantity): Add support for turning null
7778         into a constant.
7779
7780         * const.cs (Const.Define): Allow constants to be reference types
7781         as long as the value is Null.
7782
7783 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7784
7785         * namespace.cs (NamespaceEntry.Using): No matter which warning
7786         level is set, check if this namespace name has already been added.
7787
7788 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7789
7790         * expression.cs: reftype [!=]= null should always use br[true,false].
7791         # 67410
7792
7793 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7794
7795         Fix #67108
7796         * attribute.cs: Enum conversion moved to 
7797         GetAttributeArgumentExpression to be applied to the all
7798         expressions.
7799
7800 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7801
7802         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7803         * class.c (TypeContainer.DefineType): Flag error if
7804         base types aren't accessible due to access permissions.
7805         * decl.cs (DeclSpace.ResolveType): Move logic to
7806         Expression.ResolveAsTypeTerminal.
7807         (DeclSpace.ResolveTypeExpr): Thin layer over
7808         Expression.ResolveAsTypeTerminal.
7809         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7810         Refactor code into NestedAccess.  Use it.
7811         (DeclSpace.NestedAccess): New.
7812         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7813         argument to silence errors.  Check access permissions.
7814         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7815         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7816         (Cast.DoResolve): Likewise.
7817         (New.DoResolve): Likewise.
7818         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7819         (TypeOf.DoResolve): Likewise.
7820
7821         * expression.cs (Invocation.BetterConversion): Return the Type of
7822         the better conversion.  Implement section 14.4.2.3 more faithfully.
7823         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7824         section 14.4.2.2 explicit.
7825         (Invocation.OverloadResolve): Update.
7826         (Invocation): Remove is_base field.
7827         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7828         (Invocation.Emit): Likewise.
7829
7830 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7831
7832         * cs-parser.jay: Reverted 642 warning fix.
7833
7834 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7835
7836         Fix bug #66615
7837         * decl.cs (FindMemberWithSameName): Indexer can have more than
7838         1 argument.
7839
7840 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7841
7842         * expression.cs (LocalVariableReference.DoResolveLValue):
7843         Do not report warning 219 for out values.
7844         (EmptyExpression.Null): New member to avoid extra allocations.
7845
7846 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7847
7848         * cs-parser.jay: Fix wrong warning 642 report.
7849
7850         * cs-tokenizer.cs (CheckNextToken): New helper;
7851         Inspect next character if is same as expected.
7852
7853 2004-09-23  Martin Baulig  <martin@ximian.com>
7854
7855         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7856         (Convert.ImplicitReferenceConversionExists): Likewise.
7857
7858 2004-11-09  Raja R Harinath  <rharinath@novell.com>
7859
7860         * Makefile (DISTFILES): Comment out a few missing files.
7861
7862 2004-10-29  Raja R Harinath  <rharinath@novell.com>
7863
7864         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
7865         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
7866         (gmcs.exe): Invoke bootstrap-libs.
7867         (clean-local): Clean the net_2_0_bootstrap profile too.
7868         (PROGRAM_INSTALL_DIR): New.
7869         (install-local): Use it.
7870
7871 2004-10-13  Martin Baulig  <martin@ximian.com>
7872
7873         * generic.cs (TypeManager.InflatedConstraints): New nested class.
7874         (TypeParameter.DefineType): If we're a method type parameter and
7875         that method is overriding something, "inflate" its constraints.
7876
7877 2004-10-12  Martin Baulig  <martin@ximian.com>
7878
7879         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
7880         and have type arguments, create and resolve a ConstructedType.
7881
7882 2004-10-12  Martin Baulig  <martin@ximian.com>
7883
7884         * decl.cs (MemberCache.FindMemberToOverride): Use
7885         TypeManager.IsEqual() to compare the parameters and Type.Equals()
7886         to compare the invocationType.
7887
7888         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
7889         When comparing two type parameters, only do the signature-only
7890         comparision for method type parameters.
7891
7892 2004-10-11  Martin Baulig  <martin@ximian.com>
7893
7894         * report.cs: Don't make --fatal abort on warnings, we have
7895         -warnaserror for that.
7896
7897 2004-10-11  Martin Baulig  <martin@ximian.com>
7898
7899         * typemanager.cs
7900         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
7901         (TypeManager.IsEqual): Call ourself recursively instead of using
7902         Type.IsEqual(). 
7903
7904 2004-10-11  Martin Baulig  <martin@ximian.com>
7905
7906         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
7907         on our own type parameters, not on the ones we inherit from a containing
7908         class.
7909
7910         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
7911         the comparision.
7912
7913         * generic.cs (TypeParameter.Define): We may only be called once.
7914
7915         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
7916         instead of TypeManager.IsEqual().
7917
7918 2004-09-28  Martin Baulig  <martin@ximian.com>
7919
7920         * generic.cs
7921         (GenericConstraints.EffectiveBaseClass): New public property.
7922         (TypeParameter.GenericConstraints): New public property.
7923         (ConstructedType.CheckConstraints): Improved.
7924
7925         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
7926         (Convert.TypeParameterConversion): New private method; use this in
7927         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
7928         for all conversions related to type parameters.
7929
7930 2004-09-24  Martin Baulig  <martin@ximian.com>
7931
7932         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
7933         type parameter conversions for type parameters which are known to
7934         be reference types.
7935
7936 2004-09-24  Martin Baulig  <martin@ximian.com>
7937
7938         * generic.cs (GenericConstraints): Added `IsReferenceType' and
7939         `IsValueType' properties.
7940
7941         * support.cs (ReflectionConstraints): Use
7942         Type.GetGenericParameterConstraints() instead of the old hack.
7943
7944 2004-09-24  Martin Baulig  <martin@ximian.com>
7945
7946         * generic.cs (GenericConstraints): Moved here and made it an
7947         abstract class.
7948
7949         * support.cs (GenericConstraints): Moved to generic.cs.
7950
7951 2004-09-24  Martin Baulig  <martin@ximian.com>
7952
7953         * support.cs
7954         (ReflectionConstraints): Un-nested this class and made it public.
7955
7956         * typemanager.cs
7957         (TypeManager.GetTypeParameterConstraints): New public method.
7958         (TypeManager.HasConstructorConstraint): Use the attributes.
7959
7960 2004-09-24  Martin Baulig  <martin@ximian.com>
7961
7962         * support.cs (GenericConstraints): Replaced `HasConstructor',
7963         `IsReferenceType' and `IsValueType' with `Attributes'.
7964         (ReflectionParameters.ReflectionConstraints): Removed the Create()
7965         method and made the .ctor public.
7966
7967         * generic.cs (Constraints.Attributes): New public property.
7968         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
7969         `IsReferenceType' -> `HasReferenceTypeConstraint' and
7970         `IsValueType' -> `HasValueTypeConstraint'.
7971
7972 2004-09-23  Martin Baulig  <martin@ximian.com>
7973
7974         * generic.cs (Constraints): Reflect latest runtime changes.
7975
7976 2004-09-23  Martin Baulig  <martin@ximian.com>
7977
7978         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7979         (Convert.ImplicitReferenceConversionExists): Likewise.
7980
7981 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7982
7983         * class.cs (Operator.Define): Add error 448 and 559 report.
7984         
7985 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7986
7987         * class.cs (MemberBase.IsTypePermitted): New protected
7988         method for checking error CS0610.
7989
7990 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7991
7992         * class.cs (TypeContainer.HasExplicitLayout): New property
7993         Returns whether container has StructLayout attribute set Explicit.
7994         (FieldMember): New abstract class for consts and fields.
7995         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7996         (Field): Reuse FieldMember.
7997
7998         * const.cs (Const): Reuse FieldMember.
7999
8000         * rootcontext.cs: EmitConstants call moved to class.
8001
8002 2004-09-22  Martin Baulig  <martin@ximian.com>
8003
8004         Marek and me just fixed one of our oldest bugs: #28562 :-)
8005
8006         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8007
8008         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8009         we're an EnumConstant, just return that.
8010         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8011         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8012         to get the value which'll actually be written into the attribute.
8013         However, we have to use GetValue() to access the attribute's value
8014         in the compiler.        
8015
8016 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8017
8018         * constant.cs (Constant.IsNegative): New abstract property
8019         IsNegative.
8020
8021         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8022         (StackAlloc.DoResolve): Reused IsNegative.
8023
8024 2004-09-22  Martin Baulig  <martin@ximian.com>
8025
8026         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8027         public method; like LookupTypeContainer, but also works for
8028         generic instances.
8029
8030         * report.cs (Report.SymbolRelatedToPreviousError): Use
8031         TypeManager.LookupGenericTypeContainer().       
8032
8033 2004-09-22  Martin Baulig  <martin@ximian.com>
8034
8035         Thanks to Peter Sestoft for this bug report.
8036
8037         * expression.cs (Conditional): If both the `trueExpr' and the
8038         `falseExpr' is a NullLiteral, return a NullLiteral.
8039
8040 2004-09-22  Martin Baulig  <martin@ximian.com>
8041
8042         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8043         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8044         for the "get_Current" call.
8045
8046 2004-09-21  Martin Baulig  <martin@ximian.com>
8047
8048         * convert.cs (Convert.ImplicitReferenceConversion): When
8049         converting to an interface type, first check whether we're
8050         converting from a reference type.
8051
8052 2004-09-14  Martin Baulig  <martin@ximian.com>
8053
8054         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8055
8056 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8057
8058         Fixed bug #61902
8059         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8060         called and is obsolete then this member suppress message
8061         when call is inside next [Obsolete] method or type.
8062
8063         * expression.cs: Use TestObsoleteMethodUsage member.
8064
8065 2004-09-14  Martin Baulig  <martin@ximian.com>
8066
8067         * genericparser.cs: Removed.
8068
8069 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8070
8071         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8072
8073 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8074
8075         * attribute.cs (Attribute.Resolve): Add error 653 report.
8076
8077         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8078         report.
8079         (Method.ApplyAttributeBuilder): Add error 685 report.
8080         (Operator.Define): Add error 564 report.
8081
8082         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8083
8084         * expression.cs (Invocation.DoResolve): Add error
8085         245 and 250 report.
8086
8087         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8088         error 674 report.
8089
8090 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8091
8092         * class.cs (ConstructorInitializer.Resolve):
8093         Wrong error number (515->516).
8094
8095 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8096
8097         * class.cs (Indexer.Define): Add error 631 report.
8098
8099 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8100
8101         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8102
8103 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8104
8105         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8106
8107 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8108
8109         * cs-parser.jay: Added error CS0241 report.
8110
8111 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8112
8113         * cs-parser.jay (fixed_statement): Introduce a scope for the
8114         declaration in the 'fixed' statement.
8115
8116 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8117
8118         * cs-parser.jay: Added CS0230 error report.
8119
8120 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8121
8122         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8123
8124 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8125
8126         * expression.cs (Argument.Resolve): Added error CS0192 and
8127         CS0199 report.
8128
8129 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8130
8131         C# 2.0 #pragma warning feature
8132
8133         * cs-tokenizer.cs (PreProcessPragma): New method; 
8134         Handles #pragma directive.
8135
8136         * report.cs (WarningRegions): New class; Support
8137         class for #pragma warning directive. It tests whether
8138         warning is enabled for a given line.
8139
8140 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8141
8142         * const.cs: Add more descriptive error report, tahnks to
8143         Sebastien. 
8144
8145 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8146
8147         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8148
8149 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8150
8151         * expression.cs: Apply patch from Ben: Remove dead code from
8152         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8153         as that code just threw an exception anwyays.
8154
8155         * const.cs: Remove the call to the turnintoconstant, for details
8156         see bug: #63144
8157         
8158         * literal.cs: The type of the null-literal is the null type;  So
8159         we use a placeholder type (literal.cs:System.Null, defined here)
8160         for it.
8161
8162         * expression.cs (Conditional.DoResolve): Remove some old code that
8163         is no longer needed, conversions have been fixed.
8164
8165         (ArrayCreationExpression.DoResolve): Return false if we fail to
8166         resolve the inner expression.
8167
8168 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8169
8170         Fix test-290.cs.
8171         * cs-parser.jay (delegate_declaration): Record a delegate
8172         declaration as a type declaration.
8173         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8174
8175 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8176
8177         * parameter.cs: Do not crash if the type can not be resolved. 
8178
8179         * expression.cs: Report errors with unsafe pointers, fixes #64896
8180
8181 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8182
8183         * expression.cs: Pointer arith always needs to do a conv.i
8184         if the operand is a long. fix 65320
8185
8186 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8187
8188         Fixed cs0619-37.cs, cs0619-38.cs
8189
8190         * enum.cs (GetObsoleteAttribute): Removed.
8191
8192         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8193         on Enum member is double staged. The first is tested member
8194         and then enum.
8195
8196 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8197
8198         Fixed #56986, #63631, #65231
8199
8200         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8201         adds member to name container.
8202         (TypeContainer.AddToTypeContainer): New method, adds type to
8203         name container.
8204         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8205         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8206         AddOperator): Simplified by reusing AddToMemberContainer.
8207         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8208         instead of field.
8209         (Method.CheckForDuplications): Fixed implementation to test all
8210         possibilities.
8211         (MemberBase): Detection whether member is explicit interface
8212         implementation is now in constructor.
8213         (MemberBase.UpdateMemberName): Handles IndexerName.
8214         (Accessor): Changed to keep also location information.
8215         (AbstractPropertyEventMethod): Is derived from MemberCore.
8216         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8217         will be emited or not.
8218         (PropertyBase.AreAccessorsDuplicateImplementation):
8219         Tests whether accessors are not in collision with some method.
8220         (Operator): Is derived from MethodCore to simplify common
8221         operations.
8222
8223         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8224         must be performed.
8225         (DeclSpace.AddToContainer): Adds the member to defined_names
8226         table. It tests for duplications and enclosing name conflicts.
8227
8228         * enum.cs (EnumMember): Clean up to reuse the base structures
8229
8230 2004-09-03  Martin Baulig  <martin@ximian.com>
8231
8232         Merged latest changes into gmcs.  Please keep this comment in
8233         here, it makes it easier for me to see what changed in MCS since
8234         the last time I merged.
8235
8236 2004-09-03  Martin Baulig  <martin@ximian.com>
8237
8238         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8239         into TypeContainer, to make partial classes work again.
8240
8241 2004-09-03  Martin Baulig  <martin@ximian.com>
8242
8243         * rootcontext.cs (RootContext.V2): Removed.
8244
8245 2004-03-23  Martin Baulig  <martin@ximian.com>
8246
8247         * expression.cs (Invocation.OverloadResolve): Added `bool
8248         may_fail' argument and use it instead of the Location.IsNull() hack.
8249
8250 2004-09-09  Martin Baulig  <martin@ximian.com>
8251
8252         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
8253
8254 2004-09-09  Martin Baulig  <martin@ximian.com>
8255
8256         * generic.cs (TypeParameter.DefineType): Added support for
8257         explicit interface methods.
8258
8259 2004-09-09  Martin Baulig  <martin@ximian.com>
8260
8261         * README.Changes: New document.  Started to list important changes
8262         between MCS and GMCS here.
8263
8264 2004-09-08  Martin Baulig  <martin@ximian.com>
8265
8266         * class.cs
8267         (TypeContainer.CheckRecursiveDefinition): New protected method.
8268         (TypeContainer.DefineType): Move the CS0146 check into
8269         CheckRecursiveDefinition().     
8270
8271 2004-09-06  Martin Baulig  <martin@ximian.com>
8272
8273         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
8274         types for the constructor constraint.
8275
8276 2004-09-03  Martin Baulig  <martin@ximian.com>
8277
8278         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
8279         into TypeContainer, to make partial classes work again.
8280
8281 2004-09-03  Martin Baulig  <martin@ximian.com>
8282
8283         * rootcontext.cs (RootContext.V2): Removed.
8284
8285 2004-03-23  Martin Baulig  <martin@ximian.com>
8286
8287         * expression.cs (Invocation.OverloadResolve): Added `bool
8288         may_fail' argument and use it instead of the Location.IsNull() hack.
8289
8290 2004-09-03  Martin Baulig  <martin@ximian.com>
8291
8292         Merged latest changes into gmcs.  Please keep this comment in
8293         here, it makes it easier for me to see what changed in MCS since
8294         the last time I merged.
8295
8296 2004-09-03  Raja R Harinath  <rharinath@novell.com>
8297
8298         Fix #61128.
8299         * expression.cs (BetterConversion): Don't allow either conversion 
8300         to be null.  Remove redundant implicit conversion test when 'q ==
8301         null' -- when this function is invoked, we already know that the
8302         implicit conversion exists.
8303         (BetterFunction): Assume that 'best' is non-null.  Remove
8304         redundant reimplementation of IsApplicable when 'best' is null.
8305         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
8306         number of arguments.
8307         (IsAncestralType): Extract from OverloadResolve.
8308         (OverloadResolve): Make robust to the MethodGroupExpr being
8309         unsorted.  Implement all the logic of Section 14.5.5.1, and
8310         support overloading of methods from multiple applicable types.
8311         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
8312
8313         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
8314         (RealError, Warning): Append type of report to related symbol.
8315
8316 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
8317
8318         * enum.cs: Fixed CLS-Compliance checks for enum members.
8319         Error tests cs3008-8.cs, cs3014-8.cs
8320
8321 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8322
8323         Fixed bug #62342, #63102
8324         * class.cs: ImplementIndexer uses member.IsExplicitImpl
8325         like ImplementMethod.
8326
8327 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
8328
8329         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8330         Fixed bug #65170.
8331
8332 2004-09-02  Martin Baulig  <martin@ximian.com>
8333
8334         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8335         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8336         on the MethodBase.
8337
8338 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
8339
8340         C# 2.0 Static classes implemented
8341
8342         * class.cs (TypeContainer): instance_constructors,
8343         initialized_fields, initialized_static_fields,
8344         default_constructor, base_inteface_types are protected to be
8345         accessible from StaticClass.
8346         (TypeContainer.DefineDefaultConstructor): New virtual method
8347         for custom default constructor generating
8348         (StaticClass): New class to handle "Static classes" feature.
8349
8350         * cs-parser.jay: Handle static keyword on class like instance
8351         of StaticClass.
8352
8353         * driver.cs: Added "/langversion" command line switch with two
8354         options (iso-1, default).
8355
8356 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
8357
8358         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
8359
8360 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
8361
8362         * delegate.cs: Style.
8363
8364 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
8365
8366         * delegate.cs: Add seperate instance expr field for miguel.
8367
8368 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8369
8370         * PointerArithmetic (Resolve): make sure we are not doing
8371         pointer arith on void*. Also, make sure we are resolved
8372         by not setting eclass until resolve.
8373
8374         All callers: Make sure that PointerArithmetic gets resolved.
8375
8376 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8377
8378         * ArrayCreation (LookupType): If the type does not resolve 
8379         to an array, give an error.
8380
8381 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
8382
8383         * statement.cs (Try.Resolve): Fixed bug #64222
8384
8385 2004-08-27  Martin Baulig  <martin@ximian.com>
8386
8387         * class.cs
8388         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8389         crash here.     
8390
8391 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8392
8393         * ecore.cs (Constantify): Get underlying type via
8394         System.Enum.GetUnderlyingType to avoid StackOverflow on the
8395         Windows in special cases.
8396
8397 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
8398
8399         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
8400         for obtaining also private methods.
8401         (GetRemoveMethod): Used GetRemoveMethod (true)
8402         for obtaining also private methods.
8403
8404 2004-09-02  Martin Baulig  <martin@ximian.com>
8405
8406         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
8407         TypeManager.GetArgumentTypes() rather than calling GetParameters()
8408         on the MethodBase.
8409
8410 2004-08-27  Martin Baulig  <martin@ximian.com>
8411
8412         * class.cs
8413         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
8414         crash here.     
8415
8416 2004-08-25  Martin Baulig  <martin@ximian.com>
8417
8418         * support.cs (ReflectionParameters..ctor): If this is a generic
8419         method, retrieve and store its type parameters.
8420         (InternalParameters..ctor): Added `TypeParameter[]' argument.
8421         (ReflectionParameters.GenericConstraints): The argument specifies
8422         the type parameter, not the method parameter.
8423         (InternalParameters.GenericConstraints): Likewise.
8424
8425         * generic.cs (TypeParameter.DefineType): Correctly handle
8426         constraints wrt. generic methods in interfaces and their
8427         implementations.        
8428
8429 2004-08-24  Martin Baulig  <martin@ximian.com>
8430
8431         * generic.cs (TypeParameter.IsSubclassOf): New public method.
8432         (Constraints.IsSubclassOf): New internal method.
8433
8434         * typemanager.cs (TypeManager.FindMembers): Added special support
8435         for GenericTypeParameterBuilder's.      
8436         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
8437         type parameters.
8438
8439 2004-08-24  Martin Baulig  <martin@ximian.com>
8440
8441         * typemanager.cs
8442         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
8443         this for accessibility checks.
8444         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
8445         IsNestedFamilyAccessible.
8446         (TypeManager.IsSubclassOf): New method, do what the name actually
8447         says.   
8448
8449 2004-08-24  Martin Baulig  <martin@ximian.com>
8450
8451         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
8452         as a SimpleName, include the generic arity.
8453
8454 2004-08-24  Martin Baulig  <martin@ximian.com>
8455
8456         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
8457         MethodAttributes.HideBySig for operators.
8458
8459 2004-08-23  Martin Baulig  <martin@ximian.com>
8460
8461         Back to the old error reporting system :-)
8462
8463         * report.cs (Message): Removed.
8464         (Report.MessageData, ErrorData, WarningData): Removed.
8465         (Report.Error, Warning): Back to the old system.
8466
8467 2004-08-23  Martin Baulig  <martin@ximian.com>
8468
8469         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
8470
8471         * class.cs (TypeContainer.ParentContainer): New public virtual
8472         method; replaces the explicit interface implementation.
8473         (ClassPart.ParentContainer): Override.
8474
8475 2004-08-23  Martin Baulig  <martin@ximian.com>
8476
8477         * statement.cs (Switch): Added support for constant switches; see
8478         #59428 or test-285.cs.
8479
8480 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8481
8482         Fixed bug #62740.
8483         * statement.cs (GetEnumeratorFilter): Removed useless
8484         logic because C# specs is strict. GetEnumerator must be
8485         public.
8486
8487 2004-08-22  Martin Baulig  <martin@ximian.com>
8488
8489         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8490         a switch and may break, reset the barrier.  Fixes #59867.
8491
8492 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
8493
8494         CLS-Compliance speed up (~5% for corlib)
8495
8496         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
8497         New method. Tests container for CLS-Compliant names
8498
8499         * class.cs (TypeContainer.VerifyClsName): New method.
8500         Checks whether container name is CLS Compliant.
8501         (Constructor): Implements IMethodData.
8502
8503         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
8504         low-case table for CLS Compliance test.
8505         (MemberCache.VerifyClsParameterConflict): New method.
8506         Checks method parameters for CS3006 error.
8507
8508         * enum.cs (EnumMember): Is derived from MemberCore.
8509         (Enum.VerifyClsName): Optimized for better performance.
8510
8511 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8512
8513         * report.cs: Renamed Error_T to Error and changed all
8514         references.
8515
8516 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
8517
8518         * class.cs (TypeContainer.IndexerArrayList): New inner class
8519         container for indexers.
8520         (TypeContainer.DefaultIndexerName): New constant for default
8521         indexer name. Replaced all "Item" with this constant.
8522         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
8523
8524         * typemanager.cs (TypeManager.default_member_ctor): Cache here
8525         DefaultMemberAttribute constructor.
8526
8527 2004-08-05  Martin Baulig  <martin@ximian.com>
8528
8529         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
8530         Fix bug #59429.
8531
8532 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
8533
8534         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
8535         multi platforms problem.
8536
8537         * compiler.csproj: Included shared files.
8538
8539 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8540
8541         Fix bug 60333, 55971 in the more general way
8542         * attribute.cs (Attribute.GetAttributeArgumentExpression):
8543         Added arg_type argument for constant conversion.
8544         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
8545
8546 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8547
8548         Fix bug #59760
8549         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
8550         OperatorArrayList, MethodCoreArrayList for typecontainer
8551         containers. Changed class member types to these new types.
8552         (MethodArrayList.DefineMembers): Added test for CS0659.
8553
8554 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
8555
8556         * cfold.cs: Synchronize the folding with the code in expression.cs
8557         Binary.DoNumericPromotions for uint operands.
8558
8559         * attribute.cs: Revert patch from Raja, it introduced a regression
8560         while building Blam-1.2.1 (hard to isolate a test case).
8561
8562 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
8563
8564         Fix for #55382
8565         * class.cs:
8566         (TypeContainer.Define): Renamed to DefineContainerMembers because of
8567         name collision.
8568         (MethodCore.parent_method): New member. The method we're overriding
8569         if this is an override method.
8570         (MethodCore.CheckBase): Moved from Method class and made common.
8571         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
8572         private.
8573         (MethodCore.CheckForDuplications): New abstract method. For custom
8574         member duplication search in a container
8575         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
8576         method and its return type.
8577         (Event.conflict_symbol): New member. Symbol with same name in the
8578         parent class.
8579
8580         * decl.cs:
8581         (MemberCache.FindMemberWithSameName): New method. The method
8582         is looking for conflict with inherited symbols.
8583
8584 2004-08-04  Martin Baulig  <martin@ximian.com>
8585
8586         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8587
8588         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8589
8590 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8591
8592         * report.cs (Message): New enum for better error, warning reference in
8593         the code.
8594         (MessageData): New inner abstract class. It generally handles printing of
8595         error and warning messages.
8596         Removed unused Error, Warning, Message methods.
8597
8598 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8599
8600         Fix for cs0592-8.cs test
8601         * attribute.cs
8602         (Attributable.ValidAttributeTargets): Made public.
8603         (Attribute.ExplicitTarget): New member for explicit target value.
8604         (Attribute.CheckTargets): Now we translate explicit attribute
8605         target to Target here.
8606
8607 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
8608
8609         * ecore.cs (MethodGroupExpr): new IsBase property.
8610
8611         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
8612
8613         * delegate.cs (DelegateCreation): store a MethodGroupExpr
8614         rather than an instance expr.
8615
8616         (DelegateCreation.Emit): Use the method group rather than
8617         the instance expression. Also, if you have base.Foo as the
8618         method for a delegate, make sure to emit ldftn, not ldftnvirt.
8619
8620         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
8621
8622         (NewDelegate.DoResolve): Only check for the existance of Invoke
8623         if the method is going to be needed. Use MethodGroupExpr.
8624
8625         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
8626
8627         * expression.cs: For pointer arith., make sure to use
8628         the size of the type, not the size of the pointer to
8629         the type.
8630
8631 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
8632
8633         Fix for #60722
8634         * class.cs (Class): Added error CS0502 test.
8635
8636 2004-08-03  John Luke  <jluke@cfl.rr.com>
8637             Raja R Harinath  <rharinath@novell.com>
8638
8639         Fix for #60997.
8640         * attribute.cs (Attribute.complained_before): New flag.
8641         (Attribute.ResolveType, Attribute.Resolve),
8642         (Attribute.DefinePInvokeMethod): Set it.
8643         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
8644         
8645 2004-08-03  Martin Baulig  <martin@ximian.com>
8646
8647         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8648         use a user-defined operator; we still need to do numeric
8649         promotions in case one argument is a builtin type and the other
8650         one has an implicit conversion to that type.  Fixes #62322.
8651
8652 2004-08-18  Martin Baulig  <martin@ximian.com>
8653
8654         * class.cs (Method.Define): Use the correct method name when
8655         creating the MethodBuilder for a generic method.
8656
8657 2004-08-17  Martin Baulig  <martin@ximian.com>
8658
8659         * generic.cs (Constraints): Support type parameter constraints.
8660
8661 2004-08-16  Martin Baulig  <martin@ximian.com>
8662
8663         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
8664         (Token.GENERIC_DIMENSION): New token; this is returned if we
8665         encounter an unbound generic type in a typeof() expression.
8666
8667         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
8668         this token is only generated while parsing a typeof() expression.
8669         (typeof_expression): Removed the old unbound_type hack.
8670
8671         * generic.cs (TypeArguments.IsUnbound): New public property.
8672
8673         * decl.cs (MemberName): Added support for unbound types.
8674
8675 2004-08-14  Martin Baulig  <martin@ximian.com>
8676
8677         * typemanager.cs
8678         (TypeManager.IsEqualGenericInstance): New static method.
8679         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
8680         just used to check accessibility, so follow the rules of 26.1.6.        
8681
8682         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
8683         ConstructedType instead of a TypeExpression if we have type arguments.
8684
8685         * cs-parser.jay (typeof_expression): Support unbound generic types.
8686
8687         * ecore.cs (UnboundTypeExpression): New public class.
8688
8689 2004-08-12  Martin Baulig  <martin@ximian.com>
8690
8691         * typemanager.cs (TypeManager.IsNestedChildOf): Use
8692         TypeManager.IsEqual() rather than `=='.
8693
8694         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
8695         generic instances as well.
8696
8697 2004-08-12  Martin Baulig  <martin@ximian.com>
8698
8699         * expression.cs (Invocation.InferType): We can only infer method
8700         type parameters.  Fixes #62647.
8701
8702 2004-08-11  Martin Baulig  <martin@ximian.com>
8703
8704         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
8705         before resolving the base classes.
8706
8707 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
8708
8709         * Makefile: install .mdb file too.
8710
8711 2004-08-05  Martin Baulig  <martin@ximian.com>
8712
8713         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
8714         initializer, the current type is just the TypeBuilder, not the
8715         instantiated generic type.
8716         (FieldExpr.IsFieldInitializer): New public property.
8717
8718 2004-08-04  Martin Baulig  <martin@ximian.com>
8719
8720         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
8721
8722         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
8723
8724 2004-08-03  Martin Baulig  <martin@ximian.com>
8725
8726         * class.cs (MethodData.Define): If we're an explicit
8727         implementation, remove the generic arity from the type name.
8728
8729 2004-08-03  Martin Baulig  <martin@ximian.com>
8730
8731         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
8732         use a user-defined operator; we still need to do numeric
8733         promotions in case one argument is a builtin type and the other
8734         one has an implicit conversion to that type.  Fixes #62322.
8735
8736 2004-08-02  Martin Baulig  <martin@ximian.com>
8737
8738         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
8739         `TypeExpr[]' array.
8740         (TypeContainer.GetClassBases): Return the unexpanded list of
8741         interfaces; we expand them later.
8742         (TypeContainer.DefineType): After creating the TypeBuilder, call
8743         TypeManager.ExpandInterfaces() to get an expanded and resolved
8744         list of interfaces.
8745
8746         * ecore.cs (TypeExpr.GetInterfaces): Removed
8747
8748         * generics.cs (Constraints.InterfaceConstraints): Remove.
8749         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
8750         register the interface constraints.
8751
8752         * typemanager.cs
8753         (TypeManager.AddUserType): Removed the `ifaces' argument.
8754         (TypeManager.AddTypeParameter): Likewise.
8755         (TypeManager.AddUserInterface): Removed, was unused.
8756         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
8757         `TypeExpr[]' array for the interfaces.
8758         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
8759         has been defined, returns a list of the resolved interfaces types.
8760         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
8761         (TypeManager.GetExplicitInterfaces): Likewise.  
8762
8763 2004-08-02  Martin Baulig  <martin@ximian.com>
8764
8765         * expression.cs (Invocation.EmitCall): If we're invoking a method
8766         on a type parameter, use the new `Constrained' prefix opcode.
8767
8768 2004-08-02  Martin Baulig  <martin@ximian.com>
8769
8770         * statement.cs (LocalInfo.Flags): Added `IsThis'.
8771         (LocalInfo.IsThis): New public property.
8772         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
8773
8774 2004-08-01  Martin Baulig  <martin@ximian.com>
8775
8776         * class.cs (TypeContainer.GetClassBases): Don't set the default
8777         here since we may get called from GetPartialBases().
8778         (TypeContainer.DefineType): If GetClassBases() didn't return a
8779         parent, use the default one.
8780
8781 2004-07-30  Martin Baulig  <martin@ximian.com>
8782
8783         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
8784
8785         * class.cs (SourceMethod): New public class, derive from the
8786         symbol writer's ISourceMethod.
8787         (Method): Use the new symbol writer API.
8788
8789         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
8790         as argument and use the new symbol writer.
8791
8792         * location.cs
8793         (SourceFile): Implement the symbol writer's ISourceFile.
8794         (Location.SymbolDocument): Removed.
8795         (Location.SourceFile): New public property.
8796
8797         * symbolwriter.cs: Use the new symbol writer API.
8798
8799 2004-07-30  Raja R Harinath  <rharinath@novell.com>
8800
8801         * Makefile (install-local): Remove.  Functionality moved to
8802         executable.make.
8803
8804 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
8805
8806         * Makefile: Install mcs.exe.config file together with mcs.exe.
8807         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
8808         correct runtime version.
8809         
8810 2004-07-25  Martin Baulig  <martin@ximian.com>
8811
8812         * class.cs
8813         (TypeContainer.RegisterOrder): Removed, this was unused.
8814         (TypeContainer, interface_order): Removed.
8815         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
8816         TypeContainer as argument since we can also be called with a
8817         `PartialContainer' for a partial class/struct/interface.
8818         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
8819         of checking whether we're an `Interface' - we could be a
8820         `PartialContainer'.
8821         (PartialContainer.Register): Override; call
8822         AddClass()/AddStruct()/AddInterface() on our parent.
8823
8824         * cs-parser.jay (interface_member_declaration): Add things to the
8825         `current_container', not the `current_class'.
8826
8827         * rootcontext.cs (RegisterOrder): The overloaded version which
8828         takes an `Interface' was unused, removed.
8829
8830         * typemanager.cs (TypeManager.LookupInterface): Return a
8831         `TypeContainer', not an `Interface'.
8832         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
8833         contain a `PartialContainer' for an interface, so check it's
8834         `Kind' to figure out what it is.
8835
8836 2004-07-25  Martin Baulig  <martin@ximian.com>
8837
8838         * class.cs (Class.DefaultTypeAttributes): New public constant.
8839         (Struct.DefaultTypeAttributes): Likewise.
8840         (Interface.DefaultTypeAttributes): Likewise.
8841         (PartialContainer.TypeAttr): Override this and add the
8842         DefaultTypeAttributes.
8843
8844 2004-07-25  Martin Baulig  <martin@ximian.com>
8845
8846         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
8847         we can just use the `Parent' field instead.
8848
8849 2004-07-25  Martin Baulig  <martin@ximian.com>
8850
8851         * class.cs (TypeContainer.Emit): Renamed to EmitType().
8852
8853 2004-07-25  Martin Baulig  <martin@ximian.com>
8854
8855         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
8856         our parts before defining any methods.
8857         (TypeContainer.VerifyImplements): Make this virtual.
8858         (ClassPart.VerifyImplements): Override and call VerifyImplements()
8859         on our PartialContainer.
8860
8861 2004-07-25  Martin Baulig  <martin@ximian.com>
8862
8863         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
8864
8865         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
8866         argument, we can just use the `Parent' field instead.
8867
8868         * class.cs
8869         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
8870         (MemberBase.DoDefine): Likewise.
8871
8872 2004-07-24  Martin Baulig  <martin@ximian.com>
8873
8874         * decl.cs (MemberCore.Parent): New public field.
8875         (DeclSpace.Parent): Moved to MemberCore.
8876
8877         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
8878         (MemberBase.ctor): Added TypeContainer argument, pass it to our
8879         parent's .ctor.
8880         (FieldBase, Field, Operator): Likewise.
8881         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
8882         (EventField, Event): Likewise.
8883
8884 2004-07-23  Martin Baulig  <martin@ximian.com>
8885
8886         * class.cs (PartialContainer): New public class.
8887         (ClassPart): New public class.
8888         (TypeContainer): Added support for partial classes.
8889         (TypeContainer.GetClassBases): Splitted some of the functionality
8890         out into GetNormalBases() and GetPartialBases().
8891
8892         * cs-tokenizer.cs (Token.PARTIAL): New token.
8893         (Tokenizer.consume_identifier): Added some hacks to recognize
8894         `partial', but only if it's immediately followed by `class',
8895         `struct' or `interface'.
8896
8897         * cs-parser.jay: Added support for partial clases.
8898
8899 2004-07-23  Martin Baulig  <martin@ximian.com>
8900
8901         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8902         a `DeclSpace' and also made it readonly.
8903         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8904         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8905         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8906
8907         * cs-parser.jay: Pass the `current_class', not the
8908         `current_container' (at the moment, this is still the same thing)
8909         to a new Method, Property, Event, Indexer or Constructor.
8910
8911 2004-07-23  Martin Baulig  <martin@ximian.com>
8912
8913         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8914         and removed the `current_interface' one.
8915         (struct_declaration, class_declaration, interface_declaration):
8916         Set `current_class' to the newly created class/struct/interface;
8917         set their `Bases' and call Register() before parsing their body.
8918
8919 2004-07-23  Martin Baulig  <martin@ximian.com>
8920
8921         * class.cs (Kind): New public enum.
8922         (TypeContainer): Made this class abstract.
8923         (TypeContainer.Kind): New public readonly field.
8924         (TypeContainer.CheckDef): New public method; moved here from
8925         cs-parser.jay.
8926         (TypeContainer.Register): New public abstract method.
8927         (TypeContainer.GetPendingImplementations): New public abstract
8928         method.
8929         (TypeContainer.GetClassBases): Removed the `is_class' and
8930         `is_iface' parameters.
8931         (TypeContainer.DefineNestedTypes): Formerly known as
8932         DoDefineType().
8933         (ClassOrStruct): Made this class abstract.
8934
8935         * tree.cs (RootTypes): New public type. 
8936
8937 2004-07-20  Martin Baulig  <martin@ximian.com>
8938
8939         * tree.cs (Tree.RecordNamespace): Removed.
8940         (Tree.Namespaces): Removed.
8941
8942         * rootcontext.cs (RootContext.IsNamespace): Removed.
8943
8944         * cs-parser.jay (namespace_declaration): Just create a new
8945         NamespaceEntry here.
8946
8947 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
8948
8949         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
8950         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
8951         entry to make sure it runs in the correct runtime version.
8952         
8953 2004-07-18  Martin Baulig  <martin@ximian.com>
8954
8955         * generic.cs (ConstructedType.CheckConstraints): Improved
8956         constraints checking.
8957
8958 2004-07-18  Martin Baulig  <martin@ximian.com>
8959
8960         * expression.cs (Invocation.BetterMethod): Call
8961         TypeManager.TypeToCoreType() on all types and removed my previous
8962         hack; we're already doig the right thing here.
8963
8964 2004-07-17  Martin Baulig  <martin@ximian.com>
8965
8966         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
8967
8968 2004-07-16  Martin Baulig  <martin@ximian.com>
8969
8970         * iterators.cs: Added generics support.
8971
8972 2004-07-16  Martin Baulig  <martin@ximian.com>
8973
8974         * iterators.cs: Rewrote this.  We're now using one single Proxy
8975         class for both the IEnumerable and the IEnumerator interface and
8976         `Iterator' derives from Class so we can use the high-level API.
8977
8978         * class.cs (TypeContainer.AddIterator): New method.
8979         (TypeContainer.DoDefineType): New protected virtual method, which
8980         is called from DefineType().
8981         (TypeContainer.DoDefineMembers): Call DefineType() and
8982         DefineMembers() on all our iterators.
8983         (TypeContainer.Emit): Call Emit() on all our iterators.
8984         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8985
8986         * codegen.cs (EmitContext.CurrentIterator): New public field.
8987
8988 2004-07-15  Martin Baulig  <martin@ximian.com>
8989
8990         * typemanager.cs
8991         (TypeManager.not_supported_exception_type): New type.   
8992
8993 2004-07-14  Martin Baulig  <martin@ximian.com>
8994
8995         * typemanager.cs
8996         (TypeManager.generic_ienumerable_type): New type.
8997         (TypeManager.generic_ienumerator_type): New type.
8998
8999         * rootcontext.cs
9000         (RootContext.interfaces_first_stage): Added
9001         "System.Collections.Generic.IEnumerator`1" and
9002         "System.Collections.Generic.IEnumerable`1".     
9003
9004 2004-07-14  Martin Baulig  <martin@ximian.com>
9005
9006         * iterators.cs: Use real error numbers.
9007
9008 2004-07-14  Martin Baulig  <martin@ximian.com>
9009
9010         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9011         requires this to be a System.Collection.IEnumerable and not a
9012         class implementing that interface.
9013         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9014
9015 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9016
9017         * class.cs: Fixed previous fix, it broke some error tests.
9018
9019 2004-07-12  Martin Baulig  <martin@ximian.com>
9020
9021         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9022         Fixes #61293.
9023
9024 2004-07-14  Martin Baulig  <martin@ximian.com>
9025
9026         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9027         an exclamation mark (!) for the generic arity to reflect the
9028         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9029
9030 2004-07-13  Martin Baulig  <martin@ximian.com>
9031
9032         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9033         specifiers being part of a type argument.
9034
9035 2004-07-13  Martin Baulig  <martin@ximian.com>
9036
9037         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9038         name for generic types.
9039
9040 2004-07-13  Martin Baulig  <martin@ximian.com>
9041
9042         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9043         bit to fix #60119.
9044
9045 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9046
9047         * assign.cs (LocalTemporary): Add new argument: is_address,If
9048         `is_address' is true, then the value that we store is the address
9049         to the real value, and not the value itself.
9050         
9051         * ecore.cs (PropertyExpr): use the new local temporary
9052         stuff to allow us to handle X.Y += z (where X is a struct)
9053
9054 2004-07-08  Martin Baulig  <martin@ximian.com>
9055
9056         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9057         not always return, just like we're doing in Using.Resolve().
9058
9059 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9060
9061         * cs-parser.jay (fixed_statement): flag this as Pinned.
9062
9063 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9064
9065         * typemanager.cs (TypeManager): Removed MakePinned method, this
9066         mechanism is replaced with the .NET 2.x compatible mechanism of
9067         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9068
9069         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9070         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9071         `IsFixed' property which has a different meaning.
9072
9073 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9074
9075         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9076         visible from inside a nested class, not just the names of the
9077         immediately enclosing class.
9078         Fix for bug #60730.
9079
9080 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9081
9082         * expression.cs (BetterConversion): Remove buggy special-case
9083         handling of "implicit constant expression conversions".  At this
9084         point, we already know that the conversion is possible -- we're
9085         only checking to see which is better.
9086
9087 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9088
9089         * cs-parser.jay: Added error CS0210 test.
9090
9091 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9092
9093         * cs-parser.jay: Added error CS0134 test.
9094
9095 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9096
9097         Fix bug #52507
9098         * cs-parser.jay: Added error CS0145 test.
9099
9100 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9101
9102         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9103
9104 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9105         
9106         * expression.cs (StackAlloc.Resolve): The argument may not
9107         be a constant; deal with this case.
9108         
9109 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9110
9111         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9112         GetIndexerAttributeValue.
9113         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9114
9115         * class.cs (Indexer.Define): Added error tests for CS0415,
9116         CS0609.
9117
9118 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9119
9120         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9121         property code.
9122
9123 2004-06-23  Martin Baulig  <martin@ximian.com>
9124
9125         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9126         neither return nor throw, reset the barrier as well.  Fixes #60457.
9127
9128 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9129
9130         * class.cs : EventAttributes is now set to None by default.
9131           This fixes bug #60459.
9132
9133 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9134
9135         Fix bug #60219
9136         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9137         Don't throw exception but return null (it's sufficient now).
9138
9139 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9140
9141         * typemanager.cs (GetArgumentTypes): Faster implementation.
9142
9143 2004-06-18  Martin Baulig  <martin@ximian.com>
9144
9145         * attribute.cs (Attribute.Resolve): Check whether we're an
9146         EmptyCast which a Constant child.  Fixes #60333.
9147
9148 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9149
9150         * statement.cs (EmitCollectionForeach): Account for the fact that
9151         not all valuetypes are in areas which we can take the address of.
9152         For these variables, we store to a temporary variable. Also, make
9153         sure that we dont emit a `callvirt' on a valuetype method.
9154
9155 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9156
9157         * expression.cs (StackAlloc.DoReSolve): Added test for
9158         negative parameter (CS0247).
9159
9160 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9161
9162         Fix bug #59792
9163         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9164
9165 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9166
9167         Fix bug #59781
9168         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9169         ulong.
9170
9171 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9172
9173         Fix bug #58254 & cs1555.cs, cs1556.cs
9174         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9175
9176 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9177
9178         * cs-parser.jay: Added error CS1669 test for indexers.
9179
9180 2004-06-18  Martin Baulig  <martin@ximian.com>
9181
9182         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9183         argument.  Fixes #60441.
9184
9185 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9186         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9187         The name needs to have the actual name of the method in order
9188         for other tests (such as the one in OverloadResolve for Invoke
9189         on a delegate) to work. As well, it does not really help
9190         error reporting because the method group had multiple methods.
9191         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9192         Make profiling work.
9193         
9194 2004-06-13  Martin Baulig  <martin@ximian.com>
9195
9196         * cs-parser.jay: Don't allow generic attributes.
9197
9198 2004-06-13  Martin Baulig  <martin@ximian.com>
9199
9200         * class.cs (MemberBase.DoDefineBase): New protected method.
9201         (MemberBase.DoDefine): Compute the `flags' in the new
9202         DoDefineBase() which must be called first.
9203         (Method.Define): Call DoDefineBase() first so we have the flags
9204         when defining the generic method.
9205
9206         * cs-parser.jay (interface_method_declaration): Support generic methods.
9207
9208 2004-06-13  Martin Baulig  <martin@ximian.com>
9209
9210         * decl.cs (TypeName): Removed.
9211         (MemberName): Removed TypeName and MemberNow; now we just have
9212         MemberName.
9213
9214         * cs-parser.jay: Don't distinguish between type arguments and type
9215         parameters in the grammar and simplified the rules a bit.  The
9216         reduce/reduce conflicts are now gone (except the one we inherited
9217         from mcs).
9218
9219 2004-06-11  Martin Baulig  <martin@ximian.com>
9220
9221         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9222         call this twice: for params and varargs methods.
9223
9224 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9225
9226         * class.cs:
9227         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9228
9229 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9230
9231         * attribute.cs (Attribute.GetValidTargets): Made public.
9232
9233         * class.cs: 
9234         (AbstractPropertyEventMethod): New class for better code sharing.
9235         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
9236         CS1667 report.
9237         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
9238
9239 2004-06-09  Martin Baulig  <martin@ximian.com>
9240
9241         * cs-parser.jay: Removed a reduce/reduce conflict.
9242
9243 2004-06-03  Martin Baulig  <martin@ximian.com>
9244
9245         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
9246         GetSimpleName() and return a SimpleName.
9247
9248         * ecore.cs (SimpleName.Arguments): New public field.
9249         (SimpleName): Added overloaded ctor which takes an additional
9250         TypeArguments argument.
9251         (SimpleName.SimpleNameResolve): Added support for generic methods.
9252         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
9253         formerly in MemberAccess.DoResolve(), but we also need it in
9254         SimpleNameResolve().
9255
9256         * expression.cs (MemberAccess.DoResolve): Use the new
9257         MethodGroupExpr.ResolveGeneric().       
9258
9259 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9260
9261         * decl.cs: If possible, use lookuptypedirect here. We can only do
9262         this if there is no `.' after the namespace. Avoids using
9263         LookupType, which does lots of slow processing.
9264         (FindNestedType) New method, does what it says :-).
9265         * namespace.cs: use LookupTypeDirect.
9266         * rootcontext.cs: use membercache, if possible.
9267         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9268
9269 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9270
9271         * expression.cs:
9272         According to the spec, 
9273
9274         In a member access of the form E.I, if E is a single identifier,
9275         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9276         field, property, localvariable, or parameter with the same type as
9277         the meaning of E as a type-name (§3.8), then both possible
9278         meanings of E are permitted.
9279
9280         We did not check that E as a simple-name had the same type as E as
9281         a type name.
9282
9283         This trivial check gives us 5-7% on bootstrap time.
9284
9285 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9286
9287         * expression.cs (Invocation.OverloadResolve): Avoid the
9288         use of hashtables and boxing here by allocating on demand.
9289
9290 2004-05-30  Martin Baulig  <martin@ximian.com>
9291
9292         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9293         we're doing a silent lookup.  Don't try to lookup nested types in
9294         TypeManager.object_type (thanks to Ben Maurer).
9295
9296 2004-05-30  Martin Baulig  <martin@ximian.com>
9297
9298         Committing a patch from Ben Maurer.
9299
9300         * rootcontext.cs (RootContext.LookupType): Cache negative results.
9301
9302 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9303
9304         * convert.cs: add a trivial cache for overload operator resolution.
9305
9306 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
9307
9308         * attribute.cs
9309         (AttributeTester.GetObsoleteAttribute): Returns instance of
9310         ObsoleteAttribute when type is obsolete.
9311
9312         * class.cs
9313         (TypeContainer.VerifyObsoleteAttribute): Override.
9314         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
9315         (MethodCode.VerifyObsoleteAttribute): Override.
9316         (MemberBase.VerifyObsoleteAttribute): Override.
9317
9318         * decl.cs
9319         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
9320         and report proper error.
9321
9322         *delegate.cs
9323         (Delegate.VerifyObsoleteAttribute): Override.
9324
9325         * ecore.cs
9326         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
9327         and report proper error.
9328         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
9329
9330         * enum.cs
9331         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
9332         and enum member.
9333
9334         * expression.cs
9335         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
9336         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
9337         Added test for ObsoleteAttribute.
9338
9339         * statement.cs
9340         (Catch): Derived from Statement.
9341
9342 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9343
9344         * decl.cs: If possible, use lookuptypedirect here. We can only do
9345         this if there is no `.' after the namespace. Avoids using
9346         LookupType, which does lots of slow processing.
9347         (FindNestedType) New method, does what it says :-).
9348         * namespace.cs: use LookupTypeDirect.
9349         * rootcontext.cs: use membercache, if possible.
9350         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
9351
9352 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9353
9354         * expression.cs:
9355         According to the spec, 
9356
9357         In a member access of the form E.I, if E is a single identifier,
9358         and if the meaning of E as a simple-name (§7.5.2) is a constant,
9359         field, property, localvariable, or parameter with the same type as
9360         the meaning of E as a type-name (§3.8), then both possible
9361         meanings of E are permitted.
9362
9363         We did not check that E as a simple-name had the same type as E as
9364         a type name.
9365
9366         This trivial check gives us 5-7% on bootstrap time.
9367
9368 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9369
9370         Fixed bug #59071 & cs0160.cs
9371         * statement.cs (Try.Resolve): Check here whether order of catch
9372         clauses matches their dependencies.
9373
9374 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
9375
9376         Fixed bug #58624
9377         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
9378         unsafe type.
9379
9380 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9381
9382         * expression.cs (Invocation.OverloadResolve): Avoid the
9383         use of hashtables and boxing here by allocating on demand.
9384
9385 2004-05-30  Martin Baulig  <martin@ximian.com>
9386
9387         * rootcontext.cs (RootContext.LookupType): Don't cache things if
9388         we're doing a silent lookup.  Don't try to lookup nested types in
9389         TypeManager.object_type (thanks to Ben Maurer).
9390
9391 2004-05-30  Martin Baulig  <martin@ximian.com>
9392
9393         Committing a patch from Ben Maurer.
9394
9395         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
9396
9397 2004-05-29  Martin Baulig  <martin@ximian.com>
9398
9399         * class.cs (IMethodData.ShouldIgnore): New method.
9400
9401         * typemanager.cs (TypeManager.MethodFlags): Don't take a
9402         `Location' argument, we don't need it anywhere.  Use
9403         `IMethodData.ShouldIgnore ()' instead of
9404         `MethodData.GetMethodFlags ()'.
9405         (TypeManager.AddMethod): Removed.
9406         (TypeManager.AddMethod2): Renamed to AddMethod.
9407
9408 2004-05-29  Martin Baulig  <martin@ximian.com>
9409
9410         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
9411
9412         * convert.cs (Convert.ImplicitReferenceConversion): If we're
9413         converting from a class type S to an interface type and we already
9414         have an object on the stack, don't box it again.  Fixes #52578.
9415
9416 2004-05-29  Martin Baulig  <martin@ximian.com>
9417
9418         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9419         Added support for `params' parameters.  Fixes #59267.
9420
9421 2004-05-29  Martin Baulig  <martin@ximian.com>
9422
9423         * literal.cs (NullPointer): Provide a private .ctor which sets
9424         `type' to TypeManager.object_type.  Fixes #59048.
9425
9426 2004-05-29  Martin Baulig  <martin@ximian.com>
9427
9428         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
9429         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
9430
9431         * ecore.cs (EventExpr.instance_expr): Make the field private.
9432
9433 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
9434
9435         Fixed bug #50080 & cs0214-2.cs
9436         * expression.cs (Cast.DoResolve): Check unsafe context here.
9437         
9438         * statement.cs (Resolve.DoResolve): Likewise.
9439
9440 2004-05-26  Martin Baulig  <martin@ximian.com>
9441
9442         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
9443
9444         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
9445         (RootContext.LookupType): Pass down the `silent' flag.
9446
9447 2004-05-25  Martin Baulig  <martin@ximian.com>
9448
9449         * expression.cs
9450         (MethodGroupExpr.IdenticalTypeName): New public property.
9451         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
9452         expression actually refers to a type.
9453
9454 2004-05-25  Martin Baulig  <martin@ximian.com>
9455
9456         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
9457         for #56176 and made it actually work.
9458
9459 2004-05-25  Martin Baulig  <martin@ximian.com>
9460
9461         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
9462         (FieldExpr, PropertyExpr): Override and implement
9463         CacheTemporaries.  Fixes #52279.
9464
9465 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
9466
9467         * location.cs: In the new compiler listing a file twice is a
9468         warning, not an error.
9469
9470 2004-05-24  Martin Baulig  <martin@ximian.com>
9471
9472         * enum.cs (Enum.DefineType): For the `BaseType' to be a
9473         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
9474
9475 2004-05-24  Martin Baulig  <martin@ximian.com>
9476
9477         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
9478         walking the `using' list.  Fixes #53921.
9479
9480 2004-05-24  Martin Baulig  <martin@ximian.com>
9481
9482         * const.cs (Const.LookupConstantValue): Added support for
9483         EmptyCast's; fixes #55251.
9484
9485 2004-05-24  Martin Baulig  <martin@ximian.com>
9486
9487         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
9488         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
9489         which does the CS0135 check.  The reason is that we first need to
9490         check whether the variable actually exists.
9491
9492 2004-05-24  Martin Baulig  <martin@ximian.com>
9493
9494         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
9495         than RootContext.LookupType() to find the explicit interface
9496         type.  Fixes #58584.
9497
9498 2004-05-24  Raja R Harinath  <rharinath@novell.com>
9499
9500         * Makefile: Simplify.  Use executable.make.
9501         * mcs.exe.sources: New file.  List of sources of mcs.exe.
9502
9503 2004-05-24  Anders Carlsson  <andersca@gnome.org>
9504
9505         * decl.cs:
9506         * enum.cs:
9507         Use the invariant culture when doing String.Compare for CLS case
9508         sensitivity.
9509         
9510 2004-05-23  Martin Baulig  <martin@ximian.com>
9511
9512         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
9513         don't have any dots.  Fixes #52622, added cs0246-8.cs.
9514
9515         * namespace.cs (NamespaceEntry.Lookup): Likewise.
9516
9517 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9518
9519         * class.cs (MemberBase.Define): Reuse MemberType member for 
9520         resolved type. Other methods can use it too.
9521
9522 2004-05-23  Martin Baulig  <martin@ximian.com>
9523
9524         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
9525         the variable also exists in the current block (otherwise, we need
9526         to report a CS0103).  Fixes #58670.
9527
9528 2004-05-23  Martin Baulig  <martin@ximian.com>
9529
9530         * flowanalysis.cs (Reachability.Reachable): Compute this
9531         on-the-fly rather than storing it as a field.
9532
9533 2004-05-23  Martin Baulig  <martin@ximian.com>
9534
9535         * flowanalysis.cs (Reachability.And): Manually compute the
9536         resulting `barrier' from the reachability.      
9537        
9538 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
9539
9540         Fix bug #57835
9541         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
9542         instance of ObsoleteAttribute when symbol is obsolete.
9543
9544         * class.cs
9545         (IMethodData): Extended interface for ObsoleteAttribute support.
9546
9547 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9548
9549         * attribute.cs: Fix bug #55970
9550
9551 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
9552
9553         Fix bug #52705
9554         * attribute.cs
9555         (GetObsoleteAttribute): New method. Creates the instance of
9556         ObsoleteAttribute.
9557         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
9558         ObsoleteAttribute when member is obsolete.
9559         (AttributeTester.Report_ObsoleteMessage): Common method for
9560         Obsolete error/warning reporting.
9561
9562         * class.cs
9563         (TypeContainer.base_classs_type): New member for storing parent type.
9564
9565         * decl.cs
9566         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
9567         for this MemberCore.
9568
9569 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9570
9571         * attribute.cs, const.cs: Fix bug #58590
9572
9573 2004-05-21  Martin Baulig  <martin@ximian.com>
9574
9575         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
9576         out parameters if the end of the method is unreachable.  Fixes
9577         #58098. 
9578
9579 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9580
9581         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
9582         Hari was right, why extra method.
9583
9584 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
9585
9586         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
9587
9588 2004-05-20  Martin Baulig  <martin@ximian.com>
9589
9590         * delegate.cs: Convert this file to Unix mode - like the original
9591         version in mcs is.
9592
9593 2004-05-20  Martin Baulig  <martin@ximian.com>
9594
9595         * attribute.cs: Convert this file to Unix mode - like the original
9596         version in mcs is.
9597
9598 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
9599
9600        Fix bug #58688 (MCS does not report error when the same attribute
9601        is assigned twice)
9602
9603        * attribute.cs (Attribute.Emit): Distinction between null and default.
9604
9605 2004-05-19  Raja R Harinath  <rharinath@novell.com>
9606
9607        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
9608        of a top-level attribute without an attribute target.
9609        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
9610        Make non-static.
9611        (Attribute.Conditional_GetConditionName), 
9612        (Attribute.Obsolete_GetObsoleteMessage): Update.
9613        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
9614        part of ScanForIndexerName.
9615        (Attribute.CanIgnoreInvalidAttribute): New function.
9616        (Attribute.ScanForIndexerName): Move to ...
9617        (Attributes.ScanForIndexerName): ... here.
9618        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
9619        (Attributes.Search): New internal variant that can choose not to
9620        complain if types aren't resolved.  The original signature now
9621        complains.
9622        (Attributes.GetClsCompliantAttribute): Use internal variant, with
9623        complaints suppressed.
9624        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
9625        only if it not useful.
9626        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
9627        top-level for attributes that are shared between the assembly
9628        and a top-level class.
9629        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
9630        * class.cs: Update to reflect changes.
9631        (DefineIndexers): Fuse loops.
9632        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
9633        a couple more variants of attribute names.
9634
9635 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
9636
9637         Fix bug #52585 (Implemented explicit attribute declaration)
9638
9639         * attribute.cs:
9640         (Attributable.ValidAttributeTargets): New abstract method. It gets
9641         list of valid attribute targets for explicit target declaration.
9642         (Attribute.Target): It holds target itself.
9643         (AttributeSection): Removed.
9644         (Attribute.CheckTargets): New method. It checks whether attribute
9645         target is valid for the current element.
9646
9647         * class.cs:
9648         (EventProperty): New class. For events that are declared like
9649         property (with add and remove accessors).
9650         (EventField): New class. For events that are declared like field.
9651         class.cs
9652
9653         * cs-parser.jay: Implemented explicit attribute target declaration.
9654
9655         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
9656         Override ValidAttributeTargets.
9657
9658         * parameter.cs:
9659         (ReturnParameter): Class for applying custom attributes on 
9660         the return type.
9661         (ParameterAtribute): New class. Class for applying custom
9662         attributes on the parameter type.
9663
9664 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
9665
9666         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
9667         definitions. 
9668
9669         (Method): Allow UNSAFE here.
9670
9671         * modifiers.cs: Support unsafe reporting.
9672
9673 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
9674
9675         * decl.cs: Fix bug #58478.
9676
9677 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9678
9679         * statement.cs: When checking for unreachable code on an EmptyStatement,
9680         set the location. Fixes bug #58488.
9681
9682 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
9683
9684         * driver.cs: Add -pkg handling.
9685
9686         From Gonzalo: UseShelLExecute=false
9687
9688 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
9689
9690         * attribute.cs:
9691         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
9692         for attribute.
9693         (Attribute.IsClsCompliaceRequired): Moved to base for better
9694         accesibility.
9695         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
9696         when attribute is AttributeUsageAttribute.
9697         (Attribute.GetValidTargets): Simplified.
9698         (Attribute.GetAttributeUsage): New method returns AttributeUsage
9699         attribute for this type.
9700         (Attribute.ApplyAttributes): Method renamed to Emit and make
9701         non-static.
9702         (GlobalAttributeSection): New class for special handling of global
9703         attributes (assembly, module).
9704         (AttributeSection.Emit): New method.
9705
9706         * class.cs: Implemented Attributable abstract methods.
9707         (MethodCore.LabelParameters): Moved to Parameter class.
9708         (Accessor): Is back simple class.
9709         (PropertyMethod): Implemented Attributable abstract class.
9710         (DelegateMethod): Implemented Attributable abstract class.
9711         (Event): New constructor for disctintion between normal Event
9712         and Event with accessors.
9713
9714         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
9715
9716         * codegen.cs, const.cs, decl.cs, delegate.cs:
9717         (CommonAssemblyModulClass): Implemented Attributable abstract class
9718         and simplified.
9719
9720         * enum.cs: Implement IAttributeSupport interface.
9721         (EnumMember): New class for emum members. Implemented Attributable
9722         abstract class
9723
9724         * parameter.cs:
9725         (ParameterBase): Is abstract.
9726         (ReturnParameter): New class for easier [return:] attribute handling.
9727
9728         * typemanager.cs: Removed builder_to_attr.
9729
9730 2004-05-11  Raja R Harinath  <rharinath@novell.com>
9731
9732         Fix bug #57151.
9733         * attribute.cs (Attribute.GetPositionalValue): New function.
9734         * class.cs (TypeContainer.VerifyMembers): New function.
9735         (TypeContainer.Emit): Use it.
9736         (ClassOrStruct): New base class for Class and Struct.
9737         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
9738         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
9739         class.
9740         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
9741         then each non-static field should have a FieldOffset attribute.
9742         Otherwise, none of the fields should have a FieldOffset attribute.
9743         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
9744         and FieldOffset attributes.
9745         * typemanager.cs (TypeManager.struct_layout_attribute_type)
9746         (TypeManager.field_offset_attribute_type): New core types.
9747         (TypeManager.InitCoreTypes): Initialize them.
9748
9749 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
9750
9751         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
9752         Return correct type.
9753         From bug #58270.
9754
9755 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
9756
9757         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
9758         be implicitly converted to ulong.
9759         
9760         * expression.cs: The logic for allowing operator &, | and ^ worked
9761         was wrong, it worked before because we did not report an error in
9762         an else branch.  Fixes 57895.
9763
9764         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
9765         allow volatile fields to be reference types.
9766
9767 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
9768
9769         * driver.cs: Add support for /debug-
9770
9771 2004-05-07  Raja R Harinath  <rharinath@novell.com>
9772
9773         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
9774         Add a 'complain' parameter to silence errors.
9775         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
9776         silently overlooked type-resolutions.
9777         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
9778         to reflect changes.
9779         (Attributes.Search): New function.
9780         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9781         (Attributes.GetAttributeFullName): Remove hack.
9782         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9783         Update to reflect changes.
9784         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9785         Use Attributes.Search instead of nested loops.
9786
9787 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9788
9789         * decl.cs:
9790         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9791         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9792         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9793
9794         * report.cs: (Report.Warning): Renamed to Warning_T because of
9795         parameter collision.
9796
9797 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9798
9799         * expression.cs (MemberAccess.ResolveMemberAccess):
9800         Exit with non-zero status after Report.Error.
9801         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9802         Likewise.
9803         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9804
9805 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9806
9807         * support.cs: Don't hang when the file is empty.
9808
9809 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9810
9811         * support.cs: In SeekableStreamReader, compute the preamble size of the
9812           underlying stream. Position changes should take into account that initial
9813           count of bytes.
9814
9815 2004-05-03  Todd Berman  <tberman@sevenl.net>
9816
9817         * driver.cs: remove unused GetSysVersion function.
9818
9819 2004-05-03  Todd Berman  <tberman@sevenl.net>
9820
9821         * driver.cs: Remove the hack from saturday, as well as the hack
9822         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9823         link_paths to get that bit proper.
9824
9825 2004-05-01  Todd Berman  <tberman@sevenl.net>
9826
9827         * driver.cs: Try a LoadFrom before a Load, this checks the current
9828         path. This is currently a bug in mono that is be fixed, however, this
9829         provides a workaround for now. This will be removed when the bug
9830         is fixed.
9831
9832 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9833
9834         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9835         incomplete key pairs (#57941).
9836
9837 2004-05-01  Todd Berman  <tberman@sevenl.net>
9838
9839         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9840         from the GAC
9841
9842 2004-04-30  Jackson Harper  <jackson@ximian.com>
9843
9844         * codegen.cs: Open keys readonly.
9845         
9846 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9847
9848         * typemanager.cs: don't report cyclic struct layout when a struct
9849         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9850         which has 2 Pango.Rectangle fields.
9851
9852 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9853
9854         * expression.cs: Handle IntPtr comparisons with IL code
9855         rather than a method call.
9856
9857 2004-04-29  Martin Baulig  <martin@ximian.com>
9858
9859         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9860         the list of PropertyInfo's in class hierarchy and find the
9861         accessor.  Fixes #56013.
9862
9863 2004-04-29  Martin Baulig  <martin@ximian.com>
9864
9865         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9866
9867 2004-04-29  Martin Baulig  <martin@ximian.com>
9868
9869         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9870
9871         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9872
9873 2004-04-29  Martin Baulig  <martin@ximian.com>
9874
9875         * class.cs (ConstructorInitializer.Resolve): Check whether the
9876         parent .ctor is accessible.  Fixes #52146.
9877
9878 2004-04-29  Martin Baulig  <martin@ximian.com>
9879
9880         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9881
9882         * statement.cs (Using.EmitLocalVariableDecls): Use
9883         TypeManager.idisposable_type, not typeof (IDisposable).
9884         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9885
9886 2004-04-29  Martin Baulig  <martin@ximian.com>
9887
9888         * class.cs (Event.Define): Don't emit the field and don't set
9889         RTSpecialName and SpecialName for events on interfaces.  Fixes
9890         #57703. 
9891
9892 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9893
9894         Refactor Attribute.ApplyAttributes.
9895         * attribute.cs (Attributable): New base class for objects that can
9896         have Attributes applied on them.
9897         (Attribute): Make AttributeUsage fields public.
9898         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9899         (Attribute.IsInternalCall): New property.
9900         (Attribute.UsageAttr): Convert to a public read-only property.
9901         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9902         (Attribute.ResolveType, Attribute.Resolve)
9903         (Attribute.ScanForIndexerName): Update to reflect changes.
9904         (Attribute.CheckAttributeTarget): Re-format.
9905         (Attribute.ApplyAttributes): Refactor, to various
9906         Attributable.ApplyAttributeBuilder methods.
9907         * decl.cs (MemberCore): Make Attributable.
9908         * class.cs (Accessor): Make Attributable.
9909         (MethodData.ApplyAttributes): Use proper attribute types, not
9910         attribute names.
9911         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9912         (TypeContainer.ApplyAttributeBuilder)
9913         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9914         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9915         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9916         (Operator.ApplyAttributeBuilder): New factored-out methods.
9917         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9918         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9919         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9920         * parameter.cs (ParameterBase): New Attributable base class
9921         that can also represent Return types.
9922         (Parameter): Update to the changes.
9923
9924 2004-04-29  Jackson Harper  <jackson@ximian.com>
9925
9926         * driver.cs: Prefer the corlib system version when looking for
9927         assemblies in the GAC. This is still a hack, but its a better hack
9928         now.
9929         
9930 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9931
9932         * decl.cs, enum.cs: Improved error 3005 reporting.
9933   
9934         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9935         (related_symbols): New private member for list of symbols
9936         related to reported error/warning.
9937         
9938         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9939
9940 2004-04-29  Martin Baulig  <martin@ximian.com>
9941
9942         * ecore.cs (Expression.Constantify): If we're an enum and
9943         TypeManager.TypeToCoreType() doesn't give us another type, use
9944         t.UnderlyingSystemType.  Fixes #56178.  
9945
9946 2004-04-29  Martin Baulig  <martin@ximian.com>
9947
9948         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9949         interfaces and for each interface, only add members directly
9950         declared in that interface.  Fixes #53255.
9951
9952 2004-04-28  Martin Baulig  <martin@ximian.com>
9953
9954         * expression.cs (ConditionalLogicalOperator): Use a temporary
9955         variable for `left' to avoid that we evaluate it more than once;
9956         bug #52588.
9957
9958 2004-04-28  Martin Baulig  <martin@ximian.com>
9959
9960         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9961         `void[]' (CS1547).
9962
9963 2004-04-28  Martin Baulig  <martin@ximian.com>
9964
9965         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9966         void (CS1547).
9967
9968         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9969         whether the type is not void (CS1547).
9970
9971 2004-04-28  Martin Baulig  <martin@ximian.com>
9972
9973         * expression.cs (Unary.DoResolveLValue): Override this and report
9974         CS0131 for anything but Operator.Indirection.
9975
9976 2004-04-28  Martin Baulig  <martin@ximian.com>
9977
9978         Committing a patch from Ben Maurer; see bug #50820.
9979
9980         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9981         check for classes.
9982
9983         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9984         classes.        
9985
9986 2004-04-28  Martin Baulig  <martin@ximian.com>
9987
9988         Committing a patch from Ben Maurer; see bug #50820.
9989
9990         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9991         check for classes.
9992
9993         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9994         classes.        
9995
9996 2004-04-28  Martin Baulig  <martin@ximian.com>
9997
9998         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9999         (Block.AddLabel): Call DoLookupLabel() to only search in the
10000         current block.
10001
10002 2004-04-28  Martin Baulig  <martin@ximian.com>
10003
10004         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10005         comparing StringConstants and NullLiterals in Equality and Inequality.
10006
10007 2004-04-28  Jackson Harper  <jackson@ximian.com>
10008
10009         * driver.cs: Attempt to load referenced assemblies from the
10010         GAC. This is the quick and dirty version of this method that
10011         doesnt take into account versions and just takes the first
10012         canidate found. Will be good enough for now as we will not have more
10013         then one version installed into the GAC until I update this method.
10014
10015 2004-04-28  Martin Baulig  <martin@ximian.com>
10016
10017         * typemanager.cs (TypeManager.CheckStructCycles): New public
10018         static method to check for cycles in the struct layout.
10019
10020         * rootcontext.cs (RootContext.PopulateTypes): Call
10021         TypeManager.CheckStructCycles() for each TypeContainer.
10022         [Note: We only need to visit each type once.]
10023
10024 2004-04-28  Martin Baulig  <martin@ximian.com>
10025
10026         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10027
10028         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10029         success and added `out object value'.  Use a `bool resolved' field
10030         to check whether we've already been called rather than
10031         `ConstantValue != null' since this breaks for NullLiterals.
10032
10033 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10034
10035         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10036         setting of this flag, since the 'set' method may be non-public.
10037
10038 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10039
10040         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10041         check on current_vector.Block.
10042
10043 2004-04-27  Martin Baulig  <martin@ximian.com>
10044
10045         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10046         a field initializer.  Fixes #56459.
10047
10048 2004-04-27  Martin Baulig  <martin@ximian.com>
10049
10050         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10051         we're not attempting to use an indexer.  Fixes #52154.
10052
10053 2004-04-27  Martin Baulig  <martin@ximian.com>
10054
10055         * statement.cs (Return): Don't create a return label if we don't
10056         need it; reverts my change from January 20th.  Thanks to Ben
10057         Maurer for this.
10058
10059 2004-04-27  Martin Baulig  <martin@ximian.com>
10060
10061         According to the spec, `goto' can only leave a nested scope, but
10062         never enter it.
10063
10064         * statement.cs (Block.LookupLabel): Only lookup in the current
10065         block, don't recurse into parent or child blocks.
10066         (Block.AddLabel): Check in parent and child blocks, report
10067         CS0140/CS0158 if we find a duplicate.
10068         (Block): Removed this indexer for label lookups.
10069         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10070         this already does the error reporting for us.
10071
10072         * flowanalysis.cs
10073         (FlowBranching.UsageVector.Block): New public variable; may be null.
10074         (FlowBranching.CreateSibling): Added `Block' argument.
10075         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10076         label for the target of a `goto' and check whether we're not
10077         leaving a `finally'.
10078
10079 2004-04-27  Martin Baulig  <martin@ximian.com>
10080
10081         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10082         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10083         just for returns).
10084
10085 2004-04-27  Martin Baulig  <martin@ximian.com>
10086
10087         * statement.cs (Block.AddLabel): Also check for implicit blocks
10088         and added a CS0158 check.
10089
10090 2004-04-27  Martin Baulig  <martin@ximian.com>
10091
10092         * flowanalysis.cs (FlowBranchingLoop): New class.
10093         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10094         UsageVector's instead of an ArrayList.
10095         (FlowBranching.Label): Likewise.
10096         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10097         (FlowBranching.AddBreakVector): New method.
10098
10099 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10100
10101         * attribute.cs: Small regression fix: only convert the type if we
10102         the type is different, fixes System.Drawing build.
10103
10104 2004-04-27  Martin Baulig  <martin@ximian.com>
10105
10106         * attribute.cs (Attribute.Resolve): If we have a constant value
10107         for a named field or property, implicity convert it to the correct
10108         type.
10109
10110 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10111
10112         * statement.cs (Block.Block): Implicit blocks share
10113         'child_variable_names' fields with parent blocks.
10114         (Block.AddChildVariableNames): Remove.
10115         (Block.AddVariable): Mark variable as "used by a child block" in
10116         every surrounding block.
10117         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10118         been used in a child block, complain about violation of "Invariant
10119         meaning in blocks" rule.
10120         * cs-parser.jay (declare_local_variables): Don't use
10121         AddChildVariableNames.
10122         (foreach_statement): Don't create an implicit block: 'foreach'
10123         introduces a scope.
10124
10125 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10126
10127         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10128         converting from 0L to ulong.  Fixes 57522.
10129
10130 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10131
10132         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10133         derived class hides via 'new' keyword field from base class (test-242.cs).
10134         TODO: Handle this in the more general way.
10135         
10136         * class.cs (CheckBase): Ditto.
10137
10138 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10139
10140         * decl.cs (caching_flags): New member for storing cached values
10141         as bit flags.
10142         (MemberCore.Flags): New enum where bit flags for caching_flags
10143         are defined.
10144         (MemberCore.cls_compliance): Moved to caching_flags.
10145         (DeclSpace.Created): Moved to caching_flags.
10146
10147         * class.cs: Use caching_flags instead of DeclSpace.Created
10148         
10149 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10150
10151         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10152         if we are only a derived class, not a nested class.
10153
10154         * typemanager.cs: Same as above, but do this at the MemberLookup
10155         level (used by field and methods, properties are handled in
10156         PropertyExpr).   Allow for the qualified access if we are a nested
10157         method. 
10158
10159 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10160
10161         * class.cs: Refactoring.
10162         (IMethodData): New inteface; Holds links to parent members
10163         to avoid member duplication (reduced memory allocation).
10164         (Method): Implemented IMethodData interface.
10165         (PropertyBase): New inner classes for get/set methods.
10166         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10167         (Event): New inner classes for add/remove methods.
10168         (Event.DelegateMethod): Implemented IMethodData interface.
10169
10170         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10171         EmitContext (related to class.cs refactoring).
10172
10173 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10174
10175         * delegate.cs (Delegate.VerifyApplicability): If the number of
10176         arguments are the same as the number of parameters, first try to
10177         verify applicability ignoring  any 'params' modifier on the last
10178         parameter.
10179         Fixes #56442.
10180
10181 2004-04-08  Martin Baulig  <martin@ximian.com>
10182
10183         Merged latest changes into gmcs.  Please keep this comment in
10184         here, it makes it easier for me to see what changed in MCS since
10185         the last time I merged.
10186
10187 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10188
10189         * class.cs (TypeContainer.AddIndexer): Use
10190         'ExplicitInterfaceName' to determine if interface name was
10191         explicitly specified.  'InterfaceType' is not initialized at this time.
10192         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10193         Indexers array is already in the required order.  Initialize
10194         'IndexerName' only if there are normal indexers.
10195         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10196         (TypeContainer.Emit): Emit DefaultMember attribute only if
10197         IndexerName is initialized.
10198         Fixes #56300.
10199
10200 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10201
10202         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10203         Fixes #57007
10204
10205 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10206
10207         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10208         attributes.
10209         Fix for #56456.
10210
10211         * attribute.cs (Attribute.Resolve): Check for duplicate named
10212         attributes.
10213         Fix for #56463.
10214
10215 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10216
10217         * iterators.cs (MarkYield): track whether we are in an exception,
10218         and generate code accordingly.  Use a temporary value to store the
10219         result for our state.
10220
10221         I had ignored a bit the interaction of try/catch with iterators
10222         since their behavior was not entirely obvious, but now it is
10223         possible to verify that our behavior is the same as MS .NET 2.0
10224
10225         Fixes 54814
10226
10227 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10228
10229         * iterators.cs: Avoid creating temporaries if there is no work to
10230         do. 
10231
10232         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10233         Enumerations, use TypeManager.EnumToUnderlying and call
10234         recursively. 
10235
10236         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
10237         bug #57013
10238
10239         (This.Emit): Use EmitContext.EmitThis to emit our
10240         instance variable.
10241
10242         (This.EmitAssign): Ditto.
10243
10244         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
10245         codepaths, we will move all the functionality into
10246         Mono.CSharp.This 
10247
10248         (FieldExpr.EmitAssign): Ditto.
10249
10250         This fixes several hidden bugs that I uncovered while doing a code
10251         review of this today.
10252
10253         * codegen.cs (EmitThis): reworked so the semantics are more clear
10254         and also support value types "this" instances.
10255
10256         * iterators.cs: Changed so that for iterators in value types, we
10257         do not pass the value type as a parameter.  
10258
10259         Initialization of the enumerator helpers is now done in the caller
10260         instead of passing the parameters to the constructors and having
10261         the constructor set the fields.
10262
10263         The fields have now `assembly' visibility instead of private.
10264
10265 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
10266
10267         * expression.cs (Argument.Resolve): Check if fields passed as ref
10268         or out are contained in a MarshalByRefObject.
10269
10270         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
10271         another compiler type.
10272
10273 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
10274
10275         * class.cs (Indexer.Define): use the new name checking method.
10276         Also, return false on an error.
10277         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
10278         (is_identifier_[start/part]_character): make static.
10279
10280 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
10281
10282         * expression.cs (Binary.ResolveOperator): Do no append strings
10283         twice: since we can be invoked more than once (array evaluation)
10284         on the same concatenation, take care of this here.  Based on a fix
10285         from Ben (bug #56454)
10286
10287 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10288
10289         * codegen.cs: Fix another case where CS1548 must be reported (when 
10290         delay-sign isn't specified and no private is available #56564). Fix
10291         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10292         error when MCS is used on the MS runtime and we need to delay-sign 
10293         (which seems unsupported by AssemblyBuilder - see #56621).
10294
10295 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
10296
10297         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
10298         (TypeManager.ComputeNamespaces): Faster implementation for
10299         Microsoft runtime.
10300
10301         * compiler.csproj: Updated AssemblyName to mcs.
10302
10303 2004-05-11  Jackson Harper  <jackson@ximian.com>
10304
10305         * Makefile: Preserve MONO_PATH
10306         
10307 2004-05-11  Jackson Harper  <jackson@ximian.com>
10308
10309         * Makefile: Use mono and mcs to build gmcs
10310         
10311 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
10312
10313         * codegen.cs: Add patch from Robert Shade
10314         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
10315         sync with mcs.
10316
10317 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
10318
10319         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10320         incomplete key pairs (#57941).
10321
10322 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
10323
10324         * codegen.cs: Fix another case where CS1548 must be reported (when 
10325         delay-sign isn't specified and no private is available #56564). Fix
10326         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
10327         error when MCS is used on the MS runtime and we need to delay-sign 
10328         (which seems unsupported by AssemblyBuilder - see #56621).
10329
10330 2004-04-29  Jackson Harper  <jackson@ximian.com>
10331
10332         * Makefile: Set MONO_PATH to use the bootstrap corlib
10333         * driver.cs: Check the GAC for referenced assemblies.
10334                 
10335 2004-04-29  Martin Baulig  <martin@ximian.com>
10336
10337         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
10338
10339 2004-04-07  Martin Baulig  <martin@ximian.com>
10340
10341         * expression.cs (Binary.ResolveOperator): Added special case for
10342         Equality/Inequality between a type parameter and a null literal.
10343
10344 2004-04-07  Martin Baulig  <martin@ximian.com>
10345
10346         * convert.cs: Check null literal -> type parameter conversions.
10347
10348 2004-04-07  Martin Baulig  <martin@ximian.com>
10349
10350         * generic.cs (ConstructedType.CheckConstraints): Enforce the
10351         `class' and `struct' constraints.
10352
10353 2004-04-07  Martin Baulig  <martin@ximian.com>
10354
10355         * generic.cs (SpecialConstraint): New public enum.
10356         (Constraints.Resolve): Added support for the `class' and `struct'
10357         constraints.
10358
10359         * cs-parser.jay (type_parameter_constraint): Added support for the
10360         `class' and `struct' constraints.
10361
10362 2004-04-07  Martin Baulig  <martin@ximian.com>
10363
10364         * support.cs (GenericConstraints): Replaced `Types' by
10365         `ClassConstraint' and `InterfaceConstraints'; added
10366         `HasClassConstraint'.   
10367
10368 2004-04-07  Martin Baulig  <martin@ximian.com>
10369
10370         * generic.cs
10371         (Constraints.InterfaceConstraints): New public property.
10372         (Constraints.Types): Make this property public
10373         (TypeParameter): Implement IMemberContainer.
10374         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
10375         instead of a TypeBuilder/MethodBuilder; pass the interface
10376         constraints to TypeManager.AddTypeParameter().
10377         (TypeParameter.DefineType): Just take an EmitContext and no
10378         TypeBuilder/MethodBuilder.  Use the new public API.
10379
10380         * typemanager.cs (TypeManager.AddTypeParameter): Added
10381         `TypeExpr[]' argument; add the interfaces to the
10382         `builder_to_ifaces' hash.
10383         (TypeManager.LookupMemberContainer): For
10384         GenericTypeParameterBuilders, get the TypeParameter from the
10385         `builder_to_type_param'.
10386         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
10387         the TypeParameter and call FindMembers on it.
10388
10389 2004-04-07  Martin Baulig  <martin@ximian.com>
10390
10391         * class.cs
10392         (MethodCore.GenericMethod): Moved this field here from Method.
10393         (MethodCore.IsDuplicateImplementation): Take the number of type
10394         parameters into account if we're a generic method.
10395
10396         * expression.cs (Invocation.InferTypeArguments): Don't return true
10397         if `arguments' is null; we still need to check whether we actually
10398         don't need to infer anything in this case.
10399         (MemberAccess): Merged the functionality from GenericMemberAccess
10400         into this class.
10401
10402         * generic.cs (GenericMemberAccess): Removed.
10403
10404 2004-04-05  Martin Baulig  <martin@ximian.com>
10405
10406         * decl.cs (MemberCore): For generic classes, interfaces and
10407         structs, `Name' now includes the number of type parameters
10408         ("Stack!1.Node!1").
10409         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
10410         encode the number of type arguments in the type name.
10411
10412         * expression.cs (Expression.MemberLookup): Removed the
10413         `num_type_args' argument; we now encode the number of type
10414         arguments in the type name.
10415
10416         * ecore.cs (SimpleName): Encode the number of type arguments in
10417         the type name itself.
10418
10419         * generic.cs (ConstructedType): Likewise.
10420
10421         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
10422         `MemberName'; we now include the number of type parameters in the
10423         type name.
10424
10425         * typemanager.cs (TypeManager.CheckGeneric): Removed.
10426         (TypeManager.MemberLookup): Removed the
10427         `num_type_args' argument; we now encode the number of type
10428         arguments in the type name.     
10429
10430 2004-04-03  Martin Baulig  <martin@ximian.com>
10431
10432         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
10433         (MemberCore.MemberName): Moved here from MemberBase.
10434         (DeclSpace.SetParameterInfo): Just take the constraints as an
10435         ArrayList; we already have the type parameters in our
10436         `MemberName'; also do the CS0080 reporting here.
10437
10438         * cs-parser.jay (struct_declaration): Use `member_name' instead of
10439         `IDENTIFIER opt_type_parameter_list'; when constructing our
10440         `MemberName', it'll already include our type parameters.
10441         (class_declaration, interface_declaration): Likewise.
10442         (delegate_declaration): Likewise.
10443         (MakeName): Take a MemberName and return a MemberName.
10444         The following two changes are required to avoid shift/reduce conflicts:
10445         (member_name): Don't include a TypeName anymore; ie. this is now
10446         just 'IDENTIFIER opt_type_parameter_list'.
10447         (property_declaration, event_declaration): Use a
10448         `namespace_or_type_name' instead of a `member_name'.            
10449
10450 2004-04-03  Martin Baulig  <martin@ximian.com>
10451
10452         * decl.cs (MemberName): Renamed to `TypeName' and created a new
10453         `MemberName' class.
10454         (TypeName): Formerly known as MemberName.
10455
10456         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
10457         instead of a `MemberName'.
10458
10459         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
10460         (member_name): New rule; create a MemberName.
10461
10462 2004-04-02  Martin Baulig  <martin@ximian.com>
10463
10464         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
10465         (CS0305 and CS0308).
10466
10467 2004-04-02  Martin Baulig  <martin@ximian.com>
10468
10469         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
10470         support for nested types.
10471
10472 2004-04-02  Martin Baulig  <martin@ximian.com>
10473
10474         * ecore.cs (IAlias): New public interface.
10475         (TypeExpr, TypeExpression): Implement IAlias.
10476         (TypeAliasExpression): New public class.
10477
10478         * namespace.cs (Namespace): Implement IAlias.
10479         (Namespace.Lookup): Return an IAlias instead on an object.
10480         (Namespace.DefineName): Take an IAlias instead of an object.
10481         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
10482         an object.
10483         (NamespaceEntry.UsingAlias): Take a Membername instead of an
10484         Expression.
10485         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
10486         object.
10487         (NamespaceEntry.Lookup): Likewise.
10488
10489         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
10490         instead of a Type.      
10491
10492         * decl.cs (DeclSpace): Implement IAlias.
10493         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
10494
10495         * generic.cs (ConstructedType): Improved error checking.
10496
10497 2004-04-02  Martin Baulig  <martin@ximian.com>
10498
10499         * convert.cs: Added type parameter conversions.
10500
10501         * ecore.cs
10502         (UnboxCast.Emit): Emit an `unbox.any' for type params.
10503         (ClassCast.Emit): If the source type is a type parameter, box it.
10504         If the target type is a type parameter, emit an `unbox.any'
10505         instead of a `classcast'.1      
10506
10507 2004-04-01  Martin Baulig  <martin@ximian.com>
10508
10509         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
10510
10511 2004-04-01  Martin Baulig  <martin@ximian.com>
10512
10513         * generic.cs (ConstructedType.CheckConstraints): Use
10514         Convert.ImplicitStandardConversionExists(); user-defined implicit
10515         conversions are not allowed according to the spec.
10516
10517 2004-03-30  Martin Baulig  <martin@ximian.com>
10518
10519         * expression.cs (New): Added support for type parameters.
10520
10521         * typemanager.cs
10522         (TypeManager.activator_type): New public static field.
10523         (TypeManager.activator_create_instance): Likewise.
10524
10525 2004-03-30  Martin Baulig  <martin@ximian.com>
10526
10527         * typemanager.cs (TypeManager.HasConstructorConstraint): New
10528         public method.
10529
10530 2004-03-30  Martin Baulig  <martin@ximian.com>
10531
10532         * generic.cs (ConstructedType.CheckConstraints): Actually follow
10533         the spec here: the argument type must be convertible to the
10534         constraints.
10535
10536 2004-03-30  Martin Baulig  <martin@ximian.com>
10537
10538         * generic.cs
10539         (TypeParameter.Define, TypeParameter.DefineMethod): Call
10540         TypeManager.AddTypeParameter().
10541         (ConstructedType.CheckConstraints): Re-enable this and actually
10542         check whether we have a constructor constraint.
10543
10544         * typemanager.cs
10545         (TypeManager.builder_to_type_param): New static field.
10546         (TypeManager.AddTypeParameter): New static method.
10547         (TypeManager.LookupTypeParameter): New public method.
10548
10549 2004-03-30  Martin Baulig  <martin@ximian.com>
10550
10551         * generic.cs (TypeParameter.DefineType): Return a boolean and use
10552         the new API to actually define the constructor constraint.
10553
10554         * typemanager.cs
10555         (TypeManager.new_constraint_attr_type): New static field.
10556         (TypeManager.InitCoreTypes): Initialize it.
10557
10558 2004-03-30  Martin Baulig  <martin@ximian.com>
10559
10560         * generic.cs (Constraints): Completed error checking, use correct
10561         error numbers.
10562
10563 2004-03-29  Martin Baulig  <martin@ximian.com>
10564
10565         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
10566
10567         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10568         public version which takes a `ParameterData pd' instead of an
10569         `ArrayList args'.
10570
10571 2004-03-29  Martin Baulig  <martin@ximian.com>
10572
10573         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
10574         not a MethodInfo.       
10575
10576 2004-03-29  Martin Baulig  <martin@ximian.com>
10577
10578         * expression.cs (Argument.ResolveMethodGroup): If we're a
10579         ConstructedType, call GetMemberAccess() on it.  
10580
10581 2004-03-29  Martin Baulig  <martin@ximian.com>
10582
10583         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
10584         (MethodCore.CheckGenericOverride): When overriding a generic
10585         method, check whether the constraints match.
10586
10587         * support.cs (GenericConstraints): New public interface.
10588         (ParameterData.GenericConstraints): New public method.
10589
10590         * parameter.cs (Parameter.Resolve): Check whether we're a generic
10591         method parameter and compute our constraints if appropriate.
10592         (Parameter.GenericConstraints): New public property.
10593
10594         * generic.cs (Constraints): Implement GenericConstraints.
10595
10596 2004-03-29  Martin Baulig  <martin@ximian.com>
10597
10598         * decl.cs (MemberCache.FindMemberToOverride): Use
10599         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
10600
10601 2004-03-29  Martin Baulig  <martin@ximian.com>
10602
10603         * generic.cs (GenericMethod.Define): Resolve our type parameters.
10604
10605 2004-03-29  Martin Baulig  <martin@ximian.com>
10606
10607         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
10608         not allowed on non-generic declarations").
10609
10610 2004-03-29  Martin Baulig  <martin@ximian.com>
10611
10612         * expression.cs (Invocation.InferTypeArguments): Added overloaded
10613         public version of this method.
10614
10615         * class.cs (MethodCore.IsDuplicateImplementation): Use
10616         Invocation.InferTypeArguments() to check this.
10617
10618 2004-03-29  Martin Baulig  <martin@ximian.com>
10619
10620         * convert.cs: Use TypeManager.IsDelegateType() instead of
10621         comparing types correctly.
10622
10623 2004-03-29  Martin Baulig  <martin@ximian.com>
10624
10625         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
10626         types directly to make it work for generic instances.
10627
10628         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
10629
10630 2004-03-29  Martin Baulig  <martin@ximian.com>
10631
10632         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
10633         support for arrays.     
10634
10635 2004-03-24  Martin Baulig  <martin@ximian.com>
10636
10637         * decl.cs (DeclSpace.FindType): Also use
10638         TypeManager.CheckGeneric() for types from the using clauses.
10639
10640 2004-03-23  Martin Baulig  <martin@ximian.com>
10641
10642         * expression.cs (Invocation.OverloadResolve): Added `bool
10643         may_fail' argument and use it instead of the Location.IsNull() hack.
10644
10645 2004-03-23  Martin Baulig  <martin@ximian.com>
10646
10647         * expression.cs (Invocation.InferType): Use correct type inference
10648         rules here.     
10649
10650 2004-03-23  Martin Baulig  <martin@ximian.com>
10651
10652         * ecore.cs (MethodGroupExpr.Name): Use
10653         TypeManager.CSharpSignature() instead of just the name.
10654
10655         * expression.cs (Invocation.OverloadResolve): Provide better error
10656         reporting.
10657         (Invocation.DoResolve): OverloadResolve() never returns null
10658         without reporting an error, so removed the error -6 reporting here.
10659
10660 2004-03-23  Martin Baulig  <martin@ximian.com>
10661
10662         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
10663         generic methods.
10664
10665         * cs-parser.jay (delegate_declaration): Support generic delegates.
10666
10667         * delegate.cs: Support generic delegates.
10668
10669 2004-03-22  Martin Baulig  <martin@ximian.com>
10670
10671         * expression.cs (Invocation.InferParamsTypeArguments): New static
10672         method; does type inference for params arguments.
10673
10674 2004-03-21  Martin Baulig  <martin@ximian.com>
10675
10676         * typemanager.cs (TypeManager.IsGenericMethod): New public static
10677         method; checks whether a method is a generic method.    
10678
10679         * expression.cs (Invocation.InferTypeArguments): New static method;
10680         infer type arguments for generic method invocation.
10681
10682         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
10683         property; we set this to true if we're resolving a generic method
10684         invocation and the user specified type arguments, ie. we're not
10685         doing type inference.
10686
10687 2004-03-20  Martin Baulig  <martin@ximian.com>
10688
10689         * class.cs (MethodData.DeclaringType): New public property.
10690         (MethodData.Define): Set DeclaringType here.
10691         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
10692         instead of OperatorMethodBuilder.DeclaringType.
10693
10694 2004-03-20  Martin Baulig  <martin@ximian.com>
10695
10696         * cs-tokenizer.cs (xtoken): Return a special
10697         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
10698
10699         * cs-parser.jay (default_value_expression): Switch to the new
10700         syntax (14.5.13).
10701
10702 2004-03-19  Martin Baulig  <martin@ximian.com>
10703
10704         * decl.cs (MemberName): New class.  We use this to "construct"
10705         namespace_or_type_name's.
10706
10707         * generics.cs (TypeArguments.GetDeclarations): New public method;
10708         returns the type arguments as a string[] and reports a CS0081 if
10709         one of them is not an identifier.
10710
10711         * class.cs (MemberBase): The .ctor now takes the name as a
10712         MemberName instead of a string.
10713         (MemberBase.ExplicitInterfaceName): Changed type from string to
10714         Expression.
10715         (MemberBase.DoDefine): If we're an explicit implementation, the
10716         InterfaceType may be a generic instance.
10717
10718         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
10719         (namespace_name): Call MemberName.GetName () to transform the
10720         MemberName into a string and ensure we don't have any type
10721         arguments.
10722         (type_name): Call MemberName.GetTypeExpression() to transfrom the
10723         MemberName into an expression.
10724         (method_header): Use namespace_or_type_name instead of member_name.     
10725
10726 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
10727
10728         * rootcontext.cs: Add new types to the boot resolution.
10729
10730         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
10731         MulticastDelegate is not allowed.
10732
10733         * typemanager.cs: Add new types to lookup: System.TypedReference
10734         and ArgIterator.
10735
10736         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
10737         check for TypedReference or ArgIterator, they are not allowed. 
10738
10739         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
10740         makes us properly catch 1510 in some conditions (see bug 56016 for
10741         details). 
10742
10743 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
10744
10745         * CryptoConvert.cs: update from corlib version
10746         with endian fixes.
10747
10748 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
10749
10750         * class.cs (Indexer.Define): Check indexername declaration
10751
10752 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
10753
10754         * attribute.cs (IsClsCompliant): Fixed problem with handling
10755         all three states (compliant, not-compliant, undetected).
10756
10757 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
10758
10759         * attribute.cs (Attribute): Location is now public.
10760         (Resolve): Store resolved arguments (pos_values) in attribute class.
10761         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
10762         (GetClsCompliantAttributeValue): New method that gets
10763         CLSCompliantAttribute value.
10764         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
10765         if exists else null.
10766         (AttributeTester): New class for CLS-Compliant verification routines.
10767
10768         * class.cs (Emit): Add CLS-Compliant verification.
10769         (Method.GetSignatureForError): Implemented.
10770         (Constructor.GetSignatureForError): Implemented
10771         (Constructor.HasCompliantArgs): Returns if constructor has
10772         CLS-Compliant arguments.
10773         (Constructor.Emit): Override.
10774         (Construcor.IsIdentifierClsCompliant): New method; For constructors
10775         is needed to test only parameters.
10776         (FieldBase.GetSignatureForError): Implemented.
10777         (TypeContainer): New member for storing base interfaces.
10778         (TypeContainer.FindMembers): Search in base interfaces too.
10779
10780         * codegen.cs (GetClsComplianceAttribute): New method that gets
10781         assembly or module CLSCompliantAttribute value.
10782         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
10783         for assembly.
10784         (ModuleClass.Emit): Add error 3012 test.
10785
10786         * const.cs (Emit): Override and call base for CLS-Compliant tests.
10787
10788         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
10789         state for all decl types.
10790         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
10791         if CLS-Compliant tests are required.
10792         (IsClsCompliaceRequired): New method. Analyze whether code
10793         must be CLS-Compliant.
10794         (IsExposedFromAssembly): New method. Returns true when MemberCore
10795         is exposed from assembly.
10796         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
10797         value or gets cached value.
10798         (HasClsCompliantAttribute): New method. Returns true if MemberCore
10799         is explicitly marked with CLSCompliantAttribute.
10800         (IsIdentifierClsCompliant): New abstract method. This method is
10801         used to testing error 3005.
10802         (IsIdentifierAndParamClsCompliant): New method. Common helper method
10803         for identifier and parameters CLS-Compliant testing.
10804         (VerifyClsCompliance): New method. The main virtual method for
10805         CLS-Compliant verifications.
10806         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
10807         null. I don't know why is null (too many public members !).
10808         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
10809         and get value of first CLSCompliantAttribute that found.
10810
10811         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
10812         (VerifyClsCompliance): Override and add extra tests.
10813
10814         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
10815         clscheck- disable CLS-Compliant verification event if assembly is has
10816         CLSCompliantAttribute(true).
10817
10818         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
10819         ApllyAttribute is now called in emit section as in the other cases.
10820         Possible future Emit integration.
10821         (IsIdentifierClsCompliant): New override.
10822         (VerifyClsCompliance): New override.
10823         (GetEnumeratorName): Returns full enum name.
10824
10825         * parameter.cs (GetSignatureForError): Implemented.
10826
10827         * report.cs (WarningData): New struct for Warning message information.
10828         (LocationOfPreviousError): New method.
10829         (Warning): New method. Reports warning based on the warning table.
10830         (Error_T): New method. Reports error based on the error table.
10831
10832         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
10833         verifications are done here.
10834
10835         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
10836
10837         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
10838         CLSCompliantAttribute.
10839         (all_imported_types): New member holds all imported types from other
10840         assemblies.
10841         (LoadAllImportedTypes): New method fills static table with exported types
10842         from all referenced assemblies.
10843         (Modules): New property returns all assembly modules.
10844
10845 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
10846
10847         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
10848         throwing a parser error.
10849
10850         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
10851         which removes the hardcoded get_/set_ prefixes for properties, as
10852         IL allows for the properties to be named something else.  
10853
10854         Bug #56013
10855
10856         * expression.cs: Do not override operand before we know if it is
10857         non-null.  Fix 56207
10858
10859 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10860
10861         * typemanager.cs: support for pinned variables.
10862
10863 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10864
10865         * decl.cs, typemanager.cs: Avoid using an arraylist
10866         as a buffer if there is only one result set.
10867
10868 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10869
10870         * expression.cs: Make sure you cant call a static method
10871         with an instance expression, bug #56174.
10872
10873 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
10874
10875         * class.cs (IsDuplicateImplementation): Improve error reporting to
10876         flag 663 (method only differs in parameter modifier).
10877
10878         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
10879         in preprocessor directives.
10880
10881         * location.cs (LookupFile): Allow for the empty path.
10882
10883         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
10884         better approach for some of that patch, but its failing with the
10885         CharSet enumeration.  For now try/catch will do.
10886
10887         * typemanager.cs: Do not crash if a struct does not have fields.
10888         Fixes 56150.
10889
10890 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10891
10892         * expression.cs: cs0213, cant fix a fixed expression.
10893         fixes 50231.
10894
10895 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10896
10897         * cs-parser.jay: detect invalid embeded statements gracefully.
10898         bug #51113.
10899
10900 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10901
10902         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
10903         As a regex:
10904         s/
10905         the invocation type may not be a subclass of the tye of the item/
10906         The type of the item must be a subclass of the invocation item.
10907         /g
10908
10909         Fixes bug #50820.
10910
10911 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
10912
10913         * attribute.cs: Added methods to get a string and a bool from an
10914         attribute. Required to information from AssemblyKeyFileAttribute,
10915         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
10916         * codegen.cs: Modified AssemblyName creation to include support for
10917         strongnames. Catch additional exceptions to report them as CS1548.
10918         * compiler.csproj: Updated include CryptoConvert.cs.
10919         * compiler.csproj.user: Removed file - user specific configuration.
10920         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
10921         Mono.Security assembly. The original class is maintained and tested in
10922         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
10923         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
10924         like CSC 8.0 (C# v2) supports.
10925         * Makefile: Added CryptoConvert.cs to mcs sources.
10926         * rootcontext.cs: Added new options for strongnames.
10927
10928 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
10929
10930         * driver.cs: For --expect-error, report error code `2'
10931         if the program compiled with no errors, error code `1' if
10932         it compiled with an error other than the one expected.
10933
10934 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
10935
10936         * compiler.csproj: Updated for Visual Studio .NET 2003.
10937         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
10938         * compiler.sln: Updated for Visual Studio .NET 2003.
10939
10940 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
10941
10942         * expression.cs: Fix bug #47234. We basically need to apply the
10943         rule that we prefer the conversion of null to a reference type
10944         when faced with a conversion to 'object' (csc behaviour).
10945
10946 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10947
10948         * statement.cs: Shorter form for foreach, eliminates
10949         a local variable. r=Martin.
10950
10951 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10952
10953         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
10954         checks if we can use brtrue/brfalse to test for 0.
10955         * expression.cs: use the above in the test for using brtrue/brfalse.
10956         cleanup code a bit.
10957
10958 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10959
10960         * expression.cs: Rewrite string concat stuff. Benefits:
10961
10962         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
10963         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
10964         rather than a concat chain.
10965
10966         * typemanager.cs: Add lookups for more concat overloads.
10967
10968 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10969
10970         * expression.cs: Emit shorter il code for array init.
10971
10972         newarr
10973         dup
10974         // set 1
10975
10976         // set 2
10977
10978         newarr
10979         stloc.x
10980
10981         ldloc.x
10982         // set 1
10983
10984         ldloc.x
10985         // set 2
10986
10987 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
10988
10989         * statement.cs: Before, two switch blocks would be merged if the
10990         total size of the blocks (end_item - begin_item + 1) was less than
10991         two times the combined sizes of the blocks.
10992
10993         Now, it will only merge if after the merge at least half of the
10994         slots are filled.
10995
10996         fixes 55885.
10997
10998 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
10999
11000         * class.cs : csc build fix for GetMethods(). See bug #52503.
11001
11002 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11003
11004         * expression.cs: Make sure fp comparisons work with NaN.
11005         This fixes bug #54303. Mig approved this patch a long
11006         time ago, but we were not able to test b/c the runtime
11007         had a related bug.
11008
11009 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11010
11011         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11012
11013 2004-03-19  Martin Baulig  <martin@ximian.com>
11014
11015         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11016         two overloads may unify for some type parameter substitutions and
11017         report a CS0408 if appropriate.
11018
11019 2004-03-19  Martin Baulig  <martin@ximian.com>
11020
11021         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11022         error here and not in our caller.
11023
11024 2004-03-19  Martin Baulig  <martin@ximian.com>
11025
11026         * interface.cs: Completely killed this file.
11027         (Interface): We're now a TypeContainer and live in class.cs.
11028
11029         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11030         argument; we're now also called for interfaces.
11031         (TypeContainer.DefineMembers): Allow this method being called
11032         multiple times.
11033         (TypeContainer.GetMethods): New public method; formerly known as
11034         Interface.GetMethod().  This is used by PendingImplementation.
11035         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11036         it's now private and non-static.
11037         (Interface): Moved this here; it's now implemented similar to
11038         Class and Struct.
11039         (Method, Property, Event, Indexer): Added `bool is_interface'
11040         argument to their .ctor's.
11041         (MemberBase.IsInterface): New public field.
11042
11043         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11044         instances instead of InterfaceMethod, InterfaceProperty, etc.
11045         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11046         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11047
11048 2004-03-19  Martin Baulig  <martin@ximian.com>
11049
11050         * class.cs (MethodCore.IsDuplicateImplementation): New private
11051         method which does the CS0111 checking.
11052         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11053         Use IsDuplicateImplementation().
11054
11055 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11056
11057         * decl.cs (FindMemberToOverride): New method to find the correct
11058         method or property to override in the base class.
11059         * class.cs
11060             - Make Method/Property use the above method to find the
11061               version in the base class.
11062             - Remove the InheritableMemberSignatureCompare as it is now
11063               dead code.
11064
11065         This patch makes large code bases much faster to compile, as it is
11066         O(n) rather than O(n^2) to do this validation.
11067
11068         Also, it fixes bug 52458 which is that nested classes are not
11069         taken into account when finding the base class member.
11070
11071         Reviewed/Approved by Martin.
11072
11073 2004-03-17  Martin Baulig  <martin@ximian.com>
11074
11075         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11076         of type arguments into account; use the `real_num_type_args'
11077         approach like in DoResolveAsTypeStep().
11078
11079         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11080         nested types.
11081
11082 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11083
11084         * interface.cs: In all interface classes removed redundant
11085         member initialization.
11086
11087 2004-03-16  Martin Baulig  <martin@ximian.com>
11088
11089         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11090
11091 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11092
11093         * decl.cs (DefineTypeAndParents): New helper method to define a
11094         type's containers before the type itself is defined;  This is a
11095         bug exposed by the recent changes to Windows.Forms when an
11096         implemented interface was defined inside a class that had not been
11097         built yet.   
11098
11099         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11100
11101         (Check): Loop correctly to report errors modifiers
11102         (UNSAFE was not in the loop, since it was the same as TOP).
11103
11104         * interface.cs: Every interface member now takes a ModFlags,
11105         instead of a "is_new" bool, which we set on the base MemberCore. 
11106
11107         Every place where we called "UnsafeOk" in the interface, now we
11108         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11109         the unsafe settings from the member declaration instead of the
11110         container interface. 
11111
11112         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11113
11114         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11115         `set_indexer_name' to the pending bits (one per type).
11116
11117         We fixed a bug today that was picking the wrong method to
11118         override, since for properties the existing InterfaceMethod code
11119         basically ignored the method name.  Now we make sure that the
11120         method name is one of the valid indexer names.
11121
11122 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11123  
11124         * support.cs (SeekableStreamReader): Keep track of stream byte
11125         positions and don't mix them with character offsets to the buffer.
11126
11127         Patch from Gustavo Giráldez
11128
11129 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11130
11131         * interface.cs (InterfaceSetGetBase): Removed double member
11132         initialization, base class does it as well.
11133
11134 2004-03-13  Martin Baulig  <martin@ximian.com>
11135
11136         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11137         when compiling corlib.
11138
11139 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11140
11141         * convert.cs (ExplicitConversion): We were reporting an error on
11142         certain conversions (object_type source to a value type, when the
11143         expression was `null') before we had a chance to pass it through
11144         the user defined conversions.
11145
11146         * driver.cs: Replace / and \ in resource specifications to dots.
11147         Fixes 50752
11148
11149         * class.cs: Add check for duplicate operators.  Fixes 52477
11150
11151 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11152
11153         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11154         that are in the middle of the statements, not only at the end.
11155         Fixes #54987
11156
11157         * class.cs (TypeContainer.AddField): No longer set the
11158         `HaveStaticConstructor' flag, now we call it
11159         `UserDefineStaticConstructor' to diferentiate the slightly
11160         semantic difference.
11161
11162         The situation is that we were not adding BeforeFieldInit (from
11163         Modifiers.TypeAttr) to classes that could have it.
11164         BeforeFieldInit should be set to classes that have no static
11165         constructor. 
11166
11167         See:
11168
11169         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11170
11171         And most importantly Zoltan's comment:
11172
11173         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11174
11175         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11176          before its static fields are used', i.e. initialization does not need
11177          to be triggered by the first access to the type. Setting this flag
11178          helps the JIT to compile better code, since it can run the static
11179          constructor at JIT time, and does not need to generate code to call it
11180          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11181          this flag for lots of classes like String. 
11182          
11183          csc sets this flag if the type does not have an explicit static 
11184          constructor. The reasoning seems to be that if there are only static
11185          initalizers for a type, and no static constructor, then the programmer
11186          does not care when this initialization happens, so beforefieldinit
11187          can be used.
11188          
11189          This bug prevents the AOT compiler from being usable, since it 
11190          generates so many calls to mono_runtime_class_init that the AOT code
11191          is much slower than the JITted code. The JITted code is faster, 
11192          because it does not generate these calls if the vtable is type is
11193          already initialized, which is true in the majority of cases. But the
11194          AOT compiler can't do this."
11195
11196 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11197
11198         * class.cs (MethodData.Emit): Refactor the code so symbolic
11199         information is generated for destructors;  For some reasons we
11200         were taking a code path that did not generate symbolic information
11201         before. 
11202
11203 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11204
11205         * class.cs: Create a Constructor.CheckBase method that
11206         takes care of all validation type code. The method
11207         contains some code that was moved from Define.
11208
11209         It also includes new code that checks for duplicate ctors.
11210         This fixes bug #55148.
11211
11212 2004-03-09  Joshua Tauberer <tauberer@for.net>
11213
11214         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11215         a { ... }-style array creation invokes EmitStaticInitializers
11216         which is not good for reference-type arrays.  String, decimal
11217         and now null constants (NullCast) are not counted toward
11218         static initializers.
11219
11220 2004-03-05  Martin Baulig  <martin@ximian.com>
11221
11222         * location.cs (SourceFile.HasLineDirective): New public field;
11223         specifies whether the file contains or is referenced by a "#line"
11224         directive.
11225         (Location.DefineSymbolDocuments): Ignore source files which
11226         either contain or are referenced by a "#line" directive.        
11227
11228 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11229
11230         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11231         direct access to our parent, so check the method inline there.
11232
11233 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
11234
11235         * expression.cs (Invocation.EmitCall): Miguel's last commit
11236         caused a regression. If you had:
11237
11238             T t = null;
11239             t.Foo ();
11240
11241         In Foo the implict this would be null.
11242
11243 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
11244
11245         * expression.cs (Invocation.EmitCall): If the method is not
11246         virtual, do not emit a CallVirt to it, use Call.
11247
11248         * typemanager.cs (GetFullNameSignature): Improve the method to
11249         cope with ".ctor" and replace it with the type name.
11250
11251         * class.cs (ConstructorInitializer.Resolve): Now the method takes
11252         as an argument the ConstructorBuilder where it is being defined,
11253         to catch the recursive constructor invocations.
11254
11255 2004-03-16  Martin Baulig  <martin@ximian.com>
11256
11257         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
11258         ConstructedType, call ResolveType() on it to get the type rather
11259         than just using `expr.Type'.
11260
11261 2004-03-16  Martin Baulig  <martin@ximian.com>
11262
11263         * generics.cs (ConstructedType.GetMemberAccess): Take the
11264         EmitContext instead on the TypeExpr and use
11265         ec.TypeContainer.CurrentType/ec.ContainerType.
11266
11267 2004-03-16  Martin Baulig  <martin@ximian.com>
11268
11269         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
11270         parameters before aliases.
11271
11272 2004-03-16  Martin Baulig  <martin@ximian.com>
11273
11274         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
11275         New oublic function; checks whether two generic instances may become
11276         equal under some instantiations (26.3.1).
11277
11278         * class.cs (TypeContainer.Define): Call
11279         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
11280         error.
11281
11282 2004-03-16  Martin Baulig  <martin@ximian.com>
11283
11284         * class.cs (TypeContainer.GetClassBases): Moved
11285         Error_TypeParameterAsBase() here and also check whether the base
11286         class is not an attribute.
11287
11288 2004-03-16  Martin Baulig  <martin@ximian.com>
11289
11290         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11291
11292 2004-03-16  Martin Baulig  <martin@ximian.com>
11293
11294         * class.cs (Error_TypeParameterAsBase): Use correct error number
11295         here (CS0689).  
11296
11297 2004-03-16  Martin Baulig  <martin@ximian.com>
11298
11299         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
11300         for generics.
11301
11302         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
11303         error reporting.
11304
11305 2004-03-15  Martin Baulig  <martin@ximian.com>
11306
11307         * typemanager.cs (TypeManager.GetFullName): New public method.
11308         (TypeManager.MemberLookup): Added `int_num_type_arguments'
11309         argument; only return members with the correct number of type
11310         arguments.
11311         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
11312         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
11313         whether the number of type arguments matches.
11314
11315         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
11316         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
11317
11318         * expression.cs (MemberAccess): Added public `NumTypeArguments'
11319         field; it's set by the protected .ctor when we're actually a
11320         GenericMemberAccess.
11321         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
11322         arguments and pass it to MemberLookupFinal ().
11323
11324         * ecore.cs (Expression.MemberLookup): Added `int
11325         num_type_arguments' argument; only return members with the correct
11326         number of type arguments.
11327         (Expression.MemberLookupFailed): Check whether the MemberLookup
11328         failed because we did not have the correct number of type
11329         arguments; report CS0305 in this case.
11330
11331         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
11332         `e.ResolveAsTypeTerminal()' already did so.
11333
11334 2004-03-15  Martin Baulig  <martin@ximian.com>
11335
11336         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
11337         we're a ConstructedType; in this case, the caller must report an
11338         error (for instance CS0131).
11339
11340         * generic.cs (TypeArguments): Added Location argument to the .ctor.
11341         (TypeArguments.Resolve): Actually report errors here.
11342
11343 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11344
11345         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11346         `set_indexer_name' to the pending bits (one per type).
11347
11348         We fixed a bug today that was picking the wrong method to
11349         override, since for properties the existing InterfaceMethod code
11350         basically ignored the method name.  Now we make sure that the
11351         method name is one of the valid indexer names.
11352
11353 2004-03-15  Martin Baulig  <martin@ximian.com>
11354
11355         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
11356         for generic instances.
11357
11358 2004-03-13  Martin Baulig  <martin@ximian.com>
11359
11360         * class.cs (TypeContainer.DefineType): Call
11361         TypeManager.AddUserType() immediately after creating the
11362         TypeBuilder; pass all type parameters when creating the
11363         CurrentType.
11364
11365         * decl.cs (DeclSpace.FindNestedType): New public method.
11366         (DeclSpace.FindType): Added `int num_type_args' argument; only
11367         return types with the correct number of type parameters.
11368         (DeclSpace.CountTypeParams): New public property.
11369
11370         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
11371         the number of type parameters; defaults to zero.
11372
11373         * generic.cs (TypeArguments.Count): New public property.
11374         (ConstructedType.DoResolveAsTypeStep): First call
11375         ds.FindNestedType() to find out whether we're nested in the
11376         current generic type; in this case, we inherit all type parameters
11377         from the current class.
11378
11379         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
11380         num_type_args' argument.
11381         (RootContext.LookupType): Added overloaded version which takes the
11382         number of type arguments; only return types with the correct
11383         number of type arguments.
11384
11385         * typemanager.cs (TypeManager.CheckGeneric): New public function;
11386         checks whether `Type t' has `int num_type_args'.
11387
11388 2004-03-13  Martin Baulig  <martin@ximian.com>
11389
11390         * generic.cs (GenericMethod.DefineType): New method; calls
11391         DefineType() on all the type parameters.
11392
11393         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
11394         (MethodData.Define): If we're a generic method, call
11395         GenericMethod.DefineType() to define the type parameters.       
11396
11397 2004-03-10  Martin Baulig  <martin@ximian.com>
11398
11399         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
11400         instead of IsAssignableFrom.    
11401
11402 2004-03-10  Martin Baulig  <martin@ximian.com>
11403
11404         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
11405
11406         * support.cs (ParameterData.HasArrayParameter): New property.
11407         (ReflectionParameters.ctor): Take a MethodBase instead of a
11408         ParameterInfo[].  If we have any type parameters, get the generic
11409         method definition and ask it whether we have variable arguments.
11410
11411 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
11412
11413         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
11414         routines to check if a type is an enumerable/enumerator allow
11415         classes that implement the IEnumerable or IEnumerator interfaces.
11416
11417         * class.cs (Property, Operator): Implement IIteratorContainer, and
11418         implement SetYields.
11419
11420         (Property.Define): Do the block swapping for get_methods in the
11421         context of iterators.   We need to check if Properties also
11422         include indexers or not.
11423
11424         (Operator): Assign the Block before invoking the
11425         OperatorMethod.Define, so we can trigger the Iterator code
11426         replacement. 
11427
11428         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
11429         Property and Operator classes are not created when we parse the
11430         declarator but until we have the block completed, so we use a
11431         singleton SimpleIteratorContainer.Simple to flag whether the
11432         SetYields has been invoked.
11433
11434         We propagate this setting then to the Property or the Operator to
11435         allow the `yield' to function.
11436
11437 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
11438
11439         * codegen.cs: Implemented attribute support for modules.
11440         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
11441         Assembly/Module functionality.
11442
11443         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
11444         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
11445         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
11446
11447 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
11448
11449         * interface.cs (FindMembers): The operation is performed on all base
11450         interfaces and not only on the first. It is required for future CLS Compliance patch.
11451
11452 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
11453
11454         * statement.cs, codegen.cs:
11455         This patch deals with patterns such as:
11456
11457         public class List : IEnumerable {
11458
11459                 public MyEnumerator GetEnumerator () {
11460                         return new MyEnumerator(this);
11461                 }
11462
11463                 IEnumerator IEnumerable.GetEnumerator () {
11464                         ...
11465                 }
11466                 
11467                 public struct MyEnumerator : IEnumerator {
11468                         ...
11469                 }
11470         }
11471
11472         Before, there were a few things we did wrong:
11473         1) we would emit callvirt on a struct, which is illegal
11474         2) we emited ldarg when we needed to emit ldarga
11475         3) we would mistakenly call the interface methods on an enumerator
11476         type that derived from IEnumerator and was in another assembly. For example:
11477
11478         public class MyEnumerator : IEnumerator
11479
11480         Would have the interface methods called, even if there were public impls of the
11481         method. In a struct, this lead to invalid IL code.
11482
11483 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
11484
11485         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
11486           renamed to Emit.
11487
11488         * delegate.cs (Define): Fixed crash when delegate type is undefined.
11489
11490 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
11491
11492         * cs-parser.jay: Fix small regression: we were not testing V2
11493         compiler features correctly.
11494
11495         * interface.cs: If the emit context is null, then create one
11496
11497 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
11498
11499         * decl.cs (GetSignatureForError): New virtual method to get full name
11500           for error messages.
11501
11502         * attribute.cs (IAttributeSupport): New interface for attribute setting.
11503           Now it is possible to rewrite ApplyAttributes method to be less if/else.
11504
11505         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
11506           Duplicated members and code in these classes has been removed.
11507           Better encapsulation in these classes.
11508
11509 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
11510
11511         * assign.cs (Assign.DoResolve): When dealing with compound
11512         assignments, there is a new rule in ECMA C# 2.4 (might have been
11513         there before, but it is documented here) that states that in:
11514
11515         a op= b;
11516
11517         If b is of type int, and the `op' is a shift-operator, then the
11518         above is evaluated as:
11519
11520         a = (int) a op b 
11521
11522         * expression.cs (Binary.ResolveOperator): Instead of testing for
11523         int/uint/long/ulong, try to implicitly convert to any of those
11524         types and use that in pointer arithmetic.
11525
11526         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
11527         method to print information for from the type, not from the
11528         null-method we were given.
11529
11530 2004-02-01  Duncan Mak  <duncan@ximian.com>
11531
11532         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
11533         parsing for cmd, fixes bug #53694.
11534
11535 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
11536
11537         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
11538         in the member name duplication tests. Property and operator name duplication
11539         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
11540
11541 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
11542
11543         * interface.cs (PopulateMethod): Fixed crash when interface method
11544         returns not existing type (error test cs0246-3.cs).
11545
11546 2004-02-02  Ravi Pratap M <ravi@ximian.com>
11547
11548         * cs-parser.jay (interface_accessors): Re-write actions to also
11549         store attributes attached to get and set methods. Fix spelling
11550         while at it.
11551
11552         (inteface_property_declaration): Modify accordingly.
11553
11554         (InterfaceAccessorInfo): New helper class to store information to pass
11555         around between rules that use interface_accessors.
11556
11557         * interface.cs (Emit): Apply attributes on the get and set
11558         accessors of properties and indexers too.
11559
11560         * attribute.cs (ApplyAttributes): Modify accordingly to use the
11561         right MethodBuilder when applying attributes to the get and set accessors.
11562
11563 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
11564
11565         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
11566
11567 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
11568
11569         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
11570
11571 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
11572
11573         * cs-parser.jay: Remove YIELD token, instead use the new grammar
11574         changes that treat `yield' specially when present before `break'
11575         or `return' tokens.
11576
11577         * cs-tokenizer.cs: yield is no longer a keyword.
11578
11579 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
11580
11581         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
11582         setting for default constructors.
11583         For default constructors are almost every time set wrong Modifier. The
11584         generated IL code has been alright. But inside mcs this values was
11585         wrong and this was reason why several of my CLS Compliance tests
11586         failed.
11587
11588 2004-02-27  Martin Baulig  <martin@ximian.com>
11589
11590         * generics.cs (ConstructedType.ResolveType): Make the nested type
11591         stuff actually work.
11592
11593 2004-02-25  Martin Baulig  <martin@ximian.com>
11594
11595         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
11596         property; returns the type parameters just from the current type,
11597         ie. with the ones from outer classes.
11598         (DeclSpace.LookupGeneric): First search in the current class, then
11599         in outer classes.
11600         (DeclSpace.initialize_type_params): When hiding a type parameter
11601         from an outer class, put it into the `type_param_list' anyways.
11602
11603         * expression.cs (MemberAccess.expr): Made this field protected.
11604
11605         * class.cs (TypeContainer.Define): The `CurrentType' just contains
11606         the type parameters from the current class.
11607
11608         * generic.cs (ConstructedType.ResolveType): Support nested generic
11609         types by taking the type parameters which we inherit from outer
11610         classes into account.
11611         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
11612         support for nested generic types.
11613
11614 2004-02-23  Martin Baulig  <martin@ximian.com>
11615
11616         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
11617         field and check whether we're nested inside a generic type.
11618         (DeclSpace.ResolveType): If we're resolving to a generic type
11619         definition, create a ConstructedType and return its resolved type.
11620         (DeclSpace.initialize_type_params): New private method;
11621         initializes the `type_param_list' field from the type parameters
11622         from this and all enclosing classes.
11623         (DeclSpace.TypeParameters): Call initialize_type_params() unless
11624         we're already initialized.
11625
11626 2004-02-23  Martin Baulig  <martin@ximian.com>
11627
11628         * class.cs (Method.Define): Create the generic method before
11629         calling DoDefine().
11630         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
11631         the TypeContainer one); we use this for generic methods.
11632
11633         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
11634         parent's TypeBuilder.
11635
11636 2004-02-18  Martin Baulig  <martin@ximian.com>
11637
11638         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
11639         to check for equality.
11640
11641 2004-02-05  Martin Baulig  <martin@ximian.com>
11642
11643         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
11644         `ec.TypeContainer.CurrentType', use it instead of
11645         `ec.ContainerType' to check whether we're in the type's ctor.
11646
11647 2004-01-29  Martin Baulig  <martin@ximian.com>
11648
11649         * expression.cs (Invocation.DoResolve): If we're a
11650         `ConstructedType', then we're actually a generic method, so
11651         rewrite the expr as a GenericMemberAccess.
11652
11653         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
11654         here; manually parse it into a string.
11655
11656 2004-01-28  Martin Baulig  <martin@ximian.com>
11657
11658         * typemanager.cs (TypeManager.IsEqual): New static method.
11659         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
11660         check for equality instead of using `=='.
11661
11662 2004-01-26  Martin Baulig  <martin@ximian.com>
11663
11664         * decl.cs (DeclSpace.CurrentType): New public field.
11665
11666         * expression.cs (This.ResolveBase): If we have an
11667         `ec.TypeContainer.CurrentType', use it instead of
11668         `ec.ContainerType'.
11669
11670         * class.cs (TypeContainer.DefineType): If we're a generic type,
11671         create the `CurrentType' (unresolved).
11672         (TypeContainer.GenericType): New private field.
11673         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
11674         it and store it in `GenericType' before creating the MemberCache.
11675         (TypeContainer.GetMembers): If we have a `GenericType', call
11676         TypeManager.FindMembers() on it.
11677
11678         * interface.cs (Interface.GenericType): New private field.
11679         (Interface.DefineType): If we're a generic type, create the
11680         `CurrentType' (unresolved).
11681         (Interface.DefineMembers): If we have a `CurrentType', resolve it
11682         and store it in `GenericType' before creating the MemberCache.
11683         (Interface.GetMembers): If we have a `GenericType', call
11684         TypeManager.FindMembers() on it.
11685
11686 2004-01-22  Martin Baulig  <martin@ximian.com>
11687
11688         * cs-parser.jay (namespace_or_type_name): Return an Expression,
11689         not a QualifiedIdentifier.  This is what `type_name_expression'
11690         was previously doing.
11691         (type_name_expression): Removed; the code is now in
11692         `namespace_or_type_name'.
11693         (qualified_identifier): Removed, use `namespace_or_type_name'
11694         instead.
11695         (QualifiedIdentifier): Removed this class.      
11696
11697 2004-01-22  Martin Baulig  <martin@ximian.com>
11698
11699         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
11700         not a string as alias name.
11701
11702 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
11703
11704         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
11705         #52730 bug, and instead compute correctly the need to use a
11706         temporary variable when requesting an address based on the
11707         static/instace modified of the field and the constructor.
11708  
11709 2004-01-21  Martin Baulig  <martin@ximian.com>
11710
11711         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
11712         class and namespace before looking up aliases.  Fixes #52517.
11713
11714 2004-01-21  Martin Baulig  <martin@ximian.com>
11715
11716         * flowanalysis.cs (UsageVector.Merge): Allow variables being
11717         assinged in a 'try'; fixes exception4.cs.
11718
11719 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11720         * class.cs : Implemented parameter-less constructor for TypeContainer
11721
11722         * decl.cs: Attributes are now stored here. New property OptAttributes
11723
11724         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
11725
11726         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
11727
11728 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11729
11730         * typemanager.cs (CSharpSignature): Now reports also inner class name.
11731           (CSharpSignature): New method for indexer and property signature.
11732
11733 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11734
11735         * pending.cs (IsVirtualFilter): Faster implementation.
11736
11737 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11738
11739         * typemanager.cs: Avoid inclusion of same assembly more than once.
11740
11741 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11742
11743         * cs-parser.jay: Fixed problem where the last assembly attribute
11744           has been applied also to following declaration (class, struct, etc.)
11745           
11746 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
11747
11748         * class.cs: Added error CS0538, CS0539 reporting.
11749         Fixed crash on Microsoft runtime when field type is void.
11750
11751         * cs-parser.jay: Added error CS0537 reporting.
11752
11753         * pending.cs: Added error CS0535 reporting.
11754         Improved error report for errors CS0536, CS0534.
11755
11756 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
11757
11758         Merge a few bits from the Anonymous Method MCS tree.
11759
11760         * statement.cs (ToplevelBlock): New class for toplevel methods,
11761         will hold anonymous methods, lifted variables.
11762
11763         * cs-parser.jay: Create toplevel blocks for delegates and for
11764         regular blocks of code. 
11765
11766 2004-01-20  Martin Baulig  <martin@ximian.com>
11767
11768         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
11769         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
11770         and `NeedExplicitReturn'; added `IsLastStatement'.
11771         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
11772         have a `ReturnLabel' or we're not unreachable.
11773
11774         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
11775         child's reachability; don't just override ours with it.  Fixes
11776         #58058 (lluis's example).
11777         (FlowBranching): Added public InTryOrCatch(), InCatch(),
11778         InFinally(), InLoop(), InSwitch() and
11779         BreakCrossesTryCatchBoundary() methods.
11780
11781         * statement.cs (Return): Do all error checking in Resolve().
11782         Unless we are the last statement in a top-level block, always
11783         create a return label and jump to it.
11784         (Break, Continue): Do all error checking in Resolve(); also make
11785         sure we aren't leaving a `finally'.
11786         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
11787         statement in a top-level block.
11788         (Block.Flags): Added `IsDestructor'.
11789         (Block.IsDestructor): New public property.
11790
11791 2004-01-20  Martin Baulig  <martin@ximian.com>
11792
11793         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
11794
11795 2004-01-20  Martin Baulig  <martin@ximian.com>
11796
11797         * statement.cs (Statement.ResolveUnreachable): New public method.
11798         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
11799         (Block.Resolve): Resolve unreachable statements.
11800
11801 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11802
11803         * expression.cs: We need to fix the case where we do
11804         not have a temp variable here.
11805
11806         * assign.cs: Only expression compound assignments need
11807         temporary variables.
11808
11809 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
11810
11811         * flowanalysis.cs: Reduce memory allocation in a few ways:
11812           - A block with no variables should not allocate a bit
11813             vector for itself.
11814           - A method with no out parameters does not need any tracking
11815             for assignment of the parameters, so we need not allocate
11816             any data for it.
11817           - The arrays:
11818                 public readonly Type[] VariableTypes;
11819                 public readonly string[] VariableNames;
11820             Are redundant. The data is already stored in the variable
11821             map, so we need not allocate another array for it.
11822           - We need to add alot of checks for if (params | locals) == null
11823             due to the first two changes.
11824
11825 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
11826
11827         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
11828         implement IMemoryLocation, we store a copy on a local variable and
11829         take the address of it.  Patch from Benjamin Jemlich
11830
11831         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
11832         to use a special "type_name_expression" rule which reduces the
11833         number of "QualifiedIdentifier" classes created, and instead
11834         directly creates MemberAccess expressions.
11835
11836 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
11837
11838         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
11839         that fixes #52853.  Null literal assignment to ValueType
11840
11841         * class.cs (MethodData.Emit): Instead of checking the name of the
11842         method to determine if its a destructor, create a new derived
11843         class from Method called Destructor, and test for that.  
11844
11845         * cs-parser.jay: Create a Destructor object instead of a Method.  
11846
11847         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
11848
11849         Fixes: 52933
11850
11851 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
11852
11853         * expression.cs (Binary.ResolveOperator): Perform an implicit
11854         conversion from MethodGroups to their delegate types on the
11855         Addition operation.
11856
11857         * delegate.cs: Introduce a new class DelegateCreation that is the
11858         base class for `NewDelegate' and `ImplicitDelegateCreation',
11859         factor some code in here.
11860
11861         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
11862         conversion from MethodGroups to compatible delegate types. 
11863
11864         * ecore.cs (Expression.Resolve): Do not flag error 654
11865         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
11866         we allow conversions from MethodGroups to delegate types now.
11867
11868         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
11869         assignments in v2 either.
11870
11871 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
11872
11873         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
11874         static read-only fields in ctors.
11875
11876         Applied patch from Benjamin Jemlich 
11877
11878         * expression.cs (UnaryMutator): Avoid leaking local variables. 
11879
11880 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
11881
11882         * cs-tokenizer.cs (IsCastToken): Allow the various native types
11883         here to return true, as they can be used like this:
11884
11885                 (XXX) int.MEMBER ()
11886
11887         Fixed 49836 and all the other dups
11888
11889 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
11890
11891         * driver.cs: Implement /win32res and /win32icon.
11892
11893 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
11894
11895         * cs-parser.jay: Add a rule to improve error handling for the
11896         common mistake of placing modifiers after the type.
11897
11898 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
11899
11900         * cs-parser.jay (interface_event_declaration): Catch
11901         initialization of events on interfaces, and report cs0068
11902
11903         * cs-parser.jay (interface_event_declaration): Catch
11904         initialization of events. 
11905
11906         * ecore.cs: Better report missing constructors.
11907
11908         * expression.cs (Binary.ResolveOperator): My previous bug fix had
11909         the error reporting done in the wrong place.  Fix.
11910
11911         * expression.cs (Binary.ResolveOperator): Catch the 
11912         operator + (E x, E y) error earlier, and later allow for implicit
11913         conversions in operator +/- (E e, U x) from U to the underlying
11914         type of E.
11915
11916         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
11917         52596, if the container class is abstract, the default constructor
11918         is protected otherwise its public (before, we were always public).
11919
11920         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
11921         fixed statement.
11922
11923         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
11924         Jemlich that fixes bug #52597, MCS was generating invalid code for
11925         idisposable structs.   Thanks to Ben for following up with this
11926         bug as well.
11927
11928 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
11929
11930         * driver.cs: Allow assemblies without code to be generated, fixes
11931         52230.
11932
11933 2004-01-07  Nick Drochak <ndrochak@gol.com>
11934
11935         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
11936
11937 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
11938
11939         * cs-parser.jay: Add rules to improve error reporting if fields or
11940         methods are declared at the namespace level (error 116)
11941
11942         * Add rules to catch event add/remove
11943
11944 2004-01-04  David Sheldon <dave-mono@earth.li>
11945
11946   * expression.cs: Added matching ")" to error message for 
11947   CS0077
11948
11949 2004-01-03 Todd Berman <tberman@gentoo.org>
11950
11951         * ecore.cs, attribute.cs:
11952         Applying fix from #52429.
11953
11954 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11955
11956         * ecore.cs, expression.cs, statement.cs:
11957         Total rewrite of how we handle branching. We
11958         now handle complex boolean expressions with fewer
11959         jumps. As well if (x == 0) no longer emits a ceq.
11960
11961         if (x is Foo) is much faster now, because we generate
11962         better code.
11963
11964         Overall, we get a pretty big improvement on our benchmark
11965         tests. The code we generate is smaller and more readable.
11966
11967         I did a full two-stage bootstrap. The patch was reviewed
11968         by Martin and Miguel.
11969
11970 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11971
11972         * cs-parser.jay: Make primary_expression not take a QI.
11973         we dont need this because the member_access rule covers
11974         us here. So we replace the rule with just IDENTIFIER.
11975
11976         This has two good effects. First, we remove a s/r conflict.
11977         Second, we allocate many fewer QualifiedIdentifier objects.
11978
11979 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11980
11981         * attribute.cs: Handle MarshalAs attributes as pseudo, and
11982         set the correct information via SRE. This prevents
11983         hanging on the MS runtime. Fixes #29374.
11984
11985 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
11986
11987         * convert.cs: correctly handle conversions to value types
11988         from Enum and ValueType as unboxing conversions.
11989
11990         Fixes bug #52569. Patch by Benjamin Jemlich.
11991
11992 2004-01-02  Ravi Pratap  <ravi@ximian.com>
11993
11994         * expression.cs (BetterConversion): Prefer int -> uint
11995         over int -> ulong (csc's behaviour). This fixed bug #52046.
11996
11997 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
11998
11999         * decl.cs (MemberCache.FindMembers): now returns a
12000         MemberInfo [].
12001
12002         * typemanager.cs: In general, go with with ^^.
12003         (CopyNewMethods): take an IList.
12004         (RealMemberLookup): Only allocate an arraylist
12005         if we copy from two sets of methods.
12006
12007         This change basically does two things:
12008         1) Fewer array lists allocated due to CopyNewMethods.
12009         2) the explicit cast in MemberList costed ALOT.
12010
12011 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12012
12013         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12014         a hashtable to avoid needless string allocations when an identifier is
12015         used more than once (the common case).
12016
12017 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12018
12019         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12020         is broken, it will not return anything. So, we
12021         have to use the information we have in mcs to
12022         do the task.
12023
12024         * typemanager.cs: Add a cache for GetInterfaces,
12025         since this will now be used more often (due to ^^)
12026
12027         (GetExplicitInterfaces) New method that gets the
12028         declared, not effective, interfaces on a type
12029         builder (eg, if you have interface IFoo, interface
12030         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12031         { IBar }.
12032
12033         This patch makes MCS able to bootstrap itself on
12034         Windows again.
12035
12036 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12037
12038         * expression.cs: Remove the Nop's that Miguel put
12039         in by mistake.
12040
12041 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12042
12043         * report.cs, codegen.cs: Give the real stack trace to
12044         the error when an exception is thrown.
12045
12046 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12047
12048         * decl.cs: only allocate hashtables for ifaces if 
12049         it is an iface!
12050
12051 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12052
12053         * expression.cs: fix the error from cs0121-2.cs
12054         (a parent interface has two child interfaces that
12055         have a function with the same name and 0 params
12056         and the function is called through the parent).
12057
12058 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12059
12060         * class.cs, rootcontext.cs, typmanager.cs: do not
12061         leak pointers.
12062
12063 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12064
12065         * codegen.cs: remove stack for the ec flow branching.
12066         It is already a linked list, so no need.
12067
12068 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12069
12070         * Makefile: Allow custom profiler here.
12071
12072 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12073
12074         * typemanager.cs (LookupType):
12075           - Use a static char [], because split takes
12076             a param array for args, so it was allocating
12077             every time.
12078           - Do not store true in a hashtable, it boxes.
12079
12080 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12081
12082         * flowanalysis.cs: bytify common enums.
12083
12084 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12085
12086         * modifiers.cs: Add a new set of flags for the
12087         flags allowed on explicit interface impls.
12088         * cs-parser.jay: catch the use of modifiers in
12089         interfaces correctly.
12090         * class.cs: catch private void IFoo.Blah ().
12091
12092         All related to bug #50572.
12093
12094 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12095
12096         * decl.cs: Rewrite the consistant accessability checking.
12097         Accessability is not linear, it must be implemented in
12098         a tableish way. Fixes #49704.
12099
12100 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12101
12102         * expression.cs: Handle negation in a checked context.
12103         We must use subtraction from zero. Fixes #38674.
12104
12105 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12106
12107         * class.cs: Ignore static void main in DLLs.
12108         * rootcontext.cs: Handle the target type here,
12109         since we are have to access it from class.cs
12110         * driver.cs: account for the above.
12111
12112 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12113
12114         * report.cs: Give line numbers and files if available.
12115
12116 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12117
12118         * driver.cs: Implement /addmodule.
12119
12120         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12121         ModuleBuilders.
12122
12123 2003-12-20  Martin Baulig  <martin@ximian.com>
12124
12125         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12126         (FieldBase.IsAssigned): Removed this field.
12127         (FieldBase.SetAssigned): New public method.
12128         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12129
12130 2003-12-20  Martin Baulig  <martin@ximian.com>
12131
12132         * expression.cs (LocalVariableReference.DoResolve): Don't set
12133         `vi.Used' if we're called from DoResolveLValue().
12134
12135         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12136         returns the usage vector it just merged into the current one -
12137         pass this one to UsageWarning().
12138         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12139         of the `EmitContext', don't call this recursively on our children.
12140
12141 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12142
12143         * driver.cs: Implement /target:module.
12144
12145 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12146
12147         * support.cs (CharArrayHashtable): New helper class.
12148
12149         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12150         char arrays, not strings, so we can avoid creating a string in
12151         consume_identifier if the identifier is a keyword.
12152
12153 2003-12-16  Martin Baulig  <martin@ximian.com>
12154
12155         * statement.cs (LocalInfo.Assigned): Removed this property.
12156         (LocalInfo.Flags): Removed `Assigned'.
12157         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12158         and uses flow analysis.
12159         (Block.UsageWarning): Made this method private.
12160         (Block.Resolve): Call UsageWarning() if appropriate.
12161
12162         * expression.cs (LocalVariableReference.DoResolve): Always set
12163         LocalInfo.Used here.
12164
12165 2003-12-13  Martin Baulig  <martin@ximian.com>
12166
12167         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12168         any value here; we're now using flow analysis to figure out
12169         whether a statement/block returns a value.
12170
12171 2003-12-13  Martin Baulig  <martin@ximian.com>
12172
12173         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12174         working again.
12175         (FlowBranching.MergeFinally): Don't call
12176         `branching.CheckOutParameters()' here, this is called in
12177         MergeTopBlock().
12178         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12179         when adding the `finally' vector.       
12180
12181 2003-12-13  Martin Baulig  <martin@ximian.com>
12182
12183         * flowanalysis.cs
12184         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12185         actually work and also fix #48962.
12186
12187 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12188
12189         * decl.cs: Do not check System.Object for nested types,
12190         since we know it does not have any. Big bang for buck:
12191
12192         BEFORE:
12193            Run 1:   8.35 seconds
12194            Run 2:   8.32 seconds
12195            corlib:  17.99 seconds
12196         AFTER:
12197            Run 1:   8.17 seconds
12198            Run 2:   8.17 seconds
12199            corlib:  17.39 seconds
12200
12201 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12202
12203         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12204         time we are returning 0 members, so we save alot here.
12205
12206 2003-12-11  Martin Baulig  <martin@ximian.com>
12207
12208         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12209         `MergeChild()', also just take the `FlowBranching' as argument;
12210         call Merge() on it and return the result.
12211         (FlowBranching.Merge): We don't need to do anything if we just
12212         have one sibling.
12213
12214 2003-12-11  Martin Baulig  <martin@ximian.com>
12215
12216         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12217         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12218         Maurer for this idea.
12219
12220 2003-12-11  Martin Baulig  <martin@ximian.com>
12221
12222         * flowanalysis.cs (MergeResult): This class is now gone; we now
12223         use the `UsageVector' for this.  The reason for this is that if a
12224         branching just has one sibling, we don't need to "merge" them at
12225         all - that's the next step to do.
12226         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12227         `MergeResult'.
12228
12229 2003-12-11  Martin Baulig  <martin@ximian.com>
12230
12231         Reworked flow analyis and made it more precise and bug-free.  The
12232         most important change is that we're now using a special `Reachability'
12233         class instead of having "magic" meanings of `FlowReturns'.  I'll
12234         do some more cleanups and optimizations and also add some more
12235         documentation this week.
12236
12237         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
12238         largely reworked this class.
12239         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
12240         the new `Reachability' class instead of having "magic" values here.
12241         (FlowBranching): We're now using an instance of `Reachability'
12242         instead of having separate `Returns', `Breaks' etc. fields.
12243
12244         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
12245         based on flow analysis; ignore the return value of block.Emit ().
12246
12247 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
12248
12249         * driver.cs typemanager.cs: Find the mono extensions to corlib even
12250         if they are private.
12251
12252 2003-12-09  Martin Baulig  <martin@ximian.com>
12253
12254         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
12255         call them directly on the UsageVector.
12256
12257 2003-12-09  Martin Baulig  <martin@ximian.com>
12258
12259         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
12260         Changed return type from `FlowReturns' to `Reachability'.
12261
12262 2003-12-09  Martin Baulig  <martin@ximian.com>
12263
12264         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
12265         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
12266         `Reachable' fields with a single `Reachability' one.
12267
12268 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12269
12270         * class.cs (FindMembers): Remove foreach's.
12271
12272         Bootstrap times:
12273
12274         BEFORE
12275                 Run 1:   8.74 seconds
12276                 Run 2:   8.71 seconds
12277
12278         AFTER
12279                 Run 1:   8.64 seconds
12280                 Run 2:   8.58 seconds
12281
12282
12283 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12284
12285         * cs-parser.jay:
12286         * gen-treedump.cs:
12287         * statement.cs:
12288         This patch does a few things:
12289                 1. EmptyStatement is now a singleton, so it is never reallocated.
12290                 2. All blah is EmptyStatement constructs have been changed to
12291                    blah == EmptyStatement.Value, which is much faster and valid
12292                    now that EmptyStatement is a singleton.
12293                 3. When resolving a block, rather than allocating a new array for
12294                    the non-empty statements, empty statements are replaced with
12295                    EmptyStatement.Value
12296                 4. Some recursive functions have been made non-recursive.
12297         Mainly the performance impact is from (3), however (1) and (2) are needed for
12298         this to work. (4) does not make a big difference in normal situations, however
12299         it makes the profile look saner.
12300
12301         Bootstrap times:
12302
12303         BEFORE
12304         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12305         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
12306         Total memory allocated: 56397 KB
12307
12308         AFTER
12309         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
12310         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
12311         Total memory allocated: 55666 KB
12312
12313 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12314
12315         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
12316         than the hashtable in a hashtable version
12317
12318         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
12319         we always end up concating a string. This results in a huge perf
12320         loss, because many strings have to be tracked by the GC. In this
12321         patch, we first use a hashtable that works with two keys, so that
12322         the strings do not need to be concat'ed.
12323
12324         Bootstrap times:
12325         BEFORE
12326                 Run 1:   8.74 seconds
12327                 Run 2:   8.71 seconds
12328
12329         AFTER
12330                 Run 1:   8.65 seconds
12331                 Run 2:   8.56 seconds
12332
12333 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
12334
12335         * Makefile: Add a new target `do-time' that does a quick and simple
12336         profile, leaving easy to parse output.
12337
12338 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
12339
12340         * codegen.cs (Init): Create the dynamic assembly with 
12341         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
12342
12343 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12344
12345         * support.cs: Make the PtrHashtable use only one
12346         instance of its comparer.
12347
12348 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
12349
12350         * typemanager.cs: Fix lookup of GetNamespaces.
12351
12352 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
12353
12354         * expression.cs: Removed redundant line.
12355
12356         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
12357         ArrayLists, use for loops with bounds.  
12358
12359         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
12360         arraylist.
12361
12362         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
12363         arraylists, use for loop with bounds.
12364
12365         The above three changes give us a 0.071 second performance
12366         improvement out of 3.294 seconds down to 3.223.  On my machine
12367         the above changes reduced the memory usage by 1,387 KB during
12368         compiler bootstrap.
12369
12370         * cs-parser.jay (QualifiedIdentifier): New class used to represent
12371         QualifiedIdentifiers.  Before we created a new string through
12372         concatenation, and mostly later on, the result would be
12373         manipulated by DecomposeQI through string manipulation.
12374
12375         This reduced the compiler memory usage for bootstrapping from
12376         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
12377         compile times in 0.05 seconds.
12378
12379 2003-11-28  Dick Porter  <dick@ximian.com>
12380
12381         * support.cs: Do string compares with the Invariant culture.
12382
12383         * rootcontext.cs: 
12384         * gen-treedump.cs: 
12385         * expression.cs: 
12386         * driver.cs: 
12387         * decl.cs: 
12388         * codegen.cs: 
12389         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
12390         the comparison is done with the Invariant culture.
12391
12392 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
12393
12394         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
12395         GetEnumerator method.
12396
12397         (ProbeCollectionType): Iterate starting at the most specific type
12398         upwards looking for a GetEnumerator
12399
12400         * expression.cs: Shift count can be up to 31 for int/uint and 63
12401         for long/ulong.
12402
12403 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
12404
12405         * statement.cs (Block.LookupLabel): Also look for the label on the
12406         children blocks.  Use a hash table to keep track of visited
12407         nodes. 
12408
12409         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
12410         we actually did transform the other operand, otherwise fall back
12411         to the common codepath that casts to long.
12412
12413         * cs-tokenizer.cs: Use the same code pattern as the int case.
12414         Maybe I should do the parsing myself, and avoid depending on the
12415         Parse routines to get this done.
12416
12417 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
12418
12419         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12420         which fixes bug 51347.  This time test it.
12421
12422         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
12423         attributes for example can not tell the difference between these.
12424         The difference was only a syntax feature of the language. 
12425
12426         * attribute.cs: Apply attributes to delegates.
12427
12428         * delegate.cs: Call the apply attributes method.
12429
12430 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
12431
12432         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
12433         comparing 0 vs Byte.MinValue, not the value
12434
12435         (ImplicitConversionRequired): When reporting a conversion error,
12436         use error 31 to print out the constant error instead of the
12437         simpler 29.
12438
12439         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
12440         which fixes bug 51347.
12441
12442 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
12443
12444         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
12445         which fixes the -warnaserror command line option.
12446
12447 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
12448
12449         * cfold.cs (DoNumericPromotions): During constant folding of
12450         additions on UIntConstant, special case intconstants with
12451         IntConstants like we do on the expression binary operator. 
12452
12453 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
12454
12455         * convert.cs (ImplicitReferenceConversion): We were missing a case
12456         (System.Enum are not value types or class types, so we need to
12457         classify them separatedly).
12458
12459         * driver.cs: We do not support error 2007.
12460
12461 2003-11-12 Jackson Harper <jackson@ximian.com>
12462
12463         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
12464         system directory. Also use the full file name so users can
12465         libraries names mscorlib-o-tron.dll in a non system dir.
12466         
12467 2004-01-04  David Sheldon <dave-mono@earth.li>
12468
12469         * expression.cs: Added matching ")" to error message for CS0077.
12470
12471 2003-12-19  Martin Baulig  <martin@ximian.com>
12472
12473         * typemanager.cs (TypeManager.IsEqualGenericType): New public
12474         static method; see documentation in the method.
12475         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
12476
12477         * convert.cs (Convert.ImplicitReferenceConversion,
12478         Convert.ImplicitReferenceConversionExists): Add support for
12479         generic type declarations; see gen-36.cs.
12480
12481 2003-12-19  Martin Baulig  <martin@ximian.com>
12482
12483         * pending.cs (Pending.InterfaceMethod): Use
12484         `Type.IsAssignableFrom()' instead of `=='.
12485
12486 2003-12-18  Martin Baulig  <martin@ximian.com>
12487
12488         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
12489         byref types first.
12490
12491         * convert.cs (Convert.ImplicitStandardConversionExists): Use
12492         `expr_type.Equals (target_type)' instead of `=='.
12493
12494 2003-12-08  Martin Baulig  <martin@ximian.com>
12495
12496         * generics.cs (Constraints.Types): Removed.
12497         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
12498         to Type's.
12499         (Constraints.ResolveTypes): New public method; resolves the
12500         TypeExpr's to Type's.
12501         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
12502         longer takes the constraints.
12503         (TypeParameter.DefineMethod): Likewise.
12504         (TypeParameter.DefineType): New public method.  Calls
12505         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
12506         the constraints.
12507
12508 2003-12-08  Martin Baulig  <martin@ximian.com>
12509
12510         * convert.cs (Convert.ImplicitConversionStandard): Use
12511         `expr_type.Equals (target_type)' instead of `=='.
12512
12513 2003-12-08  Martin Baulig  <martin@ximian.com>
12514
12515         * typemanager.cs (TypeManager.GetReferenceType): Call
12516         `Type.MakeByRefType ()'.
12517
12518 2003-12-08  Martin Baulig  <martin@ximian.com>
12519
12520         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
12521         just has some special meaning in some situations.  For instance,
12522         it is allowed to use `where' as the name of a variable etc.
12523
12524 2003-12-04  Martin Baulig  <martin@ximian.com>
12525
12526         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
12527         `Type.MakeArrayType()' for array types.
12528
12529 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
12530
12531         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
12532         debugging message.
12533
12534         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
12535         corlib to compile.
12536
12537 2003-11-16  Martin Baulig  <martin@ximian.com>
12538
12539         * codegen.cs (EmitContext.IsGeneric): Removed.
12540
12541         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
12542         ResolveGeneric() on the DeclSpace.
12543
12544 2003-11-16  Martin Baulig  <martin@ximian.com>
12545
12546         * generic.cs (TypeArguments.Resolve):
12547         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
12548         `ResolveType()' on it to get the Type.
12549
12550 2003-11-15  Martin Baulig  <martin@ximian.com>
12551
12552         * generic.cs (ConstructedType.GetInterfaces): Override this.
12553
12554 2003-11-14  Martin Baulig  <martin@ximian.com>
12555
12556         * interface.cs (Interface.DefineType): Define all type parameters
12557         before adding the interfaces we inherit.
12558
12559 2003-11-11  Martin Baulig  <martin@ximian.com>
12560
12561         * generic.cs (ConstructedType.ResolveType): Always call
12562         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
12563
12564 2003-11-10  Martin Baulig  <martin@ximian.com>
12565
12566         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
12567         (TypeManager.InitCoreTypes): Initialize them here, but instead of
12568         calling `ResolveType()' on them, directly assign their `Type'.
12569
12570 2003-11-08  Martin Baulig  <martin@ximian.com>
12571
12572         * generic.cs (ConstructedType): Override `IsClass' etc.
12573
12574 2003-11-08  Martin Baulig  <martin@ximian.com>
12575
12576         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
12577         return value and the `out parent' parameter.
12578         (TypeContainer.DefineType): Moved the CS0644 check into
12579         GetClassBases().  Don't pass the interface types to the
12580         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
12581         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
12582
12583         * ecore.cs (TypeExpr.IsAttribute): New property.
12584         (TypeExpr.GetInterfaces): New method.
12585
12586         * interface.cs (Interface.GetInterfaceTypeByName): Return a
12587         TypeExpr instead of a Type.
12588         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
12589         (Interface.DefineType): Don't pass the interface types to the
12590         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
12591         them later and then call `TypeBulider.AddInterfaceImplementation()'.
12592
12593         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
12594         instead of a `Type[]'.
12595         (TypeManager.RegisterBuilder): Likewise.
12596         (TypeManager.AddUserInterface): Likewise.
12597         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
12598         `Type[]' and also return a `TypeExpr[]'.
12599         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
12600
12601 2003-11-08  Martin Baulig  <martin@ximian.com>
12602
12603         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
12604         Expression.     
12605
12606 2003-11-08  Martin Baulig  <martin@ximian.com>
12607
12608         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
12609         TypeManager.ResolveExpressionTypes().
12610
12611         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
12612         instead of an Expression.
12613         (TypeExpr): This is now an abstract base class for `TypeExpression'.
12614         (TypeExpression): New public class; formerly known as `TypeExpr'.
12615
12616         * expression.cs (ComposedCast): Derive from TypeExpr.
12617
12618         * typemanager.cs (TypeManager.system_*_expr): These are now
12619         TypExpr's instead of Expression's.
12620         (TypeManager.ResolveExpressionTypes): New public static function;
12621         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
12622         of them.        
12623
12624 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
12625
12626         * expression.cs (New.DoResolve): Do not dereference value that
12627         might be a null return.
12628
12629         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
12630         sure that the constant value has the right type.  Fixes an
12631         unreported bug, similar to 50425.
12632
12633         * const.cs (Const.LookupConstantValue): Call
12634         ImplicitStandardConversionExists before doing a conversion to
12635         avoid havng the TypeManager.ChangeType do conversions.
12636
12637         Reduced the number of casts used
12638
12639         (Const.ChangeType): New routine to enable reuse of the constant
12640         type changing code from statement.
12641
12642         * typemanager.cs (ChangeType): Move common initialization to
12643         static global variables.
12644
12645         Fixes #50425.
12646
12647         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
12648         every value type to go through, even if it was void.  Fix that. 
12649
12650         * cs-tokenizer.cs: Use is_identifier_start_character on the start
12651         character of the define, and the is_identifier_part_character for
12652         the rest of the string.
12653
12654 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
12655
12656         * expression.cs (UnaryMutator.EmitCode): When I updated
12657         LocalVariableReference.DoResolve, I overdid it, and dropped an
12658         optimization done on local variable references.
12659
12660 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
12661
12662         * ecore.cs: Convert the return from Ldlen into an int.
12663
12664 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
12665
12666         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
12667         the accessibility, this is a special case for toplevel non-public
12668         classes (internal for instance).
12669
12670 2003-10-20  Nick Drochak <ndrochak@gol.com>
12671
12672         * ecore.cs: Fix typo and build.  Needed another right paren.
12673
12674 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
12675
12676         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
12677         `internal' case regular and protected, but not allowing protected
12678         to be evaluated later.  Bug 49840
12679
12680 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
12681
12682         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
12683         to kb.Nlast, and not the kb.nFirst to isolate the switch
12684         statement.
12685
12686         Extract the underlying type, so enumerations of long/ulong are
12687         treated like long/ulong.
12688
12689 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
12690
12691         * expression.cs (New): Overload the meaning of RequestedType to
12692         track the possible creation of the NewDelegate type, since
12693         DoResolve is invoked more than once for new constructors on field
12694         initialization.
12695
12696         See bugs: #48800 and #37014
12697
12698         * cs-parser.jay (declare_local_constants): Take an arraylist
12699         instead of a single constant.
12700
12701         (local_constant_declaration): It should take a
12702         constant_declarators, not a constant_declarator.  Fixes 49487
12703
12704         * convert.cs: Fix error report.
12705
12706 2003-10-13 Jackson Harper <jackson@ximian.com>
12707
12708         * typemanager.cs (TypeToCoreType): Add float and double this fixes
12709         bug #49611
12710         
12711 2003-11-03  Martin Baulig  <martin@ximian.com>
12712
12713         * expression.cs (ArrayAccess.GetStoreOpcode): Added
12714         `out bool has_type_arg'; if set, we need to pass the type to
12715         ig.Emit().
12716         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
12717         Stelem_Any/Ldelem_Any for generic parameters.   
12718
12719 2003-11-02  Martin Baulig  <martin@ximian.com>
12720
12721         * expression.cs (Invocation.EmitCall): Use
12722         `TypeManager.IsValueType()' to check whether it's a value type.
12723         Don't set `struct_call' when calling a method on a type parameter.
12724
12725 2003-11-02  Martin Baulig  <martin@ximian.com>
12726
12727         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
12728         and removed the TypeBuilder argument.
12729
12730         * typemanager.cs (TypeManager.IsValueType): Return
12731         `t.IsGenericParameter || t.IsValueType'.
12732
12733 2003-10-25  Martin Baulig  <martin@ximian.com>
12734
12735         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
12736         call ConstructedType.Resolve() on it.
12737
12738         * generic.cs (ConstructedType.Resolve): Set `type' on success.
12739
12740 2003-10-25  Martin Baulig  <martin@ximian.com>
12741
12742         * class.cs (TypeContainer.GetClassBases): Changed
12743         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
12744         CS8214 reporting here.
12745         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
12746         instead of a `Type' for our parent.  In case of a recursive
12747         declaration (see tests/gen-23.cs for an example), our parent is a
12748         ConstructedType and it doesn't have its type set.  So, first
12749         create our own TypeBuilder, then call constructed.Resolve() to get
12750         the parent's type and finally TypeBuilder.SetParent() it.
12751
12752         * ecore.cs (TypeExpr.Name): New public virtual property.
12753
12754         * generic.cs
12755         (ConstructedType): We're now a TypeExpr and not just an Expression.
12756         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
12757         arguments here; this is done later.
12758         (ConstructedType.Resolve): New public method to resolve the type
12759         arguments and bind them.
12760
12761 2003-10-21  Martin Baulig  <martin@ximian.com>
12762
12763         * convert.cs: Use `TypeManager.IsValueType' instead of
12764         'type.IsValueType' everywhere.
12765
12766         * typemanager.cs (TypeManager.IsValueType): Return true for type
12767         parameters.  The reason for this is that we need to box a type
12768         parameter when converting it to a reference type.
12769
12770         * cs-parser.jay: Added support for default value expressions.
12771
12772         * generics.cs (DefaultValueExpression): New public class.       
12773
12774 2003-10-17  Martin Baulig  <martin@ximian.com>
12775
12776         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
12777         TypeContainer so we can also use this for Interfaces.
12778         (TypeParameter.Resolve): Likewise.
12779
12780         * interface.cs (Interface.DefineType): Added support for generic
12781         interfaces.
12782
12783         * cs-parser.jay: Added support for generic structs and interfaces.
12784
12785 2003-10-17  Martin Baulig  <martin@ximian.com>
12786
12787         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
12788         call generic methods :-)
12789
12790 2003-10-16  Martin Baulig  <martin@ximian.com>
12791
12792         * cs-parser.jay (namespace_or_type_name): Only create a
12793         GenericMemberAccess if we actually have type arguments.
12794
12795 2003-10-13  Martin Baulig  <martin@ximian.com>
12796
12797         * class.cs (Method.Define): If we're a generic method, call
12798         TypeBuilder.DefineGenericMethod () before resolving
12799         the parameters.
12800         (MethodData): Added .ctor which takes an additional MethodBuilder
12801         argument; this is used for generic methods.
12802         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
12803         we already have a MethodBuilder.
12804
12805 2003-10-10  Martin Baulig  <martin@ximian.com>
12806
12807         * class.cs (Method): Added .ctor which takes a `GenericMethod'
12808         instead of a `DeclSpace'.  This is used for generic methods.
12809
12810         * cs-parser.jay (method_header): Added support for generic
12811         methods; create a `GenericMethod' instance and pass it to the
12812         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
12813         parameters and locals.
12814
12815         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
12816         since we already have the location.  Check whether we're a generic
12817         type declaration or a generic method and create the correct type
12818         parameter.
12819
12820         * generic.cs (TypeParameter.DefineMethod): New public method.
12821         (GenericMethod): New public class; derives from DeclSpace and is
12822         used for generic methods.       
12823
12824 2003-10-09  Martin Baulig  <martin@ximian.com>
12825
12826         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
12827         to the .ctor.
12828         (MethodCore.DoDefineParameters): Removed the TypeContainer
12829         argument; use the DeclSpace which was passed to the .ctor instead.
12830         (MethodCore.CheckParameter): Take a DeclSpace instead of a
12831         TypeContainer; we only need a DeclSpace here.
12832
12833 2003-10-09  Martin Baulig  <martin@ximian.com>
12834
12835         * class.cs (MethodData): Added additional `DeclSpace ds' argument
12836         to the .ctor.
12837         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
12838         EmitContext's .ctor.    
12839
12840 2003-10-09  Martin Baulig  <martin@ximian.com>
12841
12842         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
12843         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
12844         AsAccessible(), moved them as well.
12845
12846         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
12847
12848 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
12849
12850         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
12851         generation for >=, as spotted by Paolo, bug 48679.  
12852         Patch from David Waite.
12853
12854         * cs-tokenizer.cs: Add handling for #pragma.
12855
12856         * cs-parser.jay: Allow for both yield and yield return in the
12857         syntax.  The anti-cobolization of C# fight will go on!
12858
12859         * class.cs (TypeBuilder.DefineType): Catch error condition here
12860         (Parent.DefineType erroring out and returning null).
12861
12862         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12863         coping with enumerations variables, we were mistakenly processing
12864         them as a regular value type instead of built-in types.  Fixes the
12865         bug #48063
12866
12867         * typemanager.cs (IsBuiltinOrEnum): New method.
12868
12869 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
12870
12871         * cs-parser.jay: Upgrade: yield now needs the return clause.
12872
12873 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
12874
12875         * cs-parser.jay : Renamed yyName to yyNames related to jay.
12876
12877 2003-09-29  Martin Baulig  <martin@ximian.com>
12878
12879         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
12880         inflated generic methods.
12881
12882         * generics.cs (ConstructedType): Distinguish between open and
12883         closed constructed types; correctly resolve the arguments.
12884
12885 2003-09-22  Martin Baulig  <martin@ximian.com>
12886
12887         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
12888         all type arguments meet their constraints.
12889
12890 2003-09-19  Martin Baulig  <martin@ximian.com>
12891
12892         * decl.cs (MemberCache.SetupCacheForInterface): Take a
12893         `MemberCache parent' argument.  Normally, an interface doesn't
12894         have a parent type except System.Object, but we use this in gmcs
12895         for generic type parameters.
12896
12897 2003-09-18  Martin Baulig  <martin@ximian.com>
12898
12899         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
12900         on `type.IsInterface'; don't check whether the type has a parent
12901         to determine whether it's an interface.
12902
12903 2003-09-17  Martin Baulig  <martin@ximian.com>
12904
12905         * generic.cs (ConstructedType.ToString): Always use `name' as the
12906         type name.
12907
12908 2003-09-15  Martin Baulig  <martin@ximian.com>
12909
12910         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
12911
12912         * generic.cs (Constraints.Resolve): New public method; this is
12913         called to resolve the constraint types and to check whether all
12914         the constraints are correct.
12915         (Constraints.Types): New public property.
12916         (TypeParameter.Resolve): New public method; resolves all the
12917         type's constraints.
12918
12919         * class.cs (TypeContainer.DefineType): Call
12920         TypeParameter.Resolve() before actually defining the type.
12921
12922 2003-09-15  Martin Baulig  <martin@ximian.com>
12923
12924         * class.cs (TypeContainer.DefineType): Added an error flag to
12925         avoid reporting duplicate CS0146's ("class definition is
12926         circular.").
12927
12928         * driver.cs (Driver.MainDriver): Abort if
12929         RootContext.ResolveTree() reported any errors.
12930
12931 2003-09-07  Martin Baulig  <martin@ximian.com>
12932
12933         * report.cs (Error, Warning): Added overloaded versions which take
12934         a `params object[] args' and call String.Format().
12935
12936 2003-09-07  Martin Baulig  <martin@ximian.com>
12937
12938         * decl.cs (DeclSpace..ctor): Don't call
12939         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
12940         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
12941         (DeclSpace.RecordDecl): New method.
12942
12943         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
12944
12945 2003-09-02  Ravi Pratap  <ravi@ximian.com>
12946
12947         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
12948         value attributes to be applied to ParameterBuilders.
12949
12950         * class.cs (MethodCore.LabelParameters): Make static and more
12951         generic so that it can be used from other places - like interface
12952         methods, for instance.
12953
12954         * interface.cs (Interface.Emit): Call LabelParameters before
12955         emitting attributes on the InterfaceMethod.
12956
12957 2003-09-07  Martin Baulig  <martin@ximian.com>
12958
12959         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
12960         if the number of type parameters doesn't match.
12961
12962 2003-09-04  Martin Baulig  <martin@ximian.com>
12963
12964         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
12965         for arrays of generic type params (ie. `!0[]').
12966
12967 2003-09-04  Martin Baulig  <martin@ximian.com>
12968
12969         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
12970         for the moment.
12971
12972 2003-09-04  Martin Baulig  <martin@ximian.com>
12973
12974         * decl.cs (DeclSpace.LookupGeneric): New method.
12975         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
12976         moment.
12977
12978         * generic.cs (TypeParameterExpr): Take a TypeParameter as
12979         argument, not just a string.
12980         (TypeParameter.Define): New public method; this is called to
12981         actually define the generic parameter; after this, you can use the
12982         new `Type' property to get the type.
12983
12984 2003-09-04  Martin Baulig  <martin@ximian.com>
12985
12986         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
12987         is now an ArrayList; initialize the result of the `TypeParameters'
12988         property here.
12989         (DeclSpace.GetGenericData): Removed.
12990         (DeclSpace.LookupGeneric): Temporarily removed; we need to
12991         implement this in a different way.
12992         (DeclSpace.GetTypeParameters): Removed; there's now a
12993         `TypeParameters' property.
12994         (DeclSpace.TypeParameters): New public property.
12995
12996         * generic.cs (Constraints): Make this class public.
12997         (TypeParameter): New public class.
12998
12999 2003-09-04  Martin Baulig  <martin@ximian.com>
13000
13001         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13002         generic parameters.
13003
13004         * class.cs (TypeContainer.DefineType): Call
13005         TypeBuilder.DefineGenericParameter () on all generic parameters if
13006         this is a generic type.
13007
13008 2003-08-28  Martin Baulig  <martin@ximian.com>
13009
13010         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13011         sample-stack.il".
13012
13013         * sample-hello.cs: Compile this with gmcs: "gmcs
13014         /r:sample-stack.dll sample-hello.cs".
13015
13016 2003-08-28  Martin Baulig  <martin@ximian.com>
13017
13018         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13019         the parameters to the generic type.
13020
13021 2003-08-28  Martin Baulig  <martin@ximian.com>
13022
13023         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13024
13025 2003-08-28  Martin Baulig  <martin@ximian.com>
13026
13027         * cs-parser.jay (opt_type_argument_list): Use
13028         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13029         (primary_expression): Replace `qualified_identifier' with `type_name'.
13030         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13031
13032         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13033         parser to check whether it is syntactically a type parameter list;
13034         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13035         this case.
13036
13037 2003-08-26  Martin Baulig  <martin@ximian.com>
13038
13039         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13040         resolving aliases; fixes #47927.
13041
13042 2003-08-26  Martin Baulig  <martin@ximian.com>
13043
13044         * statement.cs (Using.DoResolve): This is internally emitting a
13045         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13046         do not always return.  Fixes #47681.
13047
13048 2003-08-26  Martin Baulig  <martin@ximian.com>
13049
13050         * decl.cs (MemberCore): Moved WarningNotHiding(),
13051         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13052         into MemberBase.
13053         (AdditionResult): Make this nested in DeclSpace.
13054         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13055         argument; call NamespaceEntry.Define() unless we're nested in a
13056         class or struct.
13057
13058         * namespace.cs (Namespace.DefineName): New public function.  This
13059         is called from DeclSpace's .ctor to add 
13060         (Namespace.Lookup): Include DeclSpaces in the lookup.
13061
13062         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13063
13064         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13065
13066 2003-08-25  Martin Baulig  <martin@ximian.com>
13067
13068         * convert.cs (Convert.ExplicitReferenceConversion): When
13069         converting from an interface type to a class, unbox if the target
13070         type is a struct type.  Fixes #47822.
13071
13072 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13073
13074         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13075         #47854.
13076
13077 2003-08-22  Martin Baulig  <martin@ximian.com>
13078
13079         * class.cs (TypeManager.DefineType): When defining a nested type,
13080         call DefineType() on our parent; fixes #47801.
13081
13082 2003-08-22  Martin Baulig  <martin@ximian.com>
13083
13084         * class.cs (MethodData.Define): While checking if a method is an
13085         interface implementation, improve the test a bit more to fix #47654.
13086
13087 2003-08-22  Martin Baulig  <martin@ximian.com>
13088
13089         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13090         correctly; fixes #47722.
13091
13092 2003-08-22  Martin Baulig  <martin@ximian.com>
13093
13094         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13095         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13096
13097         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13098
13099 2003-08-22  Martin Baulig  <martin@ximian.com>
13100
13101         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13102         can only be assigned in static constructors.  Fixes #47161.
13103
13104 2003-08-22  Martin Baulig  <martin@ximian.com>
13105
13106         Rewrote and improved the flow analysis code.
13107
13108         * flowbranching.cs (FlowBranching): Make this class abstract.
13109         (FlowBranching.CreateBranching): New static function to create a
13110         new flow branching.
13111         (FlowBranchingBlock, FlowBranchingException): New classes.
13112         (FlowBranching.UsageVector.Type): New public readonly field.
13113         (FlowBranching.UsageVector.Breaks): Removed the setter.
13114         (FlowBranching.UsageVector.Returns): Removed the setter.
13115         (FlowBranching.UsageVector): Added Break(), Return(),
13116         NeverReachable() and Throw() methods to modify the reachability.
13117         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13118         done by FlowBranching.Merge().
13119         (FlowBranching.UsageVector.MergeChild): New method; merges the
13120         merge result into the current vector.
13121         (FlowBranching.Merge): New abstract method to merge a branching.
13122
13123 2003-08-12  Martin Baulig  <martin@ximian.com>
13124
13125         * expression.cs (Indirection.CacheTemporaries): Create the
13126         LocalTemporary with the pointer type, not its element type.
13127
13128 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13129
13130         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13131         token was a keyword or not.
13132
13133         Add `error' options where an IDENTIFIER was expected;  Provide
13134         CheckToken and CheckIdentifierToken convenience error reporting
13135         functions. 
13136
13137         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13138
13139         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13140         NameSpaceEntry NameSpaceEntry.
13141
13142         (LookupInterfaceOrClass): Avoid creating a full qualified name
13143         from namespace and name: avoid doing lookups when we know the
13144         namespace is non-existant.   Use new Tree.LookupByNamespace which
13145         looks up DeclSpaces based on their namespace, name pair.
13146
13147         * driver.cs: Provide a new `parser verbose' to display the
13148         exception thrown during parsing.  This is turned off by default
13149         now, so the output of a failure from mcs is more graceful.
13150
13151         * namespace.cs: Track all the namespaces defined in a hashtable
13152         for quick lookup.
13153
13154         (IsNamespace): New method
13155
13156 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13157
13158         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13159         we know that we need to concatenate (full typename can never be
13160         null). 
13161
13162         * class.cs: ditto.
13163
13164         * statement.cs: Use a bitfield;  Do not initialize to null things
13165         which are done by the constructor by default.
13166
13167         * cs-parser.jay: bug fix, parameter was 4, not 3.
13168
13169         * expression.cs: Just use the property;
13170
13171         * statement.cs: No need for GetVariableInfo method.
13172
13173 2003-08-08  Martin Baulig  <martin@ximian.com>
13174
13175         * flowanalysis.cs (FlowReturns): This is now nested in the
13176         `FlowBranching' class.
13177         (MyBitVector): Moved this here from statement.cs.
13178         (FlowBranching.SiblingType): New enum type.
13179         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13180
13181 2003-08-07  Martin Baulig  <martin@ximian.com>
13182
13183         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13184         `FlowBranching' class and called `BranchingType'.
13185
13186 2003-08-07  Martin Baulig  <martin@ximian.com>
13187
13188         * flowanalysis.cs: Moved all the control flow analysis code into
13189         its own file.
13190
13191 2003-08-07  Martin Baulig  <martin@ximian.com>
13192
13193         * assign.cs (Assign.DoResolve): `target' must either be an
13194         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13195         #37319.
13196
13197 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13198
13199         * expression.cs (BinaryMethod): This kind of expression is created by the
13200         Binary class if it determines that the operator has to be handled
13201         by a method.
13202
13203         (BinaryDelegate): This kind of expression is created if we are
13204         dealing with a + or - operator on delegates.
13205
13206         (Binary): remove method, argumetns, and DelegateOperator: when
13207         dealing with methods, 
13208
13209         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13210
13211         * statement.cs (Block): use bitfields for the three extra booleans
13212         we had in use.   Remove unused topblock parameter.
13213
13214         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13215
13216         * assign.cs: Drop extra unneeded tests.
13217
13218 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13219
13220         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13221
13222         * statement.cs (Foreach): Use VariableStorage instead of
13223         LocalBuilders.   
13224
13225         * codegen.cs (VariableStorage): New class used by clients that
13226         require a variable stored: locals or fields for variables that
13227         need to live across yield.
13228
13229         Maybe provide a convenience api for EmitThis+EmitLoad?
13230
13231         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13232         these bad boys.
13233
13234 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
13235
13236         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
13237         RemapParameterLValue): New methods that are used to turn a
13238         precomputed FieldInfo into an expression like this:
13239
13240                 instance.FieldInfo
13241
13242         The idea is to use this instead of making LocalVariableReference
13243         have more than one meaning.
13244
13245         * cs-parser.jay: Add error production to BASE.
13246
13247         * ecore.cs: Deal with TypeManager.GetField returning null, which
13248         is now a valid return value.
13249
13250         (FieldExprNoAddress): New expression for Fields whose address can
13251         not be taken.
13252
13253         * expression.cs (LocalVariableReference): During the resolve
13254         phases, create new expressions if we are in a remapping context.
13255         Remove code that dealt with remapping here.
13256
13257         (ParameterReference): same.
13258
13259         (ProxyInstance): New expression, like the `This' expression, but
13260         it is born fully resolved.  We know what we are doing, so remove
13261         the errors that are targeted to user-provided uses of `this'.
13262
13263         * statement.cs (Foreach): our variable is now stored as an
13264         Expression;  During resolution, follow the protocol, dont just
13265         assume it will return this.
13266
13267 2003-08-06  Martin Baulig  <martin@ximian.com>
13268
13269         * support.cs (SeekableStreamReader.cs): New public class.
13270
13271         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
13272         SeekableStreamReader instead of the normal StreamReader.
13273
13274 2003-08-04  Martin Baulig  <martin@ximian.com>
13275
13276         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
13277         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
13278         deambiguate casts and delegate invocations.
13279         (parenthesized_expression): Use the new tokens to ensure this is
13280         not a cast of method invocation.
13281
13282         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
13283         when reading a `)' and Deambiguate_CloseParens () was previously
13284         called.
13285
13286         * expression.cs (ParenthesizedExpression): New class.  This is
13287         just used for the CS0075 test.
13288         (Binary.DoResolve): Check for CS0075.   
13289
13290 2003-07-29  Ravi Pratap  <ravi@ximian.com>
13291
13292         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
13293         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
13294         reference comparison.
13295
13296         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
13297         examine the ReturnType for equality - this is necessary in the
13298         cases of implicit and explicit operators whose signature also
13299         includes the return type.
13300
13301 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
13302
13303         * namespace.cs: Cache the result of the namespace computation,
13304         instead of computing it every time.
13305
13306 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13307
13308         * decl.cs: Use a global arraylist that we reuse over invocations
13309         to avoid excesive memory consumption.  Reduces memory usage on an
13310         mcs compile by one meg (45 average).
13311
13312         * typemanager.cs (LookupTypeReflection): In .NET pointers are
13313         private, work around that.
13314
13315 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
13316
13317         * literal.cs (IntLiteral): Define Zero and One static literals. 
13318
13319         * cs-parser.jay (integer_literal): use static literals to reduce
13320         memory usage for the most used literals (0, 1 and -1).  211kb
13321         reduced in memory usage.
13322
13323         Replace all calls to `new ArrayList' with `new
13324         ArrayList(4)' which is a good average number for most allocations,
13325         and also requires only 16 bytes of memory for its buffer by
13326         default. 
13327
13328         This reduced MCS memory usage in seven megabytes for the RSS after
13329         bootstrapping.
13330
13331 2003-07-28  Ravi Pratap  <ravi@ximian.com>
13332
13333         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
13334         handle params methods the correct way by forming only one
13335         applicable set with params and normal methods in them. Earlier we
13336         were looking at params methods only if we found no normal methods
13337         which was not the correct thing to do.
13338
13339         (Invocation.BetterFunction): Take separate arguments indicating
13340         when candidate and the best method are params methods in their
13341         expanded form.
13342
13343         This fixes bugs #43367 and #46199.
13344
13345         * attribute.cs: Documentation updates.
13346
13347         (CheckAttribute): Rename to CheckAttributeTarget.
13348         (GetValidPlaces): Rename to GetValidTargets.
13349
13350         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
13351         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
13352
13353         Fixes bug #44468.
13354
13355 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
13356
13357         * codegen.cs: Compute IsGeneric correctly.
13358
13359         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
13360         resolution. 
13361
13362         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
13363         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
13364         regressions, and I was chasing more bugs than I required.
13365
13366         * interface.cs: Use expressions for base type names (like classes
13367         and structs have been doing for a while now), and resolve that.
13368         This patch should probably go into head as well.
13369
13370         This makes it one less user of FindType.
13371
13372 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
13373
13374         This compiler can not self host currently.  Need to fix that.
13375         
13376         * Makefile: compile to `gmcs.exe'
13377
13378         * driver.cs: Turn on v2 by default on gmcs.
13379
13380         * generic.cs (ConstructedType): Does no longer take a container
13381         type argument;  That will be taken care of later.
13382
13383         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
13384         Use SimpleName to resolve for now, so we can continue the work on
13385         the parser, until we get Type.GetType that understands generics.
13386
13387         (ConstructedType.ToString): Implement
13388
13389         (TypeArguments.Resolve): Resolve the child expressions as types. 
13390         
13391         * cs-parser.jay: Rename interface_constraints to
13392         type_parameter_constraints
13393
13394         (namespace_or_type_name): Only use constructed types for the basic
13395         construction, we will deal with identifier<...> later.
13396
13397         (type/type_name): No longer call DecomposeQI, as
13398         namespace_or_type_name is always decoded now.
13399         
13400 2003-07-22  Ravi Pratap  <ravi@ximian.com>
13401
13402         * expression.cs (Invocation.OverloadResolve): Follow the spec more
13403         closely: we eliminate methods in base types when we have an
13404         applicable method in a top-level type.
13405
13406         Please see section 14.5.5.1 for an exact description of what goes
13407         on. 
13408
13409         This fixes bug #45127 and a host of other related to corlib compilation.
13410
13411         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
13412         array is the method corresponding to the top-level type (this is
13413         because of the changes made to icall.c) so we change this
13414         accordingly.
13415
13416         (MethodGroupExpr.Name): This too.
13417
13418         * typemanager.cs (GetElementType): New method which does the right
13419         thing when compiling corlib. 
13420
13421         * everywhere: Make use of the above in the relevant places.
13422
13423 2003-07-22  Martin Baulig  <martin@ximian.com>
13424
13425         * cs-parser.jay (invocation_expression): Moved
13426         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
13427         `cast_expression', but create a InvocationOrCast which later
13428         resolves to either an Invocation or a Cast.
13429
13430         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
13431         method; call this before EmitStatement() to make sure that this
13432         expression can be used as a statement.
13433
13434         * expression.cs (InvocationOrCast): New class; resolves to either
13435         an Invocation or a Cast.
13436
13437         * statement.cs (StatementExpression): Call ResolveStatement() on
13438         the ExpressionStatement before emitting it.
13439
13440 2003-07-21  Martin Baulig  <martin@ximian.com>
13441
13442         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
13443         `ref' and `out' attributes match; fixes #46220.
13444         (MemberAccess.ResolveMemberAccess): You can't reference a type
13445         through an expression; fixes #33180.
13446         (Indexers.GetIndexersForType): Don't return the indexers from
13447         interfaces the class implements; fixes #46502.
13448
13449 2003-07-21  Martin Baulig  <martin@ximian.com>
13450
13451         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
13452         CS0661 checks; fixes bug #30442.
13453
13454 2003-07-21  Martin Baulig  <martin@ximian.com>
13455
13456         * decl.cs (AdditionResult): Added `Error'.
13457
13458         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
13459
13460         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
13461         cs0031.cs actually work.
13462
13463  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13464  
13465         * cs-parser.jay (namespace_name): do not use
13466         namespace_or_type_name, use qualified_identifier, because
13467         namespace_or_type_name will soon return a composed expression
13468         instead of a string.
13469  
13470         (namespace_or_type_name): Instead of returning a string, now this
13471         production returns an expression.
13472  
13473         * codegen.cs (EmitContext): Setup IsGeneric property based on
13474         whether our DeclSpace is generic, our the method is generic.
13475  
13476         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
13477         the method is generic.
13478  
13479         * cs-parser.jay (type_arguments, opt_type_argument_list,
13480         type_parameters, type_parameter_list, opt_type_parameter_list,
13481         type_parameter,, opt_type_parameter_constraints_clauses,
13482         type_parameter_constraints_clauses,
13483         type_parameter_constraint_clause, type_parameter_constraint,
13484         interface_constraints): Add new production
13485  
13486         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
13487         DeclSpace is generic or not.
13488  
13489         (DeclSpace.SetParameterInfo): New routine, used to set the
13490         parameter info for a type.
13491  
13492         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
13493         returns a GenericTypeExpr
13494  
13495         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
13496         generic, lookup the generic argument.
13497  
13498         * attribute.cs: Do not allow TypeParameterExpressions in
13499         Attributes.
13500  
13501         * class.cs: Do not allow the Main method to be defined in a
13502         Generic container.
13503  
13504         * expression.cs (SizeOf): Do not allow generic types to be used as
13505         arguments to sizeof.
13506  
13507         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
13508         it: whether a type is generic or not.  Only works for types we are
13509         currently building for now.
13510         
13511 2003-07-20  Martin Baulig  <martin@ximian.com>
13512
13513         * namespace.cs: Fixed that bug which caused a crash when compiling
13514         the debugger's GUI.
13515
13516 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
13517
13518         * typemanager.cs (LookupTypeReflection): Never expose types which
13519         are NotPublic, NestedPrivate, NestedAssembly, or
13520         NestedFamANDAssem.  We used to return these, and later do a check
13521         that would report a meaningful error, but the problem is that we
13522         would not get the real match, if there was a name override.
13523
13524 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
13525
13526         * namespace.cs (Namespace, Name): Do not compute the namespace
13527         name dynamically, compute it in the constructor.  This reduced
13528         memory usage by 1697 KB.
13529
13530         * driver.cs: Use --pause to pause at the end.
13531
13532 2003-07-17  Peter Williams  <peter@newton.cx>
13533
13534         * Makefile: Change the name of the test target so that it doesn't
13535         conflict with the recursive test target.
13536
13537 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
13538
13539         * expression.cs (LocalVariableReference.Emit, EmitAssign,
13540         AddressOf): Do not use EmitThis, that was wrong, use the actual
13541         this pointer.
13542
13543 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
13544
13545         * class.cs (MethodData.Define): While checking if a method is an
13546         interface implementation, improve the test: If we are not public
13547         (use new test here: use the computed MethodAttributes directly,
13548         instead of the parsed modifier flags) check if the `implementing'
13549         method comes from an interface or not.
13550
13551         * pending.cs (VerifyPendingMethods): Slightly better error
13552         message.
13553
13554         * makefile: add test target that does the mcs bootstrap.
13555
13556 2003-07-16  Ravi Pratap  <ravi@ximian.com>
13557
13558         * interface.cs (Define): Do nothing here since there are no
13559         members to populate etc. Move the attribute emission out of here
13560         since this was just totally the wrong place to put it. Attribute
13561         application happens during the 'Emit' phase, not in the 'Define'
13562         phase.
13563
13564         (Emit): Add this method and move the attribute emission here
13565
13566         * rootcontext.cs (EmitCode): Call the Emit method on interface
13567         types too.
13568
13569 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13570
13571         * expression.cs (OverloadResolve): Report error only if Location
13572         is not 'Null' which means that there was a probe going on.
13573
13574 2003-07-14  Martin Baulig  <martin@ximian.com>
13575
13576         * expression.cs (ConditionalLogicalOperator): New public class to
13577         implement user defined conditional logical operators.
13578         This is section 14.11.2 in the spec and bug #40505.
13579
13580 2003-07-14  Martin Baulig  <martin@ximian.com>
13581
13582         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
13583
13584 2003-07-14  Martin Baulig  <martin@ximian.com>
13585
13586         * codegen.cs (EmitContext.InFixedInitializer): New public field.
13587
13588         * ecore.cs (IVariable.VerifyFixed): New interface method.
13589
13590         * expression.cs (Unary.ResolveOperator): When resolving the `&'
13591         operator, check whether the variable is actually fixed.  Fixes bug
13592         #36055.  Set a variable definitely assigned when taking its
13593         address as required by the spec.
13594
13595         * statement.cs (LocalInfo.IsFixed): New field.
13596         (LocalInfo.MakePinned): Set `IsFixed' to true.
13597
13598 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
13599
13600         * attribute.cs (Attribute.Resolve): While doing a Member lookup
13601         for .ctors, ensure that we only ask for members declared in the
13602         attribute type (BindingFlags.DeclaredOnly).
13603
13604         Fixes bug #43632.
13605
13606         * expression.cs (Error_WrongNumArguments): Report error 1501
13607         correctly the way CSC does.
13608
13609 2003-07-13  Martin Baulig  <martin@ximian.com>
13610
13611         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
13612         lookup on the fully qualified name, to make things like "X.X" work
13613         where "X.X" is a fully qualified type name, but we also have a
13614         namespace "X" in the using list.  Fixes #41975.
13615
13616 2003-07-13  Martin Baulig  <martin@ximian.com>
13617
13618         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
13619         function. If we're a CompoundAssign, we need to create an embedded
13620         CompoundAssign, not an embedded Assign.
13621         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
13622         Fixes #45854.
13623
13624 2003-07-13  Martin Baulig  <martin@ximian.com>
13625
13626         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
13627         work to fix bug #46088.
13628
13629 2003-07-13  Ravi Pratap <ravi@ximian.com>
13630
13631         * class.cs (Operator.Emit): Do not emit attributes here - it is
13632         taken care of by the Method class that we delegate too. This takes
13633         care of bug #45876.
13634
13635 2003-07-10  Martin Baulig  <martin@ximian.com>
13636
13637         * expression.cs (TypeOfVoid): New class.
13638         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
13639
13640 2003-07-10  Martin Baulig  <martin@ximian.com>
13641
13642         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
13643         bug #35957.
13644
13645 2003-07-10  Martin Baulig  <martin@ximian.com>
13646
13647         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
13648         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
13649
13650         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
13651
13652         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
13653
13654 2003-07-10  Martin Baulig  <martin@ximian.com>
13655
13656         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
13657         of decimal.  Fixes #42850.
13658
13659         NOTE: I also fixed the created byte blob, but this doesn't work on
13660         the MS runtime and csc never produces any byte blobs for decimal
13661         arrays.
13662
13663 2003-07-10  Martin Baulig  <martin@ximian.com>
13664
13665         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
13666         structs; fixes #32068.
13667         (Block.AddChildVariableNames): Fixed #44302.
13668
13669 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13670
13671         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
13672
13673 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13674
13675         * attribute.cs: And this test is onger needed.
13676
13677 2003-07-08  Martin Baulig  <martin@ximian.com>
13678
13679         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
13680         inaccessible types.  Fixes #36313.
13681
13682         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
13683
13684         * namespace.cs (NamespaceEntry): Create implicit entries for all
13685         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
13686         implicit entries for N1.N2 and N1.
13687
13688 2003-07-08  Martin Baulig  <martin@ximian.com>
13689
13690         Rewrote the handling of namespaces to fix a lot of the issues
13691         wrt. `using' aliases etc.
13692
13693         * namespace.cs (Namespace): Splitted this class into a
13694         per-assembly `Namespace' and a per-file `NamespaceEntry'.
13695
13696         * typemanager.cs (TypeManager.IsNamespace): Removed.
13697         (TypeManager.ComputeNamespaces): Only compute namespaces from
13698         loaded assemblies here, not the namespaces from the assembly we're
13699         currently compiling.
13700
13701 2003-07-08  Martin Baulig  <martin@ximian.com>
13702
13703         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
13704
13705 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13706
13707         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
13708         already fixed it.  
13709
13710         I thought about the memory savings here, but LookupTypeReflection
13711         is used under already very constrained scenarios.  Compiling
13712         corlib or mcs only exposes one hit, so it would not really reduce
13713         any memory consumption.
13714
13715 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13716
13717         * typemanager.cs: fixes bug #45889 by only adding public types from
13718         other assemblies to the list of known types.
13719
13720 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
13721
13722         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
13723         on the type we resolved.
13724
13725 2003-07-05  Martin Baulig  <martin@ximian.com>
13726
13727         * pending.cs (PendingImplementation.ParentImplements): Don't
13728         create the proxy if the parent is abstract.
13729
13730         * class.cs (TypeContainer.DefineIndexers): Process explicit
13731         interface implementations first.  Fixes #37714.
13732
13733 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
13734
13735         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
13736         defined recursively;  but since we modify the input parameters
13737         (left is set to `this' temporarily), we reset this value if the
13738         left_is_explicit is false, which gives the original semantics to
13739         the code.  
13740
13741         * literal.cs (NullPointer): new class used to represent a null
13742         literal in a pointer context.
13743
13744         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
13745         type is a pointer, use a NullPointer object instead of a
13746         NullLiteral.   Closes 43687
13747
13748         (ExplicitConversion): Convert pointer values using
13749         the conv opcode to the proper type.
13750
13751         * ecore.cs (New): change ValueTypeVariable property into a method,
13752         that returns whether the valuetype is suitable for being used.
13753
13754         * expression.cs (Binary.DoNumericPromotions): Only return if we
13755         the int constant was a valid uint, and we can return both left and
13756         right as uints.  If not, we continue processing, to trigger the
13757         type conversion.  This fixes 39018.
13758
13759         * statement.cs (Block.EmitMeta): During constant resolution, set
13760         the CurrentBlock property on the emitcontext, so that we resolve
13761         constants propertly.
13762
13763 2003-07-02  Martin Baulig  <martin@ximian.com>
13764
13765         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
13766         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
13767
13768         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
13769         than emitting it here.
13770
13771         * statement.cs: Fixed some more flow analysis bugs.
13772
13773 2003-07-02  Martin Baulig  <martin@ximian.com>
13774
13775         * class.cs (MethodData.Define): When implementing interface
13776         methods, set Final unless we're Virtual.
13777
13778         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
13779         check work for interface methods.
13780
13781 2003-07-01  Martin Baulig  <martin@ximian.com>
13782
13783         * ecore.cs (EmitContext.This): Replaced this property with a
13784         GetThis() method which takes a Location argument.  This ensures
13785         that we get the correct error location for a CS0188.
13786
13787 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
13788
13789         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
13790         ImplicitStandardConversion.
13791
13792         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
13793
13794 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
13795
13796         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
13797         optimization.
13798
13799 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
13800
13801         * class.cs (Constructor.Define): Turn off initlocals for unsafe
13802         constructors.
13803
13804         (MethodData.Define): Turn off initlocals for unsafe methods.
13805
13806 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
13807
13808         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
13809         complete;  Fixes #37521.
13810
13811         * delegate.cs: Use Modifiers.TypeAttr to compute the
13812         TypeAttributes, instead of rolling our own.  This makes the flags
13813         correct for the delegates.
13814
13815 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
13816
13817         * class.cs (Constructor.Define): Set the private flag for static
13818         constructors as well.
13819
13820         * cs-parser.jay (statement_expression): Set the return value to
13821         null, to avoid a crash when we catch an error.
13822
13823 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
13824
13825         * cs-parser.jay: Applied patch from Jackson that adds support for
13826         extern and unsafe modifiers to destructor declarations.
13827
13828         * expression.cs: Report error 21 if the user is trying to index a
13829         System.Array.
13830
13831         * driver.cs: Add an error message, suggested by the bug report.
13832
13833         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
13834         if we do not have a ": this ()" constructor initializer.  Fixes 45149
13835
13836 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
13837
13838         * namespace.cs: Add some information to reduce FAQs.
13839
13840 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
13841
13842         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
13843         underlying enumeration types.  Fixes #43915.
13844
13845         * expression.cs: Treat ushort/short as legal values to be used in
13846         bitwise operations.
13847
13848 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
13849
13850         * delegate.cs: transfer custom attributes for paramenters from
13851         the delegate declaration to Invoke and BeginInvoke.
13852
13853 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
13854
13855         * attribute.cs: handle custom marshalers and emit marshal info
13856         for fields, too.
13857
13858 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
13859
13860         * makefile.gnu: Added anonymous.cs to the compiler sources.
13861
13862 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
13863
13864         * iterators.cs: Change the name of the proxy class to include two
13865         underscores.
13866
13867         * cs-parser.jay: Update grammar to include anonymous methods.
13868
13869         * anonymous.cs: new file.
13870
13871 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
13872
13873         * class.cs (Field.Define): Add missing test for pointers and
13874         safety. 
13875
13876 2003-05-27  Ravi Pratap  <ravi@ximian.com>
13877
13878         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
13879         we use the stobj opcode.
13880
13881         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
13882         since it wasn't the correct fix. 
13883
13884         It still is puzzling that we are required to use stobj for IntPtr
13885         which seems to be a ValueType.
13886
13887 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
13888
13889         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
13890         during regular simple name resolution.   Now, the trick is that
13891         instead of returning for processing the simplename, we do a
13892         TypeManager.LookupType (ie, a rooted lookup as opposed to a
13893         contextual lookup type).   If a match is found, return that, if
13894         not, return for further composition.
13895
13896         This fixes long-standing 30485.
13897
13898         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13899         using the address to initialize an object, do an Stobj instead of
13900         using the regular Stelem.
13901
13902         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
13903         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
13904         Because if we are a BaseIndexerAccess that value will be true.
13905         Fixes 43643.
13906
13907         * statement.cs (GotoCase.Resolve): Return after reporting an
13908         error, do not attempt to continue. 
13909
13910         * expression.cs (PointerArithmetic.Emit): If our operand is a
13911         long, convert our constants to match the operand before
13912         multiplying.  Convert to I type before adding.   Fixes 43670.
13913
13914 2003-05-14  Ravi Pratap  <ravi@ximian.com>
13915
13916         * enum.cs (ImplicitConversionExists) : Rename to
13917         ImplicitEnumConversionExists to remove ambiguity. 
13918
13919         * ecore.cs (NullCast): New type of cast expression class which
13920         basically is very similar to EmptyCast with the difference being
13921         it still is a constant since it is used only to cast a null to
13922         something else
13923         (eg. (string) null)
13924
13925         * convert.cs (ImplicitReferenceConversion): When casting a null
13926         literal, we return a NullCast.
13927
13928         * literal.cs (NullLiteralTyped): Remove - I don't see why this
13929         should be around anymore.
13930
13931         The renaming (reported was slightly wrong). Corrections:
13932
13933         ConvertImplicitStandard -> ImplicitConversionStandard
13934         ConvertExplicitStandard -> ExplicitConversionStandard
13935
13936         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
13937         before passing them in !
13938
13939         * convert.cs (ImplicitConversionStandard): When comparing for
13940         equal expr and target types, ensure that expr is not a
13941         NullLiteral.
13942
13943         In general, we must not be checking (expr_type ==
13944         target_type) in the top level conversion methods
13945         (ImplicitConversion, ExplicitConversion etc). This checking is
13946         done in the methods that they delegate to.
13947
13948 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
13949
13950         * convert.cs: Move Error_CannotConvertType,
13951         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
13952         ImplicitNumericConversion, ImplicitConversionExists,
13953         ImplicitUserConversionExists, StandardConversionExists,
13954         FindMostEncompassedType, FindMostSpecificSource,
13955         FindMostSpecificTarget, ImplicitUserConversion,
13956         ExplicitUserConversion, GetConversionOperators,
13957         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
13958         TryImplicitIntConversion, Error_CannotConvertImplicit,
13959         ConvertImplicitRequired, ConvertNumericExplicit,
13960         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
13961         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
13962         its own file.
13963
13964         Perform the following renames:
13965
13966         StandardConversionExists -> ImplicitStandardConversionExists
13967         ConvertImplicit -> ImplicitConversion
13968         ConvertImplicitStandard -> ImplicitStandardConversion
13969         TryImplicitIntConversion -> ImplicitIntConversion
13970         ConvertImplicitRequired -> ImplicitConversionRequired
13971         ConvertNumericExplicit -> ExplicitNumericConversion
13972         ConvertReferenceExplicit -> ExplicitReferenceConversion
13973         ConvertExplicit -> ExplicitConversion
13974         ConvertExplicitStandard -> ExplicitStandardConversion
13975
13976 2003-05-19  Martin Baulig  <martin@ximian.com>
13977
13978         * statement.cs (TypeInfo.StructInfo): Made this type protected.
13979         (TypeInfo): Added support for structs having structs as fields.
13980
13981         * ecore.cs (FieldExpr): Implement IVariable.
13982         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
13983         VariableInfo for the field.
13984
13985 2003-05-18  Martin Baulig  <martin@ximian.com>
13986
13987         * expression.cs (This.DoResolve): Report a CS0027 if we're
13988         emitting a field initializer.
13989
13990 2003-05-18  Martin Baulig  <martin@ximian.com>
13991
13992         * expression.cs (This.ResolveBase): New public function.
13993         (This.DoResolve): Check for CS0188.
13994
13995         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
13996         This.Resolve().
13997
13998         * ecore.cs (MethodGroupExpr.DoResolve): Set the
13999         `instance_expression' to null if we don't have any non-static
14000         methods.
14001
14002 2003-05-18  Martin Baulig  <martin@ximian.com>
14003
14004         Reworked the way how local variables and parameters are handled by
14005         the flow analysis code.
14006
14007         * statement.cs (TypeInfo, VariableMap): New public classes.
14008         (VariableInfo): New public class.  This is now responsible for
14009         checking whether a variable has been assigned.  It is used for
14010         parameters and local variables.
14011         (Block.EmitMeta): Take the InternalParameters as argument; compute
14012         the layout of the flow vectors here.
14013         (Block.LocalMap, Block.ParameterMap): New public properties.
14014         (FlowBranching): The .ctor doesn't get the InternalParameters
14015         anymore since Block.EmitMeta() now computes the layout of the flow
14016         vector.
14017         (MyStructInfo): This class is now known as `StructInfo' and nested
14018         in `TypeInfo'; we don't access this directly anymore.
14019
14020         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14021         property and removed IsAssigned(), IsFieldAssigned(),
14022         SetAssigned() and SetFieldAssigned(); we now call them on the
14023         VariableInfo so we don't need to duplicate this code everywhere.
14024
14025         * expression.cs (ParameterReference): Added `Block block' argument
14026         to the .ctor.
14027         (LocalVariableReference, ParameterReference, This): The new
14028         VariableInfo class is now responsible for all the definite
14029         assignment stuff.
14030
14031         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14032         IsParameterAssigned, SetParameterAssigned): Removed.
14033
14034 2003-05-18  Martin Baulig  <martin@ximian.com>
14035
14036         * typemanager.cs (InitCoreTypes): Try calling
14037         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14038         the 3-args-version.  Corlib now also needs our `void_type'.
14039         (GetMethod): Added overloaded version which takes an optional
14040         `bool report_errors' to allow lookups of optional methods.
14041
14042 2003-05-12  Martin Baulig  <martin@ximian.com>
14043
14044         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14045         only used for locals and not for parameters.
14046
14047 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14048
14049         * support.cs (InternalParameters.ParameterType): Return the
14050         ExternalType of the parameter.
14051
14052         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14053         they were unused.
14054
14055 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14056
14057         * class.cs (MethodData.Define): Do not set the `newslot' on
14058         interface members, if they are also flagged as "override".
14059
14060         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14061         better code for ++i and i++.  This only works for static fields
14062         and local variables.
14063
14064         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14065         want to pull the DeclSpace out of the builder_to_declspace instead
14066         of the TypeBuilder (like in TypeContainer.FindMembers).
14067
14068         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14069         instead of LookupTypeContainer.  Fixes the crash on .NET for
14070         looking up interface members.
14071
14072         * const.cs: Create our own emit context during the Definition
14073         stage, so that constants are evaluated in the proper context, when
14074         a recursive definition happens.
14075
14076 2003-05-11  Martin Baulig  <martin@ximian.com>
14077
14078         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14079         new block for a switch section.
14080         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14081         the adding/lookup in the switch block.  Fixes #39828.
14082
14083 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14084
14085         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14086         functionality: I needed to convert the data after I had performed
14087         the add/sub operation into the operands type size.
14088
14089         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14090         pass the type for the box operation, otherwise the resulting
14091         object would have been of type object.
14092
14093         (BoxedCast): Add constructor to specify the type to box as.
14094
14095 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14096
14097         * iterators.cs: I was reusing the `count' variable inadvertently,
14098         take steps to not allow this to happen.
14099
14100 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14101
14102         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14103         by creating an array at the point where the params starts and
14104         putting all those arguments there, then adjusting the size of the
14105         array.
14106
14107 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14108
14109         * expression.cs (New.AddressOf): Implement interface
14110         IMemoryLocation.  This is used when the `new' operator is used in
14111         the context of an invocation to a method on a value type.
14112
14113         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14114         example. 
14115
14116         * namespace.cs: Also check the using aliases here.
14117
14118         * driver.cs: Move the test for using validity after the types have
14119         been entered, so we do a single pass that also includes the using
14120         aliases. 
14121
14122         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14123         in the regular case.   CreateSiblingForFinally is doing extra
14124         error checking.
14125
14126         * attribute.cs (GetAttributeArgumentExpression): Store the result
14127         on an out value, and use the return value to indicate failure
14128         instead of using null (which is a valid return for Constant.GetValue).
14129
14130         * statement.cs: Perform the analysis flow for the increment
14131         portion after the statement, because this will be the real flow of
14132         execution.  Fixes #42385
14133
14134         * codegen.cs (EmitContext.EmitArgument,
14135         EmitContext.EmitStoreArgument): New helper functions when the
14136         RemapToProxy flag is set.
14137
14138         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14139         function.
14140
14141         Add support for remapping parameters. 
14142
14143         * iterators.cs: Propagate parameter values;  Store parameter
14144         values in the proxy classes.
14145
14146 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14147
14148         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14149         need a proxy reference;  I do not know what I was thinking
14150
14151         * cs-parser.jay (constructor_initializer): catch another error,
14152         and display nice message.
14153
14154         (field_declaration): catch void field declaration
14155         to flag a better error. 
14156
14157         * class.cs (MemberBase.CheckBase): Report an error instead of a
14158         warning if a new protected member is declared in a struct. 
14159         (Field.Define): catch the error of readonly/volatile.
14160
14161         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14162
14163         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14164         volatile variable is taken
14165
14166 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14167
14168         * statement.cs (Fixed.Resolve): Report an error if we are not in
14169         an unsafe context.
14170
14171 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14172
14173         * typemanager.cs: reuse the code that handles type clashes for
14174         delegates and enumerations.
14175
14176         * class.cs (Report28): Always report.
14177
14178         * expression.cs (EncodeAsAttribute): Allow nulls here.
14179
14180 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14181
14182         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14183         the functionality for testing whether an expression is valid for
14184         an attribute here.  Also handle the case of arrays of elements
14185         being stored. 
14186
14187         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14188         encoding a linear array into an array of objects that are suitable
14189         to be passed to an CustomAttributeBuilder.
14190
14191         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14192
14193         * ecore.cs: (FieldExpr): Handle field remapping here.
14194
14195         * iteratators.cs: Pass the instance variable (if the method is an
14196         instance method) to the constructors, so we can access the field
14197         variables on the class.
14198
14199         TODO: Test this with structs.  I think the THIS variable on
14200         structs might have to be a pointer, and not a refenrece
14201
14202 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14203
14204         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14205         local variables to fields in a proxy class.
14206
14207         * iterators.cs (PopulateProxy): Rename our internal fields to
14208         <XXX>.  
14209         Create a <THIS> field if we are an instance method, so we can
14210         reference our parent container variables.
14211         (MapVariable): Called back from the EmitContext code to enter a
14212         new variable to field mapping into the proxy class (we just create
14213         a FieldBuilder).
14214
14215         * expression.cs
14216         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14217         for using the remapped locals to fields.
14218
14219         I placed the code here, because that gives the same semantics to
14220         local variables, and only changes the Emit code.
14221
14222         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14223         statements inside iterators.
14224         (VariableInfo): Add a FieldBuilder for the cases when we are
14225         remapping local variables to fields in a proxy class
14226
14227         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14228         current_block != null.
14229
14230         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14231         not cope with strings, as it has been moved to the
14232         TableSwitchEmit.  Fixed bug in switch generation.
14233
14234         * expression.cs (New.DoResolve): Provide more context for the user
14235         when reporting an error.
14236
14237         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
14238         pointers. 
14239
14240         * expression.cs (MemberAccess.DoResolve): When we get a type back,
14241         check the permissions for it.  Note than in a type-resolution
14242         context the check was already present in DeclSpace.ResolveType,
14243         but was missing from the MemberAccess.
14244
14245         (ArrayCreation.CheckIndices): warn if the user has
14246         more nested levels of expressions, but there are no more
14247         dimensions specified.  Avoids crash on bug 41906.
14248
14249 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
14250
14251         * statement.cs (Block): replace Implicit bool, for a generic
14252         flags.   
14253         New flag: `Unchecked'.  This is used during the EmitMeta phase
14254         (which is out-of-line with the regular Resolve/Emit process for a
14255         statement, as this is done ahead of time, but still gets a chance
14256         to call constant resolve).
14257
14258         (Block.Flags): new enum for adding a new flag.
14259
14260         (Block.EmitMeta): track the state of unchecked.
14261
14262         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
14263         to enable constant resolution to work there as well.
14264
14265 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
14266
14267         * typemanager.cs (ienumerable_type): Also look up
14268         System.Collections.IEnumerable. 
14269
14270 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
14271
14272         TODO: Test more than one conditional per method.
14273
14274         * class.cs (Indexer.Define): Report the location where the user is
14275         referencing the unsupported feature.
14276
14277         (MethodData): Overload the use of `conditionals' to
14278         minimize the creation of needless ArrayLists.   This saves roughly
14279         212kb on my machine.
14280
14281         (Method): Implement the new IIteratorContainer interface.
14282         (Method.SetYields): Implement the method by setting the ModFlags
14283         to contain METHOD_YIELDS.
14284
14285         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
14286         which just got set to null.
14287
14288         * iterators.cs: New file.
14289
14290         (Yield, YieldBreak): New statements.
14291
14292         * statement.cs (Return.Resolve): Flag an error if we are used in
14293         an iterator method.
14294
14295         * codegen.cs (InIterator): New flag set if the code is being
14296         compiled in an iterator method.
14297
14298         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
14299         internal modifier, and we just use it to avoid adding extra
14300         fields, as this is seldom used.  
14301
14302         * cs-parser.jay: Add yield_statement (yield and yield break).
14303
14304         * driver.cs: New flag -v2 to turn on version 2 features. 
14305
14306         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
14307         hashtable when v2 is enabled.
14308
14309 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
14312         there is already a namespace defined with this name.
14313
14314         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
14315         people upgraded their corlibs.
14316
14317         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
14318         always use fully qualified types, no need to use the compiler
14319         front end.
14320
14321         (TypeManager.IsNamespace): Use binarysearch.
14322
14323         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
14324         AddDelegate): I did not quite use the new IsValid API properly: I
14325         have to pass the short-name and the fullname.  I was passing only
14326         the basename instead of the fullname sometimes. 
14327
14328         (TypeContainer.DefineType): call NamespaceClash.
14329
14330         * interface.cs (Interface.DefineType): use NamespaceClash before
14331         defining the type.
14332
14333         * delegate.cs (Delegate.DefineType): use NamespaceClash before
14334         defining the type.
14335
14336         * enum.cs: (Enum.DefineType): use NamespaceClash before
14337         defining the type.
14338
14339         * typemanager.cs (: 3-line patch that gives us some tasty 11%
14340         speed increase.  First, use the negative_hits cache when we get a
14341         negative.  Second, add the type with its full original name
14342         instead of the new . and + encoded name (reflection uses + to
14343         separate type from a nested type).  Use LookupTypeReflection
14344         directly which bypasses the type->name hashtable (that we already
14345         know does not contain the type.
14346
14347         * decl.cs (DeclSpace.ResolveTypeExpr): track the
14348         location/container type. 
14349
14350         * driver.cs: When passing utf8, use directly the UTF8Encoding.
14351
14352 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
14353
14354         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
14355
14356         * delegate.cs (NewDelegate.Resolve): Test whether an instance
14357         method is being referenced in the method group from a static
14358         context, and report error 120 if so.
14359
14360         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
14361         Error118. 
14362
14363         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
14364         is created, we create the A namespace).
14365
14366         * cs-parser.jay: A namespace also introduces a DeclarationFound.
14367         Fixes #41591
14368
14369 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
14370
14371         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
14372         invocation to ModuleBuilder.GetType with the same values will
14373         return a new type instance, so we need to cache its return
14374         values. 
14375
14376         * expression.cs (Binary.ResolveOperator): Only allow the compare
14377         operators on enums if they are of the same type.
14378
14379         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
14380         types of ValueType on their own case.  Before we were giving them
14381         the same treatment as objects.
14382
14383         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
14384         fullname.  Short name is used to compare against container name.
14385         Fullname is used to check against defined namespace names.
14386
14387         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
14388         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
14389
14390         (Method.CheckBase): Call parent.
14391         (MemberBase.CheckBase): Check for protected members on sealed
14392         classes.
14393         (PropertyBase.CheckBase): Call parent.
14394         (Field.Define): Call parent.
14395
14396         * report.cs: Negative error codes are now mapped to 8000 - code,
14397         so that the display is render more nicely.
14398
14399         * typemanager.cs: Do not use try/catch, instead report a regular
14400         error. 
14401
14402         (GetPointerType, GetReferenceType): These methods provide
14403         mechanisms to obtain the T* and T& from a T.  We had the code
14404         previously scattered around the code base, and it also used
14405         TypeManager.LookupType that would go through plenty of caches.
14406         This one goes directly to the type source.
14407
14408         In some places we did the Type.GetType followed by
14409         ModuleBuilder.GetType, but not in others, so this unifies the
14410         processing as well.
14411
14412         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
14413         statements now that we have namespace information.
14414
14415         * typemanager.cs (IsNamespace): New method, returns whether the
14416         string presented is a namespace or not.
14417
14418         (ComputeNamespaces): New public entry point, computes the list of
14419         available namespaces, using the GetNamespaces API call in Mono, or
14420         the slower version in MS.NET.   
14421
14422         Now before we start the semantic analysis phase, we have a
14423         complete list of namespaces including everything that the user has
14424         provided.
14425
14426         Deleted old code to cache namespaces in .nsc files.
14427
14428 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
14429
14430         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
14431         class/struct location definition Location for the implicit
14432         constructor location.
14433
14434         (Operator.Define): Use the location of the operator for the
14435         implicit Method definition.
14436
14437         (Constructor.Emit): use the constructor location for the implicit
14438         base initializer constructor.
14439
14440         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
14441         and the Expression class now contains two new methods:
14442
14443         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
14444         isolate type lookup from the rest of the resolution process.
14445
14446         Since we use Expressions to hold type definitions due to the way
14447         we parse the input we have historically overloaded Resolve to
14448         perform the Type lookups if a special flag is passed.  Now this is
14449         eliminated and two methods take their place. 
14450
14451         The differences in the two methods between xStep and xTerminal is
14452         that xStep is involved in our current lookup system that uses
14453         SimpleNames to compose a name, while xTerminal is used just to
14454         catch the case where the simplename lookup failed.
14455
14456 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
14457
14458         * expression.cs (ResolveMemberAccess): Remove redundant code.
14459         TypeExpr expressions are always born fully resolved.
14460
14461         * interface.cs (PopulateMethod): Do not lookup the types twice.
14462         We were doing it once during SemanticAnalysis and once during
14463         PopulateMethod.
14464
14465         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
14466         in local variable type definitions, were being returned as a
14467         SimpleName (we decomposed everything into a string), that is
14468         because primary_expression was being used instead of a type in the
14469         grammar (reduce/reduce conflicts).
14470
14471         The part that was wrong is that we converted the expression into a
14472         string (an oversimplification in one hand, compounded with primary
14473         expressions doing string concatenation).
14474
14475         So things like:
14476
14477         A.B.C [] x;
14478
14479         Would return "A.B.C[]" as a SimpleName.  This stopped things like
14480         using clauses from working on this particular context.  And a type
14481         was being matched directly against "A.B.C[]".
14482
14483         We now use the correct approach, and allow for ComposedCast to be
14484         part of the unary expression.  So the "A.B.C []" become a composed
14485         cast of "A.B.C" (as a nested group of MemberAccess with a
14486         SimpleName at the end) plus the rank composition "[]". 
14487
14488         Also fixes 35567
14489
14490 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
14491
14492         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
14493         for the access level checking.
14494
14495         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
14496         `TypeContainer container', because I kept getting confused when I
14497         was debugging this code.
14498
14499         * expression.cs (Indexers): Instead of tracking getters/setters,
14500         we now track them in parallel.  We create one arraylist less, but
14501         most importantly it is possible now for the LValue code to find a
14502         matching get for a set.
14503
14504         (IndexerAccess.DoResolveLValue): Update the code.
14505         GetIndexersForType has been modified already to extract all the
14506         indexers from a type.  The code assumed it did not.
14507
14508         Also make the code set the correct return type for the indexer.
14509         This was fixed a long time ago for properties, but was missing for
14510         indexers.  It used to be void_type.
14511
14512         (Binary.Emit): Test first for doubles instead of
14513         floats, as they are more common.
14514
14515         (Binary.EmitBranchable): Use the .un version of the branch opcodes
14516         when dealing with floats and the <=, >= operators.  This fixes bug
14517         #39314 
14518
14519         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
14520         to load the array value by emitting a load on the foreach variable
14521         type.  This was incorrect.  
14522
14523         We now emit the code to load an element using the the array
14524         variable type, and then we emit the conversion operator.
14525
14526         Fixed #40176
14527
14528 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
14529
14530         * attribute.cs: Avoid allocation of ArrayLists in the common case.
14531
14532 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
14533
14534         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
14535         test for protection before we test for signatures. 
14536
14537         (MethodSignature.ToString): implement.
14538
14539         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
14540         to the case where we reduced into a LongConstant.
14541
14542         * decl.cs (CheckAccessLevel): If the type is an array, we can not
14543         depend on whether the information is acurrate, because the
14544         Microsoft runtime will always claim that the array type is public,
14545         regardless of the real state.
14546
14547         If the type is a pointer, another problem happens: the type is
14548         reported as non-public in Microsoft.  
14549
14550         In both cases we have to call CheckAccessLevel recursively with
14551         the underlying type as the argument to be tested.
14552
14553 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
14554
14555         * assign.cs (Assign.Emit): If we are dealing with a compound
14556         assignment expression, we should use the code path that stores the
14557         intermediate result in a temporary value.  This fixes #40903.
14558
14559         *expression.cs (Indirection.ToString): Provide ToString method for
14560         debugging. 
14561
14562 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
14563
14564         * class.cs: Null out fields holding references to Block objects so
14565         they can be garbage collected.
14566
14567         * expression.cs (OverloadResolve): Remove unused local.
14568
14569 2003-04-07  Martin Baulig  <martin@ximian.com>
14570
14571         * codegen.cs (EmitContext.CurrentFile): New public field.
14572         (EmitContext.Mark): Use the CurrentFile to check whether the
14573         location is in the correct file.
14574         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
14575
14576 2003-04-07  Martin Baulig  <martin@ximian.com>
14577
14578         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
14579
14580         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
14581         location.  [FIXME: The location argument which gets passed to this
14582         method is sometimes wrong!]
14583
14584 2003-04-07  Nick Drochak <ndrochak@gol.com>
14585
14586         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
14587
14588 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
14589
14590         * expression.cs (Indirection.EmitAssign): We were using the
14591         temporary, but returning immediately instead of continuing the
14592         EmitAssing flow.
14593
14594 2003-04-06  Martin Baulig  <martin@ximian.com>
14595
14596         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
14597         if it's a nested child, but also deriving from the outer class.
14598         See test 190.cs.
14599
14600         * typemanager.cs (IsNestedChildOf): Make this work if it's a
14601         nested child, but also deriving from the outer class.  See
14602         test-190.cs.
14603         (FilterWithClosure): We may access private members of the outer
14604         class if we're a nested child and deriving from the outer class.
14605         (RealMemberLookup): Only set `closure_private_ok' if the
14606         `original_bf' contained BindingFlags.NonPublic.
14607
14608 2003-04-05  Martin Baulig  <martin@ximian.com>
14609
14610         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
14611         probe if its a type parameter, and if so, flag an error.
14612
14613         * decl.cs: Move here the SetParameterInfo code from class.cs.
14614         Handle IsGeneric here.
14615
14616         Handle a variety of errors in the parameter info definition.
14617
14618         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
14619         type parameters here.
14620
14621         * cs-parser.jay (class_declaration): report errors for parameters
14622         here as well.
14623
14624 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
14625
14626         * generic.cs: New file, contains support code for generics.
14627
14628         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
14629         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
14630
14631         Update parser for the above removals.
14632
14633         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
14634         now taken care of in the parser.
14635
14636 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
14637
14638         * class.cs (Event.Define): Do not allow abstract events to have
14639         initializers. 
14640
14641 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
14642
14643         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
14644         block in event declarations.
14645
14646         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
14647         value type, get its address.
14648
14649         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
14650         leaving a class on the stack instead of a boolean value (int
14651         0/1).  Change the code so we compare against null, and then the
14652         result against zero.
14653
14654         * class.cs (TypeContainer.GetClassBases): We were checking for the
14655         parent class being sealed too late.
14656
14657         * expression.cs (Binary.Emit): For <= and >= when dealing with
14658         floating point values, use cgt.un and clt.un instead of cgt and
14659         clt alone.
14660
14661 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
14662
14663         * statement.cs: Apply the same optimization as MS: skip the 
14664         GetEnumerator returning an IEnumerator, and use the one returning a 
14665         CharEnumerator instead. This allows us to avoid the try-finally block 
14666         and the boxing.
14667
14668 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
14669
14670         * cs-parser.jay: Attributes cannot be applied to
14671                          namespaces. Fixes #40473
14672
14673 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14674
14675         * class.cs:
14676         (Add*): check if the name is valid using the full name for constants,
14677         fields, properties and events.
14678
14679 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
14680
14681         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
14682         char constants to be part of the enumeration.
14683
14684         * expression.cs (Conditional.DoResolve): Add support for operator
14685         true. Implements the missing functionality from 14.12
14686
14687         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
14688         operator true/false as required by the spec.
14689
14690         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
14691         implicit conversion to boolean.
14692
14693         * statement.cs (Statement.ResolveBoolean): A boolean expression is
14694         also one where the type implements `operator true'. 
14695
14696         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
14697         get an expression that will invoke operator true based on an
14698         expression.  
14699
14700         (GetConversionOperators): Removed the hack that called op_True
14701         here.  
14702
14703         (Expression.ResolveBoolean): Move this from Statement.
14704
14705 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
14706
14707         * ecore.cs (FieldExpr): do not allow initialization of initonly
14708         fields on derived classes
14709
14710 2003-03-13  Martin Baulig  <martin@ximian.com>
14711
14712         * statement.cs (Block.Emit): Call ig.BeginScope() and
14713         ig.EndScope() when compiling with debugging info; call
14714         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
14715
14716 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
14717
14718         * expression.cs (Indexers): Do not construct immediately, allow
14719         for new members to be appended as we go.  Fixes 38143
14720
14721 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14722
14723         * expression.cs: save/restore context when resolving an unchecked
14724         expression.
14725
14726 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
14727
14728         * cfold.cs: Catch division by zero in modulus operator during
14729         constant folding.
14730
14731 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
14732
14733         * interface.cs (Interface.DefineMembers): Avoid defining members
14734         twice. 
14735
14736 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
14737
14738         * driver.cs: handle the +/- options for -noconfig
14739
14740         * statement.cs (Unckeched.Resolve): Also track the state of
14741         unchecked in the Resolve phase.
14742
14743 2003-02-27  Martin Baulig  <martin@ximian.com>
14744
14745         * ecore.cs (Expression.MemberLookup): Don't create a
14746         MethodGroupExpr for something which is not a method.  Fixes #38291.
14747
14748 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
14749
14750         * class.cs (MemberBase.CheckParameters): Also check that the type
14751         is unmanaged if it is a pointer.
14752
14753         * expression.cs (SizeOf.Resolve): Add location information.
14754
14755         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
14756         a managed type is declared.
14757
14758         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
14759         parameter modifiers as well.  Fixes bug 38606
14760
14761         * class.cs: Very sad.  Am backing out the speed up changes
14762         introduced by the ArrayList -> Array in the TypeContainer, as they
14763         were not actually that much faster, and introduced a bug (no error
14764         reports on duplicated methods).
14765
14766         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
14767         source first, this will guarantee that we have a valid expression
14768         before calling in lower levels functions that will require a
14769         resolved object.  Then use this original_source in the
14770         target.ResolveLValue instead of the original source that was
14771         passed to us.
14772
14773         Another change.  Use target.Resolve instead of LValueResolve.
14774         Although we are resolving for LValues, we will let the Assign code
14775         take care of that (it will be called again from Resolve).  This
14776         basically allows code like this:
14777
14778         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
14779         class Y { void A (X x) { x [0] += o; }
14780
14781         The problem was that the indexer was trying to resolve for
14782         set_Item (idx, object o) and never finding one.  The real set_Item
14783         was set_Item (idx, X).  By delaying the process we get the right
14784         semantics. 
14785
14786         Fixes bug 36505
14787
14788 2003-02-23  Martin Baulig  <martin@ximian.com>
14789
14790         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
14791         while calling DoEmit ().
14792
14793         * codegen.cs (EmitContext.Mark): Don't mark locations in other
14794         source files; if you use the #line directive inside a method, the
14795         compiler stops emitting line numbers for the debugger until it
14796         reaches the end of the method or another #line directive which
14797         restores the original file.
14798
14799 2003-02-23  Martin Baulig  <martin@ximian.com>
14800
14801         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
14802
14803 2003-02-23  Martin Baulig  <martin@ximian.com>
14804
14805         * statement.cs (Block.AddChildVariableNames): We need to call this
14806         recursively, not just for our immediate children.
14807
14808 2003-02-23  Martin Baulig  <martin@ximian.com>
14809
14810         * class.cs (Event.Define): Always make the field private, like csc does.
14811
14812         * typemanager.cs (TypeManager.RealMemberLookup): Make events
14813         actually work, fixes bug #37521.
14814
14815 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
14816
14817         * delegate.cs: When creating the various temporary "Parameters"
14818         classes, make sure that we call the ComputeAndDefineParameterTypes
14819         on those new parameters (just like we do with the formal ones), to
14820         allow them to be resolved in the context of the DeclSpace.
14821
14822         This fixes the bug that Dick observed in Bugzilla #38530.
14823
14824 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
14825
14826         * expression.cs (ResolveMemberAccess): When resolving a constant,
14827         do not attempt to pull a constant if the value was not able to
14828         generate a valid constant.
14829
14830         * const.cs (LookupConstantValue): Do not report more errors than required.
14831
14832 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14833
14834         * expression.cs: fixes bug #38328.
14835
14836 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14837
14838         * class.cs: Changed all the various members that can be part of a
14839         class from being an ArrayList to be an Array of the right type.
14840         During the DefineType type_list, interface_list, delegate_list and
14841         enum_list are turned into types, interfaces, delegates and enums
14842         arrays.  
14843
14844         And during the member population, indexer_list, event_list,
14845         constant_list, field_list, instance_constructor_list, method_list,
14846         operator_list and property_list are turned into their real arrays.
14847
14848         Although we could probably perform this operation earlier, for
14849         good error reporting we need to keep the lists and remove the
14850         lists for longer than required.
14851
14852         This optimization was triggered by Paolo profiling the compiler
14853         speed on the output of `gen-sample-program.pl' perl script. 
14854
14855         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
14856         not crash in methods like MemberLookupFailed that use this field.  
14857
14858         This problem arises when the compiler fails to resolve a type
14859         during interface type definition for example.
14860
14861 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
14864         inherit from System.Object, so we have to stop at null, not only
14865         when reaching System.Object.
14866
14867 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
14868
14869         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
14870         DeclaredOnly because the parent indexer might have had a different
14871         name, but did not loop until the top of the hierarchy was reached.
14872
14873         The problem this one fixes is 35492: when a class implemented an
14874         indexer from an interface, we were getting the interface method
14875         (which was abstract) and we were flagging an error (can not invoke
14876         abstract method).
14877
14878         This also keeps bug 33089 functioning, and test-148 functioning.
14879
14880         * typemanager.cs (IsSpecialMethod): The correct way of figuring
14881         out if a method is special is to see if it is declared in a
14882         property or event, or whether it is one of the predefined operator
14883         names.   This should fix correctly #36804.
14884
14885 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
14886
14887         The goal here is to remove the dependency on EmptyCast.Peel ().
14888         Killing it completely.
14889
14890         The problem is that currently in a number of places where
14891         constants are expected, we have to "probe" for an EmptyCast, and
14892         Peel, which is not the correct thing to do, as this will be
14893         repetitive and will likely lead to errors. 
14894
14895         The idea is to remove any EmptyCasts that are used in casts that
14896         can be reduced to constants, so we only have to cope with
14897         constants. 
14898
14899         This bug hunt was triggered by Bug 37363 and the desire to remove
14900         the duplicate pattern where we were "peeling" emptycasts to check
14901         whether they were constants.  Now constants will always be
14902         constants.
14903
14904         * ecore.cs: Use an enumconstant here instead of wrapping with
14905         EmptyCast.  
14906
14907         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
14908         throwing me off.  By handling this we can get rid of a few hacks.
14909
14910         * statement.cs (Switch): Removed Peel() code.
14911
14912 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
14913
14914         * class.cs: Location information for error 508
14915
14916         * expression.cs (New.DoResolve): Add a guard against double
14917         resolution of an expression.  
14918
14919         The New DoResolve might be called twice when initializing field
14920         expressions (see EmitFieldInitializers, the call to
14921         GetInitializerExpression will perform a resolve on the expression,
14922         and later the assign will trigger another resolution
14923
14924         This leads to bugs (#37014)
14925
14926         * delegate.cs: The signature for EndInvoke should contain any ref
14927         or out parameters as well.  We were not doing this in the past. 
14928
14929         * class.cs (Field.Define): Do not overwrite the type definition
14930         inside the `volatile' group.  Turns out that volatile enumerations
14931         were changing the type here to perform a validity test, which
14932         broke conversions. 
14933
14934 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
14935
14936         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
14937         and structs, we do not want to load the instance variable
14938
14939         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
14940         enum_type has to be handled like an object reference (implicit
14941         conversions exists from this to object), but the regular IsClass
14942         and IsValueType tests will never return true for this one.
14943
14944         Also we use TypeManager.IsValueType instead of type.IsValueType,
14945         just for consistency with the rest of the code (this is only
14946         needed if we ever use the construct exposed by test-180.cs inside
14947         corlib, which we dont today).
14948
14949 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
14950
14951         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
14952         just InternalCall.
14953
14954 2003-02-09  Martin Baulig  <martin@ximian.com>
14955
14956         * namespace.cs (Namespace..ctor): Added SourceFile argument.
14957         (Namespace.DefineNamespaces): New static public method; this is
14958         called when we're compiling with debugging to add all namespaces
14959         to the symbol file.
14960
14961         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
14962         pass it to the Namespace's .ctor.
14963
14964         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
14965         and MethodBase arguments; pass the namespace ID to the symwriter;
14966         pass the MethodBase instead of the token to the symwriter.
14967         (SymbolWriter.DefineNamespace): New method to add a namespace to
14968         the symbol file.
14969
14970 2003-02-09  Martin Baulig  <martin@ximian.com>
14971
14972         * symbolwriter.cs: New file.  This is a wrapper around
14973         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
14974         methods here in near future.
14975
14976 2003-02-09  Martin Baulig  <martin@ximian.com>
14977
14978         * codegen.cs (EmitContext.Mark): Just pass the arguments to
14979         ILGenerator.MarkSequencePoint() which are actually used by the
14980         symbol writer.
14981
14982 2003-02-09  Martin Baulig  <martin@ximian.com>
14983
14984         * location.cs (SourceFile): New public sealed class.  This
14985         contains the name and an index which is used in the location's token.
14986         (Location): Reserve an appropriate number of bits in the token for
14987         the source file instead of walking over that list, this gives us a
14988         really huge performance improvement when compiling with debugging.
14989
14990         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
14991         `SourceFile' argument instead of a string.
14992         (Driver.ProcessFile): Add all the files via Location.AddFile(),
14993         but don't parse/tokenize here, we need to generate the list of all
14994         source files before we do that.
14995         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
14996         the files.
14997
14998         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
14999         instead of a string.
15000
15001         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15002         of a string.
15003
15004 2003-02-09  Martin Baulig  <martin@ximian.com>
15005
15006         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15007         filename on `#line default'.
15008
15009 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15010
15011         * statement.cs: don't clear the pinned var when the fixed statement
15012         returns from the method (fixes bug#37752).
15013
15014 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15015
15016         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15017         to IsValueType.
15018
15019 2003-02-07  Martin Baulig  <martin@ximian.com>
15020
15021         * driver.cs: Removed the `--debug-args' command line argument.
15022
15023         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15024         automatically by the AsssemblyBuilder.
15025         (CodeGen.InitializeSymbolWriter): We don't need to call any
15026         initialization function on the symbol writer anymore.  This method
15027         doesn't take any arguments.
15028
15029 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15030
15031         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15032         from referenced assemblies as well.
15033
15034 2003-02-02  Martin Baulig  <martin@ximian.com>
15035
15036         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15037
15038 2003-02-02  Martin Baulig  <martin@ximian.com>
15039
15040         * class.cs (Constructor.Emit): Open the symbol writer before
15041         emitting the constructor initializer.
15042         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15043         single-stepping through constructor initializers.
15044
15045 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15046
15047         * class.cs: Handle error 549: do not allow virtual methods in
15048         sealed classes. 
15049
15050 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15051
15052         * decl.cs: Check access levels when resolving types
15053
15054 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15055
15056         * statement.cs: Add parameters and locals set in catch blocks that might 
15057         return to set vector
15058
15059 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15060
15061         * class.cs (Operator): Set the SpecialName flags for operators.
15062
15063         * expression.cs (Invocation.DoResolve): Only block calls to
15064         accessors and operators on SpecialName methods.
15065
15066         (Cast.TryReduce): Handle conversions from char constants.
15067
15068
15069 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15070
15071         * statement.cs: small memory and time optimization in FlowBranching.
15072
15073 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15074
15075         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15076         problem that the last fix but in the other sid (Set).
15077
15078         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15079         access when there is no indexer in the hierarchy.
15080
15081 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15082
15083         * class.cs: Combine some if statements.
15084
15085 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15086
15087         * driver.cs: fixed bug #37187.
15088
15089 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15090
15091         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15092         any indexer, it's needed to build a list with all the indexers in the
15093         hierarchy (AllGetters), else we have problems. Fixes #35653.
15094
15095 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15096
15097         * class.cs (MethodData.Define): It is wrong for an interface
15098         implementation to be static in both cases: explicit and implicit.
15099         We were only handling this in one case.
15100
15101         Improve the if situation there to not have negations.
15102
15103         * class.cs (Field.Define): Turns out that we do not need to check
15104         the unsafe bit on field definition, only on usage.  Remove the test.
15105
15106 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15107
15108         * driver.cs: use assembly.Location instead of Codebase (the latest
15109         patch made mcs fail when using MS assemblies).
15110
15111 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15112
15113         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15114         get the path to *corlib.dll.
15115
15116 2003-01-21  Nick Drochak <ndrochak@gol.com>
15117
15118         * cs-tokenizer.cs:
15119         * pending.cs:
15120         * typemanager.cs: Remove compiler warnings
15121
15122 2003-01-20  Duncan Mak  <duncan@ximian.com>
15123
15124         * AssemblyInfo.cs: Bump the version number to 0.19.
15125
15126 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15127
15128         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15129
15130 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15131
15132         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15133
15134 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15135
15136         * cs-parser.jay: Small fix: we were not comparing the constructor
15137         name correctly.   Thanks to Zoltan for the initial pointer.
15138
15139 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15140
15141         * cs-tokenizer.cs: Set file name when specified with #line
15142
15143 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15144
15145         * cs-parser.jay: Only perform the constructor checks here if we
15146         are named like the class;  This will help provider a better
15147         error.  The constructor path is taken when a type definition is
15148         not found, but most likely the user forgot to add the type, so
15149         report that rather than the constructor error.
15150
15151 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15152
15153         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15154         allocations.
15155
15156 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15157
15158         * cs-parser.jay: Add cleanup call.
15159
15160 2003-01-13  Duncan Mak  <duncan@ximian.com>
15161
15162         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15163         consistent with other methods.
15164
15165 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15166
15167         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15168
15169 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15170
15171         * attribute.cs: only set GuidAttr to true when we have a
15172         GuidAttribute.
15173
15174 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15175
15176         * ecore.cs:
15177         * expression.cs:
15178         * typemanager.cs: fixes to allow mcs compile corlib with the new
15179         Type.IsSubclassOf fix.
15180
15181 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15182
15183         * expression.cs (LocalVariableReference.DoResolve): Classify a
15184         constant as a value, not as a variable.   Also, set the type for
15185         the variable.
15186
15187         * cs-parser.jay (fixed_statement): take a type instead of a
15188         pointer_type, so we can produce a better error message later.
15189
15190         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15191         as an error.  
15192
15193         (For.DoEmit): Make inifinite loops have a
15194         non-conditional branch back.
15195
15196         (Fixed.DoEmit): First populate the pinned variables, then emit the
15197         statement, then clear the variables.  Before I was emitting the
15198         code once for each fixed piece.
15199
15200
15201 2003-01-08  Martin Baulig  <martin@ximian.com>
15202
15203         * statement.cs (FlowBranching.MergeChild): A break in a
15204         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15205
15206 2003-01-08  Martin Baulig  <martin@ximian.com>
15207
15208         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15209         lives in the same number space than `param_map'.  Fixes #36154.
15210
15211 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15212
15213         * cs-parser.jay (constructor_declaration): Set the
15214         Constructor.ModFlags before probing for it.  This makes the
15215         compiler report 514, 515 and 132 (the code was there, but got
15216         broken). 
15217
15218         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15219         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15220         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15221
15222 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15223
15224         * enum.cs: create the enum static fields using the enum type.
15225
15226 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15227
15228         * class.cs: don't try to create the ParamBuilder for the return
15229         type if it's not needed (and handle it breaking for the ms runtime
15230         anyway).
15231
15232 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15233
15234         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
15235
15236 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
15237
15238         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
15239         the command.   This showed up while compiling the JANET source
15240         code, which used \r as its only newline separator.
15241
15242 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
15243
15244         * class.cs (Method.Define): If we are an operator (because it
15245         reuses our code), then set the SpecialName and HideBySig.  #36128
15246
15247 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
15248
15249         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
15250         exception, report error 120 `object reference required'.
15251
15252         * driver.cs: Add --pause option, used during to measure the size
15253         of the process as it goes with --timestamp.
15254
15255         * expression.cs (Invocation.DoResolve): Do not allow methods with
15256         SpecialName to be invoked.
15257
15258 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
15259
15260         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
15261         number before adding it.
15262
15263 2002-12-21  Ravi Pratap  <ravi@ximian.com>
15264
15265         * ecore.cs (StandardImplicitConversion): When in an unsafe
15266         context, we allow conversion between void * to any other pointer
15267         type. This fixes bug #35973.
15268
15269 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
15270
15271         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
15272         is not thrown when extensionless outputs are used 
15273
15274 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15275
15276         * rootcontext.cs: fixed compilation of corlib.
15277
15278 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
15279
15280         * attribute.cs (Attributes.Contains): Add new method.
15281
15282         * class.cs (MethodCore.LabelParameters): if the parameter is an
15283         `out' parameter, check that no attribute `[In]' has been passed.
15284
15285         * enum.cs: Handle the `value__' name in an enumeration.
15286
15287 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
15288
15289         * decl.cs: Added special case to allow overrides on "protected
15290         internal" methods
15291
15292 2002-12-18  Ravi Pratap  <ravi@ximian.com>
15293
15294         * attribute.cs (Attributes.AddAttributeSection): Rename to this
15295         since it makes much more sense.
15296
15297         (Attributes.ctor): Don't require a Location parameter.
15298
15299         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
15300
15301         * attribute.cs (ApplyAttributes): Remove extra Location parameters
15302         since we already have that information per attribute.
15303
15304         * everywhere : make appropriate changes.
15305
15306         * class.cs (LabelParameters): Write the code which actually
15307         applies attributes to the return type. We can't do this on the MS
15308         .NET runtime so we flag a warning in the case an exception is
15309         thrown.
15310
15311 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
15312
15313         * const.cs: Handle implicit null conversions here too.
15314
15315 2002-12-17  Ravi Pratap  <ravi@ximian.com>
15316
15317         * class.cs (MethodCore.LabelParameters): Remove the extra
15318         Type [] parameter since it is completely unnecessary. Instead
15319         pass in the method's attributes so that we can extract
15320         the "return" attribute.
15321
15322 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
15323
15324         * cs-parser.jay (parse): Use Report.Error to flag errors instead
15325         of ignoring it and letting the compile continue.
15326
15327         * typemanager.cs (ChangeType): use an extra argument to return an
15328         error condition instead of throwing an exception.
15329
15330 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
15331
15332         * expression.cs (Unary.TryReduce): mimic the code for the regular
15333         code path.  Perform an implicit cast in the cases where we can
15334         implicitly convert to one of the integral types, and then reduce
15335         based on that constant.   This fixes bug #35483.
15336
15337 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15338
15339         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
15340
15341 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15342
15343         * namespace.cs: fixed bug #35489.
15344
15345 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
15346
15347         * class.cs: Remove some dead code.
15348
15349         * cs-parser.jay: Estimate the number of methods needed
15350         (RootContext.MethodCount);
15351
15352         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
15353         numbers instead of StringBuilders.
15354
15355         * support.cs (PtrHashtable): Add constructor with initial size;
15356         We can now reduce reallocations of the method table.
15357
15358 2002-12-10  Ravi Pratap  <ravi@ximian.com>
15359
15360         * attribute.cs (ApplyAttributes): Keep track of the emitted
15361         attributes on a per-target basis. This fixes bug #35413.
15362
15363 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
15364
15365         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
15366         default to the Windows 1252 encoding.
15367
15368         (UnixParseOption): Support version, thanks to Alp for the missing
15369         pointer. 
15370
15371         * AssemblyInfo.cs: Add nice assembly information.
15372
15373         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
15374         (bug 35169).
15375
15376         * cs-parser.jay: Allow a trailing comma before the close bracked
15377         in the attribute_section production.
15378
15379         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
15380         address of the instance was being taken, I will take this out,
15381         because we take the address of the object immediately here.
15382
15383 2002-12-09  Ravi Pratap  <ravi@ximian.com>
15384
15385         * typemanager.cs (AreMultipleAllowed): Take care of the most
15386         obvious case where attribute type is not in the current assembly -
15387         stupid me ;-)
15388
15389 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
15390
15391         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
15392         definitions, instead of doing that afterwards.  
15393
15394         Also we use a nice little hack, depending on the constructor, we
15395         know if we are a "composed" name or a simple name.  Hence, we
15396         avoid the IndexOf test, and we avoid 
15397
15398         * codegen.cs: Add code to assist in a bug reporter to track down
15399         the source of a compiler crash. 
15400
15401 2002-12-07  Ravi Pratap  <ravi@ximian.com>
15402
15403         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
15404         types have been emitted for a given element and flag an error
15405         if something which does not have AllowMultiple set is used more
15406         than once.
15407
15408         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
15409         attribute types and their corresponding AllowMultiple properties
15410
15411         (AreMultipleAllowed): Check the property for a given type.
15412
15413         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
15414         property in the case we have a TypeContainer.
15415
15416         (Attributes.AddAttribute): Detect duplicates and just skip on
15417         adding them. This trivial fix catches a pretty gross error in our
15418         attribute emission - global attributes were being emitted twice!
15419
15420         Bugzilla bug #33187 is now fixed.
15421
15422 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
15423
15424         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
15425         instead of pp_and).
15426
15427         * expression.cs (Binary.ResolveOperator): I can only use the
15428         Concat (string, string, string) and Concat (string, string,
15429         string, string) if the child is actually a concatenation of
15430         strings. 
15431
15432 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
15433
15434         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
15435         context where we need a 2-character lookahead.
15436
15437         * pending.cs (PendingImplementation): Rework so we can keep track
15438         of interface types all the time, and flag those which were
15439         implemented by parents as optional.
15440
15441 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
15442
15443         * expression.cs (Binary.ResolveOperator): Use
15444         String.Concat(string,string,string) or
15445         String.Concat(string,string,string,string) when possible. 
15446
15447         * typemanager: More helper methods.
15448
15449
15450 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
15451
15452         * pending.cs: remove the bogus return from GetMissingInterfaces()
15453         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
15454
15455 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15456
15457         * namespace.cs: avoid duplicated 'using xxx' being added to
15458         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
15459         when we get more than one 'using' statement for the same namespace.
15460         Report a CS0105 warning for it.
15461
15462 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
15463
15464         * cs-tokenizer.cs (consume_identifier): use read directly, instead
15465         of calling getChar/putback, uses internal knowledge of it.    
15466
15467         (xtoken): Reorder tokenizer so most common patterns are checked
15468         first.  This reduces the compilation time in another 5% (from 8.11s
15469         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
15470
15471         The parsing time is 22% of the compilation in mcs, and from that
15472         64% is spent on the tokenization process.  
15473
15474         I tried using a binary search for keywords, but this is slower
15475         than the hashtable.  Another option would be to do a couple of
15476         things:
15477
15478                 * Not use a StringBuilder, instead use an array of chars,
15479                   with a set value.  Notice that this way we could catch
15480                   the 645 error without having to do it *afterwards*.
15481
15482                 * We could write a hand-parser to avoid the hashtable
15483                   compares altogether.
15484
15485         The identifier consumption process takes 37% of the tokenization
15486         time.  Another 15% is spent on is_number.  56% of the time spent
15487         on is_number is spent on Int64.Parse:
15488
15489                 * We could probably choose based on the string length to
15490                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
15491                   computations. 
15492
15493         Another 3% is spend on wrapping `xtoken' in the `token' function.
15494
15495         Handle 0xa0 as whitespace (#34752)
15496
15497 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
15498
15499         * typemanager.cs (IsCLRType): New routine to tell whether a type
15500         is one of the builtin types.  
15501
15502         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
15503         typecode in more places instead of doing pointer comparissions.
15504         We could leverage some knowledge about the way the typecodes are
15505         laid out.
15506
15507         New code to cache namespaces in assemblies, it is currently not
15508         invoked, to be used soon.
15509
15510         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
15511
15512         * expression.cs (Binary.ResolveOperator): specially handle
15513         strings, and do not perform user-defined operator overloading for
15514         built-in types.
15515
15516 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
15517
15518         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
15519         internalcall as it is a pretty simple operation;  Avoid whenever
15520         possible to call Char.IsLetter.
15521
15522         (consume_identifier): Cut by half the number of
15523         hashtable calls by merging the is_keyword and GetKeyword behavior.
15524
15525         Do not short-circuit, because if we do, we
15526         report errors (ie, #if false && true would produce an invalid
15527         directive error);
15528
15529
15530 2002-11-24  Martin Baulig  <martin@ximian.com>
15531
15532         * expression.cs (Cast.TryReduce): If we're in checked syntax,
15533         check constant ranges and report a CS0221.  Fixes #33186.
15534
15535 2002-11-24  Martin Baulig  <martin@ximian.com>
15536
15537         * cs-parser.jay: Make this work for uninitialized variable
15538         declarations in the `for' initializer.  Fixes #32416.
15539
15540 2002-11-24  Martin Baulig  <martin@ximian.com>
15541
15542         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
15543         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
15544
15545 2002-11-24  Martin Baulig  <martin@ximian.com>
15546
15547         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
15548         argument; if true, we also check for user-defined conversions.
15549         This is only needed if both arguments are of a user-defined type.
15550         Fixes #30443, added test-175.cs.
15551         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
15552
15553         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
15554
15555 2002-11-24  Martin Baulig  <martin@ximian.com>
15556
15557         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
15558         function to get the store opcode.
15559         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
15560         only emit the Ldelema if the store opcode is Stobj.  You must run
15561         both test-34 and test-167 to test this.  Fixes #34529.
15562
15563 2002-11-23  Martin Baulig  <martin@ximian.com>
15564
15565         * ecore.cs (Expression.MemberLookup): Added additional
15566         `qualifier_type' argument which is used when we're being called
15567         from MemberAccess.DoResolve() and null if we're called from a
15568         SimpleName lookup.
15569         (Expression.MemberLookupFailed): New method to report errors; this
15570         does the CS1540 check and reports the correct error message.
15571
15572         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
15573         argument for the CS1540 check and redone the way how we're dealing
15574         with private members.  See the comment in the source code for details.
15575         (FilterWithClosure): Reverted this back to revision 1.197; renamed
15576         `closure_start_type' to `closure_qualifier_type' and check whether
15577         it's not null.  It was not this filter being broken, it was just
15578         being called with the wrong arguments.
15579
15580         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
15581         and pass it the correct `qualifier_type'; this also does the error
15582         handling for us.
15583
15584 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
15585
15586         * expression.cs (Invocation.EmitParams): If the we are dealing
15587         with a non-built-in value type, load its address as well.
15588
15589         (ArrayCreation): Use a a pretty constant instead
15590         of the hardcoded value 2.   Use 6 instead of 2 for the number of
15591         static initializers.  
15592
15593         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
15594         because they are not really value types, just glorified integers. 
15595
15596         * driver.cs: Do not append .exe, the CSC compiler does not do it.
15597
15598         * ecore.cs: Remove redundant code for enumerations, make them use
15599         the same code path as everything else, fixes the casting issue
15600         with enumerations in Windows.Forms.
15601
15602         * attribute.cs: Do only cast to string if it is a string, the
15603         validation happens later.
15604
15605         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
15606         people upgrade their corlibs.
15607
15608         * ecore.cs: Oops, enumerations were not following the entire code path
15609
15610 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
15611
15612         * typemanager.cs (FilterWithClosure): Commented out the test for
15613         1540 in typemanager.cs, as it has problems when accessing
15614         protected methods from a parent class (see test-174.cs). 
15615
15616         * attribute.cs (Attribute.ValidateGuid): new method.
15617         (Attribute.Resolve): Use above.
15618
15619 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
15620
15621         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
15622
15623         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
15624         handling for enumerations, as we only needed the TypeContainer
15625         functionality to begin with (this is required for the fix below to
15626         work for enums that reference constants in a container class for
15627         example). 
15628
15629         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
15630
15631         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
15632         a valid TypeBuilder to perform lookups on.o
15633
15634         * class.cs (InheritableMemberSignatureCompare): Use true in the
15635         call to GetGetMethod and GetSetMethod, because we are comparing
15636         the signature, and we need to get the methods *even* if they are
15637         private. 
15638
15639         (PropertyBase.CheckBase): ditto.
15640
15641         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
15642         GotoCase.Resolve): Use Peel on EmpytCasts.
15643
15644         * ecore.cs (EmptyCast): drop child, add Peel method.
15645
15646 2002-11-17  Martin Baulig  <martin@ximian.com>
15647
15648         * ecore.cs (EmptyCast.Child): New public property.
15649
15650         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
15651         label resolved to an EmptyCast.  Fixes #34162.
15652         (GotoCase.Resolve): Likewise.
15653         (Block.EmitMeta): Likewise.
15654
15655 2002-11-17  Martin Baulig  <martin@ximian.com>
15656
15657         * expression.cs (Invocation.BetterConversion): Prefer int over
15658         uint; short over ushort; long over ulong for integer literals.
15659         Use ImplicitConversionExists instead of StandardConversionExists
15660         since we also need to check for user-defined implicit conversions.
15661         Fixes #34165.  Added test-173.cs.
15662
15663 2002-11-16  Martin Baulig  <martin@ximian.com>
15664
15665         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
15666         with the `true' and `false' literals.  Fixes #33151.
15667
15668 2002-11-16  Martin Baulig  <martin@ximian.com>
15669
15670         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
15671         October 22nd; don't do the cs1540 check for static members.
15672
15673         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
15674         now using our own filter here and doing the cs1540 check again.
15675
15676 2002-11-16  Martin Baulig  <martin@ximian.com>
15677
15678         * support.cs (InternalParameters): Don't crash if we don't have
15679         any fixed parameters.  Fixes #33532.
15680
15681 2002-11-16  Martin Baulig  <martin@ximian.com>
15682
15683         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
15684         when looking up static methods to make this work on Windows.
15685         Fixes #33773.
15686
15687 2002-11-16  Martin Baulig  <martin@ximian.com>
15688
15689         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
15690         a setter rather than using PropertyInfo.CanWrite.
15691
15692 2002-11-15  Nick Drochak  <ndrochak@gol.com>
15693
15694         * class.cs: Allow acces to block member by subclasses. Fixes build
15695         breaker.
15696
15697 2002-11-14  Martin Baulig  <martin@ximian.com>
15698
15699         * class.cs (Constructor.Emit): Added the extern/block check.
15700         Fixes bug #33678.
15701
15702 2002-11-14  Martin Baulig  <martin@ximian.com>
15703
15704         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
15705         iteration while looking for indexers, this is needed because the
15706         indexer may have a different name in our base classes.  Fixed the
15707         error reporting (no indexers at all, not get accessor, no
15708         overloaded match).  Fixes bug #33089.
15709         (IndexerAccess.DoResolveLValue): Likewise.
15710
15711 2002-11-14  Martin Baulig  <martin@ximian.com>
15712
15713         * class.cs (PropertyBase.CheckBase): Make this work for multiple
15714         indexers.  Fixes the first part of bug #33089.
15715         (MethodSignature.InheritableMemberSignatureCompare): Added support
15716         for properties.
15717
15718 2002-11-13  Ravi Pratap  <ravi@ximian.com>
15719
15720         * attribute.cs (Attribute.Resolve): Catch the
15721         NullReferenceException and report it since it isn't supposed to
15722         happen. 
15723
15724 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
15725
15726         * expression.cs (Binary.EmitBranchable): Also handle the cases for
15727         LogicalOr and LogicalAnd that can benefit from recursively
15728         handling EmitBranchable.  The code now should be nice for Paolo.
15729
15730 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
15731
15732         * typemanager.cs (LookupType): Added a negative-hit hashtable for
15733         the Type lookups, as we perform quite a number of lookups on
15734         non-Types.  This can be removed once we can deterministically tell
15735         whether we have a type or a namespace in advance.
15736
15737         But this might require special hacks from our corlib.
15738
15739         * TODO: updated.
15740
15741         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
15742         and double which avoids a conversion from an integer to a double.
15743
15744         * expression.cs: tiny optimization, avoid calling IsConstant,
15745         because it effectively performs the lookup twice.
15746
15747 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
15748
15749         But a bogus return here to keep the semantics of the old code
15750         until the Mono runtime is fixed.
15751
15752         * pending.cs (GetMissingInterfaces): New method used to remove all
15753         the interfaces that are already implemented by our parent
15754         classes from the list of pending methods. 
15755
15756         * interface.cs: Add checks for calls after ResolveTypeExpr.
15757
15758 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
15759
15760         * class.cs (Class.Emit): Report warning 67: event not used if the
15761         warning level is beyond 3.
15762
15763         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
15764         being a NullLiteral.
15765
15766         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
15767         specifiers. 
15768
15769         * class.cs (TypeContainer.GetClassBases): Cover a missing code
15770         path that might fail if a type can not be resolved.
15771
15772         * expression.cs (Binary.Emit): Emit unsigned versions of the
15773         operators. 
15774
15775         * driver.cs: use error 5.
15776
15777 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
15778
15779         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
15780
15781 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
15782
15783         * cs-parser.jay (switch_section): A beautiful patch from Martin
15784         Baulig that fixed 33094.
15785
15786 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
15787
15788         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
15789         Check whether the base is abstract and report an error if so.
15790
15791         * expression.cs (IndexerAccess.DoResolveLValue,
15792         IndexerAccess.DoResolve): ditto. 
15793
15794         (Invocation.DoResolve): ditto.
15795
15796         (Invocation.FullMethodDesc): Improve the report string.
15797
15798         * statement.cs (Block): Eliminate IsVariableDefined as it is
15799         basically just a wrapper for GetVariableInfo.
15800
15801         * ecore.cs (SimpleName): Use new 
15802
15803         * support.cs (ReflectionParamter.ParameterType): We unwrap the
15804         type, as we return the actual parameter ref/unref state on a
15805         different call.
15806
15807 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
15808
15809         * support.cs: Return proper flags REF/OUT fixing the previous
15810         commit.  
15811
15812         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
15813         not used to mean `ref' but `ref or out' in ParameterReference
15814
15815         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
15816         full type signature instead of calling TypeManger.CSharpName
15817         ourselves. 
15818
15819         * support.cs (InternalParameters.ParameterDesc): Do not compare
15820         directly to the modflags, because REF/OUT will actually be bitsets
15821         if set. 
15822
15823         * delegate.cs (VerifyMethod): Check also the modifiers.
15824
15825         * cs-tokenizer.cs: Fix bug where floating point values with an
15826         exponent where a sign was missing was ignored.
15827
15828         * driver.cs: Allow multiple assemblies to be specified in a single
15829         /r: argument
15830
15831 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
15832
15833         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
15834         because identifiers after a parenthesis would end up in this kind
15835         of production, and we needed to desamiguate it for having casts
15836         like:
15837
15838                 (UserDefinedType *) xxx
15839
15840 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
15841
15842         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
15843         we should set on the Bindingflags.NonPublic, but not turn on
15844         private_ok.  private_ok controls whether a Private member is
15845         returned (this is chekced on the filter routine), while the
15846         BindingFlags.NonPublic just controls whether private/protected
15847         will be allowed.   This fixes the problem part of the problem of
15848         private properties being allowed to be used in derived classes.
15849
15850         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
15851         so we can call the children DoResolveLValue method (this will
15852         properly signal errors on lvalue assignments to base properties)
15853
15854         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
15855         getter are null, and we have a property info, we know that this
15856         happened because the lookup failed, so we report an error 122 for
15857         protection level violation.
15858
15859         We also silently return if setter and getter are null in the
15860         resolve functions, this condition only happens if we have flagged
15861         the error before.  This is the other half of the problem. 
15862
15863         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
15864         not have accessibility information, that is why we were returning
15865         true in the filter function in typemanager.cs.
15866
15867         To properly report 122 (property is inaccessible because of its
15868         protection level) correctly, we report this error in ResolveAccess
15869         by failing if both the setter and the getter are lacking (ie, the
15870         lookup failed). 
15871
15872         DoResolve and DoLResolve have been modified to check for both
15873         setter/getter being null and returning silently, the reason being
15874         that I did not want to put the knowledge about this error in upper
15875         layers, like:
15876
15877         int old = Report.Errors;
15878         x = new PropertyExpr (...);
15879         if (old != Report.Errors)
15880                 return null;
15881         else
15882                 return x;
15883
15884         So the property expr is returned, but it is invalid, so the error
15885         will be flagged during the resolve process. 
15886
15887         * class.cs: Remove InheritablePropertySignatureCompare from the
15888         class, as we no longer depend on the property signature to compute
15889         whether it is possible to implement a method or not.
15890
15891         The reason is that calling PropertyInfo.GetGetMethod will return
15892         null (in .NET, in Mono it works, and we should change this), in
15893         cases where the Get Method does not exist in that particular
15894         class.
15895
15896         So this code:
15897
15898         class X { public virtual int A { get { return 1; } } }
15899         class Y : X { }
15900         class Z : Y { public override int A { get { return 2; } } }
15901
15902         Would fail in Z because the parent (Y) would not have the property
15903         defined.  So we avoid this completely now (because the alternative
15904         fix was ugly and slow), and we now depend exclusively on the
15905         method names.
15906
15907         (PropertyBase.CheckBase): Use a method-base mechanism to find our
15908         reference method, instead of using the property.
15909
15910         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
15911         routines are gone now.
15912
15913         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
15914         names, they were incorrectly named.
15915
15916         * cs-tokenizer.cs: Return are more gentle token on failure. 
15917
15918         * pending.cs (PendingImplementation.InterfaceMethod): This routine
15919         had an out-of-sync index variable, which caused it to remove from
15920         the list of pending methods the wrong method sometimes.
15921
15922 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
15923
15924         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
15925         CanWrite, because those refer to this particular instance of the
15926         property, and do not take into account the fact that we can
15927         override single members of a property.
15928
15929         Constructor requires an EmitContext.  The resolution process does
15930         not happen here, but we need to compute the accessors before,
15931         because the resolution does not always happen for properties.
15932
15933         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
15934         subclass, before we did not update this flag, but we did update
15935         bindingflags. 
15936
15937         (GetAccessors): Drop this routine, as it did not work in the
15938         presence of partially overwritten set/get methods. 
15939
15940         Notice that this broke the cs1540 detection, but that will require
15941         more thinking. 
15942
15943 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15944
15945         * class.cs:
15946         * codegen.cs:
15947         * driver.cs: issue a warning instead of an error if we don't support
15948         debugging for the platform. Also ignore a couple of errors that may
15949         arise when trying to write the symbols. Undo my previous patch.
15950
15951 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15952
15953         * driver.cs: ignore /debug switch except for Unix platforms.
15954
15955 2002-10-23  Nick Drochak  <ndrochak@gol.com>
15956
15957         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
15958
15959 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
15960
15961         * driver.cs: Do not make mcs-debug conditional, so we do not break
15962         builds that use it.
15963
15964         * statement.cs (UsageVector.MergeChildren): I would like Martin to
15965         review this patch.  But basically after all the children variables
15966         have been merged, the value of "Breaks" was not being set to
15967         new_breaks for Switch blocks.  I think that it should be set after
15968         it has executed.  Currently I set this to the value of new_breaks,
15969         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
15970         conservative, but I do not understand this code very well.
15971
15972         I did not break anything in the build, so that is good ;-)
15973
15974         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
15975
15976 2002-10-20  Mark Crichton  <crichton@gimp.org>
15977
15978         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
15979
15980 2002-10-20  Nick Drochak  <ndrochak@gol.com>
15981
15982         * cfold.cs: Fixed compile blocker.
15983
15984 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
15985
15986         * driver.cs: I was chekcing the key, not the file.
15987
15988 2002-10-19  Ravi Pratap  <ravi@ximian.com>
15989
15990         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
15991         message that we were generating - we just need to silently return
15992         a null.
15993
15994 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
15995
15996         * class.cs (Event.Define): Change my previous commit, as this
15997         breaks the debugger.  This is a temporary hack, as it seems like
15998         the compiler is generating events incorrectly to begin with.
15999
16000         * expression.cs (Binary.ResolveOperator): Added support for 
16001         "U operator - (E x, E y)"
16002
16003         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16004         y)".
16005
16006         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16007         init-only variables, but this path did not take into account that
16008         there might be also instance readonly variables.  Correct this
16009         problem. 
16010
16011         This fixes bug 32253
16012
16013         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16014         delegates as well.
16015
16016         * driver.cs: Change the extension for modules to `netmodule'
16017
16018         * cs-parser.jay: Improved slightly the location tracking for
16019         the debugger symbols.
16020
16021         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16022         modifiers that were specified instead of the hardcoded value
16023         (FamAndAssem).  This was basically ignoring the static modifier,
16024         and others.  Fixes 32429.
16025
16026         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16027         fixed a bug in the process (32476)
16028
16029         * expression.cs (ArrayAccess.EmitAssign): Patch from
16030         hwang_rob@yahoo.ca that fixes bug 31834.3
16031
16032 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16033
16034         * driver.cs: Make the module extension .netmodule.
16035
16036 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16037
16038         * driver.cs: Report an error if the resource file is not found
16039         instead of crashing.
16040
16041         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16042         false, like Emit does.
16043
16044 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16045
16046         * typemanager.cs: Remove unused private member.  Also reported mcs
16047         bug to report this as a warning like csc.
16048
16049 2002-10-15  Martin Baulig  <martin@gnome.org>
16050
16051         * statement.cs (Statement.Emit): Made this a virtual method; emits
16052         the line number info and calls DoEmit().
16053         (Statement.DoEmit): New protected abstract method, formerly knows
16054         as Statement.Emit().
16055
16056         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16057
16058 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16059
16060         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16061         have fixed a remaining problem: not every AddXXXX was adding a
16062         fully qualified name.  
16063
16064         Now everyone registers a fully qualified name in the DeclSpace as
16065         being defined instead of the partial name.  
16066
16067         Downsides: we are slower than we need to be due to the excess
16068         copies and the names being registered this way.  
16069
16070         The reason for this is that we currently depend (on the corlib
16071         bootstrap for instance) that types are fully qualified, because
16072         we dump all the types in the namespace, and we should really have
16073         types inserted into the proper namespace, so we can only store the
16074         basenames in the defined_names array.
16075
16076 2002-10-10  Martin Baulig  <martin@gnome.org>
16077
16078         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16079         from bug #31834, see the bug report for a testcase which is
16080         miscompiled.
16081
16082 2002-10-10  Martin Baulig  <martin@gnome.org>
16083
16084         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16085         flow analysis code for this.
16086
16087         * statement.cs (Do, While, For): Tell the flow analysis code about
16088         infinite loops.
16089         (FlowBranching.UsageVector): Added support for infinite loops.
16090         (Block.Resolve): Moved the dead code elimination here and use flow
16091         analysis to do it.
16092
16093 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16094
16095         * class.cs (Field.Define): Catch cycles on struct type
16096         definitions. 
16097
16098         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16099         fields if the fields are static.  We only need to check instance
16100         fields. 
16101
16102         * expression.cs (As.DoResolve): Test for reference type.
16103
16104         * statement.cs (Using.ResolveExpression): Use
16105         ConvertImplicitRequired, not ConvertImplicit which reports an
16106         error on failture
16107         (Using.ResolveLocalVariableDecls): ditto.
16108
16109         * expression.cs (Binary.ResolveOperator): Report errors in a few
16110         places where we had to.
16111
16112         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16113
16114 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16115
16116         * expression.cs: Use StoreFromPtr instead of extracting the type
16117         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16118
16119         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16120         an enumeration value to a System.Enum, but System.Enum is not a
16121         value type, but an class type, so we need to box.
16122
16123         (Expression.ConvertExplicit): One codepath could return
16124         errors but not flag them.  Fix this.  Fixes #31853
16125
16126         * parameter.cs (Resolve): Do not allow void as a parameter type.
16127
16128 2002-10-06  Martin Baulig  <martin@gnome.org>
16129
16130         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16131         if it's a class type and not a struct.  Fixes #31815.
16132
16133 2002-10-06  Martin Baulig  <martin@gnome.org>
16134
16135         * statement.cs: Reworked the flow analysis code a bit to make it
16136         usable for dead code elimination.
16137
16138 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16139
16140         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16141
16142 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16143
16144         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16145         to fix the test 165, will investigate deeper.
16146
16147 2002-10-04  Martin Baulig  <martin@gnome.org>
16148
16149         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16150         finally blocks actually work.
16151         (Try.Resolve): We don't need to create a sibling for `finally' if
16152         there is no finally block.
16153
16154 2002-10-04  Martin Baulig  <martin@gnome.org>
16155
16156         * class.cs (Constructor.Define): The default accessibility for a
16157         non-default constructor is private, not public.
16158
16159 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16160
16161         * class.cs (Constructor): Make AllowedModifiers public, add
16162         EXTERN.
16163
16164         * cs-parser.jay: Perform the modifiers test here, as the
16165         constructor for the Constructor class usually receives a zero
16166         because of the way we create it (first we create, later we
16167         customize, and we were never checking the modifiers).
16168
16169         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16170         is a version of LookupTypeReflection that includes the type-name
16171         cache.  This can be used as a fast path for functions that know
16172         the fully qualified name and are only calling into *.GetType() to
16173         obtain a composed type.
16174
16175         This is also used by TypeManager.LookupType during its type
16176         composition.
16177
16178         (LookupType): We now also track the real type name, as sometimes
16179         we can get a quey for the real type name from things like
16180         ComposedCast.  This fixes bug 31422.
16181
16182         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16183         complete type fullname, it does not have to go through the type
16184         resolution system to obtain the composed version of the type (for
16185         obtaining arrays or pointers).
16186
16187         (Conditional.Emit): Use the EmitBoolExpression to
16188         generate nicer code, as requested by Paolo.
16189
16190         (ArrayCreation.CheckIndices): Use the patch from
16191         hwang_rob@yahoo.ca to validate the array initializers. 
16192
16193 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16194
16195         * class.cs (ConstructorInitializer.Emit): simplify code by using
16196         Invocation.EmitCall, and at the same time, fix the bugs in calling
16197         parent constructors that took variable arguments. 
16198
16199         * ecore.cs (Expression.ConvertNumericExplicit,
16200         Expression.ImplicitNumericConversion): Remove the code that
16201         manually wrapped decimal (InternalTypeConstructor call is now gone
16202         as well).
16203
16204         * expression.cs (Cast.TryReduce): Also handle decimal types when
16205         trying to perform a constant fold on the type.
16206
16207         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16208
16209         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16210         that only turned off an error report, and did nothing else. 
16211
16212 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16213
16214         * driver.cs: Handle and ignore /fullpaths
16215
16216 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16217
16218         * expression.cs (Binary.ResolveOperator): Catch the case where
16219         DoNumericPromotions returns true, 
16220
16221         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16222
16223 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16224
16225         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16226         report error 70.
16227
16228 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16229
16230         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16231         conversion exists, but it is also required that the conversion be
16232         performed.  This manifested in "(Type64Enum) 2".  
16233
16234         * class.cs (TypeManager.AddMethod): The fix is not to change
16235         AddEnum, because that one was using a fully qualified name (every
16236         DeclSpace derivative does), but to change the AddMethod routine
16237         that was using an un-namespaced name.  This now correctly reports
16238         the duplicated name.
16239
16240         Revert patch until I can properly fix it.  The issue
16241         is that we have a shared Type space across all namespaces
16242         currently, which is wrong.
16243
16244         Options include making the Namespace a DeclSpace, and merge
16245         current_namespace/current_container in the parser.
16246
16247 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
16248
16249         * cs-parser.jay: Improve error reporting when we get a different
16250         kind of expression in local_variable_type and
16251         local_variable_pointer_type. 
16252
16253         Propagate this to avoid missleading errors being reported.
16254
16255         * ecore.cs (ImplicitReferenceConversion): treat
16256         TypeManager.value_type as a target just like object_type.   As
16257         code like this:
16258
16259         ValueType v = 1;
16260
16261         Is valid, and needs to result in the int 1 being boxed before it
16262         is assigned to the value type v.
16263
16264         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
16265         to validate the enumeration name.
16266
16267         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
16268         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
16269         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
16270
16271         * ecore.cs (TryImplicitIntConversion): When doing an
16272         implicit-enumeration-conversion, check if the type is 64-bits and
16273         perform a conversion before passing to EnumConstant.
16274
16275 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
16276
16277         * decl.cs (Error_AmbiguousTypeReference); New routine used to
16278         report ambiguous type references.  Unlike the MS version, we
16279         report what the ambiguity is.   Innovation at work ;-)
16280
16281         (DeclSpace.FindType): Require a location argument to
16282         display when we display an ambiguous error.
16283
16284         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
16285
16286         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
16287
16288         * expression.cs (EmitDynamicInitializers): Apply patch from
16289         hwang_rob@yahoo.ca that fixes the order in which we emit our
16290         initializers. 
16291
16292 2002-09-21  Martin Baulig  <martin@gnome.org>
16293
16294         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
16295         delegate takes no arguments.
16296
16297 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
16298
16299         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
16300         from integers.
16301
16302         * expression.cs: Extract the underlying type.
16303
16304         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
16305
16306         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
16307
16308 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
16309
16310         * class.cs (TypeContainer.DefineType): We can not use the nice
16311         PackingSize with the size set to 1 DefineType method, because it
16312         will not allow us to define the interfaces that the struct
16313         implements.
16314
16315         This completes the fixing of bug 27287
16316
16317         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
16318         means also structs.  This fixes part of the problem. 
16319         (Expresion.ImplicitReferenceConversionExists): ditto.
16320
16321         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
16322         error if there were no errors reported during the type lookup
16323         process, to avoid duplicates or redundant errors.  Without this
16324         you would get an ambiguous errors plus a type not found.  We have
16325         beaten the user enough with the first error.  
16326
16327         (DeclSparce.FindType): Emit a warning if we have an ambiguous
16328         reference. 
16329
16330         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
16331         during the resolution process, stop the lookup, this avoids
16332         repeated error reports (same error twice).
16333
16334         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
16335
16336         * typemanager.cs (LookupType): Redo the type lookup code to match
16337         the needs of System.Reflection.  
16338
16339         The issue is that System.Reflection requires references to nested
16340         types to begin with a "+" sign instead of a dot.  So toplevel
16341         types look like: "NameSpace.TopLevelClass", and nested ones look
16342         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
16343         levels. 
16344
16345 2002-09-19  Martin Baulig  <martin@gnome.org>
16346
16347         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
16348         says that a method always returns or always throws an exception,
16349         don't report the CS0161.
16350
16351         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
16352         set `Returns = new_returns'.
16353
16354 2002-09-19  Martin Baulig  <martin@gnome.org>
16355
16356         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
16357         to an enum constant, check for a CS0176.
16358
16359 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
16360
16361         * class.cs (TypeContainer.CheckPairedOperators): Now we check
16362         for operators that must be in pairs and report errors.
16363
16364         * ecore.cs (SimpleName.DoResolveType): During the initial type
16365         resolution process, when we define types recursively, we must
16366         check first for types in our current scope before we perform
16367         lookups in the enclosing scopes.
16368
16369         * expression.cs (MakeByteBlob): Handle Decimal blobs.
16370
16371         (Invocation.VerifyArgumentsCompat): Call
16372         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
16373         I thought we were supposed to always call this, but there are a
16374         few places in the code where we dont do it.
16375
16376 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
16377
16378         * driver.cs: Add support in -linkres and -resource to specify the
16379         name of the identifier.
16380
16381 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16382
16383         * ecore.cs (StandardConversionExists): Sync with the conversion
16384         code: allow anything-* to void* conversions.
16385
16386         (FindMostSpecificSource): Use an Expression argument
16387         instead of a Type, because we might be handed over a Literal which
16388         gets a few more implicit conversions that plain types do not.  So
16389         this information was being lost.
16390
16391         Also, we drop the temporary type-holder expression when not
16392         required.
16393
16394 2002-09-17  Martin Baulig  <martin@gnome.org>
16395
16396         * class.cs (PropertyBase.CheckBase): Don't check the base class if
16397         this is an explicit interface implementation.
16398
16399 2002-09-17  Martin Baulig  <martin@gnome.org>
16400
16401         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
16402         different `IndexerName' attributes.
16403
16404         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
16405         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
16406         virtual CommonResolve().
16407
16408 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
16409
16410         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
16411         and convert that to the UnderlyingType.
16412
16413         * statement.cs (Foreach.Resolve): Indexers are just like variables
16414         or PropertyAccesses.
16415
16416         * cs-tokenizer.cs (consume_string): Track line numbers and columns
16417         inside quoted strings, we were not doing this before.
16418
16419 2002-09-16  Martin Baulig  <martin@gnome.org>
16420
16421         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
16422         resolve it.  This is needed for the definite assignment check of the
16423         instance expression, fixes bug #29846.
16424         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
16425
16426 2002-09-16  Nick Drochak  <ndrochak@gol.com>
16427
16428         * parameter.cs: Fix compile error.  Cannot reference static member
16429         from an instance object.  Is this an mcs bug?
16430
16431 2002-09-14  Martin Baulig  <martin@gnome.org>
16432
16433         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
16434         multiple times.  Fixes bug #30295, added test-166.cs.
16435
16436 2002-09-14  Martin Baulig  <martin@gnome.org>
16437
16438         * statement.cs (Block.Emit): Don't emit unreachable code.
16439         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
16440         `break' statements.
16441         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
16442
16443 2002-09-14  Martin Baulig  <martin@gnome.org>
16444
16445         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
16446         is set.
16447
16448 2002-09-14  Martin Baulig  <martin@gnome.org>
16449
16450         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
16451         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
16452         be false on the ms runtime.
16453
16454 2002-09-13  Martin Baulig  <martin@gnome.org>
16455
16456         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
16457         the CS0038 error message.
16458
16459 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
16460
16461         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
16462         constant inside, return it.
16463
16464 2002-09-12  Martin Baulig  <martin@gnome.org>
16465
16466         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
16467         implicit conversion can be done between enum types.
16468
16469         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
16470         check whether an implicit conversion to the current enum's UnderlyingType
16471         exists and report an error if not.
16472
16473         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
16474         without debugging support.
16475
16476         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
16477         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
16478
16479 2002-09-12  Martin Baulig  <martin@gnome.org>
16480
16481         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
16482
16483         * ecore.cs (IMemberExpr.DeclaringType): New property.
16484         (SimpleName.SimpleNameResolve): Check whether we're accessing a
16485         nonstatic member of an outer type (CS0038).
16486
16487 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
16488
16489         * driver.cs: Activate the using-error detector at warning level
16490         4 (at least for MS-compatible APIs).
16491
16492         * namespace.cs (VerifyUsing): Small buglett fix.
16493
16494         * pending.cs (PendingImplementation): pass the container pointer. 
16495
16496         * interface.cs (GetMethods): Allow for recursive definition.  Long
16497         term, I would like to move every type to support recursive
16498         definitions, not the current ordering mechanism that we have right
16499         now.
16500
16501         The situation is this: Attributes are handled before interfaces,
16502         so we can apply attributes to interfaces.  But some attributes
16503         implement interfaces, we will now handle the simple cases
16504         (recursive definitions will just get an error).  
16505
16506         * parameter.cs: Only invalidate types at the end if we fail to
16507         lookup all types.  
16508
16509 2002-09-09  Martin Baulig  <martin@gnome.org>
16510
16511         * ecore.cs (PropertyExpr.Emit): Also check for
16512         TypeManager.system_int_array_get_length so this'll also work when
16513         compiling corlib.  Fixes #30003.
16514
16515 2002-09-09  Martin Baulig  <martin@gnome.org>
16516
16517         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
16518         and throw an exception if we can't get the type's size.  Fixed #30040,
16519         added test-165.cs.
16520
16521 2002-09-09  Martin Baulig  <martin@gnome.org>
16522
16523         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
16524
16525         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
16526         context.  Fixes bug #30027.
16527
16528         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
16529         virtual functions.  Fixes bug #30043, added test-164.cs.
16530
16531 2002-09-08  Ravi Pratap  <ravi@ximian.com>
16532
16533         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
16534
16535 2002-09-08  Nick Drochak  <ndrochak@gol.com>
16536
16537         * driver.cs: Use an object to get the windows codepage since it's not a
16538         static property.
16539
16540 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
16541
16542         * statement.cs (For.Emit): for infinite loops (test == null)
16543         return whether there is a break inside, not always "true".
16544
16545         * namespace.cs (UsingEntry): New struct to hold the name of the
16546         using definition, the location where it is defined, and whether it
16547         has been used in a successful type lookup.
16548
16549         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
16550         strings.
16551
16552         * decl.cs: ditto.
16553
16554 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16555
16556         * attribute.cs : Fix incorrect code which relied on catching
16557         a NullReferenceException to detect a null being passed in
16558         where an object was expected.
16559
16560 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
16561
16562         * statement.cs (Try): flag the catch variable as assigned
16563
16564         * expression.cs (Cast): Simplified by using ResolveType instead of
16565         manually resolving.
16566
16567         * statement.cs (Catch): Fix bug by using ResolveType.
16568
16569 2002-09-06  Ravi Pratap  <ravi@ximian.com>
16570
16571         * expression.cs (BetterConversion): Special case for when we have
16572         a NullLiteral as the argument and we have to choose between string
16573         and object types - we choose string the way csc does.
16574
16575         * attribute.cs (Attribute.Resolve): Catch the
16576         NullReferenceException and report error #182 since the Mono
16577         runtime no more has the bug and having this exception raised means
16578         we tried to select a constructor which takes an object and is
16579         passed a null.
16580
16581 2002-09-05  Ravi Pratap  <ravi@ximian.com>
16582
16583         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
16584         message (1502, 1503) when we can't locate a method after overload
16585         resolution. This is much more informative and closes the bug
16586         Miguel reported.
16587
16588         * interface.cs (PopulateMethod): Return if there are no argument
16589         types. Fixes a NullReferenceException bug.
16590
16591         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
16592         expressions too. Previously we were checking only in one place for
16593         positional arguments leaving out named arguments.
16594
16595         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
16596         type to the enum type is not allowed. Remove code corresponding to
16597         that.
16598
16599         (ConvertNumericExplicit): Allow explicit conversions from
16600         the underlying type to enum type. This precisely follows the spec
16601         and closes a bug filed by Gonzalo.
16602
16603 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16604
16605         * compiler.csproj:
16606         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
16607
16608 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
16609
16610         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
16611         it was important that we stored the right value after the
16612         reduction in `converted'.
16613
16614 2002-09-04  Martin Baulig  <martin@gnome.org>
16615
16616         * location.cs (Location.SymbolDocument): Use full pathnames for the
16617         source files.
16618
16619 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
16620
16621         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
16622         of the expression resolve mechanism, because that will catch the
16623         SimpleName error failures.
16624
16625         (Conditional): If we can not resolve the
16626         expression, return, do not crash.
16627
16628 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16629
16630         * cs-tokenizer.cs:
16631         (location): display token name instead of its number.
16632
16633 2002-08-28  Martin Baulig  <martin@gnome.org>
16634
16635         * expression.cs (Binary.ResolveOperator): Don't silently return
16636         but return an error if an operator cannot be applied between two
16637         enum types.
16638
16639 2002-08-28  Martin Baulig  <martin@gnome.org>
16640
16641         * class.cs (Constructor.Define): Set the permission attributes
16642         correctly instead of making all constructors public.
16643
16644 2002-08-28  Martin Baulig  <martin@gnome.org>
16645
16646         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
16647         for private members before reporting a CS0103; if we find anything,
16648         it's a CS0122.
16649
16650 2002-08-28  Martin Baulig  <martin@gnome.org>
16651
16652         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
16653         to check whether `closure_start_type == closure_invocation_type',
16654         we also need to check whether `m.DeclaringType == closure_invocation_type'
16655         before bypassing the permission checks.  We might be accessing
16656         protected/private members from the base class.
16657         (TypeManager.RealMemberLookup): Only set private_ok if private
16658         members were requested via BindingFlags.NonPublic.
16659
16660         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
16661
16662         * expression.cs (MemberAccess.ResolveMemberAccess): Set
16663         MethodGroupExpr.IsExplicitImpl if appropriate.
16664         (Invocation.DoResolve): Don't report the CS0120 for explicit
16665         interface implementations.
16666
16667 2002-08-27  Martin Baulig  <martin@gnome.org>
16668
16669         * expression.cs (Invocation.DoResolve): If this is a static
16670         method and we don't have an InstanceExpression, we must report
16671         a CS0120.
16672
16673 2002-08-25  Martin Baulig  <martin@gnome.org>
16674
16675         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
16676         `==' between a valuetype and an object.
16677
16678 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
16679
16680         * ecore.cs (TypeExpr): Provide a ToString method.
16681
16682 2002-08-24  Martin Baulig  <martin@gnome.org>
16683
16684         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
16685         now called proggie.dbg and it's a binary file.
16686
16687 2002-08-23  Martin Baulig  <martin@gnome.org>
16688
16689         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
16690
16691 2002-08-23  Martin Baulig  <martin@gnome.org>
16692
16693         * struct.cs (MyStructInfo.ctor): Make this work with empty
16694         structs; it's not allowed to use foreach() on null.
16695
16696 2002-08-23  Martin Baulig  <martin@gnome.org>
16697
16698         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
16699         writer the full pathname of the generated assembly.
16700
16701 2002-08-23  Martin Baulig  <martin@gnome.org>
16702
16703         * statements.cs (FlowBranching.UsageVector.MergeChildren):
16704         A `finally' block never returns or breaks; improved handling of
16705         unreachable code.
16706
16707 2002-08-23  Martin Baulig  <martin@gnome.org>
16708
16709         * statement.cs (Throw.Resolve): Allow `throw null'.
16710
16711 2002-08-23  Martin Baulig  <martin@gnome.org>
16712
16713         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
16714         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
16715         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
16716         MemberLookup would return a wrong event if this is an explicit
16717         interface implementation and the class has an event with the same
16718         name.
16719
16720 2002-08-23  Martin Baulig  <martin@gnome.org>
16721
16722         * statement.cs (Block.AddChildVariableNames): New public method.
16723         (Block.AddChildVariableName): Likewise.
16724         (Block.IsVariableNameUsedInChildBlock): Likewise.
16725         (Block.AddVariable): Check whether a variable name has already
16726         been used in a child block.
16727
16728         * cs-parser.jay (declare_local_variables): Mark all variable names
16729         from the current block as being used in a child block in the
16730         implicit block.
16731
16732 2002-08-23  Martin Baulig  <martin@gnome.org>
16733
16734         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
16735         find the symbol writer.
16736
16737         * driver.cs: csc also allows the arguments to /define being
16738         separated by commas, not only by semicolons.
16739
16740 2002-08-23  Martin Baulig  <martin@gnome.org>
16741
16742         * interface.cs (Interface.GetMembers): Added static check for events.
16743
16744 2002-08-15  Martin Baulig  <martin@gnome.org>
16745
16746         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
16747         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
16748
16749         * ecore.cs (Expression.MemberLookup): Added documentation and explained
16750         why the MethodData.EmitDestructor() change was necessary.
16751
16752 2002-08-20  Martin Baulig  <martin@gnome.org>
16753
16754         * class.cs (TypeContainer.FindMembers): Added static check for events.
16755
16756         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
16757
16758         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
16759         use Type.GetEvents(), not Type.FindMembers().
16760
16761 2002-08-20  Martin Baulig  <martin@gnome.org>
16762
16763         * decl.cs (MemberCache): Added a special method cache which will
16764         be used for method-only searched.  This ensures that a method
16765         search will return a MethodInfo with the correct ReflectedType for
16766         inherited methods.      
16767
16768 2002-08-20  Martin Baulig  <martin@gnome.org>
16769
16770         * decl.cs (DeclSpace.FindMembers): Made this public.
16771
16772 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16773
16774         * delegate.cs: fixed build on windows.
16775         [FIXME:  Filed as bug #29150: MCS must report these errors.]
16776
16777 2002-08-19  Ravi Pratap  <ravi@ximian.com>
16778
16779         * ecore.cs (StandardConversionExists): Return a false
16780         if we are trying to convert the void type to anything else
16781         since that is not allowed.
16782
16783         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
16784         we flag error 70 in the event an event is trying to be accessed
16785         directly from outside the declaring type.
16786
16787 2002-08-20  Martin Baulig  <martin@gnome.org>
16788
16789         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
16790         MemberCache from typemanager.cs to decl.cs.
16791
16792 2002-08-19  Martin Baulig  <martin@gnome.org>
16793
16794         * class.cs (TypeContainer): Implement IMemberContainer.
16795         (TypeContainer.DefineMembers): Create the MemberCache.
16796         (TypeContainer.FindMembers): Do better BindingFlags checking; only
16797         return public members if BindingFlags.Public was given, check
16798         whether members are static.
16799
16800 2002-08-16  Martin Baulig  <martin@gnome.org>
16801
16802         * decl.cs (DeclSpace.Define): Splitted this in Define and
16803         DefineMembers.  DefineMembers is called first and initializes the
16804         MemberCache.
16805
16806         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
16807         DefineMembers() on all our DeclSpaces.
16808
16809         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
16810         but call DefineMembers() on all nested interfaces.  We call their
16811         Define() in our new Define() function.
16812
16813         * interface.cs (Interface): Implement IMemberContainer.
16814         (Interface.Define): Moved all code except the attribute stuf to
16815         DefineMembers().
16816         (Interface.DefineMembers): Initialize the member cache.
16817
16818         * typemanager.cs (IMemberFinder): Removed this interface, we don't
16819         need this anymore since we can use MemberCache.FindMembers directly.
16820
16821 2002-08-19  Martin Baulig  <martin@gnome.org>
16822
16823         * typemanager.cs (MemberCache): When creating the cache for an
16824         interface type, add all inherited members.
16825         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
16826         to `out bool used_cache' and documented it.
16827         (TypeManager.MemberLookup): If we already used the cache in the first
16828         iteration, we don't need to do the interfaces check.
16829
16830 2002-08-19  Martin Baulig  <martin@gnome.org>
16831
16832         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
16833         here from IMemberFinder and don't implement this interface anymore.
16834         (DeclSpace.MemberCache): Moved here from IMemberFinder.
16835
16836         * typemanager.cs (IMemberFinder): This interface is now only used by
16837         classes which actually support the member cache.
16838         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
16839         since we only put DeclSpaces into this Hashtable.
16840         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
16841         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
16842
16843 2002-08-16  Martin Baulig  <martin@gnome.org>
16844
16845         * typemanager.cs (ICachingMemberFinder): Removed.
16846         (IMemberFinder.MemberCache): New property.
16847         (TypeManager.FindMembers): Merged this with RealFindMembers().
16848         This function will never be called from TypeManager.MemberLookup()
16849         so we can't use the cache here, just the IMemberFinder.
16850         (TypeManager.MemberLookup_FindMembers): Check whether the
16851         IMemberFinder has a MemberCache and call the cache's FindMembers
16852         function.
16853         (MemberCache): Rewrote larger parts of this yet another time and
16854         cleaned it up a bit.
16855
16856 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
16857
16858         * driver.cs (LoadArgs): Support quoting.
16859
16860         (Usage): Show the CSC-like command line arguments.
16861
16862         Improved a few error messages.
16863
16864 2002-08-15  Martin Baulig  <martin@gnome.org>
16865
16866         * typemanager.cs (IMemberContainer.Type): New property.
16867         (IMemberContainer.IsInterface): New property.
16868
16869         The following changes are conditional to BROKEN_RUNTIME, which is
16870         defined at the top of the file.
16871
16872         * typemanager.cs (MemberCache.MemberCache): Don't add the base
16873         class'es members, but add all members from TypeHandle.ObjectType
16874         if we're an interface.
16875         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
16876         is the current type.
16877         (MemberCache.CacheEntry.Container): Removed this field.
16878         (TypeHandle.GetMembers): Include inherited members.
16879
16880 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16881
16882         * typemanager.cs: fixed compilation and added a comment on a field that
16883         is never used.
16884
16885 2002-08-15  Martin Baulig  <martin@gnome.org>
16886
16887         * class.cs (ConstructorInitializer.Resolve): In the
16888         Expression.MemberLookup call, use the queried_type as
16889         invocation_type.
16890
16891         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
16892         declared' attribute, it's always true.
16893         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
16894         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
16895         temporary wrapper for FindMembers which tells MemberLookup whether
16896         members from the base classes are included in the return value.
16897         This will go away soon.
16898         (TypeManager.MemberLookup): Use this temporary hack here; once the
16899         new MemberCache is completed, we don't need to do the DeclaredOnly
16900         looping here anymore since the MemberCache will take care of this.
16901         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
16902         (MemberCache): When creating the MemberCache for a class, get
16903         members from the current class and all its base classes.
16904         (MemberCache.CacheEntry.Container): New field.  This is a
16905         temporary hack until the Mono runtime is fixed to distinguish
16906         between ReflectedType and DeclaringType.  It allows us to use MCS
16907         with both the MS runtime and the unfixed Mono runtime without
16908         problems and without accecting performance.
16909         (MemberCache.SearchMembers): The DeclaredOnly looping from
16910         TypeManager.MemberLookup is now done here.      
16911
16912 2002-08-14  Martin Baulig  <martin@gnome.org>
16913
16914         * statement.cs (MyStructInfo.MyStructInfo): Don't call
16915         Type.GetFields on dynamic types but get the fields from the
16916         corresponding TypeContainer.
16917         (MyStructInfo.GetStructInfo): Added check for enum types.
16918
16919         * typemanager.cs (MemberList.IsSynchronized): Implemented.
16920         (MemberList.SyncRoot): Implemented.
16921         (TypeManager.FilterWithClosure): No need to check permissions if
16922         closure_start_type == closure_invocation_type, don't crash if
16923         closure_invocation_type is null.
16924
16925 2002-08-13  Martin Baulig  <martin@gnome.org>
16926
16927         Rewrote TypeContainer.FindMembers to use a member cache.  This
16928         gives us a speed increase of about 35% for the self-hosting MCS
16929         build and of about 15-20% for the class libs (both on GNU/Linux).
16930
16931         * report.cs (Timer): New class to get enhanced profiling.  This
16932         whole class is "TIMER" conditional since it remarkably slows down
16933         compilation speed.
16934
16935         * class.cs (MemberList): New class.  This is an IList wrapper
16936         which we're now using instead of passing MemberInfo[]'s around to
16937         avoid copying this array unnecessarily.
16938         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
16939         (ICachingMemberFinder, IMemberContainer): New interface.
16940         (TypeManager.FilterWithClosure): If `criteria' is null, the name
16941         has already been checked, otherwise use it for the name comparision.
16942         (TypeManager.FindMembers): Renamed to RealMemberFinder and
16943         provided wrapper which tries to use ICachingMemberFinder.FindMembers
16944         if possible.  Returns a MemberList, not a MemberInfo [].
16945         (TypeHandle): New class, implements IMemberContainer.  We create
16946         one instance of this class per type, it contains a MemberCache
16947         which is used to do the member lookups.
16948         (MemberCache): New class.  Each instance of this class contains
16949         all members of a type and a name-based hash table.
16950         (MemberCache.FindMembers): This is our new member lookup
16951         function.  First, it looks up all members of the requested name in
16952         the hash table.  Then, it walks this list and sorts out all
16953         applicable members and returns them.
16954
16955 2002-08-13  Martin Baulig  <martin@gnome.org>
16956
16957         In addition to a nice code cleanup, this gives us a performance
16958         increase of about 1.4% on GNU/Linux - not much, but it's already
16959         half a second for the self-hosting MCS compilation.
16960
16961         * typemanager.cs (IMemberFinder): New interface.  It is used by
16962         TypeManager.FindMembers to call FindMembers on a TypeContainer,
16963         Enum, Delegate or Interface.
16964         (TypeManager.finder_to_member_finder): New PtrHashtable.
16965         (TypeManager.finder_to_container): Removed.
16966         (TypeManager.finder_to_delegate): Removed.
16967         (TypeManager.finder_to_interface): Removed.
16968         (TypeManager.finder_to_enum): Removed.
16969
16970         * interface.cs (Interface): Implement IMemberFinder.
16971
16972         * delegate.cs (Delegate): Implement IMemberFinder.
16973
16974         * enum.cs (Enum): Implement IMemberFinder.
16975
16976         * class.cs (TypeContainer): Implement IMemberFinder.
16977
16978 2002-08-12  Martin Baulig  <martin@gnome.org>
16979
16980         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
16981
16982 2002-08-12  Martin Baulig  <martin@gnome.org>
16983
16984         * ecore.cs (ITypeExpression): New interface for expressions which
16985         resolve to a type.
16986         (TypeExpression): Renamed to TypeLookupExpression.
16987         (Expression.DoResolve): If we're doing a types-only lookup, the
16988         expression must implement the ITypeExpression interface and we
16989         call DoResolveType() on it.
16990         (SimpleName): Implement the new ITypeExpression interface.
16991         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
16992         hack, the situation that we're only looking up types can't happen
16993         anymore when this method is called.  Moved the type lookup code to
16994         DoResolveType() and call it.
16995         (SimpleName.DoResolveType): This ITypeExpression interface method
16996         is now doing the types-only lookup.
16997         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
16998         (ResolveFlags): Added MaskExprClass.
16999
17000         * expression.cs (MemberAccess): Implement the ITypeExpression
17001         interface.
17002         (MemberAccess.DoResolve): Added support for a types-only lookup
17003         when we're called via ITypeExpression.DoResolveType().
17004         (ComposedCast): Implement the ITypeExpression interface.
17005
17006         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17007         Expression.Resolve() with ResolveFlags.Type instead.
17008
17009 2002-08-12  Martin Baulig  <martin@gnome.org>
17010
17011         * interface.cs (Interface.Define): Apply attributes.
17012
17013         * attribute.cs (Attribute.ApplyAttributes): Added support for
17014         interface attributes.
17015
17016 2002-08-11  Martin Baulig  <martin@gnome.org>
17017
17018         * statement.cs (Block.Emit): Only check the "this" variable if we
17019         do not always throw an exception.
17020
17021         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17022         whether the property has a set accessor.
17023
17024 2002-08-11  Martin Baulig  <martin@gnome.org>
17025
17026         Added control flow analysis support for structs.
17027
17028         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17029         with control flow analysis turned off.
17030         (IVariable): New interface.
17031         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17032         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17033         (FieldExpr.DoResolve): Resolve the instance expression with flow
17034         analysis turned off and do the definite assignment check after the
17035         resolving when we know what the expression will resolve to.
17036
17037         * expression.cs (LocalVariableReference, ParameterReference):
17038         Implement the new IVariable interface, only call the flow analysis
17039         code if ec.DoFlowAnalysis is true.
17040         (This): Added constructor which takes a Block argument.  Implement
17041         the new IVariable interface.
17042         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17043         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17044         This does the definite assignment checks for struct members.
17045
17046         * class.cs (Constructor.Emit): If this is a non-static `struct'
17047         constructor which doesn't have any initializer, call
17048         Block.AddThisVariable() to tell the flow analysis code that all
17049         struct elements must be initialized before control returns from
17050         the constructor.
17051
17052         * statement.cs (MyStructInfo): New public class.
17053         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17054         argument to this indexer.  If non-zero, check an individual struct
17055         member, not the whole struct.
17056         (FlowBranching.CheckOutParameters): Check struct members.
17057         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17058         overloaded versions of these methods which take an additional
17059         `int field_idx' argument to check struct members.
17060         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17061         overloaded versions of these methods which take an additional
17062         `string field_name' argument to check struct member.s
17063         (VariableInfo): Implement the IVariable interface.
17064         (VariableInfo.StructInfo): New public property.  Returns the
17065         MyStructInfo instance of the variable if it's a struct or null.
17066         (Block.AddThisVariable): New public method.  This is called from
17067         Constructor.Emit() for non-static `struct' constructor which do
17068         not have any initializer.  It creates a special variable for the
17069         "this" instance variable which will be checked by the flow
17070         analysis code to ensure that all of the struct's fields are
17071         initialized before control returns from the constructor.
17072         (UsageVector): Added support for struct members.  If a
17073         variable/parameter is a struct with N members, we reserve a slot
17074         in the usage vector for each member.  A struct is considered fully
17075         initialized if either the struct itself (slot 0) or all its
17076         members are initialized.
17077
17078 2002-08-08  Martin Baulig  <martin@gnome.org>
17079
17080         * driver.cs (Driver.MainDriver): Only report an error CS5001
17081         if there were no compilation errors.
17082
17083         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17084         `UnsafeContext' property to determine whether the parent is in
17085         unsafe context rather than checking the parent's ModFlags:
17086         classes nested in an unsafe class are unsafe as well.
17087
17088 2002-08-08  Martin Baulig  <martin@gnome.org>
17089
17090         * statement.cs (UsageVector.MergeChildren): Distinguish between
17091         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17092         we return.  Added test17() and test18() to test-154.cs.
17093
17094 2002-08-08  Martin Baulig  <martin@gnome.org>
17095
17096         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17097         Family access, make sure the invoking type isn't a subclass of the
17098         queried type (that'd be a CS1540).
17099
17100         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17101         this method which takes an additional `Type invocation_type'.
17102
17103         * expression.cs (BaseAccess.DoResolve): Use the base type as
17104         invocation and query type.
17105         (MemberAccess.DoResolve): If the lookup failed and we're about to
17106         report a CS0122, try a lookup with the ec.ContainerType - if this
17107         succeeds, we must report a CS1540.
17108
17109 2002-08-08  Martin Baulig  <martin@gnome.org>
17110
17111         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17112         (MethodGroupExpr): Implement the IMemberExpr interface.
17113
17114         * expression (MemberAccess.ResolveMemberAccess): No need to have
17115         any special code for MethodGroupExprs anymore, they're now
17116         IMemberExprs.   
17117
17118 2002-08-08  Martin Baulig  <martin@gnome.org>
17119
17120         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17121         Family, FamANDAssem and FamORAssem permissions.
17122         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17123
17124 2002-08-08  Martin Baulig  <martin@gnome.org>
17125
17126         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17127         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17128         or loop block.
17129
17130 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17131
17132         * driver.cs: implemented /resource option to embed managed resources.
17133
17134 2002-08-07  Martin Baulig  <martin@gnome.org>
17135
17136         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17137         (FieldBase.HasFieldInitializer): New public property.
17138         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17139         returns the field initializer and makes sure it is only resolved once.
17140         (TypeContainer.EmitFieldInitializers): Call
17141         FieldBase.GetInitializerExpression to get the initializer, this ensures
17142         that it isn't resolved multiple times.
17143
17144         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17145         the resolving process (SimpleName/MemberLookup) that we're currently
17146         emitting a field initializer (which must not access any instance members,
17147         this is an error CS0236).
17148
17149         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17150         argument, if the `IsFieldInitializer' flag is set, we must report and
17151         error CS0236 and not an error CS0120.   
17152
17153 2002-08-07  Martin Baulig  <martin@gnome.org>
17154
17155         * ecore.cs (IMemberExpr): New public interface.
17156         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17157         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17158         if the expression is an IMemberExpr.
17159
17160         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17161         to be null, implicitly default to `this' if we're non-static in
17162         this case.  Simplified the code a lot by using the new IMemberExpr
17163         interface.  Also fixed bug #28176 here.
17164
17165 2002-08-06  Martin Baulig  <martin@gnome.org>
17166
17167         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17168         ParameterReferences during semantic analysis so that we can do a
17169         type-only search when resolving Cast, TypeOf and SizeOf.
17170         (block): Pass the `current_local_parameters' to the Block's
17171         constructor.
17172
17173         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17174         argument to the constructor.
17175         (ConstructorInitializer.Resolve): Create a temporary implicit
17176         block with the parameters.
17177
17178         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17179         references here if we aren't doing a type-only search.
17180
17181         * statement.cs (Block): Added constructor which takes a
17182         `Parameters parameters' argument.
17183         (Block.Parameters): New public property.
17184
17185         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17186         to `Parameters' and made it public readonly.
17187
17188 2002-08-06  Martin Baulig  <martin@gnome.org>
17189
17190         * ecore.cs (Expression.Warning): Made this public as well.
17191
17192         * report.cs (Report.Debug): Print the contents of collections.
17193
17194 2002-08-06  Martin Baulig  <martin@gnome.org>
17195
17196         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17197         used to tell Resolve() which kinds of expressions it may return.
17198         (Expression.Resolve): Added overloaded version of this method which
17199         takes a `ResolveFlags flags' argument.  This can be used to tell
17200         Resolve() which kinds of expressions it may return.  Reports a
17201         CS0118 on error.
17202         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17203         ResolveFlags.SimpleName.
17204         (Expression.Error118): Added overloaded version of this method which
17205         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17206         which kinds of expressions are allowed.
17207
17208         * expression.cs (Argument.ResolveMethodGroup): New public method.
17209         Resolves an argument, but allows a MethodGroup to be returned.
17210         This is used when invoking a delegate.
17211
17212         * TODO: Updated a bit.
17213
17214 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17215
17216         Fixed compilation with csc.
17217
17218         * ecore.cs: Expression.Error made public. Is this correct? Should
17219         Warning be made public too?
17220
17221         * expression.cs: use ea.Location instead of ea.loc.
17222         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17223
17224 2002-08-06  Martin Baulig  <martin@gnome.org>
17225
17226         * ecore.cs (Expression.loc): Moved the location here instead of
17227         duplicating it in all derived classes.
17228         (Expression.Location): New public property.
17229         (Expression.Error, Expression.Warning): Made them non-static and
17230         removed the location argument.
17231         (Expression.Warning): Added overloaded version which takes an
17232         `int level' argument.
17233         (Expression.Error118): Make this non-static and removed the
17234         expression and location arguments.
17235         (TypeExpr): Added location argument to the constructor.
17236
17237         * expression.cs (StaticCallExpr): Added location argument to
17238         the constructor.
17239         (Indirection, PointerArithmetic): Likewise.
17240         (CheckedExpr, UnCheckedExpr): Likewise.
17241         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
17242         (StringPtr): Likewise.
17243
17244
17245 2002-08-05  Martin Baulig  <martin@gnome.org>
17246
17247         * expression.cs (BaseAccess.DoResolve): Actually report errors.
17248
17249         * assign.cs (Assign.DoResolve): Check whether the source
17250         expression is a value or variable.
17251
17252         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
17253         while resolving the corresponding blocks.
17254
17255         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
17256         an error, don't silently return null.
17257
17258         * statement.cs (Block.AddVariable): Do the error reporting here
17259         and distinguish between CS0128 and CS0136.
17260         (Block.DoResolve): Report all unused labels (warning CS0164).
17261         (LabeledStatement): Pass the location to the constructor.
17262         (LabeledStatement.HasBeenReferenced): New property.
17263         (LabeledStatement.Resolve): Set it to true here.
17264
17265         * statement.cs (Return.Emit): Return success even after reporting
17266         a type mismatch error (CS0126 or CS0127), this is what csc does and
17267         it avoids confusing the users with any consecutive errors.
17268
17269 2002-08-05  Martin Baulig  <martin@gnome.org>
17270
17271         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
17272
17273         * const.cs (Const.LookupConstantValue): Catch circular definitions.
17274
17275         * expression.cs (MemberAccess.DoResolve): Silently return if an
17276         error has already been reported.
17277
17278         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
17279         error has already been reported.
17280
17281 2002-08-05  Martin Baulig  <martin@gnome.org>
17282
17283         * statement.cs (UsageVector): Only initialize the `parameters'
17284         vector if we actually have any "out" parameters.
17285
17286 2002-08-05  Martin Baulig  <martin@gnome.org>
17287
17288         * expression.cs (Binary.ResolveOperator): When combining delegates,
17289         they must have the same type.
17290
17291 2002-08-05  Martin Baulig  <martin@gnome.org>
17292
17293         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
17294         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
17295         work with the ms runtime and we also don't need it: if we're a
17296         PropertyBuilder and not in the `indexer_arguments' hash, then we
17297         are a property and not an indexer.
17298
17299         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
17300         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
17301         since the latter one doesn't work with the ms runtime.
17302
17303 2002-08-03  Martin Baulig  <martin@gnome.org>
17304
17305         Fixed bugs #27998 and #22735.
17306
17307         * class.cs (Method.IsOperator): New public field.
17308         (Method.CheckBase): Report CS0111 if there's already a method
17309         with the same parameters in the current class.  Report CS0508 when
17310         attempting to change the return type of an inherited method.
17311         (MethodData.Emit): Report CS0179 if a method doesn't have a body
17312         and it's not marked abstract or extern.
17313         (PropertyBase): New abstract base class for Property and Indexer.
17314         (PropertyBase.CheckBase): Moved here from Property and made it work
17315         for indexers.
17316         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
17317         the same so we can reuse it there.
17318         (Property, Indexer): Derive from PropertyBase.
17319         (MethodSignature.inheritable_property_signature_filter): New delegate
17320         to find properties and indexers.
17321
17322         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
17323         argument and improved error reporting.
17324
17325         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
17326         EmptyReadOnlyParameters and made it a property.
17327
17328         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
17329         version of this method which takes a `PropertyInfo indexer'.
17330         (TypeManager.RegisterIndexer): New method.
17331
17332         * class.cs: Added myself as author of this file :-)
17333
17334 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17335
17336         * class.cs: fixed compilation on windoze.
17337
17338 2002-08-03  Martin Baulig  <martin@gnome.org>
17339
17340         * interface.cs (Interface.GetInterfaceBases): Check whether all
17341         base interfaces are at least as accessible than the current one.
17342
17343         * class.cs (TypeContainer.GetClassBases): Check whether base types
17344         are at least as accessible than the current type.
17345         (TypeContainer.AsAccessible): Implemented and made non-static.
17346         (MemberBase.CheckParameters): Report errors if the accessibility
17347         checks fail.
17348
17349         * delegate.cs (Delegate.Delegate): The default visibility is
17350         internal for top-level types and private for nested types.
17351         (Delegate.Define): Report errors if the accessibility checks fail.
17352
17353         * enum.cs (Enum.Enum): The default visibility is internal for
17354         top-level types and private for nested types.
17355         (Enum.DefineType): Compute the correct visibility.
17356
17357         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
17358         function which takes a `bool is_toplevel' instead of a TypeContainer.
17359
17360         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
17361         builtin type.
17362
17363 2002-08-02  Martin Baulig  <martin@gnome.org>
17364
17365         * expression.cs (LocalVariableReferenc): Added constructor which
17366         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
17367         (LocalVariableReference.IsReadOnly): New property.
17368         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
17369         variable is readonly, use our own readonly flag to do this; you can
17370         use the new constructor to get a writable reference to a read-only
17371         variable.
17372
17373         * cs-parser.jay (foreach_statement, using_statement): Get a writable
17374         reference to the local variable.
17375
17376 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
17377
17378         * rootcontext.cs (ResolveCore): Also include System.Exception
17379
17380         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
17381         we reach an EmptyStatement.
17382
17383         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
17384         is also fine.
17385
17386         * expression.cs (Binary.ResolveOperator): Check error result in
17387         two places.
17388
17389         use brtrue/brfalse directly and avoid compares to null.
17390
17391 2002-08-02  Martin Baulig  <martin@gnome.org>
17392
17393         * class.cs (TypeContainer.Define): Define all nested interfaces here.
17394         Fixes bug #28407, added test-155.cs.
17395
17396 2002-08-01  Martin Baulig  <martin@gnome.org>
17397
17398         * class.cs (Event.EmitDefaultMethod): Make this work with static
17399         events.  Fixes #28311, added verify-3.cs.
17400
17401 2002-08-01  Martin Baulig  <martin@gnome.org>
17402
17403         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
17404         `is_disposable' fields.
17405         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
17406         `hm.is_disposable' if we're using the collection pattern.
17407         (Foreach.EmitCollectionForeach): Use the correct type for the
17408         enumerator's local variable, only emit the try/finally block if
17409         necessary (fixes #27713).
17410
17411 2002-08-01  Martin Baulig  <martin@gnome.org>
17412
17413         * ecore.cs (Expression.report118): Renamed to Error118 and made
17414         it public static.
17415
17416         * statement.cs (Throw.Resolve): Check whether the expression is of
17417         the correct type (CS0118) and whether the type derives from
17418         System.Exception (CS0155).
17419         (Catch.Resolve): New method.  Do the type lookup here and check
17420         whether it derives from System.Exception (CS0155).
17421         (Catch.CatchType, Catch.IsGeneral): New public properties.
17422
17423         * typemanager.cs (TypeManager.exception_type): Added.
17424
17425 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
17426
17427         * driver.cs: Updated About function.
17428
17429 2002-07-31  Martin Baulig  <martin@gnome.org>
17430
17431         Implemented Control Flow Analysis.
17432
17433         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
17434         (EmitContext.CurrentBranching): Added.
17435         (EmitContext.StartFlowBranching): Added.
17436         (EmitContext.EndFlowBranching): Added.
17437         (EmitContext.KillFlowBranching): Added.
17438         (EmitContext.IsVariableAssigned): Added.
17439         (EmitContext.SetVariableAssigned): Added.
17440         (EmitContext.IsParameterAssigned): Added.
17441         (EmitContext.SetParameterAssigned): Added.
17442         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
17443         Added control flow analysis stuff here.
17444
17445         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
17446         resolve the expression as lvalue.
17447         (LocalVariableReference.DoResolve): Check whether the variable has
17448         already been assigned.
17449         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
17450         the parameter as assigned here.
17451         (ParameterReference.DoResolve): Check whether the parameter has already
17452         been assigned.
17453         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
17454         expression as lvalue.
17455
17456         * statement.cs (FlowBranching): New class for the flow analysis code.
17457         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
17458         (LabeledStatement.IsDefined): New public property.
17459         (LabeledStatement.AddUsageVector): New public method to tell flow
17460         analyis that the label may be reached via a forward jump.
17461         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
17462         flow analysis.
17463         (VariableInfo.Number): New public field.  This is used by flow analysis
17464         to number all locals of a block.
17465         (Block.CountVariables): New public property.  This is the number of
17466         local variables in this block (including the locals from all parent
17467         blocks).
17468         (Block.EmitMeta): Number all the variables.
17469
17470         * statement.cs: Added flow analysis support to all classes.
17471
17472 2002-07-31  Martin Baulig  <martin@gnome.org>
17473
17474         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
17475         To get debugging messages, compile mcs with /define:MCS_DEBUG and
17476         then use this argument.
17477
17478         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
17479
17480         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
17481         use this to specify /define options.
17482
17483 2002-07-29  Martin Baulig  <martin@gnome.org>
17484
17485         * statement.cs (Fixed): Moved all code that does variable lookups
17486         and resolvings from Emit to Resolve.
17487
17488         * statement.cs (For): Moved all code that does variable lookups
17489         and resolvings from Emit to Resolve.
17490
17491         * statement.cs (Using): Moved all code that does variable lookups
17492         and resolvings from Emit to Resolve.
17493
17494 2002-07-29  Martin Baulig  <martin@gnome.org>
17495
17496         * attribute.cs (Attribute.Resolve): Explicitly catch a
17497         System.NullReferenceException when creating the
17498         CustromAttributeBuilder and report a different warning message.
17499
17500 2002-07-29  Martin Baulig  <martin@gnome.org>
17501
17502         * support.cs (ParameterData.ParameterName): Added method to
17503         get the name of a parameter.
17504
17505         * typemanager.cs (TypeManager.IsValueType): New public method.
17506
17507 2002-07-29  Martin Baulig  <martin@gnome.org>
17508
17509         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
17510         is a flag which specifies that it's either ref or out.
17511         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
17512         the out parameter to `out Parameter.Modifier mod', also set the
17513         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
17514
17515         * support.cs (InternalParameters.ParameterModifier): Distinguish
17516         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17517         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17518
17519         * expression.cs (Argument.GetParameterModifier): Distinguish
17520         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
17521         Parameter.Modifier.ISBYREF flag if it's either ref or out.
17522
17523 2002-07-29  Martin Baulig  <martin@gnome.org>
17524
17525         * expression.cs (ParameterReference.ParameterReference): Added
17526         `Location loc' argument to the constructor.
17527
17528         * cs-parser.jay: Pass location to ParameterReference.
17529
17530 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
17531
17532         * statement.cs (Try): Initialize the location.
17533
17534         * cs-parser.jay: pass location to Try.
17535
17536         * expression.cs (Unary.Reduce): Change the prototype to return
17537         whether a constant fold could be performed or not.  The result is
17538         returned in an out parameters.  In the case of Indirection and
17539         AddressOf, we want to perform the full tests.
17540
17541 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
17542
17543         * statement.cs (Statement.Emit): Flag dead code.
17544
17545 2002-07-27  Andrew Birkett  <andy@nobugs.org>
17546
17547         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
17548
17549 2002-07-27  Martin Baulig  <martin@gnome.org>
17550
17551         * class.cs (MethodData.Define): Put back call to
17552         TypeManager.AddMethod(), accidentally commented this out.
17553
17554         * report.cs (Debug): New public method to print debugging information,
17555         this is `[Conditional ("DEBUG")]'.
17556
17557 2002-07-26  Martin Baulig  <martin@gnome.org>
17558
17559         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
17560         (switch_statement): Push the current_block to the switch_stack and
17561         pop it again when we're done with the switch.
17562         (switch_section): The new block is a child of the current_block.
17563         Fixes bug #24007, added test-152.cs.
17564
17565 2002-07-27  Martin Baulig  <martin@gnome.org>
17566
17567         * expression.cs (Invocation.EmitArguments): When calling a varargs
17568         function with only its fixed arguments, we need to pass an empty
17569         array.
17570
17571 2002-07-27  Martin Baulig  <martin@gnome.org>
17572
17573         Mono 0.13 has been released.
17574
17575 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
17576
17577         * driver.cs: Rename --resource to --linkres, because that is what
17578         we do currently, we dont support --resource yet.
17579
17580         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
17581
17582 2002-07-25  Martin Baulig  <martin@gnome.org>
17583
17584         * class.cs (MethodData): New public class.  This is a `method builder'
17585         class for a method or one accessor of a Property/Indexer/Event.
17586         (MethodData.GetMethodFlags): Moved here from MemberBase.
17587         (MethodData.ApplyAttributes): Likewise.
17588         (MethodData.ApplyObsoleteAttribute): Likewise.
17589         (MethodData.ApplyConditionalAttribute): Likewise.
17590         (MethodData.ApplyDllImportAttribute): Likewise.
17591         (MethodData.CheckAbstractAndExternal): Likewise.
17592         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
17593         (MethodData.Emit): Formerly known as Method.Emit().
17594         (MemberBase): Moved everything which was specific to a single
17595         accessor/method to MethodData.
17596         (Method): Create a new MethodData and call Define() and Emit() on it.
17597         (Property, Indexer, Event): Create a new MethodData objects for each
17598         accessor and call Define() and Emit() on them.
17599
17600 2002-07-25  Martin Baulig  <martin@gnome.org>
17601
17602         Made MethodCore derive from MemberBase to reuse the code from there.
17603         MemberBase now also checks for attributes.
17604
17605         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
17606         (MemberBase.GetMethodFlags): Moved here from class Method and marked
17607         as virtual.
17608         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
17609         `CallingConventions cc' and `Attributes opt_attrs' arguments.
17610         (MemberBase.ApplyAttributes): New virtual method; applies the
17611         attributes to a method or accessor.
17612         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
17613         (MemberBase.ApplyConditionalAttribute): Likewise.
17614         (MemberBase.ApplyDllImportAttribute): Likewise.
17615         (MemberBase.CheckAbstractAndExternal): Likewise.
17616         (MethodCore.ParameterTypes): This is now a property instead of a
17617         method, it's initialized from DoDefineParameters().
17618         (MethodCore.ParameterInfo): Removed the set accessor.
17619         (MethodCore.DoDefineParameters): New protected virtual method to
17620         initialize ParameterTypes and ParameterInfo.
17621         (Method.GetReturnType): We can now simply return the MemberType.
17622         (Method.GetMethodFlags): Override the MemberBase version and add
17623         the conditional flags.
17624         (Method.CheckBase): Moved some code from Define() here, call
17625         DoDefineParameters() here.
17626         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
17627         here to avoid some larger code duplication.
17628         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
17629         ensure that abstract and external accessors don't declare a body.
17630
17631         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
17632         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
17633         lookup in the attribute's parent classes, so we need to abort as soon
17634         as we found the first match.
17635         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
17636         the attribute has no arguments.
17637
17638         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
17639         of a Method.
17640
17641 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17642
17643         * cs-parser.jay: reverted previous patch.
17644
17645 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17646
17647         * cs-parser.jay: fixed bug #22119.
17648
17649 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17650
17651         * attribute.cs: fixed compilation. The error was:
17652         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
17653         be assigned to before control leaves the current method."
17654         [FIXME:  Filed as bug #28186: MCS must report this error.]
17655
17656 2002-07-25  Martin Baulig  <martin@gnome.org>
17657
17658         * attribute.cs (Attribute.Conditional_GetConditionName): New static
17659         method to pull the condition name ouf of a Conditional attribute.
17660         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
17661         the obsolete message and error flag out of an Obsolete attribute.
17662
17663         * class.cs (Method.GetMethodFlags): New public method to get the
17664         TypeManager.MethodFlags for this method.
17665         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
17666         private methods.
17667         (Method.Define): Get and apply the Obsolete and Conditional attributes;
17668         if we're overriding a virtual function, set the new private variable
17669         `parent_method'; call the new TypeManager.AddMethod().
17670
17671         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
17672         the MethodBuilder and the Method in a PtrHashtable.
17673         (TypeManager.builder_to_method): Added for this purpose.
17674         (TypeManager.MethodFlags): Added IsObsoleteError.
17675         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
17676         Obsolete and Conditional arguments in MethodBuilders.  If we discover
17677         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
17678         the message from the attribute.
17679
17680 2002-07-24  Martin Baulig  <martin@gnome.org>
17681
17682         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
17683         preprocessor directives, ensure that the argument to #define/#undef is
17684         exactly one identifier and that it's actually an identifier.
17685
17686         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
17687         did not work ....
17688
17689 2002-07-24  Martin Baulig  <martin@gnome.org>
17690
17691         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
17692         initialize it to TypeManager.object_type in the constructor.
17693         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
17694         of the `hm.get_current' method if we're using the collection pattern.
17695         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
17696         for the explicit conversion to make it work when we're using the collection
17697         pattern and the `Current' property has a different return type than `object'.
17698         Fixes #27713.
17699
17700 2002-07-24  Martin Baulig  <martin@gnome.org>
17701
17702         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
17703         does not match, but don't report any errors.  This method is called in
17704         order for all methods in a MethodGroupExpr until a matching method is
17705         found, so we don't want to bail out if the first method doesn't match.
17706         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
17707         matches, report the 123.  Fixes #28070.
17708
17709 2002-07-24  Martin Baulig  <martin@gnome.org>
17710
17711         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
17712         TypeManager.TypeToCoreType() to the top of the method so the
17713         following equality checks will work.  Fixes #28107.
17714
17715 2002-07-24  Martin Baulig  <martin@gnome.org>
17716
17717         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
17718         operand is of type uint, and the other operand is of type sbyte,
17719         short or int, the operands are converted to type long." -
17720         Actually do what this comment already told us.  Fixes bug #28106,
17721         added test-150.cs.
17722
17723 2002-07-24  Martin Baulig  <martin@gnome.org>
17724
17725         * class.cs (MethodBase): New abstract class.  This is now a base
17726         class for Property, Indexer and Event to avoid some code duplication
17727         in their Define() and DefineMethods() methods.
17728         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
17729         generic methods for Define() and DefineMethods().
17730         (FieldBase): Derive from MemberBase, not MemberCore.
17731         (Property): Derive from MemberBase, not MemberCore.
17732         (Property.DefineMethod): Moved all the code from this method to the
17733         new MethodBase.DefineAccessor(), just call it with appropriate
17734         argumetnts.
17735         (Property.Define): Call the new Property.DoDefine(), this does some
17736         sanity checks and we don't need to duplicate the code everywhere.
17737         (Event): Derive from MemberBase, not MemberCore.
17738         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
17739         accessors, this will also make them work with interface events.
17740         (Indexer): Derive from MemberBase, not MemberCore.
17741         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
17742         (Indexer.Define): Use the new MethodBase functions.
17743
17744         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
17745         argument to the constructor.
17746         (Interface.FindMembers): Added support for interface events.
17747         (Interface.PopluateEvent): Implemented.
17748
17749         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
17750
17751 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
17752
17753         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
17754         but this is required to check for a method name being the same as
17755         the containing class.  
17756
17757         Handle this now.
17758
17759 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17760
17761         * interface.cs: initialize variable.
17762
17763 2002-07-23  Martin Baulig  <martin@gnome.org>
17764
17765         Implemented the IndexerName attribute in interfaces.
17766
17767         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
17768         name if this is an explicit interface implementation.
17769         (Indexer.InterfaceIndexerName): New public variable.  If we're
17770         implementing an interface indexer, this is the IndexerName in that
17771         interface.  Otherwise, it's the IndexerName.
17772         (Indexer.DefineMethod): If we're implementing interface indexer,
17773         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
17774         and Pending.ImplementIndexer methods.
17775         (Indexer.Define): Also define the PropertyBuilder if we're
17776         implementing an interface indexer and this is neither an explicit
17777         interface implementation nor do the IndexerName match the one in
17778         the interface.
17779
17780         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
17781         If a method is defined here, then we always need to create a proxy
17782         for it.  This is used when implementing interface indexers.
17783         (Pending.IsInterfaceIndexer): New public method.
17784         (Pending.ImplementIndexer): New public method.
17785         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
17786         This is used when implementing interface indexers to define a proxy
17787         if necessary.
17788         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
17789         define a proxy if necessary.
17790
17791         * interface.cs (Interface.IndexerName): New public variable.
17792         (Interface.PopulateIndexer): Set the IndexerName.
17793         (Interface.DefineIndexers): New private method.  Populate all the
17794         indexers and make sure their IndexerNames match.
17795
17796         * typemanager.cs (IndexerPropertyName): Added support for interface
17797         indexers.
17798
17799 2002-07-22  Martin Baulig  <martin@gnome.org>
17800
17801         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
17802         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
17803         ret if HasReturnLabel.
17804         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
17805         variables.
17806
17807         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
17808         and set the ec.LoopBeginTryCatchLevel.
17809         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
17810         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
17811         the current ec.TryCatchLevel, the branch goes out of an exception
17812         block.  In this case, we need to use Leave and not Br.
17813
17814 2002-07-22  Martin Baulig  <martin@gnome.org>
17815
17816         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
17817         block unless the block does not always return or it is contained in
17818         another try { ... } catch { ... } block.  Fixes bug #26506.
17819         Added verify-1.cs to the test suite.
17820
17821 2002-07-22  Martin Baulig  <martin@gnome.org>
17822
17823         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
17824         then we do not always return.  Fixes bug #24985.
17825
17826 2002-07-22  Martin Baulig  <martin@gnome.org>
17827
17828         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
17829         lookup on a per-class level; ie. walk up the class hierarchy until we
17830         found at least one applicable method, then choose the best among them.
17831         Fixes bug #24463 and test-29.cs.
17832
17833 2002-07-22  Martin Baulig  <martin@gnome.org>
17834
17835         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
17836         return types of the methods.  The return type is not part of the
17837         signature and we must not check it to make the `new' modifier work.
17838         Fixes bug #27999, also added test-147.cs.
17839         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
17840
17841         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
17842         on the method's return type.
17843
17844 2002-07-21  Martin Baulig  <martin@gnome.org>
17845
17846         * assign.cs: Make this work if the rightmost source is a constant and
17847         we need to do an implicit type conversion.  Also adding a few more tests
17848         to test-38.cs which should have caught this.
17849
17850         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
17851         target in the makefile for this.  The makefile.gnu is primarily intended
17852         for end-users who don't want to debug the compiler.
17853
17854 2002-07-21  Martin Baulig  <martin@gnome.org>
17855
17856         * assign.cs: Improved the Assign class so it can now handle embedded
17857         assignments (X = Y = Z = something).  As a side-effect this'll now also
17858         consume less local variables.  test-38.cs now passes with MCS, added
17859         a few new test cases to that test.
17860
17861 2002-07-20  Martin Baulig  <martin@gnome.org>
17862
17863         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
17864         instructions.  Fixes bug #27977, also added test-146.cs.
17865
17866 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17867
17868         * cs-tokenizer.cs: fixed getHex ().
17869
17870 2002-07-19  Martin Baulig  <martin@gnome.org>
17871
17872         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
17873         not Type.GetType() to lookup the array type.  This is needed when
17874         we're constructing an array of a user-defined type.
17875         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
17876         single-dimensional arrays, but also for single-dimensial arrays of
17877         type decimal.
17878
17879 2002-07-19  Martin Baulig  <martin@gnome.org>
17880
17881         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
17882         this function is called, it's not allowed to share LocalBuilders
17883         among ILGenerators.
17884
17885 2002-07-19  Martin Baulig  <martin@gnome.org>
17886
17887         * expression.cs (Argument.Resolve): Report an error 118 when trying
17888         to pass a type as argument.
17889
17890 2002-07-18  Martin Baulig  <martin@gnome.org>
17891
17892         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
17893         Conv_R_Un for the signed `long' type.
17894
17895 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
17896
17897         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
17898         `expr' for the temporary result, as that will fail if we do
17899         multiple resolves on the same expression.
17900
17901 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
17902
17903         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
17904         ec.TypeContainer for looking up aliases. 
17905
17906         * class.cs (TypeContainer): Remove LookupAlias from here.
17907
17908         * decl.cs (DeclSpace); Move here.
17909
17910 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
17911
17912         * class.cs (FindMembers): Only call filter if the constructor
17913         bulider is not null.
17914
17915         Also handle delegates in `NestedTypes' now.  Now we will perform
17916         type lookups using the standard resolution process.  This also
17917         fixes a bug.
17918
17919         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
17920         This uses Expressions (the limited kind that can be parsed by the
17921         tree) instead of strings.
17922
17923         * expression.cs (ComposedCast.ToString): Implement, used to flag
17924         errors since now we have to render expressions.
17925
17926         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
17927         FormArrayType. 
17928
17929         * ecore.cs (SimpleName.ToString): ditto.
17930
17931         * cs-parser.jay: Instead of using strings to assemble types, use
17932         Expressions to assemble the type (using SimpleName, ComposedCast,
17933         MemberAccess).  This should fix the type lookups in declarations,
17934         because we were using a different code path for this.
17935
17936         * statement.cs (Block.Resolve): Continue processing statements
17937         even when there is an error.
17938
17939 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
17940
17941         * class.cs (Event.Define): Also remove the `remove' method from
17942         the list of pending items.
17943
17944         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
17945         generate more compact code. 
17946
17947 2002-07-17  Martin Baulig  <martin@gnome.org>
17948
17949         * const.cs (Const.LookupConstantValue): Add support for constant
17950         `unchecked' and `checked' expressions.
17951         Also adding test case test-140.cs for this.
17952
17953 2002-07-17  Martin Baulig  <martin@gnome.org>
17954
17955         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
17956         check whether mi.ReturnType implements the IEnumerator interface; the
17957         `==' and the IsAssignableFrom() will fail in this situation.
17958
17959 2002-07-16  Ravi Pratap  <ravi@ximian.com>
17960
17961         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
17962         here too.
17963
17964 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17965
17966         * expression.cs: fixed bug #27811.
17967
17968 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
17969
17970         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
17971         Molaro: when we are a ref, the value already contains a pointer
17972         value, do not take the address of it.
17973
17974 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
17975         * removed mb-parser.jay and mb-tokenizer.cs
17976
17977 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
17978
17979         * expression.cs: check against the building corlib void type.
17980
17981 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
17982
17983         * ecore.cs: fix for valuetype static readonly fields: when 
17984         initializing them, we need their address, not the address of a copy.
17985
17986 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
17987
17988         * typemanager.cs: register also enum_type in corlib.
17989
17990 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
17991
17992         * class.cs: allow calling this (but not base) initializers in structs.
17993
17994 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
17995
17996         * ecore.cs: make sure we compare against the building base types
17997         in GetTypeSize ().
17998
17999 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18000
18001         * typemanager.cs: fix TypeToCoreType() to handle void and object
18002         (corlib gets no more typerefs after this change).
18003
18004 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18005
18006         * expression.cs (ArrayCreation.EmitArrayArguments): use
18007         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18008
18009         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18010         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18011         array indexes, the runtime actually forbids them.
18012
18013         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18014         for array arguments here.
18015
18016         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18017         instead of the default for ValueTypes.
18018
18019         (New.DoEmit): Use IsValueType instead of
18020         IsSubclassOf (value_type)
18021         (New.DoResolve): ditto.
18022         (Invocation.EmitCall): ditto.
18023
18024         * assign.cs (Assign): ditto.
18025
18026         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18027         Statements *are* currently doing part of their resolution during
18028         Emit.  
18029
18030         Expressions do always resolve during resolve, but statements are
18031         only required to propagate resolution to their children.
18032
18033 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18034
18035         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18036
18037         (LoadAssembly): Do not add the dll if it is already specified
18038
18039         (MainDriver): Add the System directory to the link path at the end,
18040         after all the other -L arguments. 
18041
18042         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18043         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18044         ldelem.u1) and using the opposite for sbytes.
18045
18046         This fixes Digger, and we can finally run it.
18047
18048         * driver.cs (UnixParseOption): Move the option parsing here.  
18049         (CSCParseOption): Implement CSC-like parsing of options.
18050
18051         We now support both modes of operation, the old Unix way, and the
18052         new CSC-like way.  This should help those who wanted to make cross
18053         platform makefiles.
18054
18055         The only thing broken is that /r:, /reference: and /lib: are not
18056         implemented, because I want to make those have the same semantics
18057         as the CSC compiler has, and kill once and for all the confussion
18058         around this.   Will be doing this tomorrow.
18059
18060         * statement.cs (Unsafe.Resolve): The state is checked during
18061         resolve, not emit, so we have to set the flags for IsUnsfe here.
18062
18063 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18064
18065         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18066         not catch the Error_ObjectRefRequired in SimpleName (as it is
18067         possible to have a class/instance variable name that later gets
18068         deambiguated), we have to check this here.      
18069
18070 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18071
18072         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18073         make static and put into Expression.
18074
18075         (Event.Define): Register the private field of the event with the 
18076         TypeManager so that GetFieldFromEvent can get at it.
18077
18078         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18079         keep track of the private field associated with an event which
18080         has no accessors.
18081
18082         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18083         private field.
18084
18085         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18086
18087 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18088
18089         * expression.cs (Binary.EmitBranchable): this routine emits the
18090         Binary expression in a branchable context.  This basically means:
18091         we need to branch somewhere, not just get the value on the stack.
18092
18093         This works together with Statement.EmitBoolExpression.
18094
18095         * statement.cs (Statement.EmitBoolExpression): Use
18096         EmitBranchable. 
18097
18098 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18099
18100         * statement.cs (For): Reduce the number of jumps in loops.
18101
18102         (For): Implement loop inversion for the For statement.
18103
18104         (Break): We can be breaking out of a Try/Catch controlled section
18105         (foreach might have an implicit try/catch clause), so we need to
18106         use Leave instead of Br.
18107
18108         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18109         now).  If the instace expression supports IMemoryLocation, we use
18110         the AddressOf method from the IMemoryLocation to extract the
18111         address instead of emitting the instance.
18112
18113         This showed up with `This', as we were emitting the instance
18114         always (Emit) instead of the Address of This.  Particularly
18115         interesting when This is a value type, as we dont want the Emit
18116         effect (which was to load the object).
18117
18118 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18119
18120         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18121
18122         * statement.cs (Checked): Set the CheckedState during the resolve
18123         process too, as the ConvCast operations track the checked state on
18124         the resolve process, and not emit.
18125
18126         * cs-parser.jay (namespace_member_declaration): Flag that we have
18127         found a declaration when we do.  This is used to flag error 1529
18128
18129         * driver.cs: Report ok when we display the help only.
18130
18131 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18132
18133         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18134
18135 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18136
18137         * cs-tokenizer.cs (define): We also have to track locally the
18138         defines.  AllDefines is just used for the Conditional Attribute,
18139         but we also need the local defines for the current source code. 
18140
18141 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18142
18143         * statement.cs (While, For, Do): These loops can exit through a
18144         Break statement, use this information to tell whether the
18145         statement is the last piece of code.
18146
18147         (Break): Flag that we break.
18148
18149         * codegen.cs (EmitContexts): New `Breaks' state variable.
18150
18151 2002-07-03  Martin Baulig  <martin@gnome.org>
18152
18153         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18154         modifiers in method declarations in structs.  Otherwise, you won't
18155         be able to override things like Object.Equals().
18156
18157 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18158
18159         * class.cs (Method, Property, Indexer): Do not allow the public
18160         modifier to be used in explicit interface implementations.
18161
18162         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18163         override modifiers in method declarations in structs
18164
18165 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18166
18167         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18168         integer or real overflow, report an error
18169
18170 2002-07-02  Martin Baulig  <martin@gnome.org>
18171
18172         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18173         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18174         to tell the runtime about our newly created System.Object and
18175         System.ValueType types.
18176
18177 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18178
18179         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18180         struct instead of Ldarg/Starg.
18181
18182 2002-07-02  Martin Baulig  <martin@gnome.org>
18183
18184         * expression.cs (Indirection.Indirection): Call
18185         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18186
18187 2002-07-02  Martin Baulig  <martin@gnome.org>
18188
18189         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18190         ValueType, call TypeManager.TypeToCoreType() on it.
18191         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18192         the OpCodes.Newarr argument.
18193
18194 2002-07-02  Martin Baulig  <martin@gnome.org>
18195
18196         * expression.cs (Invocation.EmitCall): When compiling corlib,
18197         replace all calls to the system's System.Array type to calls to
18198         the newly created one.
18199
18200         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18201         System.Array methods.
18202         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18203         from the system's System.Array type which must be replaced.
18204
18205 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18206
18207         * typemanager.cs: load unverifiable_code_ctor so we can build
18208         corlib using the correct type. Avoid using GetTypeCode() with
18209         TypeBuilders.
18210         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18211         TypeManager.object_type to allow building corlib.
18212
18213 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18214
18215         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18216
18217 2002-07-01  Martin Baulig  <martin@gnome.org>
18218
18219         * class.cs: Make the last change actually work, we need to check
18220         whether `ifaces != null' to avoid a crash.
18221
18222 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18223
18224         * class.cs: when we build structs without fields that implement
18225         interfaces, we need to add the interfaces separately, since there is
18226         no API to both set the size and add the interfaces at type creation
18227         time.
18228
18229 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18230
18231         * expression.cs: the dimension arguments to the array constructors
18232         need to be converted if they are a long.
18233
18234 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
18235
18236         * class.cs: don't emit ldarg.0 if there is no parent constructor
18237         (fixes showstopper for corlib).
18238
18239 2002-06-29  Martin Baulig  <martin@gnome.org>
18240
18241         MCS now compiles corlib on GNU/Linux :-)
18242
18243         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
18244         ie. check for MethodImplOptions.InternalCall.
18245
18246         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
18247         and TypeManager.attribute_type are null, so we must explicitly check
18248         whether parent is not null to find out whether it's an attribute type.
18249         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
18250         and SetBuilder, not only if the property is neither abstract nor external.
18251         This is necessary to set the MethodImplOptions on the accessor methods.
18252         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
18253         SetBuilder, see Property.Emit().
18254
18255         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
18256         populate "System.Object", "System.ValueType" and "System.Attribute" since
18257         they've already been populated from BootCorlib_PopulateCoreTypes().
18258
18259 2002-06-29  Martin Baulig  <martin@gnome.org>
18260
18261         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
18262         is the NullLiteral, we also need to make sure that target_type is not
18263         an enum type.   
18264
18265 2002-06-29  Martin Baulig  <martin@gnome.org>
18266
18267         * rootcontext.cs (RootContext.ResolveCore): We must initialize
18268         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
18269         before calling BootstrapCorlib_ResolveDelegate ().
18270
18271 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18272
18273         * statement.cs: fixed build-breaker. All tests passed ok.
18274
18275 2002-06-27  Martin Baulig  <martin@gnome.org>
18276
18277         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
18278         for System.Decimal when compiling corlib.
18279
18280 2002-06-27  Martin Baulig  <martin@gnome.org>
18281
18282         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
18283         switch blocks which contain nothing but a default clause.
18284
18285 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
18286
18287        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
18288
18289 2002-06-27  Martin Baulig  <martin@gnome.org>
18290
18291         * ecore.cs (PropertyExpr.PropertyExpr): Call
18292         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
18293
18294         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
18295         is already a TypeBuilder.
18296
18297 2002-06-27  Martin Baulig  <martin@gnome.org>
18298
18299         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
18300         `target_type == TypeManager.array_type', not IsAssignableFrom() in
18301         the "from an array-type to System.Array" case.  This makes it work
18302         when compiling corlib.
18303
18304 2002-06-27  Martin Baulig  <martin@gnome.org>
18305
18306         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
18307         non-static PropertyExpr, set its InstanceExpression.  This makes
18308         the `ICollection.Count' property work in System/Array.cs.
18309
18310 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
18311
18312         * driver.cs: Made error handling more consistent.  Errors now
18313         tracked by Report class, so many methods which used to return int
18314         now return void.  Main() now prints success/failure and 
18315         errors/warnings message.
18316
18317         Renamed '--probe' compiler argument to '--expect-error'.  Removed
18318         the magic number return values (123 and 124).  Now, if the
18319         expected error occurs, the compiler exits with success (exit value
18320         0).  If the compilation completes without seeing that particular
18321         error, the compiler exits with failure (exit value 1).  The
18322         makefile in mcs/errors has been changed to handle the new behaviour.
18323
18324         * report.cs: Made 'expected error' number a property and renamed
18325         it from 'Probe' to 'ExpectedError'.
18326
18327         * genericparser.cs: Removed error handling support, since it is
18328         now all done by Report class.
18329
18330         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
18331         class, so parse() no longer returns an int.
18332
18333         * namespace.cs: Use Report.Error instead of GenericParser.error
18334
18335 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
18336
18337         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
18338         TypeContainer.AddOperator): At the front of the list put the
18339         explicit implementations, so they get resolved/defined first. 
18340
18341 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
18342
18343         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
18344         interface type is implemented by this TypeContainer.  Used during
18345         explicit interface implementation.
18346
18347         (Property.Define, Indexer.Define, Method.Define): Validate that
18348         the given interface in the explicit implementation is one of the
18349         base classes for the containing type.
18350
18351         Also if we are explicitly implementing an interface, but there is
18352         no match in the pending implementation table, report an error.
18353
18354         (Property.Define): Only define the property if we are
18355         not explicitly implementing a property from an interface.  Use the
18356         correct name also for those properties (the same CSC uses,
18357         although that is really not needed).
18358
18359         (Property.Emit): Do not emit attributes for explicitly implemented
18360         properties, as there is no TypeBuilder.
18361
18362         (Indexer.Emit): ditto.
18363
18364         Hiding then means that we do not really *implement* a pending
18365         implementation, which makes code fail.
18366
18367 2002-06-22  Martin Baulig  <martin@gnome.org>
18368
18369         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
18370         the return value of Object.GetType().  [FIXME: we need to do this whenever
18371         we get a type back from the reflection library].
18372
18373 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
18374
18375         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
18376
18377 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
18378
18379         * attribute.cs: Return null if we can not look up the type.
18380
18381         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
18382         the interface types found.
18383
18384         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
18385         interface types found.
18386
18387         * typemanager.cs (GetInterfaces): Make this routine returns alll
18388         the interfaces and work around the lame differences between
18389         System.Type and System.Reflection.Emit.TypeBuilder in the results
18390         result for GetInterfaces.
18391
18392         (ExpandInterfaces): Given an array of interface types, expand and
18393         eliminate repeated ocurrences of an interface.  This expands in
18394         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
18395         be IA, IB, IC.
18396
18397 2002-06-21  Martin Baulig  <martin@gnome.org>
18398
18399         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
18400         on System.Enum.
18401
18402 2002-06-21  Martin Baulig  <martin@gnome.org>
18403
18404         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
18405         and called with one of the core types, return the corresponding typebuilder for
18406         that type.
18407
18408         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
18409         element type.
18410
18411 2002-06-21  Martin Baulig  <martin@gnome.org>
18412
18413         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
18414         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
18415         (Expression.ConvertReferenceExplicit): Likewise.
18416
18417         * expression.cs (ElementAccess.DoResolve): Likewise.
18418         (ElementAccess.DoResolveLValue): Likewise.
18419
18420 2002-06-10  Martin Baulig  <martin@gnome.org>
18421
18422         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
18423         add the "value" parameter to the parameter list.
18424
18425         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
18426         to our caller.
18427
18428 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
18429
18430         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
18431         the argument to an int, uint, long or ulong, per the spec.  Also
18432         catch negative constants in array creation.
18433
18434 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
18435
18436         * class.cs: do not allow the same interface to appear twice in
18437         the definition list.
18438
18439 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
18440
18441         * ecore.cs: don't use ldlen with System.Array.
18442
18443 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
18444
18445         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
18446
18447 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
18448
18449         * modifiers.cs: produce correct field attributes for protected
18450         internal. Easy fix so miguel can work on ther harder stuff:-)
18451
18452 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
18453
18454         * pending.cs: New file.  Move the code from class.cs here.
18455         Support clearning the pending flag for all methods (when not doing
18456         explicit interface implementation).
18457
18458 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
18459
18460         * rootcontext.cs: added a couple more types needed to bootstrap.
18461
18462 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
18463
18464         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
18465         constructor in the type, instead of any constructor in the type
18466         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
18467         a bug in the Mono runtime when applying the params attribute). 
18468
18469 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
18470         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
18471
18472 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
18473
18474         * expression.cs (Unary.ResolveOperator): Use TypeManager
18475         to resolve the type.
18476
18477 2002-06-13  Ravi Pratap  <ravi@ximian.com>
18478
18479         * cs-parser.jay (enum_member_declaration): Pass in the attributes
18480         attached.
18481
18482         * enum.cs (AddEnumMember): Add support to store the attributes associated 
18483         with each member too.
18484
18485         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
18486         field builders too - this takes care of the enum member case.
18487
18488 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
18489
18490         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
18491         address-of operator on both value types and pointers.
18492
18493 2002-06-10  Martin Baulig  <martin@gnome.org>
18494
18495         * interface.cs (Interface.PopulateIndexer): Add the indexer's
18496         PropertyBuilder to the `property_builders' list.
18497
18498         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
18499         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
18500         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
18501         find any indexers which are inherited from an interface.
18502
18503 2002-06-09  Martin Baulig  <martin@gnome.org>
18504
18505         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
18506         the same type as the constant if necessary.  There's also a test-130.cs
18507         for this.
18508
18509         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
18510
18511         * typemanager.cs (TypeManager.ChangeType): Previously known as
18512         Enum.ChangeEnumType().
18513
18514 2002-06-09  Martin Baulig  <martin@gnome.org>
18515
18516         * expression.cs (Cast.TryReduce): Added support for consts.
18517
18518 2002-06-08  Ravi Pratap  <ravi@ximian.com>
18519
18520         * class.cs (Accessor): Hold attributes information so we can pass
18521         it along.
18522
18523         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
18524         Modify to pass in attributes attached to the methods.
18525
18526         (add_accessor_declaration, remove_accessor_declaration): Ditto.
18527
18528         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
18529         to handle the Accessor kind :-)
18530
18531         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
18532
18533 2002-06-08  Martin Baulig  <martin@gnome.org>
18534
18535         * expression.cs (Unary.TryReduceNegative): Added support for
18536         ULongConstants.
18537
18538 2002-06-08  Martin Baulig  <martin@gnome.org>
18539
18540         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
18541         name can't be found in the `defined_names' - the caller will do a
18542         MemberLookup in this case and thus find methods in System.Enum
18543         such as Enum.IsDefined().
18544
18545 2002-06-08  Martin Baulig  <martin@gnome.org>
18546
18547         * enum.cs (Enum.ChangeEnumType): This is a custom version of
18548         Convert.ChangeType() which works with TypeBuilder created types.
18549         (Enum.LookupEnumValue, Enum.Define): Use it here.
18550
18551         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
18552         `TypeBuilder.BaseType != null' check.
18553         (TypeContainer.FindMembers): Only lookup parent members if we
18554         actually have a parent.
18555         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
18556         (ConstructorInitializer.Resolve): Likewise.
18557
18558         * interface.cs (Interface.FindMembers): Added
18559         `TypeBuilder.BaseType != null' check.
18560
18561         * rootcontext.cs (RootContext.ResolveCore): Added
18562         "System.Runtime.CompilerServices.IndexerNameAttribute" to
18563         classes_second_stage.
18564
18565         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
18566         debug_type and trace_type when compiling with --nostdlib.       
18567
18568 2002-06-07  Martin Baulig  <martin@gnome.org>
18569
18570         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
18571         (AddField): Set it to true when adding a non-static field.
18572         (DefineType): Use `have_nonstatic_fields' to find out whether we
18573         have non-static fields, not `Fields != null'.
18574
18575 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
18576
18577         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
18578         dereferencing a null on the static-field code path)
18579
18580 2002-05-30  Martin Baulig  <martin@gnome.org>
18581
18582         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
18583         to take command line arguments.  Use reflection to call the new
18584         custom `Initialize' function on the symbol writer and pass it the
18585         command line arguments.
18586
18587         * driver.cs (--debug-args): New command line argument to pass command
18588         line arguments to the symbol writer.
18589
18590 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
18591
18592         * assign.cs (DoResolve): Forgot to do the implicit conversion to
18593         the target type for indexers and properties.  Thanks to Joe for
18594         catching this.
18595
18596 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
18597
18598         * typemanager.cs (MethodFlags): returns the method flags
18599         (Obsolete/ShouldIgnore) that control warning emission and whether
18600         the invocation should be made, or ignored. 
18601
18602         * expression.cs (Invocation.Emit): Remove previous hack, we should
18603         not do this on matching a base type, we should do this based on an attribute
18604
18605         Only emit calls to System.Diagnostics.Debug and
18606         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
18607         on the command line.
18608
18609         * rootcontext.cs: Global settings for tracing and debugging.
18610
18611         * cs-tokenizer.cs (define): New utility function to track
18612         defines.   Set the global settings for TRACE and DEBUG if found.
18613
18614 2002-05-25  Ravi Pratap  <ravi@ximian.com>
18615
18616         * interface.cs (Populate*): Pass in the TypeContainer as well as
18617         the DeclSpace as parameters so that we can create EmitContexts and
18618         then use that to apply attributes etc.
18619
18620         (PopulateMethod, PopulateEvent, PopulateProperty)
18621         (PopulateIndexer): Apply attributes everywhere.
18622
18623         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
18624         etc.
18625
18626         (ApplyAttributes): Update accordingly.
18627
18628         We now apply interface attributes for all members too.
18629
18630 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
18631
18632         * class.cs (Indexer.Define); Correctly check if we are explicit
18633         implementation (instead of checking the Name for a ".", we
18634         directly look up if the InterfaceType was specified).
18635
18636         Delay the creation of the PropertyBuilder.
18637
18638         Only create the PropertyBuilder if we are not an explicit
18639         interface implementation.   This means that explicit interface
18640         implementation members do not participate in regular function
18641         lookups, and hence fixes another major ambiguity problem in
18642         overload resolution (that was the visible effect).
18643
18644         (DefineMethod): Return whether we are doing an interface
18645         implementation. 
18646
18647         * typemanager.cs: Temporary hack until we get attributes in
18648         interfaces (Ravi is working on that) and we get IndexerName
18649         support in interfaces.
18650
18651         * interface.cs: Register the indexers as properties.
18652
18653         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
18654         warning, I have verified that this is a bug in the .NET runtime
18655         (JavaScript suffers of the same problem).
18656
18657         * typemanager.cs (MemberLookup): When looking up members for
18658         interfaces, the parent of an interface is the implicit
18659         System.Object (so we succeed in searches of Object methods in an
18660         interface method invocation.  Example:  IEnumerable x;  x.ToString
18661         ()) 
18662
18663 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
18664
18665         * class.cs (Event): Events should also register if they do
18666         implement the methods that an interface requires.
18667
18668         * typemanager.cs (MemberLookup); use the new GetInterfaces
18669         method. 
18670
18671         (GetInterfaces): The code used to lookup interfaces for a type is
18672         used in more than one place, factor it here. 
18673
18674         * driver.cs: Track the errors at the bottom of the file, we kept
18675         on going.
18676
18677         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
18678         instance if the method we are calling is static!
18679
18680 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
18681
18682         * attribute.cs (ApplyAttributes): Make this function filter out
18683         the IndexerName attribute (as that attribute in reality is never
18684         applied) and return the string constant for the IndexerName
18685         attribute. 
18686
18687         * class.cs (TypeContainer.Emit): Validate that all the indexers
18688         have the same IndexerName attribute, and if so, set the
18689         DefaultName attribute on the class. 
18690
18691         * typemanager.cs: The return value might contain other stuff (not
18692         only methods).  For instance, consider a method with an "Item"
18693         property and an Item method.
18694
18695         * class.cs: If there is a problem with the parameter types,
18696         return. 
18697
18698 2002-05-24  Ravi Pratap  <ravi@ximian.com>
18699
18700         * ecore.cs (ImplicitConversionExists): Wrapper function which also
18701         looks at user defined conversion after making a call to 
18702         StandardConversionExists - we need this for overload resolution.
18703
18704         * expression.cs : Update accordingly the various method calls.
18705
18706         This fixes 2 bugs filed against implicit user defined conversions 
18707
18708 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
18709
18710         * statement.cs: Track the result of the assignment.
18711
18712 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
18713
18714         * expression.cs (MemberAccess): Improved error reporting for
18715         inaccessible members.
18716
18717 2002-05-22  Martin Baulig  <martin@gnome.org>
18718
18719         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
18720         itself with debugging support.
18721
18722 2002-05-22  Martin Baulig  <martin@gnome.org>
18723
18724         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
18725         Removed, this isn't needed anymore.
18726
18727 2002-05-20  Martin Baulig  <martin@gnome.org>
18728
18729         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
18730         be underlying type for an enum.
18731
18732 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
18733
18734         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
18735         that splits out the loading of just the core types.
18736
18737         * rootcontext.cs (ResolveCore): Split the struct resolution in
18738         two, so we can load the enumeration underlying types before any
18739         enums are used.
18740
18741         * expression.cs (Is): Bandaid until we fix properly Switch (see
18742         bug #24985 for details).
18743
18744         * typemanager.cs (ImplementsInterface): The hashtable will contain
18745         a null if there are no interfaces implemented.
18746
18747 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
18748
18749         * cs-parser.jay (indexer_declarator): It is fine to have array
18750         parameters
18751
18752 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18753
18754         * typemanager.cs: (RegisterBuilder): New function used to register
18755         TypeBuilders that implement interfaces.  Since
18756         TypeBuilder.GetInterfaces (as usual) does not work with lame
18757         Reflection.Emit. 
18758         (AddUserType): register interfaces.
18759
18760         (ImplementsInterface): Use the builder_to_ifaces hash if we are
18761         dealing with TypeBuilder.  Also, arrays are showing up as
18762         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
18763         methods can not be invoked on them!
18764
18765         * ecore.cs (ExplicitReferenceConversionExists): Made public.
18766         (ImplicitReferenceConversionExists): Split out from
18767         StandardConversionExists. 
18768
18769         * expression.cs (As): We were only implementing one of the three
18770         cases for the as operator.  We now implement them all.
18771         (Is): Implement the various other cases for Is as well.
18772
18773         * typemanager.cs (CACHE): New define used to control if we want or
18774         not the FindMembers cache.  Seems to have a negative impact on
18775         performance currently
18776
18777         (MemberLookup): Nested types have full acess to
18778         enclosing type members
18779
18780         Remove code that coped with instance/static returns for events, we
18781         now catch this in RealFindMembers.
18782
18783         (RealFindMembers): only perform static lookup if the instance
18784         lookup did not return a type or an event.  
18785
18786 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
18787
18788         * assign.cs (CompoundAssign): We pass more semantic information
18789         now to Compound Assignments than we did before: now we have all
18790         the information at hand, and now we resolve the target *before* we
18791         do the expression expansion, which allows the "CacheValue" method
18792         to have the effect we intended (before, a [x] += 1 would generate
18793         two differen ArrayAccess expressions from the ElementAccess,
18794         during the resolution process).
18795
18796         (CompoundAssign.DoResolve): Resolve target and original_source here.
18797
18798 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
18799
18800         * expression.cs (ArrayAccess): dropped debugging information. 
18801
18802         * typemanager.cs: Small bug fix: I was always returning i_members,
18803         instead of one of i_members or s_members (depending on which had
18804         the content).
18805
18806         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
18807         method is invoked before any code generation takes place, and it
18808         is a mechanism to inform that the expression will be invoked more
18809         than once, and that the method should use temporary values to
18810         avoid having side effects
18811
18812         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
18813
18814         * ecore.cs (Expression.CacheTemporaries): Provide empty default
18815         implementation.
18816
18817         * expression.cs (Indirection, ArrayAccess): Add support for
18818         CacheTemporaries in these two bad boys. 
18819
18820         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
18821         ldobj or ldind_ref.  
18822         (StoreFromPtr): Handle stobj as well.
18823
18824         * expression.cs (UnaryMutator): Share more code.
18825
18826         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
18827         down: I was not tracking the Filter function as well, which
18828         was affecting the results of the cache.
18829
18830 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
18831
18832         * attribute.cs: Remove the hack to handle the CharSet property on
18833         StructLayouts. 
18834
18835 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
18836
18837         * attribute.cs (DoResolve): More uglyness, we now only try to
18838         resolve the attribute partially, to extract the CharSet
18839         information (only if we are a StructLayout attribute).  Otherwise 
18840
18841         (GetExtraTypeInfo): Add some code to conditionally kill in the
18842         future this.   I am more and more convinced that the .NET
18843         framework has special code to handle the attribute setting on
18844         certain elements.
18845
18846         * expression.cs (IsParamsMethodApplicable): Revert my previous
18847         foreach change here, it was wrong.
18848
18849 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
18850
18851         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
18852         (pp_expr): do not abort on unknown input, just return.
18853         (eval): abort if there are pending chars.
18854
18855         * attribute.cs (Attribute.Resolve): Positional parameters are
18856         optional.  Deal with that case.
18857
18858         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
18859         the Ansi/Unicode/Auto information for the type.
18860
18861         (TypeContainer.DefineType): instantiate the EmitContext here, as
18862         we will be using it during the type definition (to resolve
18863         attributes) and during the emit phase.
18864
18865         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
18866         to pull type information out of the attributes
18867
18868         (Attribute.Resolve): track the constructor builder, and allow for
18869         multiple invocations (structs and classes will use this).
18870
18871         * ecore.cs (MemberLookupFinal): new version with all the
18872         parameters customizable.
18873
18874         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
18875         constructors.  Return if the result value is null (as the error
18876         would have been flagged already by MemberLookupFinal)
18877
18878         Do not allow instances of abstract classes or interfaces to be
18879         created.
18880
18881         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
18882         We have to compare the assembly property here when dealing with
18883         FamANDAssem and Assembly access modifiers, because we might be
18884         creating an assembly from *modules* (that means that we are not
18885         getting TypeBuilders for types defined in other modules that are
18886         part of this assembly).
18887
18888         (Method.Emit): If the method is marked abstract and has a body,
18889         emit an error. 
18890
18891         (TypeContainer.DefineMembers): If both the defined member and the
18892         parent name match are methods, then do not emit any warnings: let
18893         the Method.Define routine take care of flagging warnings.  But if
18894         there is a mismatch (method overrides something else, or method is
18895         overriwritten by something, then emit warning).
18896
18897         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
18898         set to null, this means `do not check for the return type on the
18899         signature'. 
18900
18901         (Method.Define): set the return type for the method signature to
18902         null, so that we get methods with the same name and parameters and
18903         different return types.  This is used to flag warning 114 (you are
18904         hiding a method, and you probably want to use the new/override
18905         keywords instead).
18906
18907         * typemanager.cs (MemberLookup): Implemented proper access
18908         control, closing a long standing set of bug reports.  The problem
18909         was that the Framework only has two bits: Public and NonPublic,
18910         and NonPublic includes private and protected methods, but we need
18911         to enforce the FamANDAssem, FamOrAssem and Family. 
18912
18913 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
18914
18915         * statement.cs (GotoCase): Return true: Ammounts to giving up
18916         knowledge on whether we return or not, and letting the other case
18917         be responsible for it.
18918
18919 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
18920
18921         * driver.cs: Do not load directories for each file processed, only
18922         do it if there is a pattern.
18923
18924         * ecore.cs: Report readonly assigns here as well, as we might have
18925         been resolved only by MemberAccess.
18926
18927         (SimpleName.SimpleNameResolve): Also be useful for LValue
18928         resolution.   We need this to propagate assign to local readonly variables
18929
18930         * typemanager.cs: Use a ptrhashtable for the criteria, because we
18931         do not want to reuse potential criteria memory.
18932
18933         * class.cs (MyEventBuilder): Set reflected_type;
18934
18935         * ecore.cs (Constantify): Added support for constifying bools.
18936
18937         (RootContext.LookupType): Added a cache for values looked up in
18938         the declaration space.
18939
18940         * typemanager.cs (FindMembers): Now is a front-end to
18941         RealFindMembers, and provides a two-level hashtable-based cache to
18942         the request.  
18943
18944         15% performance improvement: from 22.5 to 19.2 seconds.
18945
18946         * expression.cs (IsParamsMethodApplicable): use foreach.
18947         (Invocation.DoResolve): ditto.
18948         (New.DoResolve): ditto.
18949         (ArrayCreation.DoResolve): ditto.
18950
18951         * ecore.cs (FindMostEncompassingType): use foreach.
18952
18953         * delegate.cs (NewDelegate.DoResolve): Use foreach
18954
18955         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
18956         (RemoveMethods): use foreach.
18957
18958         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
18959         nested foreach statements instead of for, and also break out of
18960         the inner loop once a match is found.
18961
18962         (Invocation.OverloadResolve): Use foreach, simplify the code. 
18963
18964 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
18965
18966         * cfold.cs (BinaryFold): During an enumeration evaluation context,
18967         we actually unwrap the expression to allow for extra information
18968         to be extracted. 
18969
18970         * expression.cs: Use Shr_Un on unsigned operations. 
18971
18972 2002-05-08  Ravi Pratap  <ravi@ximian.com>
18973
18974         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
18975         applicable operators was not being considered correctly. This closes
18976         the bug Miguel reported.
18977
18978 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
18979
18980         * attribute.cs: check that the type derives from System.Attribute
18981         and report the correct error in that case (moved the duplicate code to
18982         its own method, too).
18983
18984 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
18985
18986         * attribute.cs: lookup attribute type name as the spec says: first the
18987         bare attribute name and then name + "Attribute" (nant compiles with
18988         mcs after this fix).
18989
18990 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
18991
18992         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
18993         Because of the way we parse things, we should try to see if a
18994         UIntConstant can fit in an integer.
18995
18996 2002-05-07  Ravi Pratap  <ravi@ximian.com>
18997
18998         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
18999         when we are in an explicit context.
19000
19001         (ConvertReferenceExplicit): When converting from Iface type S to Class
19002         T make sure the rules are implemented as an OR.
19003
19004         * parameter.cs (ParameterType): Make it a property for now although the
19005         purpose really isn't anything immediate.
19006
19007         * expression.cs (Is*Applicable): Do better checking on the parameter type
19008         of a ref/out parameter. The ones from the system assemblies are already 
19009         marked with the correct type so we don't need to do any correction.
19010
19011         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19012         the object type is standard too so include that.
19013
19014 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19015
19016         * ecore.cs (StandardConversionExists): Augment with missing code:
19017         deal with IntConstant, LongConstants and Enumerations.
19018
19019         * assign.cs: Report the error, instead of failing silently
19020
19021         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19022         typecontainer that they are declared, because the
19023         typecontainer/namespace will have the list of using clauses that
19024         need to be applied.
19025
19026         Assembly Attributes were escaping the normal registration
19027         mechanism. 
19028
19029         (EmitCode): Apply attributes within an EmitContext that represents
19030         the container they were declared on.
19031
19032         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19033
19034 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19035
19036         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19037         Revamp completely - make much cleaner as we now operate only
19038         on a set of Types.
19039
19040         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19041         to implement the logic detailed in the spec more correctly.
19042
19043         (UserDefinedConversion): Update accordingly.
19044
19045 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19046
19047         * statement.cs: Return flow analysis information up.
19048
19049         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19050         and the default.
19051
19052         (token): Do not consume an extra character before calling
19053         decimal_digits.
19054
19055 2002-05-06  Piers Haken <piersh@friskit.com>
19056
19057         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19058
19059 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19060
19061         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19062         EmitContext during the instance constructor initializer
19063         resolution, to stop access to instance variables.
19064
19065         This is mandated by the spec, last paragraph of the `constructor
19066         initializers' section. 
19067
19068 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19069
19070         * cs-parser.jay, class.cs (Accessor): new class used to represent
19071         an accessor (get or set).  In the past we used `null' to represent
19072         a missing accessor.  But this is ambiguous because there was no
19073         way to tell in abstract indexers/properties if one of them was
19074         specified.
19075
19076         Now there is a way of addressing that.
19077
19078         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19079         instead of FindMembers.
19080
19081         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19082         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19083
19084         * attribute.cs: Treat indexers and properties as the same in terms
19085         of applying attributes
19086
19087         * ecore.cs (FindMostEncompassedType): Use statically initialized
19088         EmptyExpressions()s like we do elsewhere to avoid creating useless
19089         objects (and we take this out of the tight loop).
19090
19091         (GetConversionOperators): Move the code to extract the actual
19092         operators to a separate routine to clean things up.
19093
19094 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19095
19096         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19097         events are always registered FieldBuilders.
19098
19099         * class.cs (FieldBase): New class shared by Fields 
19100
19101         * delegate.cs: If we are a toplevel delegate, use our full name.
19102         If we are a nested delegate, then only use our tail name.
19103
19104 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19105
19106         * expression.cs (IsApplicable): Ensure that we add the "&" to
19107         ref/out types before comparing it with the type of the argument.
19108
19109         (IsParamsMethodApplicable): Ditto.
19110
19111         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19112         silly me ;-)
19113
19114         * delegate.cs : Handle the case when we have more than one applicable
19115         method. Flag an error only when we finish checking all.
19116
19117 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19118
19119         * expression.cs: Add support for boolean static initializers.
19120
19121 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19122
19123         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19124
19125         * parameter.cs (ComputeParameterTypes,
19126         ComputeAndDefineParameterTypes): Better error handling: now we
19127         clear the `types' cache if we fail during any of the type lookups.
19128         We also return the status code correctly to our caller
19129
19130         * delegate.cs: If we fail to define a delegate, abort the extra
19131         steps. 
19132
19133         * expression.cs (Binary.ResolveOperator): for
19134         operator==(object,object) and operator !=(object, object) we also
19135         have to verify that there is an implicit conversion from one to
19136         the other.
19137
19138         (ArrayAccess.DoResolve): Array Access can operate on
19139         non-variables. 
19140
19141 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19142
19143         * assign.cs (CompoundAssign): A new class used as a "flag" that
19144         the assignment actually is happening as part of a compound
19145         assignment operator.
19146
19147         During compound assignment, a few new rules exist to enable things
19148         like:
19149
19150         byte b |= 1 + 2
19151
19152         From the spec:
19153
19154         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19155         to the type of x) if y is implicitly convertible to the type of x,
19156         and the operator is a builtin operator and the return type of the
19157         operator is explicitly convertible to the type of x. 
19158
19159         * rootcontext.cs: Reset warning level to 2.  4 catches various
19160         "interesting" features in mcs, we must clean this up at some
19161         point, but currently am trying to kill other bugs ;-)
19162
19163         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19164         in container classes as well.  
19165
19166         * expression.cs (Binary.ResolveOperator): Handle string case
19167         before anything else (as operator overloading does emit an error
19168         before doing anything else).
19169
19170         This code could go away when we move to a table driven model, but
19171         i could not come up with a good plan last night.
19172
19173 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19174
19175         * typemanager.cs (CSharpName): reimplementation using regex.
19176         * class.cs: added null check for fields in Emit
19177         * rootcontext.cs: set warninglevel to 4
19178
19179 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19180
19181         * typemanager.cs (CSharpName): reimplemented with Lupus
19182         suggestion.
19183
19184 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19185
19186         * statement.cs (If): correclty implement Resolve, because we were
19187         not catching sem errors in there.  The same process is needed
19188         everywhere else. 
19189         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19190
19191
19192         (Statement.Warning_DeadCodeFound): Factorize code.
19193         (While): Report dead code here too.
19194
19195         (Statement): Added Resolve virtual method to allow
19196         for resolution split from the emit code.
19197
19198 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19199
19200         * statement.cs (EmitBoolExpression): No longer try to resolve the
19201         expression here.    
19202         (MakeBoolean): New utility function that resolve, implicitly
19203         converts to boolean and tags the expression. 
19204
19205
19206         (If, Do): Implement dead code elimination.
19207         (While): Implement loop inversion
19208
19209         (Do, While, For, If): Resolve the expression prior to calling our
19210         code generation.
19211
19212 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19213
19214         * class.cs:
19215           - added method Report28 (warning: program has more than one entry point)
19216           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19217           - modified method Method.Define, the part at the end of the method
19218
19219         * rootcontext.cs: added static public Location EntryPointLocation;
19220           
19221         * ../errors/cs0028.cs : Add test case for the above warning.              
19222
19223         * typemanager.cs:
19224           - modified method CSharpName to allow arrays of primitive type to
19225             be printed nicely (e.g. instead of System.Int32[][] it now prints
19226             int[][])
19227           - added method CSharpSignature: returns the signature of a method
19228             in string format to be used in reporting errors, warnings, etc.
19229
19230         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19231         with String.Empty.
19232
19233 2002-04-26  Ravi Pratap  <ravi@ximian.com>
19234
19235         * delegate.cs (Define): Fix extremely silly bug where I was
19236         setting the type of the 'object' parameter of the BeginInvoke
19237         method to System.IAsyncResult instead of System.Object ;-)
19238
19239 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19240
19241         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
19242         here. 
19243
19244         (Constructor.Emit): return if we fail to initialize the
19245         constructor.  Another door closed!  
19246
19247         * expression.cs (New.DoResolve): Improve error message (from -6 to
19248         1501).  Use DeclaredOnly lookup to find the exact constructor.
19249
19250         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
19251         loop.  This is useful.
19252
19253         * cs-parser.jay: Adjust the default parameters so that destructors
19254         have the proper signature.
19255
19256 2002-04-26  Martin Baulig  <martin@gnome.org>
19257
19258         * driver.cs (LoadAssembly): If `assembly' contains any characters
19259         which are only valid in path names and not in assembly names
19260         (currently slash, backslash and point), use Assembly.LoadFrom ()
19261         instead of Assembly.Load () on the `assembly' (before iteration
19262         over the link_paths).
19263
19264 2002-04-26  Martin Baulig  <martin@gnome.org>
19265
19266         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
19267
19268 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
19269
19270         * class.cs (Property): use the new typemanager.MemberLookup
19271
19272         (TypeContainer.MemberLookup): Implement using the
19273         TypeManager.MemberLookup now. 
19274
19275         * typemanager.cs: Make MemberLookup a function of the TypeManager,
19276         and return MemberInfos, so that these can be used without an
19277         EmitContext (what we had before).
19278
19279 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
19280
19281         * expression.cs: Fix the case where the argument to params if the
19282         type of the params.  I omitted handling this before.   Fixed
19283
19284 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19285
19286         * driver.cs: Call BootCorlib_PopulateCoreType
19287
19288         * class.cs (Property.CheckBase): Check for properties only, not
19289         for all members. 
19290
19291         * interface.cs: Temporary hack: try/catch around the
19292         CustomAttributeBuilder, because I am getting an exception that I
19293         do not understand.
19294
19295         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
19296         types whose definitions are required to be there (attributes are
19297         defined before standard types).
19298
19299         Compute definitions as we boot the various types, as they are used
19300         immediately (value_type class will need object_type, but if we do
19301         not initialize object_type, we will pass a null, which will let
19302         the runtime pick the System.Object from the existing corlib, which
19303         is not what we want).
19304
19305 2002-04-22  Patrik Torstensson <totte@labs2.com>
19306
19307         * cs-tokenizer.cs: fixed a number of trim() issues.
19308
19309 2002-04-22  Ravi Pratap  <ravi@ximian.com>
19310
19311         * expression.cs (Argument.Type): Ensure that we return the correct
19312         type when we have out or ref parameters [in which case we 
19313         append a "&"].
19314
19315 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
19316
19317         * class.cs (Property, Indexer): Allow extern modifier in there. 
19318
19319         * typemanager.cs (InitBaseTypes): Initializes object_type and
19320         value_type, since those will be used early on during the bootstrap
19321         process to compile corlib.
19322
19323         (InitCoreTypes): Move code from here to InitBaseTypes.
19324
19325 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
19326
19327         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
19328         single-dimension arrays as using the ldlen opcode.  
19329
19330         Daniel Lewis discovered this optimization.  
19331
19332         * typemanager.cs: Add signature for System.Array::get_Length
19333
19334 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19335
19336         * statement.cs: report the error when the foreach does not apply to an
19337         array nor a collection.
19338
19339 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
19340
19341         * expression.cs: Add implicit conversions to the operator ~.
19342
19343         * constant.cs (DecimalConstant.Emit): Emit decimal value.
19344
19345         * typemanager.cs: Locate the decimal constructor.
19346
19347 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19348
19349         * attribute.cs: use the new property of TypeOf.
19350         * expression.cs: added 'get' property around typearg.
19351
19352         These changes fix a build breaker reported by NickD. Is this the
19353         correct way to fix?  If not, please, revert my changes and make it
19354         work :-).
19355
19356 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
19357
19358         * attribute.cs: Add support for typeof in attribute invocations.
19359         I am not sure that this is right though.
19360
19361 2002-04-14  Duncan Mak  <duncan@ximian.com>
19362
19363         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
19364         Binary.Operator.Division case.
19365
19366 2002-04-13  Ravi Pratap  <ravi@ximian.com>
19367
19368         * class.cs (DefineType): Ensure that we do a proper check on
19369         attribute types and also register it with the TypeManager.
19370
19371         (TypeContainer.Targets): The default for attribute types is
19372         AttributeTargets.All.
19373
19374         * attribute.cs (ApplyAttributes): Registering the attribute type
19375         is done elsewhere, not when we discover we have a Usage attribute.
19376
19377 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19378
19379         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
19380         and get rid of is_delegate parameter.
19381
19382         * everywhere : update.
19383
19384 2002-04-12  Ravi Pratap  <ravi@ximian.com>
19385
19386         * cs-parser.jay (compilation_unit): Revamp completely to use
19387         some new ideas that I got from Rhys' grammar to solve the problems
19388         with assembly level attributes.
19389
19390         (outer_declaration): New grammar production.
19391
19392         (attribute_sections): Add.
19393
19394         (opt_attributes): Base on attribute_sections
19395
19396         (namespace_declaration): Allow opt_attributes to tackle the case
19397         when we have assembly level attributes - we are clever in this
19398         regard now ;-)
19399
19400         * attribute.cs (ApplyAttributes): Do not worry about assembly 
19401         attributes in the non-global context.
19402
19403         * rootcontext.cs (AddGlobalAttributes): Go back to using this
19404         instead of SetGlobalAttributes.
19405
19406         * class.cs, rootcontext.cs : Ensure we define and generate 
19407         attribute types before anything else.
19408
19409         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
19410         and flag the new error -20 for the case when the attribute type
19411         does not have valid targets specified. csc does not catch this.
19412
19413         * ../errors/errors.txt : update for error # -20
19414
19415 2002-04-11  Ravi Pratap  <ravi@ximian.com>
19416
19417         * support.cs (InternalParameters.ParameterModifier): Do some null
19418         checking and return sane values.
19419
19420         * class.cs (Method.Define): If we are a PInvoke method, ensure
19421         that we are static and extern. Report error # 601
19422
19423         * ../errors/cs0601.cs : Add test case for the above error.
19424
19425 2002-04-07  Ravi Pratap  <ravi@ximian.com>
19426
19427         * rootcontext.cs (attribute_types): We need to keep type of
19428         all attribute types separately and emit code for them first.
19429
19430         (RegisterAttribute) : Implement.
19431
19432         * class.cs (DefineType): Check if the current Type is a custom
19433         attribute type and register it accordingly.
19434
19435         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
19436         adding the first attribute twice and rename to
19437
19438         (SetGlobalAttributes): this.
19439
19440         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
19441         lookups.
19442
19443         * attribute.cs (ApplyAttributes): Take an additional argument telling us
19444         if we are processing global arguments. Hmm, I am unsure of this.
19445
19446 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19447
19448         * expression.cs: added static array of strings to avoid calling
19449         Enum.ToString () for Operator in Binary. Significant recover of
19450         performance.
19451
19452 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
19453
19454         * class.cs (FindMembers): Allow the Builders of the various
19455         members to be null.  If they are skip them.  This only happens
19456         during the PInvoke declaration.
19457
19458 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
19459
19460         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
19461         failure, so we do not keep going afterwards.
19462
19463         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
19464         wanted to pass `false' as the `is_delegate' argument.  If this is
19465         the case, why not use delegate_type == null to mean `is_delegate =
19466         false' and anything else as is_delegate = true.
19467
19468 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
19469
19470         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
19471         code for the section, not the beginning of the tests.
19472
19473 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
19474
19475         * cfold.cs: Handle operator + (Enum x, Underlying x) 
19476
19477         * expression.cs (Binary): same.  Warn about errors where we have
19478         Enum/Enum in operator + as well.
19479
19480 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
19481
19482         * statement.cs:
19483                 - added support for switch(bool)
19484                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
19485                 - add TableSwitchEmit() to handle table-based switch statements
19486
19487 2002-04-05  Ravi Pratap  <ravi@ximian.com>
19488
19489         * expression.cs (Invocation.OverloadResolve): Factor out code which
19490         does parameter compatibility checking with arguments so that we can 
19491         re-use the code even from Delegate.VerifyApplicability
19492
19493         (VerifyArgumentsCompat): Move above code here.
19494
19495         * delegate.cs (VerifyApplicability): Get rid of duplicate code
19496         and instead make a call to the above method.
19497
19498 2002-03-31  Ravi Pratap  <ravi@ximian.com>
19499
19500         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
19501         We use it to keep track of classes which are attribute types.
19502
19503 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
19504
19505         * delegate.cs (Delegate.Define): Correctly define the types in the
19506         presence of fixed and array parameters.
19507
19508         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
19509         doing FindMembers.
19510
19511         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
19512         include NonPublic after the first iteration.
19513
19514         * class.cs (Indexer.CheckBase): Only check if both parents are
19515         non-null. 
19516
19517         * cs-parser.jay (accessor_body): If empty, set to null.
19518
19519         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
19520         same code path here to resolve constants names that we did have in
19521         MemberAccess.DoResolve.  There is too much code duplicated here.
19522
19523 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
19524
19525         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
19526
19527         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
19528         to MakeUnionSet.
19529
19530         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
19531         tokens, numbers and strings.
19532
19533         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
19534         parenthesis.
19535
19536         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
19537         asyncronous parameters and the regular parameters.  
19538
19539         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
19540         specify the target directory.
19541
19542         * expression.cs: (This.DoResolve): Simplify
19543         (As.Emit): Optimize, do not generate IsInst if the expression is
19544         always of the given type.
19545
19546         (Is.DoResolve): Bug fix, we were reporting both always/never for
19547         the is expression.
19548
19549         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
19550         creating too many unnecessary arrays.
19551
19552 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
19553
19554         * class.cs (EmitFieldInitializer): Use Assign expression to assign
19555         fields instead of rolling our own initializer.   Takes care of all
19556         implicit conversions, and drops unnecessary static checks/argument.
19557
19558 2002-03-31  Dick Porter  <dick@ximian.com>
19559
19560         * driver.cs: use the GetDirectories() return values properly, and
19561         use "/" as path separator.
19562
19563 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
19564
19565         * expression.cs (Unary): Optimize - - expr into expr.
19566         (Binary): Optimize a + (-b) into a -b.
19567
19568         * codegen.cs (CodeGen): Made all methods static.
19569
19570 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
19571
19572         * rootcontext.cs: 
19573
19574         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
19575         TypeBuilder property.
19576
19577         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
19578         instead. 
19579
19580         * tree.cs: Removed the various RecordXXXX, and replaced with a
19581         single RecordDecl.  Removed all the accessor methods, and just
19582         left a single access point Type 
19583
19584         * enum.cs: Rename DefineEnum to DefineType.
19585
19586         * decl.cs: New abstract method `DefineType' used to unify the
19587         Defines for Enumerations, Interfaces, TypeContainers and
19588         Delegates.
19589
19590         (FindType): Moved LookupInterfaceOrClass here.  Moved the
19591         LookupBaseClasses method that used to live in class.cs and
19592         interface.cs here, and renamed to FindType.
19593
19594         * delegate.cs: Implement DefineType.  Take advantage of the
19595         refactored pattern for locating the parent builder without taking
19596         the parent_builder argument (which we know does not work if we are
19597         nested, and triggering a toplevel definition).
19598
19599 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19600
19601         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
19602         accessibility of a member has changed during override and report
19603         an error if so.
19604
19605         * class.cs (Method.Define, Property.Define): Only complain on
19606         overrides if the method is private, any other accessibility is
19607         fine (and since we just checked the permission is the same, we are
19608         good to go).
19609
19610         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
19611         and elif are processed always.  The other pre-processing
19612         directives are only processed if we are "taking" the path
19613
19614 2002-03-29  Martin Baulig  <martin@gnome.org>
19615
19616         * class.cs (Method.Emit): Only emit symbolic debugging info if the
19617         current location is not Null.
19618
19619         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
19620         a separate method so we can profile it.
19621
19622         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
19623         `span.Seconds' are just seconds, but no minutes or hours.
19624         (MainDriver): Profile the CodeGen.SaveSymbols calls.
19625
19626 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19627
19628         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
19629         Remove the gratuitous set of Final:
19630
19631                                 // If an interface implementation, then we can set Final.
19632                                 if (((flags & MethodAttributes.Abstract) == 0) &&
19633                                     implementing.DeclaringType.IsInterface)
19634                                         flags |= MethodAttributes.Final;
19635
19636         I do not know what I was smoking when I used that.
19637
19638
19639         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
19640         step into fixing the name resolution issues for delegates and
19641         unifying the toplevel name resolution.
19642
19643 2002-03-28  Martin Baulig  <martin@gnome.org>
19644
19645         * class.cs (Method.Emit): If we have a symbol writer, call its
19646         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
19647         tell it about the current method.
19648
19649         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
19650         writer that we're going to emit the first byte of IL code for a new
19651         statement (a new source line).
19652         (EmitContext.EmitTopBlock): If we have a symbol writer, call
19653         EmitContext.Mark() before emitting any code.
19654
19655         * location.cs (SymbolDocument): Return null when we're Null.
19656
19657         * statement.cs (Statement): Moved the `Location loc' variable here.
19658         (Statement.EmitBoolExpression): If we have a symbol writer, call
19659         ec.Mark() before emitting any code to tell it that we're at the
19660         beginning of a new statement.
19661         (StatementExpression): Added `Location' argument to the constructor.
19662         (Block): Added public readonly variable `StartLocation' and public
19663         variable `EndLocation'.  The latter is to be set using SetEndLocation().
19664         (Block): Added constructor which takes a start and end location.
19665         (Block.SetEndLocation): New method. This sets the end location.
19666         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
19667         local variables we create.
19668         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
19669         each statement and do also mark the begin and end of the block.
19670
19671         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
19672         tell it the current lexer.Location, use Location.Null for the end of the
19673         block.
19674         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
19675         current block, set its end location using SetEndLocation().
19676         (statement_expression): StatementExpression constructor now takes the
19677         lexer.Location as additional argument.
19678         (for_statement, declare_local_variables): Likewise.
19679         (declare_local_variables): When creating a new implicit block, use the
19680         new Block constructor and pass it the lexer.Location.
19681
19682 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
19683
19684         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
19685         members also on the parent interfaces recursively.
19686
19687 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * report.cs: Use new formats, since Gonzalo finished the missing
19690         bits. 
19691
19692         * expression.cs (Binary.ResolveOperator): added missing operator|
19693         operator& and operator^ for bool/bool.
19694
19695         * cs-parser.jay: CheckDef now takes a Location argument that is
19696         used to report errors more precisly (instead of reporting the end
19697         of a definition, we try to track something which is a lot closer
19698         to the source of the problem).
19699
19700         * cs-tokenizer.cs: Track global token use, so we can properly flag
19701         the use of #define/#undef after the first token has been seen.
19702
19703         Also, rename the reportXXXX to Error_DescriptiveName
19704
19705         * decl.cs (DeclSpace.IsTopLevel): Move property here from
19706         TypeContainer, so that Enum and Interface can use this too.
19707
19708         * class.cs (TypeContainer.LookupInterfaceOrClass,
19709         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
19710         `builder' argument.  Typically this was used to pass the parent
19711         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
19712         the definition).  
19713
19714         The problem is that a nested class could trigger the definition of
19715         a toplevel class, and the builder would be obviously wrong in that
19716         case. 
19717
19718         So we drop this argument, and we compute dynamically the
19719         TypeBuilder/ModuleBuilder (the correct information was available
19720         to us anyways from DeclSpace.Parent)
19721
19722         * interface.cs (Interface.DefineInterface): Drop builder
19723         parameter cleanup like class.cs
19724
19725         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
19726         like class.cs
19727
19728         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
19729         values. 
19730
19731         (Try.Emit): Propagate the returns value from the statement.
19732
19733         (Return.Emit): Even if we are leavning 
19734
19735         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
19736
19737         * modifiers.cs: Fix the computation of MethodAttributes flags.
19738
19739 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
19740
19741         * driver.cs: allow compilation of files that start with '/'.
19742         Add a default case when checking the argument of --target.
19743
19744 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
19745
19746         * interface.cs: Implement the same search algorithm for types in
19747         the interface code.
19748
19749         * delegate.cs: Do not allow multiple definition.
19750
19751         * Recovered ChangeLog that got accidentally amputated
19752
19753         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
19754
19755         * rootcontext.cs: Load manually enum to allow core classes to
19756         contain enumerations.
19757
19758         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
19759         Update to new static methods in TypeManager.
19760
19761         * typemanager.cs (GetMethod, GetConstructor): Use our
19762         implementation of FindMembers to find the members, since during
19763         corlib compilation, the types are TypeBuilders and GetMethod and
19764         GetConstructor do not work.
19765
19766         Make all methods in TypeManager static.
19767
19768         (InitCodeHelpers): Split the functionality from
19769         the InitCodeTypes function.
19770
19771         * driver.cs: Call InitCodeHelpers after we have populated the
19772         types. 
19773
19774         * cs-parser.jay (delegate_declaration): we did not used to compute
19775         the delegate name correctly for void delegates.
19776
19777 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
19778
19779         * rootcontext.cs (RootContext): Init the interface_resolve_order
19780         and type_container_resolve_order always.
19781
19782         (ResolveCore, BootstrapCorlib_ResolveClass,
19783         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
19784         compiler when compiling with --nostdlib
19785
19786         * class.cs (TypeContainer.DefineType): Check that our parent is
19787         not null.  This test is most important when we are bootstraping
19788         the core types.
19789
19790         * codegen.cs: Split out the symbol writing code.
19791
19792 2002-03-25  Martin Baulig  <martin@gnome.org>
19793
19794         * driver.cs (-g): Made -g an alias for --debug.
19795
19796 2002-03-24  Martin Baulig  <martin@gnome.org>
19797
19798         * codegen.cs (SymbolWriter): New public variable. Returns the
19799         current symbol writer.
19800         (CodeGen): Added `bool want_debugging_support' argument to the
19801          constructor. If true, tell the ModuleBuild that we want debugging
19802         support and ask it for the ISymbolWriter.
19803         (Save): If we have a symbol writer, call it's Close() method after
19804         saving the assembly.
19805
19806         * driver.c (--debug): New command line argument to create a
19807         debugger information file.
19808
19809         * location.cs (SymbolDocument): New public property. Returns an
19810         ISymbolDocumentWriter object for the current source file or null
19811         if we don't have a symbol writer.
19812
19813 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
19814
19815         * driver.cs (LoadAssembly): Correctly return when all the paths
19816         have been tried and not before.
19817
19818         * statement.cs (Switch.Emit): return the actual coverage for this
19819         statement (returns/not-returns)
19820
19821         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
19822         switch of the statement if we are the last switch section.  That
19823         kills two problems: try/catch problems (we used to emit an empty
19824         nop at the end) and switch statements where all branches would
19825         return. 
19826
19827 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
19828
19829         * driver.cs: Add default assemblies (the equivalent to the
19830         Microsoft CSC.RSP file)
19831
19832         * cs-tokenizer.cs: When updating `cols and setting it to zero,
19833         also update tokens_seen and set it to false.
19834
19835         * driver.cs: Implement --recurse for Mike.
19836
19837         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
19838         correctly splitting out the paths.
19839
19840 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
19841
19842         * interface.cs (Interface.PopulateProperty): Instead of using
19843         `parent' as the declaration space for the set parameters, use
19844         `this' 
19845
19846         * support.cs (InternalParameters): InternalParameters constructor
19847         takes a DeclSpace instead of a TypeContainer.
19848
19849         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
19850         types are being initialized, load the address of it before calling
19851         the function.  
19852
19853         (New): Provide a mechanism to disable the generation of local
19854         value type temporaries when the caller will be providing us with
19855         an address to store it.
19856
19857         (ArrayCreation.EmitDynamicInitializers): Use it.
19858
19859 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
19860
19861         * expression.cs (Invocation.EmitArguments): Only probe for array
19862         property if there is more than one argument.  Sorry about that.
19863
19864         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
19865         empty param arrays.
19866
19867         * class.cs (Method.LabelParameters): Fix incorrect code path that
19868         prevented the `ParamArrayAttribute' from being applied to the
19869         params attribute.
19870
19871 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
19872
19873         * support.cs (ReflectionParameters): Correctly compute whether the
19874         last argument is a params array.  Fixes the problem with
19875         string.Split ('a')
19876
19877         * typemanager.cs: Make the assemblies array always be non-null
19878         (empty, but non-null)
19879
19880         * tree.cs (RecordDecl): New function that abstracts the recording
19881         of names.  This reports error 101, and provides a pointer to the
19882         previous declaration.  Fixes a crash in the compiler.
19883
19884         * cs-parser.jay (constructor_declaration): Update to new grammar,
19885         and provide a constructor_body that can be empty.
19886
19887 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
19888
19889         * driver.cs: Add support for --resources.
19890
19891         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
19892         Make all types for the various array helper methods be integer.
19893
19894         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
19895         CheckState to ConvCast.
19896
19897         (ConvCast): Now it takes a `checked' state argument, to avoid
19898         depending on the emit context for the conversion, and just using
19899         the resolve time setting.
19900
19901         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
19902         instead of Invocation.EmitArguments.  We do not emit the original
19903         arguments, instead we emit those which have been converted to
19904         unsigned int expressions.
19905
19906         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
19907
19908         * codegen.cs: ditto.
19909
19910         * expression.cs (LocalVariableReference): Drop the use of the
19911         Store function that depended on the variable index.
19912
19913         * statement.cs (VariableInfo): Drop the `Idx' property from this
19914         class, as this is not taking into account the indexes for
19915         temporaries tat we generate during the execution, getting the
19916         indexes wrong.
19917
19918         * class.cs: First emit class initializers, then call the parent
19919         constructor. 
19920
19921         * expression.cs (Binary): Fix opcode emision.
19922         (UnaryMutator.EmitCode): Support checked code generation
19923
19924         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
19925         matches for events for both the Static and Instance scans,
19926         pointing to the same element.   Fix that.
19927
19928 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
19929
19930         * rootcontext.cs (ResolveTree): Always set the
19931         interface_resolve_order, because nested interfaces will be calling
19932         into us.
19933
19934         * class.cs (GetInterfaceOrClass): Track the same resolution
19935         process used by TypeManager.LookupType.  This fixes the nested
19936         type lookups in class declarations (separate path from
19937         LookupType). 
19938
19939         (TypeContainer.DefineType): Also define nested interfaces.
19940         (TypeContainer.RegisterOrder): New public function used to
19941         register the order in which child interfaces need to be closed.
19942
19943         Nested interfaces need to be closed after their parents have been
19944         created. 
19945
19946         * interface.cs (InterfaceAttr): Put all the logic for computing
19947         the interface attribute here. 
19948
19949         (DefineInterface): Register our interface order with the
19950         RootContext or with the TypeContainer depending on the case.
19951
19952 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19953
19954         * cs-parser.jay: rework foreach statement to work with the new
19955         changes to the policy on SimpleNames.
19956
19957         * report.cs: support Stacktrace on warnings as well.
19958
19959         * makefile: drop --unsafe and /unsafe from the compile.
19960
19961 2002-03-13  Ravi Pratap  <ravi@ximian.com>
19962
19963         * ecore.cs (StandardConversionExists): Modify to take an Expression
19964         as the first parameter. Ensure we do null -> reference type conversion
19965         checking.
19966
19967         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
19968         temporary Expression objects.
19969
19970 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
19971
19972         * interface.cs: workaround bug in method overloading resolution
19973         (there is already a bugzilla bug for it).
19974
19975 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
19976
19977         We could also solve this problem by having a separate path for
19978         performing type lookups, instead of DoResolve, we could have a
19979         ResolveType entry point, and only participating pieces of the
19980         production (simplename, deref, array) would implement this. 
19981
19982         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
19983         signal SimpleName to only resolve type names and not attempt to
19984         resolve anything else.
19985
19986         * expression.cs (Cast): Set the flag.
19987
19988         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
19989
19990         * class.cs: Only report 108 if there is no `new' modifier.
19991
19992         * cs-parser.jay: rework foreach statement to work with the new
19993         changes to the policy on SimpleNames.
19994         
19995         * report.cs: support Stacktrace on warnings as well.
19996
19997         * makefile: drop --unsafe and /unsafe from the compile.
19998
19999 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20000
20001         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20002         lookups here, instead of doing that at parse time.  This means
20003         that our grammar will not introduce `LocalVariableReferences' as
20004         expressions at this point.  That solves the problem of code like
20005         this:
20006
20007         class X {
20008            static void Main ()
20009            { int X = 1;
20010             { X x = null }}}
20011
20012         This is only half the fix.  The full fix requires parameters to
20013         also be handled in this way.
20014
20015         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20016         makes the use more obvious of the DeclSpace.  The
20017         ec.TypeContainer.TypeBuilder is now only used to pull the
20018         TypeBuilder for it.
20019
20020         My theory is that I can get rid of the TypeBuilder completely from
20021         the EmitContext, and have typecasts where it is used (from
20022         DeclSpace to where it matters).  
20023
20024         The only pending problem is that the code that implements Aliases
20025         is on TypeContainer, and probably should go in DeclSpace.
20026
20027         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20028         lookups here, instead of doing that at parse time.  This means
20029         that our grammar will not introduce `LocalVariableReferences' as
20030         expressions at this point.  That solves the problem of code like
20031         this:
20032
20033         class X {
20034            static void Main ()
20035            { int X = 1;
20036             { X x = null }}}
20037
20038         This is only half the fix.  The full fix requires parameters to
20039         also be handled in this way.
20040
20041         * class.cs (Property.DefineMethod): When implementing an interface
20042         method, set newslot, when implementing an abstract method, do not
20043         set the flag (before we tried never setting it, or always setting
20044         it, which is the difference).
20045         (Indexer.DefineMethod): same.
20046         (Method.DefineMethod): same.
20047
20048         * ecore.cs: Only set the status used flag if we get back a Field.
20049
20050         * attribute.cs: Temporary hack, so Paolo can keep working.
20051
20052 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20053
20054         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20055         the unmanaged type in the case we have a MarshalAs attribute.
20056
20057         (Resolve): Handle the case when we are parsing the special MarshalAs
20058         attribute [we need to store the unmanaged type to use later]
20059
20060         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20061         MarshalAs Attribute.
20062
20063         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20064         on parameters and accordingly set the marshalling info.
20065
20066 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20067
20068         * class.cs: Optimizing slightly by removing redundant code after
20069         we switched to the `NoTypes' return value.
20070         (Property.DefineMethod): use NoTypes here too.
20071
20072         This fixes the bug I introduced in my last batch of changes.
20073
20074 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20075
20076         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20077
20078         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20079         Enums since those are types too. 
20080
20081         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20082
20083         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20084         thanks to a call during the lookup process.
20085
20086 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20087
20088         * statement.cs (Foreach): Lots of work to accomodate a particular
20089         kind of foreach statement that I had not kept in mind.  It is
20090         possible to have foreachs on classes that provide a GetEnumerator
20091         method that return objects that implement the "pattern" for using
20092         a foreach, there is no need to support GetEnumerator
20093         specifically. 
20094
20095         This is needed to compile nant.
20096
20097         * decl.cs: Only report 114 if the member is not `Finalize' and if
20098         the warning level is at least 2.
20099
20100         * class.cs: Moved the compare function from Method to
20101         MethodSignature. 
20102
20103         (MethodSignature.InheritableMemberSignatureCompare): Add new
20104         filter function that is used to extract inheritable methods from a
20105         class. 
20106
20107         (Method.Define): Use the new `inheritable_method_signature_filter'
20108         delegate
20109
20110         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20111         command. 
20112
20113 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20114
20115         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20116
20117         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20118
20119         * expression.cs: Pass location information to
20120         ConvertImplicitStandard. 
20121
20122         * class.cs: Added debugging code to track return values from
20123         interfaces. 
20124
20125 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20126
20127         * expression.cs (Is.DoResolve): If either side of the `is' is an
20128         interface, do not flag the warning.
20129
20130         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20131         for interfaces
20132
20133         * report.cs: Allow for --fatal to be used with --probe.
20134
20135         * typemanager.cs (NoTypes): Move the definition for the empty Type
20136         array here. 
20137
20138         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20139         properties. 
20140         (TypeContainer.DefineProxy): New function used to proxy to parent
20141         implementations when implementing interfaces.
20142         (TypeContainer.ParentImplements): used to lookup if our parent
20143         implements a public function that is required by an interface.
20144         (TypeContainer.VerifyPendingMethods): Hook this up.
20145
20146         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20147         `modules' and `assemblies' arraylists into arrays.  We only grow
20148         these are the very early start up of the program, so this improves
20149         the speedof LookupType (nicely measured).
20150
20151         * expression.cs (MakeByteBlob): Replaced unsafe code with
20152         BitConverter, as suggested by Paolo.
20153
20154         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20155         folding of string concatenation, but if either side is a string,
20156         and the other is not, then return null, and let the runtime use
20157         the concatenation on the string plus the object (using
20158         `Object.ToString'). 
20159
20160 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20161
20162         Constant Folding has been implemented now.
20163
20164         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20165         the error instead on types that are not supported in one's
20166         complement. 
20167
20168         * constant.cs (Constant and all children): New set of functions to
20169         perform implict and explicit conversions.
20170
20171         * ecore.cs (EnumConstant): Implement the new functions to perform
20172         conversion by proxying to the child expression.
20173
20174         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20175         own separate setting that can not be turned off from the command
20176         line using --unchecked or --checked and is only controlled using
20177         the checked/unchecked statements and expressions.  This setting is
20178         used by the constant folder to flag errors.
20179
20180         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20181         ConstantCheckState as well.   
20182
20183         During Resolve, they also have to flag the state, because the
20184         constant folder runs completely in the Resolve phase.
20185
20186         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20187         well.
20188
20189 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20190
20191         * cfold.cs: New file, this file contains the constant folder.
20192
20193         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20194         argument to track whether we are using the resulting address to
20195         load or store a value and provide better error messages. 
20196
20197         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20198         new AddressOf arguments.
20199
20200         * statement.cs (Foreach.EmitCollectionForeach): Update
20201
20202         * expression.cs (Argument.Emit): Call AddressOf with proper
20203         arguments to track usage.
20204
20205         (New.DoEmit): Call AddressOf with new arguments.
20206
20207         (Unary.Emit): Adjust AddressOf call.
20208
20209 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20210
20211         * cs-parser.jay (member_access): Change the case for pre-defined types
20212         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20213         this suggestion.
20214
20215         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20216         a method body.
20217
20218         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20219         essentially like methods and apply attributes like MethodImplOptions to them too.
20220
20221         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20222         not being null.
20223
20224         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20225         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20226         is the DeclSpace.
20227
20228         * Update code everywhere accordingly.
20229
20230         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20231
20232         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20233
20234 2002-02-28  Ravi Pratap  <ravi@ximian.com>
20235
20236         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
20237         try performing lookups against those instead of jumping straight into using
20238         the 'using' clauses.
20239
20240         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
20241
20242         (LookupType): Perform lookups in implicit parents too.
20243
20244         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
20245         sequence as RootContext.LookupType. 
20246
20247         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
20248         the various cases of namespace lookups into this method.
20249
20250 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20251
20252         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
20253         in positional arguments)
20254
20255         * class.cs (Operator): Update the AllowedModifiers to contain
20256         extern. 
20257
20258         * cs-parser.jay: Update operator declaration to allow for the
20259         operator body to be empty.
20260
20261         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
20262         values. 
20263
20264 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
20265
20266         * class.cs (Method.Emit): Label parameters.
20267
20268         * driver.cs: Return 1 or 0 as the program exit code.
20269
20270 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
20271
20272         * expression.cs: Special case the `null' object when trying to
20273         auto-compute the type, as anything can be explicitly converted to
20274         that. 
20275
20276         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
20277         spotting this Paolo.
20278
20279         (Expression.ImplicitNumericConversion): Perform comparissions of
20280         the type using the underlying type in the case of an enumeration
20281         rather than using the enumeration type for the compare.
20282
20283         Cope with the underlying == type case, which is not possible to
20284         catch before. 
20285
20286         (Expression.ConvertNumericExplicit): Perform comparissions of
20287         the type using the underlying type in the case of an enumeration
20288         rather than using the enumeration type for the compare.
20289
20290         * driver.cs: If the user does not supply an extension, assume .exe
20291
20292         * cs-parser.jay (if_statement): Rewrote so that we can track the
20293         location for the if statement.
20294
20295         * expression.cs (Binary.ConstantFold): Only concat strings when
20296         the operation is "+", not everything ;-)
20297
20298         * statement.cs (Statement.EmitBoolExpression): Take a location
20299         argument. 
20300         (If, While, Do): Track location.
20301
20302         * expression.cs (Binary.ResolveOperator): In the object + string
20303         case, I was missing a call to ConvertImplicit
20304
20305 2002-02-25  Ravi Pratap  <ravi@ximian.com>
20306
20307         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
20308         Location arguments. Ensure we use RootContext.LookupType to do our work
20309         and not try to do a direct Type.GetType and ModuleBuilder.GetType
20310
20311         * interface.cs (PopulateMethod): Handle the type of the parameter being
20312         null gracefully.
20313
20314         * expression.cs (Invocation.BetterFunction): Handle the case when we 
20315         have a params method with no fixed arguments and a call is made with no
20316         arguments.
20317
20318 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
20321         the verbatim-string-literal
20322
20323         * support.cs (InternalParameters.ParameterModifier): handle null
20324         fixed parameters.
20325         (InternalParameters.ParameterType): ditto.
20326
20327         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
20328         duplicating the name of the variable parameter.
20329         (GetParameterByName): Fix bug where we were not looking up array
20330         paramters if they were the only present (thanks Paolo!).
20331         (GetParameterInfo): We only have an empty set of types if both
20332         fixed and array are set to null.
20333         (GetParameterInfo-idx): Handle FixedParameter == null
20334
20335         * cs-parser.jay: Handle the case where there is no catch
20336         statements (missing null test).
20337
20338 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
20339
20340         * driver.cs (MainDriver): Be conservative on our command line
20341         handling.
20342
20343         Catch DirectoryNotFoundException when calling GetFiles.
20344
20345         (SplitPathAndPattern): Used to split the input specification into
20346         a path and a pattern that we can feed to Directory.GetFiles.
20347
20348 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
20349
20350         * statement.cs (Fixed): Implement the last case of the Fixed
20351         statement (string handling).
20352
20353         * expression.cs (StringPtr): New class used to return a char * to
20354         a string;  Used by the Fixed statement.
20355
20356         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
20357
20358         * expression.cs (Binary.ResolveOperator): Remove redundant
20359         MemberLookup pn parent type.
20360         Optimize union call, we do not need a union if the types are the same.
20361         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
20362         type.
20363
20364         Specialize the use of MemberLookup everywhere, instead of using
20365         the default settings. 
20366
20367         (StackAlloc): Implement stackalloc keyword.
20368
20369         * cs-parser.jay: Add rule to parse stackalloc.
20370
20371         * driver.cs: Handle /h, /help, /?
20372
20373         * expression.cs (MakeByteBlob): Removed the hacks we had in place
20374         before we supported unsafe code.
20375
20376         * makefile: add --unsafe to the self compilation of mcs.
20377
20378 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
20379
20380         * expression.cs (PointerArithmetic): New class that is used to
20381         perform pointer arithmetic.
20382         (Binary.Resolve): Handle pointer arithmetic
20383         Handle pointer comparission.
20384         (ArrayPtr): Utility expression class that is used to take the
20385         address of an array.
20386
20387         (ElementAccess): Implement array access for pointers
20388
20389         * statement.cs (Fixed): Implement fixed statement for arrays, we
20390         are missing one more case before we are done.
20391
20392         * expression.cs (Indirection): Implement EmitAssign and set the
20393         ExprClass to Variable.  This allows pointer dereferences to be
20394         treated as variables, and to have values assigned to them.
20395
20396         * ecore.cs (Expression.StoreFromPtr): New utility function to
20397         store values dereferencing.
20398
20399 2002-02-20  Ravi Pratap  <ravi@ximian.com>
20400
20401         * expression.cs (Binary.ResolveOperator): Ensure that we are
20402         not trying to operate on a void type - this fixes the reported
20403         bug.
20404
20405         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
20406         the parent implementation is sealed.
20407
20408         * ../errors/cs0239.cs : Add.
20409
20410         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
20411
20412         * typemanager.cs (unverifiable_code_type): Corresponds to 
20413         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
20414         which have unsafe code in them.
20415
20416         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
20417         unsafe context.
20418
20419 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
20420
20421         * cs-tokenizer.cs: Add support for @"litreal strings"
20422
20423         Make tokenizer accept pre-processor directives
20424         on any column (remove the old C-like limitation). 
20425
20426         * rootcontext.cs (EmitCode): Emit any global attributes.
20427         (AddGlobalAttributes): Used to keep track of assembly attributes. 
20428
20429         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
20430
20431         * cs-parser.jay: Add support for global attributes.  
20432
20433 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
20434
20435         * expression.cs (Indirection): New helper class.  Unary will
20436         create Indirection classes to be able to implement the
20437         IMemoryLocation interface on it.
20438
20439 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
20440
20441         * cs-parser.jay (fixed_statement): reference the right statement.
20442
20443         * statement.cs (Fixed.Emit): Finish implementing the fixed
20444         statement for the &x case.
20445
20446 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
20447
20448         * class.cs (Property.Define, Method.Define): Remove newslot when
20449         `implementing'.  
20450
20451         * modifiers.cs: My use of NewSlot when `Abstract' was set was
20452         wrong.  NewSlot should only be used if the `new' keyword is present.
20453
20454         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
20455         locating our system dir.  Sorry about this.
20456
20457 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20458
20459         * driver.cs (GetSystemDir): Compute correctly the location of our
20460         system assemblies.  I was using the compiler directory instead of
20461         the library directory.
20462
20463 2002-02-13  Ravi Pratap  <ravi@ximian.com>
20464
20465         * expression.cs (BetterFunction): Put back in what Miguel commented out
20466         since it is the correct fix. The problem is elsewhere ;-)
20467
20468         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
20469         parameters of the parms method are themselves compatible or not !
20470
20471         (StandardConversionExists): Fix very dangerous bug where we were forgetting
20472         to check that a class implements an interface before saying that an implicit
20473         conversion was allowed. Use ImplementsInterface to do the checking.
20474
20475 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
20476
20477         * class.cs (Method.Define): Track whether we are an explicit
20478         implementation or not.  And only call DefineMethodOverride if we
20479         are an explicit implementation.
20480
20481         (Property.DefineMethod): Ditto.
20482
20483 2002-02-11  Ravi Pratap  <ravi@ximian.com>
20484
20485         * expression.cs (BetterFunction): Catch hideous bug which was
20486          preventing us from detecting ambiguous calls due to implicit casts i.e
20487         cs0121.
20488
20489 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
20490
20491         * support.cs (Pair): Remove un-needed method.  I figured why I was
20492         getting the error in cs-parser.jay, the variable in a foreach loop
20493         is readonly, and the compiler does not really treat this as a variable.
20494
20495         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
20496         instead of EQUALS in grammar.  
20497
20498         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
20499
20500         * expression.cs (Unary.DoResolve): Check whether the argument is
20501         managed or not.
20502
20503 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
20504
20505         * support.cs: Api for Pair to set a value.  Despite the fact that
20506         the variables are public the MS C# compiler refuses to compile
20507         code that accesses the field if the variable is part of a foreach
20508         statement. 
20509
20510         * statement.cs (Fixed): Begin implementation of the fixed
20511         statement.
20512
20513         (Block.AddVariable): Return the VariableInfo on success and null
20514         on failure instead of true/false. 
20515
20516         * cs-parser.jay (foreach): Catch errors on variables already
20517         defined (we were ignoring this value before) and properly unwind
20518         the block hierarchy
20519
20520         (fixed_statement): grammar for the fixed statement.
20521
20522 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
20523
20524         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
20525         pointer types to be incretemented.
20526
20527         (SizeOf): Implement.
20528
20529         * cs-parser.jay (pointer_member_access): Implement
20530         expr->IDENTIFIER production.
20531
20532         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
20533         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
20534         on safe contexts.
20535
20536         (Unary): Implement indirection.
20537
20538         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
20539         use in non-unsafe context).
20540
20541         (SimpleName.DoResolve): Check for pointers in field access on safe
20542         contexts. 
20543
20544         (Expression.LoadFromPtr): Factor the load-indirect code in this
20545         function.  This was duplicated in UnboxCast and ParameterReference
20546
20547 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
20548
20549         * expression.cs (ComposedCast): report an error if a pointer cast
20550         is used in a safe region.
20551
20552         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
20553         pointer type casts in unsafe context.
20554
20555         * codegen.cs (EmitContext): Set up IsUnsafe.
20556
20557         * cs-parser.jay (non_expression_type): Add productions for pointer
20558         casts. 
20559
20560         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
20561         code.  We should not use force into static mode if the method is
20562         not virtual.  Fixes bug in MIS
20563
20564         * statement.cs (Do.Emit, While.Emit, For.Emit,
20565         Statement.EmitBoolExpression): Add support to Do and While to
20566         propagate infinite loop as `I do return' semantics.
20567
20568         Improve the For case to also test for boolean constants.
20569
20570         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
20571         to the list of attributes we can add.
20572
20573         Remove `EmitContext' argument.
20574
20575         * class.cs (Method.Define): Apply parameter attributes.
20576         (Constructor.Define): Apply parameter attributes.
20577         (MethodCore.LabelParameters): Move here the core of labeling
20578         parameters. 
20579
20580         * support.cs (ReflectionParameters.ParameterModifier,
20581         InternalParameters.ParameterModifier): Use IsByRef on the type and
20582         only return the OUT bit for these parameters instead of in/out/ref
20583         flags.
20584
20585         This is because I miss-understood things.  The ParameterInfo.IsIn
20586         and IsOut represent whether the parameter has the [In] and [Out]
20587         attributes set.  
20588
20589 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
20590
20591         * ecore.cs (FieldExpr.Emit): Release temporaries.
20592
20593         * assign.cs (LocalTemporary.Release): new function.
20594
20595         * codegen.cs (EmitContext.GetTemporaryStorage,
20596         EmitContext.FreeTemporaryStorage): Rework the way we deal with
20597         temporary storage.  Now we can "put back" localbuilders when we
20598         are done with them
20599
20600 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
20601
20602         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
20603         need to make a copy of the variable to generate verifiable code.
20604
20605 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
20606
20607         * driver.cs: Compute dynamically the system directory.
20608
20609         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
20610         Slower, but more generally useful.  Used by the abstract
20611         registering implementation. 
20612
20613         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
20614         the rules for the special rule on Type/instances.  First check if
20615         we have the same name, and if so, try that special static path
20616         rather than the instance path.
20617
20618 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
20619
20620         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
20621         for, while and if.
20622
20623         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
20624         Enum, ValueType, Delegate or Array for non-corlib compiles.
20625
20626         * cs-tokenizer.cs: Catch long identifiers (645)
20627
20628         * typemanager.cs (IndexerPropetyName): Ravi never tested this
20629         piece of code.
20630
20631         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
20632         fix, we were returning too early, so we were not registering
20633         pending methods from abstract classes.
20634
20635         Do not register pending methods if the class is abstract.
20636
20637         * expression.cs (Conditional.DoResolve): Report circular implicit
20638         conversions when we neecd to compute it for conditional
20639         expressions. 
20640
20641         (Is.DoResolve): If the expression is always of the provided type,
20642         flag warning 183.  If the expression can not ever be of the
20643         provided type flag warning 184.
20644
20645         * class.cs: Catch 169 as well.
20646
20647         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
20648         read. 
20649
20650 2002-01-18  Nick Drochak  <ndrochak@gol.com>
20651
20652         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
20653
20654 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
20655
20656         * interface.cs: (PopulateMethod): Check for pointers being defined
20657         only if the unsafe context is active.
20658         (PopulateProperty): ditto.
20659         (PopulateIndexer): ditto.
20660
20661         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
20662         specified.  If pointers are present, make sure that they are
20663         present in an unsafe context.
20664         (Constructor, Constructor.Define): ditto.
20665         (Field, Field.Define): ditto.
20666         (Property, Property.Define): ditto.
20667         (Event, Event.Define): ditto.
20668
20669         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
20670         hashtable if there are classes or structs defined.
20671
20672         * expression.cs (LocalVariableReference.DoResolve): Simplify this
20673         code, as the constant resolution moved.
20674
20675         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
20676         the metadata, so we can flag error 133. 
20677
20678         * decl.cs (MemberCore.UnsafeOK): New function to test that a
20679         pointer is being declared in an unsafe context.
20680
20681 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
20682
20683         * modifiers.cs (Modifiers.Check): Require a Location argument.
20684         Report error 227 for Unsafe use.
20685
20686         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
20687
20688         * statement.cs (For.Emit): If the test is null, then report that
20689         we do `return', as we wont reach anything afterwards.
20690
20691         (Switch.SwitchGoverningType): Track the expression that matched
20692         the conversion.
20693
20694         * driver.cs: Allow negative numbers as an error code to flag.
20695
20696         * cs-parser.jay: Handle 1551.
20697
20698         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
20699
20700 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20701
20702         * cs-parser.jay: Report 1518 (type declaration can only contain
20703         class, struct, interface, enum or delegate)
20704
20705         (switch_label): Report 1523 (keywords `case' or `default' must
20706         preced code)
20707
20708         (opt_switch_sections): Report 1522 (empty switch)
20709
20710         * driver.cs: Report 1515 (response file specified multiple times)
20711         Report 1516 (Source file specified multiple times).
20712
20713         * expression.cs (Argument.Resolve): Signal 1510
20714
20715         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
20716         access not allowed in static code)
20717
20718 2002-01-11  Ravi Pratap  <ravi@ximian.com>
20719
20720         * typemanager.cs (IsPointerType): Utility method which we are going
20721         to need a lot.
20722
20723         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
20724         the object type, so we take care of that.
20725
20726         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
20727
20728         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
20729         added to non-params parameters :-)
20730
20731         * typemanager.cs (CSharpName): Include 'void' type too. 
20732
20733         (void_ptr_type): Include in the set of core types.
20734
20735         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
20736         duplicating code.
20737
20738         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
20739         an unsafe context.
20740
20741         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
20742         completely forgotten about it.
20743
20744 2002-01-10  Ravi Pratap  <ravi@ximian.com>
20745
20746         * cs-parser.jay (pointer_type): Add. This begins our implementation
20747         of parsing rules for unsafe code.
20748
20749         (unsafe_statement): Implement.
20750
20751         (embedded_statement): Modify to include the above.
20752
20753         * statement.cs (Unsafe): Implement new class for unsafe blocks.
20754
20755         * codegen.cs (EmitContext.InUnsafe): Add. This determines
20756         if the current context is an unsafe one.
20757
20758         * cs-parser.jay (local_variable_pointer_type): Since local variable types
20759         are handled differently, we need separate rules for them.
20760
20761         (local_variable_declaration): Update to use local_variable_pointer_type
20762         to allow variable declarations of unmanaged pointer types.
20763
20764         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
20765         in unsafe contexts.
20766
20767         * ../errors/cs0214.cs : Add.
20768
20769 2002-01-16  Nick Drochak  <ndrochak@gol.com>
20770
20771         * makefile: remove 'response' file when cleaning.
20772
20773 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
20774
20775         * cs-parser.jay: Report 1524.
20776
20777 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * typemanager.cs (RegisterMethod): drop checking if we have
20780         registered this from here
20781
20782 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
20783
20784         * class.cs (Method.EmitDestructor): Implement calling our base
20785         destructor. 
20786
20787         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
20788         value of InFinally.
20789
20790         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
20791         this routine and will wrap the call in a try/catch block.  Deal
20792         with the case.
20793
20794 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
20795
20796         * ecore.cs (Expression.MemberLookup): instead of taking a
20797         parameter `same_type' that was used to tell whether we could
20798         access private members we compute our containing type from the
20799         EmitContext.
20800
20801         (FieldExpr): Added partial support for volatile fields.  This does
20802         not work for volatile fields exposed from assemblies, as I can not
20803         figure out how to extract the modreq from it.
20804
20805         Updated all the source files to use this.
20806
20807         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
20808         because it is referenced by MemberLookup very often. 
20809
20810 2002-01-09  Ravi Pratap  <ravi@ximian.com>
20811
20812         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
20813         TypeBuilder.GetCustomAttributes to retrieve what we need.
20814
20815         Get rid of redundant default_member_attr_type as this is the same as
20816         default_member_type which already exists.
20817
20818         * interface.cs, attribute.cs : Update accordingly.
20819
20820 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
20821
20822         * typemanager.cs: Enable IndexerPropertyName again.  It does not
20823         work for TYpeBuilders though.  Ravi, can you please fix this?
20824
20825         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
20826
20827         * expression.cs (Argument.Emit): Handle the case of ref objects
20828         being passed to ref functions;  
20829
20830         (ParameterReference.EmitLoad): Loads the content of the pointer
20831         without dereferencing.
20832
20833 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20834
20835         * cs-tokenizer.cs: Implemented the pre-processing expressions.
20836
20837 2002-01-08  Ravi Pratap  <ravi@ximian.com>
20838
20839         * class.cs (Indexer.DefineMethod): Incorporate the interface
20840         type in the name of the method if we are doing explicit interface
20841         implementation.
20842
20843         * expression.cs (ConversionExists): Remove as it is completely obsolete.
20844
20845         (BetterConversion): Fix extremely trivial bug where we were referring to
20846         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
20847         again !
20848
20849         * ../errors/bug16.cs : Add although we have fixed it.
20850
20851 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
20852
20853         * expression.cs (BaseIndexer): Begin implementation.
20854
20855         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
20856
20857         * cs-parser.jay (indexer_declarator): Use qualified_identifier
20858         production directly to remove a shift/reduce, and implement
20859         explicit interface implementation.
20860
20861         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
20862         after a floating point suffix.
20863
20864         * expression.cs (DoNumericPromotions): Improved the conversion for
20865         uint/uint.  If we have a constant, we avoid doing a typecast to a
20866         larger type.
20867
20868         * class.cs (Indexer): Implement explicit interface implementation
20869         for indexers.
20870
20871 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
20872
20873         * class.cs: make the default instance constructor public and hidebysig.
20874
20875 2001-01-03  Ravi Pratap  <ravi@ximian.com>
20876
20877         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
20878         so we can call it from elsewhere.
20879
20880         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
20881         we emit it internally if the class has a defined indexer; otherwise the user
20882         emits it by decorating the class definition with the DefaultMemberAttribute.
20883
20884         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
20885         attribute is not used on a type which defines an indexer.
20886
20887         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
20888         character when we skip whitespace.
20889
20890         * ../errors/cs0646.cs : Add.
20891
20892 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
20893
20894         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
20895         again. 
20896
20897         * makefile: Add practical target `mcs3.exe' which builds the third
20898         generation compiler. 
20899
20900         * expression.cs (New): Fix structures constructor calling.
20901
20902         * class.cs (Property, Method, Indexer): Emit Final flag on the
20903         method if we are an interface implementation and we are not
20904         abstract. 
20905
20906         * ecore.cs (PropertyExpr): New public field `IsBase', tells
20907         whether this property is referencing a `base' method.
20908
20909         * expression.cs (Invocation.EmitCall): take an extra argument:
20910         is_base, this is used to determine whether the `call' or
20911         `callvirt' opcode should be used.
20912
20913
20914         * delegate.cs: update EmitCall.
20915
20916         * class.cs (Method.Define): Set NewSlot for the cases where we are
20917         not implementing an interface method.
20918
20919         (Property.Define): ditto.
20920
20921 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
20922
20923         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
20924         'r'.  Allows mcs to parse itself fully.
20925
20926 2002-01-02  Ravi Pratap  <ravi@ximian.com>
20927
20928         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
20929         of the number of initializers that require the InitializeArray method.
20930
20931         (CheckIndices): Store the Expression in all cases - not the plain value. Also
20932         update the above field where necessary.
20933
20934         (MakeByteBlob): Update accordingly.
20935
20936         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
20937         greater than 2.
20938
20939         (EmitDynamicInitializers): Update in accordance with the new optimization.
20940
20941         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
20942         same OpCode applies.
20943
20944         * cs-parser.jay : Fix some glaring errors I introduced.
20945
20946 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
20947
20948         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
20949         so that we can check for name clashes there too.
20950
20951         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
20952         for interface indexers.
20953
20954         * interfaces.cs (Define): Emit the default member attribute.
20955
20956         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
20957         variable was being referred to while setting the value ;-)
20958
20959 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
20960
20961         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
20962         byte-by-byte information when we know the data is zero.
20963
20964         Make the block always a multiple of 4, because
20965         DefineInitializedData has a bug.
20966
20967         * assign.cs: Fix, we should assign from the temporary, not from
20968         the source. 
20969
20970         * expression.cs (MakeByteBlob): Fix my incorrect code.
20971
20972 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
20973
20974         * typemanager.cs (EnumToUnderlying): This function is used to get
20975         the underlying type from an enumeration, because it does not
20976         always work. 
20977
20978         * constant.cs: Use the I4_S form for values between -128 and 127.
20979
20980         * statement.cs (Block.LookupLabel): Looks up a label.
20981         (Block): Drop support for labeled blocks.
20982
20983         (LabeledStatement): New kind of statement that represents a label
20984         only.
20985
20986         (Goto): Finally implement this bad boy.
20987
20988         * cs-parser.jay: Update to reflect new mechanism to implement
20989         labels.
20990
20991 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
20992
20993         * codegen.cs (EmitContext.This): a codegen property that keeps the
20994         a single instance of this instead of creating many different this
20995         instances. 
20996
20997         * delegate.cs (Delegate.DoResolve): Update to use the property;
20998
20999         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21000
21001         * expression.cs (BaseAccess.DoResolve): Ditto.
21002
21003 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21004
21005         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21006         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21007
21008         (InitCoreTypes): Update accordingly.
21009
21010         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21011         so we can quickly store the state.
21012
21013         (ApplyAttributes): Set the correct implementation flags
21014         for InternalCall methods.
21015
21016 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21017
21018         * expression.cs (EmitCall): if a method is not virtual, then do
21019         not use callvirt on it.
21020
21021         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21022         user defined stuff) requires the use of stobj, which takes an
21023         address on the stack instead of an array and an index.  So emit
21024         the Ldelema operation for it.
21025
21026         (EmitStoreOpcode): Use stobj for valuetypes.
21027
21028         (UnaryMutator.EmitCode): Use the right 1 value depending on
21029         whether we are dealing with int64/uint64, float or doubles.
21030
21031         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21032         constructors that I implemented last night.
21033
21034         (Constructor.IsDefault): Fix to work properly for static
21035         constructors.
21036
21037         * cs-parser.jay (CheckDef): report method signature errors.
21038         Update error number 103 to be 132.
21039
21040         * decl.cs: New AdditionResult enumeration value: MethodExists.
21041         Although we do this check for methods later on in the semantic
21042         analysis, catching repeated default constructors is so easy that
21043         we catch these here. 
21044
21045         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21046         promotions code.
21047
21048         (ParameterReference.EmitAssign, Emit): handle
21049         bools as bytes.
21050
21051         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21052         (ArrayAccess.EmitStoreOpcode): ditto.
21053
21054         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21055
21056         * expression.cs (MakeByteBlob): Complete all the missing types
21057         (uint, short, ushort, byte, sbyte)
21058
21059         * class.cs: Only init instance field initializers on instance
21060         constructors. 
21061
21062         Rename `constructors' to instance_constructors. 
21063
21064         (TypeContainer.AddConstructor): Only add constructors to the list
21065         if it is not static.
21066
21067         Make sure that we handle default_static_constructor independently
21068         everywhere where we handle instance_constructors
21069
21070 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21071
21072         * class.cs: Do not lookup or create a base initializer for a
21073         static constructor.
21074
21075         (ConstructorInitializer.Resolve): use the proper type to lookup
21076         for constructors.
21077
21078         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21079
21080         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21081         in DeclSpace. 
21082
21083         * decl.cs: CloseType is now an virtual method, the default
21084         implementation just closes this type.
21085
21086 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21087
21088         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21089         to PreserveSig by default. Also emit HideBySig on such methods.
21090
21091         Basically, set the defaults to standard values.
21092
21093         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21094         argument, if candidate is better, it can't be worse than the best !
21095
21096         (Invocation): Re-write bits to differentiate between methods being
21097         applicable in their expanded form and their normal form - for params
21098         methods of course.
21099
21100         Get rid of use_standard everywhere as only standard conversions are allowed
21101         in overload resolution. 
21102
21103         More spec conformance.
21104
21105 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21106
21107         * driver.cs: Add --timestamp, to see where the compiler spends
21108         most of its time.
21109
21110         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21111         `this' in static code.
21112
21113         (SimpleName.DoResolve): Implement in terms of a helper function
21114         that allows static-references to be passed upstream to
21115         MemberAccess.
21116
21117         (Expression.ResolveWithSimpleName): Resolve specially simple
21118         names when called by MemberAccess to implement the special
21119         semantics. 
21120
21121         (Expression.ImplicitReferenceConversion): Handle conversions from
21122         Null to reference types before others, as Null's type is
21123         System.Object. 
21124
21125         * expression.cs (Invocation.EmitCall): Handle the special case of
21126         calling methods declared on a reference type from a ValueType
21127         (Base classes System.Object and System.Enum)
21128
21129         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21130         the left hand side is a TypeExpr, not on every enumeration. 
21131
21132         (Binary.Resolve): If types are reference types, then do a cast to
21133         object on operators != and == of both arguments.
21134
21135         * typemanager.cs (FindMembers): Extract instance and static
21136         members if requested.
21137
21138         * interface.cs (PopulateProperty): Use void_type instead of null
21139         as the return type for the setter method.
21140
21141         (PopulateIndexer): ditto.
21142
21143 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21144
21145         * support.cs (ReflectionParameters): Fix minor bug where we
21146         were examining the wrong parameter for the ParamArray attribute.
21147
21148         Cope with requests for the type of the parameter at position
21149         greater than the params parameter's. We now return the element
21150         type of the params array as that makes more sense.
21151
21152         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21153         accordingly as we no longer have to extract the element type
21154         ourselves.
21155
21156         (Invocation.OverloadResolve): Update.
21157
21158 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21159
21160         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21161         against IEnumerator, test whether the return value is a descendant
21162         of the IEnumerator interface.
21163
21164         * class.cs (Indexer.Define): Use an auxiliary method to implement
21165         the other bits of the method definition.  Begin support for
21166         explicit interface implementation.
21167
21168         (Property.DefineMethod): Use TypeManager.void_type instead of null
21169         for an empty return value.
21170
21171 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21172
21173         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21174         dealing with a FieldExpr which is composed of a FieldBuilder, in
21175         the code path we did extract the constant, but we should have
21176         obtained the underlying value to be able to cast it (otherwise we
21177         end up in an infinite loop, this is what Ravi was running into).
21178
21179         (ArrayCreation.UpdateIndices): Arrays might be empty.
21180
21181         (MemberAccess.ResolveMemberAccess): Add support for section
21182         14.5.4.1 that deals with the special case of E.I when E is a type
21183         and something else, that I can be a reference to a static member.
21184
21185         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21186         handle a particular array type to create byte blobs, it is just
21187         something we dont generate byteblobs for.
21188
21189         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21190         arguments. 
21191
21192         * location.cs (Push): remove the key from the hashtable that we
21193         are about to add.   This happens for empty files.
21194
21195         * driver.cs: Dispose files after we have parsed them.
21196
21197         (tokenize): new function that only runs the tokenizer on its
21198         input, for speed testing.
21199
21200 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21201
21202         * class.cs (Event.Define): Define the private field only if there
21203         are no accessors defined.
21204
21205         * expression.cs (ResolveMemberAccess): If there is no associated
21206         field with the event, that means we have an event defined with its
21207         own accessors and we should flag error cs0070 since transforming
21208         ourselves into a field is not valid in that case.
21209
21210         * ecore.cs (SimpleName.DoResolve): Same as above.
21211
21212         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21213         and charset to sane values.
21214
21215 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21216
21217         * assign.cs (DoResolve): Perform check on events only if they 
21218         are being accessed outside the declaring type.
21219
21220         * cs-parser.jay (event_declarations): Update rules to correctly
21221         set the type of the implicit parameter etc.
21222
21223         (add_accessor, remove_accessor): Set current local parameters.
21224
21225         * expression.cs (Binary): For delegate addition and subtraction,
21226         cast the return value from the method into the appropriate delegate
21227         type.
21228
21229 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21230
21231         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21232         of these as the workaround is unnecessary.
21233
21234         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
21235         delegate data - none of that is needed at all.
21236
21237         Re-write bits to extract the instance expression and the delegate method
21238         correctly.
21239
21240         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
21241         on delegates too.
21242
21243         * attribute.cs (ApplyAttributes): New method to take care of common tasks
21244         of attaching attributes instead of duplicating code everywhere.
21245
21246         * everywhere : Update code to do attribute emission using the above method.
21247
21248 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21249
21250         * expression.cs (IsParamsMethodApplicable): if there are not
21251         parameters, return immediately.
21252
21253         * ecore.cs: The 0 literal can be implicity converted to an enum
21254         type. 
21255
21256         (SimpleName.DoResolve): First lookup the type, then lookup the
21257         members. 
21258
21259         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
21260         want to get its address.  If the InstanceExpression is not
21261         addressable, store the result in a temporary variable, then get
21262         the address of it.
21263
21264         * codegen.cs: Only display 219 errors on warning level or above. 
21265
21266         * expression.cs (ArrayAccess): Make it implement the
21267         IMemoryLocation interface.
21268
21269         (Binary.DoResolve): handle the operator == (object a, object b)
21270         and operator != (object a, object b) without incurring into a
21271         BoxedCast (because 5 != o should never be performed).
21272
21273         Handle binary enumerator operators.
21274
21275         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
21276         value type, otherwise use Ldelem_ref.
21277
21278         Use precomputed names;
21279
21280         (AddressOf): Implement address of
21281
21282         * cs-parser.jay (labeled_statement): Fix recursive block
21283         addition by reworking the production.
21284
21285         * expression.cs (New.DoEmit): New has a special case:
21286                 
21287                  If we are dealing with a ValueType, we have a few
21288                  situations to deal with:
21289                 
21290                     * The target of New is a ValueType variable, that is
21291                       easy, we just pass this as the variable reference
21292                 
21293                     * The target of New is being passed as an argument,
21294                       to a boxing operation or a function that takes a
21295                       ValueType.
21296                 
21297                       In this case, we need to create a temporary variable
21298                       that is the argument of New.
21299
21300
21301 2001-12-23  Ravi Pratap  <ravi@ximian.com>
21302
21303         * rootcontext.cs (LookupType): Check that current_type is not null before
21304         going about looking at nested types.
21305
21306         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
21307         not implement the IAssignMethod interface any more.
21308
21309         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
21310         where we tranform them into FieldExprs if they are being resolved from within
21311         the declaring type.
21312
21313         * ecore.cs (SimpleName.DoResolve): Do the same here.
21314
21315         * assign.cs (DoResolve, Emit): Clean up code considerably. 
21316
21317         * ../errors/bug10.cs : Add.
21318
21319         * ../errors/cs0070.cs : Add.
21320
21321         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
21322
21323         * assign.cs : Get rid of EventIsLocal everywhere.
21324
21325 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
21326
21327         * ecore.cs (ConvertIntLiteral): finished the implementation.
21328
21329         * statement.cs (SwitchLabel): Convert the value we are using as a
21330         key before looking up the table.
21331
21332 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21333
21334         * codegen.cs (EmitTopBlock): Require a Location argument now.
21335
21336         * cs-parser.jay (constructor_declarator): We need to setup
21337         current_local_parameters before we parse the
21338         opt_constructor_initializer, to allow the variables to be bound
21339         to the constructor arguments.
21340
21341         * rootcontext.cs (LookupType): First lookup nested classes in our
21342         class and our parents before we go looking outside our class.
21343
21344         * expression.cs (ConstantFold): Extract/debox the values at the
21345         beginnning. 
21346
21347         * rootcontext.cs (EmitCode): Resolve the constants first before we
21348         resolve the types.  This is not really needed, but it helps debugging.
21349
21350         * statement.cs: report location.
21351
21352         * cs-parser.jay: pass location to throw statement.
21353
21354         * driver.cs: Small bug fix.
21355
21356         * report.cs: Updated format to be 4-zero filled digits.
21357
21358 2001-12-22  Ravi Pratap  <ravi@ximian.com>
21359
21360         * expression.cs (CheckIndices): Fix minor bug where the wrong
21361         variable was being referred to ;-)
21362
21363         (DoEmit): Do not call EmitStaticInitializers when the 
21364         underlying type is System.Object.
21365
21366 2001-12-21  Ravi Pratap  <ravi@ximian.com>
21367
21368         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
21369         and do the usual workaround for SRE.
21370
21371         * class.cs (MyEventBuilder.EventType): New member to get at the type
21372         of the event, quickly.
21373
21374         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
21375
21376         * assign.cs (Assign.DoResolve): Handle the case when the target
21377         is an EventExpr and perform the necessary checks.
21378
21379         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
21380         interface.
21381
21382         (SimpleName.MemberStaticCheck): Include check for EventExpr.
21383
21384         (EventExpr): Set the type in the constructor itself since we 
21385         are meant to be born fully resolved.
21386
21387         (EventExpr.Define): Revert code I wrote earlier.
21388                 
21389         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
21390         instance expression is null. The instance expression is a This in that case
21391         or a null, depending on whether it is a static method or not.
21392
21393         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
21394         refers to more than one method.
21395
21396         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
21397         and accordingly flag errors.
21398
21399 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21400
21401         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
21402
21403 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
21404
21405         * location.cs (ToString): Provide useful rutine.
21406
21407 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
21408
21409         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
21410         objects, return the actual integral boxed.
21411
21412         * statement.cs (SwitchLabel): define an ILLabel for each
21413         SwitchLabel. 
21414
21415         (Switch.CheckSwitch): If the value is a Literal, extract
21416         the underlying literal.
21417
21418         Also in the unused hashtable we had, add the SwitchLabel so we can
21419         quickly look this value up.
21420
21421         * constant.cs: Implement a bunch of new constants.  Rewrite
21422         Literal based on this.  Made changes everywhere to adapt to this.
21423
21424         * expression.cs (Expression.MakeByteBlob): Optimize routine by
21425         dereferencing array only once, and also copes with enumrations.
21426
21427         bytes are two bytes wide, not one.
21428
21429         (Cast): Perform constant conversions.
21430
21431         * ecore.cs (TryImplicitIntConversion): Return literals instead of
21432         wrappers to the literals here.
21433
21434         * expression.cs (DoNumericPromotions): long literals can converted
21435         to ulong implicity (this is taken care of elsewhere, but I was
21436         missing this spot).
21437
21438         * ecore.cs (Expression.Literalize): Make the return type Literal,
21439         to improve type checking.
21440
21441         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
21442
21443 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21444
21445         * literal.cs: Revert code from ravi that checked the bounds.  The
21446         bounds are sane by the definition of the type itself. 
21447
21448         * typemanager.cs: Fix implementation of ImplementsInterface.  We
21449         need to actually look up in our parent hierarchy for interfaces
21450         implemented. 
21451
21452         * const.cs: Use the underlying type for enumerations
21453
21454         * delegate.cs: Compute the basename for the delegate creation,
21455         that should fix the delegate test case, and restore the correct
21456         Type Lookup semantics in rootcontext
21457
21458         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
21459         referencing a nested type with the Reflection API is using the "+"
21460         sign. 
21461
21462         * cs-parser.jay: Do not require EOF token at the end.
21463
21464 2001-12-20  Ravi Pratap  <ravi@ximian.com>
21465
21466         * rootcontext.cs (LookupType): Concatenate type names with
21467         a '.' instead of a '+' The test suite passes again.
21468
21469         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
21470         field of the enumeration.
21471
21472         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
21473         the case when the member is an EventExpr.
21474
21475         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
21476         static has an associated instance expression.
21477
21478         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
21479
21480         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
21481
21482         * class.cs (Event.Define): Register event and perform appropriate checks
21483         for error #111.
21484
21485         We define the Add and Remove methods even if the use provides none because
21486         in that case, we provide default implementations ourselves.
21487
21488         Define a private field of the type of the event. This is done by the CSC compiler
21489         and we should be doing it too ;-)
21490
21491         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
21492         More methods we use in code we generate.
21493
21494         (multicast_delegate_type, delegate_type): Two separate types since the distinction
21495         is important.
21496
21497         (InitCoreTypes): Update accordingly for the above.
21498
21499         * class.cs (Event.Emit): Generate code for default accessors that we provide
21500
21501         (EmitDefaultMethod): Do the job in the above.
21502
21503         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
21504         appropriate place.
21505
21506 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
21507
21508         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
21509         builders even if we were missing one.
21510
21511         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
21512         pass the Basename as our class name instead of the Name.  The
21513         basename will be correctly composed for us.
21514
21515         * parameter.cs (Paramters): Now takes a Location argument.
21516
21517         * decl.cs (DeclSpace.LookupType): Removed convenience function and
21518         make all the code call directly LookupType in RootContext and take
21519         this chance to pass the Location information everywhere.
21520
21521         * Everywhere: pass Location information.
21522
21523 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
21524
21525         * class.cs (Constructor.Define): Updated way of detecting the
21526         length of the parameters.
21527
21528         (TypeContainer.DefineType): Use basename as the type name for
21529         nested types.
21530
21531         (TypeContainer.Define): Do not recursively define types here, as
21532         definition is taken care in order by the RootContext.
21533
21534         * tree.cs: Keep track of namespaces in a per-file basis.
21535
21536         * parameter.cs (Parameter.ComputeSignature): Update to use
21537         DeclSpace. 
21538
21539         (Parameters.GetSignature): ditto.
21540
21541         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
21542         instead of a TypeContainer.
21543
21544         (Interface.SemanticAnalysis): Use `this' instead of our parent to
21545         resolve names.  Because we need to be resolve in our context, not
21546         our parents.
21547
21548         * driver.cs: Implement response files.
21549
21550         * class.cs (TypeContainer.DefineType): If we are defined, do not
21551         redefine ourselves.
21552
21553         (Event.Emit): Emit the code for add/remove handlers.
21554         (Event.Define): Save the MethodBuilders for add/remove.
21555
21556         * typemanager.cs: Use pair here too.
21557
21558         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
21559         DictionaryEntry requires the first argument to be non-null.  
21560
21561         (enum_declaration): Compute full name for registering the
21562         enumeration.
21563
21564         (delegate_declaration): Instead of using
21565         formal_parameter_list, use opt_formal_parameter_list as the list
21566         can be empty.
21567
21568         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
21569         (EventParsing): New property that controls whether `add' and
21570         `remove' are returned as tokens or identifiers (for events);
21571
21572 2001-12-19  Ravi Pratap  <ravi@ximian.com>
21573
21574         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
21575         use MyEventBuilder only and let it wrap the real builder for us.
21576
21577         (MyEventBuilder): Revamp constructor etc.
21578
21579         Implement all operations that we perform on EventBuilder in precisely the same
21580         way here too.
21581
21582         (FindMembers): Update to use the EventBuilder member.
21583
21584         (Event.Emit): Update accordingly.
21585
21586 2001-12-18  Ravi Pratap  <ravi@ximian.com>
21587
21588         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
21589         by calling the appropriate methods.
21590
21591         (GetCustomAttributes): Make stubs as they cannot possibly do anything
21592         useful.
21593
21594         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
21595
21596 2001-12-17  Ravi Pratap  <ravi@ximian.com>
21597
21598         * delegate.cs (Delegate.Populate): Check that the return type
21599         and various parameters types are indeed accessible.
21600
21601         * class.cs (Constructor.Define): Same here.
21602
21603         (Field.Define): Ditto.
21604
21605         (Event.Define): Ditto.
21606
21607         (Operator.Define): Check that the underlying Method defined itself
21608         correctly - so it's MethodBuilder should not be null.
21609
21610         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
21611         expression happens to be null.
21612
21613         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
21614         members but as of now we don't seem to be able to do anything really useful with it.
21615
21616         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
21617         not the EventBuilder.
21618
21619 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
21620
21621         * cs-tokenizer.cs: Add support for defines.
21622         Add support for #if, #elif, #else, #endif
21623
21624         (eval_var): evaluates a variable.
21625         (eval): stubbed for evaluating functions.
21626
21627         * cs-parser.jay: Pass the defines information
21628
21629         * driver.cs: Add --define command line option.
21630
21631         * decl.cs: Move MemberCore here.
21632
21633         Make it the base class for DeclSpace.  This allows us to catch and
21634         report 108 and 109 for everything now.
21635
21636         * class.cs (TypeContainer.Define): Extract all the members
21637         before populating and emit the warning 108 (new keyword required
21638         to override) instead of having each member implement this.
21639
21640         (MemberCore.Define): New abstract method, we will be using this in
21641         the warning reporting engine in Populate.
21642
21643         (Operator.Define): Adjust to new MemberCore protocol. 
21644
21645         * const.cs (Const): This does not derive from Expression, it is a
21646         temporary object we use to create fields, it is a MemberCore. 
21647
21648         * class.cs (Method.Define): Allow the entry point to be in a
21649         specific class.
21650
21651         * driver.cs: Rewrite the argument handler to clean it up a bit.
21652
21653         * rootcontext.cs: Made it just an auxiliary namespace feature by
21654         making everything static.
21655
21656         * driver.cs: Adapt code to use RootContext type name instead of
21657         instance variable.
21658
21659         * delegate.cs: Remove RootContext argument.
21660
21661         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
21662         argument. 
21663
21664         * class.cs (Event.Define): The lookup can fail.
21665
21666         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
21667
21668         * expression.cs: Resolve the this instance before invoking the code.
21669
21670 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
21671
21672         * cs-parser.jay: Add a production in element_access that allows
21673         the thing to become a "type" reference.  This way we can parse
21674         things like "(string [])" as a type.
21675
21676         Note that this still does not handle the more complex rules of
21677         casts. 
21678
21679
21680         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
21681
21682         * ecore.cs: (CopyNewMethods): new utility function used to
21683         assemble the list of methods from running FindMembers.
21684
21685         (MemberLookup): Rework FindMembers so that 
21686
21687 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
21688
21689         * class.cs (TypeContainer): Remove Delegates who fail to be
21690         defined.
21691
21692         * delegate.cs (Populate): Verify that we dont get null return
21693         values.   TODO: Check for AsAccessible.
21694
21695         * cs-parser.jay: Use basename to emit error 574 (destructor should
21696         have the same name as container class), not the full name.
21697
21698         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
21699         possible representation.  
21700
21701         Also implements integer type suffixes U and L.
21702
21703 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
21704
21705         * expression.cs (ArrayCreation.DoResolve): We need to do the
21706         argument resolution *always*.
21707
21708         * decl.cs: Make this hold the namespace.  Hold the root context as
21709         well.
21710         (LookupType): Move here.
21711
21712         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
21713
21714         * location.cs (Row, Name): Fixed the code, it was always returning
21715         references to the first file.
21716
21717         * interface.cs: Register properties defined through interfaces.
21718
21719         * driver.cs: Add support for globbing on the command line
21720
21721         * class.cs (Field): Make it derive from MemberCore as well.
21722         (Event): ditto.
21723
21724 2001-12-15  Ravi Pratap  <ravi@ximian.com>
21725
21726         * class.cs (Event::Define): Check that the type of the event is a delegate
21727         type else flag error #66.
21728
21729         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
21730         same.
21731
21732         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
21733         values of EntryPoint, CharSet etc etc.
21734
21735         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
21736
21737         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
21738         be null and we should ignore this. I am not sure if this is really clean. Apparently,
21739         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
21740         which needs this to do its work.
21741
21742         * ../errors/cs0066.cs : Add.
21743
21744 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
21745
21746         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
21747         helper functions.
21748
21749         * class.cs: (MethodSignature.MethodSignature): Removed hack that
21750         clears out the parameters field.
21751         (MemberSignatureCompare): Cleanup
21752
21753         (MemberCore): New base class used to share code between MethodCore
21754         and Property.
21755
21756         (RegisterRequiredImplementations) BindingFlags.Public requires
21757         either BindingFlags.Instace or Static.  Use instance here.
21758
21759         (Property): Refactored code to cope better with the full spec.
21760
21761         * parameter.cs (GetParameterInfo): Return an empty array instead
21762         of null on error.
21763
21764         * class.cs (Property): Abstract or extern properties have no bodies.
21765
21766         * parameter.cs (GetParameterInfo): return a zero-sized array.
21767
21768         * class.cs (TypeContainer.MethodModifiersValid): Move all the
21769         method modifier validation to the typecontainer so we can reuse
21770         this on properties.
21771
21772         (MethodCore.ParameterTypes): return an empty sized array of types.
21773
21774         (Property.Define): Test property modifier validity.
21775
21776         Add tests for sealed/override too.
21777
21778         (Method.Emit): abstract or extern methods have no bodies.
21779
21780 2001-12-14  Ravi Pratap  <ravi@ximian.com>
21781
21782         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
21783         thing.
21784
21785         (Method::Define, ::Emit): Modify accordingly.
21786
21787         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
21788
21789         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
21790
21791         * makefile: Pass in /unsafe.
21792
21793 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
21794
21795         * class.cs (MakeKey): Kill routine.
21796
21797         * class.cs (TypeContainer.Define): Correctly define explicit
21798         method implementations (they require the full interface name plus
21799         the method name).
21800
21801         * typemanager.cs: Deply the PtrHashtable here and stop using the
21802         lame keys.  Things work so much better.
21803
21804         This of course broke everyone who depended on `RegisterMethod' to
21805         do the `test for existance' test.  This has to be done elsewhere.
21806
21807         * support.cs (PtrHashtable): A hashtable that avoid comparing with
21808         the object stupid Equals method (because, that like fails all over
21809         the place).  We still do not use it.
21810
21811         * class.cs (TypeContainer.SetRequiredInterface,
21812         TypeContainer.RequireMethods): Killed these two routines and moved
21813         all the functionality to RegisterRequiredImplementations.
21814
21815         (TypeContainer.RegisterRequiredImplementations): This routine now
21816         registers all the implementations required in an array for the
21817         interfaces and abstract methods.  We use an array of structures
21818         which can be computed ahead of time to reduce memory usage and we
21819         also assume that lookups are cheap as most classes will not
21820         implement too many interfaces.
21821
21822         We also avoid creating too many MethodSignatures.
21823
21824         (TypeContainer.IsInterfaceMethod): Update and optionally does not
21825         clear the "pending" bit if we find that there are problems with
21826         the declaration.
21827
21828         (TypeContainer.VerifyPendingMethods): Update to report errors of
21829         methods that look like implementations but are not.
21830
21831         (TypeContainer.Define): Add support for explicit interface method
21832         implementation. 
21833
21834 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
21835
21836         * typemanager.cs: Keep track of the parameters here instead of
21837         being a feature of the TypeContainer.
21838
21839         * class.cs: Drop the registration of parameters here, as
21840         InterfaceMethods are also interface declarations.
21841
21842         * delegate.cs: Register methods with the TypeManager not only with
21843         the TypeContainer.  This code was buggy.
21844
21845         * interface.cs: Full registation here.
21846
21847 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
21848
21849         * expression.cs: Remove reducer for binary expressions, it can not
21850         be done this way.
21851
21852         * const.cs: Put here the code that used to go into constant.cs
21853
21854         * constant.cs: Put here the code for constants, this is a new base
21855         class for Literals.
21856
21857         * literal.cs: Make Literal derive from Constant.
21858
21859 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
21860
21861         * statement.cs (Return.Emit): Report error 157 if the user
21862         attempts to return from a finally block.
21863
21864         (Return.Emit): Instead of emitting a return, jump to the end of
21865         the function.
21866
21867         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
21868         LocalBuilder to store the result of the function.  ReturnLabel is
21869         the target where we jump.
21870
21871
21872 2001-12-09  Radek Doulik  <rodo@ximian.com>
21873
21874         * cs-parser.jay: remember alias in current namespace
21875
21876         * ecore.cs (SimpleName::DoResolve): use aliases for types or
21877         namespaces
21878
21879         * class.cs (LookupAlias): lookup alias in my_namespace
21880
21881         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
21882         aliases hashtable
21883         (LookupAlias): lookup alias in this and if needed in parent
21884         namespaces
21885
21886 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
21887
21888         * support.cs: 
21889
21890         * rootcontext.cs: (ModuleBuilder) Made static, first step into
21891         making things static.  I need this to avoid passing the
21892         TypeContainer when calling ParameterType.
21893
21894         * support.cs (InternalParameters.ParameterType): Remove ugly hack
21895         that did string manipulation to compute the type and then call
21896         GetType.  Use Parameter.ParameterType instead.
21897
21898         * cs-tokenizer.cs: Consume the suffix for floating values.
21899
21900         * expression.cs (ParameterReference): figure out whether this is a
21901         reference parameter or not.  Kill an extra variable by computing
21902         the arg_idx during emission.
21903
21904         * parameter.cs (Parameters.GetParameterInfo): New overloaded
21905         function that returns whether a parameter is an out/ref value or not.
21906
21907         (Parameter.ParameterType): The type of the parameter (base,
21908         without ref/out applied).
21909
21910         (Parameter.Resolve): Perform resolution here.
21911         (Parameter.ExternalType): The full type (with ref/out applied).
21912
21913         * statement.cs (Using.Emit, Using.EmitExpression): Implement
21914         support for expressions on the using statement.
21915
21916 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
21917
21918         * statement.cs (Using.EmitLocalVariableDecls): Split the
21919         localvariable handling of the using statement.
21920
21921         (Block.EmitMeta): Keep track of variable count across blocks.  We
21922         were reusing slots on separate branches of blocks.
21923
21924         (Try.Emit): Emit the general code block, we were not emitting it. 
21925
21926         Check the type of the declaration to be an IDisposable or
21927         something that can be implicity converted to it. 
21928
21929         Emit conversions if required.
21930
21931         * ecore.cs (EmptyExpression): New utility class.
21932         (Expression.ImplicitConversionExists): New utility function.
21933
21934 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
21935
21936         * statement.cs (Using): Implement.
21937
21938         * expression.cs (LocalVariableReference): Support read only variables.
21939
21940         * statement.cs: Remove the explicit emit for the Leave opcode.
21941         (VariableInfo): Add a readonly field.
21942
21943 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
21944
21945         * ecore.cs (ConvCast): new class used to encapsulate the various
21946         explicit integer conversions that works in both checked and
21947         unchecked contexts.
21948
21949         (Expression.ConvertNumericExplicit): Use new ConvCast class to
21950         properly generate the overflow opcodes.
21951
21952 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21953
21954         * statement.cs: The correct type for the EmptyExpression is the
21955         element_type, not the variable type.  Ravi pointed this out.
21956
21957 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21958
21959         * class.cs (Method::Define): Handle PInvoke methods specially
21960         by using DefinePInvokeMethod instead of the usual one.
21961
21962         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
21963         above to do the task of extracting information and defining the method.
21964
21965 2001-12-04  Ravi Pratap  <ravi@ximian.com>
21966
21967         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
21968         of the condition for string type.
21969
21970         (Emit): Move that here. 
21971
21972         (ArrayCreation::CheckIndices): Keep string literals in their expression
21973         form.
21974
21975         (EmitDynamicInitializers): Handle strings appropriately.
21976
21977 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
21978
21979         * codegen.cs (EmitContext): Replace multiple variables with a
21980         single pointer to the current Switch statement.
21981
21982         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
21983         EmitContext.
21984
21985 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
21986
21987         * statement.cs 
21988
21989         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
21990         default'.
21991
21992         (Foreach.Emit): Foreach on arrays was not setting
21993         up the loop variables (for break/continue).
21994
21995         (GotoCase): Semi-implented.
21996
21997 2001-12-03  Ravi Pratap  <ravi@ximian.com>
21998
21999         * attribute.cs (CheckAttribute): Handle system attributes by using
22000         Attribute.GetAttributes to examine information we need.
22001
22002         (GetValidPlaces): Same here.
22003
22004         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22005
22006         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22007
22008         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22009
22010         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22011
22012         (Method::Emit): Handle the case when we are a PInvoke method.
22013
22014 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22015
22016         * expression.cs: Use ResolveWithSimpleName on compound names.
22017
22018 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22019
22020         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22021         before trying to reduce it.
22022
22023         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22024
22025         * constant.cs (LookupConstantValue): Implement.
22026
22027         (EmitConstant): Use the above in emitting the constant.
22028
22029         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22030         that are user-defined by doing a LookupConstantValue on them.
22031
22032         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22033         too, like above.
22034
22035 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22036
22037         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22038
22039         (BaseAccess.DoResolve): Implement.
22040
22041         (MemberAccess.DoResolve): Split this routine into a
22042         ResolveMemberAccess routine that can be used independently
22043
22044 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22045
22046         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22047         As that share bits of the implementation.  Is returns a boolean,
22048         while As returns the Type that is being probed.
22049
22050 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22051
22052         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22053         instead of a Literal - much easier.
22054
22055         (EnumInTransit): Remove - utterly useless :-)
22056
22057         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22058
22059         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22060
22061         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22062         chain when we have no associated expression.
22063
22064 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22065
22066         * constant.cs (Define): Use Location while reporting the errror.
22067
22068         Also emit a warning when 'new' is used and there is no inherited
22069         member to hide.
22070
22071         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22072         populated.
22073
22074         (LookupEnumValue): Implement to lookup an enum member's value and define it
22075         if necessary.
22076
22077         (Populate): Re-write accordingly to use the above routine.
22078
22079 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22080
22081         * expression.cs (This): Fix prototype for DoResolveLValue to
22082         override the base class DoResolveLValue.
22083
22084         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22085         declarations) 
22086
22087         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22088         (we need to load the address of the field here).  This fixes
22089         test-22. 
22090
22091         (FieldExpr.DoResolveLValue): Call the DoResolve
22092         function to initialize the Instance expression.
22093
22094         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22095         correctly the GetEnumerator operation on a value type.
22096
22097         * cs-parser.jay: Add more simple parsing error catches.
22098
22099         * statement.cs (Switch): Add support for string switches.
22100         Handle null specially.
22101
22102         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22103
22104 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22105
22106         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22107
22108         (declare_local_constant): New helper function.
22109
22110         * statement.cs (AddConstant): Keep a separate record of constants
22111
22112         (IsConstant): Implement to determine if a variable is a constant.
22113
22114         (GetConstantExpression): Implement.
22115
22116         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22117
22118         * statement.cs (IsVariableDefined): Re-write.
22119
22120 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22121
22122         * class.cs (TypeContainer::FindMembers): Look for constants
22123         in the case when we are looking for MemberTypes.Field
22124
22125         * expression.cs (MemberAccess::DoResolve): Check that in the
22126         case we are a FieldExpr and a Literal, we are not being accessed
22127         by an instance reference.
22128
22129         * cs-parser.jay (local_constant_declaration): Implement.
22130
22131         (declaration_statement): Implement for constant declarations.
22132
22133 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22134
22135         * statement.cs (Switch): Catch double defaults.
22136
22137         (Switch): More work on the switch() statement
22138         implementation.  It works for integral values now, need to finish
22139         string support.
22140
22141
22142 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22143
22144         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22145         integer literals into other integer literals.  To be used by
22146         switch. 
22147
22148 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22149
22150         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22151         some memory.
22152
22153         (EmitDynamicInitializers): Cope with the above since we extract data
22154         directly from ArrayData now.
22155
22156         (ExpectInitializers): Keep track of whether initializers are mandatory
22157         or not.
22158
22159         (Bounds): Make it a hashtable to prevent the same dimension being 
22160         recorded for every element in that dimension.
22161
22162         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22163         from being found.
22164
22165         Also fix bug which was causing the indices to be emitted in the reverse
22166         order.
22167
22168 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22169
22170         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22171         unfinished.  They do not work, because the underlying code is
22172         sloppy.
22173
22174 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22175
22176         * cs-parser.jay: Remove bogus fixme.
22177
22178         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22179         on Switch statement.
22180
22181 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22182
22183         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22184         the same. 
22185
22186         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22187         parameter. Apparently, any expression is allowed. 
22188
22189         (ValidateInitializers): Update accordingly.
22190
22191         (CheckIndices): Fix some tricky bugs thanks to recursion.
22192
22193         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22194         I was being completely brain-dead.
22195
22196         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22197         and re-write acordingly.
22198
22199         (DelegateInvocation): Re-write accordingly.
22200
22201         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22202
22203         (MakeByteBlob): Handle types more correctly.
22204
22205         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22206         initialization from expressions but it is incomplete because I am a complete
22207         Dodo :-|
22208
22209 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22210
22211         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22212         on If.  Basically, we have to return `true' (ie, we do return to
22213         our caller) only if both branches of the if return.
22214
22215         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22216         short-circuit operators, handle them as short circuit operators. 
22217
22218         (Cast.DoResolve): Resolve type.
22219         (Cast.Cast): Take an expression as the target type.
22220
22221         * cs-parser.jay (cast_expression): Remove old hack that only
22222         allowed a limited set of types to be handled.  Now we take a
22223         unary_expression and we resolve to a type during semantic
22224         analysis.
22225
22226         Use the grammar productions from Rhys to handle casts (this is
22227         not complete like Rhys syntax yet, we fail to handle that corner
22228         case that C# has regarding (-x), but we will get there.
22229
22230 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22231
22232         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22233         field which is an array type.
22234
22235         * cs-parser.jay (declare_local_variables): Support array initialization too.
22236
22237         * typemanager.cs (MakeKey): Implement.
22238
22239         (everywhere): Use the above appropriately.
22240
22241         * cs-parser.jay (for_statement): Update for array initialization while
22242         declaring variables.
22243
22244         * ecore.cs : The error message was correct, it's the variable's names that
22245         were misleading ;-) Make the code more readable.
22246
22247         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
22248         the correct type etc.
22249
22250         (ConvertExplicit): Handle Enum types by examining the underlying type.
22251
22252 2001-11-21  Ravi Pratap  <ravi@ximian.com>
22253
22254         * parameter.cs (GetCallingConvention): Always return
22255         CallingConventions.Standard for now.
22256
22257 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22258
22259         * expression.cs (Binary.ResolveOperator): Update the values of `l'
22260         and `r' after calling DoNumericPromotions.
22261
22262         * ecore.cs: Fix error message (the types were in the wrong order).
22263
22264         * statement.cs (Foreach.ProbeCollectionType): Need to pass
22265         BindingFlags.Instance as well 
22266
22267         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
22268         implicit int literal conversion in an empty cast so that we
22269         propagate the right type upstream.
22270
22271         (UnboxCast): new class used to unbox value types.
22272         (Expression.ConvertExplicit): Add explicit type conversions done
22273         by unboxing.
22274
22275         (Expression.ImplicitNumericConversion): Oops, forgot to test for
22276         the target type before applying the implicit LongLiterals to ULong
22277         literal cast.
22278
22279 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
22280
22281         * cs-parser.jay (for_statement): Reworked the way For works: now
22282         we declare manually any variables that are introduced in
22283         for_initializer to solve the problem of having out-of-band code
22284         emition (that is what got for broken).
22285
22286         (declaration_statement): Perform the actual variable declaration
22287         that used to be done in local_variable_declaration here.
22288
22289         (local_variable_declaration): Do not declare anything, just pass
22290         the information on a DictionaryEntry
22291
22292 2001-11-20  Ravi Pratap  <ravi@ximian.com>
22293
22294         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
22295         re-write of the logic to now make it recursive.
22296
22297         (UpdateIndices): Re-write accordingly.
22298
22299         Store element data in a separate ArrayData list in the above methods.
22300
22301         (MakeByteBlob): Implement to dump the array data into a byte array.
22302
22303 2001-11-19  Ravi Pratap  <ravi@ximian.com>
22304
22305         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
22306         into CheckIndices.
22307
22308         * constant.cs (Define): Implement.
22309
22310         (EmitConstant): Re-write fully.
22311
22312         Pass in location info.
22313
22314         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
22315         respectively.
22316
22317         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
22318         DictionaryEntry since we need location info too.
22319
22320         (constant_declaration): Update accordingly.
22321
22322         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
22323         code into another method : UpdateIndices.
22324
22325 2001-11-18  Ravi Pratap  <ravi@ximian.com>
22326
22327         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
22328         some type checking etc.
22329
22330 2001-11-17  Ravi Pratap  <ravi@ximian.com>
22331
22332         * expression.cs (ArrayCreation::ValidateInitializers): Implement
22333         bits to provide dimension info if the user skips doing that.
22334
22335         Update second constructor to store the rank correctly.
22336
22337 2001-11-16  Ravi Pratap  <ravi@ximian.com>
22338
22339         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
22340         and try to implement.
22341
22342         * ../errors/cs0150.cs : Add.
22343
22344         * ../errors/cs0178.cs : Add.
22345
22346 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
22347
22348         * statement.cs: Implement foreach on multi-dimensional arrays. 
22349
22350         * parameter.cs (Parameters.GetParameterByName): Also lookup the
22351         name of the params argument.
22352
22353         * expression.cs: Use EmitStoreOpcode to get the right opcode while
22354         initializing the array.
22355
22356         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
22357         we can use this elsewhere.
22358
22359         * statement.cs: Finish implementation of foreach for single
22360         dimension arrays.
22361
22362         * cs-parser.jay: Use an out-of-band stack to pass information
22363         around, I wonder why I need this.
22364
22365         foreach_block: Make the new foreach_block the current_block.
22366
22367         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
22368         function used to return a static Parameters structure.  Used for
22369         empty parameters, as those are created very frequently.
22370
22371         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
22372
22373 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22374
22375         * interface.cs : Default modifier is private, not public. The
22376         make verify test passes again.
22377
22378 2001-11-15  Ravi Pratap  <ravi@ximian.com>
22379
22380         * support.cs (ReflectionParameters): Fix logic to determine
22381         whether the last parameter is a params one. Test 9 passes again.
22382
22383         * delegate.cs (Populate): Register the builders we define with
22384         RegisterParameterForBuilder. Test 19 passes again.
22385
22386         * cs-parser.jay (property_declaration): Reference $6 instead
22387         of $$ to get at the location.
22388
22389         (indexer_declaration): Similar stuff.
22390
22391         (attribute): Ditto.
22392
22393         * class.cs (Property): Register parameters for the Get and Set methods
22394         if they exist. Test 23 passes again.
22395
22396         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
22397         call to EmitArguments as we are sure there aren't any params arguments. 
22398         Test 32 passes again.
22399
22400         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
22401         IndexOutOfRangeException. 
22402
22403         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
22404         Test 33 now passes again.
22405
22406 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
22407
22408         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
22409         broke a bunch of things.  Will have to come up with a better way
22410         of tracking locations.
22411
22412         * statement.cs: Implemented foreach for single dimension arrays.
22413
22414 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22415
22416         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
22417         an error.  This removes the lookup from the critical path.
22418
22419         * cs-parser.jay: Removed use of temporary_loc, which is completely
22420         broken. 
22421
22422 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
22423
22424         * support.cs (ReflectionParameters.ParameterModifier): Report
22425         whether the argument is a PARAMS argument or not.
22426
22427         * class.cs: Set the attribute `ParamArrayAttribute' on the
22428         parameter argument.
22429
22430         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
22431         and cons_param_array_attribute (ConstructorInfo for
22432         ParamArrayAttribute)., 
22433
22434         * codegen.cs: Emit the return using the `Return' statement, that
22435         way we can report the error correctly for missing return values. 
22436
22437         * class.cs (Method.Emit): Clean up.
22438
22439         * expression.cs (Argument.Resolve): Take another argument: the
22440         location where this argument is used.  Notice that this is not
22441         part of the "Argument" class as to reduce the size of the
22442         structure (we know the approximate location anyways).
22443
22444         Test if the argument is a variable-reference, if not, then
22445         complain with a 206.
22446
22447         (Argument.Emit): Emit addresses of variables.
22448
22449         (Argument.FullDesc): Simplify.
22450
22451         (Invocation.DoResolve): Update for Argument.Resolve.
22452
22453         (ElementAccess.DoResolve): ditto.
22454
22455         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
22456         method should be virtual, as this method is always virtual.
22457
22458         (NewDelegate.DoResolve): Update for Argument.Resolve.
22459
22460         * class.cs (ConstructorInitializer.DoResolve): ditto.
22461
22462         * attribute.cs (Attribute.Resolve): ditto.
22463
22464 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
22465
22466         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
22467
22468         * expression.cs (ParameterReference): Drop IStackStorage and implement
22469         IAssignMethod instead. 
22470
22471         (LocalVariableReference): ditto.
22472
22473         * ecore.cs (FieldExpr): Drop IStackStorage and implement
22474         IAssignMethod instead. 
22475
22476 2001-11-13  Miguel de Icaza <miguel@ximian.com>
22477
22478         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
22479         enumerations that are used in heavily used structures derive from
22480         byte in a laughable and pathetic attempt to reduce memory usage.
22481         This is the kind of pre-optimzations that you should not do at
22482         home without adult supervision.
22483
22484         * expression.cs (UnaryMutator): New class, used to handle ++ and
22485         -- separatedly from the other unary operators.  Cleans up the
22486         code, and kills the ExpressionStatement dependency in Unary.
22487
22488         (Unary): Removed `method' and `Arguments' from this class, making
22489         it smaller, and moving it all to SimpleCall, so I can reuse this
22490         code in other locations and avoid creating a lot of transient data
22491         strucutres when not required.
22492
22493         * cs-parser.jay: Adjust for new changes.
22494
22495 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
22496
22497         * enum.cs (Enum.Populate): If there is a failure during
22498         definition, return
22499
22500         * cs-parser.jay (opt_enum_base): we used to catch type errors
22501         here, but this is really incorrect.  The type error should be
22502         catched during semantic analysis.
22503
22504 2001-12-11  Ravi Pratap  <ravi@ximian.com>
22505
22506         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
22507         current_local_parameters as expected since I, in my stupidity, had forgotten
22508         to do this :-)
22509
22510         * attribute.cs (GetValidPlaces): Fix stupid bug.
22511
22512         * class.cs (Method::Emit): Perform check on applicability of attributes.
22513
22514         (Constructor::Emit): Ditto.
22515
22516         (Field::Emit): Ditto.
22517
22518         (Field.Location): Store location information.
22519
22520         (Property, Event, Indexer, Operator): Ditto.
22521
22522         * cs-parser.jay (field_declaration): Pass in location for each field.
22523
22524         * ../errors/cs0592.cs : Add.
22525
22526 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22527
22528         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
22529
22530         (InitCoreTypes): Update accordingly.
22531
22532         (RegisterAttrType, LookupAttr): Implement.
22533
22534         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
22535         info about the same.
22536
22537         (Resolve): Update to populate the above as necessary.
22538
22539         (Error592): Helper.
22540
22541         (GetValidPlaces): Helper to the above.
22542
22543         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
22544
22545         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
22546
22547 2001-11-12  Ravi Pratap  <ravi@ximian.com>
22548
22549         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
22550
22551         * ../errors/cs0617.cs : Add.
22552
22553 2001-11-11  Ravi Pratap  <ravi@ximian.com>
22554
22555         * enum.cs (Emit): Rename to Populate to be more consistent with what
22556         we expect it to do and when exactly it is called.
22557
22558         * class.cs, rootcontext.cs : Update accordingly.
22559
22560         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
22561         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
22562
22563         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
22564
22565         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
22566         of a fieldinfo using the above, when dealing with a FieldBuilder.
22567
22568 2001-11-10  Ravi Pratap  <ravi@ximian.com>
22569
22570         * ../errors/cs0031.cs : Add.
22571
22572         * ../errors/cs1008.cs : Add.
22573
22574         * ../errrors/cs0543.cs : Add.
22575
22576         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
22577         enum type.
22578
22579         (FindMembers): Implement.
22580
22581         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
22582         enums and delegates too.
22583
22584         (enum_types): Rename to builder_to_enum.
22585
22586         (delegate_types): Rename to builder_to_delegate.
22587
22588         * delegate.cs (FindMembers): Implement.
22589
22590 2001-11-09  Ravi Pratap  <ravi@ximian.com>
22591
22592         * typemanager.cs (IsEnumType): Implement.
22593
22594         * enum.cs (Emit): Re-write parts to account for the underlying type
22595         better and perform checking etc.
22596
22597         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
22598         of the underlying type.
22599
22600         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
22601         value
22602
22603         * enum.cs (error31): Helper to report error #31.
22604
22605         * cs-parser.jay (enum_declaration): Store location of each member too.
22606
22607         * enum.cs (member_to_location): New hashtable. 
22608
22609         (AddEnumMember): Update location hashtable.
22610
22611         (Emit): Use the location of each member while reporting errors.
22612
22613 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
22614
22615         * cs-parser.jay: A for_initializer if is a
22616         local_variable_declaration really ammount to have an implicit
22617         block with the variable declaration and no initializer for for.
22618
22619         * statement.cs (For.Emit): Cope with null initializers.
22620
22621         This fixes the infinite loop on for initializers.
22622
22623 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
22624
22625         * enum.cs: More cleanup.
22626
22627         * ecore.cs: Remove dead code.
22628
22629         * class.cs (Property.Emit): More simplification.
22630         (Event.Emit): ditto.
22631
22632         Reworked to have less levels of indentation.
22633
22634 2001-11-08  Ravi Pratap  <ravi@ximian.com>
22635
22636         * class.cs (Property): Emit attributes.
22637
22638         (Field): Ditto.
22639
22640         (Event): Ditto.
22641
22642         (Indexer): Ditto.
22643
22644         (Operator): Ditto.
22645
22646         * enum.cs (Emit): Ditto.
22647
22648         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
22649         Enums too.
22650
22651         * class.cs (Field, Event, etc.): Move attribute generation into the
22652         Emit method everywhere.
22653
22654         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
22655         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
22656         as we had no way of defining nested enums !
22657
22658         * rootcontext.cs : Adjust code accordingly.
22659
22660         * typemanager.cs (AddEnumType): To keep track of enum types separately.
22661
22662 2001-11-07  Ravi Pratap  <ravi@ximian.com>
22663
22664         * expression.cs (EvalConstantExpression): Move into ecore.cs
22665
22666         * enum.cs (Enum): Rename some members and make them public and readonly
22667         according to our convention.
22668
22669         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
22670         nothing else.
22671
22672         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
22673
22674         (Enum::Emit): Write a simple version for now which doesn't try to compute
22675         expressions. I shall modify this to be more robust in just a while.
22676
22677         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
22678
22679         (TypeContainer::CloseType): Create the Enum types too.
22680
22681         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
22682
22683         * expression.cs (EvalConstantExpression): Get rid of completely.
22684
22685         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
22686         user-defined values and other cases.
22687
22688         (IsValidEnumLiteral): Helper function.
22689
22690         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
22691         out there in the case we had a literal FieldExpr.
22692
22693         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
22694
22695         (Literalize): Revamp a bit to take two arguments.
22696
22697         (EnumLiteral): New class which derives from Literal to wrap enum literals.
22698
22699 2001-11-06  Ravi Pratap  <ravi@ximian.com>
22700
22701         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
22702
22703         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
22704
22705         (Resolve): Use the above to ensure we have proper initializers.
22706
22707 2001-11-05  Ravi Pratap  <ravi@ximian.com>
22708
22709         * expression.cs (Expression::EvalConstantExpression): New method to 
22710         evaluate constant expressions.
22711
22712         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
22713
22714 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
22715
22716         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
22717         in an array.
22718
22719         (Binary.ResolveOperator): Handle operator != (object a, object b)
22720         and operator == (object a, object b);
22721
22722         (Binary.DoNumericPromotions): Indicate whether the numeric
22723         promotion was possible.
22724
22725         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
22726         Implement.  
22727
22728         Made the ArrayAccess implement interface IAssignMethod instead of
22729         IStackStore as the order in which arguments are passed reflects
22730         this.
22731
22732         * assign.cs: Instead of using expr.ExprClass to select the way of
22733         assinging, probe for the IStackStore/IAssignMethod interfaces.
22734
22735         * typemanager.cs: Load InitializeArray definition.
22736
22737         * rootcontext.cs (RootContext.MakeStaticData): Used to define
22738         static data that can be used to initialize arrays. 
22739
22740 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
22741
22742         * expression.cs: Handle operator== and operator!= for booleans.
22743
22744         (Conditioal.Reduce): Implement reducer for the ?: operator.
22745
22746         (Conditional.Resolve): Implement dead code elimination.
22747
22748         (Binary.Resolve): Catch string literals and return a new
22749         concatenated string.
22750
22751         (Unary.Reduce): Implement reduction of unary expressions.
22752
22753         * ecore.cs: Split out the expression core handling here.
22754
22755         (Expression.Reduce): New method used to perform constant folding
22756         and CSE.  This is needed to support constant-expressions. 
22757
22758         * statement.cs (Statement.EmitBoolExpression): Pass true and false
22759         targets, and optimize for !x.
22760
22761 2001-11-04  Ravi Pratap  <ravi@ximian.com>
22762
22763         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
22764         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
22765         set custom atttributes.
22766
22767         * literal.cs (Literal::GetValue): New abstract method to return the actual
22768         value of the literal, cast as an object.
22769
22770         (*Literal): Implement GetValue method.
22771
22772         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
22773         expressions to the arraylist but objects of type Argument.
22774
22775         * class.cs (TypeContainer::Emit): Emit our attributes too.
22776
22777         (Method::Emit, Constructor::Emit): Ditto.
22778
22779         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
22780         to be ignoring earlier.
22781
22782 2001-11-03  Ravi Pratap  <ravi@ximian.com>
22783
22784         * attribute.cs (AttributeSection::Define): Implement to do the business
22785         of constructing a CustomAttributeBuilder.
22786
22787         (Attribute): New trivial class. Increases readability of code.  
22788
22789         * cs-parser.jay : Update accordingly.
22790
22791         (positional_argument_list, named_argument_list, named_argument): New rules
22792
22793         (attribute_arguments): Use the above so that we are more correct.
22794
22795 2001-11-02  Ravi Pratap  <ravi@ximian.com>
22796
22797         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
22798         to perform all checks for a method with a params parameter.
22799
22800         (Invocation::OverloadResolve): Update to use the above method and therefore
22801         cope correctly with params method invocations.
22802
22803         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
22804         params too.
22805
22806         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
22807         constructors in our parent too because we can't afford to miss out on 
22808         protected ones ;-)
22809
22810         * attribute.cs (AttributeSection): New name for the class Attribute
22811
22812         Other trivial changes to improve readability.
22813
22814         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
22815         use the new class names.
22816
22817 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22818
22819         * class.cs (Method::Define): Complete definition for params types too
22820
22821         (Indexer::Define): Ditto.
22822
22823         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
22824         Cope everywhere with a request for info about the array parameter.
22825
22826 2001-11-01  Ravi Pratap  <ravi@ximian.com>
22827
22828         * tree.cs (RecordNamespace): Fix up to check for the correct key.
22829
22830         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
22831         local_variable_type to extract the string corresponding to the type.
22832
22833         (local_variable_type): Fixup the action to use the new helper method.
22834
22835         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
22836         go.
22837
22838         * expression.cs : Clean out code which uses the above.
22839
22840 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22841
22842         * typemanager.cs (RegisterMethod): Check if we already have an existing key
22843         and bale out if necessary by returning a false.
22844
22845         (RegisterProperty): Ditto.
22846
22847         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
22848         and print out appropriate error messages.
22849
22850         * interface.cs (everywhere): Ditto.
22851
22852         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
22853         location to constructor.
22854
22855         * class.cs (Property, Event, Indexer): Update accordingly.
22856
22857         * ../errors/cs111.cs : Added.
22858
22859         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
22860         of a method, as laid down by the spec.
22861
22862         (Invocation::OverloadResolve): Use the above method.
22863
22864 2001-10-31  Ravi Pratap  <ravi@ximian.com>
22865
22866         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
22867         now take a TypeContainer and a Parameters object.
22868
22869         (ParameterData): Modify return type of ParameterModifier method to be 
22870         Parameter.Modifier and not a string.
22871
22872         (ReflectionParameters, InternalParameters): Update accordingly.
22873
22874         * expression.cs (Argument::GetParameterModifier): Same here.
22875
22876         * support.cs (InternalParameters::ParameterType): Find a better way of determining
22877         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
22878         symbol in it at all so maybe this is only for now.
22879
22880 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22881
22882         * support.cs (InternalParameters): Constructor now takes an extra argument 
22883         which is the actual Parameters class.
22884
22885         (ParameterDesc): Update to provide info on ref/out modifiers.
22886
22887         * class.cs (everywhere): Update call to InternalParameters to pass in
22888         the second argument too.
22889
22890         * support.cs (ParameterData): Add ParameterModifier, which is a method 
22891         to return the modifier info [ref/out etc]
22892
22893         (InternalParameters, ReflectionParameters): Implement the above.
22894
22895         * expression.cs (Argument::ParameterModifier): Similar function to return
22896         info about the argument's modifiers.
22897
22898         (Invocation::OverloadResolve): Update to take into account matching modifiers 
22899         too.
22900
22901         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
22902         a new SetFormalParameters object which we pass to InternalParameters.
22903
22904 2001-10-30  Ravi Pratap  <ravi@ximian.com>
22905
22906         * expression.cs (NewArray): Merge into the ArrayCreation class.
22907
22908 2001-10-29  Ravi Pratap  <ravi@ximian.com>
22909
22910         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
22911         NewUserdefinedArray into one as there wasn't much of a use in having
22912         two separate ones.
22913
22914         * expression.cs (Argument): Change field's name to ArgType from Type.
22915
22916         (Type): New readonly property which returns the proper type, taking into 
22917         account ref/out modifiers.
22918
22919         (everywhere): Adjust code accordingly for the above.
22920
22921         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
22922         whether we are emitting for a ref or out parameter.
22923
22924         * expression.cs (Argument::Emit): Use the above field to set the state.
22925
22926         (LocalVariableReference::Emit): Update to honour the flag and emit the
22927         right stuff.
22928
22929         * parameter.cs (Attributes): Set the correct flags for ref parameters.
22930
22931         * expression.cs (Argument::FullDesc): New function to provide a full desc.
22932
22933         * support.cs (ParameterData): Add method ParameterDesc to the interface.
22934
22935         (ReflectionParameters, InternalParameters): Implement the above method.
22936
22937         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
22938         reporting errors.
22939
22940         (Invocation::FullMethodDesc): Ditto. 
22941
22942 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
22943
22944         * cs-parser.jay: Add extra production for the second form of array
22945         creation. 
22946
22947         * expression.cs (ArrayCreation): Update to reflect the above
22948         change. 
22949
22950         * Small changes to prepare for Array initialization.
22951
22952 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
22953
22954         * typemanager.cs (ImplementsInterface): interface might be null;
22955         Deal with this problem;
22956
22957         Also, we do store negative hits on the cache (null values), so use
22958         this instead of calling t.GetInterfaces on the type everytime.
22959
22960 2001-10-28  Ravi Pratap  <ravi@ximian.com>
22961
22962         * typemanager.cs (IsBuiltinType): New method to help determine the same.
22963
22964         * expression.cs (New::DoResolve): Get rid of array creation code and instead
22965         split functionality out into different classes.
22966
22967         (New::FormArrayType): Move into NewBuiltinArray.
22968
22969         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
22970         quite useless.
22971
22972         (NewBuiltinArray): New class to handle creation of built-in arrays.
22973
22974         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
22975         account creation of one-dimensional arrays.
22976
22977         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
22978
22979         (NewUserdefinedArray::DoResolve): Implement.
22980
22981         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
22982
22983         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
22984         we maintain inside the TypeManager. This is necessary to perform lookups on the
22985         module builder.
22986
22987         (LookupType): Update to perform GetType on the module builders too.     
22988
22989         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
22990
22991         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
22992
22993 2001-10-23  Ravi Pratap  <ravi@ximian.com>
22994
22995         * expression.cs (New::DoResolve): Implement guts of array creation.
22996
22997         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
22998
22999 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23000
23001         * expression.cs: Fix bug I introduced lsat night that broke
23002         Delegates. 
23003
23004         (Expression.Resolve): Report a 246 error (can not resolve name)
23005         if we find a SimpleName in the stream.
23006
23007         (Expression.ResolveLValue): Ditto.
23008
23009         (Expression.ResolveWithSimpleName): This function is a variant of
23010         ResolveName, this one allows SimpleNames to be returned without a
23011         warning.  The only consumer of SimpleNames is MemberAccess
23012
23013 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23014
23015         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23016         might arrive here.  I have my doubts that this is correct.
23017
23018         * statement.cs (Lock): Implement lock statement.
23019
23020         * cs-parser.jay: Small fixes to support `lock' and `using'
23021
23022         * cs-tokenizer.cs: Remove extra space
23023
23024         * driver.cs: New flag --checked, allows to turn on integer math
23025         checking. 
23026
23027         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23028         Threading.Monitor.Exit 
23029
23030 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23031
23032         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23033         Expression Class to be IndexerAccess.
23034
23035         Notice that Indexer::DoResolve sets the eclass to Value.
23036
23037 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23038
23039         * class.cs (TypeContainer::Emit): Emit code for indexers.
23040
23041         * assign.cs (IAssignMethod): New interface implemented by Indexers
23042         and Properties for handling assignment.
23043
23044         (Assign::Emit): Simplify and reuse code. 
23045
23046         * expression.cs (IndexerAccess, PropertyExpr): Implement
23047         IAssignMethod, clean up old code. 
23048
23049 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23050
23051         * typemanager.cs (ImplementsInterface): New method to determine if a type
23052         implements a given interface. Provides a nice cache too.
23053
23054         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23055         method.
23056
23057         (ConvertReferenceExplicit): Ditto.
23058
23059         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23060         various methods, with correct names etc.
23061
23062         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23063         Operator.UnaryNegation.
23064
23065         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23066         we have a unary plus or minus operator.
23067
23068         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23069         UnaryMinus.
23070
23071         * everywhere : update accordingly.
23072
23073         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23074         respectively.
23075
23076         * class.cs (Method::Define): For the case where we are implementing a method
23077         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23078         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23079
23080 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23081
23082         * interface.cs (FindMembers): Implement to work around S.R.E
23083         lameness.
23084
23085         * typemanager.cs (IsInterfaceType): Implement.
23086
23087         (FindMembers): Update to handle interface types too.
23088
23089         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23090         use IsAssignableFrom as that is not correct - it doesn't work.
23091
23092         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23093         and accordingly override EmitStatement.
23094
23095         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23096         using the correct logic :-)
23097
23098 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23099
23100         * ../errors/cs-11.cs : Add to demonstrate error -11 
23101
23102 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23103
23104         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23105         then pass this as a hint to ResolveLValue.
23106
23107         * expression.cs (FieldExpr): Add Location information
23108
23109         (FieldExpr::LValueResolve): Report assignment to readonly
23110         variable. 
23111
23112         (Expression::ExprClassFromMemberInfo): Pass location information.
23113
23114         (Expression::ResolveLValue): Add new method that resolves an
23115         LValue. 
23116
23117         (Expression::DoResolveLValue): Default invocation calls
23118         DoResolve. 
23119
23120         (Indexers): New class used to keep track of indexers in a given
23121         Type. 
23122
23123         (IStackStore): Renamed from LValue, as it did not really describe
23124         what this did.  Also ResolveLValue is gone from this interface and
23125         now is part of Expression.
23126
23127         (ElementAccess): Depending on the element access type
23128
23129         * typemanager.cs: Add `indexer_name_type' as a Core type
23130         (System.Runtime.CompilerServices.IndexerNameAttribute)
23131
23132         * statement.cs (Goto): Take a location.
23133
23134 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23135
23136         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23137         if two delegates are compatible.
23138
23139         (NewDelegate::DoResolve): Update to take care of the case when
23140         we instantiate a delegate from another delegate.
23141
23142         * typemanager.cs (FindMembers): Don't even try to look up members
23143         of Delegate types for now.
23144
23145 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23146
23147         * delegate.cs (NewDelegate): New class to take care of delegate
23148         instantiation.
23149
23150         * expression.cs (New): Split the delegate related code out into 
23151         the NewDelegate class.
23152
23153         * delegate.cs (DelegateInvocation): New class to handle delegate 
23154         invocation.
23155
23156         * expression.cs (Invocation): Split out delegate related code into
23157         the DelegateInvocation class.
23158
23159 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23160
23161         * expression.cs (New::DoResolve): Implement delegate creation fully
23162         and according to the spec.
23163
23164         (New::DoEmit): Update to handle delegates differently.
23165
23166         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23167         because of which we were printing out arguments in reverse order !
23168
23169         * delegate.cs (VerifyMethod): Implement to check if the given method
23170         matches the delegate.
23171
23172         (FullDelegateDesc): Implement.
23173
23174         (VerifyApplicability): Implement.
23175
23176         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23177         delegate invocations too.
23178
23179         (Invocation::Emit): Ditto.
23180
23181         * ../errors/cs1593.cs : Added.
23182
23183         * ../errors/cs1594.cs : Added.
23184
23185         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23186
23187 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23188
23189         * typemanager.cs (intptr_type): Core type for System.IntPtr
23190
23191         (InitCoreTypes): Update for the same.
23192
23193         (iasyncresult_type, asynccallback_type): Ditto.
23194
23195         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23196         correct.
23197
23198         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23199         too.
23200
23201         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23202         the builders for the 4 members of a delegate type :-)
23203
23204         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23205         type.
23206
23207         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23208
23209         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23210
23211 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23212
23213         * statement.cs (Break::Emit): Implement.   
23214         (Continue::Emit): Implement.
23215
23216         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23217         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23218         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23219         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23220         end loop
23221
23222         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23223         properties that track the label for the current loop (begin of the
23224         loop and end of the loop).
23225
23226 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23227
23228         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23229         use of emitting anything at all.
23230
23231         * class.cs, rootcontext.cs : Get rid of calls to the same.
23232
23233         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
23234
23235         (Populate): Define the constructor correctly and set the implementation
23236         attributes.
23237
23238         * typemanager.cs (delegate_types): New hashtable to hold delegates that
23239         have been defined.
23240
23241         (AddDelegateType): Implement.
23242
23243         (IsDelegateType): Implement helper method.
23244
23245         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
23246
23247         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
23248         and accordingly handle it.
23249
23250         * delegate.cs (Populate): Take TypeContainer argument.
23251         Implement bits to define the Invoke method. However, I still haven't figured out
23252         how to take care of the native int bit :-(
23253
23254         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
23255         Qualify the name of the delegate, not its return type !
23256
23257         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
23258         conversion.
23259
23260         (StandardConversionExists): Checking for array types turns out to be recursive.
23261
23262         (ConvertReferenceExplicit): Implement array conversion.
23263
23264         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
23265
23266 2001-10-12  Ravi Pratap  <ravi@ximian.com>
23267
23268         * cs-parser.jay (delegate_declaration): Store the fully qualified
23269         name as it is a type declaration.
23270
23271         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
23272         readonly.
23273
23274         (DefineDelegate): Renamed from Define. Does the same thing essentially,
23275         as TypeContainer::DefineType.
23276
23277         (Populate): Method in which all the definition of the various methods (Invoke)
23278         etc is done.
23279
23280         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
23281         see.
23282
23283         (CloseDelegate): Finally creates the delegate.
23284
23285         * class.cs (TypeContainer::DefineType): Update to define delegates.
23286         (Populate, Emit and CloseType): Do the same thing here too.
23287
23288         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
23289         delegates in all these operations.
23290
23291 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
23292
23293         * expression.cs: LocalTemporary: a new expression used to
23294         reference a temporary that has been created.
23295
23296         * assign.cs: Handle PropertyAccess back here, so that we can
23297         provide the proper semantic access to properties.
23298
23299         * expression.cs (Expression::ConvertReferenceExplicit): Implement
23300         a few more explicit conversions. 
23301
23302         * modifiers.cs: `NEW' modifier maps to HideBySig.
23303
23304         * expression.cs (PropertyExpr): Make this into an
23305         ExpressionStatement, and support the EmitStatement code path. 
23306
23307         Perform get/set error checking, clean up the interface.
23308
23309         * assign.cs: recognize PropertyExprs as targets, and if so, turn
23310         them into toplevel access objects.
23311
23312 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
23313
23314         * expression.cs: PropertyExpr::PropertyExpr: use work around the
23315         SRE.
23316
23317         * typemanager.cs: Keep track here of our PropertyBuilders again to
23318         work around lameness in SRE.
23319
23320 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
23321
23322         * expression.cs (LValue::LValueResolve): New method in the
23323         interface, used to perform a second resolution pass for LValues. 
23324
23325         (This::DoResolve): Catch the use of this in static methods.
23326
23327         (This::LValueResolve): Implement.
23328
23329         (This::Store): Remove warning, assigning to `this' in structures
23330         is 
23331
23332         (Invocation::Emit): Deal with invocation of
23333         methods on value types.  We need to pass the address to structure
23334         methods rather than the object itself.  (The equivalent code to
23335         emit "this" for structures leaves the entire structure on the
23336         stack instead of a pointer to it). 
23337
23338         (ParameterReference::DoResolve): Compute the real index for the
23339         argument based on whether the method takes or not a `this' pointer
23340         (ie, the method is static).
23341
23342         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
23343         value types returned from functions when we need to invoke a
23344         method on the sturcture.
23345
23346
23347 2001-10-11  Ravi Pratap  <ravi@ximian.com>
23348
23349         * class.cs (TypeContainer::DefineType): Method to actually do the business of
23350         defining the type in the Modulebuilder or Typebuilder. This is to take
23351         care of nested types which need to be defined on the TypeBuilder using
23352         DefineNestedMethod.
23353
23354         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
23355         methods in RootContext, only ported to be part of TypeContainer.
23356
23357         (TypeContainer::GetInterfaceOrClass): Ditto.
23358
23359         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
23360
23361         * interface.cs (Interface::DefineInterface): New method. Does exactly
23362         what RootContext.CreateInterface did earlier, only it takes care of nested types 
23363         too.
23364
23365         (Interface::GetInterfaces): Move from RootContext here and port.
23366
23367         (Interface::GetInterfaceByName): Same here.
23368
23369         * rootcontext.cs (ResolveTree): Re-write.
23370
23371         (PopulateTypes): Re-write.
23372
23373         * class.cs (TypeContainer::Populate): Populate nested types too.
23374         (TypeContainer::Emit): Emit nested members too.
23375
23376         * typemanager.cs (AddUserType): Do not make use of the FullName property,
23377         instead just use the name argument passed in as it is already fully
23378         qualified.
23379
23380         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
23381         to TypeContainer mapping to see if a type is user-defined.
23382
23383         * class.cs (TypeContainer::CloseType): Implement. 
23384
23385         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
23386         the default constructor.
23387
23388         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
23389         twice.
23390
23391         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
23392
23393         * interface.cs (CloseType): Create the type here.
23394
23395         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
23396         the hierarchy.
23397
23398         Remove all the methods which are now in TypeContainer.
23399
23400 2001-10-10  Ravi Pratap  <ravi@ximian.com>
23401
23402         * delegate.cs (Define): Re-write bits to define the delegate
23403         correctly.
23404
23405 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
23406
23407         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
23408
23409         * expression.cs (ImplicitReferenceConversion): handle null as well
23410         as a source to convert to any reference type.
23411
23412         * statement.cs (Return): Perform any implicit conversions to
23413         expected return type.  
23414
23415         Validate use of return statement.  
23416
23417         * codegen.cs (EmitContext): Pass the expected return type here.
23418
23419         * class.cs (Method, Constructor, Property): Pass expected return
23420         type to EmitContext.
23421
23422 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
23423
23424         * expression.cs: Make DoResolve take an EmitContext instead of a
23425         TypeContainer.
23426
23427         Replaced `l' and `location' for `loc', for consistency.
23428
23429         (Error, Warning): Remove unneeded Tc argument.
23430
23431         * assign.cs, literal.cs, constant.cs: Update to new calling
23432         convention. 
23433
23434         * codegen.cs: EmitContext now contains a flag indicating whether
23435         code is being generated in a static method or not.
23436
23437         * cs-parser.jay: DecomposeQI, new function that replaces the old
23438         QualifiedIdentifier.  Now we always decompose the assembled
23439         strings from qualified_identifier productions into a group of
23440         memberaccesses.
23441
23442 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
23443
23444         * rootcontext.cs: Deal with field-less struct types correctly now
23445         by passing the size option to Define Type.
23446
23447         * class.cs: Removed hack that created one static field. 
23448
23449 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23450
23451         * statement.cs: Moved most of the code generation here. 
23452
23453 2001-10-09  Ravi Pratap  <ravi@ximian.com>
23454
23455         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
23456         seem very right.
23457
23458         (ElementAccess): Remove useless bits for now - keep checks as the spec
23459         says.
23460
23461 2001-10-08  Ravi Pratap  <ravi@ximian.com>
23462
23463         * expression.cs (ElementAccess::DoResolve): Remove my crap code
23464         and start performing checks according to the spec.
23465
23466 2001-10-07  Ravi Pratap  <ravi@ximian.com>
23467
23468         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
23469         rank_specifiers instead.
23470
23471         (rank_specifiers): Change the order in which the rank specifiers are stored
23472
23473         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
23474
23475         * expression.cs (ElementAccess): Implement the LValue interface too.
23476
23477 2001-10-06  Ravi Pratap  <ravi@ximian.com>
23478
23479         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
23480         except that user defined conversions are not included.
23481
23482         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
23483         perform the conversion of the return type, if necessary.
23484
23485         (New::DoResolve): Check whether we are creating an array or an object
23486         and accordingly do the needful.
23487
23488         (New::Emit): Same here.
23489
23490         (New::DoResolve): Implement guts of array creation.
23491
23492         (New::FormLookupType): Helper function.
23493
23494 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
23495
23496         * codegen.cs: Removed most of the code generation here, and move the
23497         corresponding code generation bits to the statement classes. 
23498
23499         Added support for try/catch/finalize and throw.
23500
23501         * cs-parser.jay: Added support for try/catch/finalize.
23502
23503         * class.cs: Catch static methods having the flags override,
23504         virtual or abstract.
23505
23506         * expression.cs (UserCast): This user cast was not really doing
23507         what it was supposed to do.  Which is to be born in fully resolved
23508         state.  Parts of the resolution were being performed at Emit time! 
23509
23510         Fixed this code.
23511
23512 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23513
23514         * expression.cs: Implicity convert the result from UserCast.
23515
23516 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23517
23518         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
23519         prevented it from working correctly. 
23520
23521         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
23522         merely ConvertImplicit.
23523
23524 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
23525
23526         * typemanager.cs: Make the LookupTypeContainer function static,
23527         and not per-instance.  
23528
23529         * class.cs: Make static FindMembers (the one that takes a Type
23530         argument). 
23531
23532         * codegen.cs: Add EmitForeach here.
23533
23534         * cs-parser.jay: Make foreach a toplevel object instead of the
23535         inline expansion, as we need to perform semantic analysis on it. 
23536
23537 2001-10-05  Ravi Pratap  <ravi@ximian.com>
23538
23539         * expression.cs (Expression::ImplicitUserConversion): Rename to
23540         UserDefinedConversion.
23541
23542         (Expression::UserDefinedConversion): Take an extra argument specifying 
23543         whether we look for explicit user conversions too.
23544
23545         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
23546
23547         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
23548
23549         (ExplicitUserConversion): Make it a call to UserDefinedConversion
23550         with the appropriate arguments.
23551
23552         * cs-parser.jay (cast_expression): Record location too.
23553
23554         * expression.cs (Cast): Record location info.
23555
23556         (Expression::ConvertExplicit): Take location argument.
23557
23558         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
23559         to determine if we are doing explicit conversions.
23560
23561         (UserCast::Emit): Update accordingly.
23562
23563         (Expression::ConvertExplicit): Report an error if everything fails.
23564
23565         * ../errors/cs0030.cs : Add.
23566
23567 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
23568
23569         * modifiers.cs: If the ABSTRACT keyword is present, also set the
23570         virtual and newslot bits. 
23571
23572         * class.cs (TypeContainer::RegisterRequiredImplementations):
23573         Record methods we need.
23574
23575         (TypeContainer::MakeKey): Helper function to make keys for
23576         MethodBases, since the Methodbase key is useless.
23577
23578         (TypeContainer::Populate): Call RegisterRequiredImplementations
23579         before defining the methods.   
23580
23581         Create a mapping for method_builders_to_methods ahead of time
23582         instead of inside a tight loop.
23583
23584         (::RequireMethods):  Accept an object as the data to set into the
23585         hashtable so we can report interface vs abstract method mismatch.
23586
23587 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23588
23589         * report.cs: Make all of it static.
23590
23591         * rootcontext.cs: Drop object_type and value_type computations, as
23592         we have those in the TypeManager anyways.
23593
23594         Drop report instance variable too, now it is a global.
23595
23596         * driver.cs: Use try/catch on command line handling.
23597
23598         Add --probe option to debug the error reporting system with a test
23599         suite. 
23600
23601         * report.cs: Add support for exiting program when a probe
23602         condition is reached.
23603
23604 2001-10-03  Ravi Pratap  <ravi@ximian.com>
23605
23606         * expression.cs (Binary::DoNumericPromotions): Fix the case when
23607         we do a forcible conversion regardless of type, to check if 
23608         ForceConversion returns a null.
23609
23610         (Binary::error19): Use location to report error.
23611
23612         (Unary::error23): Use location here too.
23613
23614         * ../errors/cs0019.cs : Check in.
23615
23616         * ../errors/cs0023.cs : Check in.
23617
23618         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
23619         case of a non-null MethodInfo object with a length of 0 !
23620
23621         (Binary::ResolveOperator): Flag error if overload resolution fails to find
23622         an applicable member - according to the spec :-)
23623         Also fix logic to find members in base types.
23624
23625         (Unary::ResolveOperator): Same here.
23626
23627         (Unary::report23): Change name to error23 and make first argument a TypeContainer
23628         as I was getting thoroughly confused between this and error19 :-)
23629
23630         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
23631         (::FindMostEncompassedType): Implement.
23632         (::FindMostEncompassingType): Implement.
23633         (::StandardConversionExists): Implement.
23634
23635         (UserImplicitCast): Re-vamp. We now need info about most specific
23636         source and target types so that we can do the necessary conversions.
23637
23638         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
23639         mathematical union with no duplicates.
23640
23641 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
23642
23643         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
23644         in order from base classes to child classes, so that we can in
23645         child classes look up in our parent for method names and
23646         attributes (required for handling abstract, virtual, new, override
23647         constructs: we need to instrospect our base class, and if we dont
23648         populate the classes in order, the introspection might be
23649         incorrect.  For example, a method could query its parent before
23650         the parent has any methods and would determine that the parent has
23651         no abstract methods (while it could have had them)).
23652
23653         (RootContext::CreateType): Record the order in which we define the
23654         classes.
23655
23656 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
23657
23658         * class.cs (TypeContainer::Populate): Also method definitions can
23659         fail now, keep track of this.
23660
23661         (TypeContainer::FindMembers): Implement support for
23662         DeclaredOnly/noDeclaredOnly flag.
23663
23664         (Constructor::Emit) Return the ConstructorBuilder.
23665
23666         (Method::Emit) Return the MethodBuilder. 
23667         Check for abstract or virtual methods to be public.
23668
23669         * rootcontext.cs (RootContext::CreateType): Register all the
23670         abstract methods required for the class to be complete and the
23671         interface methods that must be implemented. 
23672
23673         * cs-parser.jay: Report error 501 (method requires body if it is
23674         not marked abstract or extern).
23675
23676         * expression.cs (TypeOf::Emit): Implement.
23677
23678         * typemanager.cs: runtime_handle_type, new global type.
23679
23680         * class.cs (Property::Emit): Generate code for properties.
23681
23682 2001-10-02  Ravi Pratap  <ravi@ximian.com>
23683
23684         * expression.cs (Unary::ResolveOperator): Find operators on base type
23685         too - we now conform exactly to the spec.
23686
23687         (Binary::ResolveOperator): Same here.
23688
23689         * class.cs (Operator::Define): Fix minor quirk in the tests.
23690
23691         * ../errors/cs0215.cs : Added.
23692
23693         * ../errors/cs0556.cs : Added.
23694
23695         * ../errors/cs0555.cs : Added.
23696
23697 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23698
23699         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
23700         single integer which is really efficient
23701
23702 2001-10-01  Ravi Pratap  <ravi@ximian.com>
23703
23704         *  expression.cs (Expression::ImplicitUserConversion): Use location
23705         even in the case when we are examining True operators.
23706  
23707         * class.cs (Operator::Define): Perform extensive checks to conform
23708         with the rules for operator overloading in the spec.
23709
23710         * expression.cs (Expression::ImplicitReferenceConversion): Implement
23711         some of the other conversions mentioned in the spec.
23712
23713         * typemanager.cs (array_type): New static member for the System.Array built-in
23714         type.
23715
23716         (cloneable_interface): For System.ICloneable interface.
23717
23718         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
23719         we start resolving the tree and populating types.
23720
23721         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
23722  
23723 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
23724
23725         * expression.cs (Expression::ExprClassFromMemberInfo,
23726         Expression::Literalize): Create literal expressions from
23727         FieldInfos which are literals.
23728
23729         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
23730         type casts, because they were wrong.  The test suite in tests
23731         caught these ones.
23732
23733         (ImplicitNumericConversion): ushort to ulong requires a widening
23734         cast. 
23735
23736         Int32 constant to long requires widening cast as well.
23737
23738         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
23739         for integers because the type on the stack is not i4.
23740
23741 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
23742
23743         * expression.cs (report118): require location argument. 
23744
23745         * parameter.cs: Do not dereference potential null value.
23746
23747         * class.cs: Catch methods that lack the `new' keyword when
23748         overriding a name.  Report warnings when `new' is used without
23749         anything being there to override.
23750
23751         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
23752
23753         * class.cs: Only add constructor to hashtable if it is non-null
23754         (as now constructors can fail on define).
23755
23756         (TypeManager, Class, Struct): Take location arguments.
23757
23758         Catch field instance initialization in structs as errors.
23759
23760         accepting_filter: a new filter for FindMembers that is static so
23761         that we dont create an instance per invocation.
23762
23763         (Constructor::Define): Catch errors where a struct constructor is
23764         parameterless 
23765
23766         * cs-parser.jay: Pass location information for various new
23767         constructs. 
23768
23769         * delegate.cs (Delegate): take a location argument.
23770
23771         * driver.cs: Do not call EmitCode if there were problesm in the
23772         Definition of the types, as many Builders wont be there. 
23773
23774         * decl.cs (Decl::Decl): Require a location argument.
23775
23776         * cs-tokenizer.cs: Handle properly hex constants that can not fit
23777         into integers, and find the most appropiate integer for it.
23778
23779         * literal.cs: Implement ULongLiteral.
23780
23781         * rootcontext.cs: Provide better information about the location of
23782         failure when CreateType fails.
23783
23784 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
23785
23786         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
23787         as well.
23788
23789         * expression.cs (Binary::CheckShiftArguments): Add missing type
23790         computation.
23791         (Binary::ResolveOperator): Add type to the logical and and logical
23792         or, Bitwise And/Or and Exclusive Or code paths, it was missing
23793         before.
23794
23795         (Binary::DoNumericPromotions): In the case where either argument
23796         is ulong (and most signed types combined with ulong cause an
23797         error) perform implicit integer constant conversions as well.
23798
23799 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23800
23801         * expression.cs (UserImplicitCast): Method should always be
23802         non-null. 
23803         (Invocation::BetterConversion): Simplified test for IntLiteral.
23804
23805         (Expression::ImplicitNumericConversion): Split this routine out.
23806         Put the code that performs implicit constant integer conversions
23807         here. 
23808
23809         (Expression::Resolve): Become a wrapper around DoResolve so we can
23810         check eclass and type being set after resolve.
23811
23812         (Invocation::Badness): Remove this dead function
23813
23814         (Binary::ResolveOperator): Do not compute the expensive argumnets
23815         unless we have a union for it.
23816
23817         (Probe::Emit): Is needs to do an isinst and then
23818         compare against null.
23819
23820         (::CanConvert): Added Location argument.  If the Location argument
23821         is null (Location.Null), then we do not report errors.  This is
23822         used by the `probe' mechanism of the Explicit conversion.  We do
23823         not want to generate an error for something that the user
23824         explicitly requested to be casted.  But the pipeline for an
23825         explicit cast first tests for potential implicit casts.
23826
23827         So for now, if the Location is null, it means `Probe only' to
23828         avoid adding another argument.   Might have to revise this
23829         strategy later.
23830
23831         (ClassCast): New class used to type cast objects into arbitrary
23832         classes (used in Explicit Reference Conversions).
23833
23834         Implement `as' as well.
23835
23836         Reverted all the patches from Ravi below: they were broken:
23837
23838                 * The use of `level' as a mechanism to stop recursive
23839                   invocations is wrong.  That was there just to catch the
23840                   bug with a strack trace but not as a way of addressing
23841                   the problem.
23842
23843                   To fix the problem we have to *understand* what is going
23844                   on and the interactions and come up with a plan, not
23845                   just get things going.
23846
23847                 * The use of the type conversion cache that I proposed
23848                   last night had an open topic: How does this work across
23849                   protection domains.  A user defined conversion might not
23850                   be public in the location where we are applying the
23851                   conversion, a different conversion might be selected
23852                   (ie, private A->B (better) but public B->A (worse),
23853                   inside A, A->B applies, but outside it, B->A will
23854                   apply).
23855
23856                 * On top of that (ie, even if the above is solved),
23857                   conversions in a cache need to be abstract.  Ie, `To
23858                   convert from an Int to a Short use an OpcodeCast', not
23859                   `To convert from an Int to a Short use the OpcodeCast on
23860                   the variable 5' (which is what this patch was doing).
23861
23862 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23863
23864         * expression.cs (Invocation::ConversionExists): Re-write to use
23865         the conversion cache
23866
23867         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
23868         cache all conversions done, not just user-defined ones.
23869
23870         (Invocation::BetterConversion): The real culprit. Use ConversionExists
23871         to determine if a conversion exists instead of acutually trying to 
23872         perform the conversion. It's faster too.
23873
23874         (Expression::ConvertExplicit): Modify to use ConversionExists to check
23875         and only then attempt the implicit conversion.
23876
23877 2001-09-28  Ravi Pratap  <ravi@ximian.com>
23878
23879         * expression.cs (ConvertImplicit): Use a cache for conversions
23880         already found. Check level of recursion and bail out if necessary.
23881
23882 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
23883
23884         * typemanager.cs (string_concat_string_string, string_concat_object_object):
23885         Export standard methods that we expect for string operations.
23886
23887         * statement.cs (Block::UsageWarning): Track usage of variables and
23888         report the errors for not used variables.
23889
23890         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
23891         operator. 
23892
23893 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
23894
23895         * codegen.cs: remove unnneded code 
23896
23897         * expression.cs: Removed BuiltinTypeAccess class
23898
23899         Fix the order in which implicit conversions are
23900         done.  
23901
23902         The previous fixed dropped support for boxed conversions (adding a
23903         test to the test suite now)
23904
23905         (UserImplicitCast::CanConvert): Remove test for source being null,
23906         that code is broken.  We should not feed a null to begin with, if
23907         we do, then we should track the bug where the problem originates
23908         and not try to cover it up here.
23909
23910         Return a resolved expression of type UserImplicitCast on success
23911         rather than true/false.  Ravi: this is what I was talking about,
23912         the pattern is to use a static method as a "constructor" for
23913         objects. 
23914
23915         Also, do not create arguments until the very last minute,
23916         otherwise we always create the arguments even for lookups that
23917         will never be performed. 
23918
23919         (UserImplicitCast::Resolve): Eliminate, objects of type
23920         UserImplicitCast are born in a fully resolved state. 
23921
23922         * typemanager.cs (InitCoreTypes): Init also value_type
23923         (System.ValueType). 
23924
23925         * expression.cs (Cast::Resolve): First resolve the child expression.
23926
23927         (LValue): Add new method AddressOf to be used by
23928         the `&' operator.  
23929
23930         Change the argument of Store to take an EmitContext instead of an
23931         ILGenerator, because things like FieldExpr need to be able to call
23932         their children expression to generate the instance code. 
23933
23934         (Expression::Error, Expression::Warning): Sugar functions for
23935         reporting errors.
23936
23937         (Expression::MemberLookup): Accept a TypeContainer instead of a
23938         Report as the first argument.
23939
23940         (Expression::ResolvePrimary): Killed.  I still want to improve
23941         this as currently the code is just not right.
23942
23943         (Expression::ResolveMemberAccess): Simplify, but it is still
23944         wrong. 
23945
23946         (Unary::Resolve): Catch errors in AddressOf operators.
23947
23948         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
23949         index to a byte for the short-version, or the compiler will choose
23950         the wrong Emit call, which generates the wrong data.
23951
23952         (ParameterReference::Emit, ::Store): same.
23953
23954         (FieldExpr::AddressOf): Implement.
23955
23956         * typemanager.cs: TypeManager: made public variable instead of
23957         property.
23958
23959         * driver.cs: document --fatal.
23960
23961         * report.cs (ErrorMessage, WarningMessage): new names for the old
23962         Error and Warning classes.
23963
23964         * cs-parser.jay (member_access): Turn built-in access to types
23965         into a normal simplename
23966
23967 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23968
23969         * expression.cs (Invocation::BetterConversion): Fix to cope
23970         with q being null, since this was introducing a bug.
23971
23972         * expression.cs (ConvertImplicit): Do built-in conversions first.
23973
23974 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23975
23976         * expression.cs (UserImplicitCast::Resolve): Fix bug.
23977
23978 2001-09-27  Ravi Pratap  <ravi@ximian.com>
23979
23980         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
23981         I had introduced long ago (what's new ?).
23982
23983         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
23984         the work of all the checking. 
23985         (ConvertImplicit): Call CanConvert and only then create object if necessary.
23986         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
23987
23988         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
23989         that is the right way. 
23990
23991         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
23992         overloading resolution. Use everywhere instead of cutting and pasting code.
23993
23994         (Binary::ResolveOperator): Use MakeUnionSet.
23995
23996         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
23997         we have to convert to bool types. Not complete yet.
23998
23999 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24000
24001         * typemanager.cs (TypeManager::CSharpName): support ushort.
24002
24003         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24004         to provide an expression that performsn an implicit constant int
24005         conversion (section 6.1.6).
24006         (Expression::ConvertImplicitRequired): Reworked to include
24007         implicit constant expression conversions.
24008
24009         (Expression::ConvertNumericExplicit): Finished.
24010
24011         (Invocation::Emit): If InstanceExpression is null, then it means
24012         that we perform a call on this.
24013
24014 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24015
24016         * expression.cs (Unary::Emit): Remove some dead code.
24017         (Probe): Implement Resolve and Emit for `is'.
24018         (Expression::ConvertImplicitRequired): Attempt to do constant
24019         expression conversions here.  Maybe should be moved to
24020         ConvertImplicit, but I am not sure.
24021         (Expression::ImplicitLongConstantConversionPossible,
24022         Expression::ImplicitIntConstantConversionPossible): New functions
24023         that tell whether is it possible to apply an implicit constant
24024         expression conversion.
24025
24026         (ConvertNumericExplicit): Started work on explicit numeric
24027         conversions.
24028
24029         * cs-parser.jay: Update operator constants.
24030
24031         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24032         (Parameters::GetSignature): Hook up VerifyArgs here.
24033         (Parameters::VerifyArgs): Verifies that no two arguments have the
24034         same name. 
24035
24036         * class.cs (Operator): Update the operator names to reflect the
24037         ones that the spec expects (as we are just stringizing the
24038         operator names).
24039
24040         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24041         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24042         previous usage did only work for our methods.
24043         (Expression::ConvertImplicit): Handle decimal implicit numeric
24044         conversions as well.
24045         (Expression::InternalTypeConstructor): Used to invoke constructors
24046         on internal types for default promotions.
24047
24048         (Unary::Emit): Implement special handling for the pre/post
24049         increment/decrement for overloaded operators, as they need to have
24050         the same semantics as the other operators.
24051
24052         (Binary::ResolveOperator): ditto.
24053         (Invocation::ConversionExists): ditto.
24054         (UserImplicitCast::Resolve): ditto.
24055
24056 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24057
24058         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24059         operator, return after emitting body. Regression tests pass again !
24060
24061         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24062         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24063         (Invocation::OverloadResolve): Ditto.
24064         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24065
24066         * everywhere : update calls to the above methods accordingly.
24067
24068 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24069
24070         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24071
24072         * expression.cs (ExpressionStatement): New base class used for
24073         expressions that can appear in statements, so that we can provide
24074         an alternate path to generate expression that do not leave a value
24075         on the stack.
24076
24077         (Expression::Emit, and all the derivatives): We no longer return
24078         whether a value is left on the stack or not.  Every expression
24079         after being emitted leaves a single value on the stack.
24080
24081         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24082         facilties of ExpressionStatement if possible.
24083
24084         * cs-parser.jay: Update statement_expression.
24085
24086 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24087
24088         * driver.cs: Change the wording of message
24089
24090 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24091
24092         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24093         the type of the expression to the return type of the method if
24094         we have an overloaded operator match ! The regression tests pass again !
24095         (Unary::ResolveOperator): Ditto.
24096
24097         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24098         to find "op_Implicit", not "implicit" ;-)
24099         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24100         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24101
24102         * everywhere : Correct calls to the above accordingly.
24103
24104         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24105         (ConvertImplicit): Do user-defined conversion if it exists.
24106
24107 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24108
24109         * assign.cs: track location.
24110         (Resolve): Use implicit conversions on assignment.
24111
24112         * literal.cs: Oops.  Not good, Emit of short access values should
24113         pass (Bytes) or the wrong argument will be selected.
24114
24115         * expression.cs (Unary::Emit): Emit code for -expr.
24116
24117         (Unary::ResolveOperator): Handle `Substract' for non-constants
24118         (substract from zero from the non-constants).
24119         Deal with Doubles as well. 
24120
24121         (Expression::ConvertImplicitRequired): New routine that reports an
24122         error if no implicit conversion exists. 
24123
24124         (Invocation::OverloadResolve): Store the converted implicit
24125         expressions if we make them
24126
24127 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24128
24129         * class.cs (ConstructorInitializer): Take a Location argument.
24130         (ConstructorBaseInitializer): Same here.
24131         (ConstructorThisInitializer): Same here.
24132
24133         * cs-parser.jay : Update all calls accordingly.
24134
24135         * expression.cs (Unary, Binary, New): Take location argument.
24136         Update accordingly everywhere.
24137
24138         * cs-parser.jay : Update all calls to the above to take a location
24139         argument.
24140
24141         * class.cs : Ditto.
24142
24143 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24144
24145         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24146         (Invocation::BetterConversion): Same here
24147         (Invocation::ConversionExists): Ditto.
24148
24149         (Invocation::ConversionExists): Implement.
24150
24151 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24152
24153         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24154         Also take an additional TypeContainer argument.
24155
24156         * All over : Pass in TypeContainer as argument to OverloadResolve.
24157
24158         * typemanager.cs (CSharpName): Update to check for the string type and return
24159         that too.
24160
24161         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24162         a given method.
24163
24164 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24165
24166         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24167         (Invocation::BetterFunction): Implement.
24168         (Invocation::BetterConversion): Implement.
24169         (Invocation::ConversionExists): Skeleton, no implementation yet.
24170
24171         Okay, things work fine !
24172
24173 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24174
24175         * typemanager.cs: declare and load enum_type, delegate_type and
24176         void_type. 
24177
24178         * expression.cs (Expression::Emit): Now emit returns a value that
24179         tells whether a value is left on the stack or not.  This strategy
24180         might be reveted tomorrow with a mechanism that would address
24181         multiple assignments.
24182         (Expression::report118): Utility routine to report mismatches on
24183         the ExprClass.
24184
24185         (Unary::Report23): Report impossible type/operator combination
24186         utility function.
24187
24188         (Unary::IsIncrementableNumber): Whether the type can be
24189         incremented or decremented with add.
24190         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24191         complemented. 
24192         (Unary::ResolveOperator): Implement ++, !, ~,
24193
24194         (Invocation::Emit): Deal with new Emit convetion.
24195
24196         * All Expression derivatives: Updated their Emit method to return
24197         whether they leave values on the stack or not.
24198
24199         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24200         stack for expressions that are statements. 
24201
24202 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24203
24204         * expression.cs (LValue): New interface.  Must be implemented by
24205         LValue objects.
24206         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24207         LValue interface.
24208
24209         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24210         interface for generating code, simplifies the code.
24211
24212 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24213
24214         * expression.cs (everywhere): Comment out return statements in ::Resolve
24215         methods to avoid the warnings.
24216
24217 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24218
24219         * driver.cs (parse): Report error 2001 if we can not open the
24220         source file.
24221
24222         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24223         not resolve it.
24224
24225         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24226         object. 
24227
24228         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24229         otherwise nested blocks end up with the same index.
24230
24231         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24232
24233         * expression.cs:  Instead of having FIXMEs in the Resolve
24234         functions, throw exceptions so it is obvious that we are facing a
24235         bug. 
24236
24237         * cs-parser.jay (invocation_expression): Pass Location information.
24238
24239         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
24240         Use a basename for those routines because .NET does not like paths
24241         on them. 
24242
24243         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
24244         already defined.
24245
24246 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
24247
24248         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
24249         are loading the correct data types (throws an exception if not).
24250         (TypeManager::InitCoreTypes): Use CoreLookupType
24251
24252         * expression.cs (Unary::ResolveOperator): return the child
24253         expression for expressions which are just +expr.
24254         (Unary::ResolveOperator): Return negative literals for -LITERAL
24255         expressions (otherwise they are Unary {Literal}).
24256         (Invocation::Badness): Take into account `Implicit constant
24257         expression conversions'.
24258
24259         * literal.cs (LongLiteral): Implement long literal class.
24260         (IntLiteral): export the `Value' of the intliteral. 
24261
24262 2001-09-19  Ravi Pratap  <ravi@ximian.com>
24263
24264         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
24265
24266         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
24267         instead of 'Operator'
24268
24269         * expression.cs (Binary::ResolveOperator): Update accordingly.
24270         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
24271         and 'Minus'
24272
24273         * cs-parser.jay (unary_expression): Update to use the new names.
24274
24275         * gen-treedump.cs (GetUnary): Same here.
24276
24277         * expression.cs (Unary::Resolve): Implement.
24278         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
24279         operators are found instead of making noise ;-)
24280         (Unary::ResolveOperator): New method to do precisely the same thing which
24281         Binary::ResolveOperator does for Binary expressions.
24282         (Unary.method, .Arguments): Add.
24283         (Unary::OperName): Implement.   
24284         (Unary::ForceConversion): Copy and Paste !
24285
24286         * class.cs (Operator::Define): Fix a small bug for the case when we have 
24287         a unary operator.
24288
24289         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
24290         for the inbuilt operators. Only overloading works for now ;-)
24291
24292 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
24293
24294         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
24295         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
24296
24297         * expression.cs (This::Emit): Implement. 
24298         (This::Resolve): Implement.
24299         (TypeOf:Resolve): Implement.
24300         (Expression::ResolveSimpleName): Add an implicit this to instance
24301         field references. 
24302         (MemberAccess::Resolve): Deal with Parameters and Fields. 
24303         Bind instance variable to Field expressions.
24304         (FieldExpr::Instance): New field used to track the expression that
24305         represents the object instance.
24306         (FieldExpr::Resolve): Track potential errors from MemberLookup not
24307         binding 
24308         (FieldExpr::Emit): Implement.
24309
24310         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
24311         the last instruction contains a return opcode to avoid generating
24312         the last `ret' instruction (this generates correct code, and it is
24313         nice to pass the peverify output).
24314
24315         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
24316         initializer for static and instance variables.
24317         (Constructor::Emit): Allow initializer to be null in the case of
24318         static constructors.  Only emit initializer for instance
24319         constructors. 
24320
24321         (TypeContainer::FindMembers): Return a null array if there are no
24322         matches.
24323
24324         Also fix the code for the MemberTypes.Method branch, as it was not
24325         scanning that for operators (or tried to access null variables before).
24326
24327         * assign.cs (Assign::Emit): Handle instance and static fields. 
24328
24329         * TODO: Updated.
24330
24331         * driver.cs: Stop compilation if there are parse errors.
24332
24333         * cs-parser.jay (constructor_declaration): Provide default base
24334         initializer for non-static constructors.
24335         (constructor_declarator): Do not provide a default base
24336         initializers if none was specified.
24337         Catch the fact that constructors should not have parameters.
24338
24339         * class.cs: Do not emit parent class initializers for static
24340         constructors, that should be flagged as an error.
24341
24342 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24343
24344         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
24345         Move back code into TypeContainer::Populate.
24346
24347 2001-09-18  Ravi Pratap  <ravi@ximian.com>
24348
24349         * class.cs (TypeContainer::AddConstructor): Fix the check to
24350         compare against Name, not Basename. 
24351         (Operator::OpType): Change Plus and Minus to Add and Subtract.
24352
24353         * cs-parser.jay : Update accordingly.
24354
24355         * class.cs (TypeContainer::FindMembers): For the case where we are searching
24356         for methods, don't forget to look into the operators too.
24357         (RegisterMethodBuilder): Helper method to take care of this for
24358         methods, constructors and operators.
24359         (Operator::Define): Completely revamp.
24360         (Operator.OperatorMethod, MethodName): New fields.
24361         (TypeContainer::Populate): Move the registering of builders into
24362         RegisterMethodBuilder.
24363         (Operator::Emit): Re-write.
24364
24365         * expression.cs (Binary::Emit): Comment out code path to emit method
24366         invocation stuff for the case when we have a user defined operator. I am
24367         just not able to get it right !
24368
24369 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24370
24371         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
24372         argument. 
24373
24374         (Expression::MemberLookup): Provide a version that allows to
24375         specify the MemberTypes and BindingFlags. 
24376
24377         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
24378         so it was not fetching variable information from outer blocks.
24379
24380         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
24381         Beforefieldinit as it was buggy.
24382
24383         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
24384         that Ravi put here.  
24385
24386         * class.cs (Constructor::Emit): Only emit if block is not null.
24387         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
24388         deal with this by semantically definining it as if the user had
24389         done it.
24390
24391         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
24392         constructors as we now "emit" them at a higher level.
24393
24394         (TypeContainer::DefineDefaultConstructor): Used to define the
24395         default constructors if none was provided.
24396
24397         (ConstructorInitializer): Add methods Resolve and Emit. 
24398
24399         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
24400
24401 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24402
24403         * class.cs (TypeContainer::EmitDefaultConstructor): Register
24404         the default constructor builder with our hashtable for methodbuilders
24405         to methodcores.
24406
24407         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
24408         and argument_count is 0 in which case we have a match.
24409         (Binary::ResolveOperator): More null checking and miscellaneous coding
24410         style cleanup.
24411
24412 2001-09-17  Ravi Pratap  <ravi@ximian.com>
24413
24414         * rootcontext.cs (IsNameSpace): Compare against null.
24415
24416         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
24417
24418         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
24419         and Unary::Operator.
24420
24421         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
24422         accordingly.
24423
24424         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
24425         we have overloaded operators.
24426         (Binary::ResolveOperator): Implement the part which does the operator overload
24427         resolution.
24428
24429         * class.cs (Operator::Emit): Implement.
24430         (TypeContainer::Emit): Emit the operators we have too.
24431
24432         * expression.cs (Binary::Emit): Update to emit the appropriate code for
24433         the case when we have a user-defined operator.
24434
24435 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
24436
24437         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
24438
24439 2001-09-16  Ravi Pratap  <ravi@ximian.com>
24440
24441         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
24442         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
24443         (Constructor::Emit): Implement.
24444         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
24445         if we have no work to do. 
24446         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
24447         Emit method.
24448
24449         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
24450         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
24451
24452         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
24453         of parent.parent.
24454
24455 2001-09-15  Ravi Pratap  <ravi@ximian.com>
24456
24457         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
24458         in the source.
24459         (Tree::RecordNamespace): Method to do what the name says ;-)
24460         (Tree::Namespaces): Property to get at the namespaces hashtable.
24461
24462         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
24463         keep track.
24464
24465         * rootcontext.cs (IsNamespace): Fixed it :-)
24466
24467 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24468
24469         * class.cs (TypeContainer::FindMembers): Add support for
24470         constructors. 
24471         (MethodCore): New class that encapsulates both the shared aspects
24472         of a Constructor and a Method.  
24473         (Method, Constructor): Factored pieces into MethodCore.
24474
24475         * driver.cs: Added --fatal which makes errors throw exceptions.
24476         Load System assembly as well as part of the standard library.
24477
24478         * report.cs: Allow throwing exceptions on errors for debugging.
24479
24480         * modifiers.cs: Do not use `parent', instead use the real type
24481         container to evaluate permission settings.
24482
24483         * class.cs: Put Ravi's patch back in.  He is right, and we will
24484         have to cope with the
24485
24486 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24487
24488         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
24489         FamORAssem, not FamANDAssem.
24490
24491 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
24492
24493         * driver.cs: Added --parse option that only parses its input files
24494         and terminates.
24495
24496         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
24497         incorrect.  IsTopLevel is not used to tell whether an object is
24498         root_types or not (that can be achieved by testing this ==
24499         root_types).  But to see if this is a top-level *class* (not
24500         necessarly our "toplevel" container). 
24501
24502 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24503
24504         * enum.cs (Enum::Define): Modify to call the Lookup method on the
24505         parent instead of a direct call to GetType.
24506
24507 2001-09-14  Ravi Pratap  <ravi@ximian.com>
24508
24509         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
24510         Modifiers.TypeAttr. This should just be a call to that method.
24511
24512         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
24513         object so that we can determine if we are top-level or not.
24514
24515         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
24516         TypeContainer too.
24517
24518         * enum.cs (Enum::Define): Ditto.
24519
24520         * modifiers.cs (FieldAttr): Re-write.
24521
24522         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
24523         (TypeContainer::HaveStaticConstructor): New property to provide access
24524         to precisely that info.
24525
24526         * modifiers.cs (MethodAttr): Re-write.
24527         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
24528
24529         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
24530         of top-level types as claimed.
24531
24532 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24533
24534         * expression.cs (MemberLookup): Fruitless attempt to lookup
24535         constructors.  Maybe I need to emit default constructors?  That
24536         might be it (currently .NET emits this for me automatically).
24537         (Invocation::OverloadResolve): Cope with Arguments == null.
24538         (Invocation::EmitArguments): new function, shared by the new
24539         constructor and us.
24540         (Invocation::Emit): Handle static and instance methods.  Emit
24541         proper call instruction for virtual or non-virtual invocations.
24542         (New::Emit): Implement.
24543         (New::Resolve): Implement.
24544         (MemberAccess:Resolve): Implement.
24545         (MethodGroupExpr::InstanceExpression): used conforming to the spec
24546         to track instances.
24547         (FieldExpr::Resolve): Set type.
24548
24549         * support.cs: Handle empty arguments.
24550                 
24551         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
24552         SimpleLookup): Auxiliary routines to help parse a qualifier
24553         identifier.  
24554
24555         Update qualifier_identifier rule.
24556
24557         * codegen.cs: Removed debugging messages.
24558
24559         * class.cs: Make this a global thing, this acts just as a "key" to
24560         objects that we might have around.
24561
24562         (Populate): Only initialize method_builders_to_methods once.
24563
24564         * expression.cs (PropertyExpr): Initialize type from the
24565         PropertyType. 
24566
24567         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
24568         Resolve pattern.  Attempt to implicitly convert value to boolean.
24569         Emit code.
24570
24571         * expression.cs: Set the type for the int32/int32 argument case.
24572         (Binary::ResolveOperator): Set the return type to boolean for
24573         comparission operators
24574
24575         * typemanager.cs: Remove debugging print code.
24576
24577         (Invocation::Resolve): resolve type.
24578
24579         * class.cs: Allocate a MemberInfo of the correct size, as the code
24580         elsewhere depends on the test to reflect the correct contents.
24581
24582         (Method::) Keep track of parameters, due to System.Reflection holes
24583
24584         (TypeContainer::Populate): Keep track of MethodBuilders to Method
24585         mapping here.
24586
24587         (TypeContainer::FindMembers): Use ArrayList and then copy an array
24588         of the exact size and return that.
24589
24590         (Class::LookupMethodByBuilder): New function that maps
24591         MethodBuilders to its methods.  Required to locate the information
24592         on methods because System.Reflection bit us again.
24593
24594         * support.cs: New file, contains an interface ParameterData and
24595         two implementations: ReflectionParameters and InternalParameters
24596         used to access Parameter information.  We will need to grow this
24597         as required.
24598
24599         * expression.cs (Invocation::GetParameterData): implement a cache
24600         and a wrapper around the ParameterData creation for methods. 
24601         (Invocation::OverloadResolve): Use new code.
24602
24603 2001-09-13  Ravi Pratap  <ravi@ximian.com>
24604
24605         * class.cs (TypeContainer::EmitField): Remove and move into 
24606         (Field::Define): here and modify accordingly.
24607         (Field.FieldBuilder): New member.
24608         (TypeContainer::Populate): Update accordingly.
24609         (TypeContainer::FindMembers): Implement.
24610
24611 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
24612
24613         * statement.cs: (VariableInfo::VariableType): New field to be
24614         initialized with the full type once it is resolved. 
24615
24616 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
24617
24618         * parameter.cs (GetParameterInfo): Use a type cache to compute
24619         things only once, and to reuse this information
24620
24621         * expression.cs (LocalVariableReference::Emit): Implement.
24622         (OpcodeCast::Emit): fix.
24623
24624         (ParameterReference::Resolve): Implement.
24625         (ParameterReference::Emit): Implement.
24626
24627         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
24628         that are expressions need to stay as Expressions.
24629
24630         * typemanager.cs (CSharpName): Returns the C# name of a type if
24631         possible. 
24632
24633         * expression.cs (Expression::ConvertImplicit): New function that
24634         implements implicit type conversions.
24635
24636         (Expression::ImplicitReferenceConversion): Implements implicit
24637         reference conversions.
24638
24639         (EmptyCast): New type for transparent casts.
24640
24641         (OpcodeCast): New type for casts of types that are performed with
24642         a sequence of bytecodes.
24643
24644         (BoxedCast): New type used for casting value types into reference
24645         types.  Emits a box opcode.
24646
24647         (Binary::DoNumericPromotions): Implements numeric promotions of
24648         and computation of the Binary::Type.
24649
24650         (Binary::EmitBranchable): Optimization.
24651
24652         (Binary::Emit): Implement code emission for expressions.
24653
24654         * typemanager.cs (TypeManager): Added two new core types: sbyte
24655         and byte.
24656
24657 2001-09-12  Ravi Pratap  <ravi@ximian.com>
24658
24659         * class.cs (TypeContainer::FindMembers): Method which does exactly
24660         what Type.FindMembers does, only we don't have to use reflection. No
24661         implementation yet.
24662
24663         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
24664         typecontainer objects as we need to get at them.
24665         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
24666
24667         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
24668         typecontainer object.
24669
24670         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
24671         of just a Report object.
24672
24673 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24674
24675         * class.cs (Event::Define): Go back to using the prefixes "add_" and
24676         "remove_"
24677         (TypeContainer::Populate): Now define the delegates of the type too.
24678         (TypeContainer.Delegates): Property to access the list of delegates defined
24679         in the type.
24680
24681         * delegates.cs (Delegate::Define): Implement partially.
24682
24683         * modifiers.cs (TypeAttr): Handle more flags.
24684
24685 2001-09-11  Ravi Pratap  <ravi@ximian.com>
24686
24687         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
24688         and not <=
24689         (Operator::Define): Re-write logic to get types by using the LookupType method
24690         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
24691         (Indexer::Define): Ditto.
24692         (Event::Define): Ditto.
24693         (Property::Define): Ditto.
24694
24695 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24696
24697         * class.cs (TypeContainer::Populate): Now define operators too. 
24698         (TypeContainer.Operators): New property to access the list of operators
24699         in a type.
24700         (Operator.OperatorMethodBuilder): New member to hold the method builder
24701         for the operator we are defining.
24702         (Operator::Define): Implement.
24703
24704 2001-09-10  Ravi Pratap  <ravi@ximian.com>
24705
24706         * class.cs (Event::Define): Make the prefixes of the accessor methods
24707         addOn_ and removeOn_ 
24708
24709         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
24710         of the location being passed in too. Ideally, this should go later since all
24711         error reporting should be done through the Report object.
24712
24713         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
24714         (Populate): Iterate thru the indexers we have and define them too.
24715         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
24716         for the get and set accessors.
24717         (Indexer::Define): Implement.
24718
24719 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
24720
24721         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
24722         my previous implementation, did not work.
24723
24724         * typemanager.cs: Add a couple of missing types (the longs).
24725
24726         * literal.cs: Use TypeManager.bool_type instead of getting it.
24727
24728         * expression.cs (EventExpr): New kind of expressions.
24729         (Expressio::ExprClassFromMemberInfo): finish
24730
24731 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
24732
24733         * assign.cs: Emit stores to static fields differently.
24734
24735 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24736
24737         * Merge in changes and adjust code to tackle conflicts. Backed out my
24738         code in Assign::Resolve ;-) 
24739
24740 2001-09-08  Ravi Pratap  <ravi@ximian.com>
24741
24742         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
24743         instead Report.Error and also pass in the location.
24744         (CSharpParser::Lexer): New readonly property to return the reference
24745         to the Tokenizer object.
24746         (declare_local_variables): Use Report.Error with location instead of plain 
24747         old error.
24748         (CheckDef): Ditto.
24749
24750         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
24751         (Operator.CheckBinaryOperator): Ditto.
24752
24753         * cs-parser.jay (operator_declarator): Update accordingly.
24754
24755         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
24756         (CheckBinaryOperator): Same here.
24757
24758         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
24759         on the name without any prefixes of namespace names etc. This is because we
24760         already might have something already fully qualified like 
24761         'System.Console.WriteLine'
24762
24763         * assign.cs (Resolve): Begin implementation. Stuck ;-)
24764
24765 2001-09-07  Ravi Pratap  <ravi@ximian.com>
24766
24767         * cs-tokenizer.cs (location): Return a string which also contains
24768         the file name.
24769
24770         * expression.cs (ElementAccess): New class for expressions of the
24771         type 'element access.'
24772         (BaseAccess): New class for expressions of the type 'base access.'
24773         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
24774         respectively.
24775
24776         * cs-parser.jay (element_access): Implement action.
24777         (base_access): Implement actions.
24778         (checked_expression, unchecked_expression): Implement.
24779
24780         * cs-parser.jay (local_variable_type): Correct and implement.
24781         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
24782
24783         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
24784
24785         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
24786         name and the specifiers.
24787
24788         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
24789
24790         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
24791         making them all public ;-)
24792
24793         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
24794         class anyways.
24795
24796 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
24797
24798         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
24799         PropertyExprs.
24800         (FieldExpr, PropertyExprs): New resolved expressions.
24801         (SimpleName::MemberStaticCheck): Perform static checks for access
24802         to non-static fields on static methods. Maybe this should be
24803         generalized for MemberAccesses. 
24804         (SimpleName::ResolveSimpleName): More work on simple name
24805         resolution. 
24806
24807         * cs-parser.jay (primary_expression/qualified_identifier): track
24808         the parameter index.
24809
24810         * codegen.cs (CodeGen::Save): Catch save exception, report error.
24811         (EmitContext::EmitBoolExpression): Chain to expression generation
24812         instead of temporary hack.
24813         (::EmitStatementExpression): Put generic expression code generation.
24814
24815         * assign.cs (Assign::Emit): Implement variable assignments to
24816         local variables, parameters and fields.
24817
24818 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
24819
24820         * statement.cs (Block::GetVariableInfo): New method, returns the
24821         VariableInfo for a variable name in a block.
24822         (Block::GetVariableType): Implement in terms of GetVariableInfo
24823
24824         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
24825         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
24826
24827 2001-09-06  Ravi Pratap  <ravi@ximian.com>
24828
24829         * cs-parser.jay (operator_declaration): Continue on my quest : update
24830         to take attributes argument.
24831         (event_declaration): Ditto.
24832         (enum_declaration): Ditto.
24833         (indexer_declaration): Ditto.
24834
24835         * class.cs (Operator::Operator): Update constructor accordingly.
24836         (Event::Event): Ditto.
24837
24838         * delegate.cs (Delegate::Delegate): Same here.
24839
24840         * enum.cs (Enum::Enum): Same here.
24841
24842 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24843
24844         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
24845
24846         * ../tests/cs0658.cs : New file to demonstrate error 0658.
24847
24848         * attribute.cs (Attributes): New class to encapsulate all attributes which were
24849         being passed around as an arraylist.
24850         (Attributes::AddAttribute): Method to add attribute sections.
24851
24852         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
24853         (struct_declaration): Update accordingly.
24854         (constant_declaration): Update.
24855         (field_declaration): Update.
24856         (method_header): Update.
24857         (fixed_parameter): Update.
24858         (parameter_array): Ditto.
24859         (property_declaration): Ditto.
24860         (destructor_declaration): Ditto.
24861
24862         * class.cs (Struct::Struct): Update constructors accordingly.
24863         (Class::Class): Ditto.
24864         (Field::Field): Ditto.
24865         (Method::Method): Ditto.
24866         (Property::Property): Ditto.
24867         (TypeContainer::OptAttribute): update property's return type.
24868
24869         * interface.cs (Interface.opt_attributes): New member.
24870         (Interface::Interface): Update to take the extra Attributes argument.
24871
24872         * parameter.cs (Parameter::Parameter): Ditto.
24873
24874         * constant.cs (Constant::Constant): Ditto.
24875
24876         * interface.cs (InterfaceMemberBase): New OptAttributes field.
24877         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
24878         the attributes as a parameter.
24879         (InterfaceProperty): Update constructor call.
24880         (InterfaceEvent): Ditto.
24881         (InterfaceMethod): Ditto.
24882         (InterfaceIndexer): Ditto.
24883
24884         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
24885         pass the attributes too.
24886         (interface_event_declaration): Ditto.
24887         (interface_property_declaration): Ditto.
24888         (interface_method_declaration): Ditto.
24889         (interface_declaration): Ditto.
24890
24891 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
24892
24893         * class.cs (Method::Define): Track the "static Main" definition to
24894         create an entry point. 
24895
24896         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
24897         EntryPoint if we find it. 
24898
24899         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
24900         (EmitContext::ig): Make this variable public.
24901
24902         * driver.cs: Make the default output file be the first file name
24903         with the .exe extension.  
24904
24905         Detect empty compilations
24906
24907         Handle various kinds of output targets.  Handle --target and
24908         rename -t to --dumper.
24909
24910         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
24911         methods inherited from Expression return now an Expression.  This
24912         will is used during the tree rewriting as we resolve them during
24913         semantic analysis.
24914
24915         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
24916         the spec.  Missing entirely is the information about
24917         accessability of elements of it.
24918
24919         (Expression::ExprClassFromMemberInfo): New constructor for
24920         Expressions that creates a fully initialized Expression based on
24921         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
24922         a Type.
24923
24924         (Invocation::Resolve): Begin implementing resolution of invocations.
24925
24926         * literal.cs (StringLiteral):  Implement Emit.
24927
24928 2001-09-05  Ravi Pratap  <ravi@ximian.com>
24929
24930         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
24931         member.
24932
24933 2001-09-04  Ravi Pratap  <ravi@ximian.com>
24934
24935         * cs-parser.jay (attribute_arguments): Implement actions.
24936         (attribute): Fix bug in production. Implement action.
24937         (attribute_list): Implement.
24938         (attribute_target): Implement.
24939         (attribute_target_specifier, opt_target_specifier): Implement
24940         (CheckAttributeTarget): New method to check if the attribute target
24941         is valid.
24942         (attribute_section): Implement.
24943         (opt_attributes): Implement.
24944
24945         * attribute.cs : New file to handle attributes.
24946         (Attribute): Class to hold attribute info.
24947
24948         * cs-parser.jay (opt_attribute_target_specifier): Remove production
24949         (attribute_section): Modify production to use 2 different rules to 
24950         achieve the same thing. 1 s/r conflict down !
24951         Clean out commented, useless, non-reducing dimension_separator rules.
24952
24953         * class.cs (TypeContainer.attributes): New member to hold list
24954         of attributes for a type.
24955         (Struct::Struct): Modify to take one more argument, the attribute list.
24956         (Class::Class): Ditto.
24957         (Field::Field): Ditto.
24958         (Method::Method): Ditto.
24959         (Property::Property): Ditto.
24960
24961         * cs-parser.jay (struct_declaration): Update constructor call to
24962         pass in the attributes too.
24963         (class_declaration): Ditto.
24964         (constant_declaration): Ditto.
24965         (field_declaration): Ditto.
24966         (method_header): Ditto.
24967         (fixed_parameter): Ditto.
24968         (parameter_array): Ditto.
24969         (property_declaration): Ditto.
24970
24971         * constant.cs (Constant::Constant): Update constructor similarly.
24972         Use System.Collections.
24973
24974         * parameter.cs (Parameter::Parameter): Update as above.
24975
24976 2001-09-02  Ravi Pratap  <ravi@ximian.com>
24977
24978         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
24979         (TypeContainer.delegates): New member to hold list of delegates.
24980
24981         * cs-parser.jay (delegate_declaration): Implement the action correctly 
24982         this time as I seem to be on crack ;-)
24983
24984 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
24985
24986         * rootcontext.cs (RootContext::IsNamespace): new function, used to
24987         tell whether an identifier represents a namespace.
24988
24989         * expression.cs (NamespaceExpr): A namespace expression, used only
24990         temporarly during expression resolution.
24991         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
24992         utility functions to resolve names on expressions.
24993
24994 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
24995
24996         * codegen.cs: Add hook for StatementExpressions. 
24997
24998         * class.cs: Fix inverted test for static flag in methods.
24999
25000 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25001
25002         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25003         to make it coincide with MS' number.
25004         (Operator::CheckBinaryOperator): Ditto.
25005
25006         * ../errors/errors.txt : Remove error numbers added earlier.
25007
25008         * ../errors/cs1019.cs : Test case for error # 1019
25009
25010         * ../errros/cs1020.cs : Test case for error # 1020
25011
25012         * cs-parser.jay : Clean out commented cruft.
25013         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25014         used anywhere - non-reducing rule.
25015         (namespace_declarations): Non-reducing rule - comment out.
25016
25017         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25018         with TypeContainer::AddEnum.
25019
25020         * delegate.cs : New file for delegate handling classes.
25021         (Delegate): Class for declaring delegates.
25022
25023         * makefile : Update.
25024
25025         * cs-parser.jay (delegate_declaration): Implement.
25026
25027 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25028
25029         * class.cs (Event::Define): Implement.
25030         (Event.EventBuilder): New member.
25031
25032         * class.cs (TypeContainer::Populate): Update to define all enums and events
25033         we have.
25034         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25035         readonly fields for all these cases ?
25036
25037 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25038
25039         * class.cs (Property): Revamp to use the convention of making fields readonly.
25040         Accordingly modify code elsewhere.
25041
25042         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25043         the Define method of the Property class.
25044
25045         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25046         trivial bug.
25047         (TypeContainer::Populate): Update to define all the properties we have. Also
25048         define all enumerations.
25049
25050         * enum.cs (Define): Implement.
25051
25052 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25053
25054         * cs-parser.jay (overloadable_operator): The semantic value is an
25055         enum of the Operator class.
25056         (operator_declarator): Implement actions.
25057         (operator_declaration): Implement.
25058
25059         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25060         validity of definitions.
25061         (Operator::CheckBinaryOperator): Static method to check for binary operators
25062         (TypeContainer::AddOperator): New method to add an operator to a type.
25063
25064         * cs-parser.jay (indexer_declaration): Added line to actually call the
25065         AddIndexer method so it gets added ;-)
25066
25067         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25068         already taken care of by the MS compiler ?  
25069
25070 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25071
25072         * class.cs (Operator): New class for operator declarations.
25073         (Operator::OpType): Enum for the various operators.
25074
25075 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25076
25077         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25078         ostensibly handle this in semantic analysis.
25079
25080         * cs-parser.jay (general_catch_clause): Comment out
25081         (specific_catch_clauses, specific_catch_clause): Ditto.
25082         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25083         (catch_args, opt_catch_args): New productions.
25084         (catch_clause): Rewrite to use the new productions above
25085         (catch_clauses): Modify accordingly.
25086         (opt_catch_clauses): New production to use in try_statement
25087         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25088         and re-write the code in the actions to extract the specific and
25089         general catch clauses by being a little smart ;-)
25090
25091         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25092         Hooray, try and catch statements parse fine !
25093
25094 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25095
25096         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25097         string from the hashtable of variables.
25098
25099         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25100         I end up making that mistake ;-)
25101         (catch_clauses): Fixed gross error which made Key and Value of the 
25102         DictionaryEntry the same : $1 !!
25103
25104 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25105
25106         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25107
25108         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25109         when the add and remove accessors are specified. 
25110
25111 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25112
25113         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25114         information about indexer_declarator.
25115         (indexer_declarator): Implement actions.
25116         (parsing_indexer): New local boolean used to keep track of whether
25117         we are parsing indexers or properties. This is necessary because 
25118         implicit_parameters come into picture even for the get accessor in the 
25119         case of an indexer.
25120         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25121
25122         * class.cs (Indexer): New class for indexer declarations.
25123         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25124         (TypeContainer::indexers): New member to hold list of indexers for the
25125         type.
25126
25127 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25128
25129         * cs-parser.jay (add_accessor_declaration): Implement action.
25130         (remove_accessor_declaration): Implement action.
25131         (event_accessors_declaration): Implement
25132         (variable_declarators): swap statements for first rule - trivial.
25133
25134         * class.cs (Event): New class to hold information about event
25135         declarations.
25136         (TypeContainer::AddEvent): New method to add an event to a type
25137         (TypeContainer::events): New member to hold list of events.
25138
25139         * cs-parser.jay (event_declaration): Implement actions.
25140
25141 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25142
25143         * cs-parser.jay (dim_separators): Implement. Make it a string
25144         concatenating all the commas together, just as they appear.
25145         (opt_dim_separators): Modify accordingly
25146         (rank_specifiers): Update accordingly. Basically do the same
25147         thing - instead, collect the brackets here.
25148         (opt_rank_sepcifiers): Modify accordingly.
25149         (array_type): Modify to actually return the complete type string
25150         instead of ignoring the rank_specifiers.
25151         (expression_list): Implement to collect the expressions
25152         (variable_initializer): Implement. We make it a list of expressions
25153         essentially so that we can handle the array_initializer case neatly too.
25154         (variable_initializer_list): Implement.
25155         (array_initializer): Make it a list of variable_initializers
25156         (opt_array_initializer): Modify accordingly.
25157
25158         * expression.cs (New::NType): Add enumeration to help us
25159         keep track of whether we have an object/delegate creation
25160         or an array creation.
25161         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25162         members to hold data about array creation.
25163         (New:New): Modify to update NewType
25164         (New:New): New Overloaded contructor for the array creation
25165         case.
25166
25167         * cs-parser.jay (array_creation_expression): Implement to call
25168         the overloaded New constructor.
25169
25170 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25171
25172         * class.cs (TypeContainer::Constructors): Return member
25173         constructors instead of returning null.
25174
25175 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25176
25177         * typemanager.cs (InitCoreTypes): Initialize the various core
25178         types after we have populated the type manager with the user
25179         defined types (this distinction will be important later while
25180         compiling corlib.dll)
25181
25182         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25183         on Expression Classification.  Now all expressions have a method
25184         `Resolve' and a method `Emit'.
25185
25186         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25187         generation from working.     Also add some temporary debugging
25188         code. 
25189
25190 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25191
25192         * codegen.cs: Lots of code generation pieces.  This is only the
25193         beginning, will continue tomorrow with more touches of polish.  We
25194         handle the fundamentals of if, while, do, for, return.  Others are
25195         trickier and I need to start working on invocations soon.
25196
25197         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25198         s.InitStatement. 
25199
25200         * codegen.cs (EmitContext): New struct, used during code
25201         emission to keep a context.   Most of the code generation will be
25202         here. 
25203
25204         * cs-parser.jay: Add embedded blocks to the list of statements of
25205         this block.  So code generation proceeds in a top down fashion.
25206
25207 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25208
25209         * statement.cs: Add support for multiple child blocks.
25210
25211 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25212
25213         * codegen.cs (EmitCode): New function, will emit the code for a
25214         Block of code given a TypeContainer and its ILGenerator. 
25215
25216         * statement.cs (Block): Standard public readonly optimization.
25217         (Block::Block constructors): Link children. 
25218         (Block::Child): Child Linker.
25219         (Block::EmitVariables): Emits IL variable declarations.
25220
25221         * class.cs: Drop support for MethodGroups here, delay until
25222         Semantic Analysis.
25223         (Method::): Applied the same simplification that I did before, and
25224         move from Properties to public readonly fields.
25225         (Method::ParameterTypes): Returns the parameter types for the
25226         function, and implements a cache that will be useful later when I
25227         do error checking and the semantic analysis on the methods is
25228         performed.
25229         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25230         and made a method, optional argument tells whether this is a class
25231         or a structure to apply the `has-this' bit.
25232         (Method::GetCallingConvention): Implement, returns the calling
25233         convention. 
25234         (Method::Define): Defines the type, a second pass is performed
25235         later to populate the methods.
25236
25237         (Constructor::ParameterTypes): implement a cache similar to the
25238         one on Method::ParameterTypes, useful later when we do semantic
25239         analysis. 
25240
25241         (TypeContainer::EmitMethod):  New method.  Emits methods.
25242
25243         * expression.cs: Removed MethodGroup class from here.
25244
25245         * parameter.cs (Parameters::GetCallingConvention): new method.
25246
25247 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
25248
25249         * class.cs (TypeContainer::Populate): Drop RootContext from the
25250         argument. 
25251
25252         (Constructor::CallingConvention): Returns the calling convention.
25253         (Constructor::ParameterTypes): Returns the constructor parameter
25254         types. 
25255
25256         (TypeContainer::AddConstructor): Keep track of default constructor
25257         and the default static constructor.
25258
25259         (Constructor::) Another class that starts using `public readonly'
25260         instead of properties. 
25261
25262         (Constructor::IsDefault): Whether this is a default constructor. 
25263
25264         (Field::) use readonly public fields instead of properties also.
25265
25266         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
25267         track of static constructors;  If none is used, turn on
25268         BeforeFieldInit in the TypeAttributes. 
25269
25270         * cs-parser.jay (opt_argument_list): now the return can be null
25271         for the cases where there are no arguments. 
25272
25273         (constructor_declarator): If there is no implicit `base' or
25274         `this', then invoke the default parent constructor. 
25275
25276         * modifiers.cs (MethodAttr): New static function maps a set of
25277         modifiers flags into a MethodAttributes enum
25278         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
25279         MethodAttr, TypeAttr to represent the various mappings where the
25280         modifiers are used.
25281         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
25282
25283 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
25284
25285         * parameter.cs (GetParameterInfo): Fix bug where there would be no
25286         method arguments.
25287
25288         * interface.cs (PopulateIndexer): Implemented the code generator
25289         for interface indexers.
25290
25291 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
25292
25293         * interface.cs (InterfaceMemberBase): Now we track the new status
25294         here.  
25295
25296         (PopulateProperty): Implement property population.  Woohoo!  Got
25297         Methods and Properties going today. 
25298
25299         Removed all the properties for interfaces, and replaced them with
25300         `public readonly' fields. 
25301
25302 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
25303
25304         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
25305         initialize their hashtables/arraylists only when they are needed
25306         instead of doing this always.
25307
25308         * parameter.cs: Handle refs and out parameters.
25309
25310         * cs-parser.jay: Use an ArrayList to construct the arguments
25311         instead of the ParameterCollection, and then cast that to a
25312         Parameter[] array.
25313
25314         * parameter.cs: Drop the use of ParameterCollection and use
25315         instead arrays of Parameters.
25316
25317         (GetParameterInfo): Use the Type, not the Name when resolving
25318         types. 
25319
25320 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
25321
25322         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
25323         and instead use public readonly fields.
25324
25325         * class.cs: Put back walking code for type containers.
25326
25327 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
25328
25329         * class.cs (MakeConstant): Code to define constants.
25330
25331         * rootcontext.cs (LookupType): New function.  Used to locate types 
25332
25333
25334 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
25335
25336         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
25337         this System.Reflection code is.  Kudos to Microsoft
25338
25339         * typemanager.cs: Implement a type cache and avoid loading all
25340         types at boot time.  Wrap in LookupType the internals.  This made
25341         the compiler so much faster.  Wow.  I rule!
25342
25343         * driver.cs: Make sure we always load mscorlib first (for
25344         debugging purposes, nothing really important).
25345
25346         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
25347         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
25348
25349         * rootcontext.cs: Lookup types on their namespace;  Lookup types
25350         on namespaces that have been imported using the `using' keyword.
25351
25352         * class.cs (TypeContainer::TypeAttr): Virtualize.
25353         (Class::TypeAttr): Return attributes suitable for this bad boy.
25354         (Struct::TypeAttr): ditto.
25355         Handle nested classes.
25356         (TypeContainer::) Remove all the type visiting code, it is now
25357         replaced with the rootcontext.cs code
25358
25359         * rootcontext.cs (GetClassBases): Added support for structs. 
25360
25361 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
25362
25363         * interface.cs, statement.cs, class.cs, parameter.cs,
25364         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
25365         Drop use of TypeRefs, and use strings instead.
25366
25367 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
25368
25369         * rootcontext.cs: 
25370
25371         * class.cs (Struct::Struct): set the SEALED flags after
25372         checking the modifiers.
25373         (TypeContainer::TypeAttr): new property, returns the
25374         TypeAttributes for a class.  
25375
25376         * cs-parser.jay (type_list): Oops, list production was creating a
25377         new list of base types.
25378
25379         * rootcontext.cs (StdLib): New property.
25380         (GetInterfaceTypeByName): returns an interface by type name, and
25381         encapsulates error handling here.
25382         (GetInterfaces): simplified.
25383         (ResolveTree): Encapsulated all the tree resolution here.
25384         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
25385         types. 
25386
25387         * driver.cs: Add support for --nostdlib, to avoid loading the
25388         default assemblies.
25389         (Main): Do not put tree resolution here. 
25390
25391         * rootcontext.cs: Beginning of the class resolution.
25392
25393 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
25394
25395         * rootcontext.cs: Provide better error reporting. 
25396
25397         * cs-parser.jay (interface_base): set our $$ to be interfaces.
25398
25399         * rootcontext.cs (CreateInterface): Handle the case where there
25400         are no parent interfaces.
25401
25402         (CloseTypes): Routine to flush types at the end.
25403         (CreateInterface): Track types.
25404         (GetInterfaces): Returns an array of Types from the list of
25405         defined interfaces.
25406
25407         * typemanager.c (AddUserType): Mechanism to track user types (puts
25408         the type on the global type hash, and allows us to close it at the
25409         end). 
25410
25411 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
25412
25413         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
25414         RecordInterface instead.
25415
25416         * cs-parser.jay: Updated to reflect changes above.
25417
25418         * decl.cs (Definition): Keep track of the TypeBuilder type that
25419         represents this type here.  Not sure we will use it in the long
25420         run, but wont hurt for now.
25421
25422         * driver.cs: Smaller changes to accomodate the new code.
25423
25424         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
25425         when done. 
25426
25427         * rootcontext.cs (CreateInterface):  New method, used to create
25428         the System.TypeBuilder type for interfaces.
25429         (ResolveInterfaces): new entry point to resolve the interface
25430         hierarchy. 
25431         (CodeGen): Property, used to keep track of the code generator.
25432
25433 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
25434
25435         * cs-parser.jay: Add a second production for delegate_declaration
25436         with `VOID'.
25437
25438         (enum_body): Put an opt_comma here instead of putting it on
25439         enum_body or enum_member_declarations so we can handle trailing
25440         commas on enumeration members.  Gets rid of a shift/reduce.
25441
25442         (type_list): Need a COMMA in the middle.
25443
25444         (indexer_declaration): Tell tokenizer to recognize get/set
25445
25446         * Remove old targets.
25447
25448         * Re-add the parser target.
25449
25450 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25451
25452         * cs-parser.jay: Add precendence rules for a number of operators
25453         ot reduce the number of shift/reduce conflicts in the grammar.
25454
25455 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
25456
25457         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
25458         and put it here.
25459
25460         Get rid of old crufty code.
25461
25462         * rootcontext.cs: Use this to keep track of the parsed
25463         representation and the defined types available to the program. 
25464
25465         * gen-treedump.cs: adjust for new convention.
25466
25467         * type.cs: Split out the type manager, and the assembly builder
25468         from here. 
25469
25470         * typemanager.cs: the type manager will live here now.
25471
25472         * cil-codegen.cs: And the code generator here. 
25473
25474 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
25475
25476         * makefile: Fixed up for easy making.
25477
25478 2001-07-13  Simon Cozens <simon@simon-cozens.org>
25479
25480         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
25481         the 
25482
25483         (unary_expression): Expand pre_increment_expression and
25484         post_decrement_expression to reduce a shift/reduce.
25485
25486 2001-07-11  Simon Cozens
25487
25488         * cs-tokenizer.cs: Hex numbers should begin with a 0.
25489
25490         Improve allow_keyword_as_indent name.
25491
25492 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
25493
25494         * Adjustments for Beta2. 
25495
25496 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
25497
25498         * decl.cs: Added `Define' abstract method.
25499         (InTransit): new property, used to catch recursive definitions. 
25500
25501         * interface.cs: Implement `Define'. 
25502
25503         * modifiers.cs: Map Modifiers.constants to
25504         System.Reflection.TypeAttribute flags.
25505
25506         * class.cs: Keep track of types and user-defined types.
25507         (BuilderInit): New method for creating an assembly
25508         (ResolveType): New function to launch the resolution process, only
25509         used by interfaces for now.
25510
25511         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
25512         that are inserted into the name space. 
25513
25514 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
25515
25516         * ARGH.  I have screwed up my tree so many times due to the use of
25517         rsync rather than using CVS.  Going to fix this at once. 
25518
25519         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
25520         load types.
25521
25522 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
25523
25524         * Experiment successful: Use System.Type rather that our own
25525         version of Type.  
25526
25527 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
25528
25529         * cs-parser.jay: Removed nsAliases from here.
25530
25531         Use new namespaces, handle `using XXX;' 
25532
25533         * namespace.cs: Reimplemented namespace handling, use a recursive
25534         definition of the class.  Now we can keep track of using clauses
25535         and catch invalid using clauses.
25536
25537 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
25538
25539         * gen-treedump.cs: Adapted for all the renaming.
25540
25541         * expression.cs (Expression): this class now has a Type property
25542         which returns an expression Type.
25543
25544         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
25545         `Type', as this has a different meaning now in the base
25546
25547 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
25548
25549         * interface.cs, class.cs: Removed from all the sources the
25550         references to signature computation, as we can not do method
25551         signature computation during the parsing time, as we are not
25552         trying to solve at that point distinguishing:
25553
25554         class X {
25555                 void a (Blah x) {}
25556                 void a (NS.Blah x) {}
25557         }
25558
25559         Which depending on the context might be valid or not, as we do not
25560         know if Blah is the same thing as NS.Blah at that point.
25561
25562         * Redid everything so the code uses TypeRefs now instead of
25563         Types.  TypeRefs are just temporary type placeholders, that need
25564         to be resolved.  They initially have a pointer to a string and the
25565         current scope in which they are used.  This is used later by the
25566         compiler to resolve the reference to an actual Type. 
25567
25568         * DeclSpace is no longer a CIR.Type, and neither are
25569         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
25570         are all DeclSpaces, but no Types. 
25571
25572         * type.cs (TypeRefManager): This implements the TypeRef manager,
25573         which keeps track of all the types that need to be resolved after
25574         the parsing has finished. 
25575
25576 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
25577
25578         * ARGH.  We are going to have to store `foreach' as a class rather
25579         than resolving it, as we need to verify error 1579 after name
25580         resolution.   *OR* we could keep a flag that says `This request to
25581         IEnumerator comes from a foreach statement' which we can then use
25582         to generate the error.
25583
25584 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
25585
25586         * class.cs (TypeContainer.AddMethod): we now add methods to the
25587         MethodGroup instead of the method hashtable.  
25588
25589         * expression.cs: Add MethodGroup abstraction, which gets us one
25590         step closer to the specification in the way we handle method
25591         declarations.  
25592
25593         * cs-parser.jay (primary_expression): qualified_identifier now
25594         tried to match up an identifier to a local variable reference or
25595         to a parameter reference.
25596
25597         current_local_parameters is now a parser global variable that
25598         points to the current parameters for the block, used during name
25599         lookup.
25600
25601         (property_declaration): Now creates an implicit `value' argument to
25602         the set accessor.
25603
25604 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
25605
25606         * parameter.cs: Do not use `param' arguments as part of the
25607         signature, per the spec.
25608
25609 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
25610
25611         * decl.cs: Base class for classes, structs and interfaces.  This
25612         is the "Declaration Space" 
25613
25614         * cs-parser.jay: Use CheckDef for checking declaration errors
25615         instead of having one on each function.
25616
25617         * class.cs: Factor out some code for handling error handling in
25618         accordance to the "Declarations" section in the "Basic Concepts"
25619         chapter in the ECMA C# spec.
25620
25621         * interface.cs: Make all interface member classes derive from
25622         InterfaceMemberBase.
25623
25624 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
25625
25626         * Many things: all interfaces are parsed and generated in
25627         gen-treedump.  Support for member variables, constructors,
25628         destructors, properties, constants is there.
25629
25630         Beginning of the IL backend, but very little done, just there for
25631         testing purposes. 
25632
25633 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
25634
25635         * cs-parser.jay: Fix labeled statement.
25636
25637         * cs-tokenizer.cs (escape): Escape " and ' always.
25638         ref_line, ref_name: keep track of the line/filename as instructed
25639         by #line by the compiler.
25640         Parse #line.
25641
25642 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
25643
25644         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
25645         to match the values in System.CodeDOM.
25646
25647         Divid renamed to Divide.
25648
25649         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
25650         statements. 
25651         (Statements.set): remove.
25652
25653         * System.CodeDOM/CodeCatchClause.cs: always have a valid
25654         statements. 
25655
25656         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
25657         falseStatements always have valid values. 
25658
25659         * cs-parser.jay: Use System.CodeDOM now.
25660