7ea9ed572aae6fdb1434e0cf4c3de32a7703433c
[mono.git] / mcs / mcs / ChangeLog
1 2006-04-28  Raja R Harinath  <harinath@gmail.com>
2
3         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
4         dummy UsageVector.
5
6         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
7         argument to two arguments: an usage-vector and a bool.  Move call
8         to FlowBranching.Merge () ...
9         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
10
11         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
12         handling of loop and switch reachability to ...
13         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
14
15 2006-04-27  Raja R Harinath  <harinath@gmail.com>
16
17         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
18         handling to FlowBranchingLoop.InLoop.
19         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
20
21 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
22
23         A fix for #78115
24         anonymous.cs.cs (AnonymousMethod.DoResolve): Moved the check whether
25         anonymous method  is allowed from AnonymousContainer here.
26
27         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
28
29 2006-04-24  Raja R Harinath  <rharinath@novell.com>
30
31         Fix #78156
32         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
33
34 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
35
36         A fix for #49011.
37         constant.cs (FloatConstant.Reduce): Add range checking for checked context.
38         (DoubleConstant.Reduce): Ditto.
39
40 2006-04-23  Raja R Harinath  <rharinath@novell.com>
41
42         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
43         Remove 'lvalue_right_side' argument.  Move parts to ...
44         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
45         (LocalVariable.DoResolveLValue): ... these.
46
47 2006-04-21  Raja R Harinath  <rharinath@novell.com>
48
49         Fix cs1655.cs
50         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
51         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
52         (LocalVariableReference.DoResolveBase): Use it to implement new
53         CS1655 check.
54         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
55         (Argument.Resolve): Simplify.  Move CS1510 check ...
56         * ecore.cs (Expression.ResolveLValue): ... here.
57         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
58         (PropertyExpr.DoResolveLValue): Likewise.
59         (FieldExpr.Report_AssignToReadonly): Likewise.
60         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
61         LValueMemberAccess or LValueMemberOutAccess on instance depending
62         on it.
63         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
64         DoResolve as appropriate.
65
66 2006-04-20  Raja R Harinath  <rharinath@novell.com>
67
68         Fix #75800
69         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
70         implicit conversions on 'out' and 'ref' arguments.
71
72         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
73         improve clarity.  Remove dead code.
74
75         Fix #66031
76         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
77         (Catch.Resolve): Resolve VarBlock if it exists.
78
79 2006-04-19  Miguel de Icaza  <miguel@novell.com>
80
81         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
82         twice, this was some residual code, the enumerator was emitted
83         properly in the two branche of if later.
84
85 2006-04-19  Raja R Harinath  <rharinath@novell.com>
86
87         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
88         cast is never an lvalue.
89         (Cast.DoResolve, Cast.ResolveRest): Combine.
90         (Argument.Emit): Simplify slightly.  Move 'Expr is
91         IMemoryLocation' check ...
92         (Argument.Resolve): ... here.
93         (Argument.Error_LValueRequired): Remove.  Inline into only user.
94
95         Simplifications.  Fix cs0191-2.cs
96         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
97         CS1649 and CS1651 to ...
98         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
99         the actual selection of the error code and message to a lookup
100         table.  Add a dummy return value to simplify callsites.
101         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
102         readonly fields of other instances of the same type.  Move CS0197
103         warning from ...
104         * expression.cs (Argument.Resolve): ... here.  Simplify code.
105         Ensure that ec.InRefOutArgumentResolving is only set during LValue
106         resolution of an out or ref argument.  The code simplification
107         above uses this invariant.
108
109 2006-04-18  Raja R Harinath  <rharinath@novell.com>
110
111         Possibly fix #77752.  Fix cs1690-[4-7].cs.
112         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
113         CheckMarshallByRefAccess.  Drop parameter.
114         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
115         warning.
116         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
117         InstanceExpression.
118         * report.cs (AllWarnings): Add CS1690.
119         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
120         for ref access too.
121         (LocalVariableReference.DoResolveBase): Update.
122
123 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
124
125         class.cs (MethodOrOperator): Moved common parts from method class.
126         detect obsolete attributes.
127         (Method.Define): Simplified as it reuses code from base.
128         (Constructor.ValidAttributeTargets): Fixed issue found during
129         refactoring.
130         (Destructor.ValidAttributeTargets): Fixed issue found during
131         refactoring.
132         (Operator): Finished refactoring set off by #78020. Operator class is now
133         ordinary method class.
134
135         * anonymous.cs: Updated.
136
137         * decl.cs (DeclSpace): Add IsGeneric
138
139 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
140
141         (Constructor.Emit): Don't emit the attributes twice.
142
143 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
144
145         class.cs (Operator.Emit): Extracted code from MethodData to correctly
146         detect obsolete attributes.
147         (Method.CreateEmitContext): Moved to MethodOrOperator.
148
149 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
150
151         A fix for #78048.
152         class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
153         customized exception to make crash detection easier.
154         (MethodOrOperator): Started to work on new base class for methods and
155         operators.
156         (Method): Derives from MethodOrOperator.
157         (Constructor.Emit): Emits its own attributes.
158         (AbstractPropertyEventMethod.Emit): Ditto.
159         (Operator): Derives from MethodOrOperator, will refactor fully in extra
160         patch.
161         (Operator.Emit): It's temporary more tricky than should be.
162         
163         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
164
165         * report.cs (InternalErrorException): Add ctor with inner exception.
166
167 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
168
169         A fix for #76744.
170         ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
171         only not visible.
172
173 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
174
175         A fix for #77916.
176         expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
177         array.
178
179 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
180
181         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
182         attribute is present and Guid not.
183         (Interface.ApplyAttributeBuilder): Ditto.
184
185         * attribute.cs: Add error message.
186
187 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
188
189         A fix for #78020.
190
191         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
192         sources (it's composite) so hold them in extra array as they are used in
193         Emit phase only. It worked in the previous versions by mistake.
194         (Attribute.Emit): Emit attribute for more owners when exist.
195
196         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
197         it has now different behaviour.
198
199 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
200
201         * constant.cs (Constant.IsDefaultInitializer): New method.
202
203         * class.cs: Updated.
204
205         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
206         re-initialize default values. It saves KBs almost for every assembly.
207         Thanks Zoltan for the idea.
208         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
209         (ArrayCreation.DoResolve): Resolve only once.
210         (ArrayCreation.Emit): Emit static initializer only when it is faster.
211         (ArrayCreation.GetAttributableValue): Cope with optimized values.
212
213 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
214
215         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
216         From #77961.
217
218 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
219
220         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
221         in an embedded statement too.
222
223 2006-04-01  Raja R Harinath  <rharinath@novell.com>
224
225         Fix #77958
226         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
227
228 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
229
230         A fix for #77966.
231
232         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
233         was not specified.
234
235         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
236
237 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
238
239         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
240         phase.
241
242         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
243         LocalTemporary change.
244
245         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
246         TypeContainer.
247         (ClassOrStruct.DefineFieldInitializers): Implemented static field
248         initializers optimization.
249         (ClassOrStruct.TypeAttr): Moved from modifiers.
250         (Constructor.CheckBase): Don't crash when static ctor has parameters.
251         (FieldBase.ResolveInitializer): Resolves initializer.
252         (FieldBase.HasDefaultInitializer): New property.
253
254         * cs-parser.jay: Removed message.
255
256         * expression.cs (CompilerGeneratedThis): New specialization.
257
258         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
259
260 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
261
262         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
263
264 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
265
266         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
267         be now EnumConstants only.
268
269 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
270
271         * attribute.cs, driver.cs: Reset more caches.
272
273 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
274
275         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
276
277 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
278
279         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
280         for easier reuse. Updated all overrides.
281         (IntegralConstant): New base class for all integral constants.
282         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
283         of the constant range, report custom error.
284         (UIntConstant.Reduce): Fixed uint conversion.
285
286         * ecore.cs, literal.cs: Reduce updates.
287
288 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
289
290         A fix for #75813.
291
292         * class.cs (Constructor.Define): Removed extra if for default ctors.
293         A patch from Atsushi Enomoto.
294
295 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
296
297         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
298         GetAttributableValue.
299
300         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
301         when required.
302
303         * convert.cs (ImplicitConversionRequired): Error message moved to
304         DoubleLiteral.
305
306         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
307         automatic implicit conversion of an output value.
308         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
309
310         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
311         conversion.
312         (TypeOf.GetAttributableValue): Add extra handling for object type.
313
314         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
315         special error message.
316
317 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
318
319         * class.cs (Constructor.Emit): Don't crash when struct ctor is
320         InternalCall.
321         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
322         compatible with MS runtime.
323
324 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
325
326         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
327         attribute arguments here.
328
329         * class.cs (Indexer.Define): The check was moved to attribute class.
330
331 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
332
333         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
334         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
335         easier.
336
337 2006-03-22  Raja R Harinath  <rharinath@novell.com>
338
339         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
340         mcs to keep code differences small.
341         * attribute.cs (Attribute.GetParameterDefaultValue): New.
342         * typemanager.cs (parameter_default_value_attribute_type): New.
343         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
344         CS1908 check.
345
346 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
347
348         * expression.cs (StringConcat.Append): Reverted back to no warning state.
349
350 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
351
352         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
353
354         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
355         the blocks too.
356
357 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
358
359         * doc-bootstrap.cs : fix build.
360
361 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
362
363         * expression.cs (StringConcat.Append): Issue a warning when empty string
364         is going to append.
365
366 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
367
368         * assign.cs (CompoundAssign.ResolveSource): Removed.
369
370         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
371         clean up.
372
373         * class.cs (TypeContainer.FindMethods): Removed.
374         (TypeContainer.CheckMemberUsage): Made static.
375
376         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
377
378         * constant.cs (CheckRange): Removed unused type argument.
379         (CheckUnsigned): Removed unused type argument.
380
381         * cs-parser.jay: Updated after MemberAccess clean up.
382         Uses Length for empty string test.
383
384         * cs-tokenizer.cs: Uses Length for empty string test.
385         (IsCastToken): Made static.
386         (is_hex): Made static.
387         (real_type_suffix): Made static.
388
389         * decl.cs (SetupCache): Made static.
390         (OnGenerateDocComment): Removed unused ds argument.
391
392         * delegate.cs (VerifyDelegate): Removed unused argument.
393
394         * doc.cs: Uses Length for empty string test.
395
396         * driver.cs: Uses Length for empty string test.
397
398         * enum.cs (IsValidEnumType): Made static
399
400         * expression.cs (EnumLiftUp): Removed unused argument.
401         (ResolveMethodGroup): Ditto.
402         (BetterConversion): Ditto.
403         (GetVarargsTypes): Ditto.
404         (UpdateIndices): Ditto.
405         (ValidateInitializers): Ditto.
406         (MemberAccess.ctor): Ditto.
407         (GetIndexersForType): Ditto.
408
409         * flowanalysis.cs: (MergeFinally): Removed unused argument.
410
411         * iterators.cs: Updated after MemberAccess clean up.
412
413         * location.cs: Uses Length for empty string test.
414
415         * namespace.cs: Uses Length for empty string test.
416
417          * report.cs (CheckWarningCode): Made static.
418
419         * statement.cs (LabeledStatement): Removed unused argument.
420
421         * typemanager.cs (FilterNone): Removed.
422
423 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
424
425         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
426         obsolete.
427
428         * class.cs: Updated.
429
430 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
431
432         * cs-parser.jay.cs: __arglist is not allowed for delegates.
433
434 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
435
436         A fix for #77822.
437
438         * expression.cs (VerifyArgumentsCompat): Reverted to double error
439         reporting, it's more tricky than I thought.
440
441 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
442
443         A fix for #77816.
444
445         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
446         host container.
447         (AnonymousMethod.ImplicitStandardConversionExists): New method.
448         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
449         Add more error reporting; Fixed issue with params.
450
451         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
452
453         * cs-parser.jay: AnonymousMethod requires host container.
454
455         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
456
457 2006-03-18  Raja R Harinath  <harinath@gmail.com>
458
459         * class.cs: Change 'TypeContainer ds' constructor argument to
460         'DeclSpace parent'.  Some classes were missed below due to
461         different naming convention.
462
463         * class.cs (MemberCore.Parent): Delete.  This makes the
464         ParentContainer changes below enforceable by the compiler.
465
466         Treat pointers to enclosing declaration space as 'DeclSpace', not
467         'TypeContainer'.
468         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
469         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
470
471         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
472         of TypeContainer.
473         (Block.AddThisVariable): Likewise.
474         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
475         (AbstractPropertyEventMethod.Emit): Likewise.
476         (AbstractPropertyEventMethod.EmitMethod): Likewise.
477         (GetMethod.Define, SetMethod.Define): Likewise.
478         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
479         (DelegateMethod.EmitMethod): Likewise.
480
481         Fix regression test-partial-13.cs.
482         Rationalize use of PartialContainer.  Ensure that the partial
483         class semantics can be tied to type-correctness, i.e., any
484         violation will cause a compile error.
485         * class.cs, const.cs: Access all fields that belong to class
486         TypeContainer via ParentContainer.  Arguments of EmitContexts and
487         Resolve()-like functions still use 'Parent'.
488
489         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
490         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
491         (PropertyMethod.CheckModifiers): Remove unused argument.
492         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
493         DeclSpace.
494
495 2006-03-17  Raja R Harinath  <harinath@gmail.com>
496
497         Make semantics of PartialContainer simpler.
498         * decl.cs (DeclSpace.IsPartial): Remove.
499         * class.cs (TypeContainer.IsPartial): Likewise.
500         (TypeContainer..ctor): Set PartialContainer to point to self.
501         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
502         (TypeContainer.FindNestedType): Likewise.
503         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
504
505 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
506
507         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
508
509 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
510
511         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
512         classes.
513
514 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
515
516         * class.cs (Operator.Define): An error for base conversion was not
517         reported correctly.
518
519 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
520
521         * iterator.cs : yield break is allowed in try statement which has
522           catch clauses. Fixed bug #77767.
523
524 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
525
526         A fix for #77593, #77574.
527
528         * class.cs (MethodCore.CheckBase): Another if for operator.
529
530 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
531
532         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
533         were not resolved
534
535         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
536         (DelegateCreation.ImplicitStandardConversionExists): New method for just
537         conversion test.
538         
539         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
540         not needed.
541
542         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
543         Updated after another emitcontext usage was clean up. It should help us to
544         synchronize with gmcs easier.
545
546 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
547
548         A fix for #77353.
549
550         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
551         (Event.Define): ditto
552         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
553
554         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
555         Removed redundant code and set NewSlot for Invoke method too.
556
557         * parameter.cs (Parameters.ctor): Add custom, type ctor.
558         (Parameters.MergeGenerated): New method. Use this method when you merge
559         compiler generated argument with user arguments.
560
561 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
562
563         * attribute.cs (ResolveAsTypeTerminal): Removed.
564
565         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
566         specialization for predefined types; 30% speed up.
567         Finally placed obsolete check to right place.
568         (Expression.ResolveType): Removed.
569
570         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
571         Updated after ResolveType was removed.
572
573         * expression.cs (Cast.ctor): Check void cast.
574         (Binary.ResolveAsTypeTerminal): Is never type.
575         (Conditional.ResolveAsTypeTerminal): Is never type.
576
577         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
578
579 2006-03-01  Raja R Harinath  <rharinath@novell.com>
580
581         Fix #77679.
582         * expression.cs (ParameterReference.DoResolveBase): Change return
583         type to bool.
584         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
585         Update.
586
587         Fix #77628.
588         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
589
590         Fix #77642.
591         * typemanager.cs (GetFullNameSignature): Don't nullref on
592         protected accessors.
593
594 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
595
596         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
597         these two separated members to simplify the code.
598         (Attribute.Resolve): Refactored to use new fields and methods.
599         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
600         implemented obsolete attribute checking.
601         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
602         implemented obsolete checking again. It look line never ending quest ;-)
603         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
604
605         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
606
607         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
608
609         *class.cs (Property.Define): Add RegisterProperty call.
610
611         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
612         argument groups (only 2).
613
614         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
615         encoding expression to arguments.
616         (Expression.ExprClassToResolveFlags): Just turned to property.
617
618         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
619         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
620         optimized as well as implemented support for zero-length attributes.
621
622         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
623         Add caching of PropertyInfo's.
624
625 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
626
627         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
628         error multiple times.
629
630 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
631
632         New partial class implementation.
633         A fix for #77027, #77029, #77403
634
635         * attribute.cs (Attributable): Made attributes protected.
636
637         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
638         the replacements of ClassPart and PartialContainer.
639         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
640         (TypeContainer.AddInterface): Ditto.
641         (TypeContainer.AddPartial): The main method for partial classes. It checks
642         for errors and merges ModFlags and attributes. At the end class is added to
643         partial_parts list.
644         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
645         required here.
646         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
647         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
648         from the rest of partial classes.
649         (TypeContainer.GetClassBases): Simplified.
650         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
651         DefineType.
652         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
653         (TypeContainer.HasExplicitLayout): Uses Flags now.
654         (PartialContainer): Removed.
655         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
656         (StaticClass): Was merged with Class.
657         (Class.GetClassBases): class and static class bases are verified here.
658         (Class.TypeAttr): Added static attributes when class is static.
659         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
660         (MemberBase): In some cases we need to call parent container for partial
661         class. It should be eliminated but it's not easy now.
662
663         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
664
665         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
666         partial classed to accumulate class comments.
667         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
668
669         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
670
671         * driver.cs (MainDriver): Tree.GetDecl was removed.
672
673         * modifiers.cs (Modifiers): Add partial modifier.
674
675         * tree.cs (Tree.decl): Removed.
676         (RootTypes): Started to use this class more often for root types
677         specializations.
678
679 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
680
681         A fix for #77615
682
683         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
684         external interface does not have an attribute.
685
686 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
687
688         Another prerequisites for new partial classs implementation.
689         
690         * attribute.cs (Attribute.Equal): Implemented.
691         (Attribute.Emit): Changed as attributes can be applied more than twice.
692         (Attributes.Emit): Check for duplicate attributes here.
693
694         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
695         as a parameter, clean-up.
696
697 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
698
699         A fix for #77485
700
701         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
702         contains obsolete attribute check which can in some cases look for base
703         type of current class which is not initialized yet.
704         (TypeContainer.BaseType): Replacement of ptype.
705
706         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
707
708 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
709
710         First of prerequisites for new partial classs implemention.
711         
712         * attribute.cs (Attributable): Extended by ResolveContext;
713         Attributes finally have correct context for resolving in all cases.
714         (AttachTo): Attribute owner is assigned here.
715
716         * codegen.cs (IResolveContext): Introduce new interface to hold
717         all information needed in resolving phase.
718         (EmitContext): Implements IResolveContext; more clean-up needed here.
719         
720         * decl.cs (MemberCore): Implemented IResolveContext.
721
722         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
723         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
724         parameter.cs, statement.cs, tree.cs, typemanager.cs:
725         Refactored to use new IResolveContext instead of EmitContext; cleanup
726
727 2006-02-06  Miguel de Icaza  <miguel@novell.com>
728
729         * codegen.cs (EmitScopeInitFromBlock): check here the
730         capture_context, there is no need to make two calls to the
731         EmitContext. 
732
733         * anonymous.cs: Add some debugging messages that might help me
734         track other instances of this problem in the future (the
735         regression of test 467).
736
737         * cs-parser.jay: track the variable block, as we need to initalize
738         any captured variables declared in this block for the "catch"
739         portion of the "Try" statement.
740
741         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
742         scope initialization for captured variables. 
743
744         Also, move the emit for the variables after the block location has
745         been marked.
746
747 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
748
749         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
750
751 2006-02-02  Miguel de Icaza  <miguel@novell.com>
752
753         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
754         commit yesterday, the initialization for the roots is necessary.
755         What is not necessary is the scope activation.
756
757 2006-02-02  Raja R Harinath  <rharinath@novell.com>
758
759         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
760         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
761         CS0206 checks.
762         (Argument.Resolve): Remove CS0206 checks.
763
764 2006-02-01  Miguel de Icaza  <miguel@novell.com>
765
766         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
767         scopes for all the roots, the scopes will now be emitted when the
768         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
769
770         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
771         code.  This reduces a lot of existing cruft.
772         
773         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
774         that the ScopeInfo is generated as we enter the scope, not at the
775         time of use, which is what we used to do before.
776
777         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
778         every time a Block is about to be emitted if we have a
779         CaptureContext. 
780
781 2006-02-01  Raja R Harinath  <rharinath@novell.com>
782
783         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
784         (Reset): Update.
785         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
786
787         * typemanager.cs (cons_param_array_attribute): Make private.
788         (Reset): Set it to null.
789         (InitCoreHelpers): Don't initialize it.
790         (ConsParamArrayAttribute): New.  Initialize it as needed.
791         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
792
793 2006-01-31  Miguel de Icaza  <miguel@novell.com>
794
795         * expression.cs: There might be errors reported during the
796         selection of applicable methods.  If there are errors, do not
797         continue execution as it will lead the compiler to crash.
798
799 2006-01-30  Miguel de Icaza  <miguel@novell.com>
800
801         * expression.cs: Member access is not allowed on anonymous
802         methods.  Fixes #77402.
803
804 2006-01-30  Raja R Harinath  <rharinath@novell.com>
805
806         Fix #77401
807         * cs-parser.jay (VariableDeclaration): Don't set
808         current_array_type to null.
809         (field_declaration, event_declaration, declaration_statement):
810         Set it to null here.
811
812 2006-01-28  Raja R Harinath  <harinath@gmail.com>
813
814         * typemanager.cs (GenericParameterPosition): New.
815         * doc.cs: Use it.
816
817 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
818
819         * doc.cs : To process "include" elements, first we should create
820           another list than XmlNodeList, because it could result in node
821           removal, which could result in that the XmlNodeList gives up
822           yielding next node.
823
824           (Also made code identical to gmcs again.)
825
826 2006-01-25  Miguel de Icaza  <miguel@novell.com>
827
828         * ecore.cs: Introduce an error report that we were not catching
829         before, if not silent, we must report the error.  Gonzalo ran into
830         it.
831
832 2006-01-23  Miguel de Icaza  <miguel@novell.com>
833
834         A fix for bug: #76957
835         
836         * iterators.cs (MoveNextMethod.CreateMethodHost): call
837         ComputeMethodHost before creating the method, this is a new
838         requirement. 
839
840         * anonymous.cs (AnonymousContainer): Now we track all the scopes
841         that this method references (RegisterScope).  The actual scope
842         where the method is hosted is computed with the ComputeMethodHost
843         before we create the method.
844
845         Moved the Deepest routine here.
846
847         (AnonymousContainer.ComputeMethodHost): New routine used to
848         compute the proper ScopeInfo that will host the anonymous method.
849
850         (ScopeInfo): Deal with multiple roots.  The problem was that we
851         did not have a unique root where all ScopeInfos could be hanged
852         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
853         of roots.  
854
855         Remove AdjustMethodScope which is now computed at the end.  Remove
856         LinkScope which did a partial link, instead link all ScopeInfos
857         before code generation from the new "LinkScopes" routine. 
858
859         Simplify all the Add* routines as they no longer need to maintain
860         the tree, they just need to record that they are using variables
861         from a ScopeInfo.
862
863         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
864         routines to produce the forest of ScopeInfo trees.
865
866         * class.cs (TypeContainer.AppendMethod): This is just like
867         AddMethod, but ensures that an interface implementation method
868         (IEnumerable.XXX) is not inserted at the beginning of the queue of
869         methods, but at the end.
870
871         We use this functionality to ensure that the generated MoveNext
872         method in the iterator class is resolved/emitted before the
873         enumerator methods created.   
874
875         This is required because the MoveNext method computes the right
876         ScopeInfo for the method.  And the other methods will eventually
877         need to resolve and fetch information computed from the anonymous
878         method. 
879
880 2006-01-21  Raja R Harinath  <harinath@gmail.com>
881             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
882
883         Fix rest of #76995.
884         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
885         the 'aliases' hash.
886         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
887         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
888
889 2006-01-18  Raja R Harinath  <rharinath@novell.com>
890
891         Fix #76656, cs0231-2.cs.
892         * cs-parser.jay (formal_parameter_list): Make error case catch
893         more issues.
894         (parenthesized_expression_0): Add CS1026 check.
895         (invocation_expression): Remove unused { $$ = lexer.Location }.
896
897 2006-01-17  Raja R Harinath  <rharinath@novell.com>
898
899         Fix #76824.
900         * cs-parser.jay (statement_expression): Don't list out the
901         individual statement-expressions.  Convert syntax error into
902         CS0201 check.
903
904 2006-01-16  Raja R Harinath  <rharinath@novell.com>
905
906         Fix #76874.
907         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
908         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
909         CheckIntermediateModification.
910         (FieldExpr.DoResolve): Add new two-argument version that
911         allows us to resolve the InstanceExpression as an lvalue.
912         The one-argument variant is now just a wrapper.
913         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
914         Resolve the lhs as an lvalue if the it has a value type.
915         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
916         from Assign.DoResolve.
917         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
918         resolved as an lvalue.
919         (PropertyExpr.DoResolve): Update.
920         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
921         has a value type.  Move CS1612 check here from
922         CheckIntermediateModification.
923         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
924         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
925         'right_side' of a ResolveLValue on an 'out' argument.
926         (EmptyExpression.LValueMemberAccess): New.  Used as the
927         'right_side' of a propagated ResolveLValue on a value type.
928         (LocalVariableReference.DoResolveBase): Recognize
929         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
930         Add CS1654 check.
931         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
932         EmptyExpression.Null.
933
934 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
935
936         * typemanager.cs : added IsGenericParameter(). In mcs it always
937           return false.
938         * doc.cs : for generic parameters, use GenericParameterPosition,
939           not FullName.
940
941 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
942
943         * expression.cs: Fix Console.WriteLine ((this = x).foo);
944
945 2006-01-12  Miguel de Icaza  <miguel@novell.com>
946
947         This fixes the problem where we used ldfld instead of ldflda to
948         load the "THIS" pointer on captured parameters, when THIS is a
949         value type.  See bug #77205.
950         
951         * iterators.cs (CapturedThisReference.Emit): Pass false to
952         EmitThis (we do not need the address).
953
954         * codegen.cs (EmitThis): it needs to know whether we need the
955         address of `this' or not.  This is used by value types.  
956
957         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
958         every other call passes false.
959
960 2006-01-12  Raja R Harinath  <rharinath@novell.com>
961
962         Fix #77221.
963         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
964         GetOverride.
965         * expression.cs (Invocation.OverloadResolve): Update.
966         (Invocation.DoResolve): Avoid double resolution of invocation.
967
968 2006-01-11  Raja R Harinath  <rharinath@novell.com>
969
970         Fix #77180.
971         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
972         unary negation of floating point types as 0-expr; negation cannot
973         overflow in floating point types.
974
975         Fix #77204.
976         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
977         on operands of 'void' type.
978
979         Fix #77200.
980         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
981         and ExclusiveOr for boolean constants too.
982
983 2006-01-09  Raja R Harinath  <rharinath@novell.com>
984
985         Fix #75636.
986         * expression.cs (Invocation.OverloadResolve): Replace reflected
987         override methods with their base virtual methods, rather than
988         skipping over them.
989         * typemanager.cs (TypeManager.GetOverride): New.
990
991 2006-01-05  Jb Evain  <jbevain@gmail.com>
992
993         * class.cs (Property.Define, Indexer.Define): do not tag the
994         properties as SpecialName | RTSpecialName.
995
996 2006-01-04  Miguel de Icaza  <miguel@novell.com>
997
998         * class.cs (MethodCore.IsDuplicateImplementation): This method was
999         doing a low-level comparission of parameter types.  It was lacking
1000         a check for __argslist. 
1001
1002 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1003
1004         * expression.cs (ParameterReference.DoResolveBase): Allow
1005         reference parameters if they are local to this block. 
1006
1007         This allows the ref and out parameters of a delegate to be used in
1008         an anonymous method, for example:
1009
1010         delegate void set (out int x);
1011
1012         set s = delegate (out int x){
1013                 x = 0;
1014         };
1015
1016         This is used by functionality introduced late in the C# language.
1017         
1018         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1019         method that take ref and out parameters. 
1020
1021         Fixes #77119 which was a late change in the spec.
1022
1023 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1024
1025         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1026         parent if its the same scope.  Fixes #77060.
1027
1028 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1029
1030         * driver.cs: Report the case of no source files and no -out:
1031         argument provided.
1032
1033 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1034
1035         Fix #77035.
1036         * expression.cs (ComposedCast.GetSignatureForError): Define.
1037
1038 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1039
1040         Fix #76995
1041
1042         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1043         ListDictionary, to contain the ExternAliasEntry entries (in
1044         addition to the NamespaceEntry.aliases hashtable). This field is
1045         shared between the original entry and its doppelganger (bodyless 
1046         copy of it).
1047         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1048         extern_aliases field.
1049         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1050         lookup in extern_aliases.
1051
1052 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1053
1054         Fix #77006.
1055         * class.cs (TypeContainer.Mark_HasEquals): New.
1056         (TypeContainer.Mark_HasGetHashCode): New.
1057         (ClassPart): Override them.
1058         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1059
1060         Fix #77008.
1061         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1062         'parent' argument to the base constructor.
1063
1064         Remove all mention of TypeContainer from decl.cs.
1065         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1066         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1067         (DeclSpace.DeclSpace): Likewise.
1068         (DeclSpace.DefineMembers): Remove unused argument.
1069         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1070         debugging check -- we don't care if the debug code throws an
1071         InvalidCastException instead of an InternalErrorException.
1072         * class.cs (TypeContainer.DefineMembers): Update to changes.
1073         (TypeContainer.DoDefineMembers): Likewise.
1074         (TypeContainer.GetMethods): Likewise.
1075         (PropertyMember.Define): Likewise.
1076         (MemberBase.Parent): New property that forwards to
1077         MemberCore.Parent, but ensures that we get a TypeContainer.
1078         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1079         (RootContext.PopulateTypes): Likewise.  Remove special case code
1080         for !RootContext.StdLib: DefineMembers is idempotent.
1081
1082 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1083
1084         * convert.cs (ExplicitConversionCore): Check the return value from
1085         ExplicitConversionCore which can return null on failure.  Fixes #76914
1086
1087 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1088
1089         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1090
1091 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1092
1093         * doc.cs : The search for referenced namespace was insufficient to
1094           get global one as it used to do. Fixed bug #76965.
1095
1096 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1097
1098         * doc.cs : check name in cref in the last phase that whether it is
1099           namespace or not.
1100
1101 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1102
1103         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1104           Mono.C5.
1105
1106 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1107
1108         * doc.cs : so it turned out that we cannot skip override check for 
1109           interface members. Fixed bug #76954.
1110
1111 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1112
1113         * cs-tokenizer.cs : fixed bug #75984:
1114           - #warning and #error should not be handled when the source line
1115             is disabled.
1116           - #line is not checked strictly when the source line is disabled.
1117           - #define and #undef is on the other hand checked strictly at any
1118             state.
1119
1120 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1121
1122         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1123           CS1027 report.
1124
1125 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1126
1127         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1128
1129         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1130         event initializers.
1131         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1132         (FieldBase.Initializer): Initializer is now optional.
1133         (EventField.Define): Only event field can have initializer.
1134
1135         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1136
1137         * const.cs (Const): Reuse initializer.
1138
1139         * cs-parser.jay: Updated after FieldBase changes.
1140         Added current_array_type to simplify array initializers.
1141
1142         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1143
1144         * expression.cs, iterators.cs: Updated.
1145
1146         * namespace.cs (NamespaceEntry): Made UsingFound private.
1147
1148 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1149
1150         * parameterCollection.cs: Obsolete, removed.
1151         * parser.cs: Obsolete, removed.
1152
1153 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1154
1155         Fix #76849.
1156         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1157
1158         * enum.cs (Enum.Define): Set obsolete context here.
1159
1160 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1161
1162         * doc.cs :
1163           - FindDocumentedMember() now expects 1) paramList as null
1164             when "we don't have to check the number of parameters" and
1165             2) Type.EmptyTypes when "there is no arguments".
1166           - Introduced FoundMember struct to hold the exact type which was
1167             used to find the documented member (the above change broke
1168             test-xml-044; it might be better just to use DeclaringType than
1169             what MS does, like this change does, but it depends on usage.)
1170
1171 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1172
1173         * doc.cs : documented member might be from DeclaringType for nested
1174           types. Fixed bug #76782.
1175
1176 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1177
1178         * anonymous.cs: Have the param code handle leaving copies on the
1179         stack etc. Allows anonymous params to take part in the assignment
1180         code (++, +=, etc). Fixes bug #76550
1181
1182         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1183         it down to the anon code.
1184
1185         * iterators.cs: Use dummy var here
1186
1187         * codegen.cs: Handle new vars
1188
1189 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1190
1191         Fix #76849.
1192         * class.cs (MethodData.Define): Set proper Obsolete context.
1193
1194         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1195         obsolete context.
1196         (FieldExpr.DoResolve): Ditto.
1197
1198 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1199
1200         Fix #76849.
1201         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1202         parent is not obsolete.
1203
1204 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1205
1206         * doc.cs : (FindDocumentedMember) find parameterless members first
1207           and get CS0419 in the early stage. Fixed first case of bug #76727.
1208
1209 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1210
1211         Fix #76859.
1212         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1213         no error was reported.
1214
1215         *expression.cs (Binary.DoResolve): left can be null.
1216
1217 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1218
1219         Fix #76783.
1220         * class.cs (MethodData.Emit): Parameters should be labeled first.
1221
1222 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1223
1224         Fix #76761.
1225         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1226
1227 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1228
1229         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1230
1231         * class.cs (MethodCore): Parameter clean up.
1232         (IMethodData): Added ParameterInfo.
1233         (MethodData): Parameter clean up.
1234         (Indexer.Define): Parameter clean up.
1235
1236         * anonymous.cs,
1237         * codegen.cs,
1238         * cs-parser.jay,
1239         * decl.cs,
1240         * doc.cs,
1241         * ecore.cs,
1242         * flowanalysis.cs,
1243         * iterators.cs,
1244         * pending.cs,
1245         * statement.cs,
1246         * typemanager.cs: Parameter clean up.
1247
1248         * delegate.cs (Define): Get rid of duplicated code.
1249
1250         * expression.cs (ParameterReference): Removed useless parameters
1251         and simplified.
1252         (Invocation): Ditto.
1253
1254         * parameter.cs (ParamsParameter): New class, params specialization.
1255         (ArglistParameter): Attemp to separate arglist.
1256         (Parameter): Refactored to be reusable and faster.
1257         (Parameter.Modifier): Made understandable.
1258         (Parameters): Changed to be used as a class for `this' assembly
1259         parameters. Refactored to use new specialized classes.
1260
1261         * support.cs (ParameterData): Added Types property.
1262         (InternalParameters): Deleted.
1263
1264 2005-08-20  Martin Baulig  <martin@ximian.com>
1265
1266         Merging this patch from GMCS to fix #75867.
1267
1268         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
1269         scope if we don't already have it.
1270
1271 2005-11-17  Martin Baulig  <martin@ximian.com>
1272
1273         * anonymous.cs
1274         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
1275         inherit the scope from our parent.  Fixes #76653.
1276
1277 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1278
1279         * doc.cs : the previous patch does not actually fix the bug.
1280           PropertyInfo override check is now implemented and really fixed it.
1281         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
1282
1283 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1284
1285         * doc.cs : apply "override filter" also to properties.
1286           Fixed bug #76730.
1287
1288 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
1289
1290         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
1291           no need to check overrides. For classes, omit those results from 
1292           interfaces since they must exist in the class. Fixed bug #76726.
1293
1294 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1295
1296         * typemanager.cs : (GetFullNameSignature) differentiate indexers
1297           with different parameters. Fixed the second problem in #76685.
1298
1299 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1300
1301         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
1302           get expected 'protected' access in CheckValidFamilyAccess()).
1303           Fixed bug #76692.
1304
1305 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
1306
1307         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
1308           Fixed bug #76705.  CS1569 was incorrectly commented out.
1309
1310 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1311
1312         * doc.cs : use Invocation.IsOverride() to do real override check.
1313         * expression.cs : made Invocation.IsOverride() internal.
1314
1315 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
1316
1317         * doc.cs : use TypeManager.FindMembers() instead of (possible)
1318           TypeBuilder.FindMembers() and filter overriden base members out.
1319           Fixed bug #76990.
1320
1321 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1322
1323         * doc.cs : ref/out parameters are represented as '@' (instead of
1324           '&' in type FullName). Fixed bug #76630 (additionally crefs).
1325
1326 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1327
1328         * doc.cs : when there was no '.' in cref to methods in doc comment,
1329           then parameters were missing in the output. Fixed bug #76691.
1330
1331 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1332
1333         * driver.cs : don't output docs when there is an error.
1334           Fixed bug #76693.
1335
1336 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1337
1338         * doc.cs :
1339           Now it should detect indexers. Fixed primary concern in bug #76685.
1340           Fixed CS0419 message to not show the identical member signature in
1341           the message.
1342
1343 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
1344
1345         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
1346           instead of Type.FindMembers() since it does not handle events.
1347           Fixed bug #71604.
1348
1349 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
1350
1351         * codegen.cs: Fixed typo (speficied -> specified).
1352
1353 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1354
1355         Fix #76369.
1356         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
1357
1358 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
1359
1360         * attribute.cs: Changed error message.
1361
1362         * cs-tokenizer.cs: One more check.
1363
1364 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1365
1366         * statement.cs (Block.Resolve): Ignore empty statement.
1367
1368 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
1369
1370         * report.cs: Made error/warning methods more strict to avoid
1371         their misuse.
1372
1373         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
1374         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
1375         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
1376         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
1377
1378 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
1379
1380         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
1381         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
1382
1383         * class.cs (TypeContainer.IsComImport): New property.
1384         (Constructor.Define): Create proper ctor for ComImport types.
1385
1386         * expression.cs (New.CheckComImport): Fixed.
1387
1388 2005-11-07  Miguel de Icaza  <miguel@novell.com>
1389
1390         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
1391         that a parameter has been captured does not mean that we do not
1392         have to do the rest of the processing.  This fixes the second part
1393         of #76592.  If there was another anonymous method capturing
1394         values in the past, the Scope would never be set for the second
1395         method that captured the same parameter.
1396
1397         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
1398         properly manipulate the stack.   Second part of fix for #76592.
1399
1400         * expression.cs (New): Add support for invoking "new" on
1401         interfaces that have been flagged with the ComImport attribute and
1402         the CoClass.  Fixes #76637 
1403
1404         * statement.cs (Try.DoEmit): When a variable is captured, do not
1405         try to emit the vi.LocalBuilder variable as it has been captured.
1406         Create a temporary variable and store the results on the
1407         FieldBuilder.  Fixes #76642
1408
1409 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
1410
1411         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
1412
1413         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
1414
1415         * expression.cs (Binary.DoResolve): Added && optimalization.
1416     
1417         * typemanager.cs (AddUserType): Removed useless argument.
1418
1419 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
1420
1421         * statement.cs (Block.variables): Uses ListDictionary.
1422
1423 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1424
1425         Fix #75969.
1426         * class.cs (PartialContainer.EmitType): Customized to emit
1427         security attributes.
1428         (ClassPart.ApplyAttributeBuilder): Transform security attribute
1429         for partial classes.
1430
1431 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
1432
1433         Fix #76599.
1434         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
1435         access has to be fixed.
1436         
1437         * typemanager.cs (IsUnmanagedType): Wrong common field type.
1438
1439 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
1440
1441         Fix #76590.
1442         * ecore.cs (NullCast.Reduce): Implemented.
1443
1444         * expression.cs (ArrayCreation.CheckIndices): Correcly check
1445         constant type.
1446         
1447         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
1448         properly.
1449         (Foreach.Resolve): Catch null properly.
1450
1451 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1452  
1453         * cs-tokenizer.cs: Warning text fix.
1454
1455         * driver.cs: AllWarningNumbers exposed on public interface.
1456
1457         * report.cs (): Reviewed warning numbers.
1458         (IsValidWarning): Use binary search.
1459
1460 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
1461  
1462         * driver.cs: Implemeted resource visibility.
1463         (Resources): New class for code sharing between /res: and
1464         /linkres:
1465  
1466 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
1467
1468         Fix #76568.
1469         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
1470         folding.
1471         
1472         * convert (Convert.ImplicitReferenceConversion): NullCast holds
1473         contants only.
1474         
1475         * ecore.cs (NullCast): Child is contant only.
1476         
1477         * literal.cs (NullLiteral.Reduce): null can be converted to any
1478         reference type.
1479
1480 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
1481
1482         * driver.cs: Use Encoding.Default as default code page instead
1483           of ISO-28591.
1484
1485 2005-10-27  Raja R Harinath  <rharinath@novell.com>
1486
1487         Fix #76085.
1488         * expression.cs (Invocation.Error_InvalidArguments): Handle
1489         __arglist parameters.
1490         (Invocation.VerifyArgumentsCompat): Likewise.
1491         * support.cs (ReflectionParameters.GetSignatureForError): Print
1492         __arglist parameters.
1493         (InternalParamters.GetSignatureForError): Likewise.
1494         * parameter.cs (Parameters.GetSignatureForError): Likewise.
1495
1496 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
1497
1498         * attribute.cs (GetPropertyValue): Made public.
1499
1500         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
1501         Resolve.
1502         Add new property WrapNonExceptionThrows to handle 2.0 assembly
1503         attribute.
1504         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
1505         is not defined.
1506         
1507         * driver.cs: Reflect method name change.
1508         
1509         * statement.cs (Try.Resolve): Warn when try has both general
1510         exception handlers.
1511         
1512         * typemanager.cs: runtime_compatibility_attr_type new predefined
1513         type.
1514
1515 2005-10-26  Raja R Harinath  <harinath@gmail.com>
1516
1517         Fix #76419.
1518         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
1519         treat it as an empty parameter list.
1520
1521 2005-10-26  Raja R Harinath  <rharinath@novell.com>
1522
1523         Fix #76271.     
1524         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
1525         ResolveAsTypeStep silent.
1526         * statement.cs (Block.AddConstant): Mark block as used.
1527         (Block.ResolveMeta): Avoid piling on error messages
1528         if a constant initializer resolution fails.
1529
1530 2005-10-25  Raja R Harinath  <rharinath@novell.com>
1531
1532         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
1533         Remove.
1534         (NamespaceEntry.VerifyAllUsing): New.
1535         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
1536         behaviour.  Delegates actual resolution of alias to ...
1537         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
1538         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
1539         Update.
1540         * driver.cs (Driver.MainDriver): Update.
1541         
1542         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
1543         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
1544         property.
1545         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
1546         Remove.
1547         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
1548         RootNamespace.DefineNamespacesForAll.
1549
1550 2005-10-24  Raja R Harinath  <harinath@gmail.com>
1551
1552         * typemanager.cs (assemblies, external_aliases, modules)
1553         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
1554         (ComputeNamespaces, GetRootNamespace): Remove extra staging
1555         overhead.  Move resposibility ...
1556         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
1557         * driver.cs, attribute.cs, codegen.cs: Update to changes.
1558
1559 2005-10-23  Raja R Harinath  <harinath@gmail.com>
1560
1561         * namespace.cs (RootNamespace.all_namespaces): Renamed from
1562         cached_namespaces.  Improve usage.
1563         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
1564         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
1565         Move from GlobalRootNamespace and simplify.
1566         (RootNamespace.Global): Make instance variable.
1567         (RootNamespace.RootNamespace): Add "alias name" parameter.
1568         (GlobalRootNamespace): Simplify drastically.
1569         (Namespace.Lookup): Don't use GetNamespace.
1570         * typemanager.cs (GetRootNamespace): Rename from
1571         ComputeNamespaceForAlias.
1572         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
1573
1574 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1575
1576         * anonymous.cs (AnonymousContainer): Don't crash when container
1577         doesn't exist.
1578
1579 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1580
1581         * expression.cs (Binary.DoResolve): Warn when comparing same
1582         values.
1583
1584 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
1585
1586         Fix #76486.
1587         * expression.cs (Binary.DoResolve): It looks like there are no
1588         convetsion rules in enum context.
1589
1590 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
1591
1592         Add support for extern alias qualifiers.
1593         * typemanager.cs: Move some LookupTypeReflection code
1594         to namespace.cs, to have cleaner code. Added some methods
1595         to help us keep track of the extern aliased references.
1596         * driver.cs: Add suport for extern alias assemblies on command
1597         line and check for their warnings/errors. Also keep track of the
1598         extern aliased assemblies.
1599         * namespace.cs: Move the global functionality of Namespace
1600         to GlobalRootNamespace/RootNamespace. Now the global namespace
1601         is GlobalRootNamespace.Globa. Also the code moved from 
1602         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
1603         Finally added LocalAliasEntry (AliasEntry before) and
1604         ExternAliasEntry, to handle alias statements.
1605         * cs-parser.jay: Add support in the grammar for extern alias
1606         statement.
1607         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
1608         Update callings to Namespace (now in GlobalRootNamespace).
1609
1610 2005-10-18  Raja R Harinath  <rharinath@novell.com>
1611
1612         Fix #76371.
1613         * class.cs (TypeContainer.DefineType): Move updating of
1614         topological sort earlier in the code.
1615         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
1616
1617 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
1618
1619         Fix #76273.
1620         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
1621         
1622         * constant.cs (Constant.TryReduce): Moved from Cast class.
1623         (Reduce): Made little bit more OO and fixed missing conversions.
1624         
1625         * ecore.cs (Reduce): Implemented.
1626         (Binary.EnumLiftUp): New method to upgrade values to enum values.
1627         
1628         * literal.cs (Reduce): Implemented.
1629         
1630         * class.cs: Reverted Miguel's wrong commit.
1631
1632 2005-10-14  Miguel de Icaza  <miguel@novell.com>
1633
1634         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
1635
1636 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
1637
1638         * cs-parser.jay, expression.cs : CS0214 was missing error location
1639           for constants. Fixed bug #76404.
1640
1641 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
1642
1643         Fix #76370.
1644         * convert.cs (ExplicitConversionCore): Fixed object->enum
1645         conversion.
1646
1647 2005-10-10  Raja R Harinath  <rharinath@novell.com>
1648
1649         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
1650         InstanceExpression.
1651         (PropertyExpr.EmitCall): Likewise.
1652         * expression.cs (Invocation.EmitArguments): Handle case where
1653         arguments == null.
1654         (Invocation.EmitCall): Avoid allocating temporary variable if
1655         there are no arguments.
1656
1657 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1658
1659         Fix #76323.
1660         * convert.cs (ImplicitConversionStandard): Move conversion of
1661         void* to arbitrary pointer types ...
1662         (ExplicitConversionStandard): .. here.
1663         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
1664         error to always print typenames.
1665
1666 2005-10-07  Raja R Harinath  <rharinath@novell.com>
1667
1668         * convert.cs (GetConversionOperator): Rename from
1669         GetConversionOperators.  Move operator selection code from ...
1670         (UserDefinedConversion): ... here.
1671
1672 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
1673
1674         * convert.cs (ExplicitConversionCore): Removed duplicate enum
1675         conversion.
1676
1677 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
1678
1679         * assign.cs (Assign.DoResolve): Error method changed.
1680
1681         * cfold.cs (DoConstantNumericPromotions): Error method changed.
1682         
1683         * const.cs (ResolveValue): Reset in_transit immediately.
1684         
1685         * constant.cs: Error method changed.
1686         
1687         * convert.cs: Removed useless location parameter.
1688         (ExplicitNumericConversion): Don't do double enum check.
1689         (ExplicitConversionCore): Renamed from ExplicitConversion.
1690         (ExplicitUnsafe): Extracted from ExplicitConversion.
1691         (ExplicitConversion): Uses for error reporting.
1692         
1693         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
1694         error messages.
1695         (ResolveBoolean): Uses common error method.
1696         (CastToDecimal): Get rid of ec.
1697         (CastFromDecimal): Optimized.
1698         (ConvCast): Get rid of ec.
1699         
1700         * enum.cs (ResolveValue): Reset in_transit immediately.
1701         (Emit): Return after first error.
1702         
1703         * expression.cs: Convert changes.
1704         
1705         * literal.cs: Error method changed.
1706         
1707         * statement.cs: Error method changed.
1708
1709 2005-10-03  Raja R Harinath  <rharinath@novell.com>
1710
1711         * support.cs (SeekableStreamReader.Position): Don't error out when
1712         the requested position is just beyond the end of the current
1713         buffered data.
1714
1715 2005-09-28  Raja R Harinath  <rharinath@novell.com>
1716
1717         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
1718         try to keep in sync with the byte count of the underlying Stream.
1719         However, this limits us to a window size of 2048 characters: i.e.,
1720         the maximum lookahead of our lexer/parser can be 2048 characters.
1721
1722 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
1723
1724         Fix #76255.
1725         * driver.cs: Fix compilation files with full root path.
1726
1727 2005-09-25  Miguel de Icaza  <miguel@novell.com>
1728
1729         * report.cs (SymbolRelatedToPreviousError): Format the output so
1730         it does not use an open parenthesis that is never closed. 
1731
1732         * driver.cs: Follow coding guidelines
1733
1734 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1735
1736         Fix #72930.
1737         * const.cs (Const.ResolveValue): Check for assigning non-null
1738         value to reference type.
1739
1740 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
1741
1742         * anonymous.cs: Implemented ExprClassName.
1743         
1744         * assign.cs (Assign.DoResolve): Don't chrash when type is not
1745         delegate.
1746         
1747         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
1748         check.
1749         
1750         * class.cs (StaticClass.DefineContainerMembers): Report protected
1751         members as error.
1752         
1753         * codegen.cs: if(ed) PRODUCTION.
1754         
1755         * convert.cs (Error_CannotImplicitConversion): Better error
1756         distinction.
1757         
1758         * cs-parser.jay: More error checks.
1759         
1760         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
1761         
1762         * driver.cs (CSCParseOption): Enabled wrong option check.
1763         
1764         * ecore.cs (Expression.ExprClassName): Turned to property.
1765         (MemberExpr.CheckIntermediateModification): For checking boxed
1766         value types     modification.
1767         
1768         * statement.cs (Fixed.Resolve): Expression type must be
1769         convertible to fixed type.
1770         (CollectionForeach.GetEnumeratorFilter,TryType):
1771         Small refactoring for easier error checking.
1772
1773 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
1774
1775         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
1776         attributes.
1777         
1778         * class.cs (GeneratedBaseInitializer): New class for customization
1779         compiler generated initializers.
1780         (MemberBase.DoDefine): Check Obsolete attribute here.
1781         (FieldMember.DoDefine): Ditto.
1782         
1783         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
1784         constants.
1785         
1786         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
1787         (MemberCore.GetObsoleteAttribute): Removed argument.
1788         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
1789         (MemberCore.CheckObsoleteType): New helper.
1790         
1791         * delegate.cs,
1792         * enum.cs,
1793         * statement.cs: Updates after MemberCore changes.
1794         
1795         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
1796         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
1797         
1798         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
1799         obsolete attribute for compiler construct.
1800         (As.DoResolve): Cache result.
1801         
1802         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
1803
1804 2005-09-26  Raja R Harinath  <rharinath@novell.com>
1805
1806         Fix #76133.
1807         * expression.cs (This.VerifyFixed): In a value type T, the type of
1808         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
1809         value type R, 'this' is treated as a value parameter.
1810
1811 2005-09-22  Miguel de Icaza  <miguel@novell.com>
1812
1813         * statement.cs (Lock): Use the TemporaryVariable class instead of
1814         manually using local variables as those do not work when variables
1815         are captured.
1816
1817         * ecore.cs: Moved the TemporaryVariable class from being a nested
1818         class inside Foreach to be a public class that can be employed in
1819         other places. 
1820
1821 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
1822
1823         * cs-parser.jay: interface_accessors replaced by
1824         accessor_declarations.
1825
1826         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
1827         location.
1828         
1829         * statement.cs (GotoCase.Resolve): Convert null constant to
1830         null case.
1831         (SwitchLabel.ResolveAndReduce): Ditto.
1832         (SwitchLabel.NullStringCase): Custom null stamp.
1833         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
1834         
1835         typemanager.cs (CSharpSignature): Don't skip first argument
1836         for full names.
1837
1838 2005-09-18  Miguel de Icaza  <miguel@novell.com>
1839
1840         * driver.cs: Set InEmacs based on the environment variable EMACS. 
1841
1842         * location.cs (InEmacs): in this mode, do not report column
1843         location as it confuses Emacs.
1844
1845 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
1846
1847         * cfold.cs, constant.cs, convert.cs, ecore.cs,
1848         expression.cs, iterators.cs, literal.cs: Store constants and
1849         literals location.
1850         
1851         * class.cs (MemberBase.ShortName): Pass location.
1852         
1853         * cs-parser.jay: Some location fixes.
1854         
1855         * ecore.cs (Expression.Location): Made virtual.
1856
1857 2005-09-05  Miguel de Icaza  <miguel@novell.com>
1858
1859         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
1860         if the underlying types are the same, otherwise we need to produce
1861         code that will do the proper cast.
1862
1863         This was exposed by Marek's constant rewrite which produced
1864         invalid code for the call site:
1865
1866         enum X : long { a }
1867         void Method (X v) {}
1868
1869         Method ((X) 5)
1870
1871         This fixes test-49.cs
1872
1873 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1874
1875         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
1876           Type/Object should be allowed as well. Fixed bug #75968.
1877
1878 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
1879
1880         * expression.cs : (Binary.DoResolve): when one is enum constant and
1881           another is constant 0, then return enum one *as enum type*.
1882           Fixed bug 74846.
1883
1884 2005-09-02  Raja R Harinath  <rharinath@novell.com>
1885
1886         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
1887         internal.
1888
1889         Fix #75941.
1890         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
1891         flow-branching for LocalVariableReferences in case we were invoked
1892         from a MemberAccess.
1893         * expression.cs (LocalVariableReference.VerifyAssigned): New.
1894         Carved out of ...
1895         (LocalVariableReference.DoResolveBase): ... this.
1896         (MemberAccess.Resolve): Do the check that was disabled during
1897         SimpleNameResolve.
1898
1899 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1900
1901         * class.cs :
1902           (PartialContainer.Create): check abstract/sealed/static strictly
1903           but abstract/sealed can exist only at one side. Fixed bug #75883.
1904
1905 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
1906
1907         Fix #75945.
1908         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
1909         specified, don't default to UnmanagedType.I4.
1910
1911 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
1912
1913         * expression.cs : conditional operator should check possibly
1914           incorrect assign expression. Fixed bug #75946.
1915
1916 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
1917
1918         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
1919           Reverting the change. gmcs is much complex than mcs on this matter.
1920
1921 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
1922
1923         * cs-tokenizer.cs : To read another token ahead of the actual 
1924           consumption, use new SavedToken and cache token instead of moving
1925           back the stream with SeekableStreamReader (it seemed problematic).
1926         * cs-parser.jay,
1927           driver.cs : Thus use StreamReader directly.
1928         * support.cs : Thus removed SeekableStreamReader.
1929
1930 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1931
1932         Fix #75934.
1933         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
1934         (ScopeInfo.EmitScopeType): Use it to construct field names from
1935         names of captured locals.
1936
1937         Fix #75929.
1938         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
1939         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
1940         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
1941         (ExplicitConversion): Remove enum cases already handled by
1942         implicit conversion.  Move implicit conversion check to the beginning.
1943         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
1944         * expression.cs (ArrayCreation.EmitDynamicInitializers):
1945         Don't treat System.Enum as a struct.
1946
1947 2005-08-30  Jb Evain  <jbevain@gmail.com>
1948
1949         * attribute.cs: handles as expression in parameters.
1950
1951 2005-08-30  Raja R Harinath  <rharinath@novell.com>
1952
1953         Fix #75802.
1954         * class.cs (TypeContainer.VerifyClsName): Don't use a
1955         PartialContainer when verifying CLS compliance.
1956         (AbstractPropertyEventMethod): Set Parent here, ...
1957         (PropertyMethod): ... not here.
1958
1959 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
1960
1961         * attribute.cs : escaped attribute name should not be allowed to be
1962           resolved (e.g. @class as classAttribute). Fixed bug #75930.
1963
1964 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1965
1966         Fix #75927.
1967         * convert.cs (ImplicitStandardConversionExists): Allow zero also
1968         when converting a long constant to unsigned long.
1969         * expression.cs (Invocation.OverloadResolve): Add sanity check to
1970         detect where IsApplicable and VerifyArgumentsCompat disagree.
1971
1972 2005-08-29  Raja R Harinath  <rharinath@novell.com>
1973         and Carlos Alberto Cortez  <carlos@unixmexico.org>
1974
1975         Fix #75848.
1976         * class.cs (TypeContainer.CanElideInitializer): New helper.
1977         (TypeContainer.EmitFieldInitializers): Use it to determine if we
1978         can safely emitting the initializer of a field.
1979
1980 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1981
1982         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
1983           allowed inside a switch (without loop). Fixed bug #75433.
1984
1985 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
1986
1987         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
1988         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
1989
1990 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1991
1992         * driver.cs : kinda reverting the default encoding changes (not exact 
1993           revert since I noticed that "codepage:reset" might not work fine).
1994
1995 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
1996
1997         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
1998           Location. Now getter and setter store location correctly.
1999           (errors/cs0111-12.cs now reports the expected location.)
2000
2001 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2002
2003         * driver.cs : Use default encoding on the environment.
2004           Removed (now that) extra parameter for SeekableStreamReader.
2005         * support.cs : (SeekableStreamReader) third .ctor() argument for
2006           StreamReader is not required (always true). preamble size could
2007           be acquired in simpler and safe way.
2008
2009 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2010
2011         * cs-parser.jay: report CS0642 at warning level 3
2012           and report CS0642 for an if else statement also
2013           fixes bug #74745. Patch by John Luke (and a bit
2014           modified by me).
2015           Removed extra CS0642 warning check for "while",
2016           "for" and "fixed".
2017         * statement.cs: In Block.Resolve(), CS0642 check
2018           is reimplemented to check a sequence of an empty
2019           statement and a block.
2020
2021           Both fix bug #66777.
2022
2023 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2024
2025         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2026         detection until I fix it.
2027         
2028         * cs-tokenizer.cs: Changed error message.
2029         
2030         * cs-parser.jay: Fixed 2 error locations.
2031         
2032         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2033         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2034         properties.
2035         
2036         * enum.cs (GetSignatureForError): Fixed.
2037         
2038         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2039         method detection.
2040         
2041         * class.cs,
2042         * typemanager.cs (RegisterProperty): Removed.
2043         
2044         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2045
2046 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2047
2048         Fix #75874.
2049         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2050         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2051
2052 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2053
2054         * expression.cs : tiny fix is required for not warning positive ulong.
2055           See test-441.cs.
2056
2057 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2058
2059         * expression.cs : add CS0652 check for constant and integral
2060           expression. Fixed bug #53974.
2061
2062 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2063
2064         * expression.cs : in DoNumericPromotions(), check if there is implicit
2065           conversion overload for string (to check CS0034). Fixed bug #52492.
2066
2067 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2068
2069         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2070
2071 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2072
2073         * ecore.cs : report location when it is *not* Null.
2074
2075 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2076
2077         * codegen.cs,
2078           ecore.cs,
2079           flowanalysis.cs,
2080           expression.cs:
2081           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2082           correctly. Fixed bug #75721.
2083
2084 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2085
2086         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2087         loop that performs 'min (pos, char_count)'.
2088
2089         Fix #75862.
2090         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2091         converted value in Operator.OnesComplement.
2092
2093 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2094
2095         * anonymous.cs: If the anon method is pulled into a helper class,
2096         it needs to be `internal' not `private'. Fixes runtime behavior on
2097         msft. bug #75704
2098
2099 2005-08-20  Martin Baulig  <martin@ximian.com>
2100
2101         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2102         scope if we don't already have it.
2103
2104         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2105         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2106         fixes #75867.
2107
2108 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2109
2110         Fix #75803
2111         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2112         is a partial class.
2113
2114 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2115
2116         The big constants rewrite
2117         Fix #75746, #75685 and more
2118         As a side effect saved 1MB for MWF ;-)
2119         
2120         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2121         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2122         enum based for corlib compilation.
2123         
2124         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2125         subtractions.
2126         
2127         * class.cs (FixedField.Define): Use ResolveAsConstant.
2128         
2129         * const.cs (IConstant): Interface constants and enums.
2130         (Const.ResolveValue): New method for constant resolvning.
2131         (ExternalConstant): Constants from imported assemblies.
2132         
2133         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2134         conversion; like enums.
2135         (Constant.ToType): Converts this constant to different type.
2136         (Constant.Increment): Adds 1.
2137         
2138         * convert.cs (ImplicitConversionRequired): Simplified.
2139         
2140         * cs-parser.jay: Create EnumMember directly.
2141         
2142         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2143         
2144         * doc.cs (GenerateEnumDocComment): Removed.
2145         
2146         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2147         (ConvertIntLiteral): Removed.
2148         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2149         
2150         * enum.cs (EnumMember): Implement IConstant.
2151         (Enum.IsValidEnumConstant): Removed.
2152         (Enum.GetNextDefaultValue): Removed.
2153         (Enum.FindMembers): Updated.
2154         (Enum.GenerateDocComment): Iterate enum members.
2155         
2156         * expression.cs (Cast.TryReduce): Handle enums correctly.
2157         (New.Constantify): Made public.
2158         (MemberAccess.DoResolve): Removed contant specific if(s).
2159         
2160         * literal.cs (NullLiteral): Implement new abstract methods.
2161         
2162         * statement.cs (GotoCase.Resolve): Use new constant methods.
2163         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2164         
2165         * typemanager.cs (LookupEnum): Removed.
2166         (IsEnumType): Fixed to work with corlib.
2167         (RegisterConstant): Removed.
2168         (LookupConstant): Removed.
2169         (GetConstant): Changed to work with IConstant.
2170
2171 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2172
2173         * location.cs : Fixed overflown (>255) column number.
2174
2175 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2176
2177         First cut of the qualified-alias-member feature.
2178         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2179         token.
2180         * cs-parser.jay (DOUBLE_COLON): New token.
2181         (namespace_or_type_name): Add rule for recognizing
2182         qualified-alias-members.
2183         (primary_expression): Likewise.
2184         (element_access): Allow QualifiedAliasMember as a possible
2185         type-bearing expression.
2186         (local_variable_type, local_variable_pointer_type): Likewise.
2187         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2188         aliases in the current and enclosing namespace declarations.
2189         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2190         * decl.cs (MemberName.is_double_colon): New.
2191         (MemberName.MemberName): Add new constructor for alias-member.
2192         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2193         * expression.cs (QualifiedAliasMember): New expression type.
2194
2195 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2196
2197         * location.cs : it borked when no argument was specified.
2198
2199 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2200
2201         * location.cs : tiny ToString() format fix.
2202
2203 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2204
2205         * statement.cs : oops, it was missing.
2206
2207 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2208
2209         A set of fixes for precise line/column location.
2210
2211         * location.cs :
2212           "token" field now holds a file/line "delta", a line number offset 
2213           from the segment, and a column number. See also:
2214           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2215           December/009508.html
2216           Removed static IsNull. Use instance IsNull property instead.
2217         * cs-tokenizer.cs :
2218           For some tokens it stores Location. For Identifier it stores
2219           LocatedToken which is a pair of string name and location.
2220           Column numbers are adjusted only at getChar().
2221         * report.cs :
2222           Use Location.ToString() for reporting (it now contains column).
2223         * cs-parser.jay :
2224           Largely modified to use LocatedToken instead of
2225           string (IDENTIFIER), and to acquire Location from some tokens.
2226         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2227           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2228           codegen.cs :
2229           Now MemberName holds Location. DeclSpace.ctor() receives Location
2230           as a parameter. Removed extra parameters to all derived classes.
2231           Replaced Location.IsNull() with instance property.
2232         * assign.cs, expression.cs :
2233           Added .ctor() overload that omits Location.
2234         * attribute.cs :
2235           Added "nameEscaped" flag that indicates the identifier was escaped
2236           in the source file. This fixes bug #57047.
2237
2238 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2239
2240         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2241         New method, looking for lo-case imported cls type.
2242
2243         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2244         here.
2245
2246         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2247
2248         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2249
2250         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2251         all_imported_types.
2252         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2253
2254         Optimized to save 3.5 MB for SWF compilation.
2255
2256 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2257
2258         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2259         (PartialContainer.Create): Moved logic AddToContainer.
2260         (PartialContainer.MarkForDuplicationCheck): Shares name.
2261         
2262         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2263         place.
2264         
2265         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
2266         initialization.
2267         (Namespace.GetSignatureForError): New method.
2268         
2269         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
2270         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
2271
2272 2005-08-01  Raja R Harinath  <rharinath@novell.com>
2273
2274         Fix #75669.
2275         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
2276         member lookup rather than qualifier_type, since qualifier_type can
2277         be null.
2278
2279 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2280
2281         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
2282         enum member.
2283
2284 2005-07-31  Miguel de Icaza  <miguel@novell.com>
2285
2286         * statement.cs: Copy the local exception into the exception
2287         captured local.  Fixes 75674
2288
2289 2005-07-31  Raja R Harinath  <harinath@gmail.com>
2290
2291         Fix #75658.
2292         * expression.cs (Invocation.OverloadResolve): Don't report error
2293         CS1501 if error CS1502 has been reported.
2294         (New.DoResolve): Delegate CS1501 reporting to
2295         Invocation.OverloadResolve.
2296
2297         Fix #75656.
2298         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
2299         invariant-meaning-in-block property in an enclosing block if
2300         necessary.
2301
2302 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
2303
2304         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
2305         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
2306         (Switch.CheckSwitch): Just save 50kb for SWF.
2307
2308 2005-07-27  Martin Baulig  <martin@ximian.com>
2309
2310         * anonymous.cs (CaptureContext.AddField): Added
2311         `AnonymousContainer am' argument; compute its toplevel scope if
2312         it's not already computed.  Fixes #75649.
2313
2314 2005-07-26  Raja R Harinath  <rharinath@novell.com>
2315
2316         Fix #75628.
2317         * class.cs (Constructor.Emit): Reset block to null if the block
2318         resolve fails.
2319
2320 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2321
2322         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
2323
2324 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
2325
2326         * class.cs (MethodData.Define): Check whether accessor implementing
2327         interface is public.
2328
2329         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
2330
2331 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
2332
2333         Fix #57245
2334         * namespace.cs (LookupType): Moved same type check to...
2335         
2336         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
2337         with the same name.
2338
2339 2005-07-21  Raja R Harinath  <rharinath@novell.com>
2340
2341         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
2342         already found a typebuilder.
2343         * class.cs (MethodCore.IsDuplicateImplementation): Compare
2344         MemberNames, not strings.
2345
2346         * const.cs (Error_ExpressionMustBeConst): 
2347         Rename from Error_EpressionMustBeConst.
2348         * const.cs, class.cs, statement.cd: Update.
2349
2350 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
2351
2352         Fix #65573
2353
2354         * const.cs (Const.LookupConstantValue): Report missing contant expression
2355         everytime.
2356         (Error_EpressionMustBeConstant): Only one error method.
2357
2358         * class.cs, statement.c: Updated.
2359
2360 2005-07-20  Raja R Harinath  <rharinath@novell.com>
2361
2362         * statement.cs (Block.Flags): Add back HasVarargs.
2363         (Block.flags): Make protected.
2364         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
2365
2366         * typemanager.cs (types, typecontainers, user_types): Remove.
2367         (UserTypes, TypeContainers): Likewise.
2368         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
2369         (CleanUp, Reset): Update.
2370         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
2371         (GetNestedType): Use Type.GetNestedType.
2372         (CoreLookupType): Take two arguments, the namespace and the
2373         basename of the type.  Update to use the Namespace.Lookup
2374         mechanism.
2375         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
2376         (RealMemberLookup): Use IsNestedChildOf instead of playing with
2377         string concatenation and substring matches.
2378         * class.cs, enum.cs, delegate.cs: Update to changes.
2379
2380 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
2381
2382         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
2383         Expression and made virtual.
2384
2385         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
2386         (ImplicitStandardConversionExists): Fixed `byte' typo ?
2387
2388         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
2389
2390         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
2391         error message.
2392
2393         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
2394         change.
2395
2396 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
2397
2398         Fix #57707
2399         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
2400         AssemblyCultureAttribute is not used on executable.
2401
2402         * rootcontext.cs,
2403         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
2404
2405 2005-07-16  Raja R Harinath  <rharinath@novell.com>
2406
2407         Fix #60638.
2408         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
2409         New.  Reports CS0252/CS0253.
2410         Mostly taken from preliminary patch by Duncak Mak.
2411         (Binary.DoResolveOperator): Store results of operator lookup.
2412         Use them to detect if we need to warn about unintended reference
2413         comparisons.
2414
2415 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2416
2417         Fix #72969.
2418         * namespace.cs (Namespace.Lookup): Add back location parameter.
2419         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
2420         * delegate.cs, ecore.cs, expression.cs: Update to changes.
2421
2422         * codegen.cs (EmitContext.DeclSpace): Make readonly.
2423         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
2424         (Namespace.LookupType): ... this.
2425         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
2426         of namespaces.
2427         * typemanager.cs (LookupTypeReflection): Remove buggy code that
2428         purported to handle pointers.
2429         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
2430         CoreLookupType.
2431
2432 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
2433
2434         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
2435         type as namespace.
2436
2437 2005-07-15  Raja R Harinath  <rharinath@novell.com>
2438
2439         * namespace.cs (Namespace.Lookup): Drop location parameter.
2440         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
2441         (NamespaceEntry.Lookup): ... this.
2442         (NamespaceEntry.Error_AmbiguousTypeReference):
2443         Move here from DeclSpace.
2444         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
2445         names ...
2446         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
2447         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
2448         Move to NamespaceEntry.
2449         * delegate.cs, expression.cs: Update to changes.
2450
2451 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
2452
2453         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
2454         CheckAttributeType and refactored.
2455         (Attribute.ResolvePossibleAttributeType): Changed to reuse
2456         ResolveAsTypeTerminal error handling.
2457         (ResolveAsTypeTerminal): Introduced because of global attributes extra
2458         handling.
2459         (GetSignatureForError): Print errors in same way.
2460
2461         * class.cs,
2462         * codegen.cs: Reflect attribute GetSignatureForError change.
2463
2464         * ecore.cs,
2465         * expression.cs: Add silent parameter to ResolveAsTypeStep.
2466
2467         * namespace.cs (UsingEntry): Refactored to make fields private.
2468
2469         * assign.cs,
2470         statement.cs: Error_UnexpectedKind has extra parameter.
2471
2472 2005-07-14  Raja R Harinath  <rharinath@novell.com>
2473
2474         * ecore.cs (IAlias): Remove.
2475         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
2476         that implement the interface.
2477         * namespace.cs (Namespace): Likewise.
2478         (Namespace.declspaces): Renamed from 'defined_names'.
2479         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
2480         DeclSpace instead of an IAlias.
2481         * tree.cs (Tree.AddDecl): Update.
2482
2483 2005-07-12  Raja R Harinath  <rharinath@novell.com>
2484
2485         * statement.cs (Block.Flags); Remove HasVarargs.
2486         (Block.HasVarargs): Move to ToplevelBlock.
2487         (Block.ThisVariable, Block.AddThisVariable): Likewise.
2488         (Block.Variables): Make protected.  Initialize variable hashtable
2489         if necessary.
2490         (Block.AddVariable): Update.
2491         (Block.Resolve): Update to changes.
2492         (ToplevelBlock.HasVarargs): New boolean.
2493         (ToplevelBlock.ThisVariable): Move here from Block.
2494         (ToplevelBlock.AddThisVariable): Likewise.
2495         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
2496         * expression.cs (This.ResolveBase): Update to changes.
2497         (ArglistAccess.DoResolve): Likewise.
2498
2499 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2500
2501         Fix #75321
2502         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
2503
2504         * class.cs (TypeContainer.VerifyMembers): Distinguish between
2505         not used and not used & assigned.
2506         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
2507
2508 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
2509
2510         Fix #75053
2511         * expression.cs (Is.DoResolve): null is never provided type.
2512
2513 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
2514
2515         Fix #52496
2516         * cs-parser.jay: Less strict event error rule to catch more errors.
2517
2518 2005-07-08  Martin Baulig  <martin@ximian.com>
2519
2520         Fix test-iter-10.cs - distinguish whether we `yield' in a property
2521         gettter (allowed) or setter (not allowed).
2522
2523         * class.cs (Accessor): Implement IIteratorContainer.
2524         (Accessor.Yields): New public field.
2525         (PropertyBase.PropertyMethod.Define): Handle iterators on a
2526         per-accessor basis.
2527
2528         * cs-parser.jay
2529         (get_accessor_declaration, set_accessor_declaration): Set the
2530         `yields' flag on the accessor, not the property.
2531         (property_declaration): Do the iterators check on a per-accessor
2532         basis and not for the whole property.
2533
2534 2005-07-08  Martin Baulig  <martin@ximian.com>
2535
2536         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
2537         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
2538
2539 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
2540
2541         Fix #74975
2542         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
2543         (ExtractSecurityPermissionSet): Cope with self referencing security
2544         attributes properly.
2545
2546         * driver.cs (SetOutputFile): Made public property OutputFile.
2547
2548 2005-07-07  Raja R Harinath  <rharinath@novell.com>
2549
2550         Fix #75486.
2551         * class.cs (TypeContainer.first_nonstatic_field): Rename from
2552         has_nonstatic_fields.  Make into a FieldBase pointer.
2553         (TypeContainer.AddField): Add CS0282 check.
2554         (TypeContainer.EmitType): Update.
2555
2556 2005-07-06  Miguel de Icaza  <miguel@novell.com>
2557
2558         * cs-tokenizer.cs (consume_identifier): Do not create strings to
2559         compare if they start with __.
2560
2561 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2562
2563         * statement.cs (Switch.SwitchGoverningType): Only look at
2564         UserCasts that don't need implicit standard conversions to one of
2565         the allowed switch types (Fixes test-322.cs).
2566         (LocalInfo.Resolve): Re-enable sanity-test.
2567
2568 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
2569
2570         * cs-tokenizer.cs (consume_identifier): Detect double undescores
2571         
2572         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
2573         
2574         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
2575
2576 2005-07-06  Raja R Harinath  <rharinath@novell.com>
2577
2578         Fix #75472.
2579         * ecore.cs (SimpleName.GetSignatureForError): Add.
2580         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
2581         (MemberAccess.GetSignatureForError): Add.
2582
2583 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
2584  
2585         The big error and warning messages review.
2586         
2587         * anonymous.cs,
2588         * assign.cs,
2589         * attribute.cs,
2590         * class.cs,
2591         * codegen.cs,
2592         * convert.cs,
2593         * cs-parser.jay,
2594         * cs-tokenizer.cs,
2595         * decl.cs,
2596         * delegate.cs,
2597         * doc.cs,
2598         * driver.cs,
2599         * ecore.cs,
2600         * enum.cs,
2601         * expression.cs,
2602         * flowanalysis.cs,
2603         * iterators.cs,
2604         * literal.cs,
2605         * location.cs,
2606         * modifiers.cs,
2607         * namespace.cs,
2608         * parameter.cs,
2609         * pending.cs,
2610         * report.cs,
2611         * rootcontext.cs,
2612         * statement.cs,
2613         * support.cs,
2614         * tree.cs,
2615         * typemanager.cs: Updated.
2616         
2617         * class.cs: (MethodCore.SetYields): Moved here to share.
2618         (PropertyMethod.Define): Moved iterator setup here.
2619         
2620         * iterators.cs: Add orig_method to have full access to parent
2621         container.
2622
2623 2005-07-05  Raja R Harinath  <rharinath@novell.com>
2624
2625         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
2626         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
2627         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
2628         variable of struct type.
2629         * expression.cs (Unary.ResolveOperator): Update to change.
2630         (Indirection.VerifyFixed): Likewise.
2631         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
2632         (ParameterReference.VerifyFixed): Value parameters are fixed.
2633         (This.VerifyFixed): Treat 'this' as a value parameter.
2634         * statement.cs (LocalInfo.IsFixed): Remove.
2635
2636 2005-07-01  Martin Baulig  <martin@ximian.com>
2637
2638         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
2639         `ec.EmitThis ()' to get the correct scope.
2640
2641 2005-07-01  Martin Baulig  <martin@ximian.com>
2642
2643         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
2644         instance is a ParameterReference; fixes #75299.
2645
2646 2005-07-01  Martin Baulig  <martin@ximian.com>
2647
2648         Reverted Marek's latest patch (r46725):
2649         - it contains structural changes which are neither mentioned in
2650           the ChangeLog nor explained anywhere; for example the additional
2651           argument of EmitContext's and Iterator's .ctor's and the
2652           TypeContainer.DefineMembers() change.
2653         - structural changes like this should go in in seperate patches
2654           and not be hidden in a huge patch which just seems to affect
2655           warnings and errors.
2656           a big and hard to understand patch.
2657         - it breaks iterators and causes regressions, for instance in
2658           test-iter-03.cs.      
2659
2660 2005-06-30  Raja R Harinath  <rharinath@novell.com>
2661
2662         Fix #75412.
2663         * expression.cs (Indexers.map): Remove.
2664         (Indexers.Append): Filter out inaccessible setters and getters.
2665         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
2666
2667         Fix #75283.
2668         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
2669         Refactored from ...
2670         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
2671         (FieldExpr.Emit, PropertyExpr.Emit): Update.
2672         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
2673         * expression.cs (Invocation.EmitCall): Add CS0120 check.
2674
2675 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
2676
2677         Fix #75322
2678         * class.cs (FieldBase.GetInitializerExpression): One more field
2679         for backup.
2680
2681 2005-06-28  Miguel de Icaza  <miguel@novell.com>
2682
2683         * pending.cs: Do not define a proxy if the base method is virtual,
2684         it will be picked up by the runtime (bug 75270).
2685
2686 2005-06-08  Martin Baulig  <martin@ximian.com>
2687
2688         The big Iterators rewrite :-)
2689
2690         * iterators.cs: Rewrite this to use the anonymous methods framework.
2691
2692         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
2693         before the TypeContainers; see 2test-21.cs.
2694
2695         * class.cs
2696         (TypeContainer.DefineType): Don't create a new EmitContext if we
2697         already have one (this only happens if we're an Iterator).
2698         (TypeContainer.Define): Also call Define() on all our iterators.
2699         (Method.CreateEmitContext): Added support for iterators.
2700
2701         * anonymous.cs
2702         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
2703         (AnonymousContainer.CreateMethodHost): Moved here from
2704         AnonymousMethod and made abstract.
2705         (AnonymousContainer.CreateScopeType): New abstract method.
2706         (AnonymousContainer.IsIterator): New public property.
2707         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
2708         get the ScopeTypeBuilder rather than manually defining it here. 
2709         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
2710         iterators here.
2711
2712         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
2713         before RootContext.DefineTypes().
2714
2715         * codegen.cs (EmitContext.RemapToProxy): Removed.
2716         (EmitContext.CurrentAnonymousMethod): Changed type from
2717         AnonymousMethod -> AnonymousContainer.
2718         (EmitContext.ResolveTopBlock): Protect from being called twice.
2719         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
2720         (EmitContext.EmitThis): Removed the iterators hacks; use the
2721         anonymous methods framework for that.
2722
2723         * statement.cs
2724         (ToplevelBlock.Container): Make this a property, not a field.
2725         (ToplevelBlock.ReParent): New public method; move the
2726         ToplevelBlock into a new container.
2727         (Foreach.TemporaryVariable): Simplify.
2728
2729 2005-06-05  Martin Baulig  <martin@ximian.com>
2730
2731         * statement.cs (LocalInfo.CompilerGenerated): New flag.
2732         (Block.AddTemporaryVariable): New public method; creates a new
2733         `LocalInfo' for a temporary variable.
2734         (Block.EmitMeta): Create the LocalBuilders for all the temporary
2735         variables here.
2736         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
2737         non-iterator variables.
2738
2739 2005-06-05  Martin Baulig  <martin@ximian.com>
2740
2741         * statement.cs (Foreach.TemporaryVariable): Create the
2742         LocalBuilder in the Emit phase and not in Resolve since in some
2743         situations, we don't have an ILGenerator during Resolve; see
2744         2test-19.cs for an example.
2745
2746 2005-06-04  Martin Baulig  <martin@ximian.com>
2747
2748         **** Merged r45395 from GCS ****
2749
2750         The big Foreach rewrite - Part II.
2751
2752         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
2753         with `PropertyInfo ienumerator_getcurrent'.
2754
2755         * codegen.cs (VariableStorage): Removed.
2756
2757         * statement.cs
2758         (Foreach): Derive from Statement, not ExceptionStatement.
2759         (Foreach.CollectionForeach): New nested class.  Moved all the code
2760         dealing with collection foreach here.
2761         (Foreach.ForeachHelperMethods): Removed.
2762         (Foreach.TemporaryVariable): Implement IMemoryLocation.
2763
2764 2005-05-23  Martin Baulig  <martin@ximian.com>
2765
2766         * statement.cs (Try.DoResolve): Don't create a `finally' if we
2767         don't need to.  Fix #75014.
2768
2769 2005-05-20  Martin Baulig  <martin@ximian.com>
2770
2771         Merged r44808 from GMCS.
2772
2773         * class.cs (TypeContainer.CircularDepException): Removed.
2774         (TypeContainer.DefineType): Removed the `InTransit' stuff.
2775         (TypeContainer.CheckRecursiveDefinition): Check for circular class
2776         (CS0146) and interface (CS0529) dependencies here.
2777
2778 2005-06-21  Raja R Harinath  <rharinath@novell.com>
2779
2780         * expression.cs (Invocation.EmitCall): Fix initialization
2781         'this_call' to reflect current behaviour.  Fix indentation.
2782
2783         * convert.cs (FindMostEncompassedType): Add two trivial special
2784         cases (number_of_types == 0 || number_of_types == 1).
2785         (FindMostEncompasingType): Likewise.
2786
2787 2005-06-17  Raja R Harinath  <rharinath@novell.com>
2788
2789         Some cleanups preparing for the fix of #75283.
2790         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
2791         error testing.
2792         (EventExpr.InstanceResolve): Likewise.
2793         (EventExpr.DoResolve): Remove redundant checks.
2794
2795 2005-06-10  Duncan Mak  <duncan@novell.com>
2796
2797         * cs-tokenizer.cs (process_directives): New flag for controlling
2798         the processing of preprocessor directives.
2799         (x_token): After seeing a '#', return Token.NONE instead of going
2800         to handle_preprocessing_directive() when not processing
2801         directives. This avoids unnecessary processing during the token peek in
2802         is_punct().
2803
2804         This fixes #74939.
2805
2806         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
2807         the existing error reporting methods instead of Report.Error.
2808
2809         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
2810         after Raja's rewrite.
2811
2812 2005-06-08  Miguel de Icaza  <miguel@novell.com>
2813
2814         * class.cs: Small fix.
2815
2816 2005-06-08  Raja R Harinath  <rharinath@novell.com>
2817
2818         Fix #75160.
2819         * class.cs (GetPartialBases): Fix return value check of
2820         part.GetClassBases.
2821
2822 2005-06-07  Raja R Harinath  <rharinath@novell.com>
2823
2824         Ensure that partial classes are registered in their enclosing
2825         namespace.  Initial part of fix of #75160.
2826         * tree.cs (Tree.RecordDecl): Add new namespace argument.
2827         Register declspace with namespace here, not in
2828         DeclSpace.RecordDecl.
2829         * cs-parser.jay: Pass namespace to RecordDecl.
2830         * class.cs (PartialContainer.Create): Likewise.
2831         (ClassPart.DefineType): New sanity-check.  Throws an exception if
2832         called.
2833         * decl.cs (Declspace.RecordDecl): Remove.
2834         * namespace.cs (NamespaceEntry.DefineName): Remove.
2835
2836 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
2837
2838         * rootcontext.cs: Reset TargetExt as well.
2839
2840 2005-06-03  Raja R Harinath  <rharinath@novell.com>
2841
2842         * ecore.cs (Expression.Resolve): Emit CS0654 error when
2843         -langversion:ISO-1.
2844
2845 2005-06-02  Raja R Harinath  <rharinath@novell.com>
2846
2847         Fix #75080, cs0119.cs.
2848         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
2849         of ...
2850         (Expression.Resolve): ... this.  Use it.  Remove bogus code
2851         allowing ExprClass.Type and ExprClass.Namespace for
2852         ResolveFlags.VariableOrValue.
2853         (Expression.Resolve) [1-argument variant]: Change default resolve
2854         flags based on language version.
2855         (Expression.Error_UnexpectedKind): Use a simple string array
2856         rather than an ArrayList.
2857         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
2858         not ExprClass.Type.
2859         (TypeOfVoid.DoResolve): Likewise.
2860         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
2861         flags argument -- it always has the same value.
2862
2863 2005-05-31  Raja R Harinath  <rharinath@novell.com>
2864
2865         Fix #75081.
2866         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
2867         Use it in the error message.
2868         * assign.cs, expression.cs, statement.cs: Update.
2869
2870 2005-05-30  Raja R Harinath  <rharinath@novell.com>
2871
2872         Fix #75088.
2873         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
2874         the "almostMatchedMember" case too.
2875         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
2876         that failed the accessibility checks to 'almost_match'.
2877
2878 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
2879
2880         * attribute.cs: Use internal MethodBuilder methods to set
2881         ExactSpelling and SetLastError on PInvoke methods, instead
2882         of passing them via charset.  Fixes #75060.
2883
2884 2005-05-27  Raja R Harinath  <rharinath@novell.com>
2885
2886         * parameter.cs (Parameter): Remove TODO comment.
2887         (Parameter.DefineParameter): Remove Location parameter.
2888         (Parameters.LabelParameters): Likewise.
2889         * class.cs (Constructor.Emit): Update to change.
2890         (MethodData.Emit): Likewise.
2891         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
2892         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
2893
2894 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
2895
2896         * parameter.cs,
2897           Removed Parameters.Location and added Parameter.Location instead.
2898           Removed Location parameter from Emit() and GetSignature().
2899         * anonymous.cs,
2900           class.cs,
2901           cs-parser.jay,
2902           delegate.cs,
2903           iterators.cs,
2904           statement.cs :
2905           Modified all related calls.
2906
2907 2005-05-26  Raja R Harinath  <rharinath@novell.com>
2908
2909         Improve user-defined conversion handling.
2910         * convert.cs (GetConversionOperators): Rewrite.  Return only the
2911         applicable operators.
2912         (AddConversionOperators): New.  Helper for GetConversionOperators.
2913         (FindMostEncompassedType, FindMostEncompassingType): Verify that
2914         there is only one most encompassed/encompassing type.
2915         (FindMostSpecificSource, FindMostSpecificTarget): Remove
2916         "applicable operator" handling.
2917         (UserConversion): Move cache here from GetConversionOperators.
2918         Directly cache the chosen operator, rather than the whole
2919         MethodGroup.
2920         (ExplicitNumericConversion): Fix buggy implementation of Decimal
2921         case.  Allow conversion of decimal to sbyte and byte too.
2922         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
2923         New static methods.  Used to avoid allocating EmptyExpressions in
2924         convert.cs.
2925
2926 2005-05-24  Duncan Mak  <duncan@novell.com>
2927
2928         * ecore.cs (CastFromDecimal): New class for casting a decimal to
2929         another class, used in Convert.ExplicitNumericConversion.
2930         (CastToDecimal): New class, similar to above, but casts to
2931         System.Decimal, used in Convert.ImplicitNumericConversion and also
2932         in explicit convesion from double/float to decimal.
2933
2934         * convert.cs (ImplicitNumericConversion): Handle implicit
2935         conversions to System.Decimal.
2936         (ExplicitNumericConversion): handle explicit conversions to
2937         System.Decimal.
2938
2939         This fixes #68711.
2940         
2941 2005-05-20  Miguel de Icaza  <miguel@novell.com>
2942
2943         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
2944         know the type at this stage, just break through.   Fixes #75008 
2945
2946 2005-05-19  Martin Baulig  <martin@ximian.com>
2947
2948         * delegate.cs
2949         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
2950         to disable error reporting.
2951
2952         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
2953         here since we don't want to report an error; see the new test-336.cs.
2954
2955 2005-05-19  Raja R Harinath  <rharinath@novell.com>
2956
2957         * statement.cs (ToplevelBlock.GetParameterReference)
2958         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
2959         Move here from class Block.
2960         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
2961         * expression.cs (ParameterReference.DoResolveBase): Likewise.
2962
2963 2005-05-18  Martin Baulig  <martin@ximian.com>
2964
2965         Fix #74978.
2966
2967         * flowanalysis.cs
2968         (FlowBranching.Reachability): Add non-static public And() and Or()
2969         methods.
2970         (FlowBranchingSwitch): New class; do the `break_origins' thing
2971         like in FlowBranchingLoop.
2972         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
2973         reachability, not just locals and parameters.
2974         (FlowBranching.MergeChild): Remove some of the hacks for loop and
2975         switch; MergeBreakOrigins() now takes care of that.
2976
2977 2005-05-18  Martin Baulig  <martin@ximian.com>
2978
2979         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
2980         a loop and may leave it, reset the barrier; fixes #74974.
2981
2982 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
2983         
2984         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
2985         is back.
2986         
2987         * cs-parser.jay: Catch more lexical errors.
2988         
2989         * report.cs: Add one more Error method.
2990         
2991         * rootcontext.cs,
2992         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
2993
2994 2005-05-17  Martin Baulig  <martin@ximian.com>
2995
2996         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
2997         #70970. 
2998
2999 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3000
3001         Fix test-382.cs.  Emit values of decimal constants.
3002         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3003         Carved out of ...
3004         (TypeContainer.AddField): ... this.
3005         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3006         with initializers to include 'Const's.
3007         (ClassPart.RegisterFieldForInitialization): Forward to
3008         PartialContainer.
3009         * const.cs (Const.Const): Pass initializer to base class.
3010         (Const.Define): In case of decimal constants, register them for
3011         initialization in a static constructor.
3012
3013 2005-05-14  Martin Baulig  <martin@ximian.com>
3014
3015         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3016         do not call ResolveUnreachable() on unreachable statements in
3017         here, see the comment in the source code.
3018
3019 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3020
3021         Fix #74934.
3022         * expression.cs (BinaryResolveOperator): If one of the operands of
3023         an equality comparison is 'null' and the other is a pointer type,
3024         convert the null to a NullPointer.
3025         * convert.cs (ImplicitReferenceConversion): If the expression is a
3026         NullLiteral and the target type is a pointer type, return a
3027         NullPointer instead.
3028         (ImplicitConversionStandard): Likewise.
3029
3030 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3031         
3032         * cs-parser.jay: Set readonly context based on special constructs.
3033         
3034         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3035         readonly variable error handling.
3036         
3037         * rootcontext.cs (EmitCode): Don't verify members when error
3038         occurred.
3039         
3040         * statement.cs (LocalInfo): Add reaodnly context information.
3041         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3042
3043 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3044
3045         * statement.cs (Block.Resolve): Revert change below.  Modify fix
3046         for #74041 to initialize 'resolved' to false only for explicit
3047         blocks.  Fixes #74873.
3048
3049 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3050
3051         Fix #74920.
3052         * typemanager.cs (unmanaged_enclosing_types): New.
3053         (IsUnmanagedType): Avoid infloops by using
3054         'unmanaged_enclosing_types' to talk with recursive invocations.
3055
3056 2005-05-13  Martin Baulig  <martin@ximian.com>
3057
3058         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3059         instance variable, not a local.  Fix #74873.
3060         (Block.ResolveUnreachable): Set it to true here.
3061
3062 2005-05-11  Duncan Mak  <duncan@novell.com>
3063
3064         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3065         continuing to process for 'arg'.
3066         (handle_preprocessing_directive): Check the argument of the #endif
3067         directive and report error CS1025 if there are any trailing
3068         characters.
3069
3070         According to the C# spec, having even whitespace after the #endif
3071         directive is illegal; however, because we call arg.TrimEnd ()
3072         beforehand, we have the same behavior as csc, allowing whitespace
3073         after the directive.
3074
3075         Fixes #74892.
3076
3077 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3078
3079         Fix #74863.
3080         
3081         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3082         (Constructor.GetObsoleteAttribute): Implemented correctly.
3083
3084 2005-05-10  Martin Baulig  <martin@ximian.com>
3085
3086         * support.cs (ReflectionParameters.ParameterModifier): Use
3087         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3088         and `ParameterAttributes.In'.  Fixes #74884.
3089
3090 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3091
3092         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3093         
3094         * expression.cs (Argument.GetParameterModifier): Turned to property.
3095         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3096         
3097         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3098         its C# equivalent.
3099         
3100 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3101
3102         Fix #74852.
3103         * decl.cs (MemberCache.AddMethods): Register override methods,
3104         rather than non-override methods.
3105         * typemanager.cs (RegisterOverride): New.
3106         (IsOverride): Update.
3107
3108 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3109
3110         Fix #73105.
3111         
3112         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3113         recursive declaration.
3114         
3115         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3116         
3117 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3118
3119         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3120         
3121         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3122
3123 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3124
3125         Fix #74797.
3126         * decl.cs (DeclSpace.FamilyAccessible): 
3127         Use TypeManager.IsNestedFamilyAccessible.
3128
3129         Fix reopened #64812.
3130         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3131         internal'.
3132
3133 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3134             Abin Thomas  <projectmonokochi@rediffmail.com>
3135             Anoob V E  <projectmonokochi@rediffmail.com>
3136             Harilal P R  <projectmonokochi@rediffmail.com>
3137
3138         Fix #64812.
3139         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3140         allow access to all static members.
3141
3142 2005-05-04  Martin Baulig  <martin@ximian.com>
3143
3144         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3145
3146 2005-05-04  Martin Baulig  <martin@ximian.com>
3147
3148         Fix #74655.
3149
3150         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3151         section at the end; make things work if `default' is not the last
3152         section.        
3153
3154 2005-05-04  Martin Baulig  <martin@ximian.com>
3155
3156         Fix #70400.
3157
3158         * statement.cs (Switch): Replaced the `got_default' field with a
3159         `default_section' one.
3160         (Switch.CheckSwitch): Set `default_section' here.
3161         (Switch.Resolve): If we're a constant switch and the constant is
3162         not found, use the default section.
3163
3164 2005-05-03  Martin Baulig  <martin@ximian.com>
3165
3166         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3167
3168         * statement.cs (Foreach.ArrayForeach): New nested class.
3169         (Foreach.TemporaryVariable): New nested class.
3170         (Foreach.EmitArrayForeach): Removed; this is now in the new
3171         ArrayForeach class.
3172
3173 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3174
3175         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3176         more conservative.
3177         (VerifyPendingMethods): Revert change below.
3178
3179         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3180         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3181         that used to trigger warning -28.  Remove warning -28.
3182         * expression.cs (Invocation.OverloadResolve): Use
3183         TypeManager.IsOverride to distinguish override methods.
3184
3185         Fix #74773.
3186         * pending.cs (VerifyPendingMethods): If a base type implements the
3187         requested interface, don't bother checking individual methods of
3188         the base type.  As a side-effect, this prevents the creation of
3189         unnecessary proxies.
3190
3191 2005-05-02  Martin Baulig  <martin@ximian.com>
3192
3193         Fix #70182.
3194
3195         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3196         Also `And' the locals if the old vector is null.
3197         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3198         null; in this case we basically reset all the variables.        
3199
3200 2005-05-02  Martin Baulig  <martin@ximian.com>
3201
3202         Fix #74529.
3203
3204         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3205         Added `FlowBranching branching' argument; always `and' the
3206         variables instead of `or'ing them unless we're an infinite loop.
3207
3208         * statement.cs (While.Resolve): Create a new sibling unless we're
3209         infinite.       
3210
3211 2005-05-02  Martin Baulig  <martin@ximian.com>
3212
3213         Fix #70140.
3214
3215         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3216         arguments; use it instead of creating a new TopLevelBlock.
3217         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3218         our ConstructorInitializer.
3219
3220         * statement.cs
3221         (TopLevelBlock.TopLevelBranching): New public property.
3222         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3223         and create our `TopLevelBranching'.
3224
3225         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3226         anonymous method host, use `block.TopLevelBranching' rather than
3227         creating a new branching.
3228
3229 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3230
3231         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3232         a ScopeInfo, if any of the current children is a child of the new
3233         entry, move those children there.
3234
3235 2005-04-30  Martin Baulig  <martin@ximian.com>
3236
3237         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3238         at the beginning of a SwitchSection.  Fix #73335.
3239
3240 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3241
3242         Fix #74378
3243         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3244         
3245         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3246         (FieldExpr.DoResolve): Obsolete members are ignored for field
3247         initializers.
3248         
3249 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3250
3251         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3252         of arrays detection.
3253
3254         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3255         verification.
3256         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3257
3258         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3259         arrays report.
3260
3261 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3262
3263         * cs-parser.jay: Use the prefered version of -unsafe in error
3264         message.
3265
3266 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
3267
3268         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
3269         circumstances.
3270
3271 2005-04-20  John Luke  <john.luke@gmail.com>
3272
3273         * driver.cs: fix typo in error message, --outout to --output
3274
3275 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
3276
3277         * codegen.cs (InRefOutArgumentResolving): New field.
3278         
3279         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
3280         fields outside contructor.
3281         
3282         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
3283         
3284 2005-04-19  Miguel de Icaza  <miguel@novell.com>
3285
3286         * anonymous.cs (CaptureContext.EmitParameterInstance): The
3287         parameter code was not completed ever, so it was not as up-to-date
3288         as local variables.  Must finish it.
3289
3290         The bug fix was to compare the Toplevel of the block, not the
3291         current block.  Thanks for Ben for pointing this out. 
3292
3293 2005-04-19  Raja R Harinath  <rharinath@novell.com>
3294
3295         * decl.cs (AddMethods): Use the declaring type of the problem
3296         method to determine if we want to squash a warning.
3297
3298 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
3299
3300         * attribute.cs: Removed debug output.
3301
3302         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
3303         
3304         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
3305         Report.Stderr.
3306         
3307 2005-04-18  Raja R Harinath  <rharinath@novell.com>
3308
3309         Fix #74481.
3310         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
3311         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
3312         all null comparisons against reference types.
3313
3314 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
3315
3316         Fix# 74565
3317         * class.cs (TypeContainer.CircularDepException) New nested
3318         exception class.
3319         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
3320         (TypeContainer.DefineType): Removed error, reset InTransit before
3321         exit.
3322         (Class.DefineType): Throw exception when is in Transit.
3323         Catch exception and report error.
3324         (Struct.DefineType): Throw exception when is in Transit.
3325         Catch exception and report error.
3326         (Interface.DefineType): Throw exception when is in Transit.
3327         Catch exception and report error.
3328
3329         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
3330         handle nested exception handlers.
3331
3332         * flowanalysis.cs (InTryWithCatch): New method, search for try with
3333         a catch.
3334
3335         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
3336         InFinally and InCatch storage.
3337
3338         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
3339         (Catch.Resolve): Set and Restore ec.InCatch.
3340         (Try.Resolve): Set and Restore ec.InFinally.
3341         (Try.HasCatch): True when try has catch.
3342
3343 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
3344
3345         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
3346           for the same event member, so exclude such cases from warning 419.
3347           Fixed bug #74633.
3348
3349 2005-04-16  Miguel de Icaza  <miguel@novell.com>
3350
3351         * expression.cs (Binary.ResolveOperator): Apply patch from John
3352         Luke to fix bug 59864: operators &, | and ^ on enumerations
3353         require that the same enum type on both sides.
3354
3355         * driver.cs: Add warnings to old flag usage, this is to assist
3356         people who produce Makefiles and hope that the Makefiles will be
3357         used on Windows.
3358
3359         * class.cs (TypeContainer.EmitType): Moved the definition of the
3360         special $PRIVATE$ field from the resolve phase to the Emit phase.
3361         During resolve we do not know if we are a struct with
3362         HasExplicitLayout, we know this only after the attributes for the
3363         type are emitted.
3364
3365         Set the FieldOffset to zero on the dummy field that we create for
3366         the class.   Fixes 74590.
3367
3368 2005-04-16  Raja R Harinath  <rharinath@novell.com>
3369
3370         Fix #73834.
3371         * ecore.cs (PropertyExpr.resolved): New.
3372         (DoResolve): Use it to handle a case of double resolution here.
3373         Handle a case of identical-name-and-type-name.
3374         * expression.cs (ArrayCreation.CheckIndices): Avoid double
3375         resolution by storing the results of expression resolution back
3376         into the "probes" array.
3377
3378 2005-04-15  Raja R Harinath  <rharinath@novell.com>
3379
3380         Fix cs0208-7.cs and cs0208-8.cs.
3381         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
3382         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
3383         error reporting to point out the reason a struct is not unmanaged.
3384
3385 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3386
3387         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
3388           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
3389
3390 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3391
3392         Fix #74528.
3393         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
3394         IdenticalNameAndTypeName here.
3395         (EventExpr.InstanceResolve): Likewise.
3396
3397 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
3398
3399         C# 2.0 DefaultCharSetAttribute implementation
3400         
3401         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
3402         which allows us to set GlobalNamespace for every resolve.
3403         (Attribute.ResolveArguments): Cut from Resolve.
3404         (Attribute.GetCharSetValue): Returns CharSet named argument.
3405         (Attribute.DefinePInvokeMethod): Gets default charset from
3406         module settings.
3407         (GlobalAttribute.ResolveAsTypeStep): Override.
3408         (GlobalAttribute.ResolveArguments): Override.
3409         
3410         * class.cs (TypeAttr): Is protected.
3411         
3412         * codegen.cs (ModuleClass.DefaultCharSet): New member.
3413         (ModuleClass.DefaultCharSetType): New memeber.
3414         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
3415         
3416         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
3417         charset from module.
3418         
3419         * delegate.cs (TypeAttr): Override.
3420         (Delegate.DefineType): Use this TypeAttr.
3421         
3422         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
3423         at very early stage (before types are defined) to resolve model
3424         module attributes. It will probably not work with corlib but it
3425         should be ok.
3426         
3427         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
3428         charset from module.
3429         
3430         * typemanager.cs (default_charset_type): New type.
3431
3432 2005-04-13  Raja R Harinath  <rharinath@novell.com>
3433
3434         * decl.cs (MemberCache.AddMethods): Don't warn if
3435         System.Object.Finalize has buggy MethodAttributes.
3436
3437         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
3438         removed below.
3439
3440 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3441
3442         * doc.cs : detect ambiguous reference to overloaded members.
3443           Fixed bug #71603. MS 1.1 csc does not detect it.
3444
3445 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
3446
3447         * doc.cs : delegates must not be referenced with parameters.
3448           Fixed bug #71605.
3449
3450 2005-04-12  Miguel de Icaza  <miguel@novell.com>
3451
3452         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
3453
3454 2005-04-10  Miguel de Icaza  <miguel@novell.com>
3455
3456         * driver.cs (MainDriver): Stop processing if the CLS stage found
3457         errors. 
3458
3459         (CompilerCallableEntryPoint.InvokeCompiler): Always
3460         reset after execution;   Take a TextWriter argument for the
3461         output.
3462
3463         * report.cs: Use the error stream instead of hardcoding stderr. 
3464
3465 2005-04-09  Miguel de Icaza  <miguel@novell.com>
3466
3467         * class.cs: Reduce code paths to test, too small of an
3468         optimization to make it worth the extra testing.  Always perform
3469         it. 
3470
3471 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3472
3473         Fix #74510.
3474         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
3475         operators that had errors reported on them.
3476
3477 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
3478
3479         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
3480         argument types.
3481         (Attribute.Resolve): Add named argument type checking.
3482         
3483         * class.cs (FixedField.Define): Use IsPrimitiveType
3484         
3485         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
3486         
3487         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
3488         unsafe parameter types.
3489         
3490         * statement.cs (Using.ResolveExpression): Add better error description.
3491         
3492         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
3493         
3494 2005-04-08  Raja R Harinath  <rharinath@novell.com>
3495
3496         Fix #74484.
3497         * attribute.cs (Attribute.GetAttributeUsage): Resolve
3498         AttributeUsageAttribute in the emitcontext of the attribute class,
3499         not in the emitcontext of the attributable entity it was attached to.
3500         * cs-parser.jay: Use 'current_class', not 'current_container',
3501         when creating a GlobalAttribute.
3502
3503 2005-04-08  Alp Toker  <alp@atoker.com>
3504
3505         * pending.cs: The fix to #58413 failed to compile methods implementing
3506         interfaces with/without params modifiers and vice versa, even though
3507         params modifiers aren't part of the signature. Make the modifier check
3508         less strict as in csc.
3509
3510 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
3511             Anoob V E  <projectmonokochi@rediffmail.com>
3512             Harilal P R  <projectmonokochi@rediffmail.com>
3513
3514         Fix #58413.
3515         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
3516         modifiers of pending methods.
3517         (PendingImplementation.PendingImplementation): Initialize it.
3518         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
3519         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
3520         with ParameterData.  Add check for modifiers.
3521         * class.cs (MethodData.Define): Update to changes.
3522
3523 2005-04-07  Raja R Harinath  <rharinath@novell.com>
3524
3525         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
3526
3527 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
3528
3529         * class.cs (PropertyMethod.Define): Check private accessor in abstract
3530         property.
3531         
3532         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
3533         
3534         * rootcontext.cs,
3535         * typemanager.cs: Registered RequiredAttributeAttribute.
3536         
3537 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
3538
3539         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
3540         Warning CS0169 is back at level 3.
3541         (IMethodData.SetMemberIsUsed): New method.
3542         
3543         * decl.cs (IsUsed): New value; moved from FieldBase.Status
3544         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
3545         
3546         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
3547
3548         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
3549         contants.
3550         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
3551         is used.
3552         
3553         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
3554         is used.
3555         
3556         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
3557         to avoid the problems with nested types.
3558
3559 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
3560             Anoob V.E  <projectmonokochi@rediffmail.com>
3561             Harilal P.R  <projectmonokochi@rediffmail.com>
3562             Raja R Harinath  <rharinath@novell.com>
3563
3564         Fix #73820.
3565         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
3566         attribute.
3567         * typemanager (GetConstructor): Make public.
3568
3569 2005-04-05  John Luke  <john.luke@gmail.com>
3570             Raja R Harinath  <rharinath@novell.com>
3571
3572         Fix #62232.
3573         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
3574         struct too.  Return false quicker in a few cases.
3575         (VerifyUnManaged): Use it.
3576
3577 2005-04-05  Raja R Harinath  <rharinath@novell.com>
3578
3579         Fix #74041.
3580         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
3581         not 'unreachable_seen'.
3582
3583 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
3584
3585         * attribute.cs (Attribute.GetValue): Removed unused.
3586         
3587         * codegen.cs (CodeGen.TrimExt): Removed unused.
3588         
3589         * cs-parser.jay (output): Removed unused.
3590         
3591         * cs-tokenizer.cs (hex_digits): Removed unused.
3592         
3593         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
3594         
3595         * expression.cs (Indirection.LoadExprValue): Removed unused.
3596         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
3597         
3598         * iterators.cs (Iterator.param_types): Removed unused.
3599         
3600         * statement.cs (Goto.block): Removed unused.
3601         (ToplevelBlock.did): Removed unused.
3602         (Switch.ResolveConstantSwitch): Removed unused.
3603
3604 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
3605
3606         * rootcontext.cs: Allow mcs to bootstrap with the compilation
3607         resetting thingy.
3608
3609 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3610
3611         Fix #74232 and cs0208-3.cs.
3612         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
3613         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
3614         unmanaged type.  Don't use FieldBuilders when 't' is a
3615         TypeBuilder.  Use ModFlags and MemberType fields.
3616         * class.cs (MemberBase.member_type): Rename from MemberType.
3617         (MemberBase.MemberType): New property.  Determines member_type on
3618         demand.
3619         (MemberBase.DoDefine): Don't initialize MemberType here.
3620         (FieldMember.Define): Likewise.
3621
3622 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
3623
3624         Fix #74241
3625         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
3626         Attributes are emitted there.
3627         
3628 2005-04-01  Raja R Harinath  <rharinath@novell.com>
3629
3630         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
3631         keyword in 'partial enum' too.
3632         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
3633         is not allowed).
3634         Report from Kamil Skalski <nazgul@omega.pl>.
3635
3636         Fix #74309.
3637         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
3638         have partial containers too.
3639
3640         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
3641         in block' checks to Block.CheckInvariantMeaningInBlock.
3642         * statement.cs (Block.GetKnownVariableInfo): Make private.
3643         (Block.IsVariableUsedInChildBlock): Remove.
3644         (Block.IsVariableUsedInBlock): Likewise.
3645         (Block.CheckInvariantMeaningInBlock): New.  Show location of
3646         conflicting declaration.
3647         (Block.AddVariable): Make error messages less long-winded and more
3648         specific.  Show location of conflicting declaration.
3649         * parameter.cs (Parameters.Location): New readonly property.
3650
3651 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3652
3653         Clean up semantics of invoking ResolveMemberAccess.
3654         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
3655         can have an instance, ensure that we pass in a non-TypeExpression
3656         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
3657         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
3658         argument.  Update to changes and simplify.
3659         (FieldExpr.Emitinstance): Remove CS0120 check.
3660         (PropertyExpr.EmitInstance): Likewise.
3661         * expression.cs (Argument.Resolve): Likewise.
3662         (Invocation.DoResolve): Update to changes in semantics of
3663         InstanceExpression.
3664
3665 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
3666
3667         Fix #74241
3668         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
3669         customization.
3670         
3671         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
3672
3673 2005-03-31  Raja R Harinath  <rharinath@novell.com>
3674
3675         Fix difference in behaviour with commandline invocation.
3676         * driver.cs (Driver.Reset): New.
3677         (CompilerCallableEntryPoint): Call it.
3678
3679         * statement.cs (If.Resolve): Avoid spurious "uninitialized
3680         variable" warnings if the boolean expression failed to resolve.
3681
3682 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
3683
3684         * attribute.cs: Fix the union of several permissions when some of them
3685         are unrestricted (so the result isn't an unrestricted permission set).
3686         Fix #74036.
3687
3688 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3689
3690         * ecore.cs (MemberExpr): New class.  Convert from interface
3691         IMemberExpr.
3692         (MemberExpr.ResolveMemberAccess): Refactor and move here from
3693         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
3694         error checks.
3695         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
3696         (MethodGroupExpr.IsExplicitImpl): Remove.
3697         (Expression.GetFieldFromEvent): Remove.
3698         (SimpleName.MemberStaticCheck): Remove.
3699         (SimpleName.DoSimpleNameResolve): Update to changes.
3700         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
3701         (MemberAccess.IdenticalNameAndTypeName): Remove.
3702         (MemberAccess.error176): Move to MemberExpr.
3703         (MemberAccess.DoResolve): Update to changes.
3704         (BaseAccess.DoResolve): Likewise.
3705
3706 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
3707
3708         C# 2.0 Conditional attribute class implementation
3709         
3710         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
3711         Analyzes class whether it has attribute which has ConditionalAttribute
3712         and its condition is not defined.
3713         
3714         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
3715         (Class.IsExcluded): New method. Search for at least one defined
3716         condition in ConditionalAttribute of attribute class.
3717
3718 2005-03-30  Raja R Harinath  <rharinath@novell.com>
3719
3720         * ecore.cs (PropertyExpr): Derive from Expression, not
3721         ExpressionStatement.
3722         (PropertyExpr.EmitStatement): Remove.
3723
3724 2005-03-29  Raja R Harinath  <rharinath@novell.com>
3725
3726         Fix #74060.
3727         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
3728         internal field "value__" of an enum be private.  The examples for
3729         "value__" that I found on MSDN all used FieldAttributes.Private.
3730
3731         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
3732         Don't mention IL method attribute names.
3733
3734         Fix #47991.  Remove a TODO.
3735         * statement.cs (Block.Toplevel): Make into a field.
3736         (Block.Parameters): Move into ToplevelBlock.
3737         (Block.known_variables): Rename from child_variable_names.
3738         (Block.Block): Remove variants that take Parameters.  Initialize
3739         'Toplevel' with the immediately surrounding toplevel block.
3740         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
3741         LocalInfo parameter.
3742         (Block.GetKnownVariableInfo): New.
3743         (Block.IsVariableNameUsedInChildBlock): Update.
3744         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
3745         the block, even though it may not be in scope.
3746         (Block.AddVariable): Remove Parameters parameter.  Use
3747         Toplevel.Parameters instead.
3748         (Block.AddConstant): Remove Parameters parameter.
3749         (Block.GetParameterReference): Update to use Toplevel.Parameters.
3750         (Block.IsParamaterReference): Likewise.
3751         (Block.IsLocalParameter): Likewise.  Simplify a lot.
3752         (ToplevelBlock.Parameters): New.  Moved from Block.
3753         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
3754         initialize Parameters to a non-null value.
3755         * cs-parser.jay: Update to changes.
3756         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
3757         simple names that mean different things in the same block.  Use
3758         Block.IsVariableNameUsedInBlock.
3759
3760 2005-03-28  Raja R Harinath  <rharinath@novell.com>
3761
3762         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
3763         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
3764         GetTypeHandle.  It is possible for a reflected type to derive from
3765         a TypeBuilder (e.g., int[] derives from the TypeBuilder
3766         System.Array during mscorlib compilation).
3767         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
3768         contain a method_hash, don't create one either.  Don't create a
3769         deep copy of the base cache's method_hash.
3770         (MemberCache.SetupCache): Rename back from DeepCopy.
3771         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
3772         already initialized.  If we see an override function, add its
3773         underlying base virtual function to the member_hash too.
3774
3775         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
3776
3777 2005-03-26  Raja R Harinath  <harinath@acm.org>
3778
3779         Fix #73038.
3780         * assign.cs (Assign.DoResolve): When the RHS of an assignment
3781         fails to resolve, ensure that the LHS is still resolved as an
3782         lvalue.
3783
3784 2005-03-25  Raja R Harinath  <harinath@acm.org>
3785
3786         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
3787         ec.ContainerType.
3788         (Enum.current_ec): Remove.
3789         (Enum.LookupEnumValue): Remove EmitContext argument.
3790         Just uses the one created during DefineType.
3791         (Enum.FindMembers): Update.
3792         * expression.cs (MemberAccess.DoResolve): Update.
3793
3794 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
3795
3796         * assign.cs (Assign.DoResolve): Check for CS1717 when
3797         source and target are same (uses Equals).
3798
3799         * expression.cs (LocalVariableReference, ParameterReference,
3800         This): Implemented Equals, GetHashCode.
3801
3802         * statement.cs (Block.GetParameterReference): Removed useless
3803         local variable.
3804
3805 2005-03-22  Raja R Harinath  <rharinath@novell.com>
3806
3807         Fix cs0128.cs
3808         * statement.cs (Block.AddVariable): Ensure that we skip implicit
3809         blocks before deciding whether the error is cs0136 or cs0128.
3810
3811         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
3812         (using_alias_directive, using_namespace_directive): Pass
3813         MemberName, not an expression to Namespace.UsingAlias and
3814         Namespace.Using.
3815         (MakeName): Use the MemberName of the namespace.
3816         * namespace.cs (Namespace.MemberName): New.
3817         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
3818         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
3819         Likewise.
3820         * decl.cs (MemberName.Name): Make readonly.
3821         (MemberName.FromDotted): New "constructor".
3822         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
3823         (MemberCore.Name): Compute from MemberName on demand.
3824         (MemberCore.SetMemberName): Provide a way to change the
3825         MemberName.
3826         (MemberCore.AddToContainer): Don't take a fullname parameter.
3827         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
3828         fully qualified name of the container to the member name.
3829         (TypeContainer.AddToTypeContainer): Use a fully qualified name
3830         only if the type is a member of the root container.
3831         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
3832         MemberName.Left rather than searching for an embedded ".".
3833         (PartialContainer.CreatePart): Update to changes in RootContext.
3834         (MemberBase.ShortName): Turn into a property.  Use
3835         MemberCore.SetMemberName.
3836         (MemberBase.ExplicitInterfaceName): Remove.
3837         (MemberBase.UpdateMemberName): Remove.
3838         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
3839         (PropertyBase.SetMemberName): New override.
3840         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
3841         (Tree.GetDecl): New.
3842         (Tree.AllDecls): Rename from Decls.
3843         * attribute.cs, enum.cs, report.cs: Update to changes.
3844         * driver.cs (MainDriver): Use MemberName.FromDotted on
3845         RootContext.MainClass.
3846
3847 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
3848
3849         * class.cs (FixedField.Define): Check for CS1664 and more sanity
3850         checks.
3851
3852         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
3853
3854 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
3855
3856         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
3857         property accessor modifiers.
3858
3859         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
3860         fixed buffer attribute (CS1716).
3861         (PropertyMethod.HasCustomAccessModifier): When property accessor
3862         has custom modifier.
3863
3864         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
3865         modifiers.
3866         (PropertyExpr.DoResolveLValue): Add CS0272.
3867
3868 2005-03-17  Miguel de Icaza  <miguel@novell.com>
3869
3870         * convert.cs: When converting to a pointer, use the proper Conv.U
3871         or Conv.I depending on the source data type.
3872
3873         * cs-tokenizer.cs: Make the size for large decimal constants,
3874         fixes #72957.
3875
3876 2005-03-17  Martin Baulig  <martin@ximian.com>
3877
3878         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
3879         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
3880
3881 2005-03-17  Martin Baulig  <martin@ximian.com>
3882
3883         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
3884         to bool so we can return an error condition.
3885         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
3886         returned an error.
3887
3888 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
3889
3890         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
3891         attributes.
3892
3893 2005-03-16  Raja R Harinath  <rharinath@novell.com>
3894
3895         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
3896         Refactor to avoid traversing the list of assemblies, and to avoid
3897         string concatenation.
3898         * typemanager.cs (guid_attr_type): Remove.
3899         (negative_hits, pointers, references): Remove hashes.
3900         (type_hash): New.
3901         (GetConstructedType): New.  Uses type_hash to handle constructed
3902         types (arrays, references, pointers).
3903         (GetReferenceType, GetPointerType): Use it.
3904         (GetNestedType): New.  Uses type_hash to handle nested types of
3905         reflected types.
3906         (LookupType, LookupTypeDirect): Remove.
3907         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
3908         'types' hash and LookupTypeReflection directly.
3909         (params_string, params_object): Use GetConstructedType.
3910         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
3911         top-level types.
3912         (Namespace.Lookup): Use cached_types.
3913         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
3914         provided by old TypeManager.LookupType.
3915         * rootcontext.cs (MakeFQN): Remove.
3916         * decl.cs (DeclSpace.MakeFQN): Likewise.
3917         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
3918         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
3919         TypeManager.GetConstructedType.
3920         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
3921
3922 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
3923
3924         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
3925         indexers.
3926
3927         * cs-parser.jay: Reports CS1527 for any namespace element.
3928
3929         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
3930         Added CS0407.
3931
3932         * expression.cs (ParameterReference.IsAssigned): Changed error to
3933         CS0269.
3934         (Error_WrongNumArguments): Moved CS0245 detection here.
3935
3936         * statement.cs (Return.Resolve): Add CS1622 report.
3937
3938 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
3939
3940         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
3941
3942 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
3943
3944         * attribute.cs expression.cs: Get rid of some allocations.
3945
3946 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
3947
3948         * doc.cs : just eliminate the latest change.
3949
3950 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3951
3952         * doc.cs : commented out the latest change. It breaks xml-030.cs
3953
3954 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3955
3956         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
3957           fail. So invoke CreateType() in FindDocumentedType().
3958
3959 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
3960
3961         * cs-tokenizer.cs : added IsKeyword().
3962         * doc.cs : Detect keyword incorrectly used as identifier.
3963           Allow identifiers prefixed by @.
3964
3965 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
3966
3967         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
3968         It caused exception in namespace resolving (again!).
3969         
3970         * class.cs (Class.ctor): Removed exit.
3971         (PropertyMethod.ctor): ditto.
3972         
3973         * codegen.cs (Codegen.Reset): Reset static data.
3974         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
3975         
3976         * cs-tokenizer.cs (Cleanup): Removed.
3977         
3978         * driver.cs (GetSystemDir): Rewrote to one line command.
3979         It caused problem with unloaded dynamic modules.
3980         (UnixParseOption): Removed Exit.
3981         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
3982         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
3983         Now can be mcs used as library.
3984         
3985         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
3986         empty location.
3987         
3988         * location.cs (Reset): Reset static data.
3989         
3990         * namespace.cs (Reset): Reset static data.
3991         
3992         * report.cs (Report.Reset): Reset static data.
3993         
3994         * rootcontext.cs (RootContext.Reset): Reset static data.
3995         
3996         * tree.cs (RootTypes.ctor): Use Location.Null
3997         
3998         * typemanager.cs (TypeManager.Reset): Reset static data.
3999         (CoreLookupType): Removed Exit.
4000         (TypeHandle.Reset): Reset static data.
4001         
4002 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4003
4004         Fix #73516.
4005         * typemanager.cs (ComputeNamespaces): Import namespaces from
4006         referenced modules too.
4007
4008 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4009
4010         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4011         than '.'.
4012
4013 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4014
4015         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4016         enclosing DeclSpace.  This ensures that a name-lookup populates
4017         more caches and there are fewer 'TypeExpression's.  Carve out
4018         nested type lookup into ...
4019         (LookupNestedTypeInHierarchy): ... this.
4020
4021 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4022
4023         Clean up a few partial-class semantics.  
4024         Fixes test-357.cs and cs1618-2.cs.
4025         * cs-parser.jay (struct_declaration): Use 'current_class' as
4026         parent of newly-created struct.  Remove call to Register ().
4027         Use 'pop_current_class' to complete handing the current struct.
4028         (interface_declaration): Likewise.
4029         (class_declaration): Likewise.
4030         (enum_declaration): Use 'current_class' as parent of newly created
4031         enum.
4032         (delegate_declaration): Likewise.
4033         (pop_current_class): New function.  This is used to handle closing
4034         up the 'current_class' and 'current_container', and pointing them
4035         to the enclosing class/container.
4036         (CSharpParser): Initialize 'current_class' too.
4037         * decl.cs (MemberCore): Add check for invariant: a partial
4038         container is not a parsed entity, and thus does not enclose any
4039         parsed members.
4040         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4041         (DeclSpace.BaseTypeExpr): Use it.
4042         (DeclSpace.LookupType): Add check for invariant.
4043         * class.cs (TypeContainer): Add check for invariant: a nested
4044         class should have the same NamespaceEntry as its enclosing class.
4045         (TypeContainer.EmitFieldInitializers): Make virtual.
4046         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4047         MemberCore.
4048         (TypeContainer.Register): Remove.
4049         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4050         null.  Use TypeResolveEmitContext for resolving base types and
4051         interfaces.  Move initialization of Parts.TypeBuilder here from
4052         ...
4053         (TypeContainer.DefineNestedTypes): ... here.
4054         (PartialContainer): Take a Namespace not a NamespaceEntry.
4055         (PartialContainer.Create): Don't use Register.  Call the
4056         appropriate Add... function directly.
4057         (ClassPart): Take both the PartialContainer and the enclosing
4058         class as constructor arguments.
4059         (ClassPart.EmitFieldInitializers): Override.
4060         (ClassPart.PartFindNestedTypes): Remove.
4061         (FieldBase.GetInitializerExpression): Resolve the initializer
4062         expression in the emit context of the enclosing class.
4063         * tree.cs (RootTypes): Remove Register ().
4064         
4065 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4066
4067         * cs-parser.jay: Removed CS0134.
4068         
4069         * driver.cs: Removed CS1901.
4070         
4071         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4072         for predefined types.
4073
4074 2005-03-07  Duncan Mak  <duncan@novell.com>
4075
4076         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4077         well. Fixes bug #73454.
4078
4079 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4080
4081         * cs-tokenizer.cs (xtoken): Add CS1035.
4082         
4083         * class.cs (MethodData.Define): Add CS0683.
4084         (FieldMember.ctor): Add CS0681.
4085
4086 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4087
4088         * ecore.cs (SimpleName.DoResolve): Rename from
4089         SimpleName.DoResolveAllowStatic.
4090         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4091         Pass 'intermediate' flag to MemberStaticCheck.
4092         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4093         of "intermediate" lookups via MemberAccess.
4094         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4095         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4096
4097 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4098
4099         Fix #73394.
4100         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4101         slipped in because of variable names that are identical to a
4102         builtin type's BCL equivalent ('string String;', 'int Int32;').
4103         (PropertyExpr.EmitInstance): Likewise.
4104
4105 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4106
4107         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4108         
4109         * report.cs (warning_ignore_table): Made public.
4110
4111 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4112
4113         Fix #73282.
4114         * class.cs (MethodData.Emit): Pass 'container' to
4115         container.GetObsoleteAttribute instead of 'container.Parent'.
4116
4117 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4118
4119         * cs-parser.jay: Add 1534 error test.
4120
4121         * iterators.cs (Yield.CheckContext): Add error 1629.
4122         (Iterator.ctor): Save unsafe modifier.
4123         (MoveNextMethod.DoEmit): Restore unsafe context.
4124
4125         * namespace.cs (UsingAlias): Better error message.
4126
4127 2005-03-03  Dan Winship  <danw@novell.com>
4128
4129         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4130         the warning message [#73219]
4131
4132 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4133
4134         Fix compile with MCS 1.0.0.0.
4135         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4136         w_restore to not depend on string constant folding.
4137
4138 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4139
4140         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4141         CS0246 check to users who passed 'silent = false'.
4142         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4143         check.
4144         (SimpleName.SimpleNameResolve): Update.
4145         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4146         (MemberAccess.IdenticalNameAndTypeName): Update.
4147         * doc.cs (FindDocumentedTypeNonArray): Update.
4148
4149 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4150
4151         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4152         * parameters.cs (ComputeAndDefineParameters): Remove.
4153         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4154         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4155         Use GetParameterInfo.
4156
4157 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4158
4159         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4160
4161 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4162
4163         Unify DeclSpace.LookupType and DeclSpace.FindType.
4164         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4165         is in charge of defining nested types on demand.
4166         (DeclSpace.LookupType): Use it when the current_type is a
4167         TypeBuilder.  Use LookupTypeDirect for reflected types.
4168         (DeclSpace.FindType): Remove.
4169         (DeclSpace.LookupInterfaceOrClass): Likewise.
4170         (DeclSpace.DefineTypeAndParents): Likewise.
4171         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4172         DeclSpace.LookupType.
4173         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4174         * typemanager.cs (LookupType): Simplify.
4175         (AddUserType): Remove type from negative_hits.
4176         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4177         * class.cs (TypeContainer.FindMembers): Move handling of nested
4178         types ...
4179         (TypeContainer.FindMembers_NestedTypes): ... here.
4180         (TypeContainer.FindNestedType): Implement override.
4181         (ClassPart.FindNestedType): Delegate to PartialContainer.
4182         (ClassPart.PartFindNestedType): Looks up the nested types of the
4183         part alone.
4184
4185 2005-03-02  Martin Baulig  <martin@ximian.com>
4186
4187         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4188         static constructor in static classes.
4189
4190 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4191
4192         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4193         sizeParamIndex is not specified.
4194
4195 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4196
4197         Fix #73117
4198         * report.cs (WarningMessage.IsEnabled): Missing null check.
4199
4200 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4201
4202         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4203         in the fields and not in the properties.
4204
4205 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4206
4207         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4208         fields as well.
4209
4210 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4211
4212         * attribute.cs: Small refactoring (improved robustness).
4213         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4214         (ValidateGuid): Removed.
4215         (Resolve): Removed referenced to above mentioned.
4216         (GetAttributeUsage): Made private and changed to work without
4217         class assistance.
4218         (GetIndexerAttributeValue): Don't crash.
4219         (GetConditionalAttributeValue): Ditto.
4220         (GetClsCompliantAttributeValue): Ditto.
4221         (ExtractSecurityPermissionSet): All attributes exceptions are
4222         error 648.
4223         (GetPropertyValue): New helper.
4224         (GetMethodImplOptions): New method.
4225         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4226         some missing properties.
4227         
4228         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4229         (Method.ApplyAttributeBuilder): Updated.
4230         
4231         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4232         exception.
4233
4234 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4235
4236         Fix #73052.
4237         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4238         non-simple types (array, pointer, reference).
4239
4240 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4241
4242         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4243
4244         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4245         for operators.
4246         (Method.CheckBase): Catch wrong destructor here.
4247         (MethodData.Define): Add errors 550, 668.
4248
4249         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4250
4251         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4252
4253         * pending.cs (VerifyPendingMethods): Add error 551.
4254
4255         * typemanager.cs (CSharpName): Next error report helper.
4256
4257 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4258
4259         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4260         attributes. Removed useless attribute double check.
4261         It saves almost 2MBs for corlib.
4262
4263 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4264
4265         Fix #72924.
4266         * statement.cs (ExpressionStatement.Resolve): Make robust to being
4267         called twice in case of error.
4268
4269 2005-02-23  Chris Toshok  <toshok@ximian.com>
4270
4271         Fix compiler portions of #72827.
4272         * statement.cs (Block.Emit): call Begin/EndScope on the
4273         EmitContext instead of the ILGenerator.
4274
4275         * codegen.cs (EmitContext.BeginScope): new method, call
4276         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
4277         we have one.)
4278         (EmitContext.BeginScope): same, but EndScope and CloseScope
4279
4280         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
4281         offset and call the superclass's OpenScope(int) with it.
4282         (SymbolWriter.CloseScope): get the current il
4283         offset and call superclass's CloseScope(int) with it.
4284
4285 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
4286
4287         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
4288         CS1677 for out and ref as well.
4289
4290         * class.cs (Method.Define): Add error CS1599 detection.
4291         
4292         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
4293         
4294         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
4295         
4296         * delegate.cs (Delegate.Define): Add error CS1599 detection.
4297         
4298         * support.cs.cs (ModifierDesc): New helper method.
4299
4300 2005-02-23  Raja R Harinath  <rharinath@novell.com>
4301             Abin Thomas  <projectmonokochi@rediffmail.com>
4302             Anoob V E  <projectmonokochi@rediffmail.com>
4303             Harilal P R  <projectmonokochi@rediffmail.com>
4304
4305         Fix #57851, #72718.
4306         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
4307         MemberLookup (used for error reporting) actually returns a result.
4308         Fix error report number (122, not 112).
4309
4310 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
4311             Anoob V E  <projectmonokochi@rediffmail.com>
4312             Harilal P R  <projectmonokochi@rediffmail.com>
4313
4314         Fix #71134.
4315         * pending.cs (PendingImplementation.GetAbstractMethods):
4316         Find NonPublic members too.
4317
4318 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
4319
4320         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
4321         Fixed error 217.
4322         
4323         * class.cs (MethodCore.CheckMethodAgainstBase):
4324         Add error 239 report.
4325
4326 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4327
4328         Fix #68955.
4329         * expression.cs (Invocation.IsApplicable): Make public.
4330         (Invocation.IsParamsMethodApplicable): Likewise.
4331         * delegate.cs (Delegate.VerifyApplicability): Don't use
4332         Invocation.VerifyArgumentCompat for parameter applicability
4333         testing.  Use Invocation.IsApplicable and
4334         Invocation.IsParamsMethodApplicable.
4335
4336 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4337
4338         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
4339         
4340         * class.cs (Operator.Define): Add error 217 report.
4341         
4342 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4343
4344         * namespace.cs (UsingEntry.Resolve): Undo change below.
4345
4346 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4347
4348         Fix #72756.
4349         * ecore.cs (Expression.MemberLookupFailed): Add argument to
4350         disable the error message when the extended MemberLookup also
4351         fails.
4352         (Expression.MemberLookupFinal): Update.
4353         (SimpleName.DoSimpleNameResolve): Update.
4354         * expression.cs (MemberAccess.ResolveNamespaceOrType):
4355         Don't use MemberLookupFinal.
4356         (New.DoResolve): Update.
4357         (BaseAccess.CommonResolve): Update.
4358
4359 2005-02-21  Raja R Harinath  <rharinath@novell.com>
4360
4361         Fix #72732.
4362         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
4363         occured previously, don't resolve again.
4364
4365 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
4366
4367         Fix #69949
4368         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
4369         argument. Call ResolveAttributeUsage for unresolved.
4370         when types doesn't match ctor arguments.
4371         
4372         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
4373         for nested attribute classes.
4374         (Class.attribute_usage): Removed.
4375         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
4376         for attribute class.
4377         
4378         * ecore.cs (IsAttribute): Removed.
4379         
4380         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
4381         
4382         * rootcontext.cs (RegisterAttribute): Removed, attributes are
4383         now normal types.
4384         (attribute_types): Removed.
4385         (EmitCode): Global attributes are emited as the latest.
4386
4387 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
4388
4389         * class.cs (EmitFieldInitializers): Don't emit field initializer
4390         for default values when optimilization is on.
4391         
4392         * constant.cs (Constant.IsDefaultValue): New property.
4393         
4394         * driver.cs: Add /optimize handling.
4395         
4396         * constant.cs,
4397         * ecore.cs,
4398         * literal.cs: Implement new IsDefaultValue property.
4399         
4400         * rootcontext.cs (Optimize): New field, holds /optimize option.
4401
4402 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4403
4404         Fix crasher in re-opened #72347.
4405         * namespace.cs (Namespace.Lookup): Return null if
4406         DeclSpace.DefineType returns null.
4407
4408         Fix #72678.
4409         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
4410
4411 2005-02-18  Raja R Harinath  <rharinath@novell.com>
4412
4413         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
4414         now returns null if it cannot resolve to an lvalue.
4415         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
4416         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
4417         returned null.  Remove check for SimpleName.
4418         (EventExpr.DoResolveLValue): New.
4419         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
4420         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
4421         error from ...
4422         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
4423         avoid CS0131 error.
4424         (Unary.ResolveOperator): Move CS0211 check ...
4425         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
4426         CS0131 error.
4427         (Unary.DoResolveLValue): Simplify.
4428         (AddressOf.DoResolveLValue): New.
4429         (ArrayAccess.DoResolveLValue): New.
4430
4431 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
4432
4433         * attribute.cs (Attribute.Resolve): Add arguments casting for
4434         when types doesn't match ctor arguments.
4435
4436 2005-02-16  Raja R Harinath  <rharinath@novell.com>
4437
4438         Fix parts of #63202.
4439         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
4440         lookup of operator in base type.  Ensure that all checks happen
4441         when the operator resolves to an "op_..." method.
4442
4443 2005-02-15  Raja R Harinath  <rharinath@novell.com>
4444
4445         Fix #71992.
4446         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
4447         'ignore_cs0104' parameter.  Pass it to ...
4448         (NamespaceEntry.Lookup): ... this.
4449         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
4450         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
4451         (TypeLookupExpression.DoResolveAsTypeStep): Update.
4452         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
4453         Update.  Request that cs0104 errors be ignored.
4454         (ComposedCast.ResolveAsTypeStep): Update.
4455
4456 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4457
4458         Fix #59209.
4459         * expression.cs (Invocation.BetterFunction): Remove support for
4460         comparing virtual functions and their overrides.
4461         (Invocation.IsOverride): New.
4462         (Invocation.OverloadResolve): Don't consider 'override' functions
4463         during candidate selection.  Store them in a lookaside list.
4464         If the selected method is a 'virtual' function, use the list to
4465         find any overrides that are closer to the LHS type.
4466
4467 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
4468
4469         * expression.cs (New.DoResolve): Add complex core type reduction.
4470         (New.Constantify): Converts complex core type syntax like 'new int ()'
4471         to simple constant.
4472         
4473 2005-02-14  Raja R Harinath  <rharinath@novell.com>
4474
4475         * decl.cs (EntryType.EntryType): New constructor to create an
4476         updated copy of a cache entry.
4477         (MemberCache.AddMethods): Use it.
4478         (MemberCache.ClearDeclaredOnly): Remove.
4479         (MemberCache.MemberCache): Update.
4480
4481 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4482
4483         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
4484         variable.  This one is represents the actual low-level declaration
4485         of the method, as opposed to the semantic level `IsStatic'.   
4486
4487         An anonymous method which is hosted into a static method might be
4488         actually an instance method.  IsStatic would reflect the
4489         container, while MethodIsStatic represents the actual code
4490         generated.
4491
4492         * expression.cs (ParameterReference): Use the new MethodIsStatic
4493         instead of IsStatic.
4494
4495         * anonymous.cs (AnonymousMethod.Compatible): Pass the
4496         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
4497         set on the current EmitContext. 
4498
4499         * expression.cs (Cast): Overload DoResolveLValue so we can pass
4500         resolve our casted expression as an LValue.  This triggers the
4501         proper LValue processing that is later required by Assign.
4502
4503         This fixes 72347.
4504
4505         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
4506
4507 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
4508
4509         C# 2.0 Fixed buffer implementation
4510
4511         * anonymous.cs: Update after RegisterHelperClass renaming.
4512
4513         * attribute.cs (AttributeTester.fixed_buffer_cache):
4514         Cache of external fixed buffers.
4515         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
4516         implementation if field is fixed buffer else null.
4517
4518         * class.cs
4519         (TypeContainer.AddField): Accept FieldMember instead of Field.
4520         (FieldBase.IsFieldClsCompliant): Extracted code from
4521         VerifyClsCompliance descendant customization.
4522         (FixedField): New class handles fixed buffer fields.
4523         (FixedFieldExternal): Keeps information about imported fixed
4524         buffer.
4525         (IFixedField): Make access to internal or external fixed buffer
4526         same.
4527
4528         * cs-parser.jay: Add fixed buffer parsing.
4529
4530         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
4531         buffer.
4532
4533         * expression.cs (Indirection): Extended implementation to accept
4534         fixed buffer field.
4535         (PointerArithmetic.Emit): Get element from fixed buffer as well.
4536         (ElementAccess.MakePointerAccess): Get type as parameter.
4537         (DoResolve): Add fixed buffer field expression conversion.
4538         (DoResolveLValue): Ditto.
4539         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
4540         (ArrayPtr): Derives from FixedBufferPtr.
4541         (ArrayPtr.Emit): Add extra emit for array elements.
4542
4543         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
4544
4545         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
4546         for compiler generated types.
4547         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
4548
4549         * statement.cs (Fixed): Refactored to be easier add fixed buffer
4550         and consume less memory.
4551         (Fixed.Resolve): Add fixed buffer case.
4552
4553         * typemanager.cs (compiler_generated_attr_ctor,
4554         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
4555         (HasElementType): Add our own implementation to work on every
4556         runtime.
4557
4558 2005-02-11  Miguel de Icaza  <miguel@novell.com>
4559
4560         * anonymous.cs (CaptureContext): Track whether `this' has been
4561         referenced.   
4562
4563         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
4564         only captured `this' if it was implicitly done (instance
4565         methods/variables were used). 
4566
4567         * codegen.cs (EmitContext.CaptureThis): New method to flag that
4568         `this' must be captured.
4569
4570 2005-01-30  Miguel de Icaza  <miguel@novell.com>
4571  
4572         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
4573         is null it means that there has been no need to capture anything,
4574         so we just create a sibling.
4575
4576         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
4577
4578         Just a partial fix.  The other half is fairly elusive.
4579         
4580 2005-02-10  Raja R Harinath  <rharinath@novell.com>
4581
4582         Fix #52586, cs0121-4.cs.
4583         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
4584         and return a hashtable.
4585         (MemberCache.ClearDeclaredOnly): New.
4586         (MemberCache.MemberCache): Update to change.  Make a deep copy of
4587         the method_hash of a base type too.
4588         (MemberCache.AddMethods): Adapt to having a deep copy of the base
4589         type methods.  Overwrite entries with the same MethodHandle so
4590         that the ReflectedType is correct.  The process leaves in base
4591         virtual functions and their overrides as distinct entries.
4592         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
4593         matters since it was boxed in a ArrayList before.
4594         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
4595         modifier.
4596         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
4597         case of a virtual function and its override (choose the overload
4598         as better).
4599         (Invocation.OverloadResolve): Avoid 'override' members during
4600         'applicable_type' calculation.
4601
4602 2005-02-09  Raja R Harinath  <rharinath@novell.com>
4603
4604         Combine two near-redundant caches.
4605         * typemanager.cs (method_params): Rename from method_internal_params.
4606         (TypeManager.GetParameterData): New.  Replace
4607         Invocation.GetParameterData.
4608         (TypeManager.LookupParametersByBuilder): Remove.
4609         * expression.cs (Invocation.method_parameter_cache): Remove.
4610         (Invocation.GetParameterData): Remove.
4611         Update to changes.
4612         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
4613         Update to changes.
4614
4615 2005-02-08  Raja R Harinath  <rharinath@novell.com>
4616
4617         Fix #72015.
4618         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
4619         TypeManager.multicast_delegate_type is null, resolve it by looking
4620         up "System.MulticastDelegate".
4621         * rootcontext.cs (RootContext.ResolveCore): Simplify.
4622
4623 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
4624             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
4625             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
4626
4627         Fix cs0164.cs.
4628         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
4629         (LabeledStatement.AddReference): New.  Set 'referenced'.
4630         (Goto.Resolve): Use it.
4631
4632 2005-02-05  John Luke  <john.luke@gmail.com>
4633
4634         * driver.cs: remove duplicate -doc line in Usage ()
4635
4636 2005-02-04  Raja R Harinath  <rharinath@novell.com>
4637
4638         * location.cs (Location.AddFile): Fix CS2002 error report.
4639
4640 2005-02-02  Martin Baulig  <martin@ximian.com>
4641
4642         * delegate.cs (Delegate.DefineType): Report an internal error if
4643         TypeManager.multicast_delegate_type is null.  See bug #72015 for
4644         details.        
4645
4646 2005-02-02  Raja R Harinath  <rharinath@novell.com>
4647
4648         Fix a crasher in a variant of #31984.
4649         * const.cs (Constant.CheckBase): New override that defers the
4650         new-or-override check in case the base type hasn't been populated
4651         yet.
4652         (Constant.Define): Ensure the new-or-override check is performed.
4653
4654 2005-02-01  Duncan Mak  <duncan@ximian.com>
4655
4656         * const.cs (LookupConstantValue): Check that `ce' is not null
4657         before calling GetValue ().
4658
4659 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4660
4661         Fix test-334.cs (#69519).
4662         * cs-parser.jay (using_alias_directive): Pass in an expression to
4663         NamespaceEntry.UsingAlias.
4664         (using_namespace_directive): Pass in an expression to
4665         NamespaceEntry.Using.
4666         (namespace_name): Don't flatten to a string.
4667         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
4668         (NamespaceEntry.AliasEntry.Resolve): Lookup using
4669         ResolveAsTypeStep.
4670         (NamespaceEntry.UsingEntry): Likewise.
4671         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
4672         changes.
4673         (NamespaceEntry.LookupForUsing): Remove.
4674         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
4675         names.
4676         (NamespaceEntry.Lookup): Remove support for dotted names.
4677
4678 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4679
4680         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
4681         split into two.
4682         (NamespaceEntry.ImplicitParent): Compute on demand.
4683         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
4684         parallels the current.
4685         (NamespaceEntry.LookupForUsing): Use it.
4686         (NamespaceEntry.Lookup): If the current namespace-entry is
4687         implicit, don't search aliases and using tables.
4688
4689 2005-02-01  Raja R Harinath  <rharinath@novell.com>
4690
4691         Fix #31984.
4692         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
4693         BaseCache here.
4694         (TypeContainer.BaseCache): Compute on demand.
4695         (TypeContainer.FindMembers): Define constants and types if they're
4696         not already created.
4697         (FieldMember.Define): Move resetting of ec.InUnsafe before error
4698         check.
4699         * const.cs (Constant.Define): Make idempotent.
4700
4701 2005-01-29  Miguel de Icaza  <miguel@novell.com>
4702
4703         * pending.cs: Produce better code (no nops produced by using Ldarg
4704         + value).
4705         
4706         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
4707         i - 1' it should be arg + 1.
4708
4709         Fixes bug #71819.
4710
4711 2005-01-28  Raja R Harinath  <rharinath@novell.com>
4712
4713         * attribute.cs (Attribute.CheckAttributeType): Make private
4714         non-virtual.
4715         (Attribute.ResolveType): Make virtual.
4716         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
4717         handling of RootContext.Tree.Types.
4718
4719 2005-01-27  Raja R Harinath  <rharinath@novell.com>
4720
4721         Update attribute-handling to use the SimpleName/MemberAccess
4722         mechanisms.
4723         * cs-parser.jay (attribute): Pass in an expression to the
4724         constructors of Attribute and GlobalAttribute.
4725         * attribute.cs (Attribute): Take an expression for the name.
4726         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
4727         passed in attribute name expression.
4728         (Attribute.CheckAttributeType): Use it.
4729         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
4730         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
4731         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
4732         argument to prevent error messages if the lookup fails.
4733
4734 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
4735
4736         * expression.cs (Indirection): Implemented IVariable interface
4737         to support indirection in AddressOf operator.
4738         (PointerArithmetic.Emit): Add optimalization for case where
4739         result can be precomputed.
4740
4741 2005-01-26  Martin Baulig  <martin@ximian.com>
4742
4743         * class.cs (TypeContainer.AttributeTargets): Return the correct
4744         AttributeTargets depending on our `Kind' instead of throwing an
4745         exception; fixes #71632.
4746
4747 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
4748
4749         Fix #71257
4750         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
4751         constant members.
4752
4753 2005-01-25  Raja R Harinath  <rharinath@novell.com>
4754
4755         Fix #71602.
4756         * expression.cs (MemberAccess.DoResolve): Don't complain with
4757         cs0572 when the LHS of a member access has identical name and type
4758         name.
4759
4760 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
4761
4762         Fix #71651, #71675
4763         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
4764         CreatePermission.
4765         Create custom PermissionSet only for PermissionSetAttribute.
4766
4767 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
4768
4769         Fix #71649
4770         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
4771         delegates in static class.
4772
4773 2005-01-24  Martin Baulig  <martin@ximian.com>
4774
4775         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4776         merging an implicit block, just use its reachability.
4777
4778         * statement.cs (Block.Resolve): Make the unreachable code check
4779         work wrt. implicit blocks; see test-337 from #63842.
4780
4781 2005-01-21  Alp Toker  <alp@atoker.com>
4782  
4783         * cs-parser.jay: destructor_declaration's container is PartialContainer
4784         not Class when partial types are used, so use Kind prop instead of
4785         'is'.
4786         
4787 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
4788
4789         * cs-parser.jay: Improve error reporting when an interface
4790         declares new types.
4791
4792 2005-01-20  Dick Porter  <dick@ximian.com>
4793
4794         * support.cs: SeekableStreamReader fix from Sandor Dobos
4795         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
4796         chars are read.  Fixes bug 70369.
4797
4798 2005-01-20  Raja R Harinath  <rharinath@novell.com>
4799
4800         * cs-parser.jay (catch_clause): Simplify current_block handling
4801         somewhat.
4802
4803 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
4804
4805         * convert.cs (ImplicitStandardConversionExists): Synchronize the
4806         code with ImplicitStandardConversion to handle the implicit
4807         conversion of method groups into valid delegate invocations. 
4808
4809         The problem is that in parameter handling we were using this code
4810         path.  Fixes bug #64698
4811
4812 2005-01-19  Raja R Harinath  <rharinath@novell.com>
4813
4814         * cs-parser.jay: Fix several infelicities.
4815         - Avoid assigning to the parser value stack.  Code like 
4816           '$3 = null' is unclean.  Synthesize a value for the code block
4817           instead. 
4818         - Avoid using oob_stack for storing location information.  Use ...
4819         (_mark_): ... this.  New (empty) rule.  Saves the current location
4820         in $$.
4821         (foreach_statement): Avoid using oob_stack for current_block
4822         handling.  Use technique used in for_statement and
4823         using_statement.  Synthesize a value for the code block to store
4824         additional intermediate information.
4825
4826 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
4827
4828         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
4829         of a different type is only allowed to private fields of a
4830         containing type, not on fields of a base class.
4831
4832         See test-174.cs and error cs0122-9.cs
4833
4834 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4835
4836         Fix test-335.cs (bug #58126).
4837         * cs-parser.jay (argument): Split out non-expression parts of the
4838         rule into 'non_simple_argument'.
4839         (invocation_expression): Support parenthesized invocations with
4840         multiple arguments, and with single non-simple arguments.
4841
4842 2005-01-13  Raja R Harinath  <rharinath@novell.com>
4843
4844         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
4845         places.
4846
4847 2005-01-12  Raja R Harinath  <rharinath@novell.com>
4848
4849         Fix cs0038-1.cs, cs1640-6.cs.
4850         * ecore.cs (Expression.Resolve): Remove special-case for
4851         SimpleName in error-handling.
4852         (Expression.almostMatchedMembers): Relax access permission to
4853         protected.
4854         (Expression.MemberLookupFailed): Handle duplicates in
4855         almostMatchedMembers list.
4856         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
4857         * expression.cs (New.DoResolve): Report CS1540 for more cases.
4858         * typemanager.cs (GetFullNameSignature): Use the MethodBase
4859         overload if the passed in MemberInfo is a MethodBase.
4860
4861 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
4862
4863         Fix #70749
4864         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
4865         for non-CAS & merge permission sets properly.
4866
4867 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4868
4869         Improve standard-compliance of simple name and member access 
4870         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
4871         * ecore.cs (FullNamedExpression): New abstract base class 
4872         for Namespaces and TypeExpressions.
4873         (ResolveFlags.SimpleName): Remove.
4874         (SimpleName): Remove support for dotted names.
4875         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
4876         DeclSpace.FindType and DeclSpace.LookupType.
4877         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
4878         (Expression.ExprClassName): Make member function.
4879         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
4880         a namespace.  Remove creation of dotted "SimpleName"s.
4881         (MemberAccess.DoResolve): Likewise.
4882         * decl.cs (DeclSpace.Cache): Make private.
4883         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
4884         (DeclSpace.FindType): Update.
4885         (DeclSpace.LookupType): Move here from RootContext.  Return a 
4886         FullNamedExpression.
4887         * namespace.cs (Namespace): Derive from FullNamedExpression
4888         so that it can be part of expression resolution.
4889         (Namespace.Lookup): Return an FullNamedExpression.
4890         (NamespaceEntry.LookupAlias): Lookup aliases only in current
4891         namespace.
4892         * rootcontext.cs (NamespaceLookup): Remove.
4893         (LookupType): Move to DeclSpace.
4894         * attribute.cs (CheckAttributeType): Update.
4895         * doc.cs (FindDocumentedType): Remove allowAlias argument.
4896         (FindDocumentedTypeNonArray): Likewise.
4897
4898 2005-01-11  Raja R Harinath  <rharinath@novell.com>
4899
4900         Fix cs0509.cs, cs1632.cs.
4901         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
4902         is the same as IsInterface.
4903         (TypeContainer.GetClassBases): Likewise.
4904         * statement.cs (LabeledStatement.ig): New field.
4905         (LabeledStatement.LabelTarget): Save ILGenerator which created the
4906         label.
4907         (LabeledStatement.DoEmit): Check that the label was created with
4908         the same ILGenerator.
4909
4910 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4911
4912         Fix #71058
4913         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
4914         accessors to its properties.
4915
4916         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
4917         from accessors to property.
4918         
4919 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
4920
4921         Fix #70722
4922         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
4923         only for overrides.
4924         
4925 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
4926
4927         * attribute.cs: Check for null and empty strings.  
4928
4929         I have lost another battle to Paolo.
4930
4931 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
4932
4933         Fix #70942
4934         * class.cs (PropertyMethod): Set Parent field in ctors.
4935         (SetMethod.InternalParameters): Add unsafe switch hack.
4936         Override MarkForDuplicationCheck where it is appropriate.
4937
4938         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
4939         It says whether container allows members with the same name.
4940         Base default is no.
4941         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
4942         Removed is_method parameter.
4943
4944 2005-01-06  Duncan Mak  <duncan@ximian.com>
4945
4946         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
4947         because the previous change led to incorrect reporting of CS1032
4948         ("Cannot define/undefine preprocessor symbols after first token in
4949         file"). Instead of using `tokens_seen' as the only flag that
4950         triggers CS1040, introduce `comments_seen'. This new flag is used
4951         to signify having seen comments on the current line, so it is
4952         unset after a newline.
4953
4954 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4955
4956         * doc.cs : When searching for a type, find nested type too.
4957           This fixes bug #71040.
4958
4959 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
4960
4961         * doc.cs :
4962           - Warn missing member comment on those classes which also does not
4963             have doc comments. Fixed bug #71041.
4964           - Don't warn missing doc comment on default constructor.
4965             Fixed bug #71042.
4966
4967 2005-01-06  Duncan Mak  <duncan@ximian.com>
4968
4969         * cs-tokenizer.cs (xtoken): After handling traditional C-style
4970         comments, set `tokens_seen' to true. This allows us to detect
4971         misplaced preprocessor directives (i.e. not at the beginning of
4972         the a line, nor after whitespaces). In that case, report error
4973         CS1040. This fixes bug #56460.
4974
4975         * cs-parser.jay (interface_member_declaration): Add checks for
4976         IsExplicitImpl, and report CS0541 error if an interface member is
4977         defined as an explicit interface declaration.
4978
4979 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
4980
4981         Fix #70817
4982         * class.cs (PropertyMethod): Set Parent field in ctors.
4983         (SetMethod.InternalParameters): Add unsafe switch hack.
4984         
4985         * decl.cs (MemberCore.Parent): Cannot be readonly.
4986
4987 2005-01-06  Raja R Harinath  <rharinath@novell.com>
4988
4989         * decl.cs (DeclSpace.ResolveType): Remove.
4990         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
4991         Merge in code from ...
4992         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
4993         * class.cs, enum.cs: Update to changes.
4994
4995 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
4996
4997         * anonymous.cs: Ensure that we init the scope of our parent if it
4998         has not been initialized yet.
4999
5000 2004-12-30  Duncan Mak  <duncan@ximian.com>
5001
5002         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5003         if field.FieldBuilder is null. Fixes #70758.
5004
5005         * convert.cs: Fixed some typos and updated some of the comments.
5006         (ImplicitStandardConversionExists):
5007         (TryImplicitIntConversion): If `target_type' is an interface and
5008         the type of `ic' implements this interface, return true or a new
5009         BoxedCast instead of null. This fixes #70468.
5010
5011 2004-12-29  Duncan Mak  <duncan@ximian.com>
5012
5013         * expression.cs (Argument.Emit): Check that Expr is
5014         IMemoryLocation before casting to it, and report CS1510 otherwise.
5015
5016         This fixes #70402.
5017
5018 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5019
5020         * statement.cs (Block.ThisVariable): remove the recursion here, to
5021         make the --profile more sane.
5022
5023 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5024
5025         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5026         assembly, by JB Evain.
5027
5028 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5029
5030         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5031           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5032         "parent" refers to enclosing type/class.  "base" refers to superclass.
5033
5034 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5035
5036         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5037         Ensure that we only have GlobalAttributes.
5038         * attribute.cs (Attribute.Emit): Make non-virtual.
5039         (GlobalAttribute.Emit): Remove.
5040         (Attribute.Resolve): Make virtual.
5041         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5042         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5043         the argument. Don't create one.
5044         (Attribute.GetObsoleteAttribute): Likewise.
5045         (Attribute.GetClsCompliantAttributeValue): Likewise.
5046         * class.cs, decl.cs: Update to changes.
5047
5048 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5049
5050         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5051         
5052         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5053         
5054         * statement.cs (Foreach.Resolve): Add error 186 report.
5055
5056 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5057
5058         * expression.cs (Conditional.DoResolve): Add warning 429.
5059         
5060         * statement.cs (If.Resolve): Add warning 665.
5061
5062 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5063
5064         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5065         except when in the parser, and in GlobalAttribute.
5066         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5067         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5068         RootContext.Tree.Types.NamespaceEntry once work is done.
5069         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5070         and resets RootContext.Tree.Types.NamespaceEntry.
5071
5072 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5073
5074         * cs-parser.jay: Don't create a block for every variable.
5075
5076 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5077
5078         * location.cs: Provide extra information.
5079
5080         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5081         variables from the captured environment, it is the ldarg_0.
5082
5083 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5084
5085         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5086         find a conclusion.
5087         
5088         * class.cs: Changed warning level for 169 to avoid developer
5089         displeasure from warning flooding. It will be changed back when they
5090         fix most of current BCL warnings.
5091         
5092         * RootContext.cs: Pushed default WarningLevel to 3.
5093         
5094         * statement.cs: Removed unused variable.
5095
5096 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5097
5098         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5099         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5100         Add error 502 report.
5101         (StaticClass.DefineType): Add error 441 report.
5102         (Class.AllowedModifiersProp): New virtual property as temporary
5103         extension to AllowedModifiers.
5104         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5105         to share implementation with StaticClass and don't call virtual
5106         methods from ctor.
5107         
5108         * driver.cs (MainDriver): Add error 1558 test.
5109
5110         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5111         report. Moved error 36 test here.
5112
5113         * statement.cs (Throw.Resolve): Add error 724 report.
5114
5115         * typemanager.cs: Add out_attribute_type core type.
5116         
5117 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5118
5119         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5120         3018 report.
5121         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5122
5123         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5124         3017 report.
5125         
5126         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5127
5128         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5129         Add error 3023 report.
5130         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5131
5132         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5133         implementation.
5134
5135 2004-12-12  John Luke  <john.luke@gmail.com>
5136
5137         * driver.cs (AddArgs): take -- into account when
5138         adding arguments, fixes bug 65710 
5139
5140 2004-12-12  Martin Baulig  <martin@ximian.com>
5141
5142         * expression.cs (Unary.TryReduceNegative): Added support for
5143         SByteConstant and ByteConstant.
5144         (Unary.Reduce): Check error values from TryReduceNegative().
5145
5146 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5147
5148         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5149         and report exception as error 182.
5150
5151 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5152
5153         * driver.cs (Main): Fix message when there are warnings.
5154
5155 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5156
5157         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5158
5159 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5160
5161         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5162         Reduced number of warnings.
5163         
5164         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5165
5166 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5167
5168         * driver.cs: Removed message.
5169
5170         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5171
5172 2004-12-08    <vargaz@freemail.hu>
5173
5174         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5175
5176 2004-12-08  Martin Baulig  <martin@ximian.com>
5177
5178         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5179         instead of a CS3002 for properties and indexer.
5180
5181 2004-12-08  Martin Baulig  <martin@ximian.com>
5182
5183         * decl.cs (MemberName.ToString): Make this work again.
5184
5185 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5186
5187         * attribute.cs (Resolve): Add error 591 detection.
5188
5189         * class.cs (FieldMember.Define): Add error 1547 detection.
5190         (Indexer.Define): Add error 620 detection.
5191         (Operator.Define): Add error 590 detection.
5192
5193         * ecore.cs: Missing argument for error 79.
5194
5195         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5196         detection.
5197
5198 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5199
5200         Fix #70106
5201         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5202         only.
5203
5204 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5205
5206         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5207           Some operator comments were suppressed.
5208         * doc.cs : Implicit/explicit operator name in doc comments are like
5209           "op_Explicit(type)~returnType", so added suffix handling.
5210
5211 2004-12-07  Martin Baulig  <martin@ximian.com>
5212
5213         * decl.cs
5214         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5215         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5216         (DeclSpace.ec): New protected field; store the EmitContext here.
5217         (DeclSpace.EmitContext): New public property; moved here from
5218         `TypeContainer'.
5219         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5220         EmitContext.
5221
5222         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5223         (Enum.Emit): Don't create a new EmitContext.
5224
5225         * delegate.cs (Delegate.DefineType): Always create the
5226         EmitContext.
5227
5228         * iterators.cs (Iterators.DefineIterator): Create a new
5229         EmitContext and store it in `ec'.
5230
5231 2004-08-24  Martin Baulig  <martin@ximian.com>
5232
5233         * typemanager.cs
5234         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5235         this for accessibility checks.
5236         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5237         IsNestedFamilyAccessible.
5238         (TypeManager.IsSubclassOf): New method, do what the name actually
5239         says.   
5240
5241 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5242
5243         Fix crash on cs0657-17.cs.
5244         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5245         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5246         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5247         the case where the NamespaceEntry gets overwritten.
5248
5249 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5250
5251         Fixed #69195, #56821
5252         * ecore.cs (ResolveBoolean): Tiny refactoring.
5253
5254         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5255         of right expression resolving when left is false constant and
5256         operator is LogicalAnd OR true constant and operator is LogicalOr.
5257
5258         * statement.cs (ResolveUnreachable): Always reports warning.
5259
5260 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5261
5262         * class.cs: Distinguish between 1721 and 1722 (just a little help
5263         for the programmer).
5264
5265 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
5266
5267         * delegate.cs: Only allow this on new versions of the language. 
5268
5269 2004-12-02  Duncan Mak  <duncan@ximian.com>
5270
5271         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
5272         Expression class.
5273         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
5274         here as a static method. Take an additional bool out parameter
5275         `must_do_cs1540_check' for signaling to InstanceResolve.
5276         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
5277         member field from PropertyExpr class and made it an argument of
5278         the method instead.
5279         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
5280         check for MarshalByRefObject, and report CS0122 instead of CS1540.
5281         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
5282         and `remove_accessor' as well as InstanceResolve: report CS0122
5283         where applicable.
5284
5285         Fixes #70129.
5286
5287 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5288
5289         Fix test-327.cs, test-328.cs, and put in early infrastructure
5290         for eventually fixing #52697.
5291         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
5292         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
5293         from other methods.
5294         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
5295         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
5296         (VerifyUsing, error246): Update.
5297         * rootcontext.cs (RootContext.NamespaceLookup): Just use
5298         'NamespaceEntry.LookupNamespaceOrType'.
5299
5300 2004-12-03  Martin Baulig  <martin@ximian.com>
5301
5302         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5303         method as our child, call AnonymousMethod.Compatible() on it.
5304
5305 2004-12-03  Raja R Harinath  <rharinath@novell.com>
5306
5307         Disable XML documentation support in 'basic' profile.
5308         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
5309         Redirect XmlElement to System.Object.
5310         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
5311         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
5312         * mcs.exe.sources: Add doc-bootstrap.cs.
5313         * doc-bootstrap.cs: New file.  Contains empty stub implementation
5314         of doc.cs.
5315
5316 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
5317
5318         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
5319           comments are allowed.
5320
5321 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5322
5323         * delegate.cs: Add checks for subtypes in paramaters and return values
5324         in VerifyMethod () to add support for Covariance/Contravariance
5325         in delegates.
5326         
5327 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
5328
5329         * report.cs: Remove extra closing parenthesis.
5330
5331         * convert.cs (Error_CannotImplicitConversion): If the name of the
5332         types are the same, provide some extra information.
5333
5334         * class.cs (FieldBase): Use an unused bit field from the field to
5335         encode the `has_offset' property from the FieldMember.  This saves
5336         a couple of Ks on bootstrap compilation.
5337
5338         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
5339         method as our child, return the AnonymousMethod resolved
5340         expression.
5341
5342         * expression.cs (New.DoResolve): Allow return values from
5343         NewDelegate to also include AnonymousMethods.
5344
5345         Fixes #70150.
5346
5347 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
5348
5349         Fix bug #70102
5350         * attribute.cs (Resolve): Improved implementation of params
5351         attribute arguments.
5352
5353         * support.cs (ParameterData): Add HasParams to be faster.
5354
5355 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
5356
5357         all things are for /doc support:
5358
5359         * doc.cs: new file that supports XML documentation generation.
5360         * mcs.exe.sources: added doc.cs.
5361         * driver.cs:
5362           Handle /doc command line option.
5363           Report error 2006 instead of 5 for missing file name for /doc.
5364           Generate XML documentation when required, after type resolution.
5365         * cs-tokenizer.cs:
5366           Added support for picking up documentation (/// and /** ... */),
5367           including a new XmlCommentState enumeration.
5368         * cs-parser.jay:
5369           Added lines to fill Documentation element for field, constant,
5370           property, indexer, method, constructor, destructor, operator, event
5371           and class, struct, interface, delegate, enum.
5372           Added lines to warn incorrect comment.
5373         * rootcontext.cs :
5374           Added Documentation field (passed only when /doc was specified).
5375         * decl.cs:
5376           Added DocComment, DocCommentHeader, GenerateDocComment() and
5377           OnGenerateDocComment() and some supporting private members for
5378           /doc feature to MemberCore.
5379         * class.cs:
5380           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
5381         * delegate.cs:
5382           Added overriden DocCommentHeader.
5383         * enum.cs:
5384           Added overriden DocCommentHeader and GenerateDocComment().
5385
5386 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
5387
5388         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
5389         unwrapping the enumeration values, chain to
5390         DoConstantNumericPromotions again, so we can promote things to the
5391         fundamental types (takes care of enums that are bytes, sbytes).
5392
5393         Fixes bug #62054.
5394
5395 2004-12-01  Raja R Harinath  <rharinath@novell.com>
5396
5397         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
5398         Fix long-standing bug in type-lookup.  Use FindType instead of
5399         LookupType when ec.ResolvingTypeTree.
5400         (Attribute.ResolveType, Attribute.Resolve)
5401         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
5402         Update to changes.
5403         (Attributes.Search): Remove internal version.  Update.
5404         (Attributes.SearchMulti): Update.
5405         (Attributes.GetClsCompliantAttribute): Remove.
5406         (Attributes.GetIndexerNameAttribute): Remove.
5407         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
5408         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
5409         * class.cs (Indexer.Define): Likewise.
5410
5411 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
5412
5413         Fix bug #68790
5414         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
5415         MarshallByReference members access.
5416
5417         * expression.cs: Use CheckMarshallByRefAccess;
5418         Better error CS0197 message.
5419
5420         * report.cs: Print whole related error message.
5421
5422 2004-11-30  Raja R Harinath  <rharinath@novell.com>
5423
5424         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
5425         the current directory to help debugging.
5426
5427 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5428
5429         * class (GetClassBases): Better error 60 report.
5430         (EventProperty): Disabled warning 67 detection.
5431
5432 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5433
5434         Fix bug #60324
5435         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
5436
5437         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
5438         precise values.
5439
5440 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
5441
5442         Fix bug #49488
5443         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
5444
5445         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
5446
5447 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
5448
5449         * attribute.cs (Attribute.Resolve): Refine error reporting and
5450         report a cs0117 if the identifier does not exist, to distinguish
5451         from 0617 which is a miss-use of the actual identifier.
5452
5453         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
5454         between cs0070 and cs0079.
5455
5456         * class.cs (MemberBase.DoDefine): When reporting a wrong
5457         accessibility level, we use MethodCore to compare instead of
5458         Method (this was a regression in some refactoring effort).
5459
5460         So now we correctly report cs0056 again.
5461
5462         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
5463         testing the target_type (which was known to be object_type) and
5464         not the source type (which is anonymous_method).
5465
5466         Fixed reporting of error cs1660.
5467
5468         * expression.cs (UserCast.Source): Expose the underlying cast.
5469
5470         * statement.cs (Switch.SwitchGoverningType): Sort the list of
5471         allowed types to find a match to int32 first (most common).
5472
5473         In addition, it ignores any ImplicitUserConversions that did an
5474         internal implicit conversion (as the switch statement allows only
5475         one integral conversion to exist).
5476
5477         * class.cs (PartialContainer.Create): rename `name' to
5478         `member_name' for clarity.  Then replace the string calls with a
5479         call to MemberName.GetPartialName, as now using
5480         MemberName.ToString is an error (this is due to the side effects
5481         it had, that were fixed in the past).
5482
5483         This will restore the error reporting on a number of partial class
5484         errors that were missusing this (and getting an exception as a
5485         results, which is now just a plain textual warning, because
5486         yyparse debug output would crash otherwise).
5487
5488 2004-11-26  Raja R Harinath  <rharinath@novell.com>
5489
5490         * Makefile (PROGRAM_INSTALL_DIR): Remove.
5491
5492 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5493
5494         * rootcontext.cs (LookupType): Make sure to cache lookups that
5495         don't give us a negative result. This saves about 5% of corlib
5496         compilation time.
5497
5498 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5499
5500         * report.cs (AbstractMessage.Print): messages are sent to stderr
5501
5502         * class.cs (TypeContainer.GetClassBases): It is an error to have a
5503         non-interface in the list of interfaces (at this point, either
5504         parent was properly set, or a base class is being listed in the
5505         interfaces section).
5506
5507         This flags error 1722, and resolves the crash from bug 69259.
5508
5509 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
5510
5511         * statement.cs (Using.EmitExpressionFinally): make this work right
5512         for valuetypes. Fixes 69926.
5513
5514 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
5515
5516         * const.cs (Const.ChangeType): Cope with the "0 literal can be
5517         converted to an enum" here, before we try to change the underlying
5518         type.  This code exists, but it is a different code path than the
5519         one used while encoding constants.
5520
5521         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
5522         old bug: when converting from the null literal to a pointer,
5523         return an EmptyCast, not the NullLiteral.
5524
5525         This fixes #69921, the recent null_type changes probably made this
5526         bug more prominent.
5527
5528         (ImplicitReferenceConversionExists): In addition, resynchronized
5529         the code here, so it matches the same code in
5530         ImplicitReferenceConversionExists for the `from any class-type S
5531         to any interface-type T'.
5532         
5533
5534 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
5535
5536         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
5537
5538 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
5539
5540         * cs-parser.jay: Use verbosity accordingly. 
5541
5542 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5543
5544         * expression.cs (Unary.ResolveOperator): Do not report warning;
5545         AddressOf reads from variable.
5546         
5547         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
5548
5549 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
5550
5551         Fix bug #69462
5552
5553         * attribute.cs (Attributable): Removed CheckTargets.
5554         (Attributes.Emit): Explicit attribute targets are tested here.
5555
5556         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
5557         not enabled for interfaces.
5558
5559         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
5560         (GetAssemblyName): Ouch next bug there.
5561
5562 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
5563
5564         * expression.cs: Error 275 added.
5565         
5566 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
5567
5568         Fix bug #69177 (Implemented decimal constant support)
5569
5570         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
5571         (BinaryFold): Add DecimalConstant.
5572
5573         * const.cs (Define): Decimal constant 
5574         (is not constant.
5575         (ChangeType): Add decimal type handling.
5576         (LookupConstantValue): Don't set value for decimal type but
5577         emit DecimalConstantAttribute. Needed for constant optimization.
5578
5579         * constant.cs (ToDecimal): New method.
5580         (ConvertToDecimal): New method.
5581         (IntConstant): Implemented ConvertToDecimal.
5582         (DecimalConstant.Emit): Emit optimized version for decimals in
5583         int range.
5584
5585         * expression.cs (ResolveOperator): Changed order of constant
5586         reduction to work correctly with native types which have
5587         overloaded operators.
5588         (ResolveMemberAccess): Extract constant value from attribute
5589         for decimal type.
5590
5591         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
5592
5593         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
5594         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
5595         (ChangeType): Decimal is special.
5596         (TypeToCoreType): Add decimal type.
5597
5598 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
5599
5600         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
5601         decimal types.
5602
5603 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
5604
5605         * class.cs (EventField.ApplyAttributeBuilder): Fix error
5606         test cs1667-5.cs.
5607
5608 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
5609
5610         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
5611
5612         * pending.cs (PendingImplementation): Grab only interfaces.
5613
5614 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
5615
5616         * statement.cs (ForeachHelperMethods): Add location member and
5617         error 202 detection.
5618
5619 2004-11-19  Raja R Harinath  <rharinath@novell.com>
5620
5621         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
5622         automatically handled by executable.make.
5623         (PROGRAM): Make profile-specific.
5624
5625 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
5626
5627         * expression.cs (DoResolveBase): Fixed wrong warning for out
5628         variables.
5629
5630 2004-11-18  Martin Baulig  <martin@ximian.com>
5631
5632         Merged latest changes into gmcs.  Please keep this comment in
5633         here, it makes it easier for me to see what changed in MCS since
5634         the last time I merged.
5635
5636 2004-11-17  Raja R Harinath  <rharinath@novell.com>
5637
5638         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
5639         (TypeHandle.GetMemberCache): New.
5640         (TypeHandle.TypeHandle): Update.
5641         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
5642         (TypeManager.LookupParentInterfacesCache):
5643         Rename from LookupInterfaceCache.  Optimize slightly.
5644         (TypeManager.MemberLookup_FindMembers): Update.
5645         * decl.cs (MemberCache.MemberCache): Set Container to null in the
5646         multi-type variant.
5647         (AddCacheContents): Rename from AddHashtable.
5648         * class.cs (TypeContainer.parent_container): Remove.
5649         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
5650         (TypeContainer.DoDefineMembers): Don't initialize it.
5651         Update to name changes.
5652         
5653 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
5654
5655         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
5656         that factors the code to check access modifiers on override.  
5657
5658         (PropertyBase): Use the code here.
5659
5660         Patch from Lluis S'anchez, fixes bug #69361.
5661
5662 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
5663
5664         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
5665         routine that is used to report the use of a captured variable
5666         whose address has been taken.
5667
5668         There are two checks: one when variables are being captured and
5669         the other check is when the address of a variable is taken. 
5670         
5671         (because an anonymous methods might be resolved before *or* after
5672         the address has been taken) and 
5673
5674         * expression.cs (Conditional.DoResolve): Remove the special
5675         casing that Martin added to trueExpr and falseExpr being both
5676         NullLiteral.  We get the right behavior now just by introducing
5677         the null_type into the compiler. 
5678
5679         * convert.cs (ExplicitConversion): Change the code to use
5680         null_type instead of testing `expr is NullLiteral'.
5681         (ImplicitConversionStandard): use null_type too.
5682         (ImplicitReferenceConversionExists): use null_type too.
5683         (ImplicitReferenceConversion): use null_type too.
5684
5685         * literal.cs: The type of `NullLiteral' is now null_type instead
5686         of object_type. 
5687         (Resolve): Set the type here.
5688
5689         * typemanager.cs: Introduce null_type.
5690
5691 2004-11-17  Martin Baulig  <martin@ximian.com>
5692
5693         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
5694         direction, like FindMembers() does.  Fixes #69546, testcase is in
5695         test-315.cs.    
5696
5697 2004-11-16  Martin Baulig  <martin@ximian.com>
5698
5699         This is based on a patch from Marek Safar, see bug #69082.
5700         Fixes bugs #63705 and #67130.
5701
5702         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
5703         method; create a MemberCache for an interface type and cache the
5704         result.
5705
5706         * decl.cs (IMemberContainer.ParentContainer): Removed.
5707         (IMemberContainer.ParentCache): New property.
5708         (MemberCache.SetupCacheForInterface): Removed.
5709         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
5710         to create a cache for an interface's "parent".
5711
5712         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
5713         interfaces too.
5714
5715 2004-11-16  Martin Baulig  <martin@ximian.com>
5716
5717         Merged back from gmcs; these changes already went into gmcs a
5718         couple of weeks ago.
5719
5720         * typemanager.cs
5721         (TypeManager.AddUserType): Removed the `ifaces' argument.
5722         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
5723         `TypeExpr []'.
5724         (TypeManager.AddUserInterface): Removed.
5725         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
5726         `TypeExpr []'.
5727         (TypeManager.GetInterfaces): Likewise.
5728         (TypeManager.GetExplicitInterfaces): Likewise.
5729
5730         * ecore.cs (TypeExpr.GetInterfaces): Removed.
5731
5732         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
5733         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
5734
5735 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
5736
5737         * statement.cs: Avoid adding bools to a hashtable.
5738
5739 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
5740
5741         * expression.cs (Invocation.OverloadResolve): Flag error if we are
5742         calling an unsafe method from a safe location.
5743
5744 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
5745
5746         Fix #69167
5747         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
5748
5749 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
5750
5751         * namespace.cs (VerifyUsing): use GetPartialName instead of
5752         ToString. 
5753
5754 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
5755
5756         * statement.cs (Return.Resolve): Fix regression in typo: if
5757         `in_exc', we have to request a NeedReturnLabel, this was a typo
5758         introduced in the anonymous method check-in.  Fixes #69131.
5759
5760         * Indexers were using the ShortName when defining themselves,
5761         causing a regression in the compiler bootstrap when applying the
5762         patch from 2004-11-02 (first part), now they use their full name
5763         and the bug is gone.
5764
5765 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
5766
5767         * driver.cs: Strip the path from the names of embedded resources. Fixes
5768         #68519.
5769
5770 2004-11-04  Raja R Harinath  <rharinath@novell.com>
5771
5772         Fix error message regression: cs0104-2.cs.
5773         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
5774         (AliasEntry.Resolve): Update.
5775         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
5776         'silent' flag.
5777         (RootContext.LookupType): Update.
5778
5779 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
5780
5781         * cs-parser.jay: Add support for handling accessor modifiers
5782         * class: Add support port accessor modifiers and error checking,
5783         define PropertyMethod.Define as virtual (not abstract anymore)
5784         * ecore.cs: Add checking for proeprties access with access modifiers
5785         * iterators.cs: Modify Accessor constructor call based in the modified
5786         constructor
5787 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
5788
5789         * expression.cs (StringConcat): Handle being called twice,
5790         as when we have a concat in a field init with more than two
5791         ctors in the class
5792
5793 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
5794
5795         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
5796         special case explicit implementations, we should always produce
5797         the .property or .event declaration.
5798         
5799         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
5800         since it will not return correct data if people use this
5801         unresolved in the presence of using statements (see test-313).
5802
5803         * class.cs (MethodData.Define): If we are an explicit interface
5804         implementation, set the method name to the full name of the
5805         interface plus the name of the method.  
5806
5807         Notice that using the method.MethodName.GetFullName() does not
5808         work, as it will only contain the name as declared on the source
5809         file (it can be a shorthand in the presence of using statements)
5810         and not the fully qualifed type name, for example:
5811
5812         using System;
5813
5814         class D : ICloneable {
5815                 object ICloneable.Clone ()  {
5816                 }
5817         }
5818
5819         Would produce a method called `ICloneable.Clone' instead of
5820         `System.ICloneable.Clone'.
5821
5822         * namespace.cs (Alias.Resolve): Use GetPartialName.
5823         
5824 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5825
5826         * cs-parser.jay: Add error 1055 report.
5827
5828 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
5829
5830         * assign.cs (Assign.DoResolve): Only do the transform of
5831         assignment into a New if the types are compatible, if not, fall
5832         through and let the implicit code deal with the errors and with
5833         the necessary conversions. 
5834
5835 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
5836
5837         * cs-parser.jay: Add error 1031 report.
5838
5839         * cs-tokenizer.cs: Add location for error 1038.
5840
5841 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5842
5843         * cs-parser.jay: Add error 1016 report.
5844
5845 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5846
5847         * cs-parser.jay: Add errors 1575,1611 report.
5848
5849 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5850
5851         * cs-parser.jay: Add error 1001 report.
5852
5853 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5854
5855         Fix #68850
5856         * attribute.cs (GetMarshal): Add method argument for
5857         caller identification.
5858
5859         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
5860         agument for GetMarshal and RuntimeMissingSupport.
5861
5862 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
5863
5864         * attribute.cs (ExtractSecurityPermissionSet): Removed
5865         TypeManager.code_access_permission_type.
5866
5867         * typemanager.cs: Removed TypeManager.code_access_permission_type.
5868
5869 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
5870
5871         * expression.cs (LocalVariableReference.DoResolveLValue): Check
5872         for obsolete use of a variable here.   Fixes regression on errors
5873         cs0619-25 and cs0619-26.
5874
5875 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
5876
5877         Fix #62358, implemented security attribute encoding.
5878
5879         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
5880         Tests permitted SecurityAction for assembly or other types.
5881         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
5882         data from SecurityPermissionAttribute to PermisionSet class.
5883
5884         * class.cs (ApplyAttributeBuilder): Added special handling
5885         for System.Security.Permissions.SecurityAttribute based types.
5886
5887         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
5888         special handling for System.Security.Permissions.SecurityAttribute
5889         based types.
5890
5891         * enum.cs (ApplyAttributeBuilder): Added special handling
5892         for System.Security.Permissions.SecurityAttribute based types.
5893
5894         * parameter.cs (ApplyAttributeBuilder): Added special handling
5895         for System.Security.Permissions.SecurityAttribute based types.
5896
5897         * rootcontext.cs: Next 2 core types.
5898
5899         * typemanager.cs (TypeManager.security_permission_attr_type):
5900         Built in type for the SecurityPermission Attribute.
5901         (code_access_permission_type): Build in type.
5902
5903 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
5904
5905         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
5906         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
5907         all of this information into
5908         EmitContext.EmitCapturedVariableInstance.
5909         
5910         * codegen.cs (EmitCapturedVariableInstance): move here the
5911         funcionality of emitting an ldarg.0 in the presence of a
5912         remapping.   This centralizes the instance emit code.
5913
5914         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
5915         then emit a load of this: it means that we have reached the
5916         topmost ScopeInfo: the one that contains the pointer to the
5917         instance of the class hosting the anonymous method.
5918
5919         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
5920         captures to the topmost CaptureContext.
5921
5922 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
5923
5924         * expression.cs (LocalVariableReference): Move the knowledge about
5925         the iterators into codegen's EmitCapturedVariableInstance.
5926
5927 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
5928
5929         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
5930         all code paths return a value from an anonymous method (it is the
5931         same as the 161 error, but for anonymous methods).
5932
5933 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
5934
5935         The introduction of anonymous methods in the compiler changed
5936         various ways of doing things in the compiler.  The most
5937         significant one is the hard split between the resolution phase
5938         and the emission phases of the compiler.
5939
5940         For instance, routines that referenced local variables no
5941         longer can safely create temporary variables during the
5942         resolution phase: they must do so from the emission phase,
5943         since the variable might have been "captured", hence access to
5944         it can not be done with the local-variable operations from the runtime.
5945         
5946         * statement.cs 
5947
5948         (Block.Flags): New flag `IsTopLevel' to indicate that this block
5949         is a toplevel block.
5950
5951         (ToplevelBlock): A new kind of Block, these are the blocks that
5952         are created by the parser for all toplevel method bodies.  These
5953         include methods, accessors and anonymous methods.
5954
5955         These contain some extra information not found in regular blocks:
5956         A pointer to an optional CaptureContext (for tracking captured
5957         local variables and parameters).  A pointer to the parent
5958         ToplevelBlock.
5959         
5960         (Return.Resolve): Catch missmatches when returning a value from an
5961         anonymous method (error 1662).
5962         Invoke NeedReturnLabel from the Resolve phase instead of the emit
5963         phase.
5964
5965         (Break.Resolve): ditto.
5966
5967         (SwitchLabel): instead of defining the labels during the
5968         resolution phase, we now turned the public ILLabel and ILLabelCode
5969         labels into methods called GetILLabelCode() and GetILLabel() that
5970         only define the label during the Emit phase.
5971
5972         (GotoCase): Track the SwitchLabel instead of the computed label
5973         (its contained therein).  Emit the code by using
5974         SwitchLabel.GetILLabelCode ().
5975
5976         (LocalInfo.Flags.Captured): A new flag has been introduce to track
5977         whether the Local has been captured or not.
5978
5979         (LocalInfo.IsCaptured): New property, used to tell whether the
5980         local has been captured.
5981         
5982         * anonymous.cs: Vastly updated to contain the anonymous method
5983         support.
5984
5985         The main classes here are: CaptureContext which tracks any
5986         captured information for a toplevel block and ScopeInfo used to
5987         track the activation frames for various local variables.   
5988
5989         Each toplevel block has an optional capture context associated
5990         with it.  When a method contains an anonymous method both the
5991         toplevel method and the anonymous method will create a capture
5992         context.   When variables or parameters are captured, they are
5993         recorded on the CaptureContext that owns them, for example:
5994
5995         void Demo () {
5996              int a;
5997              MyDelegate d = delegate {
5998                  a = 1;
5999              }
6000         }
6001
6002         Here `a' will be recorded as captured on the toplevel
6003         CapturedContext, the inner captured context will not have anything
6004         (it will only have data if local variables or parameters from it
6005         are captured in a nested anonymous method.
6006
6007         The ScopeInfo is used to track the activation frames for local
6008         variables, for example:
6009
6010         for (int i = 0; i < 10; i++)
6011                 for (int j = 0; j < 10; j++){
6012                    MyDelegate d = delegate {
6013                         call (i, j);
6014                    }
6015                 }
6016
6017         At runtime this captures a single captured variable `i', but it
6018         captures 10 different versions of the variable `j'.  The variable
6019         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6020         recorded on a child.  
6021
6022         The toplevel ScopeInfo will also track information like the `this'
6023         pointer if instance variables were referenced (this is necessary
6024         as the anonymous method lives inside a nested class in the host
6025         type of the method). 
6026
6027         (AnonymousMethod): Expanded to track the Toplevel, implement
6028         `AnonymousMethod.Compatible' to tell whether an anonymous method
6029         can be converted to a target delegate type. 
6030
6031         The routine now also produces the anonymous method content
6032
6033         (AnonymousDelegate): A helper class that derives from
6034         DelegateCreation, this is used to generate the code necessary to
6035         produce the delegate for the anonymous method that was created. 
6036
6037         * assign.cs: API adjustments for new changes in
6038         Convert.ImplicitStandardConversionExists.
6039
6040         * class.cs: Adjustments to cope with the fact that now toplevel
6041         blocks are of type `ToplevelBlock'. 
6042
6043         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6044         insteda of standard blocks.
6045
6046         Flag errors if params arguments are passed to anonymous methods.
6047
6048         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6049         `CurrentAnonymousMethod' which points to the current Anonymous
6050         Method.  The variable points to the AnonymousMethod class that
6051         holds the code being compiled.  It is set in the new EmitContext
6052         created for the anonymous method.
6053
6054         (EmitContext.Phase): Introduce a variable and an enumeration to
6055         assist in enforcing some rules about when and where we are allowed
6056         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6057         only one that enfonces this right now).
6058
6059         (EmitContext.HaveCaptureInfo): new helper method that returns
6060         whether we have a CapturedContext initialized.
6061
6062         (EmitContext.CaptureVariable): New method used to register that a
6063         LocalInfo must be flagged for capturing. 
6064
6065         (EmitContext.CapturedParameter): New method used to register that a
6066         parameters must be flagged for capturing. 
6067         
6068         (EmitContext.CapturedField): New method used to register that a
6069         field must be flagged for capturing. 
6070
6071         (EmitContext.HaveCapturedVariables,
6072         EmitContext.HaveCapturedFields): Return whether there are captured
6073         variables or fields. 
6074
6075         (EmitContext.EmitMethodHostInstance): This is used to emit the
6076         instance for the anonymous method.  The instance might be null
6077         (static methods), this (for anonymous methods that capture nothing
6078         and happen to live side-by-side with the current method body) or a
6079         more complicated expression if the method has a CaptureContext.
6080
6081         (EmitContext.EmitTopBlock): Routine that drives the emission of
6082         code: it will first resolve the top block, then emit any metadata
6083         and then emit the code.  The split is done so that we can extract
6084         any anonymous methods and flag any captured variables/parameters.
6085         
6086         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6087         during this phase, the ILGenerator should not be used as labels
6088         and local variables declared here might not be accessible to any
6089         code that is part of an anonymous method.  
6090
6091         Exceptions to this include the temporary variables that are
6092         created by some statements internally for holding temporary
6093         variables. 
6094         
6095         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6096         metadata for a cb
6097
6098         (EmitContext.TemporaryReturn): This method is typically called
6099         from the Emit phase, and its the only place where we allow the
6100         ReturnLabel to be defined other than the EmitMeta.  The reason is
6101         that otherwise we would have to duplicate a lot of logic in the
6102         Resolve phases of various methods that today is on the Emit
6103         phase. 
6104
6105         (EmitContext.NeedReturnLabel): This no longer creates the label,
6106         as the ILGenerator is not valid during the resolve phase.
6107
6108         (EmitContext.EmitThis): Extended the knowledge in this class to
6109         work in anonymous methods in addition to iterators. 
6110
6111         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6112         code is necessary on the stack to access the instance to a local
6113         variable (the variable will be accessed as a field).
6114
6115         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6116         EmitContext.EmitAddressOfParameter): Routines to support
6117         parameters (not completed at this point). 
6118         
6119         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6120         will also remove the parameters.
6121
6122         * convert.cs (Convert): Define a `ConstantEC' which points to a
6123         null.  This is just to prefity some code that uses
6124         ImplicitStandardConversion code and do not have an EmitContext
6125         handy.
6126
6127         The idea is to flag explicitly that at that point in time, it is
6128         known that the conversion will not trigger the delegate checking
6129         code in implicit conversions (which requires a valid
6130         EmitContext). 
6131
6132         Everywhere: pass new EmitContext parameter since
6133         ImplicitStandardConversionExists now requires it to check for
6134         anonymous method conversions. 
6135
6136         (Convert.ImplicitStandardConversionExists): If the type of an
6137         expression is the anonymous_method_type, and the type is a
6138         delegate, we invoke the AnonymousMethod.Compatible method to check
6139         whether an implicit conversion is possible. 
6140
6141         (Convert.ImplicitConversionStandard): Only do implicit method
6142         group conversions if the language level is not ISO_1.
6143
6144         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6145         MethodInfo for the Invoke method.  used by Delegate and
6146         AnonymousDelegate.
6147
6148         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6149         method conversions if the target type is a delegate.
6150
6151         Removed extra debugging nops.
6152
6153         (LocalVariableReference): Turn the `local_info' into a public
6154         field. 
6155
6156         Add `prepared' field, the same hack used for FieldExprs to cope
6157         with composed assignments, as Local variables do not necessarily
6158         operate purely on the stack as they used to: they can be captured
6159         fields. 
6160
6161         Add `temp' for a temporary result, like fields.
6162
6163         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6164
6165         It now copes with Local variables that are captured and emits the
6166         proper instance variable to load it from a field in the captured
6167         case. 
6168
6169         (ParameterReference.DoResolveBase): During the resolve phase,
6170         capture parameters if we are in an anonymous method.
6171
6172         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6173         anonymous method, use the EmitContext helper routines to emit the
6174         parameter reference.
6175
6176         * iterators.cs: Set RemapToProxy to true/false during the
6177         EmitDispose class.
6178
6179         * parameters.cs (GetParameterByName): New helper method. 
6180
6181         * typemanager.cs (anonymous_method_type) a new type that
6182         represents an anonyous method.  This is always an internal type,
6183         used as a fencepost to test against the anonymous-methodness of an
6184         expression. 
6185         
6186 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6187
6188         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6189         561 report.
6190         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6191
6192 2004-10-18  Martin Baulig  <martin@ximian.com>
6193
6194         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6195         `Type' directly, but call ResolveType() on it.
6196         (Catch.Resolve): Likewise.
6197         (Foreach.Resolve): Likewise.
6198
6199 2004-10-18  Martin Baulig  <martin@ximian.com>
6200
6201         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6202         `Type' directly, but call ResolveType() on it.
6203         (Probe.DoResolve): Likewise.
6204         (ArrayCreation.LookupType): Likewise.
6205         (TypeOf.DoResolve): Likewise.
6206         (SizeOf.DoResolve): Likewise.
6207
6208 2004-10-18  Martin Baulig  <martin@ximian.com>
6209
6210         * expression.cs (Invocation.BetterFunction): Put back
6211         TypeManager.TypeToCoreType().
6212
6213 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6214
6215         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6216         the ResolveType.
6217
6218 2004-10-18  Martin Baulig  <martin@ximian.com>
6219
6220         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
6221         `Type' directly, but call ResolveType() on it.
6222
6223 2004-10-18  Martin Baulig  <martin@ximian.com>
6224
6225         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6226         `Type' directly, but call ResolveType() on it.
6227         (MemberBase.DoDefine): Likewise.
6228
6229         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6230         `Type' directly, but call ResolveType() on it.
6231         (ComposedCast.DoResolveAsTypeStep): Likewise.
6232
6233         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6234         `Type' directly, but call ResolveType() on it.
6235
6236 2004-10-17  John Luke  <john.luke@gmail.com>
6237
6238         * class.cs (Operator.GetSignatureForError): use CSharpName
6239
6240         * parameter.cs (Parameter.GetSignatureForError): Returns
6241         correct name even if was not defined.
6242
6243 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6244
6245         Fix #65816.
6246         * class.cs (TypeContainer.EmitContext): New property.
6247         (DefineNestedTypes): Create an emitcontext for each part.
6248         (MethodCore.DoDefineParameters): Use container's emitcontext.
6249         Pass type array to InternalParameters.
6250         (MemberBase.DoDefine): Use container's emitcontext.
6251         (FieldMember.Define): Likewise.
6252         (Event.Define): Likewise.
6253         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6254         Pass type array to InternalParameters.
6255         (SetIndexerMethod.GetParameterInfo): Likewise.
6256         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6257         * delegate.cs (Define): Pass emitcontext to
6258         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6259         array to InternalParameters.
6260         * expression.cs (ParameterReference.DoResolveBase): Pass
6261         emitcontext to GetParameterInfo.
6262         (ComposedCast.DoResolveAsTypeStep): Remove check on
6263         ec.ResolvingTypeTree.
6264         * parameter.cs (Parameter.Resolve): Change argument to
6265         EmitContext.  Use ResolveAsTypeTerminal.
6266         (Parameter.GetSignature): Change argument to EmitContext.
6267         (Parameters.ComputeSignature): Likewise.
6268         (Parameters.ComputeParameterTypes): Likewise.
6269         (Parameters.GetParameterInfo): Likewise.
6270         (Parameters.ComputeAndDefineParameterTypes): Likewise.
6271         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
6272         * support.cs (InternalParameters..ctor): Remove variant that takes
6273         a DeclSpace.
6274         * typemanager.cs (system_intptr_expr): New.
6275         (InitExpressionTypes): Initialize it.
6276
6277 2004-10-12  Chris Toshok  <toshok@ximian.com>
6278
6279         * cs-parser.jay: fix location for try_statement and catch_clause.
6280
6281 2004-10-11  Martin Baulig  <martin@ximian.com>
6282
6283         * report.cs: Don't make --fatal abort on warnings, we have
6284         -warnaserror for that.
6285
6286 2004-10-07  Raja R Harinath  <rharinath@novell.com>
6287
6288         More DeclSpace.ResolveType avoidance.
6289         * decl.cs (MemberCore.InUnsafe): New property.
6290         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
6291         with newly created EmitContext.
6292         (FieldMember.Define): Likewise.
6293         * delegate.cs (Delegate.Define): Likewise.
6294         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
6295         only if normal name-lookup fails.
6296         (TypeExpr.DoResolve): Enable error-checking.
6297         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
6298         (SizeOf.DoResolve): Likewise.
6299         (ComposedCast.DoResolveAsTypeStep): Likewise.
6300         (StackAlloc.DoResolve): Likewise.
6301         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
6302         (Block.Unsafe): New property.
6303         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
6304         (Unsafe): Set 'unsafe' flag of contained block.
6305         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
6306         (Fixed.Resolve): Likewise.
6307         (Catch.Resolve): Likewise.
6308         (Using.ResolveLocalVariableDecls): Likewise.
6309         (Foreach.Resolve): Likewise.
6310
6311 2004-10-05  John Luke <john.luke@gmail.com>
6312
6313         * cs-parser.jay: add location to error CS0175
6314
6315 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
6316
6317         * ecore.cs (Expression.Constantity): Add support for turning null
6318         into a constant.
6319
6320         * const.cs (Const.Define): Allow constants to be reference types
6321         as long as the value is Null.
6322
6323 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
6324
6325         * namespace.cs (NamespaceEntry.Using): No matter which warning
6326         level is set, check if this namespace name has already been added.
6327
6328 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
6329
6330         * expression.cs: reftype [!=]= null should always use br[true,false].
6331         # 67410
6332
6333 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
6334
6335         Fix #67108
6336         * attribute.cs: Enum conversion moved to 
6337         GetAttributeArgumentExpression to be applied to the all
6338         expressions.
6339
6340 2004-10-01  Raja R Harinath  <rharinath@novell.com>
6341
6342         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
6343         * class.c (TypeContainer.DefineType): Flag error if
6344         base types aren't accessible due to access permissions.
6345         * decl.cs (DeclSpace.ResolveType): Move logic to
6346         Expression.ResolveAsTypeTerminal.
6347         (DeclSpace.ResolveTypeExpr): Thin layer over
6348         Expression.ResolveAsTypeTerminal.
6349         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
6350         Refactor code into NestedAccess.  Use it.
6351         (DeclSpace.NestedAccess): New.
6352         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
6353         argument to silence errors.  Check access permissions.
6354         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
6355         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
6356         (Cast.DoResolve): Likewise.
6357         (New.DoResolve): Likewise.
6358         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
6359         (TypeOf.DoResolve): Likewise.
6360
6361         * expression.cs (Invocation.BetterConversion): Return the Type of
6362         the better conversion.  Implement section 14.4.2.3 more faithfully.
6363         (Invocation.BetterFunction): Make boolean.  Make correspondence to
6364         section 14.4.2.2 explicit.
6365         (Invocation.OverloadResolve): Update.
6366         (Invocation): Remove is_base field.
6367         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
6368         (Invocation.Emit): Likewise.
6369
6370 2004-09-27  Raja R Harinath  <rharinath@novell.com>
6371
6372         * README: Update to changes.
6373
6374 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
6375
6376         * cs-parser.jay: Reverted 642 warning fix.
6377
6378 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6379
6380         Fix bug #66615
6381         * decl.cs (FindMemberWithSameName): Indexer can have more than
6382         1 argument.
6383
6384 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6385
6386         * expression.cs (LocalVariableReference.DoResolveLValue):
6387         Do not report warning 219 for out values.
6388         (EmptyExpression.Null): New member to avoid extra allocations.
6389
6390 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6391
6392         * cs-parser.jay: Fix wrong warning 642 report.
6393
6394         * cs-tokenizer.cs (CheckNextToken): New helper;
6395         Inspect next character if is same as expected.
6396
6397 2004-09-23  Martin Baulig  <martin@ximian.com>
6398
6399         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
6400         (Convert.ImplicitReferenceConversionExists): Likewise.
6401
6402 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
6403
6404         * class.cs (Operator.Define): Add error 448 and 559 report.
6405
6406 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6407
6408         * class.cs (MemberBase.IsTypePermitted): New protected
6409         method for checking error CS0610.
6410
6411 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6412
6413         * class.cs (TypeContainer.HasExplicitLayout): New property
6414         Returns whether container has StructLayout attribute set Explicit.
6415         (FieldMember): New abstract class for consts and fields.
6416         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
6417         (Field): Reuse FieldMember.
6418
6419         * const.cs (Const): Reuse FieldMember.
6420
6421         * rootcontext.cs: EmitConstants call moved to class.
6422
6423 2004-09-22  Martin Baulig  <martin@ximian.com>
6424
6425         Thanks to Peter Sestoft for this bug report.
6426
6427         * expression.cs (Conditional): If both the `trueExpr' and the
6428         `falseExpr' is a NullLiteral, return a NullLiteral.
6429
6430 2004-09-22  Martin Baulig  <martin@ximian.com>
6431
6432         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
6433         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
6434         for the "get_Current" call.
6435
6436 2004-09-22  Martin Baulig  <martin@ximian.com>
6437
6438         Marek and me just fixed one of our oldest bugs: #28562 :-)
6439
6440         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
6441
6442         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
6443         we're an EnumConstant, just return that.
6444         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
6445         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
6446         to get the value which'll actually be written into the attribute.
6447         However, we have to use GetValue() to access the attribute's value
6448         in the compiler.        
6449
6450 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
6451
6452         * constant.cs (Constant.IsNegative): New abstract property
6453         IsNegative.
6454
6455         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
6456         (StackAlloc.DoResolve): Reused IsNegative.
6457
6458 2004-09-21  Martin Baulig  <martin@ximian.com>
6459
6460         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
6461         if we're used in an iterator, we may be called from different
6462         methods.
6463
6464         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
6465         we actually have an exception block.
6466
6467 2004-09-20  John Luke <jluke@cfl.rr.com>
6468
6469         * class.cs, cs-parser.jay: Improve the error report for 1520:
6470         report the actual line where the error happens, not where the
6471         class was declared.
6472
6473         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
6474         Pass location information that was available elsewhere.
6475
6476 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
6477
6478         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
6479         runtime to delay sign assemblies.
6480
6481 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
6482
6483         * cs-parser.jay: Do not report the stack trace, this is barely
6484         used nowadays.
6485
6486 2004-08-22  John Luke  <john.luke@gmail.com>
6487  
6488         * driver.cs : check that a resource id is not already used
6489         before adding it, report CS1508 if it is, bug #63637
6490
6491 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
6492
6493         * ecore.cs: Removed dead code.
6494
6495 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
6496
6497         * class.cs: Do not report warning CS0067 on the interfaces.
6498
6499 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6500
6501         * cs-parser.jay: Add error 504 report.
6502
6503 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6504
6505         * rootcontext.cs: WarningLevel is 4 by default now.
6506
6507         * statement.cs (Fixed.Resolve): Do not null
6508         VariableInfo.
6509
6510 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
6511
6512         Fixed bug #55780
6513         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
6514         deep search when property is not virtual.
6515         (PropertyExpr.ResolveAccessors): Make one call for both
6516         accessors.
6517
6518 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6519
6520         Fixed bug #65766
6521         * statement.cs: Error 152 report constains also location.
6522
6523 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6524
6525         Fixed bug #65766
6526         * const.cs: Explicitly set constant as static.
6527
6528 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6529
6530         Fixed bug #64226
6531         * cs-parser.jay: Add error 1017 report.
6532
6533 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
6534
6535         Fixed bug #59980, #64224
6536         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
6537
6538         * typemanager.cs (IsSpecialMethod): Simplified
6539
6540 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6541
6542         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
6543         condition with better params.
6544
6545 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6546
6547         Fixed bug #65238
6548         * attribute.cs (Resolve): Property has to have both
6549         accessors.
6550
6551 2004-09-14  Martin Baulig  <martin@ximian.com>
6552
6553         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
6554
6555 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
6556
6557         Fixed bug #61902
6558         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
6559         called and is obsolete then this member suppress message
6560         when call is inside next [Obsolete] method or type.
6561
6562         * expression.cs: Use TestObsoleteMethodUsage member.
6563
6564 2004-09-14  Martin Baulig  <martin@ximian.com>
6565
6566         * cs-parser.jay: Sync a bit with the GMCS version.
6567
6568 2004-09-14  Martin Baulig  <martin@ximian.com>
6569
6570         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
6571         (CSharpParser.yacc_verbose_flag): New public field.
6572
6573         * genericparser.cs: Removed.
6574
6575 2004-09-14  Raja R Harinath  <rharinath@novell.com>
6576
6577         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
6578
6579 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
6580
6581         * class.cs (MethodCore.CheckBase): Fix bug #65757.
6582
6583 2004-09-10  Martin Baulig  <martin@ximian.com>
6584
6585         Backported my MemberName changes from GMCS into MCS.
6586
6587         - we are now using a special `MemberName' class instead of using
6588         strings; in GMCS, the `MemberName' also contains the type
6589         arguments.
6590
6591         - changed the grammar rules a bit:
6592           * the old `member_name' is now a `namespace_or_type_name':
6593             The rule is that we use `namespace_or_type_name' everywhere
6594             where we expect either a "member name" (GetEnumerator) or a
6595             "member name" with an explicit interface name
6596             (IEnumerable.GetEnumerator).
6597             In GMCS, the explicit interface name may include type arguments
6598             (IEnumerable<T>.GetEnumerator).
6599           * we use `member_name' instead of just `IDENTIFIER' for
6600             "member names":
6601             The rule is that we use `member_name' wherever a member may
6602             have type parameters in GMCS.       
6603
6604         * decl.cs (MemberName): New public class.
6605         (MemberCore.MemberName): New public readonly field.
6606         (MemberCore.ctor): Take a `MemberName' argument, not a string.
6607         (DeclSpace): Likewise.
6608
6609         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
6610         * enum.cs (Enum.ctor): Likewise.
6611
6612         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
6613         MemberName.     
6614         (AliasEntry.ctor): Take a MemberName, not an Expression.
6615         (AliasEntry.UsingAlias): Likewise.
6616
6617         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
6618         (IMethodData.MemberName): Changed type from string to MemberName.
6619         (MemberBase.ExplicitInterfaceName): Likewise.
6620         (AbstractPropertyEventMethod.SetupName): Make this private.
6621         (AbstractPropertyEventMethod.ctor): Added `string prefix'
6622         argument; compute the member name here.
6623         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
6624         on the `member.MemberName' and the `prefix'.
6625
6626         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
6627         not `type_name'.
6628         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
6629         thus, we get a `MemberName' instead of a `string'.  These
6630         declarations may have type parameters in GMCS.
6631         (interface_method_declaration, delegate_declaration): Likewise.
6632         (class_declaration, interface_declaration): Likewise.
6633         (method_header): Use `namespace_or_type_name' instead of
6634         `member_name'.  We may be an explicit interface implementation.
6635         (property_declaration, event_declaration): Likewise.
6636         (member_name): This is now just an `IDENTIFIER', not a
6637         `namespace_or_type_name'.
6638         (type_name, interface_type): Removed.
6639         (namespace_or_type_name): Return a MemberName, not an Expression.
6640         (primary_expression): Use `member_name' instead of `IDENTIFIER';
6641         call GetTypeExpression() on the MemberName to get an expression.
6642         (IndexerDeclaration.interface_type): Changed type from string to
6643         MemberName.
6644         (MakeName): Operate on MemberName's instead of string's.
6645
6646 2004-09-13  Raja R Harinath  <rharinath@novell.com>
6647
6648         Fix bug #55770.
6649         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
6650         (NamespaceEntry.Lookup): Add new argument to flag if we want the
6651         lookup to avoid symbols introduced by 'using'.
6652         * rootcontext.cs (NamespaceLookup): Update.
6653
6654 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6655
6656         * class.cs (TypeContainer.DoDefineMembers): Do not call
6657         DefineDefaultConstructor for static classes.
6658
6659 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
6660
6661         * attribute.cs (Attribute.Resolve): Add error 653 report.
6662
6663         * class.cs (Class.ApplyAttributeBuilder): Add error 641
6664         report.
6665         (Method.ApplyAttributeBuilder): Add error 685 report.
6666         (Operator.Define): Add error 564 report.
6667
6668         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
6669
6670         * expression.cs (Invocation.DoResolve): Add error
6671         245 and 250 report.
6672
6673         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
6674         error 674 report.
6675
6676 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6677
6678         * class.cs (ConstructorInitializer.Resolve):
6679         Wrong error number (515->516).
6680
6681 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6682
6683         * class.cs (Indexer.Define): Add error 631 report.
6684
6685 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6686
6687         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
6688
6689 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
6690
6691         * expression.cs (Probe.DoResolve): Add error CS0241 report.
6692
6693 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
6694
6695         * cs-parser.jay: Added error CS0241 report.
6696
6697 2004-09-10  Raja R Harinath  <rharinath@novell.com>
6698
6699         * cs-parser.jay (fixed_statement): Introduce a scope for the
6700         declaration in the 'fixed' statement.
6701
6702 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6703
6704         * cs-parser.jay: Added CS0230 error report.
6705
6706 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6707
6708         * cs-parser.jay: Added errors CS0231 and CS0257 report.
6709
6710 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6711
6712         * expression.cs (Argument.Resolve): Added error CS0192 and
6713         CS0199 report.
6714
6715 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
6716
6717         C# 2.0 #pragma warning feature
6718
6719         * cs-tokenizer.cs (PreProcessPragma): New method; 
6720         Handles #pragma directive.
6721
6722         * report.cs (WarningRegions): New class; Support
6723         class for #pragma warning directive. It tests whether
6724         warning is enabled for a given line.
6725
6726 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
6727
6728         * const.cs: Add more descriptive error report, tahnks to
6729         Sebastien. 
6730
6731 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
6732
6733         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
6734
6735 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
6736
6737         * expression.cs: Apply patch from Ben: Remove dead code from
6738         ArrayCreation, and remove the TurnintoConstant call in const.cs,
6739         as that code just threw an exception anwyays.
6740
6741         * const.cs: Remove the call to the turnintoconstant, for details
6742         see bug: #63144
6743         
6744         * literal.cs: The type of the null-literal is the null type;  So
6745         we use a placeholder type (literal.cs:System.Null, defined here)
6746         for it.
6747
6748         * expression.cs (Conditional.DoResolve): Remove some old code that
6749         is no longer needed, conversions have been fixed.
6750
6751         (ArrayCreationExpression.DoResolve): Return false if we fail to
6752         resolve the inner expression.
6753
6754 2004-09-07  Raja R Harinath  <rharinath@novell.com>
6755
6756         Fix test-290.cs.
6757         * cs-parser.jay (delegate_declaration): Record a delegate
6758         declaration as a type declaration.
6759         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
6760
6761 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
6762
6763         * parameter.cs: Do not crash if the type can not be resolved. 
6764
6765         * expression.cs: Report errors with unsafe pointers, fixes #64896
6766
6767 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
6768
6769         * expression.cs: Pointer arith always needs to do a conv.i
6770         if the operand is a long. fix 65320
6771
6772 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6773
6774         Fixed cs0619-37.cs, cs0619-38.cs
6775
6776         * enum.cs (GetObsoleteAttribute): Removed.
6777
6778         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
6779         on Enum member is double staged. The first is tested member
6780         and then enum.
6781
6782 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
6783
6784         Fixed #56986, #63631, #65231
6785
6786         * class.cs: (TypeContainer.AddToMemberContainer): New method,
6787         adds member to name container.
6788         (TypeContainer.AddToTypeContainer): New method, adds type to
6789         name container.
6790         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
6791         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
6792         AddOperator): Simplified by reusing AddToMemberContainer.
6793         (TypeContainer.UserDefinedStaticConstructor): Changed to property
6794         instead of field.
6795         (Method.CheckForDuplications): Fixed implementation to test all
6796         possibilities.
6797         (MemberBase): Detection whether member is explicit interface
6798         implementation is now in constructor.
6799         (MemberBase.UpdateMemberName): Handles IndexerName.
6800         (Accessor): Changed to keep also location information.
6801         (AbstractPropertyEventMethod): Is derived from MemberCore.
6802         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
6803         will be emited or not.
6804         (PropertyBase.AreAccessorsDuplicateImplementation):
6805         Tests whether accessors are not in collision with some method.
6806         (Operator): Is derived from MethodCore to simplify common
6807         operations.
6808
6809         * decl.cs (Flags.TestMethodDuplication): Test for duplication
6810         must be performed.
6811         (DeclSpace.AddToContainer): Adds the member to defined_names
6812         table. It tests for duplications and enclosing name conflicts.
6813
6814         * enum.cs (EnumMember): Clean up to reuse the base structures
6815
6816 2004-09-03  Martin Baulig  <martin@ximian.com>
6817
6818         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
6819         into TypeContainer, to make partial classes work again.
6820
6821 2004-09-03  Martin Baulig  <martin@ximian.com>
6822
6823         * rootcontext.cs (RootContext.V2): Removed.
6824
6825 2004-03-23  Martin Baulig  <martin@ximian.com>
6826
6827         * expression.cs (Invocation.OverloadResolve): Added `bool
6828         may_fail' argument and use it instead of the Location.IsNull() hack.
6829
6830 2004-09-03  Martin Baulig  <martin@ximian.com>
6831
6832         Merged latest changes into gmcs.  Please keep this comment in
6833         here, it makes it easier for me to see what changed in MCS since
6834         the last time I merged.
6835
6836 2004-09-03  Raja R Harinath  <rharinath@novell.com>
6837
6838         Fix #61128.
6839         * expression.cs (BetterConversion): Don't allow either conversion 
6840         to be null.  Remove redundant implicit conversion test when 'q ==
6841         null' -- when this function is invoked, we already know that the
6842         implicit conversion exists.
6843         (BetterFunction): Assume that 'best' is non-null.  Remove
6844         redundant reimplementation of IsApplicable when 'best' is null.
6845         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
6846         number of arguments.
6847         (IsAncestralType): Extract from OverloadResolve.
6848         (OverloadResolve): Make robust to the MethodGroupExpr being
6849         unsorted.  Implement all the logic of Section 14.5.5.1, and
6850         support overloading of methods from multiple applicable types.
6851         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
6852
6853         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
6854         (RealError, Warning): Append type of report to related symbol.
6855
6856 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
6857
6858         * enum.cs: Fixed CLS-Compliance checks for enum members.
6859         Error tests cs3008-8.cs, cs3014-8.cs
6860
6861 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6862
6863         Fixed bug #62342, #63102
6864         * class.cs: ImplementIndexer uses member.IsExplicitImpl
6865         like ImplementMethod.
6866
6867 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
6868
6869         * attribute.cs (Attribute.GetAttributeArgumentExpression):
6870         Fixed bug #65170.
6871
6872 2004-09-02  Martin Baulig  <martin@ximian.com>
6873
6874         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
6875         TypeManager.GetArgumentTypes() rather than calling GetParameters()
6876         on the MethodBase.
6877
6878 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
6879
6880         C# 2.0 Static classes implemented
6881
6882         * class.cs (TypeContainer): instance_constructors,
6883         initialized_fields, initialized_static_fields,
6884         default_constructor, base_inteface_types are protected to be
6885         accessible from StaticClass.
6886         (TypeContainer.DefineDefaultConstructor): New virtual method
6887         for custom default constructor generating
6888         (StaticClass): New class to handle "Static classes" feature.
6889
6890         * cs-parser.jay: Handle static keyword on class like instance
6891         of StaticClass.
6892
6893         * driver.cs: Added "/langversion" command line switch with two
6894         options (iso-1, default).
6895
6896 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
6897
6898         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
6899
6900 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
6901
6902         * delegate.cs: Style.
6903
6904 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
6905
6906         * delegate.cs: Add seperate instance expr field for miguel.
6907
6908 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6909
6910         * PointerArithmetic (Resolve): make sure we are not doing
6911         pointer arith on void*. Also, make sure we are resolved
6912         by not setting eclass until resolve.
6913
6914         All callers: Make sure that PointerArithmetic gets resolved.
6915
6916 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
6917
6918         * ArrayCreation (LookupType): If the type does not resolve 
6919         to an array, give an error.
6920
6921 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
6922
6923         * statement.cs (Try.Resolve): Fixed bug #64222
6924
6925 2004-08-27  Martin Baulig  <martin@ximian.com>
6926
6927         * class.cs
6928         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
6929         crash here.     
6930
6931 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6932
6933         * ecore.cs (Constantify): Get underlying type via
6934         System.Enum.GetUnderlyingType to avoid StackOverflow on the
6935         Windows in special cases.
6936
6937 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
6938
6939         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
6940         for obtaining also private methods.
6941         (GetRemoveMethod): Used GetRemoveMethod (true)
6942         for obtaining also private methods.
6943
6944 2004-08-24  Martin Baulig  <martin@ximian.com>
6945
6946         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
6947         MethodAttributes.HideBySig for operators.
6948
6949 2004-08-23  Martin Baulig  <martin@ximian.com>
6950
6951         Back to the old error reporting system :-)
6952
6953         * report.cs (Message): Removed.
6954         (Report.MessageData, ErrorData, WarningData): Removed.
6955         (Report.Error, Warning): Back to the old system.
6956
6957 2004-08-23  Martin Baulig  <martin@ximian.com>
6958
6959         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
6960
6961         * class.cs (TypeContainer.ParentContainer): New public virtual
6962         method; replaces the explicit interface implementation.
6963         (ClassPart.ParentContainer): Override.
6964
6965 2004-08-23  Martin Baulig  <martin@ximian.com>
6966
6967         * statement.cs (Switch): Added support for constant switches; see
6968         #59428 or test-285.cs.
6969
6970 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6971
6972         Fixed bug #62740.
6973         * statement.cs (GetEnumeratorFilter): Removed useless
6974         logic because C# specs is strict. GetEnumerator must be
6975         public.
6976
6977 2004-08-22  Martin Baulig  <martin@ximian.com>
6978
6979         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6980         a switch and may break, reset the barrier.  Fixes #59867.
6981
6982 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
6983
6984         CLS-Compliance speed up (~5% for corlib)
6985
6986         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
6987         New method. Tests container for CLS-Compliant names
6988
6989         * class.cs (TypeContainer.VerifyClsName): New method.
6990         Checks whether container name is CLS Compliant.
6991         (Constructor): Implements IMethodData.
6992
6993         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
6994         low-case table for CLS Compliance test.
6995         (MemberCache.VerifyClsParameterConflict): New method.
6996         Checks method parameters for CS3006 error.
6997
6998         * enum.cs (EnumMember): Is derived from MemberCore.
6999         (Enum.VerifyClsName): Optimized for better performance.
7000
7001 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7002
7003         * report.cs: Renamed Error_T to Error and changed all
7004         references.
7005
7006 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7007
7008         * class.cs (TypeContainer.IndexerArrayList): New inner class
7009         container for indexers.
7010         (TypeContainer.DefaultIndexerName): New constant for default
7011         indexer name. Replaced all "Item" with this constant.
7012         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7013
7014         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7015         DefaultMemberAttribute constructor.
7016
7017 2004-08-05  Martin Baulig  <martin@ximian.com>
7018
7019         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7020         Fix bug #59429.
7021
7022 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7023
7024         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7025         multi platforms problem.
7026
7027         * compiler.csproj: Included shared files.
7028
7029 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7030
7031         Fix bug 60333, 55971 in the more general way
7032         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7033         Added arg_type argument for constant conversion.
7034         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7035
7036 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7037
7038         Fix bug #59760
7039         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7040         OperatorArrayList, MethodCoreArrayList for typecontainer
7041         containers. Changed class member types to these new types.
7042         (MethodArrayList.DefineMembers): Added test for CS0659.
7043
7044 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7045
7046         * cfold.cs: Synchronize the folding with the code in expression.cs
7047         Binary.DoNumericPromotions for uint operands.
7048
7049         * attribute.cs: Revert patch from Raja, it introduced a regression
7050         while building Blam-1.2.1 (hard to isolate a test case).
7051
7052 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7053
7054         Fix for #55382
7055         * class.cs:
7056         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7057         name collision.
7058         (MethodCore.parent_method): New member. The method we're overriding
7059         if this is an override method.
7060         (MethodCore.CheckBase): Moved from Method class and made common.
7061         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7062         private.
7063         (MethodCore.CheckForDuplications): New abstract method. For custom
7064         member duplication search in a container
7065         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7066         method and its return type.
7067         (Event.conflict_symbol): New member. Symbol with same name in the
7068         parent class.
7069
7070         * decl.cs:
7071         (MemberCache.FindMemberWithSameName): New method. The method
7072         is looking for conflict with inherited symbols.
7073
7074 2004-08-04  Martin Baulig  <martin@ximian.com>
7075
7076         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7077
7078         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7079
7080 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7081
7082         * report.cs (Message): New enum for better error, warning reference in
7083         the code.
7084         (MessageData): New inner abstract class. It generally handles printing of
7085         error and warning messages.
7086         Removed unused Error, Warning, Message methods.
7087
7088 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7089
7090         Fix for cs0592-8.cs test
7091         * attribute.cs
7092         (Attributable.ValidAttributeTargets): Made public.
7093         (Attribute.ExplicitTarget): New member for explicit target value.
7094         (Attribute.CheckTargets): Now we translate explicit attribute
7095         target to Target here.
7096
7097 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7098
7099         * ecore.cs (MethodGroupExpr): new IsBase property.
7100
7101         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7102
7103         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7104         rather than an instance expr.
7105
7106         (DelegateCreation.Emit): Use the method group rather than
7107         the instance expression. Also, if you have base.Foo as the
7108         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7109
7110         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7111
7112         (NewDelegate.DoResolve): Only check for the existance of Invoke
7113         if the method is going to be needed. Use MethodGroupExpr.
7114
7115         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7116
7117         * expression.cs: For pointer arith., make sure to use
7118         the size of the type, not the size of the pointer to
7119         the type.
7120
7121 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7122
7123         Fix for #60722
7124         * class.cs (Class): Added error CS0502 test.
7125
7126 2004-08-03  John Luke  <jluke@cfl.rr.com>
7127             Raja R Harinath  <rharinath@novell.com>
7128
7129         Fix for #60997.
7130         * attribute.cs (Attribute.complained_before): New flag.
7131         (Attribute.ResolveType, Attribute.Resolve),
7132         (Attribute.DefinePInvokeMethod): Set it.
7133         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7134         
7135 2004-08-03  Martin Baulig  <martin@ximian.com>
7136
7137         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7138         use a user-defined operator; we still need to do numeric
7139         promotions in case one argument is a builtin type and the other
7140         one has an implicit conversion to that type.  Fixes #62322.
7141
7142 2004-08-02  Martin Baulig  <martin@ximian.com>
7143
7144         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7145         (LocalInfo.IsThis): New public property.
7146         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7147
7148 2004-08-01  Martin Baulig  <martin@ximian.com>
7149
7150         * class.cs (TypeContainer.GetClassBases): Don't set the default
7151         here since we may get called from GetPartialBases().
7152         (TypeContainer.DefineType): If GetClassBases() didn't return a
7153         parent, use the default one.
7154
7155 2004-07-30  Duncan Mak  <duncan@ximian.com>
7156
7157         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7158
7159 2004-07-30  Martin Baulig  <martin@ximian.com>
7160
7161         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7162
7163         * class.cs (SourceMethod): New public class, derive from the
7164         symbol writer's ISourceMethod.
7165         (Method): Use the new symbol writer API.
7166
7167         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7168         as argument and use the new symbol writer.
7169
7170         * location.cs
7171         (SourceFile): Implement the symbol writer's ISourceFile.
7172         (Location.SymbolDocument): Removed.
7173         (Location.SourceFile): New public property.
7174
7175         * symbolwriter.cs: Use the new symbol writer API.
7176
7177 2004-07-30  Raja R Harinath  <rharinath@novell.com>
7178
7179         * Makefile (install-local): Remove.  Functionality moved to
7180         executable.make.
7181
7182 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
7183
7184         * Makefile: Install mcs.exe.config file together with mcs.exe.
7185         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7186         correct runtime version.
7187         
7188 2004-07-25  Martin Baulig  <martin@ximian.com>
7189
7190         * class.cs
7191         (TypeContainer.RegisterOrder): Removed, this was unused.
7192         (TypeContainer, interface_order): Removed.
7193         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7194         TypeContainer as argument since we can also be called with a
7195         `PartialContainer' for a partial class/struct/interface.
7196         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7197         of checking whether we're an `Interface' - we could be a
7198         `PartialContainer'.
7199         (PartialContainer.Register): Override; call
7200         AddClass()/AddStruct()/AddInterface() on our parent.
7201
7202         * cs-parser.jay (interface_member_declaration): Add things to the
7203         `current_container', not the `current_class'.
7204
7205         * rootcontext.cs (RegisterOrder): The overloaded version which
7206         takes an `Interface' was unused, removed.
7207
7208         * typemanager.cs (TypeManager.LookupInterface): Return a
7209         `TypeContainer', not an `Interface'.
7210         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7211         contain a `PartialContainer' for an interface, so check it's
7212         `Kind' to figure out what it is.
7213
7214 2004-07-25  Martin Baulig  <martin@ximian.com>
7215
7216         * class.cs (Class.DefaultTypeAttributes): New public constant.
7217         (Struct.DefaultTypeAttributes): Likewise.
7218         (Interface.DefaultTypeAttributes): Likewise.
7219         (PartialContainer.TypeAttr): Override this and add the
7220         DefaultTypeAttributes.
7221
7222 2004-07-25  Martin Baulig  <martin@ximian.com>
7223
7224         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7225         we can just use the `Parent' field instead.
7226
7227 2004-07-25  Martin Baulig  <martin@ximian.com>
7228
7229         * class.cs (TypeContainer.Emit): Renamed to EmitType().
7230
7231 2004-07-25  Martin Baulig  <martin@ximian.com>
7232
7233         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7234         our parts before defining any methods.
7235         (TypeContainer.VerifyImplements): Make this virtual.
7236         (ClassPart.VerifyImplements): Override and call VerifyImplements()
7237         on our PartialContainer.
7238
7239 2004-07-25  Martin Baulig  <martin@ximian.com>
7240
7241         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7242
7243         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7244         argument, we can just use the `Parent' field instead.
7245
7246         * class.cs
7247         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
7248         (MemberBase.DoDefine): Likewise.
7249
7250 2004-07-24  Martin Baulig  <martin@ximian.com>
7251
7252         * decl.cs (MemberCore.Parent): New public field.
7253         (DeclSpace.Parent): Moved to MemberCore.
7254
7255         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7256         (MemberBase.ctor): Added TypeContainer argument, pass it to our
7257         parent's .ctor.
7258         (FieldBase, Field, Operator): Likewise.
7259         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7260         (EventField, Event): Likewise.
7261
7262 2004-07-23  Martin Baulig  <martin@ximian.com>
7263
7264         * class.cs (PartialContainer): New public class.
7265         (ClassPart): New public class.
7266         (TypeContainer): Added support for partial classes.
7267         (TypeContainer.GetClassBases): Splitted some of the functionality
7268         out into GetNormalBases() and GetPartialBases().
7269
7270         * cs-tokenizer.cs (Token.PARTIAL): New token.
7271         (Tokenizer.consume_identifier): Added some hacks to recognize
7272         `partial', but only if it's immediately followed by `class',
7273         `struct' or `interface'.
7274
7275         * cs-parser.jay: Added support for partial clases.
7276
7277 2004-07-23  Martin Baulig  <martin@ximian.com>
7278
7279         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
7280         a `DeclSpace' and also made it readonly.
7281         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
7282         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
7283         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
7284
7285         * cs-parser.jay: Pass the `current_class', not the
7286         `current_container' (at the moment, this is still the same thing)
7287         to a new Method, Property, Event, Indexer or Constructor.
7288
7289 2004-07-23  Martin Baulig  <martin@ximian.com>
7290
7291         * cs-parser.jay (CSharpParser): Added a new `current_class' field
7292         and removed the `current_interface' one.
7293         (struct_declaration, class_declaration, interface_declaration):
7294         Set `current_class' to the newly created class/struct/interface;
7295         set their `Bases' and call Register() before parsing their body.
7296
7297 2004-07-23  Martin Baulig  <martin@ximian.com>
7298
7299         * class.cs (Kind): New public enum.
7300         (TypeContainer): Made this class abstract.
7301         (TypeContainer.Kind): New public readonly field.
7302         (TypeContainer.CheckDef): New public method; moved here from
7303         cs-parser.jay.
7304         (TypeContainer.Register): New public abstract method.
7305         (TypeContainer.GetPendingImplementations): New public abstract
7306         method.
7307         (TypeContainer.GetClassBases): Removed the `is_class' and
7308         `is_iface' parameters.
7309         (TypeContainer.DefineNestedTypes): Formerly known as
7310         DoDefineType().
7311         (ClassOrStruct): Made this class abstract.
7312
7313         * tree.cs (RootTypes): New public type. 
7314
7315 2004-07-20  Martin Baulig  <martin@ximian.com>
7316
7317         * tree.cs (Tree.RecordNamespace): Removed.
7318         (Tree.Namespaces): Removed.
7319
7320         * rootcontext.cs (RootContext.IsNamespace): Removed.
7321
7322         * cs-parser.jay (namespace_declaration): Just create a new
7323         NamespaceEntry here.
7324
7325 2004-07-20  Martin Baulig  <martin@ximian.com>
7326
7327         * statement.cs (ExceptionStatement): New abstract class.  This is
7328         now used as a base class for everyone who's using `finally'.
7329         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
7330         our local variables before using them.
7331
7332         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
7333         virtual method.  This is used by Yield.Resolve() to "steal" an
7334         outer block's `finally' clauses.
7335         (FlowBranchingException): The .ctor now takes an ExceptionStatement
7336         argument.
7337
7338         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
7339         version which takes an ExceptionStatement.  This version must be
7340         used to create exception branchings.
7341
7342         * iterator.cs
7343         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
7344         (Iterator.EmitMoveNext): Added exception support; protect the
7345         block with a `fault' clause, properly handle 'finally' clauses.
7346         (Iterator.EmitDispose): Run all the `finally' clauses here.
7347
7348 2004-07-20  Martin Baulig  <martin@ximian.com>
7349
7350         * iterator.cs: This is the first of a set of changes in the
7351         iterator code.  Match the spec more closely: if we're an
7352         IEnumerable, then GetEnumerator() must be called.  The first time
7353         GetEnumerator() is called, it returns the current instance; all
7354         subsequent invocations (if any) must create a copy.
7355
7356 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
7357
7358         * expression.cs: Resolve the constant expression before returning
7359         it. 
7360
7361 2004-07-19  Martin Baulig  <martin@ximian.com>
7362
7363         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
7364         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
7365         the return type of the new EmitContext.
7366
7367 2004-07-18  Martin Baulig  <martin@ximian.com>
7368
7369         * class.cs (Property.Define): Fix iterators.
7370
7371         * iterators.cs (Iterator.Define): Moved the
7372         `container.AddInterator (this)' call here from the .ctor; only do
7373         it if we resolved successfully.
7374
7375 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
7376
7377         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
7378         `true' for preprocessing directives that we parse.  The return
7379         value indicates whether we should return to regular tokenizing or
7380         not, not whether it was parsed successfully.
7381
7382         In the past if we were in: #if false ... #line #endif, we would
7383         resume parsing after `#line'.  See bug 61604.
7384
7385         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
7386         building: IsEnumType should return true only for enums, not for
7387         enums or System.Enum itself.  This fixes #61593.
7388
7389         Likely what happened is that corlib was wrong: mcs depended on
7390         this bug in some places.  The bug got fixed, we had to add the
7391         hack, which caused bug 61593.
7392
7393         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
7394         that was a workaround for the older conditions.
7395
7396 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
7397
7398         * assign.cs: IAssignMethod has a new interface, as documented
7399         inline. All assignment code now uses this new api.
7400
7401         * ecore.cs, expression.cs: All classes which implement
7402         IAssignMethod now use the new interface.
7403
7404         * expression.cs (Invocation): add a hack to EmitCall so that
7405         IndexerAccess can be the target of a compound assignment without
7406         evaluating its arguments twice.
7407
7408         * statement.cs: Handle changes in Invocation api.
7409
7410 2004-07-16  Martin Baulig  <martin@ximian.com>
7411
7412         * iterators.cs: Rewrote this.  We're now using one single Proxy
7413         class for both the IEnumerable and the IEnumerator interface and
7414         `Iterator' derives from Class so we can use the high-level API.
7415
7416         * class.cs (TypeContainer.AddIterator): New method.
7417         (TypeContainer.DoDefineType): New protected virtual method, which
7418         is called from DefineType().
7419         (TypeContainer.DoDefineMembers): Call DefineType() and
7420         DefineMembers() on all our iterators.
7421         (TypeContainer.Emit): Call Emit() on all our iterators.
7422         (TypeContainer.CloseType): Call CloseType() on all our iterators.
7423
7424         * codegen.cs (EmitContext.CurrentIterator): New public field.
7425
7426 2004-07-15  Martin Baulig  <martin@ximian.com>
7427
7428         * typemanager.cs
7429         (TypeManager.not_supported_exception_type): New type.   
7430
7431 2004-07-14  Martin Baulig  <martin@ximian.com>
7432
7433         * iterators.cs: Use real error numbers.
7434
7435 2004-07-14  Martin Baulig  <martin@ximian.com>
7436
7437         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
7438         requires this to be a System.Collection.IEnumerable and not a
7439         class implementing that interface.
7440         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
7441
7442 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
7443
7444         * class.cs: Fixed previous fix, it broke some error tests.
7445
7446 2004-07-12  Martin Baulig  <martin@ximian.com>
7447
7448         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
7449         Fixes #61293.
7450
7451 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
7452
7453         * assign.cs (LocalTemporary): Add new argument: is_address,If
7454         `is_address' is true, then the value that we store is the address
7455         to the real value, and not the value itself.
7456         
7457         * ecore.cs (PropertyExpr): use the new local temporary
7458         stuff to allow us to handle X.Y += z (where X is a struct)
7459
7460 2004-07-08  Martin Baulig  <martin@ximian.com>
7461
7462         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
7463         not always return, just like we're doing in Using.Resolve().
7464
7465 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
7466
7467         * cs-parser.jay (fixed_statement): flag this as Pinned.
7468
7469 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
7470
7471         * typemanager.cs (TypeManager): Removed MakePinned method, this
7472         mechanism is replaced with the .NET 2.x compatible mechanism of
7473         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
7474
7475         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
7476         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
7477         `IsFixed' property which has a different meaning.
7478
7479 2004-07-02  Raja R Harinath  <rharinath@novell.com>
7480
7481         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
7482         visible from inside a nested class, not just the names of the
7483         immediately enclosing class.
7484         Fix for bug #60730.
7485
7486 2004-06-24  Raja R Harinath  <rharinath@novell.com>
7487
7488         * expression.cs (BetterConversion): Remove buggy special-case
7489         handling of "implicit constant expression conversions".  At this
7490         point, we already know that the conversion is possible -- we're
7491         only checking to see which is better.
7492
7493 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7494
7495         * cs-parser.jay: Added error CS0210 test.
7496
7497 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7498
7499         * cs-parser.jay: Added error CS0134 test.
7500
7501 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7502
7503         Fix bug #52507
7504         * cs-parser.jay: Added error CS0145 test.
7505
7506 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
7507
7508         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
7509
7510 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
7511         
7512         * expression.cs (StackAlloc.Resolve): The argument may not
7513         be a constant; deal with this case.
7514         
7515 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
7516
7517         * attribute.cs (IndexerName_GetIndexerName): Renamed to
7518         GetIndexerAttributeValue.
7519         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
7520
7521         * class.cs (Indexer.Define): Added error tests for CS0415,
7522         CS0609.
7523
7524 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
7525
7526         * attribute.cs (Attribute.Resolve): Keep field code in sync with
7527         property code.
7528
7529 2004-06-23  Martin Baulig  <martin@ximian.com>
7530
7531         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
7532         neither return nor throw, reset the barrier as well.  Fixes #60457.
7533
7534 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
7535
7536         * class.cs : EventAttributes is now set to None by default.
7537           This fixes bug #60459.
7538
7539 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7540
7541         Fix bug #60219
7542         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7543         Don't throw exception but return null (it's sufficient now).
7544
7545 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
7546
7547         * typemanager.cs (GetArgumentTypes): Faster implementation.
7548
7549 2004-06-18  Martin Baulig  <martin@ximian.com>
7550
7551         * attribute.cs (Attribute.Resolve): Check whether we're an
7552         EmptyCast which a Constant child.  Fixes #60333.
7553
7554 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
7555
7556         * statement.cs (EmitCollectionForeach): Account for the fact that
7557         not all valuetypes are in areas which we can take the address of.
7558         For these variables, we store to a temporary variable. Also, make
7559         sure that we dont emit a `callvirt' on a valuetype method.
7560
7561 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7562
7563         * expression.cs (StackAlloc.DoReSolve): Added test for
7564         negative parameter (CS0247).
7565
7566 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7567
7568         Fix bug #59792
7569         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
7570
7571 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
7572
7573         Fix bug #59781
7574         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
7575         ulong.
7576
7577 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7578
7579         Fix bug #58254 & cs1555.cs, cs1556.cs
7580         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
7581
7582 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
7583
7584         * cs-parser.jay: Added error CS1669 test for indexers.
7585
7586 2004-06-11  Martin Baulig  <martin@ximian.com>
7587
7588         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
7589         call this twice: for params and varargs methods.
7590
7591 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7592
7593         * class.cs:
7594         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
7595
7596 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7597
7598         * attribute.cs (Attribute.GetValidTargets): Made public.
7599
7600         * class.cs: 
7601         (AbstractPropertyEventMethod): New class for better code sharing.
7602         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
7603         CS1667 report.
7604         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
7605
7606 2004-06-11  Raja R Harinath  <rharinath@novell.com>
7607
7608         Fix bug #59477.
7609         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
7610         that the call to Resolve is part of a MemberAccess.
7611         (Expression.Resolve): Use it for SimpleName resolution.
7612         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
7613         Add 'intermediate' boolean argument.
7614         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
7615         error message when the SimpleName can be resolved ambiguously
7616         between an expression and a type.
7617         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
7618         public.
7619         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
7620         call on the left-side.
7621
7622 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7623
7624         * class.cs:
7625         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
7626
7627 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7628
7629         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
7630
7631 2004-06-11  Martin Baulig  <martin@ximian.com>
7632
7633         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
7634         varargs methods if applicable.
7635
7636 2004-06-11  Martin Baulig  <martin@ximian.com>
7637
7638         * expression.cs (Invocation.EmitCall): Don't use
7639         `method.CallingConvention == CallingConventions.VarArgs' since the
7640         method could also have `CallingConventions.HasThis'.
7641
7642 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
7643
7644         * class.cs (Event.GetSignatureForError): Implemented.
7645         Fixed crash in error test cs3010.cs
7646
7647 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
7648
7649         * cs-tokenizer.cs: Change the way we track __arglist to be
7650         consistent with the other keywords.
7651
7652 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
7653
7654         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
7655         tomorrow.
7656
7657 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
7658
7659         * codegen.cs: Check that all referenced assemblies have a strongname
7660         before strongnaming the compiled assembly. If not report error CS1577.
7661         Fix bug #56563. Patch by Jackson Harper.
7662         * typemanager.cs: Added a method to return all referenced assemblies.
7663         Fix bug #56563. Patch by Jackson Harper.
7664
7665 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
7666
7667         * class.cs:
7668         (Method.ApplyAttributeBuilder): Moved and added conditional
7669         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
7670
7671         * delegate.cs:
7672         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
7673
7674 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
7675
7676         Fixed #59640
7677         * class.cs: (EventField.attribute_targets): Changed default target.
7678
7679 2004-06-08  Martin Baulig  <martin@ximian.com>
7680
7681         * expression.cs (Invocation.EmitCall): Enable varargs methods.
7682
7683 2004-06-08  Martin Baulig  <martin@ximian.com>
7684
7685         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
7686
7687 2004-06-07  Martin Baulig  <martin@ximian.com>
7688
7689         Added support for varargs methods.
7690
7691         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
7692         keyword.
7693
7694         * cs-parser.jay: Added support for `__arglist'.
7695
7696         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
7697
7698         * expression.cs (Argument.AType): Added `ArgList'.
7699         (Invocation): Added support for varargs methods.
7700         (ArglistAccess): New public class.
7701         (Arglist): New public class.
7702
7703         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
7704
7705         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
7706         a method's top-level block if the method has varargs.
7707
7708         * support.cs (ReflectionParameters, InternalParameters): Added
7709         support for varargs methods.    
7710
7711 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
7712
7713         * class.cs: Provide location in indexer error report.
7714
7715         * driver.cs: Use standard names.
7716
7717         * namespace.cs: Catch the use of using after a namespace has been
7718         declared also on using aliases.
7719
7720 2004-06-03  Raja R Harinath  <rharinath@novell.com>
7721
7722         Bug #50820.
7723         * typemanager.cs (closure_private_ok, closure_invocation_type)
7724         (closure_qualifier_type, closure_invocation_assembly)
7725         (FilterWithClosure): Move to ...
7726         (Closure): New internal nested class.
7727         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
7728         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
7729         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
7730         (MemberLookup, MemberLookupFailed): Use it.
7731         * expression.cs (New.DoResolve): Treat the lookup for the
7732         constructor as being qualified by the 'new'ed type.
7733         (Indexers.GetIndexersForTypeOrInterface): Update.
7734
7735 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
7736
7737         * attribute.cs
7738         (GetConditionalAttributeValue): New method. Returns
7739         condition of ConditionalAttribute.
7740         (SearchMulti): New method.  Returns all attributes of type 't'.
7741         Use it when attribute is AllowMultiple = true.
7742         (IsConditionalMethodExcluded): New method.
7743
7744         * class.cs
7745         (Method.IsExcluded): Implemented. Returns true if method has conditional
7746         attribute and the conditions is not defined (method is excluded).
7747         (IMethodData): Extended interface for ConditionalAttribute support.
7748         (PropertyMethod.IsExcluded): Implemented.
7749
7750         * decl.cs
7751         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
7752
7753         * expression.cs
7754         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
7755         on the method.
7756
7757 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
7758
7759         * expression.cs (ArrayCreationExpression): Make this just an
7760         `expression'. It can't be a statement, so the code here was
7761         dead.
7762
7763 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
7764
7765         Fixed #59072
7766         * typemanager.cs (GetFullNameSignature): New method for
7767         MethodBase types.
7768
7769 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
7770
7771         Fixed #56452
7772         * class.cs (MemberBase.GetSignatureForError): New virtual method.
7773         Use this method when MethodBuilder is null.
7774         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
7775         Added test for error CS0626 (MONO reports error for this situation).
7776         (IMethodData.GetSignatureForError): Extended interface.
7777
7778 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
7779
7780         * attribute.cs
7781         (AttributeTester.GetObsoleteAttribute): Returns instance of
7782         ObsoleteAttribute when type is obsolete.
7783
7784         * class.cs
7785         (TypeContainer.VerifyObsoleteAttribute): Override.
7786         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
7787         (MethodCode.VerifyObsoleteAttribute): Override.
7788         (MemberBase.VerifyObsoleteAttribute): Override.
7789
7790         * decl.cs
7791         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
7792         and report proper error.
7793
7794         *delegate.cs
7795         Delegate.VerifyObsoleteAttribute): Override.
7796
7797         * ecore.cs
7798         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
7799         and report proper error.
7800         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
7801
7802         * enum.cs
7803         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
7804         and enum member.
7805
7806         * expression.cs
7807         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
7808         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
7809         Added test for ObsoleteAttribute.
7810
7811         * statement.cs
7812         (Catch): Derived from Statement.
7813
7814 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
7815  
7816         Fixed bug #59071 & cs0160.cs
7817  
7818         * statement.cs (Try.Resolve): Check here whether order of catch
7819         clauses matches their dependencies.
7820
7821 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
7822
7823         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
7824         caused a regression: #59343.  Referencing nested classes from an
7825         assembly stopped working.
7826
7827 2004-05-31  Martin Baulig  <martin@ximian.com>
7828
7829         MCS is now frozen for beta 2.
7830
7831 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7832
7833         * convert.cs: add a trivial cache for overload operator resolution.
7834
7835 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7836
7837         * decl.cs: If possible, use lookuptypedirect here. We can only do
7838         this if there is no `.' after the namespace. Avoids using
7839         LookupType, which does lots of slow processing.
7840         (FindNestedType) New method, does what it says :-).
7841         * namespace.cs: use LookupTypeDirect.
7842         * rootcontext.cs: use membercache, if possible.
7843         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
7844
7845 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7846
7847         * expression.cs:
7848         According to the spec, 
7849
7850         In a member access of the form E.I, if E is a single identifier,
7851         and if the meaning of E as a simple-name (§7.5.2) is a constant,
7852         field, property, localvariable, or parameter with the same type as
7853         the meaning of E as a type-name (§3.8), then both possible
7854         meanings of E are permitted.
7855
7856         We did not check that E as a simple-name had the same type as E as
7857         a type name.
7858
7859         This trivial check gives us 5-7% on bootstrap time.
7860
7861 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
7862
7863         * expression.cs (Invocation.OverloadResolve): Avoid the
7864         use of hashtables and boxing here by allocating on demand.
7865
7866 2004-05-30  Martin Baulig  <martin@ximian.com>
7867
7868         * rootcontext.cs (RootContext.LookupType): Don't cache things if
7869         we're doing a silent lookup.  Don't try to lookup nested types in
7870         TypeManager.object_type (thanks to Ben Maurer).
7871
7872 2004-05-30  Martin Baulig  <martin@ximian.com>
7873
7874         Committing a patch from Ben Maurer.
7875
7876         * rootcontext.cs (RootContext.LookupType): Cache negative results.
7877
7878 2004-05-29  Martin Baulig  <martin@ximian.com>
7879
7880         * class.cs (IMethodData.ShouldIgnore): New method.
7881
7882         * typemanager.cs (TypeManager.MethodFlags): Don't take a
7883         `Location' argument, we don't need it anywhere.  Use
7884         `IMethodData.ShouldIgnore ()' instead of
7885         `MethodData.GetMethodFlags ()'.
7886         (TypeManager.AddMethod): Removed.
7887         (TypeManager.AddMethod2): Renamed to AddMethod.
7888
7889 2004-05-29  Martin Baulig  <martin@ximian.com>
7890
7891         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
7892
7893         * convert.cs (Convert.ImplicitReferenceConversion): If we're
7894         converting from a class type S to an interface type and we already
7895         have an object on the stack, don't box it again.  Fixes #52578.
7896
7897 2004-05-29  Martin Baulig  <martin@ximian.com>
7898
7899         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
7900         Added support for `params' parameters.  Fixes #59267.
7901
7902 2004-05-29  Martin Baulig  <martin@ximian.com>
7903
7904         * literal.cs (NullPointer): Provide a private .ctor which sets
7905         `type' to TypeManager.object_type.  Fixes #59048.
7906
7907 2004-05-29  Martin Baulig  <martin@ximian.com>
7908
7909         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
7910         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
7911
7912         * ecore.cs (EventExpr.instance_expr): Make the field private.
7913
7914 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
7915
7916         Fixed bug #50080 & cs0214-2.cs
7917         * expression.cs (Cast.DoResolve): Check unsafe context here.
7918         
7919         * statement.cs (Resolve.DoResolve): Likewise.
7920
7921 2004-05-26  Martin Baulig  <martin@ximian.com>
7922
7923         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
7924
7925         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
7926         (RootContext.LookupType): Pass down the `silent' flag.
7927
7928 2004-05-25  Martin Baulig  <martin@ximian.com>
7929
7930         * expression.cs
7931         (MethodGroupExpr.IdenticalTypeName): New public property.
7932         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
7933         expression actually refers to a type.
7934
7935 2004-05-25  Martin Baulig  <martin@ximian.com>
7936
7937         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
7938         for #56176 and made it actually work.
7939
7940 2004-05-25  Martin Baulig  <martin@ximian.com>
7941
7942         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
7943         (FieldExpr, PropertyExpr): Override and implement
7944         CacheTemporaries.  Fixes #52279.
7945
7946 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
7947
7948         * location.cs: In the new compiler listing a file twice is a
7949         warning, not an error.
7950
7951 2004-05-24  Martin Baulig  <martin@ximian.com>
7952
7953         * enum.cs (Enum.DefineType): For the `BaseType' to be a
7954         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
7955
7956 2004-05-24  Martin Baulig  <martin@ximian.com>
7957
7958         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
7959         walking the `using' list.  Fixes #53921.
7960
7961 2004-05-24  Martin Baulig  <martin@ximian.com>
7962
7963         * const.cs (Const.LookupConstantValue): Added support for
7964         EmptyCast's; fixes #55251.
7965
7966 2004-05-24  Martin Baulig  <martin@ximian.com>
7967
7968         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
7969         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
7970         which does the CS0135 check.  The reason is that we first need to
7971         check whether the variable actually exists.
7972
7973 2004-05-24  Martin Baulig  <martin@ximian.com>
7974
7975         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
7976         than RootContext.LookupType() to find the explicit interface
7977         type.  Fixes #58584.
7978
7979 2004-05-24  Raja R Harinath  <rharinath@novell.com>
7980
7981         * Makefile: Simplify.  Use executable.make.
7982         * mcs.exe.sources: New file.  List of sources of mcs.exe.
7983
7984 2004-05-24  Anders Carlsson  <andersca@gnome.org>
7985
7986         * decl.cs:
7987         * enum.cs:
7988         Use the invariant culture when doing String.Compare for CLS case
7989         sensitivity.
7990         
7991 2004-05-23  Martin Baulig  <martin@ximian.com>
7992
7993         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
7994         don't have any dots.  Fixes #52622, added cs0246-8.cs.
7995
7996         * namespace.cs (NamespaceEntry.Lookup): Likewise.
7997         
7998 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
7999
8000         * class.cs (MemberBase.Define): Reuse MemberType member for 
8001         resolved type. Other methods can use it too.
8002
8003 2004-05-23  Martin Baulig  <martin@ximian.com>
8004
8005         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8006         the variable also exists in the current block (otherwise, we need
8007         to report a CS0103).  Fixes #58670.
8008
8009 2004-05-23  Martin Baulig  <martin@ximian.com>
8010
8011         * flowanalysis.cs (Reachability.Reachable): Compute this
8012         on-the-fly rather than storing it as a field.
8013
8014 2004-05-23  Martin Baulig  <martin@ximian.com>
8015
8016         * flowanalysis.cs (Reachability.And): Manually compute the
8017         resulting `barrier' from the reachability.      
8018        
8019 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8020
8021         Fix bug #57835
8022         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8023         instance of ObsoleteAttribute when symbol is obsolete.
8024
8025         * class.cs
8026         (IMethodData): Extended interface for ObsoleteAttribute support.
8027
8028 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8029
8030         * attribute.cs: Fix bug #55970
8031
8032 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8033
8034         Fix bug #52705
8035         * attribute.cs
8036         (GetObsoleteAttribute): New method. Creates the instance of
8037         ObsoleteAttribute.
8038         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8039         ObsoleteAttribute when member is obsolete.
8040         (AttributeTester.Report_ObsoleteMessage): Common method for
8041         Obsolete error/warning reporting.
8042
8043         * class.cs
8044         (TypeContainer.base_classs_type): New member for storing parent type.
8045
8046         * decl.cs
8047         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8048         for this MemberCore.
8049
8050 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8051
8052         * attribute.cs, const.cs: Fix bug #58590
8053
8054 2004-05-21  Martin Baulig  <martin@ximian.com>
8055
8056         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8057         out parameters if the end of the method is unreachable.  Fixes
8058         #58098. 
8059
8060 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8061
8062         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8063         Hari was right, why extra method.
8064
8065 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8066
8067         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8068
8069 2004-05-20  Martin Baulig  <martin@ximian.com>
8070
8071         Merged this back from gmcs to keep the differences to a minumum.
8072
8073         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8074         instead of a Declspace.
8075         (Attribute.ResolveType): Likewise.
8076         (Attributes.Search): Likewise.
8077         (Attributes.Contains): Likewise.
8078         (Attributes.GetClsCompliantAttribute): Likewise.
8079
8080         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8081         argument.
8082         (MethodData.ApplyAttributes): Take an EmitContext instead of a
8083         DeclSpace.
8084
8085 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8086
8087         Fix bug #58688 (MCS does not report error when the same attribute
8088         is assigned twice)
8089
8090         * attribute.cs (Attribute.Emit): Distinction between null and default.
8091
8092 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8093
8094         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8095         of a top-level attribute without an attribute target.
8096         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8097         Make non-static.
8098         (Attribute.Conditional_GetConditionName), 
8099         (Attribute.Obsolete_GetObsoleteMessage): Update.
8100         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8101         part of ScanForIndexerName.
8102         (Attribute.CanIgnoreInvalidAttribute): New function.
8103         (Attribute.ScanForIndexerName): Move to ...
8104         (Attributes.ScanForIndexerName): ... here.
8105         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8106         (Attributes.Search): New internal variant that can choose not to
8107         complain if types aren't resolved.  The original signature now
8108         complains.
8109         (Attributes.GetClsCompliantAttribute): Use internal variant, with
8110         complaints suppressed.
8111         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8112         only if it not useful.
8113         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8114         top-level for attributes that are shared between the assembly
8115         and a top-level class.
8116         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8117         * class.cs: Update to reflect changes.
8118         (DefineIndexers): Fuse loops.
8119         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8120         a couple more variants of attribute names.
8121
8122 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8123
8124         Fix bug #52585 (Implemented explicit attribute declaration)
8125
8126         * attribute.cs:
8127         (Attributable.ValidAttributeTargets): New abstract method. It gets
8128         list of valid attribute targets for explicit target declaration.
8129         (Attribute.Target): It holds target itself.
8130         (AttributeSection): Removed.
8131         (Attribute.CheckTargets): New method. It checks whether attribute
8132         target is valid for the current element.
8133
8134         * class.cs:
8135         (EventProperty): New class. For events that are declared like
8136         property (with add and remove accessors).
8137         (EventField): New class. For events that are declared like field.
8138         class.cs
8139
8140         * cs-parser.jay: Implemented explicit attribute target declaration.
8141
8142         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8143         Override ValidAttributeTargets.
8144
8145         * parameter.cs:
8146         (ReturnParameter): Class for applying custom attributes on 
8147         the return type.
8148         (ParameterAtribute): New class. Class for applying custom
8149         attributes on the parameter type.
8150
8151 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8152
8153         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8154         definitions. 
8155
8156         (Method): Allow UNSAFE here.
8157
8158         * modifiers.cs: Support unsafe reporting.
8159
8160 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8161
8162         * decl.cs: Fix bug #58478.
8163
8164 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8165
8166         * statement.cs: When checking for unreachable code on an EmptyStatement,
8167         set the location. Fixes bug #58488.
8168
8169 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8170
8171         * driver.cs: Add -pkg handling.
8172
8173         From Gonzalo: UseShelLExecute=false
8174
8175 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8176
8177         * attribute.cs:
8178         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8179         for attribute.
8180         (Attribute.IsClsCompliaceRequired): Moved to base for better
8181         accesibility.
8182         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8183         when attribute is AttributeUsageAttribute.
8184         (Attribute.GetValidTargets): Simplified.
8185         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8186         attribute for this type.
8187         (Attribute.ApplyAttributes): Method renamed to Emit and make
8188         non-static.
8189         (GlobalAttributeSection): New class for special handling of global
8190         attributes (assembly, module).
8191         (AttributeSection.Emit): New method.
8192
8193         * class.cs: Implemented Attributable abstract methods.
8194         (MethodCore.LabelParameters): Moved to Parameter class.
8195         (Accessor): Is back simple class.
8196         (PropertyMethod): Implemented Attributable abstract class.
8197         (DelegateMethod): Implemented Attributable abstract class.
8198         (Event): New constructor for disctintion between normal Event
8199         and Event with accessors.
8200
8201         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8202
8203         * codegen.cs, const.cs, decl.cs, delegate.cs:
8204         (CommonAssemblyModulClass): Implemented Attributable abstract class
8205         and simplified.
8206
8207         * enum.cs: Implement IAttributeSupport interface.
8208         (EnumMember): New class for emum members. Implemented Attributable
8209         abstract class
8210
8211         * parameter.cs:
8212         (ParameterBase): Is abstract.
8213         (ReturnParameter): New class for easier [return:] attribute handling.
8214
8215         * typemanager.cs: Removed builder_to_attr.
8216
8217 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8218
8219         Fix bug #57151.
8220         * attribute.cs (Attribute.GetPositionalValue): New function.
8221         * class.cs (TypeContainer.VerifyMembers): New function.
8222         (TypeContainer.Emit): Use it.
8223         (ClassOrStruct): New base class for Class and Struct.
8224         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8225         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8226         class.
8227         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8228         then each non-static field should have a FieldOffset attribute.
8229         Otherwise, none of the fields should have a FieldOffset attribute.
8230         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8231         and FieldOffset attributes.
8232         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8233         (TypeManager.field_offset_attribute_type): New core types.
8234         (TypeManager.InitCoreTypes): Initialize them.
8235
8236 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8237
8238         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8239         Return correct type.
8240         From bug #58270.
8241
8242 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8243
8244         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8245         be implicitly converted to ulong.
8246         
8247         * expression.cs: The logic for allowing operator &, | and ^ worked
8248         was wrong, it worked before because we did not report an error in
8249         an else branch.  Fixes 57895.
8250
8251         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8252         allow volatile fields to be reference types.
8253
8254 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8255
8256         * driver.cs: Add support for /debug-
8257
8258 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8259
8260         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8261         Add a 'complain' parameter to silence errors.
8262         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8263         silently overlooked type-resolutions.
8264         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8265         to reflect changes.
8266         (Attributes.Search): New function.
8267         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
8268         (Attributes.GetAttributeFullName): Remove hack.
8269         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
8270         Update to reflect changes.
8271         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
8272         Use Attributes.Search instead of nested loops.
8273
8274 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
8275
8276         * decl.cs:
8277         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
8278         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
8279         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
8280
8281         * report.cs: (Report.Warning): Renamed to Warning_T because of
8282         parameter collision.
8283
8284 2004-05-05  Raja R Harinath  <rharinath@novell.com>
8285
8286         * expression.cs (MemberAccess.ResolveMemberAccess):
8287         Exit with non-zero status after Report.Error.
8288         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
8289         Likewise.
8290         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
8291
8292 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8293
8294         * support.cs: Don't hang when the file is empty.
8295
8296 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
8297
8298         * support.cs: In SeekableStreamReader, compute the preamble size of the
8299           underlying stream. Position changes should take into account that initial
8300           count of bytes.
8301
8302 2004-05-03  Todd Berman  <tberman@sevenl.net>
8303
8304         * driver.cs: remove unused GetSysVersion function.
8305
8306 2004-05-03  Todd Berman  <tberman@sevenl.net>
8307
8308         * driver.cs: Remove the hack from saturday, as well as the hack
8309         from jackson (LoadAssemblyFromGac), also adds the CWD to the
8310         link_paths to get that bit proper.
8311
8312 2004-05-01  Todd Berman  <tberman@sevenl.net>
8313
8314         * driver.cs: Try a LoadFrom before a Load, this checks the current
8315         path. This is currently a bug in mono that is be fixed, however, this
8316         provides a workaround for now. This will be removed when the bug
8317         is fixed.
8318
8319 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
8320
8321         * CryptoConvert.cs: Updated to latest version. Fix issue with 
8322         incomplete key pairs (#57941).
8323
8324 2004-05-01  Todd Berman  <tberman@sevenl.net>
8325
8326         * driver.cs: Remove '.' from path_chars, now System.* loads properly
8327         from the GAC
8328
8329 2004-04-30  Jackson Harper  <jackson@ximian.com>
8330
8331         * codegen.cs: Open keys readonly.
8332         
8333 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8334
8335         * typemanager.cs: don't report cyclic struct layout when a struct
8336         contains 2 or more fields of the same type. Failed for Pango.AttrShape
8337         which has 2 Pango.Rectangle fields.
8338
8339 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8340
8341         * expression.cs: Handle IntPtr comparisons with IL code
8342         rather than a method call.
8343
8344 2004-04-29  Martin Baulig  <martin@ximian.com>
8345
8346         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
8347         the list of PropertyInfo's in class hierarchy and find the
8348         accessor.  Fixes #56013.
8349
8350 2004-04-29  Martin Baulig  <martin@ximian.com>
8351
8352         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
8353
8354 2004-04-29  Martin Baulig  <martin@ximian.com>
8355
8356         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8357
8358         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
8359
8360 2004-04-29  Martin Baulig  <martin@ximian.com>
8361
8362         * class.cs (ConstructorInitializer.Resolve): Check whether the
8363         parent .ctor is accessible.  Fixes #52146.
8364
8365 2004-04-29  Martin Baulig  <martin@ximian.com>
8366
8367         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
8368
8369         * statement.cs (Using.EmitLocalVariableDecls): Use
8370         TypeManager.idisposable_type, not typeof (IDisposable).
8371         (Foreach.EmitCollectionForeach): Added support for valuetypes.
8372
8373 2004-04-29  Martin Baulig  <martin@ximian.com>
8374
8375         * class.cs (Event.Define): Don't emit the field and don't set
8376         RTSpecialName and SpecialName for events on interfaces.  Fixes
8377         #57703. 
8378
8379 2004-04-29  Raja R Harinath  <rharinath@novell.com>
8380
8381         Refactor Attribute.ApplyAttributes.
8382         * attribute.cs (Attributable): New base class for objects that can
8383         have Attributes applied on them.
8384         (Attribute): Make AttributeUsage fields public.
8385         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
8386         (Attribute.IsInternalCall): New property.
8387         (Attribute.UsageAttr): Convert to a public read-only property.
8388         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
8389         (Attribute.ResolveType, Attribute.Resolve)
8390         (Attribute.ScanForIndexerName): Update to reflect changes.
8391         (Attribute.CheckAttributeTarget): Re-format.
8392         (Attribute.ApplyAttributes): Refactor, to various
8393         Attributable.ApplyAttributeBuilder methods.
8394         * decl.cs (MemberCore): Make Attributable.
8395         * class.cs (Accessor): Make Attributable.
8396         (MethodData.ApplyAttributes): Use proper attribute types, not
8397         attribute names.
8398         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
8399         (TypeContainer.ApplyAttributeBuilder)
8400         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
8401         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
8402         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
8403         (Operator.ApplyAttributeBuilder): New factored-out methods.
8404         * const.cs (Const.ApplyAttributeBuilder): Likewise.
8405         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
8406         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
8407         * parameter.cs (ParameterBase): New Attributable base class
8408         that can also represent Return types.
8409         (Parameter): Update to the changes.
8410
8411 2004-04-29  Jackson Harper  <jackson@ximian.com>
8412
8413         * driver.cs: Prefer the corlib system version when looking for
8414         assemblies in the GAC. This is still a hack, but its a better hack
8415         now.
8416         
8417 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
8418
8419         * decl.cs, enum.cs: Improved error 3005 reporting.
8420   
8421         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
8422         (related_symbols): New private member for list of symbols
8423         related to reported error/warning.
8424         
8425         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
8426
8427 2004-04-29  Martin Baulig  <martin@ximian.com>
8428
8429         * ecore.cs (Expression.Constantify): If we're an enum and
8430         TypeManager.TypeToCoreType() doesn't give us another type, use
8431         t.UnderlyingSystemType.  Fixes #56178.  
8432
8433 2004-04-29  Martin Baulig  <martin@ximian.com>
8434
8435         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
8436         interfaces and for each interface, only add members directly
8437         declared in that interface.  Fixes #53255.
8438
8439 2004-04-28  Martin Baulig  <martin@ximian.com>
8440
8441         * expression.cs (ConditionalLogicalOperator): Use a temporary
8442         variable for `left' to avoid that we evaluate it more than once;
8443         bug #52588.
8444
8445 2004-04-28  Martin Baulig  <martin@ximian.com>
8446
8447         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
8448         `void[]' (CS1547).
8449
8450 2004-04-28  Martin Baulig  <martin@ximian.com>
8451
8452         * statement.cs (LocalInfo.Resolve): Check whether the type is not
8453         void (CS1547).
8454
8455         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
8456         whether the type is not void (CS1547).
8457
8458 2004-04-28  Martin Baulig  <martin@ximian.com>
8459
8460         * expression.cs (Unary.DoResolveLValue): Override this and report
8461         CS0131 for anything but Operator.Indirection.
8462
8463 2004-04-28  Martin Baulig  <martin@ximian.com>
8464
8465         Committing a patch from Ben Maurer; see bug #50820.
8466
8467         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8468         check for classes.
8469
8470         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8471         classes.        
8472
8473 2004-04-28  Martin Baulig  <martin@ximian.com>
8474
8475         Committing a patch from Ben Maurer; see bug #50820.
8476
8477         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
8478         check for classes.
8479
8480         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
8481         classes.        
8482
8483 2004-04-28  Martin Baulig  <martin@ximian.com>
8484
8485         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
8486         (Block.AddLabel): Call DoLookupLabel() to only search in the
8487         current block.
8488
8489 2004-04-28  Martin Baulig  <martin@ximian.com>
8490
8491         * cfold.cs (ConstantFold.BinaryFold): Added special support for
8492         comparing StringConstants and NullLiterals in Equality and Inequality.
8493
8494 2004-04-28  Jackson Harper  <jackson@ximian.com>
8495
8496         * driver.cs: Attempt to load referenced assemblies from the
8497         GAC. This is the quick and dirty version of this method that
8498         doesnt take into account versions and just takes the first
8499         canidate found. Will be good enough for now as we will not have more
8500         then one version installed into the GAC until I update this method.
8501
8502 2004-04-28  Martin Baulig  <martin@ximian.com>
8503
8504         * typemanager.cs (TypeManager.CheckStructCycles): New public
8505         static method to check for cycles in the struct layout.
8506
8507         * rootcontext.cs (RootContext.PopulateTypes): Call
8508         TypeManager.CheckStructCycles() for each TypeContainer.
8509         [Note: We only need to visit each type once.]
8510
8511 2004-04-28  Martin Baulig  <martin@ximian.com>
8512
8513         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
8514
8515         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
8516         success and added `out object value'.  Use a `bool resolved' field
8517         to check whether we've already been called rather than
8518         `ConstantValue != null' since this breaks for NullLiterals.
8519
8520 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8521
8522         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
8523         setting of this flag, since the 'set' method may be non-public.
8524
8525 2004-04-28  Raja R Harinath  <rharinath@novell.com>
8526
8527         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
8528         check on current_vector.Block.
8529
8530 2004-04-27  Martin Baulig  <martin@ximian.com>
8531
8532         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
8533         a field initializer.  Fixes #56459.
8534
8535 2004-04-27  Martin Baulig  <martin@ximian.com>
8536
8537         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
8538         we're not attempting to use an indexer.  Fixes #52154.
8539
8540 2004-04-27  Martin Baulig  <martin@ximian.com>
8541
8542         * statement.cs (Return): Don't create a return label if we don't
8543         need it; reverts my change from January 20th.  Thanks to Ben
8544         Maurer for this.
8545
8546 2004-04-27  Martin Baulig  <martin@ximian.com>
8547
8548         According to the spec, `goto' can only leave a nested scope, but
8549         never enter it.
8550
8551         * statement.cs (Block.LookupLabel): Only lookup in the current
8552         block, don't recurse into parent or child blocks.
8553         (Block.AddLabel): Check in parent and child blocks, report
8554         CS0140/CS0158 if we find a duplicate.
8555         (Block): Removed this indexer for label lookups.
8556         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
8557         this already does the error reporting for us.
8558
8559         * flowanalysis.cs
8560         (FlowBranching.UsageVector.Block): New public variable; may be null.
8561         (FlowBranching.CreateSibling): Added `Block' argument.
8562         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
8563         label for the target of a `goto' and check whether we're not
8564         leaving a `finally'.
8565
8566 2004-04-27  Martin Baulig  <martin@ximian.com>
8567
8568         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
8569         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
8570         just for returns).
8571
8572 2004-04-27  Martin Baulig  <martin@ximian.com>
8573
8574         * statement.cs (Block.AddLabel): Also check for implicit blocks
8575         and added a CS0158 check.
8576
8577 2004-04-27  Martin Baulig  <martin@ximian.com>
8578
8579         * flowanalysis.cs (FlowBranchingLoop): New class.
8580         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
8581         UsageVector's instead of an ArrayList.
8582         (FlowBranching.Label): Likewise.
8583         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
8584         (FlowBranching.AddBreakVector): New method.
8585
8586 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
8587
8588         * attribute.cs: Small regression fix: only convert the type if we
8589         the type is different, fixes System.Drawing build.
8590
8591 2004-04-27  Martin Baulig  <martin@ximian.com>
8592
8593         * attribute.cs (Attribute.Resolve): If we have a constant value
8594         for a named field or property, implicity convert it to the correct
8595         type.
8596
8597 2004-04-27  Raja R Harinath  <rharinath@novell.com>
8598
8599         * statement.cs (Block.Block): Implicit blocks share
8600         'child_variable_names' fields with parent blocks.
8601         (Block.AddChildVariableNames): Remove.
8602         (Block.AddVariable): Mark variable as "used by a child block" in
8603         every surrounding block.
8604         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
8605         been used in a child block, complain about violation of "Invariant
8606         meaning in blocks" rule.
8607         * cs-parser.jay (declare_local_variables): Don't use
8608         AddChildVariableNames.
8609         (foreach_statement): Don't create an implicit block: 'foreach'
8610         introduces a scope.
8611
8612 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
8613
8614         * convert.cs (ImplicitNumericConversion): 0 is also positive when
8615         converting from 0L to ulong.  Fixes 57522.
8616
8617 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8618
8619         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
8620         derived class hides via 'new' keyword field from base class (test-242.cs).
8621         TODO: Handle this in the more general way.
8622         
8623         * class.cs (CheckBase): Ditto.
8624
8625 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
8626
8627         * decl.cs (caching_flags): New member for storing cached values
8628         as bit flags.
8629         (MemberCore.Flags): New enum where bit flags for caching_flags
8630         are defined.
8631         (MemberCore.cls_compliance): Moved to caching_flags.
8632         (DeclSpace.Created): Moved to caching_flags.
8633
8634         * class.cs: Use caching_flags instead of DeclSpace.Created
8635         
8636 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
8637
8638         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
8639         if we are only a derived class, not a nested class.
8640
8641         * typemanager.cs: Same as above, but do this at the MemberLookup
8642         level (used by field and methods, properties are handled in
8643         PropertyExpr).   Allow for the qualified access if we are a nested
8644         method. 
8645
8646 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
8647
8648         * class.cs: Refactoring.
8649         (IMethodData): New inteface; Holds links to parent members
8650         to avoid member duplication (reduced memory allocation).
8651         (Method): Implemented IMethodData interface.
8652         (PropertyBase): New inner classes for get/set methods.
8653         (PropertyBase.PropertyMethod): Implemented IMethodData interface
8654         (Event): New inner classes for add/remove methods.
8655         (Event.DelegateMethod): Implemented IMethodData interface.
8656
8657         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
8658         EmitContext (related to class.cs refactoring).
8659
8660 2004-04-21  Raja R Harinath  <rharinath@novell.com>
8661
8662         * delegate.cs (Delegate.VerifyApplicability): If the number of
8663         arguments are the same as the number of parameters, first try to
8664         verify applicability ignoring  any 'params' modifier on the last
8665         parameter.
8666         Fixes #56442.
8667
8668 2004-04-16  Raja R Harinath  <rharinath@novell.com>
8669
8670         * class.cs (TypeContainer.AddIndexer): Use
8671         'ExplicitInterfaceName' to determine if interface name was
8672         explicitly specified.  'InterfaceType' is not initialized at this time.
8673         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
8674         Indexers array is already in the required order.  Initialize
8675         'IndexerName' only if there are normal indexers.
8676         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
8677         (TypeContainer.Emit): Emit DefaultMember attribute only if
8678         IndexerName is initialized.
8679         Fixes #56300.
8680
8681 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
8682
8683         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
8684         Fixes #57007
8685
8686 2004-04-15  Raja R Harinath  <rharinath@novell.com>
8687
8688         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
8689         attributes.
8690         Fix for #56456.
8691
8692         * attribute.cs (Attribute.Resolve): Check for duplicate named
8693         attributes.
8694         Fix for #56463.
8695
8696 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
8697
8698         * iterators.cs (MarkYield): track whether we are in an exception,
8699         and generate code accordingly.  Use a temporary value to store the
8700         result for our state.
8701
8702         I had ignored a bit the interaction of try/catch with iterators
8703         since their behavior was not entirely obvious, but now it is
8704         possible to verify that our behavior is the same as MS .NET 2.0
8705
8706         Fixes 54814
8707
8708 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
8709
8710         * iterators.cs: Avoid creating temporaries if there is no work to
8711         do. 
8712
8713         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
8714         Enumerations, use TypeManager.EnumToUnderlying and call
8715         recursively. 
8716
8717         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
8718         bug #57013
8719
8720         (This.Emit): Use EmitContext.EmitThis to emit our
8721         instance variable.
8722
8723         (This.EmitAssign): Ditto.
8724
8725         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
8726         codepaths, we will move all the functionality into
8727         Mono.CSharp.This 
8728
8729         (FieldExpr.EmitAssign): Ditto.
8730
8731         This fixes several hidden bugs that I uncovered while doing a code
8732         review of this today.
8733
8734         * codegen.cs (EmitThis): reworked so the semantics are more clear
8735         and also support value types "this" instances.
8736
8737         * iterators.cs: Changed so that for iterators in value types, we
8738         do not pass the value type as a parameter.  
8739
8740         Initialization of the enumerator helpers is now done in the caller
8741         instead of passing the parameters to the constructors and having
8742         the constructor set the fields.
8743
8744         The fields have now `assembly' visibility instead of private.
8745
8746 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
8747
8748         * expression.cs (Argument.Resolve): Check if fields passed as ref
8749         or out are contained in a MarshalByRefObject.
8750
8751         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
8752         another compiler type.
8753
8754 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8755
8756         * class.cs (Indexer.Define): use the new name checking method.
8757         Also, return false on an error.
8758         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
8759         (is_identifier_[start/part]_character): make static.
8760
8761 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
8762
8763         * expression.cs (Binary.ResolveOperator): Do no append strings
8764         twice: since we can be invoked more than once (array evaluation)
8765         on the same concatenation, take care of this here.  Based on a fix
8766         from Ben (bug #56454)
8767
8768 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
8769
8770         * codegen.cs: Fix another case where CS1548 must be reported (when 
8771         delay-sign isn't specified and no private is available #56564). Fix
8772         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
8773         error when MCS is used on the MS runtime and we need to delay-sign 
8774         (which seems unsupported by AssemblyBuilder - see #56621).
8775
8776 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
8777
8778         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
8779         (TypeManager.ComputeNamespaces): Faster implementation for
8780         Microsoft runtime.
8781
8782         * compiler.csproj: Updated AssemblyName to mcs.
8783
8784 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
8785
8786         * rootcontext.cs: Add new types to the boot resolution.
8787
8788         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
8789         MulticastDelegate is not allowed.
8790
8791         * typemanager.cs: Add new types to lookup: System.TypedReference
8792         and ArgIterator.
8793
8794         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
8795         check for TypedReference or ArgIterator, they are not allowed. 
8796
8797         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
8798         makes us properly catch 1510 in some conditions (see bug 56016 for
8799         details). 
8800
8801 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
8802
8803         * CryptoConvert.cs: update from corlib version
8804         with endian fixes.
8805
8806 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
8807
8808         * class.cs (Indexer.Define): Check indexername declaration
8809
8810 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
8811
8812         * attribute.cs (IsClsCompliant): Fixed problem with handling
8813         all three states (compliant, not-compliant, undetected).
8814
8815 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
8816
8817         * attribute.cs (Attribute): Location is now public.
8818         (Resolve): Store resolved arguments (pos_values) in attribute class.
8819         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
8820         (GetClsCompliantAttributeValue): New method that gets
8821         CLSCompliantAttribute value.
8822         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
8823         if exists else null.
8824         (AttributeTester): New class for CLS-Compliant verification routines.
8825
8826         * class.cs (Emit): Add CLS-Compliant verification.
8827         (Method.GetSignatureForError): Implemented.
8828         (Constructor.GetSignatureForError): Implemented
8829         (Constructor.HasCompliantArgs): Returns if constructor has
8830         CLS-Compliant arguments.
8831         (Constructor.Emit): Override.
8832         (Construcor.IsIdentifierClsCompliant): New method; For constructors
8833         is needed to test only parameters.
8834         (FieldBase.GetSignatureForError): Implemented.
8835         (TypeContainer): New member for storing base interfaces.
8836         (TypeContainer.FindMembers): Search in base interfaces too.
8837
8838         * codegen.cs (GetClsComplianceAttribute): New method that gets
8839         assembly or module CLSCompliantAttribute value.
8840         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
8841         for assembly.
8842         (ModuleClass.Emit): Add error 3012 test.
8843
8844         * const.cs (Emit): Override and call base for CLS-Compliant tests.
8845
8846         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
8847         state for all decl types.
8848         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
8849         if CLS-Compliant tests are required.
8850         (IsClsCompliaceRequired): New method. Analyze whether code
8851         must be CLS-Compliant.
8852         (IsExposedFromAssembly): New method. Returns true when MemberCore
8853         is exposed from assembly.
8854         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
8855         value or gets cached value.
8856         (HasClsCompliantAttribute): New method. Returns true if MemberCore
8857         is explicitly marked with CLSCompliantAttribute.
8858         (IsIdentifierClsCompliant): New abstract method. This method is
8859         used to testing error 3005.
8860         (IsIdentifierAndParamClsCompliant): New method. Common helper method
8861         for identifier and parameters CLS-Compliant testing.
8862         (VerifyClsCompliance): New method. The main virtual method for
8863         CLS-Compliant verifications.
8864         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
8865         null. I don't know why is null (too many public members !).
8866         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
8867         and get value of first CLSCompliantAttribute that found.
8868
8869         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
8870         (VerifyClsCompliance): Override and add extra tests.
8871
8872         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
8873         clscheck- disable CLS-Compliant verification event if assembly is has
8874         CLSCompliantAttribute(true).
8875
8876         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
8877         ApllyAttribute is now called in emit section as in the other cases.
8878         Possible future Emit integration.
8879         (IsIdentifierClsCompliant): New override.
8880         (VerifyClsCompliance): New override.
8881         (GetEnumeratorName): Returns full enum name.
8882
8883         * parameter.cs (GetSignatureForError): Implemented.
8884
8885         * report.cs (WarningData): New struct for Warning message information.
8886         (LocationOfPreviousError): New method.
8887         (Warning): New method. Reports warning based on the warning table.
8888         (Error_T): New method. Reports error based on the error table.
8889
8890         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
8891         verifications are done here.
8892
8893         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
8894
8895         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
8896         CLSCompliantAttribute.
8897         (all_imported_types): New member holds all imported types from other
8898         assemblies.
8899         (LoadAllImportedTypes): New method fills static table with exported types
8900         from all referenced assemblies.
8901         (Modules): New property returns all assembly modules.
8902
8903 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
8904
8905         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
8906         throwing a parser error.
8907
8908         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
8909         which removes the hardcoded get_/set_ prefixes for properties, as
8910         IL allows for the properties to be named something else.  
8911
8912         Bug #56013
8913
8914         * expression.cs: Do not override operand before we know if it is
8915         non-null.  Fix 56207
8916
8917 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8918
8919         * typemanager.cs: support for pinned variables.
8920
8921 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8922
8923         * decl.cs, typemanager.cs: Avoid using an arraylist
8924         as a buffer if there is only one result set.
8925
8926 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
8927
8928         * expression.cs: Make sure you cant call a static method
8929         with an instance expression, bug #56174.
8930
8931 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
8932
8933         * class.cs (IsDuplicateImplementation): Improve error reporting to
8934         flag 663 (method only differs in parameter modifier).
8935
8936         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
8937         in preprocessor directives.
8938
8939         * location.cs (LookupFile): Allow for the empty path.
8940
8941         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
8942         better approach for some of that patch, but its failing with the
8943         CharSet enumeration.  For now try/catch will do.
8944
8945         * typemanager.cs: Do not crash if a struct does not have fields.
8946         Fixes 56150.
8947
8948 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8949
8950         * expression.cs: cs0213, cant fix a fixed expression.
8951         fixes 50231.
8952
8953 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8954
8955         * cs-parser.jay: detect invalid embeded statements gracefully.
8956         bug #51113.
8957
8958 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
8959
8960         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
8961         As a regex:
8962         s/
8963         the invocation type may not be a subclass of the tye of the item/
8964         The type of the item must be a subclass of the invocation item.
8965         /g
8966
8967         Fixes bug #50820.
8968
8969 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
8970
8971         * attribute.cs: Added methods to get a string and a bool from an
8972         attribute. Required to information from AssemblyKeyFileAttribute,
8973         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
8974         * codegen.cs: Modified AssemblyName creation to include support for
8975         strongnames. Catch additional exceptions to report them as CS1548.
8976         * compiler.csproj: Updated include CryptoConvert.cs.
8977         * compiler.csproj.user: Removed file - user specific configuration.
8978         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
8979         Mono.Security assembly. The original class is maintained and tested in
8980         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
8981         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
8982         like CSC 8.0 (C# v2) supports.
8983         * Makefile: Added CryptoConvert.cs to mcs sources.
8984         * rootcontext.cs: Added new options for strongnames.
8985
8986 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
8987
8988         * driver.cs: For --expect-error, report error code `2'
8989         if the program compiled with no errors, error code `1' if
8990         it compiled with an error other than the one expected.
8991
8992 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
8993
8994         * compiler.csproj: Updated for Visual Studio .NET 2003.
8995         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
8996         * compiler.sln: Updated for Visual Studio .NET 2003.
8997
8998 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
8999
9000         * expression.cs: Fix bug #47234. We basically need to apply the
9001         rule that we prefer the conversion of null to a reference type
9002         when faced with a conversion to 'object' (csc behaviour).
9003
9004 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9005
9006         * statement.cs: Shorter form for foreach, eliminates
9007         a local variable. r=Martin.
9008
9009 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9010
9011         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9012         checks if we can use brtrue/brfalse to test for 0.
9013         * expression.cs: use the above in the test for using brtrue/brfalse.
9014         cleanup code a bit.
9015
9016 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9017
9018         * expression.cs: Rewrite string concat stuff. Benefits:
9019
9020         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9021         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9022         rather than a concat chain.
9023
9024         * typemanager.cs: Add lookups for more concat overloads.
9025
9026 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9027
9028         * expression.cs: Emit shorter il code for array init.
9029
9030         newarr
9031         dup
9032         // set 1
9033
9034         // set 2
9035
9036         newarr
9037         stloc.x
9038
9039         ldloc.x
9040         // set 1
9041
9042         ldloc.x
9043         // set 2
9044
9045 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9046
9047         * statement.cs: Before, two switch blocks would be merged if the
9048         total size of the blocks (end_item - begin_item + 1) was less than
9049         two times the combined sizes of the blocks.
9050
9051         Now, it will only merge if after the merge at least half of the
9052         slots are filled.
9053
9054         fixes 55885.
9055
9056 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9057
9058         * class.cs : csc build fix for GetMethods(). See bug #52503.
9059
9060 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9061
9062         * expression.cs: Make sure fp comparisons work with NaN.
9063         This fixes bug #54303. Mig approved this patch a long
9064         time ago, but we were not able to test b/c the runtime
9065         had a related bug.
9066
9067 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9068
9069         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9070
9071 2004-03-19  Martin Baulig  <martin@ximian.com>
9072
9073         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9074         error here and not in our caller.
9075
9076 2004-03-19  Martin Baulig  <martin@ximian.com>
9077
9078         * interface.cs: Completely killed this file.
9079         (Interface): We're now a TypeContainer and live in class.cs.
9080
9081         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9082         argument; we're now also called for interfaces.
9083         (TypeContainer.DefineMembers): Allow this method being called
9084         multiple times.
9085         (TypeContainer.GetMethods): New public method; formerly known as
9086         Interface.GetMethod().  This is used by PendingImplementation.
9087         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9088         it's now private and non-static.
9089         (Interface): Moved this here; it's now implemented similar to
9090         Class and Struct.
9091         (Method, Property, Event, Indexer): Added `bool is_interface'
9092         argument to their .ctor's.
9093         (MemberBase.IsInterface): New public field.
9094
9095         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9096         instances instead of InterfaceMethod, InterfaceProperty, etc.
9097         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9098         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9099
9100 2004-03-19  Martin Baulig  <martin@ximian.com>
9101
9102         * class.cs (MethodCore.IsDuplicateImplementation): New private
9103         method which does the CS0111 checking.
9104         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9105         Use IsDuplicateImplementation().
9106
9107 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9108
9109         * decl.cs (FindMemberToOverride): New method to find the correct
9110         method or property to override in the base class.
9111         * class.cs
9112             - Make Method/Property use the above method to find the
9113               version in the base class.
9114             - Remove the InheritableMemberSignatureCompare as it is now
9115               dead code.
9116
9117         This patch makes large code bases much faster to compile, as it is
9118         O(n) rather than O(n^2) to do this validation.
9119
9120         Also, it fixes bug 52458 which is that nested classes are not
9121         taken into account when finding the base class member.
9122
9123         Reviewed/Approved by Martin.
9124
9125 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9126
9127         * interface.cs: In all interface classes removed redundant
9128         member initialization.
9129
9130 2004-03-16  Martin Baulig  <martin@ximian.com>
9131
9132         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9133
9134 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9135
9136         * decl.cs (DefineTypeAndParents): New helper method to define a
9137         type's containers before the type itself is defined;  This is a
9138         bug exposed by the recent changes to Windows.Forms when an
9139         implemented interface was defined inside a class that had not been
9140         built yet.   
9141
9142         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9143
9144         (Check): Loop correctly to report errors modifiers
9145         (UNSAFE was not in the loop, since it was the same as TOP).
9146
9147         * interface.cs: Every interface member now takes a ModFlags,
9148         instead of a "is_new" bool, which we set on the base MemberCore. 
9149
9150         Every place where we called "UnsafeOk" in the interface, now we
9151         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9152         the unsafe settings from the member declaration instead of the
9153         container interface. 
9154
9155         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9156
9157         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9158         `set_indexer_name' to the pending bits (one per type).
9159
9160         We fixed a bug today that was picking the wrong method to
9161         override, since for properties the existing InterfaceMethod code
9162         basically ignored the method name.  Now we make sure that the
9163         method name is one of the valid indexer names.
9164
9165 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9166  
9167         * support.cs (SeekableStreamReader): Keep track of stream byte
9168         positions and don't mix them with character offsets to the buffer.
9169
9170         Patch from Gustavo Giráldez
9171
9172 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9173
9174         * interface.cs (InterfaceSetGetBase): Removed double member
9175         initialization, base class does it as well.
9176
9177 2004-03-13  Martin Baulig  <martin@ximian.com>
9178
9179         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9180         when compiling corlib.
9181
9182 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9183
9184         * convert.cs (ExplicitConversion): We were reporting an error on
9185         certain conversions (object_type source to a value type, when the
9186         expression was `null') before we had a chance to pass it through
9187         the user defined conversions.
9188
9189         * driver.cs: Replace / and \ in resource specifications to dots.
9190         Fixes 50752
9191
9192         * class.cs: Add check for duplicate operators.  Fixes 52477
9193
9194 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9195
9196         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9197         that are in the middle of the statements, not only at the end.
9198         Fixes #54987
9199
9200         * class.cs (TypeContainer.AddField): No longer set the
9201         `HaveStaticConstructor' flag, now we call it
9202         `UserDefineStaticConstructor' to diferentiate the slightly
9203         semantic difference.
9204
9205         The situation is that we were not adding BeforeFieldInit (from
9206         Modifiers.TypeAttr) to classes that could have it.
9207         BeforeFieldInit should be set to classes that have no static
9208         constructor. 
9209
9210         See:
9211
9212         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9213
9214         And most importantly Zoltan's comment:
9215
9216         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9217
9218         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9219          before its static fields are used', i.e. initialization does not need
9220          to be triggered by the first access to the type. Setting this flag
9221          helps the JIT to compile better code, since it can run the static
9222          constructor at JIT time, and does not need to generate code to call it
9223          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9224          this flag for lots of classes like String. 
9225          
9226          csc sets this flag if the type does not have an explicit static 
9227          constructor. The reasoning seems to be that if there are only static
9228          initalizers for a type, and no static constructor, then the programmer
9229          does not care when this initialization happens, so beforefieldinit
9230          can be used.
9231          
9232          This bug prevents the AOT compiler from being usable, since it 
9233          generates so many calls to mono_runtime_class_init that the AOT code
9234          is much slower than the JITted code. The JITted code is faster, 
9235          because it does not generate these calls if the vtable is type is
9236          already initialized, which is true in the majority of cases. But the
9237          AOT compiler can't do this."
9238
9239 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9240
9241         * class.cs (MethodData.Emit): Refactor the code so symbolic
9242         information is generated for destructors;  For some reasons we
9243         were taking a code path that did not generate symbolic information
9244         before. 
9245
9246 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9247
9248         * class.cs: Create a Constructor.CheckBase method that
9249         takes care of all validation type code. The method
9250         contains some code that was moved from Define.
9251
9252         It also includes new code that checks for duplicate ctors.
9253         This fixes bug #55148.
9254
9255 2004-03-09  Joshua Tauberer <tauberer@for.net>
9256
9257         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9258         a { ... }-style array creation invokes EmitStaticInitializers
9259         which is not good for reference-type arrays.  String, decimal
9260         and now null constants (NullCast) are not counted toward
9261         static initializers.
9262
9263 2004-03-05  Martin Baulig  <martin@ximian.com>
9264
9265         * location.cs (SourceFile.HasLineDirective): New public field;
9266         specifies whether the file contains or is referenced by a "#line"
9267         directive.
9268         (Location.DefineSymbolDocuments): Ignore source files which
9269         either contain or are referenced by a "#line" directive.        
9270
9271 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
9272
9273         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
9274         direct access to our parent, so check the method inline there.
9275
9276 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9277
9278         * expression.cs (Invocation.EmitCall): Miguel's last commit
9279         caused a regression. If you had:
9280
9281             T t = null;
9282             t.Foo ();
9283
9284         In Foo the implict this would be null.
9285
9286 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
9287
9288         * expression.cs (Invocation.EmitCall): If the method is not
9289         virtual, do not emit a CallVirt to it, use Call.
9290
9291         * typemanager.cs (GetFullNameSignature): Improve the method to
9292         cope with ".ctor" and replace it with the type name.
9293
9294         * class.cs (ConstructorInitializer.Resolve): Now the method takes
9295         as an argument the ConstructorBuilder where it is being defined,
9296         to catch the recursive constructor invocations.
9297
9298 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
9299
9300         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
9301         routines to check if a type is an enumerable/enumerator allow
9302         classes that implement the IEnumerable or IEnumerator interfaces.
9303
9304         * class.cs (Property, Operator): Implement IIteratorContainer, and
9305         implement SetYields.
9306
9307         (Property.Define): Do the block swapping for get_methods in the
9308         context of iterators.   We need to check if Properties also
9309         include indexers or not.
9310
9311         (Operator): Assign the Block before invoking the
9312         OperatorMethod.Define, so we can trigger the Iterator code
9313         replacement. 
9314
9315         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
9316         Property and Operator classes are not created when we parse the
9317         declarator but until we have the block completed, so we use a
9318         singleton SimpleIteratorContainer.Simple to flag whether the
9319         SetYields has been invoked.
9320
9321         We propagate this setting then to the Property or the Operator to
9322         allow the `yield' to function.
9323
9324 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
9325
9326         * codegen.cs: Implemented attribute support for modules.
9327         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
9328         Assembly/Module functionality.
9329
9330         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
9331         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
9332         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
9333
9334 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
9335
9336         * interface.cs (FindMembers): The operation is performed on all base
9337         interfaces and not only on the first. It is required for future CLS Compliance patch.
9338
9339 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9340
9341         * statement.cs, codegen.cs:
9342         This patch deals with patterns such as:
9343
9344         public class List : IEnumerable {
9345
9346                 public MyEnumerator GetEnumerator () {
9347                         return new MyEnumerator(this);
9348                 }
9349
9350                 IEnumerator IEnumerable.GetEnumerator () {
9351                         ...
9352                 }
9353                 
9354                 public struct MyEnumerator : IEnumerator {
9355                         ...
9356                 }
9357         }
9358
9359         Before, there were a few things we did wrong:
9360         1) we would emit callvirt on a struct, which is illegal
9361         2) we emited ldarg when we needed to emit ldarga
9362         3) we would mistakenly call the interface methods on an enumerator
9363         type that derived from IEnumerator and was in another assembly. For example:
9364
9365         public class MyEnumerator : IEnumerator
9366
9367         Would have the interface methods called, even if there were public impls of the
9368         method. In a struct, this lead to invalid IL code.
9369
9370 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
9371
9372         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
9373           renamed to Emit.
9374
9375         * delegate.cs (Define): Fixed crash when delegate type is undefined.
9376
9377 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
9378
9379         * cs-parser.jay: Fix small regression: we were not testing V2
9380         compiler features correctly.
9381
9382         * interface.cs: If the emit context is null, then create one
9383
9384 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
9385
9386         * decl.cs (GetSignatureForError): New virtual method to get full name
9387           for error messages.
9388
9389         * attribute.cs (IAttributeSupport): New interface for attribute setting.
9390           Now it is possible to rewrite ApplyAttributes method to be less if/else.
9391
9392         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
9393           Duplicated members and code in these classes has been removed.
9394           Better encapsulation in these classes.
9395
9396 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
9397
9398         * assign.cs (Assign.DoResolve): When dealing with compound
9399         assignments, there is a new rule in ECMA C# 2.4 (might have been
9400         there before, but it is documented here) that states that in:
9401
9402         a op= b;
9403
9404         If b is of type int, and the `op' is a shift-operator, then the
9405         above is evaluated as:
9406
9407         a = (int) a op b 
9408
9409         * expression.cs (Binary.ResolveOperator): Instead of testing for
9410         int/uint/long/ulong, try to implicitly convert to any of those
9411         types and use that in pointer arithmetic.
9412
9413         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
9414         method to print information for from the type, not from the
9415         null-method we were given.
9416
9417 2004-02-01  Duncan Mak  <duncan@ximian.com>
9418
9419         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
9420         parsing for cmd, fixes bug #53694.
9421
9422 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
9423
9424         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
9425         in the member name duplication tests. Property and operator name duplication
9426         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
9427
9428 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
9429
9430         * interface.cs (PopulateMethod): Fixed crash when interface method
9431         returns not existing type (error test cs0246-3.cs).
9432
9433 2004-02-02  Ravi Pratap M <ravi@ximian.com>
9434
9435         * cs-parser.jay (interface_accessors): Re-write actions to also
9436         store attributes attached to get and set methods. Fix spelling
9437         while at it.
9438
9439         (inteface_property_declaration): Modify accordingly.
9440
9441         (InterfaceAccessorInfo): New helper class to store information to pass
9442         around between rules that use interface_accessors.
9443
9444         * interface.cs (Emit): Apply attributes on the get and set
9445         accessors of properties and indexers too.
9446
9447         * attribute.cs (ApplyAttributes): Modify accordingly to use the
9448         right MethodBuilder when applying attributes to the get and set accessors.
9449
9450 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
9451
9452         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
9453
9454 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
9455
9456         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
9457
9458 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
9459
9460         * cs-parser.jay: Remove YIELD token, instead use the new grammar
9461         changes that treat `yield' specially when present before `break'
9462         or `return' tokens.
9463
9464         * cs-tokenizer.cs: yield is no longer a keyword.
9465
9466 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
9467
9468         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
9469         setting for default constructors.
9470         For default constructors are almost every time set wrong Modifier. The
9471         generated IL code has been alright. But inside mcs this values was
9472         wrong and this was reason why several of my CLS Compliance tests
9473         failed.
9474
9475 2004-01-22  Martin Baulig  <martin@ximian.com>
9476
9477         * cs-parser.jay (namespace_or_type_name): Return an Expression,
9478         not a QualifiedIdentifier.  This is what `type_name_expression'
9479         was previously doing.
9480         (type_name_expression): Removed; the code is now in
9481         `namespace_or_type_name'.
9482         (qualified_identifier): Removed, use `namespace_or_type_name'
9483         instead.
9484         (QualifiedIdentifier): Removed this class.      
9485
9486 2004-01-22  Martin Baulig  <martin@ximian.com>
9487
9488         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
9489         not a string as alias name.
9490
9491 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
9492
9493         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
9494         #52730 bug, and instead compute correctly the need to use a
9495         temporary variable when requesting an address based on the
9496         static/instace modified of the field and the constructor.
9497  
9498 2004-01-21  Martin Baulig  <martin@ximian.com>
9499
9500         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
9501         class and namespace before looking up aliases.  Fixes #52517.
9502
9503 2004-01-21  Martin Baulig  <martin@ximian.com>
9504
9505         * flowanalysis.cs (UsageVector.Merge): Allow variables being
9506         assinged in a 'try'; fixes exception4.cs.
9507
9508 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9509         * class.cs : Implemented parameter-less constructor for TypeContainer
9510
9511         * decl.cs: Attributes are now stored here. New property OptAttributes
9512
9513         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
9514
9515         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
9516
9517 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9518
9519         * typemanager.cs (CSharpSignature): Now reports also inner class name.
9520           (CSharpSignature): New method for indexer and property signature.
9521
9522 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9523
9524         * pending.cs (IsVirtualFilter): Faster implementation.
9525
9526 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9527
9528         * typemanager.cs: Avoid inclusion of same assembly more than once.
9529
9530 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9531
9532         * cs-parser.jay: Fixed problem where the last assembly attribute
9533           has been applied also to following declaration (class, struct, etc.)
9534           
9535 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
9536
9537         * class.cs: Added error CS0538, CS0539 reporting.
9538         Fixed crash on Microsoft runtime when field type is void.
9539
9540         * cs-parser.jay: Added error CS0537 reporting.
9541
9542         * pending.cs: Added error CS0535 reporting.
9543         Improved error report for errors CS0536, CS0534.
9544
9545 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
9546
9547         Merge a few bits from the Anonymous Method MCS tree.
9548
9549         * statement.cs (ToplevelBlock): New class for toplevel methods,
9550         will hold anonymous methods, lifted variables.
9551
9552         * cs-parser.jay: Create toplevel blocks for delegates and for
9553         regular blocks of code. 
9554
9555 2004-01-20  Martin Baulig  <martin@ximian.com>
9556
9557         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
9558         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
9559         and `NeedExplicitReturn'; added `IsLastStatement'.
9560         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
9561         have a `ReturnLabel' or we're not unreachable.
9562
9563         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
9564         child's reachability; don't just override ours with it.  Fixes
9565         #58058 (lluis's example).
9566         (FlowBranching): Added public InTryOrCatch(), InCatch(),
9567         InFinally(), InLoop(), InSwitch() and
9568         BreakCrossesTryCatchBoundary() methods.
9569
9570         * statement.cs (Return): Do all error checking in Resolve().
9571         Unless we are the last statement in a top-level block, always
9572         create a return label and jump to it.
9573         (Break, Continue): Do all error checking in Resolve(); also make
9574         sure we aren't leaving a `finally'.
9575         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
9576         statement in a top-level block.
9577         (Block.Flags): Added `IsDestructor'.
9578         (Block.IsDestructor): New public property.
9579
9580 2004-01-20  Martin Baulig  <martin@ximian.com>
9581
9582         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
9583
9584 2004-01-20  Martin Baulig  <martin@ximian.com>
9585
9586         * statement.cs (Statement.ResolveUnreachable): New public method.
9587         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
9588         (Block.Resolve): Resolve unreachable statements.
9589
9590 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9591
9592         * expression.cs: We need to fix the case where we do
9593         not have a temp variable here.
9594
9595         * assign.cs: Only expression compound assignments need
9596         temporary variables.
9597
9598 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
9599
9600         * flowanalysis.cs: Reduce memory allocation in a few ways:
9601           - A block with no variables should not allocate a bit
9602             vector for itself.
9603           - A method with no out parameters does not need any tracking
9604             for assignment of the parameters, so we need not allocate
9605             any data for it.
9606           - The arrays:
9607                 public readonly Type[] VariableTypes;
9608                 public readonly string[] VariableNames;
9609             Are redundant. The data is already stored in the variable
9610             map, so we need not allocate another array for it.
9611           - We need to add alot of checks for if (params | locals) == null
9612             due to the first two changes.
9613
9614 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
9615
9616         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
9617         implement IMemoryLocation, we store a copy on a local variable and
9618         take the address of it.  Patch from Benjamin Jemlich
9619
9620         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
9621         to use a special "type_name_expression" rule which reduces the
9622         number of "QualifiedIdentifier" classes created, and instead
9623         directly creates MemberAccess expressions.
9624
9625 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
9626
9627         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
9628         that fixes #52853.  Null literal assignment to ValueType
9629
9630         * class.cs (MethodData.Emit): Instead of checking the name of the
9631         method to determine if its a destructor, create a new derived
9632         class from Method called Destructor, and test for that.  
9633
9634         * cs-parser.jay: Create a Destructor object instead of a Method.  
9635
9636         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
9637
9638         Fixes: 52933
9639
9640 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
9641
9642         * expression.cs (Binary.ResolveOperator): Perform an implicit
9643         conversion from MethodGroups to their delegate types on the
9644         Addition operation.
9645
9646         * delegate.cs: Introduce a new class DelegateCreation that is the
9647         base class for `NewDelegate' and `ImplicitDelegateCreation',
9648         factor some code in here.
9649
9650         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
9651         conversion from MethodGroups to compatible delegate types. 
9652
9653         * ecore.cs (Expression.Resolve): Do not flag error 654
9654         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
9655         we allow conversions from MethodGroups to delegate types now.
9656
9657         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
9658         assignments in v2 either.
9659
9660 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
9661
9662         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
9663         static read-only fields in ctors.
9664
9665         Applied patch from Benjamin Jemlich 
9666
9667         * expression.cs (UnaryMutator): Avoid leaking local variables. 
9668
9669 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
9670
9671         * cs-tokenizer.cs (IsCastToken): Allow the various native types
9672         here to return true, as they can be used like this:
9673
9674                 (XXX) int.MEMBER ()
9675
9676         Fixed 49836 and all the other dups
9677
9678 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
9679
9680         * driver.cs: Implement /win32res and /win32icon.
9681
9682 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
9683
9684         * cs-parser.jay: Add a rule to improve error handling for the
9685         common mistake of placing modifiers after the type.
9686
9687 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
9688
9689         * cs-parser.jay (interface_event_declaration): Catch
9690         initialization of events on interfaces, and report cs0068
9691
9692         * cs-parser.jay (interface_event_declaration): Catch
9693         initialization of events. 
9694
9695         * ecore.cs: Better report missing constructors.
9696
9697         * expression.cs (Binary.ResolveOperator): My previous bug fix had
9698         the error reporting done in the wrong place.  Fix.
9699
9700         * expression.cs (Binary.ResolveOperator): Catch the 
9701         operator + (E x, E y) error earlier, and later allow for implicit
9702         conversions in operator +/- (E e, U x) from U to the underlying
9703         type of E.
9704
9705         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
9706         52596, if the container class is abstract, the default constructor
9707         is protected otherwise its public (before, we were always public).
9708
9709         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
9710         fixed statement.
9711
9712         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
9713         Jemlich that fixes bug #52597, MCS was generating invalid code for
9714         idisposable structs.   Thanks to Ben for following up with this
9715         bug as well.
9716
9717 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
9718
9719         * driver.cs: Allow assemblies without code to be generated, fixes
9720         52230.
9721
9722 2004-01-07  Nick Drochak <ndrochak@gol.com>
9723
9724         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
9725
9726 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
9727
9728         * cs-parser.jay: Add rules to improve error reporting if fields or
9729         methods are declared at the namespace level (error 116)
9730
9731         * Add rules to catch event add/remove
9732
9733 2004-01-04  David Sheldon <dave-mono@earth.li>
9734
9735   * expression.cs: Added matching ")" to error message for 
9736   CS0077
9737
9738 2004-01-03 Todd Berman <tberman@gentoo.org>
9739
9740         * ecore.cs, attribute.cs:
9741         Applying fix from #52429.
9742
9743 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9744
9745         * ecore.cs, expression.cs, statement.cs:
9746         Total rewrite of how we handle branching. We
9747         now handle complex boolean expressions with fewer
9748         jumps. As well if (x == 0) no longer emits a ceq.
9749
9750         if (x is Foo) is much faster now, because we generate
9751         better code.
9752
9753         Overall, we get a pretty big improvement on our benchmark
9754         tests. The code we generate is smaller and more readable.
9755
9756         I did a full two-stage bootstrap. The patch was reviewed
9757         by Martin and Miguel.
9758
9759 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9760
9761         * cs-parser.jay: Make primary_expression not take a QI.
9762         we dont need this because the member_access rule covers
9763         us here. So we replace the rule with just IDENTIFIER.
9764
9765         This has two good effects. First, we remove a s/r conflict.
9766         Second, we allocate many fewer QualifiedIdentifier objects.
9767
9768 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9769
9770         * attribute.cs: Handle MarshalAs attributes as pseudo, and
9771         set the correct information via SRE. This prevents
9772         hanging on the MS runtime. Fixes #29374.
9773
9774 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
9775
9776         * convert.cs: correctly handle conversions to value types
9777         from Enum and ValueType as unboxing conversions.
9778
9779         Fixes bug #52569. Patch by Benjamin Jemlich.
9780
9781 2004-01-02  Ravi Pratap  <ravi@ximian.com>
9782
9783         * expression.cs (BetterConversion): Prefer int -> uint
9784         over int -> ulong (csc's behaviour). This fixed bug #52046.
9785
9786 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
9787
9788         * decl.cs (MemberCache.FindMembers): now returns a
9789         MemberInfo [].
9790
9791         * typemanager.cs: In general, go with with ^^.
9792         (CopyNewMethods): take an IList.
9793         (RealMemberLookup): Only allocate an arraylist
9794         if we copy from two sets of methods.
9795
9796         This change basically does two things:
9797         1) Fewer array lists allocated due to CopyNewMethods.
9798         2) the explicit cast in MemberList costed ALOT.
9799
9800 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
9801
9802         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
9803         a hashtable to avoid needless string allocations when an identifier is
9804         used more than once (the common case).
9805
9806 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9807
9808         * pending.cs: MS's TypeBuilder.GetInterfaces ()
9809         is broken, it will not return anything. So, we
9810         have to use the information we have in mcs to
9811         do the task.
9812
9813         * typemanager.cs: Add a cache for GetInterfaces,
9814         since this will now be used more often (due to ^^)
9815
9816         (GetExplicitInterfaces) New method that gets the
9817         declared, not effective, interfaces on a type
9818         builder (eg, if you have interface IFoo, interface
9819         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
9820         { IBar }.
9821
9822         This patch makes MCS able to bootstrap itself on
9823         Windows again.
9824
9825 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
9826
9827         * expression.cs: Remove the Nop's that Miguel put
9828         in by mistake.
9829
9830 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9831
9832         * report.cs, codegen.cs: Give the real stack trace to
9833         the error when an exception is thrown.
9834
9835 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9836
9837         * decl.cs: only allocate hashtables for ifaces if 
9838         it is an iface!
9839
9840 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9841
9842         * expression.cs: fix the error from cs0121-2.cs
9843         (a parent interface has two child interfaces that
9844         have a function with the same name and 0 params
9845         and the function is called through the parent).
9846
9847 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
9848
9849         * class.cs, rootcontext.cs, typmanager.cs: do not
9850         leak pointers.
9851
9852 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9853
9854         * codegen.cs: remove stack for the ec flow branching.
9855         It is already a linked list, so no need.
9856
9857 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
9858
9859         * Makefile: Allow custom profiler here.
9860
9861 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9862
9863         * typemanager.cs (LookupType):
9864           - Use a static char [], because split takes
9865             a param array for args, so it was allocating
9866             every time.
9867           - Do not store true in a hashtable, it boxes.
9868
9869 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
9870
9871         * flowanalysis.cs: bytify common enums.
9872
9873 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9874
9875         * modifiers.cs: Add a new set of flags for the
9876         flags allowed on explicit interface impls.
9877         * cs-parser.jay: catch the use of modifiers in
9878         interfaces correctly.
9879         * class.cs: catch private void IFoo.Blah ().
9880
9881         All related to bug #50572.
9882
9883 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9884
9885         * decl.cs: Rewrite the consistant accessability checking.
9886         Accessability is not linear, it must be implemented in
9887         a tableish way. Fixes #49704.
9888
9889 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
9890
9891         * expression.cs: Handle negation in a checked context.
9892         We must use subtraction from zero. Fixes #38674.
9893
9894 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9895
9896         * class.cs: Ignore static void main in DLLs.
9897         * rootcontext.cs: Handle the target type here,
9898         since we are have to access it from class.cs
9899         * driver.cs: account for the above.
9900
9901 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9902
9903         * report.cs: Give line numbers and files if available.
9904
9905 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
9906
9907         * driver.cs: Implement /addmodule.
9908
9909         * typemanager.cs:  Change 'modules' field so it now contains Modules not
9910         ModuleBuilders.
9911
9912 2003-12-20  Martin Baulig  <martin@ximian.com>
9913
9914         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
9915         (FieldBase.IsAssigned): Removed this field.
9916         (FieldBase.SetAssigned): New public method.
9917         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
9918
9919 2003-12-20  Martin Baulig  <martin@ximian.com>
9920
9921         * expression.cs (LocalVariableReference.DoResolve): Don't set
9922         `vi.Used' if we're called from DoResolveLValue().
9923
9924         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
9925         returns the usage vector it just merged into the current one -
9926         pass this one to UsageWarning().
9927         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
9928         of the `EmitContext', don't call this recursively on our children.
9929
9930 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
9931
9932         * driver.cs: Implement /target:module.
9933
9934 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
9935
9936         * support.cs (CharArrayHashtable): New helper class.
9937
9938         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
9939         char arrays, not strings, so we can avoid creating a string in
9940         consume_identifier if the identifier is a keyword.
9941
9942 2003-12-16  Martin Baulig  <martin@ximian.com>
9943
9944         * statement.cs (LocalInfo.Assigned): Removed this property.
9945         (LocalInfo.Flags): Removed `Assigned'.
9946         (LocalInfo.IsAssigned): New public method; takes the EmitContext
9947         and uses flow analysis.
9948         (Block.UsageWarning): Made this method private.
9949         (Block.Resolve): Call UsageWarning() if appropriate.
9950
9951         * expression.cs (LocalVariableReference.DoResolve): Always set
9952         LocalInfo.Used here.
9953
9954 2003-12-13  Martin Baulig  <martin@ximian.com>
9955
9956         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
9957         any value here; we're now using flow analysis to figure out
9958         whether a statement/block returns a value.
9959
9960 2003-12-13  Martin Baulig  <martin@ximian.com>
9961
9962         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
9963         working again.
9964         (FlowBranching.MergeFinally): Don't call
9965         `branching.CheckOutParameters()' here, this is called in
9966         MergeTopBlock().
9967         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
9968         when adding the `finally' vector.       
9969
9970 2003-12-13  Martin Baulig  <martin@ximian.com>
9971
9972         * flowanalysis.cs
9973         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
9974         actually work and also fix #48962.
9975
9976 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
9977
9978         * decl.cs: Do not check System.Object for nested types,
9979         since we know it does not have any. Big bang for buck:
9980
9981         BEFORE:
9982            Run 1:   8.35 seconds
9983            Run 2:   8.32 seconds
9984            corlib:  17.99 seconds
9985         AFTER:
9986            Run 1:   8.17 seconds
9987            Run 2:   8.17 seconds
9988            corlib:  17.39 seconds
9989
9990 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9991
9992         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
9993         time we are returning 0 members, so we save alot here.
9994
9995 2003-12-11  Martin Baulig  <martin@ximian.com>
9996
9997         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
9998         `MergeChild()', also just take the `FlowBranching' as argument;
9999         call Merge() on it and return the result.
10000         (FlowBranching.Merge): We don't need to do anything if we just
10001         have one sibling.
10002
10003 2003-12-11  Martin Baulig  <martin@ximian.com>
10004
10005         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10006         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10007         Maurer for this idea.
10008
10009 2003-12-11  Martin Baulig  <martin@ximian.com>
10010
10011         * flowanalysis.cs (MergeResult): This class is now gone; we now
10012         use the `UsageVector' for this.  The reason for this is that if a
10013         branching just has one sibling, we don't need to "merge" them at
10014         all - that's the next step to do.
10015         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10016         `MergeResult'.
10017
10018 2003-12-11  Martin Baulig  <martin@ximian.com>
10019
10020         Reworked flow analyis and made it more precise and bug-free.  The
10021         most important change is that we're now using a special `Reachability'
10022         class instead of having "magic" meanings of `FlowReturns'.  I'll
10023         do some more cleanups and optimizations and also add some more
10024         documentation this week.
10025
10026         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10027         largely reworked this class.
10028         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10029         the new `Reachability' class instead of having "magic" values here.
10030         (FlowBranching): We're now using an instance of `Reachability'
10031         instead of having separate `Returns', `Breaks' etc. fields.
10032
10033         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10034         based on flow analysis; ignore the return value of block.Emit ().
10035
10036 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10037
10038         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10039         if they are private.
10040
10041 2003-12-09  Martin Baulig  <martin@ximian.com>
10042
10043         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10044         call them directly on the UsageVector.
10045
10046 2003-12-09  Martin Baulig  <martin@ximian.com>
10047
10048         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10049         Changed return type from `FlowReturns' to `Reachability'.
10050
10051 2003-12-09  Martin Baulig  <martin@ximian.com>
10052
10053         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10054         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10055         `Reachable' fields with a single `Reachability' one.
10056
10057 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10058
10059         * class.cs (FindMembers): Remove foreach's.
10060
10061         Bootstrap times:
10062
10063         BEFORE
10064                 Run 1:   8.74 seconds
10065                 Run 2:   8.71 seconds
10066
10067         AFTER
10068                 Run 1:   8.64 seconds
10069                 Run 2:   8.58 seconds
10070
10071
10072 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10073
10074         * cs-parser.jay:
10075         * gen-treedump.cs:
10076         * statement.cs:
10077         This patch does a few things:
10078                 1. EmptyStatement is now a singleton, so it is never reallocated.
10079                 2. All blah is EmptyStatement constructs have been changed to
10080                    blah == EmptyStatement.Value, which is much faster and valid
10081                    now that EmptyStatement is a singleton.
10082                 3. When resolving a block, rather than allocating a new array for
10083                    the non-empty statements, empty statements are replaced with
10084                    EmptyStatement.Value
10085                 4. Some recursive functions have been made non-recursive.
10086         Mainly the performance impact is from (3), however (1) and (2) are needed for
10087         this to work. (4) does not make a big difference in normal situations, however
10088         it makes the profile look saner.
10089
10090         Bootstrap times:
10091
10092         BEFORE
10093         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10094         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10095         Total memory allocated: 56397 KB
10096
10097         AFTER
10098         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10099         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10100         Total memory allocated: 55666 KB
10101
10102 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10103
10104         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10105         than the hashtable in a hashtable version
10106
10107         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10108         we always end up concating a string. This results in a huge perf
10109         loss, because many strings have to be tracked by the GC. In this
10110         patch, we first use a hashtable that works with two keys, so that
10111         the strings do not need to be concat'ed.
10112
10113         Bootstrap times:
10114         BEFORE
10115                 Run 1:   8.74 seconds
10116                 Run 2:   8.71 seconds
10117
10118         AFTER
10119                 Run 1:   8.65 seconds
10120                 Run 2:   8.56 seconds
10121
10122 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10123
10124         * Makefile: Add a new target `do-time' that does a quick and simple
10125         profile, leaving easy to parse output.
10126
10127 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10128
10129         * codegen.cs (Init): Create the dynamic assembly with 
10130         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10131
10132 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10133
10134         * support.cs: Make the PtrHashtable use only one
10135         instance of its comparer.
10136
10137 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10138
10139         * typemanager.cs: Fix lookup of GetNamespaces.
10140
10141 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10142
10143         * expression.cs: Removed redundant line.
10144
10145         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10146         ArrayLists, use for loops with bounds.  
10147
10148         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10149         arraylist.
10150
10151         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10152         arraylists, use for loop with bounds.
10153
10154         The above three changes give us a 0.071 second performance
10155         improvement out of 3.294 seconds down to 3.223.  On my machine
10156         the above changes reduced the memory usage by 1,387 KB during
10157         compiler bootstrap.
10158
10159         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10160         QualifiedIdentifiers.  Before we created a new string through
10161         concatenation, and mostly later on, the result would be
10162         manipulated by DecomposeQI through string manipulation.
10163
10164         This reduced the compiler memory usage for bootstrapping from
10165         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10166         compile times in 0.05 seconds.
10167
10168 2003-11-28  Dick Porter  <dick@ximian.com>
10169
10170         * support.cs: Do string compares with the Invariant culture.
10171
10172         * rootcontext.cs: 
10173         * gen-treedump.cs: 
10174         * expression.cs: 
10175         * driver.cs: 
10176         * decl.cs: 
10177         * codegen.cs: 
10178         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10179         the comparison is done with the Invariant culture.
10180
10181 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10182
10183         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10184         GetEnumerator method.
10185
10186         (ProbeCollectionType): Iterate starting at the most specific type
10187         upwards looking for a GetEnumerator
10188
10189         * expression.cs: Shift count can be up to 31 for int/uint and 63
10190         for long/ulong.
10191
10192 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10193
10194         * statement.cs (Block.LookupLabel): Also look for the label on the
10195         children blocks.  Use a hash table to keep track of visited
10196         nodes. 
10197
10198         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10199         we actually did transform the other operand, otherwise fall back
10200         to the common codepath that casts to long.
10201
10202         * cs-tokenizer.cs: Use the same code pattern as the int case.
10203         Maybe I should do the parsing myself, and avoid depending on the
10204         Parse routines to get this done.
10205
10206 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10207
10208         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10209         which fixes bug 51347.  This time test it.
10210
10211         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10212         attributes for example can not tell the difference between these.
10213         The difference was only a syntax feature of the language. 
10214
10215         * attribute.cs: Apply attributes to delegates.
10216
10217         * delegate.cs: Call the apply attributes method.
10218
10219 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10220
10221         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10222         comparing 0 vs Byte.MinValue, not the value
10223
10224         (ImplicitConversionRequired): When reporting a conversion error,
10225         use error 31 to print out the constant error instead of the
10226         simpler 29.
10227
10228         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10229         which fixes bug 51347.
10230
10231 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10232
10233         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10234         which fixes the -warnaserror command line option.
10235
10236 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10237
10238         * cfold.cs (DoNumericPromotions): During constant folding of
10239         additions on UIntConstant, special case intconstants with
10240         IntConstants like we do on the expression binary operator. 
10241
10242 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10243
10244         * convert.cs (ImplicitReferenceConversion): We were missing a case
10245         (System.Enum are not value types or class types, so we need to
10246         classify them separatedly).
10247
10248         * driver.cs: We do not support error 2007.
10249
10250 2003-11-12 Jackson Harper <jackson@ximian.com>
10251
10252         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10253         system directory. Also use the full file name so users can
10254         libraries names mscorlib-o-tron.dll in a non system dir.
10255
10256 2003-11-10  Martin Baulig  <martin@ximian.com>
10257
10258         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10259         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10260         calling `ResolveType()' on them, directly assign their `Type'.
10261
10262 2003-11-08  Martin Baulig  <martin@ximian.com>
10263
10264         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10265         return value and the `out parent' parameter.
10266         (TypeContainer.DefineType): Moved the CS0644 check into
10267         GetClassBases().  Don't pass the interface types to the
10268         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
10269         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
10270
10271         * ecore.cs (TypeExpr.IsAttribute): New property.
10272         (TypeExpr.GetInterfaces): New method.
10273
10274         * interface.cs (Interface.GetInterfaceTypeByName): Return a
10275         TypeExpr instead of a Type.
10276         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
10277         (Interface.DefineType): Don't pass the interface types to the
10278         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
10279         them later and then call `TypeBulider.AddInterfaceImplementation()'.
10280
10281         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
10282         instead of a `Type[]'.
10283         (TypeManager.RegisterBuilder): Likewise.
10284         (TypeManager.AddUserInterface): Likewise.
10285         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
10286         `Type[]' and also return a `TypeExpr[]'.
10287         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
10288
10289 2003-11-08  Martin Baulig  <martin@ximian.com>
10290
10291         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
10292         Expression.     
10293
10294 2003-11-08  Martin Baulig  <martin@ximian.com>
10295
10296         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
10297         TypeManager.ResolveExpressionTypes().
10298
10299         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
10300         instead of an Expression.
10301         (TypeExpr): This is now an abstract base class for `TypeExpression'.
10302         (TypeExpression): New public class; formerly known as `TypeExpr'.
10303
10304         * expression.cs (ComposedCast): Derive from TypeExpr.
10305
10306         * typemanager.cs (TypeManager.system_*_expr): These are now
10307         TypExpr's instead of Expression's.
10308         (TypeManager.ResolveExpressionTypes): New public static function;
10309         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
10310         of them.        
10311
10312 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
10313
10314         * expression.cs (New.DoResolve): Do not dereference value that
10315         might be a null return.
10316
10317         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
10318         sure that the constant value has the right type.  Fixes an
10319         unreported bug, similar to 50425.
10320
10321         * const.cs (Const.LookupConstantValue): Call
10322         ImplicitStandardConversionExists before doing a conversion to
10323         avoid havng the TypeManager.ChangeType do conversions.
10324
10325         Reduced the number of casts used
10326
10327         (Const.ChangeType): New routine to enable reuse of the constant
10328         type changing code from statement.
10329
10330         * typemanager.cs (ChangeType): Move common initialization to
10331         static global variables.
10332
10333         Fixes #50425.
10334
10335         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
10336         every value type to go through, even if it was void.  Fix that. 
10337
10338         * cs-tokenizer.cs: Use is_identifier_start_character on the start
10339         character of the define, and the is_identifier_part_character for
10340         the rest of the string.
10341
10342 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
10343
10344         * expression.cs (UnaryMutator.EmitCode): When I updated
10345         LocalVariableReference.DoResolve, I overdid it, and dropped an
10346         optimization done on local variable references.
10347
10348 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
10349
10350         * ecore.cs: Convert the return from Ldlen into an int.
10351
10352 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
10353
10354         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
10355         the accessibility, this is a special case for toplevel non-public
10356         classes (internal for instance).
10357
10358 2003-10-20  Nick Drochak <ndrochak@gol.com>
10359
10360         * ecore.cs: Fix typo and build.  Needed another right paren.
10361
10362 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
10363
10364         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
10365         `internal' case regular and protected, but not allowing protected
10366         to be evaluated later.  Bug 49840
10367
10368 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
10369
10370         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
10371         to kb.Nlast, and not the kb.nFirst to isolate the switch
10372         statement.
10373
10374         Extract the underlying type, so enumerations of long/ulong are
10375         treated like long/ulong.
10376
10377 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
10378
10379         * expression.cs (New): Overload the meaning of RequestedType to
10380         track the possible creation of the NewDelegate type, since
10381         DoResolve is invoked more than once for new constructors on field
10382         initialization.
10383
10384         See bugs: #48800 and #37014
10385
10386         * cs-parser.jay (declare_local_constants): Take an arraylist
10387         instead of a single constant.
10388
10389         (local_constant_declaration): It should take a
10390         constant_declarators, not a constant_declarator.  Fixes 49487
10391
10392         * convert.cs: Fix error report.
10393
10394 2003-10-13 Jackson Harper <jackson@ximian.com>
10395
10396         * typemanager.cs (TypeToCoreType): Add float and double this fixes
10397         bug #49611
10398
10399 2003-10-09  Martin Baulig  <martin@ximian.com>
10400
10401         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
10402         to the .ctor.
10403         (MethodCore.DoDefineParameters): Removed the TypeContainer
10404         argument; use the DeclSpace which was passed to the .ctor instead.
10405         (MethodCore.CheckParameter): Take a DeclSpace instead of a
10406         TypeContainer; we only need a DeclSpace here.
10407
10408 2003-10-09  Martin Baulig  <martin@ximian.com>
10409
10410         * class.cs (MethodData): Added additional `DeclSpace ds' argument
10411         to the .ctor.
10412         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
10413         EmitContext's .ctor.    
10414
10415 2003-10-09  Martin Baulig  <martin@ximian.com>
10416
10417         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
10418         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
10419         AsAccessible(), moved them as well.
10420
10421         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
10422
10423 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
10424
10425         * cs-parser.jay : Renamed yyName to yyNames related to jay.
10426
10427 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
10428
10429         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
10430         generation for >=, as spotted by Paolo, bug 48679.  
10431         Patch from David Waite.
10432
10433         * cs-tokenizer.cs: Add handling for #pragma.
10434
10435         * cs-parser.jay: Allow for both yield and yield return in the
10436         syntax.  The anti-cobolization of C# fight will go on!
10437
10438         * class.cs (TypeBuilder.DefineType): Catch error condition here
10439         (Parent.DefineType erroring out and returning null).
10440
10441         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
10442         coping with enumerations variables, we were mistakenly processing
10443         them as a regular value type instead of built-in types.  Fixes the
10444         bug #48063
10445
10446         * typemanager.cs (IsBuiltinOrEnum): New method.
10447
10448 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
10449
10450         * cs-parser.jay: Upgrade: yield now needs the return clause.
10451
10452 2003-09-19  Martin Baulig  <martin@ximian.com>
10453
10454         * decl.cs (MemberCache.SetupCacheForInterface): Take a
10455         `MemberCache parent' argument.  Normally, an interface doesn't
10456         have a parent type except System.Object, but we use this in gmcs
10457         for generic type parameters.
10458
10459 2003-09-18  Martin Baulig  <martin@ximian.com>
10460
10461         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
10462         on `type.IsInterface'; don't check whether the type has a parent
10463         to determine whether it's an interface.
10464
10465 2003-09-15  Martin Baulig  <martin@ximian.com>
10466
10467         * class.cs (TypeContainer.DefineType): Added an error flag to
10468         avoid reporting duplicate CS0146's ("class definition is
10469         circular.").
10470
10471         * driver.cs (Driver.MainDriver): Abort if
10472         RootContext.ResolveTree() reported any errors.
10473
10474 2003-09-07  Martin Baulig  <martin@ximian.com>
10475
10476         * report.cs (Error, Warning): Added overloaded versions which take
10477         a `params object[] args' and call String.Format().
10478
10479 2003-09-07  Martin Baulig  <martin@ximian.com>
10480
10481         * decl.cs (DeclSpace..ctor): Don't call
10482         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
10483         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
10484         (DeclSpace.RecordDecl): New method.
10485
10486         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
10487
10488 2003-09-02  Ravi Pratap  <ravi@ximian.com>
10489
10490         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
10491         value attributes to be applied to ParameterBuilders.
10492
10493         * class.cs (MethodCore.LabelParameters): Make static and more
10494         generic so that it can be used from other places - like interface
10495         methods, for instance.
10496
10497         * interface.cs (Interface.Emit): Call LabelParameters before
10498         emitting attributes on the InterfaceMethod.
10499
10500 2003-08-26  Martin Baulig  <martin@ximian.com>
10501
10502         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
10503         resolving aliases; fixes #47927.
10504
10505 2003-08-26  Martin Baulig  <martin@ximian.com>
10506
10507         * statement.cs (Using.DoResolve): This is internally emitting a
10508         try/finally clause, so we need to set ec.NeedExplicitReturn if we
10509         do not always return.  Fixes #47681.
10510
10511 2003-08-26  Martin Baulig  <martin@ximian.com>
10512
10513         * decl.cs (MemberCore): Moved WarningNotHiding(),
10514         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
10515         into MemberBase.
10516         (AdditionResult): Make this nested in DeclSpace.
10517         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
10518         argument; call NamespaceEntry.Define() unless we're nested in a
10519         class or struct.
10520
10521         * namespace.cs (Namespace.DefineName): New public function.  This
10522         is called from DeclSpace's .ctor to add 
10523         (Namespace.Lookup): Include DeclSpaces in the lookup.
10524
10525         * class.cs (Operator): Derive from MemberBase, not MemberCore.
10526
10527         * const.cs (Const): Derive from MemberBase, not MemberCore.     
10528
10529 2003-08-25  Martin Baulig  <martin@ximian.com>
10530
10531         * convert.cs (Convert.ExplicitReferenceConversion): When
10532         converting from an interface type to a class, unbox if the target
10533         type is a struct type.  Fixes #47822.
10534
10535 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10536
10537         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
10538         #47854.
10539
10540 2003-08-22  Martin Baulig  <martin@ximian.com>
10541
10542         * class.cs (TypeManager.DefineType): When defining a nested type,
10543         call DefineType() on our parent; fixes #47801.
10544
10545 2003-08-22  Martin Baulig  <martin@ximian.com>
10546
10547         * class.cs (MethodData.Define): While checking if a method is an
10548         interface implementation, improve the test a bit more to fix #47654.
10549
10550 2003-08-22  Martin Baulig  <martin@ximian.com>
10551
10552         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
10553         correctly; fixes #47722.
10554
10555 2003-08-22  Martin Baulig  <martin@ximian.com>
10556
10557         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
10558         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
10559
10560         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
10561
10562 2003-08-22  Martin Baulig  <martin@ximian.com>
10563
10564         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
10565         can only be assigned in static constructors.  Fixes #47161.
10566
10567 2003-08-22  Martin Baulig  <martin@ximian.com>
10568
10569         Rewrote and improved the flow analysis code.
10570
10571         * flowbranching.cs (FlowBranching): Make this class abstract.
10572         (FlowBranching.CreateBranching): New static function to create a
10573         new flow branching.
10574         (FlowBranchingBlock, FlowBranchingException): New classes.
10575         (FlowBranching.UsageVector.Type): New public readonly field.
10576         (FlowBranching.UsageVector.Breaks): Removed the setter.
10577         (FlowBranching.UsageVector.Returns): Removed the setter.
10578         (FlowBranching.UsageVector): Added Break(), Return(),
10579         NeverReachable() and Throw() methods to modify the reachability.
10580         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
10581         done by FlowBranching.Merge().
10582         (FlowBranching.UsageVector.MergeChild): New method; merges the
10583         merge result into the current vector.
10584         (FlowBranching.Merge): New abstract method to merge a branching.
10585
10586 2003-08-12  Martin Baulig  <martin@ximian.com>
10587
10588         * expression.cs (Indirection.CacheTemporaries): Create the
10589         LocalTemporary with the pointer type, not its element type.
10590
10591 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
10592
10593         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
10594         token was a keyword or not.
10595
10596         Add `error' options where an IDENTIFIER was expected;  Provide
10597         CheckToken and CheckIdentifierToken convenience error reporting
10598         functions. 
10599
10600         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
10601
10602         * decl.cs: Rename `NamespaceEntry Namespace' public field into
10603         NameSpaceEntry NameSpaceEntry.
10604
10605         (LookupInterfaceOrClass): Avoid creating a full qualified name
10606         from namespace and name: avoid doing lookups when we know the
10607         namespace is non-existant.   Use new Tree.LookupByNamespace which
10608         looks up DeclSpaces based on their namespace, name pair.
10609
10610         * driver.cs: Provide a new `parser verbose' to display the
10611         exception thrown during parsing.  This is turned off by default
10612         now, so the output of a failure from mcs is more graceful.
10613
10614         * namespace.cs: Track all the namespaces defined in a hashtable
10615         for quick lookup.
10616
10617         (IsNamespace): New method
10618
10619 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
10620
10621         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
10622         we know that we need to concatenate (full typename can never be
10623         null). 
10624
10625         * class.cs: ditto.
10626
10627         * statement.cs: Use a bitfield;  Do not initialize to null things
10628         which are done by the constructor by default.
10629
10630         * cs-parser.jay: bug fix, parameter was 4, not 3.
10631
10632         * expression.cs: Just use the property;
10633
10634         * statement.cs: No need for GetVariableInfo method.
10635
10636 2003-08-08  Martin Baulig  <martin@ximian.com>
10637
10638         * flowanalysis.cs (FlowReturns): This is now nested in the
10639         `FlowBranching' class.
10640         (MyBitVector): Moved this here from statement.cs.
10641         (FlowBranching.SiblingType): New enum type.
10642         (FlowBranching.CreateSibling): Added `SiblingType' argument.
10643
10644 2003-08-07  Martin Baulig  <martin@ximian.com>
10645
10646         * flowanalysis.cs (FlowBranchingType): This is now nested in the
10647         `FlowBranching' class and called `BranchingType'.
10648
10649 2003-08-07  Martin Baulig  <martin@ximian.com>
10650
10651         * flowanalysis.cs: Moved all the control flow analysis code into
10652         its own file.
10653
10654 2003-08-07  Martin Baulig  <martin@ximian.com>
10655
10656         * assign.cs (Assign.DoResolve): `target' must either be an
10657         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
10658         #37319.
10659
10660 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
10661
10662         * expression.cs (BinaryMethod): This kind of expression is created by the
10663         Binary class if it determines that the operator has to be handled
10664         by a method.
10665
10666         (BinaryDelegate): This kind of expression is created if we are
10667         dealing with a + or - operator on delegates.
10668
10669         (Binary): remove method, argumetns, and DelegateOperator: when
10670         dealing with methods, 
10671
10672         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
10673
10674         * statement.cs (Block): use bitfields for the three extra booleans
10675         we had in use.   Remove unused topblock parameter.
10676
10677         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
10678
10679         * assign.cs: Drop extra unneeded tests.
10680
10681 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
10682
10683         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
10684
10685         * statement.cs (Foreach): Use VariableStorage instead of
10686         LocalBuilders.   
10687
10688         * codegen.cs (VariableStorage): New class used by clients that
10689         require a variable stored: locals or fields for variables that
10690         need to live across yield.
10691
10692         Maybe provide a convenience api for EmitThis+EmitLoad?
10693
10694         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
10695         these bad boys.
10696
10697 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
10698
10699         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
10700         RemapParameterLValue): New methods that are used to turn a
10701         precomputed FieldInfo into an expression like this:
10702
10703                 instance.FieldInfo
10704
10705         The idea is to use this instead of making LocalVariableReference
10706         have more than one meaning.
10707
10708         * cs-parser.jay: Add error production to BASE.
10709
10710         * ecore.cs: Deal with TypeManager.GetField returning null, which
10711         is now a valid return value.
10712
10713         (FieldExprNoAddress): New expression for Fields whose address can
10714         not be taken.
10715
10716         * expression.cs (LocalVariableReference): During the resolve
10717         phases, create new expressions if we are in a remapping context.
10718         Remove code that dealt with remapping here.
10719
10720         (ParameterReference): same.
10721
10722         (ProxyInstance): New expression, like the `This' expression, but
10723         it is born fully resolved.  We know what we are doing, so remove
10724         the errors that are targeted to user-provided uses of `this'.
10725
10726         * statement.cs (Foreach): our variable is now stored as an
10727         Expression;  During resolution, follow the protocol, dont just
10728         assume it will return this.
10729
10730 2003-08-06  Martin Baulig  <martin@ximian.com>
10731
10732         * support.cs (SeekableStreamReader.cs): New public class.
10733
10734         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
10735         SeekableStreamReader instead of the normal StreamReader.
10736
10737 2003-08-04  Martin Baulig  <martin@ximian.com>
10738
10739         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
10740         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
10741         deambiguate casts and delegate invocations.
10742         (parenthesized_expression): Use the new tokens to ensure this is
10743         not a cast of method invocation.
10744
10745         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
10746         when reading a `)' and Deambiguate_CloseParens () was previously
10747         called.
10748
10749         * expression.cs (ParenthesizedExpression): New class.  This is
10750         just used for the CS0075 test.
10751         (Binary.DoResolve): Check for CS0075.   
10752
10753 2003-07-29  Ravi Pratap  <ravi@ximian.com>
10754
10755         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
10756         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
10757         reference comparison.
10758
10759         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
10760         examine the ReturnType for equality - this is necessary in the
10761         cases of implicit and explicit operators whose signature also
10762         includes the return type.
10763
10764 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
10765
10766         * namespace.cs: Cache the result of the namespace computation,
10767         instead of computing it every time.
10768
10769 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
10770
10771         * decl.cs: Use a global arraylist that we reuse over invocations
10772         to avoid excesive memory consumption.  Reduces memory usage on an
10773         mcs compile by one meg (45 average).
10774
10775         * typemanager.cs (LookupTypeReflection): In .NET pointers are
10776         private, work around that.
10777
10778 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
10779
10780         * literal.cs (IntLiteral): Define Zero and One static literals. 
10781
10782         * cs-parser.jay (integer_literal): use static literals to reduce
10783         memory usage for the most used literals (0, 1 and -1).  211kb
10784         reduced in memory usage.
10785
10786         Replace all calls to `new ArrayList' with `new
10787         ArrayList(4)' which is a good average number for most allocations,
10788         and also requires only 16 bytes of memory for its buffer by
10789         default. 
10790
10791         This reduced MCS memory usage in seven megabytes for the RSS after
10792         bootstrapping.
10793
10794 2003-07-28  Ravi Pratap  <ravi@ximian.com>
10795
10796         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
10797         handle params methods the correct way by forming only one
10798         applicable set with params and normal methods in them. Earlier we
10799         were looking at params methods only if we found no normal methods
10800         which was not the correct thing to do.
10801
10802         (Invocation.BetterFunction): Take separate arguments indicating
10803         when candidate and the best method are params methods in their
10804         expanded form.
10805
10806         This fixes bugs #43367 and #46199.
10807
10808         * attribute.cs: Documentation updates.
10809
10810         (CheckAttribute): Rename to CheckAttributeTarget.
10811         (GetValidPlaces): Rename to GetValidTargets.
10812
10813         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
10814         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
10815
10816         Fixes bug #44468.
10817
10818 2003-07-28  Martin Baulig  <martin@ximian.com>
10819
10820         * class.cs (TypeContainer.DefineMembers): Use the base type's full
10821         name when looking up the base class of a nested class.  Fixes #46977.
10822
10823 2003-07-26  Martin Baulig  <martin@ximian.com>
10824
10825         * expression.cs (Indexers.Indexer): New nested struct; contains
10826         getter, setter and the indexer's type.
10827         (Indexers.Properties): This is now an ArrayList of
10828         Indexers.Indexer's.
10829         (IndexerAccess.DoResolveLValue): Correctly set the type if the
10830         indexer doesn't have any getters.
10831
10832         * assign.cs (Assign.DoResolve): Also do the implicit conversions
10833         for embedded property and indexer assignments.
10834
10835 2003-07-26  Martin Baulig  <martin@ximian.com>
10836
10837         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
10838         preprocessor directive is not the first non-whitespace character
10839         on a line.
10840
10841 2003-07-26  Martin Baulig  <martin@ximian.com>
10842
10843         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
10844         namespace parsing, follow the spec more closely.
10845
10846         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
10847         NamespaceEntry.Lookup().
10848
10849 2003-07-25  Martin Baulig  <martin@ximian.com>
10850
10851         * MethodCore.cs (OverridesSomething): New public field; it's set
10852         from TypeContainer.DefineMembers if this method overrides
10853         something (which doesn't need to be a method).  Fix #39462.
10854
10855 2003-07-25  Ravi Pratap  <ravi@ximian.com>
10856
10857         * typemanager.cs (GetMembers): Ensure that the list of members is
10858         reversed. This keeps things in sync.
10859
10860         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
10861         find an AttributeUsage attribute.
10862
10863         * expression.cs (Invocation.OverloadResolve): Perform the check
10864         which disallows Invoke to be directly called on a Delegate.
10865
10866         (Error_InvokeOnDelegate): Report error cs1533.
10867
10868 2003-07-25  Martin Baulig  <martin@ximian.com>
10869
10870         * expression.cs (Indexers.GetIndexersForType): Only look in the
10871         interface hierarchy if the requested type is already an
10872         interface.  Fixes #46788 while keeping #46502 fixed.
10873
10874 2003-07-25  Martin Baulig  <martin@ximian.com>
10875
10876         * class.cs (TypeContainer.DefineMembers): Check whether all
10877         readonly fields have been assigned and report warning CS0649 if
10878         not.
10879
10880         * statement.cs (LocalInfo.IsFixed): Always return true if this is
10881         a valuetype.
10882
10883 2003-07-24  Ravi Pratap  <ravi@ximian.com>
10884
10885         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
10886         returned from GetMethods to make things consistent with the
10887         assumptions MCS makes about ordering of methods.
10888
10889         This should comprehensively fix bug #45127 and it does :-)
10890
10891         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
10892         ordering is actually reverse.
10893
10894         * Clean up some debug messages I left lying around.
10895
10896         * interface.cs (Populate*): Get rid of code which emits attributes
10897         since the stage in which we emit attributes is the 'Emit' stage,
10898         not the define stage.
10899
10900         (Emit): Move attribute emission for interface members here.
10901
10902 2003-07-22  Ravi Pratap  <ravi@ximian.com>
10903
10904         * expression.cs (Invocation.OverloadResolve): Follow the spec more
10905         closely: we eliminate methods in base types when we have an
10906         applicable method in a top-level type.
10907
10908         Please see section 14.5.5.1 for an exact description of what goes
10909         on. 
10910
10911         This fixes bug #45127 and a host of other related to corlib compilation.
10912
10913         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
10914         array is the method corresponding to the top-level type (this is
10915         because of the changes made to icall.c) so we change this
10916         accordingly.
10917
10918         (MethodGroupExpr.Name): This too.
10919
10920         * typemanager.cs (GetElementType): New method which does the right
10921         thing when compiling corlib. 
10922
10923         * everywhere: Make use of the above in the relevant places.
10924
10925 2003-07-22  Martin Baulig  <martin@ximian.com>
10926
10927         * cs-parser.jay (invocation_expression): Moved
10928         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
10929         `cast_expression', but create a InvocationOrCast which later
10930         resolves to either an Invocation or a Cast.
10931
10932         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
10933         method; call this before EmitStatement() to make sure that this
10934         expression can be used as a statement.
10935
10936         * expression.cs (InvocationOrCast): New class; resolves to either
10937         an Invocation or a Cast.
10938
10939         * statement.cs (StatementExpression): Call ResolveStatement() on
10940         the ExpressionStatement before emitting it.
10941
10942 2003-07-21  Martin Baulig  <martin@ximian.com>
10943
10944         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
10945         `ref' and `out' attributes match; fixes #46220.
10946         (MemberAccess.ResolveMemberAccess): You can't reference a type
10947         through an expression; fixes #33180.
10948         (Indexers.GetIndexersForType): Don't return the indexers from
10949         interfaces the class implements; fixes #46502.
10950
10951 2003-07-21  Martin Baulig  <martin@ximian.com>
10952
10953         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
10954         CS0661 checks; fixes bug #30442.
10955
10956 2003-07-21  Martin Baulig  <martin@ximian.com>
10957
10958         * decl.cs (AdditionResult): Added `Error'.
10959
10960         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
10961
10962         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
10963         makes cs0031.cs actually work.
10964
10965 2003-07-20  Martin Baulig  <martin@ximian.com>
10966
10967         * namespace.cs: Fixed that bug which caused a crash when compiling
10968         the debugger's GUI.
10969
10970 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
10971
10972         * typemanager.cs (LookupTypeReflection): Never expose types which
10973         are NotPublic, NestedPrivate, NestedAssembly, or
10974         NestedFamANDAssem.  We used to return these, and later do a check
10975         that would report a meaningful error, but the problem is that we
10976         would not get the real match, if there was a name override.
10977
10978 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
10979
10980         * namespace.cs (Namespace, Name): Do not compute the namespace
10981         name dynamically, compute it in the constructor.  This reduced
10982         memory usage by 1697 KB.
10983
10984         * driver.cs: Use --pause to pause at the end.
10985
10986 2003-07-17  Peter Williams  <peter@newton.cx>
10987
10988         * Makefile: Change the name of the test target so that it doesn't
10989         conflict with the recursive test target.
10990
10991 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
10992
10993         * expression.cs (LocalVariableReference.Emit, EmitAssign,
10994         AddressOf): Do not use EmitThis, that was wrong, use the actual
10995         this pointer.
10996
10997 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
10998
10999         * class.cs (MethodData.Define): While checking if a method is an
11000         interface implementation, improve the test: If we are not public
11001         (use new test here: use the computed MethodAttributes directly,
11002         instead of the parsed modifier flags) check if the `implementing'
11003         method comes from an interface or not.
11004
11005         * pending.cs (VerifyPendingMethods): Slightly better error
11006         message.
11007
11008         * makefile: add test target that does the mcs bootstrap.
11009
11010 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11011
11012         * interface.cs (Define): Do nothing here since there are no
11013         members to populate etc. Move the attribute emission out of here
11014         since this was just totally the wrong place to put it. Attribute
11015         application happens during the 'Emit' phase, not in the 'Define'
11016         phase.
11017
11018         (Emit): Add this method and move the attribute emission here
11019
11020         * rootcontext.cs (EmitCode): Call the Emit method on interface
11021         types too.
11022
11023 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11024
11025         * expression.cs (OverloadResolve): Report error only if Location
11026         is not 'Null' which means that there was a probe going on.
11027
11028 2003-07-14  Martin Baulig  <martin@ximian.com>
11029
11030         * expression.cs (ConditionalLogicalOperator): New public class to
11031         implement user defined conditional logical operators.
11032         This is section 14.11.2 in the spec and bug #40505.
11033
11034 2003-07-14  Martin Baulig  <martin@ximian.com>
11035
11036         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11037
11038 2003-07-14  Martin Baulig  <martin@ximian.com>
11039
11040         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11041
11042         * ecore.cs (IVariable.VerifyFixed): New interface method.
11043
11044         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11045         operator, check whether the variable is actually fixed.  Fixes bug
11046         #36055.  Set a variable definitely assigned when taking its
11047         address as required by the spec.
11048
11049         * statement.cs (LocalInfo.IsFixed): New field.
11050         (LocalInfo.MakePinned): Set `IsFixed' to true.
11051
11052 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11053
11054         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11055         for .ctors, ensure that we only ask for members declared in the
11056         attribute type (BindingFlags.DeclaredOnly).
11057
11058         Fixes bug #43632.
11059
11060         * expression.cs (Error_WrongNumArguments): Report error 1501
11061         correctly the way CSC does.
11062
11063 2003-07-13  Martin Baulig  <martin@ximian.com>
11064
11065         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11066         lookup on the fully qualified name, to make things like "X.X" work
11067         where "X.X" is a fully qualified type name, but we also have a
11068         namespace "X" in the using list.  Fixes #41975.
11069
11070 2003-07-13  Martin Baulig  <martin@ximian.com>
11071
11072         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11073         function. If we're a CompoundAssign, we need to create an embedded
11074         CompoundAssign, not an embedded Assign.
11075         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11076         Fixes #45854.
11077
11078 2003-07-13  Martin Baulig  <martin@ximian.com>
11079
11080         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11081         work to fix bug #46088.
11082
11083 2003-07-13  Ravi Pratap <ravi@ximian.com>
11084
11085         * class.cs (Operator.Emit): Do not emit attributes here - it is
11086         taken care of by the Method class that we delegate too. This takes
11087         care of bug #45876.
11088
11089 2003-07-10  Martin Baulig  <martin@ximian.com>
11090
11091         * expression.cs (TypeOfVoid): New class.
11092         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11093
11094 2003-07-10  Martin Baulig  <martin@ximian.com>
11095
11096         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11097         bug #35957.
11098
11099 2003-07-10  Martin Baulig  <martin@ximian.com>
11100
11101         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11102         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11103
11104         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11105
11106         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11107
11108 2003-07-10  Martin Baulig  <martin@ximian.com>
11109
11110         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11111         of decimal.  Fixes #42850.
11112
11113         NOTE: I also fixed the created byte blob, but this doesn't work on
11114         the MS runtime and csc never produces any byte blobs for decimal
11115         arrays.
11116
11117 2003-07-10  Martin Baulig  <martin@ximian.com>
11118
11119         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11120         structs; fixes #32068.
11121         (Block.AddChildVariableNames): Fixed #44302.
11122
11123 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11124
11125         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11126
11127 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11128
11129         * attribute.cs: And this test is onger needed.
11130
11131 2003-07-08  Martin Baulig  <martin@ximian.com>
11132
11133         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11134         inaccessible types.  Fixes #36313.
11135
11136         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11137
11138         * namespace.cs (NamespaceEntry): Create implicit entries for all
11139         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11140         implicit entries for N1.N2 and N1.
11141
11142 2003-07-08  Martin Baulig  <martin@ximian.com>
11143
11144         Rewrote the handling of namespaces to fix a lot of the issues
11145         wrt. `using' aliases etc.
11146
11147         * namespace.cs (Namespace): Splitted this class into a
11148         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11149
11150         * typemanager.cs (TypeManager.IsNamespace): Removed.
11151         (TypeManager.ComputeNamespaces): Only compute namespaces from
11152         loaded assemblies here, not the namespaces from the assembly we're
11153         currently compiling.
11154
11155 2003-07-08  Martin Baulig  <martin@ximian.com>
11156
11157         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11158
11159 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11160
11161         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11162         already fixed it.  
11163
11164         I thought about the memory savings here, but LookupTypeReflection
11165         is used under already very constrained scenarios.  Compiling
11166         corlib or mcs only exposes one hit, so it would not really reduce
11167         any memory consumption.
11168
11169 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11170
11171         * typemanager.cs: fixes bug #45889 by only adding public types from
11172         other assemblies to the list of known types.
11173
11174 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11175
11176         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11177         on the type we resolved.
11178
11179 2003-07-05  Martin Baulig  <martin@ximian.com>
11180
11181         * pending.cs (PendingImplementation.ParentImplements): Don't
11182         create the proxy if the parent is abstract.
11183
11184         * class.cs (TypeContainer.DefineIndexers): Process explicit
11185         interface implementations first.  Fixes #37714.
11186
11187 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11188
11189         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11190         defined recursively;  but since we modify the input parameters
11191         (left is set to `this' temporarily), we reset this value if the
11192         left_is_explicit is false, which gives the original semantics to
11193         the code.  
11194
11195         * literal.cs (NullPointer): new class used to represent a null
11196         literal in a pointer context.
11197
11198         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11199         type is a pointer, use a NullPointer object instead of a
11200         NullLiteral.   Closes 43687
11201
11202         (ExplicitConversion): Convert pointer values using
11203         the conv opcode to the proper type.
11204
11205         * ecore.cs (New): change ValueTypeVariable property into a method,
11206         that returns whether the valuetype is suitable for being used.
11207
11208         * expression.cs (Binary.DoNumericPromotions): Only return if we
11209         the int constant was a valid uint, and we can return both left and
11210         right as uints.  If not, we continue processing, to trigger the
11211         type conversion.  This fixes 39018.
11212
11213         * statement.cs (Block.EmitMeta): During constant resolution, set
11214         the CurrentBlock property on the emitcontext, so that we resolve
11215         constants propertly.
11216
11217 2003-07-02  Martin Baulig  <martin@ximian.com>
11218
11219         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11220         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11221
11222         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11223         than emitting it here.
11224
11225         * statement.cs: Fixed some more flow analysis bugs.
11226
11227 2003-07-02  Martin Baulig  <martin@ximian.com>
11228
11229         * class.cs (MethodData.Define): When implementing interface
11230         methods, set Final unless we're Virtual.
11231
11232         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11233         check work for interface methods.
11234
11235 2003-07-01  Martin Baulig  <martin@ximian.com>
11236
11237         * ecore.cs (EmitContext.This): Replaced this property with a
11238         GetThis() method which takes a Location argument.  This ensures
11239         that we get the correct error location for a CS0188.
11240
11241 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11242
11243         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11244         ImplicitStandardConversion.
11245
11246         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11247
11248 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11249
11250         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11251         optimization.
11252
11253 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11254
11255         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11256         constructors.
11257
11258         (MethodData.Define): Turn off initlocals for unsafe methods.
11259
11260 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11261
11262         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11263         complete;  Fixes #37521.
11264
11265         * delegate.cs: Use Modifiers.TypeAttr to compute the
11266         TypeAttributes, instead of rolling our own.  This makes the flags
11267         correct for the delegates.
11268
11269 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
11270
11271         * class.cs (Constructor.Define): Set the private flag for static
11272         constructors as well.
11273
11274         * cs-parser.jay (statement_expression): Set the return value to
11275         null, to avoid a crash when we catch an error.
11276
11277 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
11278
11279         * cs-parser.jay: Applied patch from Jackson that adds support for
11280         extern and unsafe modifiers to destructor declarations.
11281
11282         * expression.cs: Report error 21 if the user is trying to index a
11283         System.Array.
11284
11285         * driver.cs: Add an error message, suggested by the bug report.
11286
11287         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
11288         if we do not have a ": this ()" constructor initializer.  Fixes 45149
11289
11290 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
11291
11292         * namespace.cs: Add some information to reduce FAQs.
11293
11294 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
11295
11296         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
11297         underlying enumeration types.  Fixes #43915.
11298
11299         * expression.cs: Treat ushort/short as legal values to be used in
11300         bitwise operations.
11301
11302 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
11303
11304         * delegate.cs: transfer custom attributes for paramenters from
11305         the delegate declaration to Invoke and BeginInvoke.
11306
11307 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
11308
11309         * attribute.cs: handle custom marshalers and emit marshal info
11310         for fields, too.
11311
11312 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
11313
11314         * makefile.gnu: Added anonymous.cs to the compiler sources.
11315
11316 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
11317
11318         * iterators.cs: Change the name of the proxy class to include two
11319         underscores.
11320
11321         * cs-parser.jay: Update grammar to include anonymous methods.
11322
11323         * anonymous.cs: new file.
11324
11325 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
11326
11327         * class.cs (Field.Define): Add missing test for pointers and
11328         safety. 
11329
11330 2003-05-27  Ravi Pratap  <ravi@ximian.com>
11331
11332         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
11333         we use the stobj opcode.
11334
11335         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
11336         since it wasn't the correct fix. 
11337
11338         It still is puzzling that we are required to use stobj for IntPtr
11339         which seems to be a ValueType.
11340
11341 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
11342
11343         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
11344         during regular simple name resolution.   Now, the trick is that
11345         instead of returning for processing the simplename, we do a
11346         TypeManager.LookupType (ie, a rooted lookup as opposed to a
11347         contextual lookup type).   If a match is found, return that, if
11348         not, return for further composition.
11349
11350         This fixes long-standing 30485.
11351
11352         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11353         using the address to initialize an object, do an Stobj instead of
11354         using the regular Stelem.
11355
11356         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
11357         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
11358         Because if we are a BaseIndexerAccess that value will be true.
11359         Fixes 43643.
11360
11361         * statement.cs (GotoCase.Resolve): Return after reporting an
11362         error, do not attempt to continue. 
11363
11364         * expression.cs (PointerArithmetic.Emit): If our operand is a
11365         long, convert our constants to match the operand before
11366         multiplying.  Convert to I type before adding.   Fixes 43670.
11367
11368 2003-05-14  Ravi Pratap  <ravi@ximian.com>
11369
11370         * enum.cs (ImplicitConversionExists) : Rename to
11371         ImplicitEnumConversionExists to remove ambiguity. 
11372
11373         * ecore.cs (NullCast): New type of cast expression class which
11374         basically is very similar to EmptyCast with the difference being
11375         it still is a constant since it is used only to cast a null to
11376         something else
11377         (eg. (string) null)
11378
11379         * convert.cs (ImplicitReferenceConversion): When casting a null
11380         literal, we return a NullCast.
11381
11382         * literal.cs (NullLiteralTyped): Remove - I don't see why this
11383         should be around anymore.
11384
11385         The renaming (reported was slightly wrong). Corrections:
11386
11387         ConvertImplicitStandard -> ImplicitConversionStandard
11388         ConvertExplicitStandard -> ExplicitConversionStandard
11389
11390         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
11391         before passing them in !
11392
11393         * convert.cs (ImplicitConversionStandard): When comparing for
11394         equal expr and target types, ensure that expr is not a
11395         NullLiteral.
11396
11397         In general, we must not be checking (expr_type ==
11398         target_type) in the top level conversion methods
11399         (ImplicitConversion, ExplicitConversion etc). This checking is
11400         done in the methods that they delegate to.
11401
11402 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
11403
11404         * convert.cs: Move Error_CannotConvertType,
11405         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
11406         ImplicitNumericConversion, ImplicitConversionExists,
11407         ImplicitUserConversionExists, StandardConversionExists,
11408         FindMostEncompassedType, FindMostSpecificSource,
11409         FindMostSpecificTarget, ImplicitUserConversion,
11410         ExplicitUserConversion, GetConversionOperators,
11411         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
11412         TryImplicitIntConversion, Error_CannotConvertImplicit,
11413         ConvertImplicitRequired, ConvertNumericExplicit,
11414         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
11415         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
11416         its own file.
11417
11418         Perform the following renames:
11419
11420         StandardConversionExists -> ImplicitStandardConversionExists
11421         ConvertImplicit -> ImplicitConversion
11422         ConvertImplicitStandard -> ImplicitStandardConversion
11423         TryImplicitIntConversion -> ImplicitIntConversion
11424         ConvertImplicitRequired -> ImplicitConversionRequired
11425         ConvertNumericExplicit -> ExplicitNumericConversion
11426         ConvertReferenceExplicit -> ExplicitReferenceConversion
11427         ConvertExplicit -> ExplicitConversion
11428         ConvertExplicitStandard -> ExplicitStandardConversion
11429
11430 2003-05-19  Martin Baulig  <martin@ximian.com>
11431
11432         * statement.cs (TypeInfo.StructInfo): Made this type protected.
11433         (TypeInfo): Added support for structs having structs as fields.
11434
11435         * ecore.cs (FieldExpr): Implement IVariable.
11436         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
11437         VariableInfo for the field.
11438
11439 2003-05-18  Martin Baulig  <martin@ximian.com>
11440
11441         * expression.cs (This.DoResolve): Report a CS0027 if we're
11442         emitting a field initializer.
11443
11444 2003-05-18  Martin Baulig  <martin@ximian.com>
11445
11446         * expression.cs (This.ResolveBase): New public function.
11447         (This.DoResolve): Check for CS0188.
11448
11449         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
11450         This.Resolve().
11451
11452         * ecore.cs (MethodGroupExpr.DoResolve): Set the
11453         `instance_expression' to null if we don't have any non-static
11454         methods.
11455
11456 2003-05-18  Martin Baulig  <martin@ximian.com>
11457
11458         Reworked the way how local variables and parameters are handled by
11459         the flow analysis code.
11460
11461         * statement.cs (TypeInfo, VariableMap): New public classes.
11462         (VariableInfo): New public class.  This is now responsible for
11463         checking whether a variable has been assigned.  It is used for
11464         parameters and local variables.
11465         (Block.EmitMeta): Take the InternalParameters as argument; compute
11466         the layout of the flow vectors here.
11467         (Block.LocalMap, Block.ParameterMap): New public properties.
11468         (FlowBranching): The .ctor doesn't get the InternalParameters
11469         anymore since Block.EmitMeta() now computes the layout of the flow
11470         vector.
11471         (MyStructInfo): This class is now known as `StructInfo' and nested
11472         in `TypeInfo'; we don't access this directly anymore.
11473
11474         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
11475         property and removed IsAssigned(), IsFieldAssigned(),
11476         SetAssigned() and SetFieldAssigned(); we now call them on the
11477         VariableInfo so we don't need to duplicate this code everywhere.
11478
11479         * expression.cs (ParameterReference): Added `Block block' argument
11480         to the .ctor.
11481         (LocalVariableReference, ParameterReference, This): The new
11482         VariableInfo class is now responsible for all the definite
11483         assignment stuff.
11484
11485         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
11486         IsParameterAssigned, SetParameterAssigned): Removed.
11487
11488 2003-05-18  Martin Baulig  <martin@ximian.com>
11489
11490         * typemanager.cs (InitCoreTypes): Try calling
11491         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
11492         the 3-args-version.  Corlib now also needs our `void_type'.
11493         (GetMethod): Added overloaded version which takes an optional
11494         `bool report_errors' to allow lookups of optional methods.
11495
11496 2003-05-12  Martin Baulig  <martin@ximian.com>
11497
11498         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
11499         only used for locals and not for parameters.
11500
11501 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
11502
11503         * support.cs (InternalParameters.ParameterType): Return the
11504         ExternalType of the parameter.
11505
11506         * parameter.cs (Parameter.ExternalType): drop the two arguments,
11507         they were unused.
11508
11509 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
11510
11511         * class.cs (MethodData.Define): Do not set the `newslot' on
11512         interface members, if they are also flagged as "override".
11513
11514         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
11515         better code for ++i and i++.  This only works for static fields
11516         and local variables.
11517
11518         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
11519         want to pull the DeclSpace out of the builder_to_declspace instead
11520         of the TypeBuilder (like in TypeContainer.FindMembers).
11521
11522         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
11523         instead of LookupTypeContainer.  Fixes the crash on .NET for
11524         looking up interface members.
11525
11526         * const.cs: Create our own emit context during the Definition
11527         stage, so that constants are evaluated in the proper context, when
11528         a recursive definition happens.
11529
11530 2003-05-11  Martin Baulig  <martin@ximian.com>
11531
11532         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
11533         new block for a switch section.
11534         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
11535         the adding/lookup in the switch block.  Fixes #39828.
11536
11537 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
11538
11539         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
11540         functionality: I needed to convert the data after I had performed
11541         the add/sub operation into the operands type size.
11542
11543         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
11544         pass the type for the box operation, otherwise the resulting
11545         object would have been of type object.
11546
11547         (BoxedCast): Add constructor to specify the type to box as.
11548
11549 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
11550
11551         * iterators.cs: I was reusing the `count' variable inadvertently,
11552         take steps to not allow this to happen.
11553
11554 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
11555
11556         * attribute.cs (Attribute.Resolve): Params attributes are encoded
11557         by creating an array at the point where the params starts and
11558         putting all those arguments there, then adjusting the size of the
11559         array.
11560
11561 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
11562
11563         * expression.cs (New.AddressOf): Implement interface
11564         IMemoryLocation.  This is used when the `new' operator is used in
11565         the context of an invocation to a method on a value type.
11566
11567         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
11568         example. 
11569
11570         * namespace.cs: Also check the using aliases here.
11571
11572         * driver.cs: Move the test for using validity after the types have
11573         been entered, so we do a single pass that also includes the using
11574         aliases. 
11575
11576         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
11577         in the regular case.   CreateSiblingForFinally is doing extra
11578         error checking.
11579
11580         * attribute.cs (GetAttributeArgumentExpression): Store the result
11581         on an out value, and use the return value to indicate failure
11582         instead of using null (which is a valid return for Constant.GetValue).
11583
11584         * statement.cs: Perform the analysis flow for the increment
11585         portion after the statement, because this will be the real flow of
11586         execution.  Fixes #42385
11587
11588         * codegen.cs (EmitContext.EmitArgument,
11589         EmitContext.EmitStoreArgument): New helper functions when the
11590         RemapToProxy flag is set.
11591
11592         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
11593         function.
11594
11595         Add support for remapping parameters. 
11596
11597         * iterators.cs: Propagate parameter values;  Store parameter
11598         values in the proxy classes.
11599
11600 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
11601
11602         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
11603         need a proxy reference;  I do not know what I was thinking
11604
11605         * cs-parser.jay (constructor_initializer): catch another error,
11606         and display nice message.
11607
11608         (field_declaration): catch void field declaration
11609         to flag a better error. 
11610
11611         * class.cs (MemberBase.CheckBase): Report an error instead of a
11612         warning if a new protected member is declared in a struct. 
11613         (Field.Define): catch the error of readonly/volatile.
11614
11615         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
11616
11617         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
11618         volatile variable is taken
11619
11620 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
11621
11622         * statement.cs (Fixed.Resolve): Report an error if we are not in
11623         an unsafe context.
11624
11625 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
11626
11627         * typemanager.cs: reuse the code that handles type clashes for
11628         delegates and enumerations.
11629
11630         * class.cs (Report28): Always report.
11631
11632         * expression.cs (EncodeAsAttribute): Allow nulls here.
11633
11634 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
11635
11636         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
11637         the functionality for testing whether an expression is valid for
11638         an attribute here.  Also handle the case of arrays of elements
11639         being stored. 
11640
11641         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
11642         encoding a linear array into an array of objects that are suitable
11643         to be passed to an CustomAttributeBuilder.
11644
11645         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
11646
11647         * ecore.cs: (FieldExpr): Handle field remapping here.
11648
11649         * iteratators.cs: Pass the instance variable (if the method is an
11650         instance method) to the constructors, so we can access the field
11651         variables on the class.
11652
11653         TODO: Test this with structs.  I think the THIS variable on
11654         structs might have to be a pointer, and not a refenrece
11655
11656 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
11657
11658         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
11659         local variables to fields in a proxy class.
11660
11661         * iterators.cs (PopulateProxy): Rename our internal fields to
11662         <XXX>.  
11663         Create a <THIS> field if we are an instance method, so we can
11664         reference our parent container variables.
11665         (MapVariable): Called back from the EmitContext code to enter a
11666         new variable to field mapping into the proxy class (we just create
11667         a FieldBuilder).
11668
11669         * expression.cs
11670         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
11671         for using the remapped locals to fields.
11672
11673         I placed the code here, because that gives the same semantics to
11674         local variables, and only changes the Emit code.
11675
11676         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
11677         statements inside iterators.
11678         (VariableInfo): Add a FieldBuilder for the cases when we are
11679         remapping local variables to fields in a proxy class
11680
11681         * ecore.cs (SimpleNameResolve): Avoid testing two times for
11682         current_block != null.
11683
11684         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
11685         not cope with strings, as it has been moved to the
11686         TableSwitchEmit.  Fixed bug in switch generation.
11687
11688         * expression.cs (New.DoResolve): Provide more context for the user
11689         when reporting an error.
11690
11691         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
11692         pointers. 
11693
11694         * expression.cs (MemberAccess.DoResolve): When we get a type back,
11695         check the permissions for it.  Note than in a type-resolution
11696         context the check was already present in DeclSpace.ResolveType,
11697         but was missing from the MemberAccess.
11698
11699         (ArrayCreation.CheckIndices): warn if the user has
11700         more nested levels of expressions, but there are no more
11701         dimensions specified.  Avoids crash on bug 41906.
11702
11703 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
11704
11705         * statement.cs (Block): replace Implicit bool, for a generic
11706         flags.   
11707         New flag: `Unchecked'.  This is used during the EmitMeta phase
11708         (which is out-of-line with the regular Resolve/Emit process for a
11709         statement, as this is done ahead of time, but still gets a chance
11710         to call constant resolve).
11711
11712         (Block.Flags): new enum for adding a new flag.
11713
11714         (Block.EmitMeta): track the state of unchecked.
11715
11716         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
11717         to enable constant resolution to work there as well.
11718
11719 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
11720
11721         * typemanager.cs (ienumerable_type): Also look up
11722         System.Collections.IEnumerable. 
11723
11724 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
11725
11726         TODO: Test more than one conditional per method.
11727
11728         * class.cs (Indexer.Define): Report the location where the user is
11729         referencing the unsupported feature.
11730
11731         (MethodData): Overload the use of `conditionals' to
11732         minimize the creation of needless ArrayLists.   This saves roughly
11733         212kb on my machine.
11734
11735         (Method): Implement the new IIteratorContainer interface.
11736         (Method.SetYields): Implement the method by setting the ModFlags
11737         to contain METHOD_YIELDS.
11738
11739         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
11740         which just got set to null.
11741
11742         * iterators.cs: New file.
11743
11744         (Yield, YieldBreak): New statements.
11745
11746         * statement.cs (Return.Resolve): Flag an error if we are used in
11747         an iterator method.
11748
11749         * codegen.cs (InIterator): New flag set if the code is being
11750         compiled in an iterator method.
11751
11752         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
11753         internal modifier, and we just use it to avoid adding extra
11754         fields, as this is seldom used.  
11755
11756         * cs-parser.jay: Add yield_statement (yield and yield break).
11757
11758         * driver.cs: New flag -v2 to turn on version 2 features. 
11759
11760         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
11761         hashtable when v2 is enabled.
11762
11763 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
11764
11765         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
11766         there is already a namespace defined with this name.
11767
11768         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
11769         people upgraded their corlibs.
11770
11771         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
11772         always use fully qualified types, no need to use the compiler
11773         front end.
11774
11775         (TypeManager.IsNamespace): Use binarysearch.
11776
11777         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
11778         AddDelegate): I did not quite use the new IsValid API properly: I
11779         have to pass the short-name and the fullname.  I was passing only
11780         the basename instead of the fullname sometimes. 
11781
11782         (TypeContainer.DefineType): call NamespaceClash.
11783
11784         * interface.cs (Interface.DefineType): use NamespaceClash before
11785         defining the type.
11786
11787         * delegate.cs (Delegate.DefineType): use NamespaceClash before
11788         defining the type.
11789
11790         * enum.cs: (Enum.DefineType): use NamespaceClash before
11791         defining the type.
11792
11793         * typemanager.cs (: 3-line patch that gives us some tasty 11%
11794         speed increase.  First, use the negative_hits cache when we get a
11795         negative.  Second, add the type with its full original name
11796         instead of the new . and + encoded name (reflection uses + to
11797         separate type from a nested type).  Use LookupTypeReflection
11798         directly which bypasses the type->name hashtable (that we already
11799         know does not contain the type.
11800
11801         * decl.cs (DeclSpace.ResolveTypeExpr): track the
11802         location/container type. 
11803
11804         * driver.cs: When passing utf8, use directly the UTF8Encoding.
11805
11806 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
11807
11808         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
11809
11810         * delegate.cs (NewDelegate.Resolve): Test whether an instance
11811         method is being referenced in the method group from a static
11812         context, and report error 120 if so.
11813
11814         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
11815         Error118. 
11816
11817         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
11818         is created, we create the A namespace).
11819
11820         * cs-parser.jay: A namespace also introduces a DeclarationFound.
11821         Fixes #41591
11822
11823 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
11824
11825         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
11826         invocation to ModuleBuilder.GetType with the same values will
11827         return a new type instance, so we need to cache its return
11828         values. 
11829
11830         * expression.cs (Binary.ResolveOperator): Only allow the compare
11831         operators on enums if they are of the same type.
11832
11833         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
11834         types of ValueType on their own case.  Before we were giving them
11835         the same treatment as objects.
11836
11837         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
11838         fullname.  Short name is used to compare against container name.
11839         Fullname is used to check against defined namespace names.
11840
11841         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
11842         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
11843
11844         (Method.CheckBase): Call parent.
11845         (MemberBase.CheckBase): Check for protected members on sealed
11846         classes.
11847         (PropertyBase.CheckBase): Call parent.
11848         (Field.Define): Call parent.
11849
11850         * report.cs: Negative error codes are now mapped to 8000 - code,
11851         so that the display is render more nicely.
11852
11853         * typemanager.cs: Do not use try/catch, instead report a regular
11854         error. 
11855
11856         (GetPointerType, GetReferenceType): These methods provide
11857         mechanisms to obtain the T* and T& from a T.  We had the code
11858         previously scattered around the code base, and it also used
11859         TypeManager.LookupType that would go through plenty of caches.
11860         This one goes directly to the type source.
11861
11862         In some places we did the Type.GetType followed by
11863         ModuleBuilder.GetType, but not in others, so this unifies the
11864         processing as well.
11865
11866         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
11867         statements now that we have namespace information.
11868
11869         * typemanager.cs (IsNamespace): New method, returns whether the
11870         string presented is a namespace or not.
11871
11872         (ComputeNamespaces): New public entry point, computes the list of
11873         available namespaces, using the GetNamespaces API call in Mono, or
11874         the slower version in MS.NET.   
11875
11876         Now before we start the semantic analysis phase, we have a
11877         complete list of namespaces including everything that the user has
11878         provided.
11879
11880         Deleted old code to cache namespaces in .nsc files.
11881
11882 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
11883
11884         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
11885         class/struct location definition Location for the implicit
11886         constructor location.
11887
11888         (Operator.Define): Use the location of the operator for the
11889         implicit Method definition.
11890
11891         (Constructor.Emit): use the constructor location for the implicit
11892         base initializer constructor.
11893
11894         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
11895         and the Expression class now contains two new methods:
11896
11897         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
11898         isolate type lookup from the rest of the resolution process.
11899
11900         Since we use Expressions to hold type definitions due to the way
11901         we parse the input we have historically overloaded Resolve to
11902         perform the Type lookups if a special flag is passed.  Now this is
11903         eliminated and two methods take their place. 
11904
11905         The differences in the two methods between xStep and xTerminal is
11906         that xStep is involved in our current lookup system that uses
11907         SimpleNames to compose a name, while xTerminal is used just to
11908         catch the case where the simplename lookup failed.
11909
11910 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
11911
11912         * expression.cs (ResolveMemberAccess): Remove redundant code.
11913         TypeExpr expressions are always born fully resolved.
11914
11915         * interface.cs (PopulateMethod): Do not lookup the types twice.
11916         We were doing it once during SemanticAnalysis and once during
11917         PopulateMethod.
11918
11919         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
11920         in local variable type definitions, were being returned as a
11921         SimpleName (we decomposed everything into a string), that is
11922         because primary_expression was being used instead of a type in the
11923         grammar (reduce/reduce conflicts).
11924
11925         The part that was wrong is that we converted the expression into a
11926         string (an oversimplification in one hand, compounded with primary
11927         expressions doing string concatenation).
11928
11929         So things like:
11930
11931         A.B.C [] x;
11932
11933         Would return "A.B.C[]" as a SimpleName.  This stopped things like
11934         using clauses from working on this particular context.  And a type
11935         was being matched directly against "A.B.C[]".
11936
11937         We now use the correct approach, and allow for ComposedCast to be
11938         part of the unary expression.  So the "A.B.C []" become a composed
11939         cast of "A.B.C" (as a nested group of MemberAccess with a
11940         SimpleName at the end) plus the rank composition "[]". 
11941
11942         Also fixes 35567
11943
11944 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
11945
11946         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
11947         for the access level checking.
11948
11949         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
11950         `TypeContainer container', because I kept getting confused when I
11951         was debugging this code.
11952
11953         * expression.cs (Indexers): Instead of tracking getters/setters,
11954         we now track them in parallel.  We create one arraylist less, but
11955         most importantly it is possible now for the LValue code to find a
11956         matching get for a set.
11957
11958         (IndexerAccess.DoResolveLValue): Update the code.
11959         GetIndexersForType has been modified already to extract all the
11960         indexers from a type.  The code assumed it did not.
11961
11962         Also make the code set the correct return type for the indexer.
11963         This was fixed a long time ago for properties, but was missing for
11964         indexers.  It used to be void_type.
11965
11966         (Binary.Emit): Test first for doubles instead of
11967         floats, as they are more common.
11968
11969         (Binary.EmitBranchable): Use the .un version of the branch opcodes
11970         when dealing with floats and the <=, >= operators.  This fixes bug
11971         #39314 
11972
11973         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
11974         to load the array value by emitting a load on the foreach variable
11975         type.  This was incorrect.  
11976
11977         We now emit the code to load an element using the the array
11978         variable type, and then we emit the conversion operator.
11979
11980         Fixed #40176
11981
11982 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
11983
11984         * attribute.cs: Avoid allocation of ArrayLists in the common case.
11985
11986 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
11987
11988         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
11989         test for protection before we test for signatures. 
11990
11991         (MethodSignature.ToString): implement.
11992
11993         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
11994         to the case where we reduced into a LongConstant.
11995
11996         * decl.cs (CheckAccessLevel): If the type is an array, we can not
11997         depend on whether the information is acurrate, because the
11998         Microsoft runtime will always claim that the array type is public,
11999         regardless of the real state.
12000
12001         If the type is a pointer, another problem happens: the type is
12002         reported as non-public in Microsoft.  
12003
12004         In both cases we have to call CheckAccessLevel recursively with
12005         the underlying type as the argument to be tested.
12006
12007 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12008
12009         * assign.cs (Assign.Emit): If we are dealing with a compound
12010         assignment expression, we should use the code path that stores the
12011         intermediate result in a temporary value.  This fixes #40903.
12012
12013         *expression.cs (Indirection.ToString): Provide ToString method for
12014         debugging. 
12015
12016 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12017
12018         * class.cs: Null out fields holding references to Block objects so
12019         they can be garbage collected.
12020
12021         * expression.cs (OverloadResolve): Remove unused local.
12022
12023 2003-04-07  Martin Baulig  <martin@ximian.com>
12024
12025         * codegen.cs (EmitContext.CurrentFile): New public field.
12026         (EmitContext.Mark): Use the CurrentFile to check whether the
12027         location is in the correct file.
12028         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12029
12030 2003-04-07  Martin Baulig  <martin@ximian.com>
12031
12032         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12033
12034         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12035         location.  [FIXME: The location argument which gets passed to this
12036         method is sometimes wrong!]
12037
12038 2003-04-07  Nick Drochak <ndrochak@gol.com>
12039
12040         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12041
12042 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12043
12044         * expression.cs (Indirection.EmitAssign): We were using the
12045         temporary, but returning immediately instead of continuing the
12046         EmitAssing flow.
12047
12048 2003-04-06  Martin Baulig  <martin@ximian.com>
12049
12050         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12051         if it's a nested child, but also deriving from the outer class.
12052         See test 190.cs.
12053
12054         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12055         nested child, but also deriving from the outer class.  See
12056         test-190.cs.
12057         (FilterWithClosure): We may access private members of the outer
12058         class if we're a nested child and deriving from the outer class.
12059         (RealMemberLookup): Only set `closure_private_ok' if the
12060         `original_bf' contained BindingFlags.NonPublic.
12061
12062 2003-04-05  Martin Baulig  <martin@ximian.com>
12063
12064         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12065
12066 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12067
12068         * class.cs (Event.Define): Do not allow abstract events to have
12069         initializers. 
12070
12071 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12072
12073         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12074         block in event declarations.
12075
12076         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12077         value type, get its address.
12078
12079         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12080         leaving a class on the stack instead of a boolean value (int
12081         0/1).  Change the code so we compare against null, and then the
12082         result against zero.
12083
12084         * class.cs (TypeContainer.GetClassBases): We were checking for the
12085         parent class being sealed too late.
12086
12087         * expression.cs (Binary.Emit): For <= and >= when dealing with
12088         floating point values, use cgt.un and clt.un instead of cgt and
12089         clt alone.
12090
12091 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12092
12093         * statement.cs: Apply the same optimization as MS: skip the 
12094         GetEnumerator returning an IEnumerator, and use the one returning a 
12095         CharEnumerator instead. This allows us to avoid the try-finally block 
12096         and the boxing.
12097
12098 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12099
12100         * cs-parser.jay: Attributes cannot be applied to
12101                          namespaces. Fixes #40473
12102
12103 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12104
12105         * class.cs:
12106         (Add*): check if the name is valid using the full name for constants,
12107         fields, properties and events.
12108
12109 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12110
12111         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12112         char constants to be part of the enumeration.
12113
12114         * expression.cs (Conditional.DoResolve): Add support for operator
12115         true. Implements the missing functionality from 14.12
12116
12117         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12118         operator true/false as required by the spec.
12119
12120         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12121         implicit conversion to boolean.
12122
12123         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12124         also one where the type implements `operator true'. 
12125
12126         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12127         get an expression that will invoke operator true based on an
12128         expression.  
12129
12130         (GetConversionOperators): Removed the hack that called op_True
12131         here.  
12132
12133         (Expression.ResolveBoolean): Move this from Statement.
12134
12135 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12136
12137         * ecore.cs (FieldExpr): do not allow initialization of initonly
12138         fields on derived classes
12139
12140 2003-03-13  Martin Baulig  <martin@ximian.com>
12141
12142         * statement.cs (Block.Emit): Call ig.BeginScope() and
12143         ig.EndScope() when compiling with debugging info; call
12144         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12145
12146 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12147
12148         * expression.cs (Indexers): Do not construct immediately, allow
12149         for new members to be appended as we go.  Fixes 38143
12150
12151 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12152
12153         * expression.cs: save/restore context when resolving an unchecked
12154         expression.
12155
12156 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12157
12158         * cfold.cs: Catch division by zero in modulus operator during
12159         constant folding.
12160
12161 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12162
12163         * interface.cs (Interface.DefineMembers): Avoid defining members
12164         twice. 
12165
12166 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12167
12168         * driver.cs: handle the +/- options for -noconfig
12169
12170         * statement.cs (Unckeched.Resolve): Also track the state of
12171         unchecked in the Resolve phase.
12172
12173 2003-02-27  Martin Baulig  <martin@ximian.com>
12174
12175         * ecore.cs (Expression.MemberLookup): Don't create a
12176         MethodGroupExpr for something which is not a method.  Fixes #38291.
12177
12178 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12179
12180         * class.cs (MemberBase.CheckParameters): Also check that the type
12181         is unmanaged if it is a pointer.
12182
12183         * expression.cs (SizeOf.Resolve): Add location information.
12184
12185         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12186         a managed type is declared.
12187
12188         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12189         parameter modifiers as well.  Fixes bug 38606
12190
12191         * class.cs: Very sad.  Am backing out the speed up changes
12192         introduced by the ArrayList -> Array in the TypeContainer, as they
12193         were not actually that much faster, and introduced a bug (no error
12194         reports on duplicated methods).
12195
12196         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12197         source first, this will guarantee that we have a valid expression
12198         before calling in lower levels functions that will require a
12199         resolved object.  Then use this original_source in the
12200         target.ResolveLValue instead of the original source that was
12201         passed to us.
12202
12203         Another change.  Use target.Resolve instead of LValueResolve.
12204         Although we are resolving for LValues, we will let the Assign code
12205         take care of that (it will be called again from Resolve).  This
12206         basically allows code like this:
12207
12208         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12209         class Y { void A (X x) { x [0] += o; }
12210
12211         The problem was that the indexer was trying to resolve for
12212         set_Item (idx, object o) and never finding one.  The real set_Item
12213         was set_Item (idx, X).  By delaying the process we get the right
12214         semantics. 
12215
12216         Fixes bug 36505
12217
12218 2003-02-23  Martin Baulig  <martin@ximian.com>
12219
12220         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12221         while calling DoEmit ().
12222
12223         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12224         source files; if you use the #line directive inside a method, the
12225         compiler stops emitting line numbers for the debugger until it
12226         reaches the end of the method or another #line directive which
12227         restores the original file.
12228
12229 2003-02-23  Martin Baulig  <martin@ximian.com>
12230
12231         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12232
12233 2003-02-23  Martin Baulig  <martin@ximian.com>
12234
12235         * statement.cs (Block.AddChildVariableNames): We need to call this
12236         recursively, not just for our immediate children.
12237
12238 2003-02-23  Martin Baulig  <martin@ximian.com>
12239
12240         * class.cs (Event.Define): Always make the field private, like csc does.
12241
12242         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12243         actually work, fixes bug #37521.
12244
12245 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12246
12247         * delegate.cs: When creating the various temporary "Parameters"
12248         classes, make sure that we call the ComputeAndDefineParameterTypes
12249         on those new parameters (just like we do with the formal ones), to
12250         allow them to be resolved in the context of the DeclSpace.
12251
12252         This fixes the bug that Dick observed in Bugzilla #38530.
12253
12254 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12255
12256         * expression.cs (ResolveMemberAccess): When resolving a constant,
12257         do not attempt to pull a constant if the value was not able to
12258         generate a valid constant.
12259
12260         * const.cs (LookupConstantValue): Do not report more errors than required.
12261
12262 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12263
12264         * expression.cs: fixes bug #38328.
12265
12266 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12267
12268         * class.cs: Changed all the various members that can be part of a
12269         class from being an ArrayList to be an Array of the right type.
12270         During the DefineType type_list, interface_list, delegate_list and
12271         enum_list are turned into types, interfaces, delegates and enums
12272         arrays.  
12273
12274         And during the member population, indexer_list, event_list,
12275         constant_list, field_list, instance_constructor_list, method_list,
12276         operator_list and property_list are turned into their real arrays.
12277
12278         Although we could probably perform this operation earlier, for
12279         good error reporting we need to keep the lists and remove the
12280         lists for longer than required.
12281
12282         This optimization was triggered by Paolo profiling the compiler
12283         speed on the output of `gen-sample-program.pl' perl script. 
12284
12285         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
12286         not crash in methods like MemberLookupFailed that use this field.  
12287
12288         This problem arises when the compiler fails to resolve a type
12289         during interface type definition for example.
12290
12291 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
12292
12293         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
12294         inherit from System.Object, so we have to stop at null, not only
12295         when reaching System.Object.
12296
12297 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
12298
12299         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
12300         DeclaredOnly because the parent indexer might have had a different
12301         name, but did not loop until the top of the hierarchy was reached.
12302
12303         The problem this one fixes is 35492: when a class implemented an
12304         indexer from an interface, we were getting the interface method
12305         (which was abstract) and we were flagging an error (can not invoke
12306         abstract method).
12307
12308         This also keeps bug 33089 functioning, and test-148 functioning.
12309
12310         * typemanager.cs (IsSpecialMethod): The correct way of figuring
12311         out if a method is special is to see if it is declared in a
12312         property or event, or whether it is one of the predefined operator
12313         names.   This should fix correctly #36804.
12314
12315 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
12316
12317         The goal here is to remove the dependency on EmptyCast.Peel ().
12318         Killing it completely.
12319
12320         The problem is that currently in a number of places where
12321         constants are expected, we have to "probe" for an EmptyCast, and
12322         Peel, which is not the correct thing to do, as this will be
12323         repetitive and will likely lead to errors. 
12324
12325         The idea is to remove any EmptyCasts that are used in casts that
12326         can be reduced to constants, so we only have to cope with
12327         constants. 
12328
12329         This bug hunt was triggered by Bug 37363 and the desire to remove
12330         the duplicate pattern where we were "peeling" emptycasts to check
12331         whether they were constants.  Now constants will always be
12332         constants.
12333
12334         * ecore.cs: Use an enumconstant here instead of wrapping with
12335         EmptyCast.  
12336
12337         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
12338         throwing me off.  By handling this we can get rid of a few hacks.
12339
12340         * statement.cs (Switch): Removed Peel() code.
12341
12342 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
12343
12344         * class.cs: Location information for error 508
12345
12346         * expression.cs (New.DoResolve): Add a guard against double
12347         resolution of an expression.  
12348
12349         The New DoResolve might be called twice when initializing field
12350         expressions (see EmitFieldInitializers, the call to
12351         GetInitializerExpression will perform a resolve on the expression,
12352         and later the assign will trigger another resolution
12353
12354         This leads to bugs (#37014)
12355
12356         * delegate.cs: The signature for EndInvoke should contain any ref
12357         or out parameters as well.  We were not doing this in the past. 
12358
12359         * class.cs (Field.Define): Do not overwrite the type definition
12360         inside the `volatile' group.  Turns out that volatile enumerations
12361         were changing the type here to perform a validity test, which
12362         broke conversions. 
12363
12364 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
12365
12366         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
12367         and structs, we do not want to load the instance variable
12368
12369         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
12370         enum_type has to be handled like an object reference (implicit
12371         conversions exists from this to object), but the regular IsClass
12372         and IsValueType tests will never return true for this one.
12373
12374         Also we use TypeManager.IsValueType instead of type.IsValueType,
12375         just for consistency with the rest of the code (this is only
12376         needed if we ever use the construct exposed by test-180.cs inside
12377         corlib, which we dont today).
12378
12379 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
12380
12381         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
12382         just InternalCall.
12383
12384 2003-02-09  Martin Baulig  <martin@ximian.com>
12385
12386         * namespace.cs (Namespace..ctor): Added SourceFile argument.
12387         (Namespace.DefineNamespaces): New static public method; this is
12388         called when we're compiling with debugging to add all namespaces
12389         to the symbol file.
12390
12391         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
12392         pass it to the Namespace's .ctor.
12393
12394         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
12395         and MethodBase arguments; pass the namespace ID to the symwriter;
12396         pass the MethodBase instead of the token to the symwriter.
12397         (SymbolWriter.DefineNamespace): New method to add a namespace to
12398         the symbol file.
12399
12400 2003-02-09  Martin Baulig  <martin@ximian.com>
12401
12402         * symbolwriter.cs: New file.  This is a wrapper around
12403         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
12404         methods here in near future.
12405
12406 2003-02-09  Martin Baulig  <martin@ximian.com>
12407
12408         * codegen.cs (EmitContext.Mark): Just pass the arguments to
12409         ILGenerator.MarkSequencePoint() which are actually used by the
12410         symbol writer.
12411
12412 2003-02-09  Martin Baulig  <martin@ximian.com>
12413
12414         * location.cs (SourceFile): New public sealed class.  This
12415         contains the name and an index which is used in the location's token.
12416         (Location): Reserve an appropriate number of bits in the token for
12417         the source file instead of walking over that list, this gives us a
12418         really huge performance improvement when compiling with debugging.
12419
12420         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
12421         `SourceFile' argument instead of a string.
12422         (Driver.ProcessFile): Add all the files via Location.AddFile(),
12423         but don't parse/tokenize here, we need to generate the list of all
12424         source files before we do that.
12425         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
12426         the files.
12427
12428         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
12429         instead of a string.
12430
12431         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
12432         of a string.
12433
12434 2003-02-09  Martin Baulig  <martin@ximian.com>
12435
12436         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
12437         filename on `#line default'.
12438
12439 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
12440
12441         * statement.cs: don't clear the pinned var when the fixed statement
12442         returns from the method (fixes bug#37752).
12443
12444 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
12445
12446         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
12447         to IsValueType.
12448
12449 2003-02-07  Martin Baulig  <martin@ximian.com>
12450
12451         * driver.cs: Removed the `--debug-args' command line argument.
12452
12453         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
12454         automatically by the AsssemblyBuilder.
12455         (CodeGen.InitializeSymbolWriter): We don't need to call any
12456         initialization function on the symbol writer anymore.  This method
12457         doesn't take any arguments.
12458
12459 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
12460
12461         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
12462         from referenced assemblies as well.
12463
12464 2003-02-02  Martin Baulig  <martin@ximian.com>
12465
12466         * class.cs (MethodData.Emit): Generate debugging info for external methods.
12467
12468 2003-02-02  Martin Baulig  <martin@ximian.com>
12469
12470         * class.cs (Constructor.Emit): Open the symbol writer before
12471         emitting the constructor initializer.
12472         (ConstructorInitializer.Emit): Call ec.Mark() to allow
12473         single-stepping through constructor initializers.
12474
12475 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
12476
12477         * class.cs: Handle error 549: do not allow virtual methods in
12478         sealed classes. 
12479
12480 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
12481
12482         * decl.cs: Check access levels when resolving types
12483
12484 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
12485
12486         * statement.cs: Add parameters and locals set in catch blocks that might 
12487         return to set vector
12488
12489 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
12490
12491         * class.cs (Operator): Set the SpecialName flags for operators.
12492
12493         * expression.cs (Invocation.DoResolve): Only block calls to
12494         accessors and operators on SpecialName methods.
12495
12496         (Cast.TryReduce): Handle conversions from char constants.
12497
12498
12499 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
12500
12501         * statement.cs: small memory and time optimization in FlowBranching.
12502
12503 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
12504
12505         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
12506         problem that the last fix but in the other sid (Set).
12507
12508         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
12509         access when there is no indexer in the hierarchy.
12510
12511 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
12512
12513         * class.cs: Combine some if statements.
12514
12515 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12516
12517         * driver.cs: fixed bug #37187.
12518
12519 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
12520
12521         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
12522         any indexer, it's needed to build a list with all the indexers in the
12523         hierarchy (AllGetters), else we have problems. Fixes #35653.
12524
12525 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
12526
12527         * class.cs (MethodData.Define): It is wrong for an interface
12528         implementation to be static in both cases: explicit and implicit.
12529         We were only handling this in one case.
12530
12531         Improve the if situation there to not have negations.
12532
12533         * class.cs (Field.Define): Turns out that we do not need to check
12534         the unsafe bit on field definition, only on usage.  Remove the test.
12535
12536 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12537
12538         * driver.cs: use assembly.Location instead of Codebase (the latest
12539         patch made mcs fail when using MS assemblies).
12540
12541 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
12542
12543         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
12544         get the path to *corlib.dll.
12545
12546 2003-01-21  Nick Drochak <ndrochak@gol.com>
12547
12548         * cs-tokenizer.cs:
12549         * pending.cs:
12550         * typemanager.cs: Remove compiler warnings
12551
12552 2003-01-20  Duncan Mak  <duncan@ximian.com>
12553
12554         * AssemblyInfo.cs: Bump the version number to 0.19.
12555
12556 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12557
12558         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
12559
12560 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
12561
12562         * class.cs (Constructor::Emit): Emit debugging info for constructors.
12563
12564 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
12565
12566         * cs-parser.jay: Small fix: we were not comparing the constructor
12567         name correctly.   Thanks to Zoltan for the initial pointer.
12568
12569 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
12570
12571         * cs-tokenizer.cs: Set file name when specified with #line
12572
12573 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
12574
12575         * cs-parser.jay: Only perform the constructor checks here if we
12576         are named like the class;  This will help provider a better
12577         error.  The constructor path is taken when a type definition is
12578         not found, but most likely the user forgot to add the type, so
12579         report that rather than the constructor error.
12580
12581 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
12582
12583         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
12584         allocations.
12585
12586 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12587
12588         * cs-parser.jay: Add cleanup call.
12589
12590 2003-01-13  Duncan Mak  <duncan@ximian.com>
12591
12592         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
12593         consistent with other methods.
12594
12595 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
12596
12597         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
12598
12599 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
12600
12601         * attribute.cs: only set GuidAttr to true when we have a
12602         GuidAttribute.
12603
12604 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12605
12606         * ecore.cs:
12607         * expression.cs:
12608         * typemanager.cs: fixes to allow mcs compile corlib with the new
12609         Type.IsSubclassOf fix.
12610
12611 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
12612
12613         * expression.cs (LocalVariableReference.DoResolve): Classify a
12614         constant as a value, not as a variable.   Also, set the type for
12615         the variable.
12616
12617         * cs-parser.jay (fixed_statement): take a type instead of a
12618         pointer_type, so we can produce a better error message later.
12619
12620         * statement.cs (Fixed.Resolve): Flag types that are not pointers
12621         as an error.  
12622
12623         (For.DoEmit): Make inifinite loops have a
12624         non-conditional branch back.
12625
12626         (Fixed.DoEmit): First populate the pinned variables, then emit the
12627         statement, then clear the variables.  Before I was emitting the
12628         code once for each fixed piece.
12629
12630
12631 2003-01-08  Martin Baulig  <martin@ximian.com>
12632
12633         * statement.cs (FlowBranching.MergeChild): A break in a
12634         SWITCH_SECTION does not leave a loop.  Fixes #36155.
12635
12636 2003-01-08  Martin Baulig  <martin@ximian.com>
12637
12638         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
12639         lives in the same number space than `param_map'.  Fixes #36154.
12640
12641 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
12642
12643         * cs-parser.jay (constructor_declaration): Set the
12644         Constructor.ModFlags before probing for it.  This makes the
12645         compiler report 514, 515 and 132 (the code was there, but got
12646         broken). 
12647
12648         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
12649         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
12650         (GotoCase.Resolve): Set `Returns' to ALWAYS.
12651
12652 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
12653
12654         * enum.cs: create the enum static fields using the enum type.
12655
12656 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
12657
12658         * class.cs: don't try to create the ParamBuilder for the return
12659         type if it's not needed (and handle it breaking for the ms runtime
12660         anyway).
12661
12662 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
12663
12664         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
12665
12666 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
12667
12668         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
12669         the command.   This showed up while compiling the JANET source
12670         code, which used \r as its only newline separator.
12671
12672 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
12673
12674         * class.cs (Method.Define): If we are an operator (because it
12675         reuses our code), then set the SpecialName and HideBySig.  #36128
12676
12677 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
12678
12679         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
12680         exception, report error 120 `object reference required'.
12681
12682         * driver.cs: Add --pause option, used during to measure the size
12683         of the process as it goes with --timestamp.
12684
12685         * expression.cs (Invocation.DoResolve): Do not allow methods with
12686         SpecialName to be invoked.
12687
12688 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
12689
12690         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
12691         number before adding it.
12692
12693 2002-12-21  Ravi Pratap  <ravi@ximian.com>
12694
12695         * ecore.cs (StandardImplicitConversion): When in an unsafe
12696         context, we allow conversion between void * to any other pointer
12697         type. This fixes bug #35973.
12698
12699 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
12700
12701         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
12702         is not thrown when extensionless outputs are used 
12703
12704 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12705
12706         * rootcontext.cs: fixed compilation of corlib.
12707
12708 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
12709
12710         * attribute.cs (Attributes.Contains): Add new method.
12711
12712         * class.cs (MethodCore.LabelParameters): if the parameter is an
12713         `out' parameter, check that no attribute `[In]' has been passed.
12714
12715         * enum.cs: Handle the `value__' name in an enumeration.
12716
12717 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
12718
12719         * decl.cs: Added special case to allow overrides on "protected
12720         internal" methods
12721
12722 2002-12-18  Ravi Pratap  <ravi@ximian.com>
12723
12724         * attribute.cs (Attributes.AddAttributeSection): Rename to this
12725         since it makes much more sense.
12726
12727         (Attributes.ctor): Don't require a Location parameter.
12728
12729         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
12730
12731         * attribute.cs (ApplyAttributes): Remove extra Location parameters
12732         since we already have that information per attribute.
12733
12734         * everywhere : make appropriate changes.
12735
12736         * class.cs (LabelParameters): Write the code which actually
12737         applies attributes to the return type. We can't do this on the MS
12738         .NET runtime so we flag a warning in the case an exception is
12739         thrown.
12740
12741 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
12742
12743         * const.cs: Handle implicit null conversions here too.
12744
12745 2002-12-17  Ravi Pratap  <ravi@ximian.com>
12746
12747         * class.cs (MethodCore.LabelParameters): Remove the extra
12748         Type [] parameter since it is completely unnecessary. Instead
12749         pass in the method's attributes so that we can extract
12750         the "return" attribute.
12751
12752 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
12753
12754         * cs-parser.jay (parse): Use Report.Error to flag errors instead
12755         of ignoring it and letting the compile continue.
12756
12757         * typemanager.cs (ChangeType): use an extra argument to return an
12758         error condition instead of throwing an exception.
12759
12760 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
12761
12762         * expression.cs (Unary.TryReduce): mimic the code for the regular
12763         code path.  Perform an implicit cast in the cases where we can
12764         implicitly convert to one of the integral types, and then reduce
12765         based on that constant.   This fixes bug #35483.
12766
12767 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12768
12769         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
12770
12771 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12772
12773         * namespace.cs: fixed bug #35489.
12774
12775 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
12776
12777         * class.cs: Remove some dead code.
12778
12779         * cs-parser.jay: Estimate the number of methods needed
12780         (RootContext.MethodCount);
12781
12782         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
12783         numbers instead of StringBuilders.
12784
12785         * support.cs (PtrHashtable): Add constructor with initial size;
12786         We can now reduce reallocations of the method table.
12787
12788 2002-12-10  Ravi Pratap  <ravi@ximian.com>
12789
12790         * attribute.cs (ApplyAttributes): Keep track of the emitted
12791         attributes on a per-target basis. This fixes bug #35413.
12792
12793 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
12794
12795         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
12796         default to the Windows 1252 encoding.
12797
12798         (UnixParseOption): Support version, thanks to Alp for the missing
12799         pointer. 
12800
12801         * AssemblyInfo.cs: Add nice assembly information.
12802
12803         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
12804         (bug 35169).
12805
12806         * cs-parser.jay: Allow a trailing comma before the close bracked
12807         in the attribute_section production.
12808
12809         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
12810         address of the instance was being taken, I will take this out,
12811         because we take the address of the object immediately here.
12812
12813 2002-12-09  Ravi Pratap  <ravi@ximian.com>
12814
12815         * typemanager.cs (AreMultipleAllowed): Take care of the most
12816         obvious case where attribute type is not in the current assembly -
12817         stupid me ;-)
12818
12819 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
12820
12821         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
12822         definitions, instead of doing that afterwards.  
12823
12824         Also we use a nice little hack, depending on the constructor, we
12825         know if we are a "composed" name or a simple name.  Hence, we
12826         avoid the IndexOf test, and we avoid 
12827
12828         * codegen.cs: Add code to assist in a bug reporter to track down
12829         the source of a compiler crash. 
12830
12831 2002-12-07  Ravi Pratap  <ravi@ximian.com>
12832
12833         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
12834         types have been emitted for a given element and flag an error
12835         if something which does not have AllowMultiple set is used more
12836         than once.
12837
12838         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
12839         attribute types and their corresponding AllowMultiple properties
12840
12841         (AreMultipleAllowed): Check the property for a given type.
12842
12843         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
12844         property in the case we have a TypeContainer.
12845
12846         (Attributes.AddAttribute): Detect duplicates and just skip on
12847         adding them. This trivial fix catches a pretty gross error in our
12848         attribute emission - global attributes were being emitted twice!
12849
12850         Bugzilla bug #33187 is now fixed.
12851
12852 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
12853
12854         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
12855         instead of pp_and).
12856
12857         * expression.cs (Binary.ResolveOperator): I can only use the
12858         Concat (string, string, string) and Concat (string, string,
12859         string, string) if the child is actually a concatenation of
12860         strings. 
12861
12862 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
12863
12864         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
12865         context where we need a 2-character lookahead.
12866
12867         * pending.cs (PendingImplementation): Rework so we can keep track
12868         of interface types all the time, and flag those which were
12869         implemented by parents as optional.
12870
12871 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
12872
12873         * expression.cs (Binary.ResolveOperator): Use
12874         String.Concat(string,string,string) or
12875         String.Concat(string,string,string,string) when possible. 
12876
12877         * typemanager: More helper methods.
12878
12879
12880 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
12881
12882         * pending.cs: remove the bogus return from GetMissingInterfaces()
12883         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
12884
12885 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12886
12887         * namespace.cs: avoid duplicated 'using xxx' being added to
12888         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
12889         when we get more than one 'using' statement for the same namespace.
12890         Report a CS0105 warning for it.
12891
12892 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
12893
12894         * cs-tokenizer.cs (consume_identifier): use read directly, instead
12895         of calling getChar/putback, uses internal knowledge of it.    
12896
12897         (xtoken): Reorder tokenizer so most common patterns are checked
12898         first.  This reduces the compilation time in another 5% (from 8.11s
12899         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
12900
12901         The parsing time is 22% of the compilation in mcs, and from that
12902         64% is spent on the tokenization process.  
12903
12904         I tried using a binary search for keywords, but this is slower
12905         than the hashtable.  Another option would be to do a couple of
12906         things:
12907
12908                 * Not use a StringBuilder, instead use an array of chars,
12909                   with a set value.  Notice that this way we could catch
12910                   the 645 error without having to do it *afterwards*.
12911
12912                 * We could write a hand-parser to avoid the hashtable
12913                   compares altogether.
12914
12915         The identifier consumption process takes 37% of the tokenization
12916         time.  Another 15% is spent on is_number.  56% of the time spent
12917         on is_number is spent on Int64.Parse:
12918
12919                 * We could probably choose based on the string length to
12920                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
12921                   computations. 
12922
12923         Another 3% is spend on wrapping `xtoken' in the `token' function.
12924
12925         Handle 0xa0 as whitespace (#34752)
12926
12927 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
12928
12929         * typemanager.cs (IsCLRType): New routine to tell whether a type
12930         is one of the builtin types.  
12931
12932         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
12933         typecode in more places instead of doing pointer comparissions.
12934         We could leverage some knowledge about the way the typecodes are
12935         laid out.
12936
12937         New code to cache namespaces in assemblies, it is currently not
12938         invoked, to be used soon.
12939
12940         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
12941
12942         * expression.cs (Binary.ResolveOperator): specially handle
12943         strings, and do not perform user-defined operator overloading for
12944         built-in types.
12945
12946 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
12947
12948         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
12949         internalcall as it is a pretty simple operation;  Avoid whenever
12950         possible to call Char.IsLetter.
12951
12952         (consume_identifier): Cut by half the number of
12953         hashtable calls by merging the is_keyword and GetKeyword behavior.
12954
12955         Do not short-circuit, because if we do, we
12956         report errors (ie, #if false && true would produce an invalid
12957         directive error);
12958
12959
12960 2002-11-24  Martin Baulig  <martin@ximian.com>
12961
12962         * expression.cs (Cast.TryReduce): If we're in checked syntax,
12963         check constant ranges and report a CS0221.  Fixes #33186.
12964
12965 2002-11-24  Martin Baulig  <martin@ximian.com>
12966
12967         * cs-parser.jay: Make this work for uninitialized variable
12968         declarations in the `for' initializer.  Fixes #32416.
12969
12970 2002-11-24  Martin Baulig  <martin@ximian.com>
12971
12972         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
12973         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
12974
12975 2002-11-24  Martin Baulig  <martin@ximian.com>
12976
12977         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
12978         argument; if true, we also check for user-defined conversions.
12979         This is only needed if both arguments are of a user-defined type.
12980         Fixes #30443, added test-175.cs.
12981         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
12982
12983         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
12984
12985 2002-11-24  Martin Baulig  <martin@ximian.com>
12986
12987         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
12988         function to get the store opcode.
12989         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
12990         only emit the Ldelema if the store opcode is Stobj.  You must run
12991         both test-34 and test-167 to test this.  Fixes #34529.
12992
12993 2002-11-23  Martin Baulig  <martin@ximian.com>
12994
12995         * ecore.cs (Expression.MemberLookup): Added additional
12996         `qualifier_type' argument which is used when we're being called
12997         from MemberAccess.DoResolve() and null if we're called from a
12998         SimpleName lookup.
12999         (Expression.MemberLookupFailed): New method to report errors; this
13000         does the CS1540 check and reports the correct error message.
13001
13002         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13003         argument for the CS1540 check and redone the way how we're dealing
13004         with private members.  See the comment in the source code for details.
13005         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13006         `closure_start_type' to `closure_qualifier_type' and check whether
13007         it's not null.  It was not this filter being broken, it was just
13008         being called with the wrong arguments.
13009
13010         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13011         and pass it the correct `qualifier_type'; this also does the error
13012         handling for us.
13013
13014 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13015
13016         * expression.cs (Invocation.EmitParams): If the we are dealing
13017         with a non-built-in value type, load its address as well.
13018
13019         (ArrayCreation): Use a a pretty constant instead
13020         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13021         static initializers.  
13022
13023         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13024         because they are not really value types, just glorified integers. 
13025
13026         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13027
13028         * ecore.cs: Remove redundant code for enumerations, make them use
13029         the same code path as everything else, fixes the casting issue
13030         with enumerations in Windows.Forms.
13031
13032         * attribute.cs: Do only cast to string if it is a string, the
13033         validation happens later.
13034
13035         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13036         people upgrade their corlibs.
13037
13038         * ecore.cs: Oops, enumerations were not following the entire code path
13039
13040 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13041
13042         * typemanager.cs (FilterWithClosure): Commented out the test for
13043         1540 in typemanager.cs, as it has problems when accessing
13044         protected methods from a parent class (see test-174.cs). 
13045
13046         * attribute.cs (Attribute.ValidateGuid): new method.
13047         (Attribute.Resolve): Use above.
13048
13049 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13050
13051         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13052
13053         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13054         handling for enumerations, as we only needed the TypeContainer
13055         functionality to begin with (this is required for the fix below to
13056         work for enums that reference constants in a container class for
13057         example). 
13058
13059         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13060
13061         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13062         a valid TypeBuilder to perform lookups on.o
13063
13064         * class.cs (InheritableMemberSignatureCompare): Use true in the
13065         call to GetGetMethod and GetSetMethod, because we are comparing
13066         the signature, and we need to get the methods *even* if they are
13067         private. 
13068
13069         (PropertyBase.CheckBase): ditto.
13070
13071         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13072         GotoCase.Resolve): Use Peel on EmpytCasts.
13073
13074         * ecore.cs (EmptyCast): drop child, add Peel method.
13075
13076 2002-11-17  Martin Baulig  <martin@ximian.com>
13077
13078         * ecore.cs (EmptyCast.Child): New public property.
13079
13080         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13081         label resolved to an EmptyCast.  Fixes #34162.
13082         (GotoCase.Resolve): Likewise.
13083         (Block.EmitMeta): Likewise.
13084
13085 2002-11-17  Martin Baulig  <martin@ximian.com>
13086
13087         * expression.cs (Invocation.BetterConversion): Prefer int over
13088         uint; short over ushort; long over ulong for integer literals.
13089         Use ImplicitConversionExists instead of StandardConversionExists
13090         since we also need to check for user-defined implicit conversions.
13091         Fixes #34165.  Added test-173.cs.
13092
13093 2002-11-16  Martin Baulig  <martin@ximian.com>
13094
13095         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13096         with the `true' and `false' literals.  Fixes #33151.
13097
13098 2002-11-16  Martin Baulig  <martin@ximian.com>
13099
13100         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13101         October 22nd; don't do the cs1540 check for static members.
13102
13103         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13104         now using our own filter here and doing the cs1540 check again.
13105
13106 2002-11-16  Martin Baulig  <martin@ximian.com>
13107
13108         * support.cs (InternalParameters): Don't crash if we don't have
13109         any fixed parameters.  Fixes #33532.
13110
13111 2002-11-16  Martin Baulig  <martin@ximian.com>
13112
13113         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13114         when looking up static methods to make this work on Windows.
13115         Fixes #33773.
13116
13117 2002-11-16  Martin Baulig  <martin@ximian.com>
13118
13119         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13120         a setter rather than using PropertyInfo.CanWrite.
13121
13122 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13123
13124         * class.cs: Allow acces to block member by subclasses. Fixes build
13125         breaker.
13126
13127 2002-11-14  Martin Baulig  <martin@ximian.com>
13128
13129         * class.cs (Constructor.Emit): Added the extern/block check.
13130         Fixes bug #33678.
13131
13132 2002-11-14  Martin Baulig  <martin@ximian.com>
13133
13134         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13135         iteration while looking for indexers, this is needed because the
13136         indexer may have a different name in our base classes.  Fixed the
13137         error reporting (no indexers at all, not get accessor, no
13138         overloaded match).  Fixes bug #33089.
13139         (IndexerAccess.DoResolveLValue): Likewise.
13140
13141 2002-11-14  Martin Baulig  <martin@ximian.com>
13142
13143         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13144         indexers.  Fixes the first part of bug #33089.
13145         (MethodSignature.InheritableMemberSignatureCompare): Added support
13146         for properties.
13147
13148 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13149
13150         * attribute.cs (Attribute.Resolve): Catch the
13151         NullReferenceException and report it since it isn't supposed to
13152         happen. 
13153
13154 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13155
13156         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13157         LogicalOr and LogicalAnd that can benefit from recursively
13158         handling EmitBranchable.  The code now should be nice for Paolo.
13159
13160 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13161
13162         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13163         the Type lookups, as we perform quite a number of lookups on
13164         non-Types.  This can be removed once we can deterministically tell
13165         whether we have a type or a namespace in advance.
13166
13167         But this might require special hacks from our corlib.
13168
13169         * TODO: updated.
13170
13171         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13172         and double which avoids a conversion from an integer to a double.
13173
13174         * expression.cs: tiny optimization, avoid calling IsConstant,
13175         because it effectively performs the lookup twice.
13176
13177 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13178
13179         But a bogus return here to keep the semantics of the old code
13180         until the Mono runtime is fixed.
13181
13182         * pending.cs (GetMissingInterfaces): New method used to remove all
13183         the interfaces that are already implemented by our parent
13184         classes from the list of pending methods. 
13185
13186         * interface.cs: Add checks for calls after ResolveTypeExpr.
13187
13188 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13189
13190         * class.cs (Class.Emit): Report warning 67: event not used if the
13191         warning level is beyond 3.
13192
13193         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13194         being a NullLiteral.
13195
13196         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13197         specifiers. 
13198
13199         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13200         path that might fail if a type can not be resolved.
13201
13202         * expression.cs (Binary.Emit): Emit unsigned versions of the
13203         operators. 
13204
13205         * driver.cs: use error 5.
13206
13207 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13208
13209         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13210
13211 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13212
13213         * cs-parser.jay (switch_section): A beautiful patch from Martin
13214         Baulig that fixed 33094.
13215
13216 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13217
13218         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13219         Check whether the base is abstract and report an error if so.
13220
13221         * expression.cs (IndexerAccess.DoResolveLValue,
13222         IndexerAccess.DoResolve): ditto. 
13223
13224         (Invocation.DoResolve): ditto.
13225
13226         (Invocation.FullMethodDesc): Improve the report string.
13227
13228         * statement.cs (Block): Eliminate IsVariableDefined as it is
13229         basically just a wrapper for GetVariableInfo.
13230
13231         * ecore.cs (SimpleName): Use new 
13232
13233         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13234         type, as we return the actual parameter ref/unref state on a
13235         different call.
13236
13237 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13238
13239         * support.cs: Return proper flags REF/OUT fixing the previous
13240         commit.  
13241
13242         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13243         not used to mean `ref' but `ref or out' in ParameterReference
13244
13245         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13246         full type signature instead of calling TypeManger.CSharpName
13247         ourselves. 
13248
13249         * support.cs (InternalParameters.ParameterDesc): Do not compare
13250         directly to the modflags, because REF/OUT will actually be bitsets
13251         if set. 
13252
13253         * delegate.cs (VerifyMethod): Check also the modifiers.
13254
13255         * cs-tokenizer.cs: Fix bug where floating point values with an
13256         exponent where a sign was missing was ignored.
13257
13258         * driver.cs: Allow multiple assemblies to be specified in a single
13259         /r: argument
13260
13261 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13262
13263         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13264         because identifiers after a parenthesis would end up in this kind
13265         of production, and we needed to desamiguate it for having casts
13266         like:
13267
13268                 (UserDefinedType *) xxx
13269
13270 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
13271
13272         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
13273         we should set on the Bindingflags.NonPublic, but not turn on
13274         private_ok.  private_ok controls whether a Private member is
13275         returned (this is chekced on the filter routine), while the
13276         BindingFlags.NonPublic just controls whether private/protected
13277         will be allowed.   This fixes the problem part of the problem of
13278         private properties being allowed to be used in derived classes.
13279
13280         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
13281         so we can call the children DoResolveLValue method (this will
13282         properly signal errors on lvalue assignments to base properties)
13283
13284         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
13285         getter are null, and we have a property info, we know that this
13286         happened because the lookup failed, so we report an error 122 for
13287         protection level violation.
13288
13289         We also silently return if setter and getter are null in the
13290         resolve functions, this condition only happens if we have flagged
13291         the error before.  This is the other half of the problem. 
13292
13293         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
13294         not have accessibility information, that is why we were returning
13295         true in the filter function in typemanager.cs.
13296
13297         To properly report 122 (property is inaccessible because of its
13298         protection level) correctly, we report this error in ResolveAccess
13299         by failing if both the setter and the getter are lacking (ie, the
13300         lookup failed). 
13301
13302         DoResolve and DoLResolve have been modified to check for both
13303         setter/getter being null and returning silently, the reason being
13304         that I did not want to put the knowledge about this error in upper
13305         layers, like:
13306
13307         int old = Report.Errors;
13308         x = new PropertyExpr (...);
13309         if (old != Report.Errors)
13310                 return null;
13311         else
13312                 return x;
13313
13314         So the property expr is returned, but it is invalid, so the error
13315         will be flagged during the resolve process. 
13316
13317         * class.cs: Remove InheritablePropertySignatureCompare from the
13318         class, as we no longer depend on the property signature to compute
13319         whether it is possible to implement a method or not.
13320
13321         The reason is that calling PropertyInfo.GetGetMethod will return
13322         null (in .NET, in Mono it works, and we should change this), in
13323         cases where the Get Method does not exist in that particular
13324         class.
13325
13326         So this code:
13327
13328         class X { public virtual int A { get { return 1; } } }
13329         class Y : X { }
13330         class Z : Y { public override int A { get { return 2; } } }
13331
13332         Would fail in Z because the parent (Y) would not have the property
13333         defined.  So we avoid this completely now (because the alternative
13334         fix was ugly and slow), and we now depend exclusively on the
13335         method names.
13336
13337         (PropertyBase.CheckBase): Use a method-base mechanism to find our
13338         reference method, instead of using the property.
13339
13340         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
13341         routines are gone now.
13342
13343         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
13344         names, they were incorrectly named.
13345
13346         * cs-tokenizer.cs: Return are more gentle token on failure. 
13347
13348         * pending.cs (PendingImplementation.InterfaceMethod): This routine
13349         had an out-of-sync index variable, which caused it to remove from
13350         the list of pending methods the wrong method sometimes.
13351
13352 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
13353
13354         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
13355         CanWrite, because those refer to this particular instance of the
13356         property, and do not take into account the fact that we can
13357         override single members of a property.
13358
13359         Constructor requires an EmitContext.  The resolution process does
13360         not happen here, but we need to compute the accessors before,
13361         because the resolution does not always happen for properties.
13362
13363         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
13364         subclass, before we did not update this flag, but we did update
13365         bindingflags. 
13366
13367         (GetAccessors): Drop this routine, as it did not work in the
13368         presence of partially overwritten set/get methods. 
13369
13370         Notice that this broke the cs1540 detection, but that will require
13371         more thinking. 
13372
13373 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13374
13375         * class.cs:
13376         * codegen.cs:
13377         * driver.cs: issue a warning instead of an error if we don't support
13378         debugging for the platform. Also ignore a couple of errors that may
13379         arise when trying to write the symbols. Undo my previous patch.
13380
13381 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13382
13383         * driver.cs: ignore /debug switch except for Unix platforms.
13384
13385 2002-10-23  Nick Drochak  <ndrochak@gol.com>
13386
13387         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
13388
13389 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
13390
13391         * driver.cs: Do not make mcs-debug conditional, so we do not break
13392         builds that use it.
13393
13394         * statement.cs (UsageVector.MergeChildren): I would like Martin to
13395         review this patch.  But basically after all the children variables
13396         have been merged, the value of "Breaks" was not being set to
13397         new_breaks for Switch blocks.  I think that it should be set after
13398         it has executed.  Currently I set this to the value of new_breaks,
13399         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
13400         conservative, but I do not understand this code very well.
13401
13402         I did not break anything in the build, so that is good ;-)
13403
13404         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
13405
13406 2002-10-20  Mark Crichton  <crichton@gimp.org>
13407
13408         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
13409
13410 2002-10-20  Nick Drochak  <ndrochak@gol.com>
13411
13412         * cfold.cs: Fixed compile blocker.
13413
13414 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
13415
13416         * driver.cs: I was chekcing the key, not the file.
13417
13418 2002-10-19  Ravi Pratap  <ravi@ximian.com>
13419
13420         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
13421         message that we were generating - we just need to silently return
13422         a null.
13423
13424 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
13425
13426         * class.cs (Event.Define): Change my previous commit, as this
13427         breaks the debugger.  This is a temporary hack, as it seems like
13428         the compiler is generating events incorrectly to begin with.
13429
13430         * expression.cs (Binary.ResolveOperator): Added support for 
13431         "U operator - (E x, E y)"
13432
13433         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
13434         y)".
13435
13436         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
13437         init-only variables, but this path did not take into account that
13438         there might be also instance readonly variables.  Correct this
13439         problem. 
13440
13441         This fixes bug 32253
13442
13443         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
13444         delegates as well.
13445
13446         * driver.cs: Change the extension for modules to `netmodule'
13447
13448         * cs-parser.jay: Improved slightly the location tracking for
13449         the debugger symbols.
13450
13451         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
13452         modifiers that were specified instead of the hardcoded value
13453         (FamAndAssem).  This was basically ignoring the static modifier,
13454         and others.  Fixes 32429.
13455
13456         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
13457         fixed a bug in the process (32476)
13458
13459         * expression.cs (ArrayAccess.EmitAssign): Patch from
13460         hwang_rob@yahoo.ca that fixes bug 31834.3
13461
13462 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
13463
13464         * driver.cs: Make the module extension .netmodule.
13465
13466 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
13467
13468         * driver.cs: Report an error if the resource file is not found
13469         instead of crashing.
13470
13471         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
13472         false, like Emit does.
13473
13474 2002-10-16  Nick Drochak  <ndrochak@gol.com>
13475
13476         * typemanager.cs: Remove unused private member.  Also reported mcs
13477         bug to report this as a warning like csc.
13478
13479 2002-10-15  Martin Baulig  <martin@gnome.org>
13480
13481         * statement.cs (Statement.Emit): Made this a virtual method; emits
13482         the line number info and calls DoEmit().
13483         (Statement.DoEmit): New protected abstract method, formerly knows
13484         as Statement.Emit().
13485
13486         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
13487
13488 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
13489
13490         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
13491         have fixed a remaining problem: not every AddXXXX was adding a
13492         fully qualified name.  
13493
13494         Now everyone registers a fully qualified name in the DeclSpace as
13495         being defined instead of the partial name.  
13496
13497         Downsides: we are slower than we need to be due to the excess
13498         copies and the names being registered this way.  
13499
13500         The reason for this is that we currently depend (on the corlib
13501         bootstrap for instance) that types are fully qualified, because
13502         we dump all the types in the namespace, and we should really have
13503         types inserted into the proper namespace, so we can only store the
13504         basenames in the defined_names array.
13505
13506 2002-10-10  Martin Baulig  <martin@gnome.org>
13507
13508         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
13509         from bug #31834, see the bug report for a testcase which is
13510         miscompiled.
13511
13512 2002-10-10  Martin Baulig  <martin@gnome.org>
13513
13514         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
13515         flow analysis code for this.
13516
13517         * statement.cs (Do, While, For): Tell the flow analysis code about
13518         infinite loops.
13519         (FlowBranching.UsageVector): Added support for infinite loops.
13520         (Block.Resolve): Moved the dead code elimination here and use flow
13521         analysis to do it.
13522
13523 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
13524
13525         * class.cs (Field.Define): Catch cycles on struct type
13526         definitions. 
13527
13528         * typemanager.cs (IsUnmanagedtype): Do not recursively check
13529         fields if the fields are static.  We only need to check instance
13530         fields. 
13531
13532         * expression.cs (As.DoResolve): Test for reference type.
13533
13534         * statement.cs (Using.ResolveExpression): Use
13535         ConvertImplicitRequired, not ConvertImplicit which reports an
13536         error on failture
13537         (Using.ResolveLocalVariableDecls): ditto.
13538
13539         * expression.cs (Binary.ResolveOperator): Report errors in a few
13540         places where we had to.
13541
13542         * typemanager.cs (IsUnmanagedtype): Finish implementation.
13543
13544 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
13545
13546         * expression.cs: Use StoreFromPtr instead of extracting the type
13547         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
13548
13549         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
13550         an enumeration value to a System.Enum, but System.Enum is not a
13551         value type, but an class type, so we need to box.
13552
13553         (Expression.ConvertExplicit): One codepath could return
13554         errors but not flag them.  Fix this.  Fixes #31853
13555
13556         * parameter.cs (Resolve): Do not allow void as a parameter type.
13557
13558 2002-10-06  Martin Baulig  <martin@gnome.org>
13559
13560         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
13561         if it's a class type and not a struct.  Fixes #31815.
13562
13563 2002-10-06  Martin Baulig  <martin@gnome.org>
13564
13565         * statement.cs: Reworked the flow analysis code a bit to make it
13566         usable for dead code elimination.
13567
13568 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13569
13570         * cs-parser.jay: allow empty source files. Fixes bug #31781.
13571
13572 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13573
13574         * expression.cs (ComposedCast.DoResolveType): A quick workaround
13575         to fix the test 165, will investigate deeper.
13576
13577 2002-10-04  Martin Baulig  <martin@gnome.org>
13578
13579         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
13580         finally blocks actually work.
13581         (Try.Resolve): We don't need to create a sibling for `finally' if
13582         there is no finally block.
13583
13584 2002-10-04  Martin Baulig  <martin@gnome.org>
13585
13586         * class.cs (Constructor.Define): The default accessibility for a
13587         non-default constructor is private, not public.
13588
13589 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
13590
13591         * class.cs (Constructor): Make AllowedModifiers public, add
13592         EXTERN.
13593
13594         * cs-parser.jay: Perform the modifiers test here, as the
13595         constructor for the Constructor class usually receives a zero
13596         because of the way we create it (first we create, later we
13597         customize, and we were never checking the modifiers).
13598
13599         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
13600         is a version of LookupTypeReflection that includes the type-name
13601         cache.  This can be used as a fast path for functions that know
13602         the fully qualified name and are only calling into *.GetType() to
13603         obtain a composed type.
13604
13605         This is also used by TypeManager.LookupType during its type
13606         composition.
13607
13608         (LookupType): We now also track the real type name, as sometimes
13609         we can get a quey for the real type name from things like
13610         ComposedCast.  This fixes bug 31422.
13611
13612         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
13613         complete type fullname, it does not have to go through the type
13614         resolution system to obtain the composed version of the type (for
13615         obtaining arrays or pointers).
13616
13617         (Conditional.Emit): Use the EmitBoolExpression to
13618         generate nicer code, as requested by Paolo.
13619
13620         (ArrayCreation.CheckIndices): Use the patch from
13621         hwang_rob@yahoo.ca to validate the array initializers. 
13622
13623 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
13624
13625         * class.cs (ConstructorInitializer.Emit): simplify code by using
13626         Invocation.EmitCall, and at the same time, fix the bugs in calling
13627         parent constructors that took variable arguments. 
13628
13629         * ecore.cs (Expression.ConvertNumericExplicit,
13630         Expression.ImplicitNumericConversion): Remove the code that
13631         manually wrapped decimal (InternalTypeConstructor call is now gone
13632         as well).
13633
13634         * expression.cs (Cast.TryReduce): Also handle decimal types when
13635         trying to perform a constant fold on the type.
13636
13637         * typemanager.cs (IsUnmanagedtype): Partially implemented.
13638
13639         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
13640         that only turned off an error report, and did nothing else. 
13641
13642 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
13643
13644         * driver.cs: Handle and ignore /fullpaths
13645
13646 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
13647
13648         * expression.cs (Binary.ResolveOperator): Catch the case where
13649         DoNumericPromotions returns true, 
13650
13651         (Binary.DoNumericPromotions): Simplify the code, and the tests.
13652
13653 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
13654
13655         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
13656         report error 70.
13657
13658 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
13659
13660         * ecore.cs (ConvertNumericExplicit): It is not enough that the
13661         conversion exists, but it is also required that the conversion be
13662         performed.  This manifested in "(Type64Enum) 2".  
13663
13664         * class.cs (TypeManager.AddMethod): The fix is not to change
13665         AddEnum, because that one was using a fully qualified name (every
13666         DeclSpace derivative does), but to change the AddMethod routine
13667         that was using an un-namespaced name.  This now correctly reports
13668         the duplicated name.
13669
13670         Revert patch until I can properly fix it.  The issue
13671         is that we have a shared Type space across all namespaces
13672         currently, which is wrong.
13673
13674         Options include making the Namespace a DeclSpace, and merge
13675         current_namespace/current_container in the parser.
13676
13677 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * cs-parser.jay: Improve error reporting when we get a different
13680         kind of expression in local_variable_type and
13681         local_variable_pointer_type. 
13682
13683         Propagate this to avoid missleading errors being reported.
13684
13685         * ecore.cs (ImplicitReferenceConversion): treat
13686         TypeManager.value_type as a target just like object_type.   As
13687         code like this:
13688
13689         ValueType v = 1;
13690
13691         Is valid, and needs to result in the int 1 being boxed before it
13692         is assigned to the value type v.
13693
13694         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
13695         to validate the enumeration name.
13696
13697         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
13698         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
13699         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
13700
13701         * ecore.cs (TryImplicitIntConversion): When doing an
13702         implicit-enumeration-conversion, check if the type is 64-bits and
13703         perform a conversion before passing to EnumConstant.
13704
13705 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
13706
13707         * decl.cs (Error_AmbiguousTypeReference); New routine used to
13708         report ambiguous type references.  Unlike the MS version, we
13709         report what the ambiguity is.   Innovation at work ;-)
13710
13711         (DeclSpace.FindType): Require a location argument to
13712         display when we display an ambiguous error.
13713
13714         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
13715
13716         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
13717
13718         * expression.cs (EmitDynamicInitializers): Apply patch from
13719         hwang_rob@yahoo.ca that fixes the order in which we emit our
13720         initializers. 
13721
13722 2002-09-21  Martin Baulig  <martin@gnome.org>
13723
13724         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
13725         delegate takes no arguments.
13726
13727 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
13728
13729         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
13730         from integers.
13731
13732         * expression.cs: Extract the underlying type.
13733
13734         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
13735
13736         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
13737
13738 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
13739
13740         * class.cs (TypeContainer.DefineType): We can not use the nice
13741         PackingSize with the size set to 1 DefineType method, because it
13742         will not allow us to define the interfaces that the struct
13743         implements.
13744
13745         This completes the fixing of bug 27287
13746
13747         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
13748         means also structs.  This fixes part of the problem. 
13749         (Expresion.ImplicitReferenceConversionExists): ditto.
13750
13751         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
13752         error if there were no errors reported during the type lookup
13753         process, to avoid duplicates or redundant errors.  Without this
13754         you would get an ambiguous errors plus a type not found.  We have
13755         beaten the user enough with the first error.  
13756
13757         (DeclSparce.FindType): Emit a warning if we have an ambiguous
13758         reference. 
13759
13760         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
13761         during the resolution process, stop the lookup, this avoids
13762         repeated error reports (same error twice).
13763
13764         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
13765
13766         * typemanager.cs (LookupType): Redo the type lookup code to match
13767         the needs of System.Reflection.  
13768
13769         The issue is that System.Reflection requires references to nested
13770         types to begin with a "+" sign instead of a dot.  So toplevel
13771         types look like: "NameSpace.TopLevelClass", and nested ones look
13772         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
13773         levels. 
13774
13775 2002-09-19  Martin Baulig  <martin@gnome.org>
13776
13777         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
13778         says that a method always returns or always throws an exception,
13779         don't report the CS0161.
13780
13781         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
13782         set `Returns = new_returns'.
13783
13784 2002-09-19  Martin Baulig  <martin@gnome.org>
13785
13786         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
13787         to an enum constant, check for a CS0176.
13788
13789 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
13790
13791         * class.cs (TypeContainer.CheckPairedOperators): Now we check
13792         for operators that must be in pairs and report errors.
13793
13794         * ecore.cs (SimpleName.DoResolveType): During the initial type
13795         resolution process, when we define types recursively, we must
13796         check first for types in our current scope before we perform
13797         lookups in the enclosing scopes.
13798
13799         * expression.cs (MakeByteBlob): Handle Decimal blobs.
13800
13801         (Invocation.VerifyArgumentsCompat): Call
13802         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
13803         I thought we were supposed to always call this, but there are a
13804         few places in the code where we dont do it.
13805
13806 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
13807
13808         * driver.cs: Add support in -linkres and -resource to specify the
13809         name of the identifier.
13810
13811 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13812
13813         * ecore.cs (StandardConversionExists): Sync with the conversion
13814         code: allow anything-* to void* conversions.
13815
13816         (FindMostSpecificSource): Use an Expression argument
13817         instead of a Type, because we might be handed over a Literal which
13818         gets a few more implicit conversions that plain types do not.  So
13819         this information was being lost.
13820
13821         Also, we drop the temporary type-holder expression when not
13822         required.
13823
13824 2002-09-17  Martin Baulig  <martin@gnome.org>
13825
13826         * class.cs (PropertyBase.CheckBase): Don't check the base class if
13827         this is an explicit interface implementation.
13828
13829 2002-09-17  Martin Baulig  <martin@gnome.org>
13830
13831         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
13832         different `IndexerName' attributes.
13833
13834         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
13835         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
13836         virtual CommonResolve().
13837
13838 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
13839
13840         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
13841         and convert that to the UnderlyingType.
13842
13843         * statement.cs (Foreach.Resolve): Indexers are just like variables
13844         or PropertyAccesses.
13845
13846         * cs-tokenizer.cs (consume_string): Track line numbers and columns
13847         inside quoted strings, we were not doing this before.
13848
13849 2002-09-16  Martin Baulig  <martin@gnome.org>
13850
13851         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
13852         resolve it.  This is needed for the definite assignment check of the
13853         instance expression, fixes bug #29846.
13854         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
13855
13856 2002-09-16  Nick Drochak  <ndrochak@gol.com>
13857
13858         * parameter.cs: Fix compile error.  Cannot reference static member
13859         from an instance object.  Is this an mcs bug?
13860
13861 2002-09-14  Martin Baulig  <martin@gnome.org>
13862
13863         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
13864         multiple times.  Fixes bug #30295, added test-166.cs.
13865
13866 2002-09-14  Martin Baulig  <martin@gnome.org>
13867
13868         * statement.cs (Block.Emit): Don't emit unreachable code.
13869         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
13870         `break' statements.
13871         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
13872
13873 2002-09-14  Martin Baulig  <martin@gnome.org>
13874
13875         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
13876         is set.
13877
13878 2002-09-14  Martin Baulig  <martin@gnome.org>
13879
13880         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
13881         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
13882         be false on the ms runtime.
13883
13884 2002-09-13  Martin Baulig  <martin@gnome.org>
13885
13886         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
13887         the CS0038 error message.
13888
13889 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
13890
13891         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
13892         constant inside, return it.
13893
13894 2002-09-12  Martin Baulig  <martin@gnome.org>
13895
13896         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
13897         implicit conversion can be done between enum types.
13898
13899         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
13900         check whether an implicit conversion to the current enum's UnderlyingType
13901         exists and report an error if not.
13902
13903         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
13904         without debugging support.
13905
13906         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
13907         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
13908
13909 2002-09-12  Martin Baulig  <martin@gnome.org>
13910
13911         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
13912
13913         * ecore.cs (IMemberExpr.DeclaringType): New property.
13914         (SimpleName.SimpleNameResolve): Check whether we're accessing a
13915         nonstatic member of an outer type (CS0038).
13916
13917 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
13918
13919         * driver.cs: Activate the using-error detector at warning level
13920         4 (at least for MS-compatible APIs).
13921
13922         * namespace.cs (VerifyUsing): Small buglett fix.
13923
13924         * pending.cs (PendingImplementation): pass the container pointer. 
13925
13926         * interface.cs (GetMethods): Allow for recursive definition.  Long
13927         term, I would like to move every type to support recursive
13928         definitions, not the current ordering mechanism that we have right
13929         now.
13930
13931         The situation is this: Attributes are handled before interfaces,
13932         so we can apply attributes to interfaces.  But some attributes
13933         implement interfaces, we will now handle the simple cases
13934         (recursive definitions will just get an error).  
13935
13936         * parameter.cs: Only invalidate types at the end if we fail to
13937         lookup all types.  
13938
13939 2002-09-09  Martin Baulig  <martin@gnome.org>
13940
13941         * ecore.cs (PropertyExpr.Emit): Also check for
13942         TypeManager.system_int_array_get_length so this'll also work when
13943         compiling corlib.  Fixes #30003.
13944
13945 2002-09-09  Martin Baulig  <martin@gnome.org>
13946
13947         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
13948         and throw an exception if we can't get the type's size.  Fixed #30040,
13949         added test-165.cs.
13950
13951 2002-09-09  Martin Baulig  <martin@gnome.org>
13952
13953         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
13954
13955         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
13956         context.  Fixes bug #30027.
13957
13958         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
13959         virtual functions.  Fixes bug #30043, added test-164.cs.
13960
13961 2002-09-08  Ravi Pratap  <ravi@ximian.com>
13962
13963         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
13964
13965 2002-09-08  Nick Drochak  <ndrochak@gol.com>
13966
13967         * driver.cs: Use an object to get the windows codepage since it's not a
13968         static property.
13969
13970 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
13971
13972         * statement.cs (For.Emit): for infinite loops (test == null)
13973         return whether there is a break inside, not always "true".
13974
13975         * namespace.cs (UsingEntry): New struct to hold the name of the
13976         using definition, the location where it is defined, and whether it
13977         has been used in a successful type lookup.
13978
13979         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
13980         strings.
13981
13982         * decl.cs: ditto.
13983
13984 2002-09-06  Ravi Pratap  <ravi@ximian.com>
13985
13986         * attribute.cs : Fix incorrect code which relied on catching
13987         a NullReferenceException to detect a null being passed in
13988         where an object was expected.
13989
13990 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
13991
13992         * statement.cs (Try): flag the catch variable as assigned
13993
13994         * expression.cs (Cast): Simplified by using ResolveType instead of
13995         manually resolving.
13996
13997         * statement.cs (Catch): Fix bug by using ResolveType.
13998
13999 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14000
14001         * expression.cs (BetterConversion): Special case for when we have
14002         a NullLiteral as the argument and we have to choose between string
14003         and object types - we choose string the way csc does.
14004
14005         * attribute.cs (Attribute.Resolve): Catch the
14006         NullReferenceException and report error #182 since the Mono
14007         runtime no more has the bug and having this exception raised means
14008         we tried to select a constructor which takes an object and is
14009         passed a null.
14010
14011 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14012
14013         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14014         message (1502, 1503) when we can't locate a method after overload
14015         resolution. This is much more informative and closes the bug
14016         Miguel reported.
14017
14018         * interface.cs (PopulateMethod): Return if there are no argument
14019         types. Fixes a NullReferenceException bug.
14020
14021         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14022         expressions too. Previously we were checking only in one place for
14023         positional arguments leaving out named arguments.
14024
14025         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14026         type to the enum type is not allowed. Remove code corresponding to
14027         that.
14028
14029         (ConvertNumericExplicit): Allow explicit conversions from
14030         the underlying type to enum type. This precisely follows the spec
14031         and closes a bug filed by Gonzalo.
14032
14033 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14034
14035         * compiler.csproj:
14036         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14037
14038 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14039
14040         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14041         it was important that we stored the right value after the
14042         reduction in `converted'.
14043
14044 2002-09-04  Martin Baulig  <martin@gnome.org>
14045
14046         * location.cs (Location.SymbolDocument): Use full pathnames for the
14047         source files.
14048
14049 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14050
14051         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14052         of the expression resolve mechanism, because that will catch the
14053         SimpleName error failures.
14054
14055         (Conditional): If we can not resolve the
14056         expression, return, do not crash.
14057
14058 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14059
14060         * cs-tokenizer.cs:
14061         (location): display token name instead of its number.
14062
14063 2002-08-28  Martin Baulig  <martin@gnome.org>
14064
14065         * expression.cs (Binary.ResolveOperator): Don't silently return
14066         but return an error if an operator cannot be applied between two
14067         enum types.
14068
14069 2002-08-28  Martin Baulig  <martin@gnome.org>
14070
14071         * class.cs (Constructor.Define): Set the permission attributes
14072         correctly instead of making all constructors public.
14073
14074 2002-08-28  Martin Baulig  <martin@gnome.org>
14075
14076         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14077         for private members before reporting a CS0103; if we find anything,
14078         it's a CS0122.
14079
14080 2002-08-28  Martin Baulig  <martin@gnome.org>
14081
14082         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14083         to check whether `closure_start_type == closure_invocation_type',
14084         we also need to check whether `m.DeclaringType == closure_invocation_type'
14085         before bypassing the permission checks.  We might be accessing
14086         protected/private members from the base class.
14087         (TypeManager.RealMemberLookup): Only set private_ok if private
14088         members were requested via BindingFlags.NonPublic.
14089
14090         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14091
14092         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14093         MethodGroupExpr.IsExplicitImpl if appropriate.
14094         (Invocation.DoResolve): Don't report the CS0120 for explicit
14095         interface implementations.
14096
14097 2002-08-27  Martin Baulig  <martin@gnome.org>
14098
14099         * expression.cs (Invocation.DoResolve): If this is a static
14100         method and we don't have an InstanceExpression, we must report
14101         a CS0120.
14102
14103 2002-08-25  Martin Baulig  <martin@gnome.org>
14104
14105         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14106         `==' between a valuetype and an object.
14107
14108 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14109
14110         * ecore.cs (TypeExpr): Provide a ToString method.
14111
14112 2002-08-24  Martin Baulig  <martin@gnome.org>
14113
14114         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14115         now called proggie.dbg and it's a binary file.
14116
14117 2002-08-23  Martin Baulig  <martin@gnome.org>
14118
14119         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14120
14121 2002-08-23  Martin Baulig  <martin@gnome.org>
14122
14123         * struct.cs (MyStructInfo.ctor): Make this work with empty
14124         structs; it's not allowed to use foreach() on null.
14125
14126 2002-08-23  Martin Baulig  <martin@gnome.org>
14127
14128         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14129         writer the full pathname of the generated assembly.
14130
14131 2002-08-23  Martin Baulig  <martin@gnome.org>
14132
14133         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14134         A `finally' block never returns or breaks; improved handling of
14135         unreachable code.
14136
14137 2002-08-23  Martin Baulig  <martin@gnome.org>
14138
14139         * statement.cs (Throw.Resolve): Allow `throw null'.
14140
14141 2002-08-23  Martin Baulig  <martin@gnome.org>
14142
14143         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14144         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14145         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14146         MemberLookup would return a wrong event if this is an explicit
14147         interface implementation and the class has an event with the same
14148         name.
14149
14150 2002-08-23  Martin Baulig  <martin@gnome.org>
14151
14152         * statement.cs (Block.AddChildVariableNames): New public method.
14153         (Block.AddChildVariableName): Likewise.
14154         (Block.IsVariableNameUsedInChildBlock): Likewise.
14155         (Block.AddVariable): Check whether a variable name has already
14156         been used in a child block.
14157
14158         * cs-parser.jay (declare_local_variables): Mark all variable names
14159         from the current block as being used in a child block in the
14160         implicit block.
14161
14162 2002-08-23  Martin Baulig  <martin@gnome.org>
14163
14164         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14165         find the symbol writer.
14166
14167         * driver.cs: csc also allows the arguments to /define being
14168         separated by commas, not only by semicolons.
14169
14170 2002-08-23  Martin Baulig  <martin@gnome.org>
14171
14172         * interface.cs (Interface.GetMembers): Added static check for events.
14173
14174 2002-08-15  Martin Baulig  <martin@gnome.org>
14175
14176         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14177         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14178
14179         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14180         why the MethodData.EmitDestructor() change was necessary.
14181
14182 2002-08-20  Martin Baulig  <martin@gnome.org>
14183
14184         * class.cs (TypeContainer.FindMembers): Added static check for events.
14185
14186         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14187
14188         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14189         use Type.GetEvents(), not Type.FindMembers().
14190
14191 2002-08-20  Martin Baulig  <martin@gnome.org>
14192
14193         * decl.cs (MemberCache): Added a special method cache which will
14194         be used for method-only searched.  This ensures that a method
14195         search will return a MethodInfo with the correct ReflectedType for
14196         inherited methods.      
14197
14198 2002-08-20  Martin Baulig  <martin@gnome.org>
14199
14200         * decl.cs (DeclSpace.FindMembers): Made this public.
14201
14202 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14203
14204         * delegate.cs: fixed build on windows.
14205         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14206
14207 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14208
14209         * ecore.cs (StandardConversionExists): Return a false
14210         if we are trying to convert the void type to anything else
14211         since that is not allowed.
14212
14213         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14214         we flag error 70 in the event an event is trying to be accessed
14215         directly from outside the declaring type.
14216
14217 2002-08-20  Martin Baulig  <martin@gnome.org>
14218
14219         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14220         MemberCache from typemanager.cs to decl.cs.
14221
14222 2002-08-19  Martin Baulig  <martin@gnome.org>
14223
14224         * class.cs (TypeContainer): Implement IMemberContainer.
14225         (TypeContainer.DefineMembers): Create the MemberCache.
14226         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14227         return public members if BindingFlags.Public was given, check
14228         whether members are static.
14229
14230 2002-08-16  Martin Baulig  <martin@gnome.org>
14231
14232         * decl.cs (DeclSpace.Define): Splitted this in Define and
14233         DefineMembers.  DefineMembers is called first and initializes the
14234         MemberCache.
14235
14236         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14237         DefineMembers() on all our DeclSpaces.
14238
14239         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14240         but call DefineMembers() on all nested interfaces.  We call their
14241         Define() in our new Define() function.
14242
14243         * interface.cs (Interface): Implement IMemberContainer.
14244         (Interface.Define): Moved all code except the attribute stuf to
14245         DefineMembers().
14246         (Interface.DefineMembers): Initialize the member cache.
14247
14248         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14249         need this anymore since we can use MemberCache.FindMembers directly.
14250
14251 2002-08-19  Martin Baulig  <martin@gnome.org>
14252
14253         * typemanager.cs (MemberCache): When creating the cache for an
14254         interface type, add all inherited members.
14255         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14256         to `out bool used_cache' and documented it.
14257         (TypeManager.MemberLookup): If we already used the cache in the first
14258         iteration, we don't need to do the interfaces check.
14259
14260 2002-08-19  Martin Baulig  <martin@gnome.org>
14261
14262         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14263         here from IMemberFinder and don't implement this interface anymore.
14264         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14265
14266         * typemanager.cs (IMemberFinder): This interface is now only used by
14267         classes which actually support the member cache.
14268         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
14269         since we only put DeclSpaces into this Hashtable.
14270         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
14271         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
14272
14273 2002-08-16  Martin Baulig  <martin@gnome.org>
14274
14275         * typemanager.cs (ICachingMemberFinder): Removed.
14276         (IMemberFinder.MemberCache): New property.
14277         (TypeManager.FindMembers): Merged this with RealFindMembers().
14278         This function will never be called from TypeManager.MemberLookup()
14279         so we can't use the cache here, just the IMemberFinder.
14280         (TypeManager.MemberLookup_FindMembers): Check whether the
14281         IMemberFinder has a MemberCache and call the cache's FindMembers
14282         function.
14283         (MemberCache): Rewrote larger parts of this yet another time and
14284         cleaned it up a bit.
14285
14286 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
14287
14288         * driver.cs (LoadArgs): Support quoting.
14289
14290         (Usage): Show the CSC-like command line arguments.
14291
14292         Improved a few error messages.
14293
14294 2002-08-15  Martin Baulig  <martin@gnome.org>
14295
14296         * typemanager.cs (IMemberContainer.Type): New property.
14297         (IMemberContainer.IsInterface): New property.
14298
14299         The following changes are conditional to BROKEN_RUNTIME, which is
14300         defined at the top of the file.
14301
14302         * typemanager.cs (MemberCache.MemberCache): Don't add the base
14303         class'es members, but add all members from TypeHandle.ObjectType
14304         if we're an interface.
14305         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
14306         is the current type.
14307         (MemberCache.CacheEntry.Container): Removed this field.
14308         (TypeHandle.GetMembers): Include inherited members.
14309
14310 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14311
14312         * typemanager.cs: fixed compilation and added a comment on a field that
14313         is never used.
14314
14315 2002-08-15  Martin Baulig  <martin@gnome.org>
14316
14317         * class.cs (ConstructorInitializer.Resolve): In the
14318         Expression.MemberLookup call, use the queried_type as
14319         invocation_type.
14320
14321         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
14322         declared' attribute, it's always true.
14323         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
14324         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
14325         temporary wrapper for FindMembers which tells MemberLookup whether
14326         members from the base classes are included in the return value.
14327         This will go away soon.
14328         (TypeManager.MemberLookup): Use this temporary hack here; once the
14329         new MemberCache is completed, we don't need to do the DeclaredOnly
14330         looping here anymore since the MemberCache will take care of this.
14331         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
14332         (MemberCache): When creating the MemberCache for a class, get
14333         members from the current class and all its base classes.
14334         (MemberCache.CacheEntry.Container): New field.  This is a
14335         temporary hack until the Mono runtime is fixed to distinguish
14336         between ReflectedType and DeclaringType.  It allows us to use MCS
14337         with both the MS runtime and the unfixed Mono runtime without
14338         problems and without accecting performance.
14339         (MemberCache.SearchMembers): The DeclaredOnly looping from
14340         TypeManager.MemberLookup is now done here.      
14341
14342 2002-08-14  Martin Baulig  <martin@gnome.org>
14343
14344         * statement.cs (MyStructInfo.MyStructInfo): Don't call
14345         Type.GetFields on dynamic types but get the fields from the
14346         corresponding TypeContainer.
14347         (MyStructInfo.GetStructInfo): Added check for enum types.
14348
14349         * typemanager.cs (MemberList.IsSynchronized): Implemented.
14350         (MemberList.SyncRoot): Implemented.
14351         (TypeManager.FilterWithClosure): No need to check permissions if
14352         closure_start_type == closure_invocation_type, don't crash if
14353         closure_invocation_type is null.
14354
14355 2002-08-13  Martin Baulig  <martin@gnome.org>
14356
14357         Rewrote TypeContainer.FindMembers to use a member cache.  This
14358         gives us a speed increase of about 35% for the self-hosting MCS
14359         build and of about 15-20% for the class libs (both on GNU/Linux).
14360
14361         * report.cs (Timer): New class to get enhanced profiling.  This
14362         whole class is "TIMER" conditional since it remarkably slows down
14363         compilation speed.
14364
14365         * class.cs (MemberList): New class.  This is an IList wrapper
14366         which we're now using instead of passing MemberInfo[]'s around to
14367         avoid copying this array unnecessarily.
14368         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
14369         (ICachingMemberFinder, IMemberContainer): New interface.
14370         (TypeManager.FilterWithClosure): If `criteria' is null, the name
14371         has already been checked, otherwise use it for the name comparision.
14372         (TypeManager.FindMembers): Renamed to RealMemberFinder and
14373         provided wrapper which tries to use ICachingMemberFinder.FindMembers
14374         if possible.  Returns a MemberList, not a MemberInfo [].
14375         (TypeHandle): New class, implements IMemberContainer.  We create
14376         one instance of this class per type, it contains a MemberCache
14377         which is used to do the member lookups.
14378         (MemberCache): New class.  Each instance of this class contains
14379         all members of a type and a name-based hash table.
14380         (MemberCache.FindMembers): This is our new member lookup
14381         function.  First, it looks up all members of the requested name in
14382         the hash table.  Then, it walks this list and sorts out all
14383         applicable members and returns them.
14384
14385 2002-08-13  Martin Baulig  <martin@gnome.org>
14386
14387         In addition to a nice code cleanup, this gives us a performance
14388         increase of about 1.4% on GNU/Linux - not much, but it's already
14389         half a second for the self-hosting MCS compilation.
14390
14391         * typemanager.cs (IMemberFinder): New interface.  It is used by
14392         TypeManager.FindMembers to call FindMembers on a TypeContainer,
14393         Enum, Delegate or Interface.
14394         (TypeManager.finder_to_member_finder): New PtrHashtable.
14395         (TypeManager.finder_to_container): Removed.
14396         (TypeManager.finder_to_delegate): Removed.
14397         (TypeManager.finder_to_interface): Removed.
14398         (TypeManager.finder_to_enum): Removed.
14399
14400         * interface.cs (Interface): Implement IMemberFinder.
14401
14402         * delegate.cs (Delegate): Implement IMemberFinder.
14403
14404         * enum.cs (Enum): Implement IMemberFinder.
14405
14406         * class.cs (TypeContainer): Implement IMemberFinder.
14407
14408 2002-08-12  Martin Baulig  <martin@gnome.org>
14409
14410         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
14411
14412 2002-08-12  Martin Baulig  <martin@gnome.org>
14413
14414         * ecore.cs (ITypeExpression): New interface for expressions which
14415         resolve to a type.
14416         (TypeExpression): Renamed to TypeLookupExpression.
14417         (Expression.DoResolve): If we're doing a types-only lookup, the
14418         expression must implement the ITypeExpression interface and we
14419         call DoResolveType() on it.
14420         (SimpleName): Implement the new ITypeExpression interface.
14421         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
14422         hack, the situation that we're only looking up types can't happen
14423         anymore when this method is called.  Moved the type lookup code to
14424         DoResolveType() and call it.
14425         (SimpleName.DoResolveType): This ITypeExpression interface method
14426         is now doing the types-only lookup.
14427         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
14428         (ResolveFlags): Added MaskExprClass.
14429
14430         * expression.cs (MemberAccess): Implement the ITypeExpression
14431         interface.
14432         (MemberAccess.DoResolve): Added support for a types-only lookup
14433         when we're called via ITypeExpression.DoResolveType().
14434         (ComposedCast): Implement the ITypeExpression interface.
14435
14436         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
14437         Expression.Resolve() with ResolveFlags.Type instead.
14438
14439 2002-08-12  Martin Baulig  <martin@gnome.org>
14440
14441         * interface.cs (Interface.Define): Apply attributes.
14442
14443         * attribute.cs (Attribute.ApplyAttributes): Added support for
14444         interface attributes.
14445
14446 2002-08-11  Martin Baulig  <martin@gnome.org>
14447
14448         * statement.cs (Block.Emit): Only check the "this" variable if we
14449         do not always throw an exception.
14450
14451         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
14452         whether the property has a set accessor.
14453
14454 2002-08-11  Martin Baulig  <martin@gnome.org>
14455
14456         Added control flow analysis support for structs.
14457
14458         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
14459         with control flow analysis turned off.
14460         (IVariable): New interface.
14461         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
14462         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
14463         (FieldExpr.DoResolve): Resolve the instance expression with flow
14464         analysis turned off and do the definite assignment check after the
14465         resolving when we know what the expression will resolve to.
14466
14467         * expression.cs (LocalVariableReference, ParameterReference):
14468         Implement the new IVariable interface, only call the flow analysis
14469         code if ec.DoFlowAnalysis is true.
14470         (This): Added constructor which takes a Block argument.  Implement
14471         the new IVariable interface.
14472         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
14473         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
14474         This does the definite assignment checks for struct members.
14475
14476         * class.cs (Constructor.Emit): If this is a non-static `struct'
14477         constructor which doesn't have any initializer, call
14478         Block.AddThisVariable() to tell the flow analysis code that all
14479         struct elements must be initialized before control returns from
14480         the constructor.
14481
14482         * statement.cs (MyStructInfo): New public class.
14483         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
14484         argument to this indexer.  If non-zero, check an individual struct
14485         member, not the whole struct.
14486         (FlowBranching.CheckOutParameters): Check struct members.
14487         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
14488         overloaded versions of these methods which take an additional
14489         `int field_idx' argument to check struct members.
14490         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
14491         overloaded versions of these methods which take an additional
14492         `string field_name' argument to check struct member.s
14493         (VariableInfo): Implement the IVariable interface.
14494         (VariableInfo.StructInfo): New public property.  Returns the
14495         MyStructInfo instance of the variable if it's a struct or null.
14496         (Block.AddThisVariable): New public method.  This is called from
14497         Constructor.Emit() for non-static `struct' constructor which do
14498         not have any initializer.  It creates a special variable for the
14499         "this" instance variable which will be checked by the flow
14500         analysis code to ensure that all of the struct's fields are
14501         initialized before control returns from the constructor.
14502         (UsageVector): Added support for struct members.  If a
14503         variable/parameter is a struct with N members, we reserve a slot
14504         in the usage vector for each member.  A struct is considered fully
14505         initialized if either the struct itself (slot 0) or all its
14506         members are initialized.
14507
14508 2002-08-08  Martin Baulig  <martin@gnome.org>
14509
14510         * driver.cs (Driver.MainDriver): Only report an error CS5001
14511         if there were no compilation errors.
14512
14513         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
14514         `UnsafeContext' property to determine whether the parent is in
14515         unsafe context rather than checking the parent's ModFlags:
14516         classes nested in an unsafe class are unsafe as well.
14517
14518 2002-08-08  Martin Baulig  <martin@gnome.org>
14519
14520         * statement.cs (UsageVector.MergeChildren): Distinguish between
14521         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
14522         we return.  Added test17() and test18() to test-154.cs.
14523
14524 2002-08-08  Martin Baulig  <martin@gnome.org>
14525
14526         * typemanager.cs (TypeManager.FilterWithClosure): If we have
14527         Family access, make sure the invoking type isn't a subclass of the
14528         queried type (that'd be a CS1540).
14529
14530         * ecore.cs (Expression.MemberLookup): Added overloaded version of
14531         this method which takes an additional `Type invocation_type'.
14532
14533         * expression.cs (BaseAccess.DoResolve): Use the base type as
14534         invocation and query type.
14535         (MemberAccess.DoResolve): If the lookup failed and we're about to
14536         report a CS0122, try a lookup with the ec.ContainerType - if this
14537         succeeds, we must report a CS1540.
14538
14539 2002-08-08  Martin Baulig  <martin@gnome.org>
14540
14541         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
14542         (MethodGroupExpr): Implement the IMemberExpr interface.
14543
14544         * expression (MemberAccess.ResolveMemberAccess): No need to have
14545         any special code for MethodGroupExprs anymore, they're now
14546         IMemberExprs.   
14547
14548 2002-08-08  Martin Baulig  <martin@gnome.org>
14549
14550         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
14551         Family, FamANDAssem and FamORAssem permissions.
14552         (TypeManager.IsSubclassOrNestedChildOf): New public method.
14553
14554 2002-08-08  Martin Baulig  <martin@gnome.org>
14555
14556         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
14557         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
14558         or loop block.
14559
14560 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
14561
14562         * driver.cs: implemented /resource option to embed managed resources.
14563
14564 2002-08-07  Martin Baulig  <martin@gnome.org>
14565
14566         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
14567         (FieldBase.HasFieldInitializer): New public property.
14568         (FieldBase.GetInitializerExpression): New public method.  Resolves and
14569         returns the field initializer and makes sure it is only resolved once.
14570         (TypeContainer.EmitFieldInitializers): Call
14571         FieldBase.GetInitializerExpression to get the initializer, this ensures
14572         that it isn't resolved multiple times.
14573
14574         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
14575         the resolving process (SimpleName/MemberLookup) that we're currently
14576         emitting a field initializer (which must not access any instance members,
14577         this is an error CS0236).
14578
14579         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
14580         argument, if the `IsFieldInitializer' flag is set, we must report and
14581         error CS0236 and not an error CS0120.   
14582
14583 2002-08-07  Martin Baulig  <martin@gnome.org>
14584
14585         * ecore.cs (IMemberExpr): New public interface.
14586         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
14587         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
14588         if the expression is an IMemberExpr.
14589
14590         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
14591         to be null, implicitly default to `this' if we're non-static in
14592         this case.  Simplified the code a lot by using the new IMemberExpr
14593         interface.  Also fixed bug #28176 here.
14594
14595 2002-08-06  Martin Baulig  <martin@gnome.org>
14596
14597         * cs-parser.jay (SimpleLookup): Removed.  We need to create
14598         ParameterReferences during semantic analysis so that we can do a
14599         type-only search when resolving Cast, TypeOf and SizeOf.
14600         (block): Pass the `current_local_parameters' to the Block's
14601         constructor.
14602
14603         * class.cs (ConstructorInitializer): Added `Parameters parameters'
14604         argument to the constructor.
14605         (ConstructorInitializer.Resolve): Create a temporary implicit
14606         block with the parameters.
14607
14608         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
14609         references here if we aren't doing a type-only search.
14610
14611         * statement.cs (Block): Added constructor which takes a
14612         `Parameters parameters' argument.
14613         (Block.Parameters): New public property.
14614
14615         * support.cs (InternalParameters.Parameters): Renamed `parameters'
14616         to `Parameters' and made it public readonly.
14617
14618 2002-08-06  Martin Baulig  <martin@gnome.org>
14619
14620         * ecore.cs (Expression.Warning): Made this public as well.
14621
14622         * report.cs (Report.Debug): Print the contents of collections.
14623
14624 2002-08-06  Martin Baulig  <martin@gnome.org>
14625
14626         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
14627         used to tell Resolve() which kinds of expressions it may return.
14628         (Expression.Resolve): Added overloaded version of this method which
14629         takes a `ResolveFlags flags' argument.  This can be used to tell
14630         Resolve() which kinds of expressions it may return.  Reports a
14631         CS0118 on error.
14632         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
14633         ResolveFlags.SimpleName.
14634         (Expression.Error118): Added overloaded version of this method which
14635         takes a `ResolveFlags flags' argument.  It uses the flags to determine
14636         which kinds of expressions are allowed.
14637
14638         * expression.cs (Argument.ResolveMethodGroup): New public method.
14639         Resolves an argument, but allows a MethodGroup to be returned.
14640         This is used when invoking a delegate.
14641
14642         * TODO: Updated a bit.
14643
14644 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14645
14646         Fixed compilation with csc.
14647
14648         * ecore.cs: Expression.Error made public. Is this correct? Should
14649         Warning be made public too?
14650
14651         * expression.cs: use ea.Location instead of ea.loc.
14652         [FIXME:  Filed as bug #28607: MCS must report these errors.]
14653
14654 2002-08-06  Martin Baulig  <martin@gnome.org>
14655
14656         * ecore.cs (Expression.loc): Moved the location here instead of
14657         duplicating it in all derived classes.
14658         (Expression.Location): New public property.
14659         (Expression.Error, Expression.Warning): Made them non-static and
14660         removed the location argument.
14661         (Expression.Warning): Added overloaded version which takes an
14662         `int level' argument.
14663         (Expression.Error118): Make this non-static and removed the
14664         expression and location arguments.
14665         (TypeExpr): Added location argument to the constructor.
14666
14667         * expression.cs (StaticCallExpr): Added location argument to
14668         the constructor.
14669         (Indirection, PointerArithmetic): Likewise.
14670         (CheckedExpr, UnCheckedExpr): Likewise.
14671         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
14672         (StringPtr): Likewise.
14673
14674
14675 2002-08-05  Martin Baulig  <martin@gnome.org>
14676
14677         * expression.cs (BaseAccess.DoResolve): Actually report errors.
14678
14679         * assign.cs (Assign.DoResolve): Check whether the source
14680         expression is a value or variable.
14681
14682         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
14683         while resolving the corresponding blocks.
14684
14685         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
14686         an error, don't silently return null.
14687
14688         * statement.cs (Block.AddVariable): Do the error reporting here
14689         and distinguish between CS0128 and CS0136.
14690         (Block.DoResolve): Report all unused labels (warning CS0164).
14691         (LabeledStatement): Pass the location to the constructor.
14692         (LabeledStatement.HasBeenReferenced): New property.
14693         (LabeledStatement.Resolve): Set it to true here.
14694
14695         * statement.cs (Return.Emit): Return success even after reporting
14696         a type mismatch error (CS0126 or CS0127), this is what csc does and
14697         it avoids confusing the users with any consecutive errors.
14698
14699 2002-08-05  Martin Baulig  <martin@gnome.org>
14700
14701         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
14702
14703         * const.cs (Const.LookupConstantValue): Catch circular definitions.
14704
14705         * expression.cs (MemberAccess.DoResolve): Silently return if an
14706         error has already been reported.
14707
14708         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
14709         error has already been reported.
14710
14711 2002-08-05  Martin Baulig  <martin@gnome.org>
14712
14713         * statement.cs (UsageVector): Only initialize the `parameters'
14714         vector if we actually have any "out" parameters.
14715
14716 2002-08-05  Martin Baulig  <martin@gnome.org>
14717
14718         * expression.cs (Binary.ResolveOperator): When combining delegates,
14719         they must have the same type.
14720
14721 2002-08-05  Martin Baulig  <martin@gnome.org>
14722
14723         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
14724         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
14725         work with the ms runtime and we also don't need it: if we're a
14726         PropertyBuilder and not in the `indexer_arguments' hash, then we
14727         are a property and not an indexer.
14728
14729         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
14730         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
14731         since the latter one doesn't work with the ms runtime.
14732
14733 2002-08-03  Martin Baulig  <martin@gnome.org>
14734
14735         Fixed bugs #27998 and #22735.
14736
14737         * class.cs (Method.IsOperator): New public field.
14738         (Method.CheckBase): Report CS0111 if there's already a method
14739         with the same parameters in the current class.  Report CS0508 when
14740         attempting to change the return type of an inherited method.
14741         (MethodData.Emit): Report CS0179 if a method doesn't have a body
14742         and it's not marked abstract or extern.
14743         (PropertyBase): New abstract base class for Property and Indexer.
14744         (PropertyBase.CheckBase): Moved here from Property and made it work
14745         for indexers.
14746         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
14747         the same so we can reuse it there.
14748         (Property, Indexer): Derive from PropertyBase.
14749         (MethodSignature.inheritable_property_signature_filter): New delegate
14750         to find properties and indexers.
14751
14752         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
14753         argument and improved error reporting.
14754
14755         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
14756         EmptyReadOnlyParameters and made it a property.
14757
14758         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
14759         version of this method which takes a `PropertyInfo indexer'.
14760         (TypeManager.RegisterIndexer): New method.
14761
14762         * class.cs: Added myself as author of this file :-)
14763
14764 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14765
14766         * class.cs: fixed compilation on windoze.
14767
14768 2002-08-03  Martin Baulig  <martin@gnome.org>
14769
14770         * interface.cs (Interface.GetInterfaceBases): Check whether all
14771         base interfaces are at least as accessible than the current one.
14772
14773         * class.cs (TypeContainer.GetClassBases): Check whether base types
14774         are at least as accessible than the current type.
14775         (TypeContainer.AsAccessible): Implemented and made non-static.
14776         (MemberBase.CheckParameters): Report errors if the accessibility
14777         checks fail.
14778
14779         * delegate.cs (Delegate.Delegate): The default visibility is
14780         internal for top-level types and private for nested types.
14781         (Delegate.Define): Report errors if the accessibility checks fail.
14782
14783         * enum.cs (Enum.Enum): The default visibility is internal for
14784         top-level types and private for nested types.
14785         (Enum.DefineType): Compute the correct visibility.
14786
14787         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
14788         function which takes a `bool is_toplevel' instead of a TypeContainer.
14789
14790         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
14791         builtin type.
14792
14793 2002-08-02  Martin Baulig  <martin@gnome.org>
14794
14795         * expression.cs (LocalVariableReferenc): Added constructor which
14796         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
14797         (LocalVariableReference.IsReadOnly): New property.
14798         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
14799         variable is readonly, use our own readonly flag to do this; you can
14800         use the new constructor to get a writable reference to a read-only
14801         variable.
14802
14803         * cs-parser.jay (foreach_statement, using_statement): Get a writable
14804         reference to the local variable.
14805
14806 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
14807
14808         * rootcontext.cs (ResolveCore): Also include System.Exception
14809
14810         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
14811         we reach an EmptyStatement.
14812
14813         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
14814         is also fine.
14815
14816         * expression.cs (Binary.ResolveOperator): Check error result in
14817         two places.
14818
14819         use brtrue/brfalse directly and avoid compares to null.
14820
14821 2002-08-02  Martin Baulig  <martin@gnome.org>
14822
14823         * class.cs (TypeContainer.Define): Define all nested interfaces here.
14824         Fixes bug #28407, added test-155.cs.
14825
14826 2002-08-01  Martin Baulig  <martin@gnome.org>
14827
14828         * class.cs (Event.EmitDefaultMethod): Make this work with static
14829         events.  Fixes #28311, added verify-3.cs.
14830
14831 2002-08-01  Martin Baulig  <martin@gnome.org>
14832
14833         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
14834         `is_disposable' fields.
14835         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
14836         `hm.is_disposable' if we're using the collection pattern.
14837         (Foreach.EmitCollectionForeach): Use the correct type for the
14838         enumerator's local variable, only emit the try/finally block if
14839         necessary (fixes #27713).
14840
14841 2002-08-01  Martin Baulig  <martin@gnome.org>
14842
14843         * ecore.cs (Expression.report118): Renamed to Error118 and made
14844         it public static.
14845
14846         * statement.cs (Throw.Resolve): Check whether the expression is of
14847         the correct type (CS0118) and whether the type derives from
14848         System.Exception (CS0155).
14849         (Catch.Resolve): New method.  Do the type lookup here and check
14850         whether it derives from System.Exception (CS0155).
14851         (Catch.CatchType, Catch.IsGeneral): New public properties.
14852
14853         * typemanager.cs (TypeManager.exception_type): Added.
14854
14855 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
14856
14857         * driver.cs: Updated About function.
14858
14859 2002-07-31  Martin Baulig  <martin@gnome.org>
14860
14861         Implemented Control Flow Analysis.
14862
14863         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
14864         (EmitContext.CurrentBranching): Added.
14865         (EmitContext.StartFlowBranching): Added.
14866         (EmitContext.EndFlowBranching): Added.
14867         (EmitContext.KillFlowBranching): Added.
14868         (EmitContext.IsVariableAssigned): Added.
14869         (EmitContext.SetVariableAssigned): Added.
14870         (EmitContext.IsParameterAssigned): Added.
14871         (EmitContext.SetParameterAssigned): Added.
14872         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
14873         Added control flow analysis stuff here.
14874
14875         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
14876         resolve the expression as lvalue.
14877         (LocalVariableReference.DoResolve): Check whether the variable has
14878         already been assigned.
14879         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
14880         the parameter as assigned here.
14881         (ParameterReference.DoResolve): Check whether the parameter has already
14882         been assigned.
14883         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
14884         expression as lvalue.
14885
14886         * statement.cs (FlowBranching): New class for the flow analysis code.
14887         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
14888         (LabeledStatement.IsDefined): New public property.
14889         (LabeledStatement.AddUsageVector): New public method to tell flow
14890         analyis that the label may be reached via a forward jump.
14891         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
14892         flow analysis.
14893         (VariableInfo.Number): New public field.  This is used by flow analysis
14894         to number all locals of a block.
14895         (Block.CountVariables): New public property.  This is the number of
14896         local variables in this block (including the locals from all parent
14897         blocks).
14898         (Block.EmitMeta): Number all the variables.
14899
14900         * statement.cs: Added flow analysis support to all classes.
14901
14902 2002-07-31  Martin Baulig  <martin@gnome.org>
14903
14904         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
14905         To get debugging messages, compile mcs with /define:MCS_DEBUG and
14906         then use this argument.
14907
14908         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
14909
14910         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
14911         use this to specify /define options.
14912
14913 2002-07-29  Martin Baulig  <martin@gnome.org>
14914
14915         * statement.cs (Fixed): Moved all code that does variable lookups
14916         and resolvings from Emit to Resolve.
14917
14918         * statement.cs (For): Moved all code that does variable lookups
14919         and resolvings from Emit to Resolve.
14920
14921         * statement.cs (Using): Moved all code that does variable lookups
14922         and resolvings from Emit to Resolve.
14923
14924 2002-07-29  Martin Baulig  <martin@gnome.org>
14925
14926         * attribute.cs (Attribute.Resolve): Explicitly catch a
14927         System.NullReferenceException when creating the
14928         CustromAttributeBuilder and report a different warning message.
14929
14930 2002-07-29  Martin Baulig  <martin@gnome.org>
14931
14932         * support.cs (ParameterData.ParameterName): Added method to
14933         get the name of a parameter.
14934
14935         * typemanager.cs (TypeManager.IsValueType): New public method.
14936
14937 2002-07-29  Martin Baulig  <martin@gnome.org>
14938
14939         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
14940         is a flag which specifies that it's either ref or out.
14941         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
14942         the out parameter to `out Parameter.Modifier mod', also set the
14943         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
14944
14945         * support.cs (InternalParameters.ParameterModifier): Distinguish
14946         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14947         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14948
14949         * expression.cs (Argument.GetParameterModifier): Distinguish
14950         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
14951         Parameter.Modifier.ISBYREF flag if it's either ref or out.
14952
14953 2002-07-29  Martin Baulig  <martin@gnome.org>
14954
14955         * expression.cs (ParameterReference.ParameterReference): Added
14956         `Location loc' argument to the constructor.
14957
14958         * cs-parser.jay: Pass location to ParameterReference.
14959
14960 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
14961
14962         * statement.cs (Try): Initialize the location.
14963
14964         * cs-parser.jay: pass location to Try.
14965
14966         * expression.cs (Unary.Reduce): Change the prototype to return
14967         whether a constant fold could be performed or not.  The result is
14968         returned in an out parameters.  In the case of Indirection and
14969         AddressOf, we want to perform the full tests.
14970
14971 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
14972
14973         * statement.cs (Statement.Emit): Flag dead code.
14974
14975 2002-07-27  Andrew Birkett  <andy@nobugs.org>
14976
14977         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
14978
14979 2002-07-27  Martin Baulig  <martin@gnome.org>
14980
14981         * class.cs (MethodData.Define): Put back call to
14982         TypeManager.AddMethod(), accidentally commented this out.
14983
14984         * report.cs (Debug): New public method to print debugging information,
14985         this is `[Conditional ("DEBUG")]'.
14986
14987 2002-07-26  Martin Baulig  <martin@gnome.org>
14988
14989         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
14990         (switch_statement): Push the current_block to the switch_stack and
14991         pop it again when we're done with the switch.
14992         (switch_section): The new block is a child of the current_block.
14993         Fixes bug #24007, added test-152.cs.
14994
14995 2002-07-27  Martin Baulig  <martin@gnome.org>
14996
14997         * expression.cs (Invocation.EmitArguments): When calling a varargs
14998         function with only its fixed arguments, we need to pass an empty
14999         array.
15000
15001 2002-07-27  Martin Baulig  <martin@gnome.org>
15002
15003         Mono 0.13 has been released.
15004
15005 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15006
15007         * driver.cs: Rename --resource to --linkres, because that is what
15008         we do currently, we dont support --resource yet.
15009
15010         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15011
15012 2002-07-25  Martin Baulig  <martin@gnome.org>
15013
15014         * class.cs (MethodData): New public class.  This is a `method builder'
15015         class for a method or one accessor of a Property/Indexer/Event.
15016         (MethodData.GetMethodFlags): Moved here from MemberBase.
15017         (MethodData.ApplyAttributes): Likewise.
15018         (MethodData.ApplyObsoleteAttribute): Likewise.
15019         (MethodData.ApplyConditionalAttribute): Likewise.
15020         (MethodData.ApplyDllImportAttribute): Likewise.
15021         (MethodData.CheckAbstractAndExternal): Likewise.
15022         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15023         (MethodData.Emit): Formerly known as Method.Emit().
15024         (MemberBase): Moved everything which was specific to a single
15025         accessor/method to MethodData.
15026         (Method): Create a new MethodData and call Define() and Emit() on it.
15027         (Property, Indexer, Event): Create a new MethodData objects for each
15028         accessor and call Define() and Emit() on them.
15029
15030 2002-07-25  Martin Baulig  <martin@gnome.org>
15031
15032         Made MethodCore derive from MemberBase to reuse the code from there.
15033         MemberBase now also checks for attributes.
15034
15035         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15036         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15037         as virtual.
15038         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15039         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15040         (MemberBase.ApplyAttributes): New virtual method; applies the
15041         attributes to a method or accessor.
15042         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15043         (MemberBase.ApplyConditionalAttribute): Likewise.
15044         (MemberBase.ApplyDllImportAttribute): Likewise.
15045         (MemberBase.CheckAbstractAndExternal): Likewise.
15046         (MethodCore.ParameterTypes): This is now a property instead of a
15047         method, it's initialized from DoDefineParameters().
15048         (MethodCore.ParameterInfo): Removed the set accessor.
15049         (MethodCore.DoDefineParameters): New protected virtual method to
15050         initialize ParameterTypes and ParameterInfo.
15051         (Method.GetReturnType): We can now simply return the MemberType.
15052         (Method.GetMethodFlags): Override the MemberBase version and add
15053         the conditional flags.
15054         (Method.CheckBase): Moved some code from Define() here, call
15055         DoDefineParameters() here.
15056         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15057         here to avoid some larger code duplication.
15058         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15059         ensure that abstract and external accessors don't declare a body.
15060
15061         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15062         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15063         lookup in the attribute's parent classes, so we need to abort as soon
15064         as we found the first match.
15065         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15066         the attribute has no arguments.
15067
15068         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15069         of a Method.
15070
15071 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15072
15073         * cs-parser.jay: reverted previous patch.
15074
15075 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15076
15077         * cs-parser.jay: fixed bug #22119.
15078
15079 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15080
15081         * attribute.cs: fixed compilation. The error was:
15082         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15083         be assigned to before control leaves the current method."
15084         [FIXME:  Filed as bug #28186: MCS must report this error.]
15085
15086 2002-07-25  Martin Baulig  <martin@gnome.org>
15087
15088         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15089         method to pull the condition name ouf of a Conditional attribute.
15090         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15091         the obsolete message and error flag out of an Obsolete attribute.
15092
15093         * class.cs (Method.GetMethodFlags): New public method to get the
15094         TypeManager.MethodFlags for this method.
15095         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15096         private methods.
15097         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15098         if we're overriding a virtual function, set the new private variable
15099         `parent_method'; call the new TypeManager.AddMethod().
15100
15101         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15102         the MethodBuilder and the Method in a PtrHashtable.
15103         (TypeManager.builder_to_method): Added for this purpose.
15104         (TypeManager.MethodFlags): Added IsObsoleteError.
15105         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15106         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15107         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15108         the message from the attribute.
15109
15110 2002-07-24  Martin Baulig  <martin@gnome.org>
15111
15112         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15113         preprocessor directives, ensure that the argument to #define/#undef is
15114         exactly one identifier and that it's actually an identifier.
15115
15116         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15117         did not work ....
15118
15119 2002-07-24  Martin Baulig  <martin@gnome.org>
15120
15121         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15122         initialize it to TypeManager.object_type in the constructor.
15123         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15124         of the `hm.get_current' method if we're using the collection pattern.
15125         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15126         for the explicit conversion to make it work when we're using the collection
15127         pattern and the `Current' property has a different return type than `object'.
15128         Fixes #27713.
15129
15130 2002-07-24  Martin Baulig  <martin@gnome.org>
15131
15132         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15133         does not match, but don't report any errors.  This method is called in
15134         order for all methods in a MethodGroupExpr until a matching method is
15135         found, so we don't want to bail out if the first method doesn't match.
15136         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15137         matches, report the 123.  Fixes #28070.
15138
15139 2002-07-24  Martin Baulig  <martin@gnome.org>
15140
15141         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15142         TypeManager.TypeToCoreType() to the top of the method so the
15143         following equality checks will work.  Fixes #28107.
15144
15145 2002-07-24  Martin Baulig  <martin@gnome.org>
15146
15147         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15148         operand is of type uint, and the other operand is of type sbyte,
15149         short or int, the operands are converted to type long." -
15150         Actually do what this comment already told us.  Fixes bug #28106,
15151         added test-150.cs.
15152
15153 2002-07-24  Martin Baulig  <martin@gnome.org>
15154
15155         * class.cs (MethodBase): New abstract class.  This is now a base
15156         class for Property, Indexer and Event to avoid some code duplication
15157         in their Define() and DefineMethods() methods.
15158         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15159         generic methods for Define() and DefineMethods().
15160         (FieldBase): Derive from MemberBase, not MemberCore.
15161         (Property): Derive from MemberBase, not MemberCore.
15162         (Property.DefineMethod): Moved all the code from this method to the
15163         new MethodBase.DefineAccessor(), just call it with appropriate
15164         argumetnts.
15165         (Property.Define): Call the new Property.DoDefine(), this does some
15166         sanity checks and we don't need to duplicate the code everywhere.
15167         (Event): Derive from MemberBase, not MemberCore.
15168         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15169         accessors, this will also make them work with interface events.
15170         (Indexer): Derive from MemberBase, not MemberCore.
15171         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15172         (Indexer.Define): Use the new MethodBase functions.
15173
15174         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15175         argument to the constructor.
15176         (Interface.FindMembers): Added support for interface events.
15177         (Interface.PopluateEvent): Implemented.
15178
15179         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15180
15181 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15182
15183         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15184         but this is required to check for a method name being the same as
15185         the containing class.  
15186
15187         Handle this now.
15188
15189 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15190
15191         * interface.cs: initialize variable.
15192
15193 2002-07-23  Martin Baulig  <martin@gnome.org>
15194
15195         Implemented the IndexerName attribute in interfaces.
15196
15197         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15198         name if this is an explicit interface implementation.
15199         (Indexer.InterfaceIndexerName): New public variable.  If we're
15200         implementing an interface indexer, this is the IndexerName in that
15201         interface.  Otherwise, it's the IndexerName.
15202         (Indexer.DefineMethod): If we're implementing interface indexer,
15203         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15204         and Pending.ImplementIndexer methods.
15205         (Indexer.Define): Also define the PropertyBuilder if we're
15206         implementing an interface indexer and this is neither an explicit
15207         interface implementation nor do the IndexerName match the one in
15208         the interface.
15209
15210         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15211         If a method is defined here, then we always need to create a proxy
15212         for it.  This is used when implementing interface indexers.
15213         (Pending.IsInterfaceIndexer): New public method.
15214         (Pending.ImplementIndexer): New public method.
15215         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15216         This is used when implementing interface indexers to define a proxy
15217         if necessary.
15218         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15219         define a proxy if necessary.
15220
15221         * interface.cs (Interface.IndexerName): New public variable.
15222         (Interface.PopulateIndexer): Set the IndexerName.
15223         (Interface.DefineIndexers): New private method.  Populate all the
15224         indexers and make sure their IndexerNames match.
15225
15226         * typemanager.cs (IndexerPropertyName): Added support for interface
15227         indexers.
15228
15229 2002-07-22  Martin Baulig  <martin@gnome.org>
15230
15231         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15232         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15233         ret if HasReturnLabel.
15234         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15235         variables.
15236
15237         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15238         and set the ec.LoopBeginTryCatchLevel.
15239         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15240         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15241         the current ec.TryCatchLevel, the branch goes out of an exception
15242         block.  In this case, we need to use Leave and not Br.
15243
15244 2002-07-22  Martin Baulig  <martin@gnome.org>
15245
15246         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15247         block unless the block does not always return or it is contained in
15248         another try { ... } catch { ... } block.  Fixes bug #26506.
15249         Added verify-1.cs to the test suite.
15250
15251 2002-07-22  Martin Baulig  <martin@gnome.org>
15252
15253         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15254         then we do not always return.  Fixes bug #24985.
15255
15256 2002-07-22  Martin Baulig  <martin@gnome.org>
15257
15258         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15259         lookup on a per-class level; ie. walk up the class hierarchy until we
15260         found at least one applicable method, then choose the best among them.
15261         Fixes bug #24463 and test-29.cs.
15262
15263 2002-07-22  Martin Baulig  <martin@gnome.org>
15264
15265         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
15266         return types of the methods.  The return type is not part of the
15267         signature and we must not check it to make the `new' modifier work.
15268         Fixes bug #27999, also added test-147.cs.
15269         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
15270
15271         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
15272         on the method's return type.
15273
15274 2002-07-21  Martin Baulig  <martin@gnome.org>
15275
15276         * assign.cs: Make this work if the rightmost source is a constant and
15277         we need to do an implicit type conversion.  Also adding a few more tests
15278         to test-38.cs which should have caught this.
15279
15280         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
15281         target in the makefile for this.  The makefile.gnu is primarily intended
15282         for end-users who don't want to debug the compiler.
15283
15284 2002-07-21  Martin Baulig  <martin@gnome.org>
15285
15286         * assign.cs: Improved the Assign class so it can now handle embedded
15287         assignments (X = Y = Z = something).  As a side-effect this'll now also
15288         consume less local variables.  test-38.cs now passes with MCS, added
15289         a few new test cases to that test.
15290
15291 2002-07-20  Martin Baulig  <martin@gnome.org>
15292
15293         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
15294         instructions.  Fixes bug #27977, also added test-146.cs.
15295
15296 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15297
15298         * cs-tokenizer.cs: fixed getHex ().
15299
15300 2002-07-19  Martin Baulig  <martin@gnome.org>
15301
15302         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
15303         not Type.GetType() to lookup the array type.  This is needed when
15304         we're constructing an array of a user-defined type.
15305         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
15306         single-dimensional arrays, but also for single-dimensial arrays of
15307         type decimal.
15308
15309 2002-07-19  Martin Baulig  <martin@gnome.org>
15310
15311         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
15312         this function is called, it's not allowed to share LocalBuilders
15313         among ILGenerators.
15314
15315 2002-07-19  Martin Baulig  <martin@gnome.org>
15316
15317         * expression.cs (Argument.Resolve): Report an error 118 when trying
15318         to pass a type as argument.
15319
15320 2002-07-18  Martin Baulig  <martin@gnome.org>
15321
15322         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
15323         Conv_R_Un for the signed `long' type.
15324
15325 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
15326
15327         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
15328         `expr' for the temporary result, as that will fail if we do
15329         multiple resolves on the same expression.
15330
15331 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
15332
15333         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
15334         ec.TypeContainer for looking up aliases. 
15335
15336         * class.cs (TypeContainer): Remove LookupAlias from here.
15337
15338         * decl.cs (DeclSpace); Move here.
15339
15340 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
15341
15342         * class.cs (FindMembers): Only call filter if the constructor
15343         bulider is not null.
15344
15345         Also handle delegates in `NestedTypes' now.  Now we will perform
15346         type lookups using the standard resolution process.  This also
15347         fixes a bug.
15348
15349         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
15350         This uses Expressions (the limited kind that can be parsed by the
15351         tree) instead of strings.
15352
15353         * expression.cs (ComposedCast.ToString): Implement, used to flag
15354         errors since now we have to render expressions.
15355
15356         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
15357         FormArrayType. 
15358
15359         * ecore.cs (SimpleName.ToString): ditto.
15360
15361         * cs-parser.jay: Instead of using strings to assemble types, use
15362         Expressions to assemble the type (using SimpleName, ComposedCast,
15363         MemberAccess).  This should fix the type lookups in declarations,
15364         because we were using a different code path for this.
15365
15366         * statement.cs (Block.Resolve): Continue processing statements
15367         even when there is an error.
15368
15369 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
15370
15371         * class.cs (Event.Define): Also remove the `remove' method from
15372         the list of pending items.
15373
15374         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
15375         generate more compact code. 
15376
15377 2002-07-17  Martin Baulig  <martin@gnome.org>
15378
15379         * const.cs (Const.LookupConstantValue): Add support for constant
15380         `unchecked' and `checked' expressions.
15381         Also adding test case test-140.cs for this.
15382
15383 2002-07-17  Martin Baulig  <martin@gnome.org>
15384
15385         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
15386         check whether mi.ReturnType implements the IEnumerator interface; the
15387         `==' and the IsAssignableFrom() will fail in this situation.
15388
15389 2002-07-16  Ravi Pratap  <ravi@ximian.com>
15390
15391         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
15392         here too.
15393
15394 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15395
15396         * expression.cs: fixed bug #27811.
15397
15398 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
15399
15400         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
15401         Molaro: when we are a ref, the value already contains a pointer
15402         value, do not take the address of it.
15403
15404 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
15405         * removed mb-parser.jay and mb-tokenizer.cs
15406
15407 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15408
15409         * expression.cs: check against the building corlib void type.
15410
15411 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
15412
15413         * ecore.cs: fix for valuetype static readonly fields: when 
15414         initializing them, we need their address, not the address of a copy.
15415
15416 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
15417
15418         * typemanager.cs: register also enum_type in corlib.
15419
15420 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15421
15422         * class.cs: allow calling this (but not base) initializers in structs.
15423
15424 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
15425
15426         * ecore.cs: make sure we compare against the building base types
15427         in GetTypeSize ().
15428
15429 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
15430
15431         * typemanager.cs: fix TypeToCoreType() to handle void and object
15432         (corlib gets no more typerefs after this change).
15433
15434 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
15435
15436         * expression.cs (ArrayCreation.EmitArrayArguments): use
15437         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
15438
15439         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
15440         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
15441         array indexes, the runtime actually forbids them.
15442
15443         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
15444         for array arguments here.
15445
15446         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
15447         instead of the default for ValueTypes.
15448
15449         (New.DoEmit): Use IsValueType instead of
15450         IsSubclassOf (value_type)
15451         (New.DoResolve): ditto.
15452         (Invocation.EmitCall): ditto.
15453
15454         * assign.cs (Assign): ditto.
15455
15456         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
15457         Statements *are* currently doing part of their resolution during
15458         Emit.  
15459
15460         Expressions do always resolve during resolve, but statements are
15461         only required to propagate resolution to their children.
15462
15463 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
15464
15465         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
15466
15467         (LoadAssembly): Do not add the dll if it is already specified
15468
15469         (MainDriver): Add the System directory to the link path at the end,
15470         after all the other -L arguments. 
15471
15472         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
15473         wrong opcode for loading bytes and bools (ldelem.i1 instead of
15474         ldelem.u1) and using the opposite for sbytes.
15475
15476         This fixes Digger, and we can finally run it.
15477
15478         * driver.cs (UnixParseOption): Move the option parsing here.  
15479         (CSCParseOption): Implement CSC-like parsing of options.
15480
15481         We now support both modes of operation, the old Unix way, and the
15482         new CSC-like way.  This should help those who wanted to make cross
15483         platform makefiles.
15484
15485         The only thing broken is that /r:, /reference: and /lib: are not
15486         implemented, because I want to make those have the same semantics
15487         as the CSC compiler has, and kill once and for all the confussion
15488         around this.   Will be doing this tomorrow.
15489
15490         * statement.cs (Unsafe.Resolve): The state is checked during
15491         resolve, not emit, so we have to set the flags for IsUnsfe here.
15492
15493 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15494
15495         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
15496         not catch the Error_ObjectRefRequired in SimpleName (as it is
15497         possible to have a class/instance variable name that later gets
15498         deambiguated), we have to check this here.      
15499
15500 2002-07-10  Ravi Pratap  <ravi@ximian.com>
15501
15502         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
15503         make static and put into Expression.
15504
15505         (Event.Define): Register the private field of the event with the 
15506         TypeManager so that GetFieldFromEvent can get at it.
15507
15508         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
15509         keep track of the private field associated with an event which
15510         has no accessors.
15511
15512         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
15513         private field.
15514
15515         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
15516
15517 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
15518
15519         * expression.cs (Binary.EmitBranchable): this routine emits the
15520         Binary expression in a branchable context.  This basically means:
15521         we need to branch somewhere, not just get the value on the stack.
15522
15523         This works together with Statement.EmitBoolExpression.
15524
15525         * statement.cs (Statement.EmitBoolExpression): Use
15526         EmitBranchable. 
15527
15528 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
15529
15530         * statement.cs (For): Reduce the number of jumps in loops.
15531
15532         (For): Implement loop inversion for the For statement.
15533
15534         (Break): We can be breaking out of a Try/Catch controlled section
15535         (foreach might have an implicit try/catch clause), so we need to
15536         use Leave instead of Br.
15537
15538         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
15539         now).  If the instace expression supports IMemoryLocation, we use
15540         the AddressOf method from the IMemoryLocation to extract the
15541         address instead of emitting the instance.
15542
15543         This showed up with `This', as we were emitting the instance
15544         always (Emit) instead of the Address of This.  Particularly
15545         interesting when This is a value type, as we dont want the Emit
15546         effect (which was to load the object).
15547
15548 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
15549
15550         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
15551
15552         * statement.cs (Checked): Set the CheckedState during the resolve
15553         process too, as the ConvCast operations track the checked state on
15554         the resolve process, and not emit.
15555
15556         * cs-parser.jay (namespace_member_declaration): Flag that we have
15557         found a declaration when we do.  This is used to flag error 1529
15558
15559         * driver.cs: Report ok when we display the help only.
15560
15561 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
15562
15563         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
15564
15565 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
15566
15567         * cs-tokenizer.cs (define): We also have to track locally the
15568         defines.  AllDefines is just used for the Conditional Attribute,
15569         but we also need the local defines for the current source code. 
15570
15571 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
15572
15573         * statement.cs (While, For, Do): These loops can exit through a
15574         Break statement, use this information to tell whether the
15575         statement is the last piece of code.
15576
15577         (Break): Flag that we break.
15578
15579         * codegen.cs (EmitContexts): New `Breaks' state variable.
15580
15581 2002-07-03  Martin Baulig  <martin@gnome.org>
15582
15583         * class.cs (TypeContainer.MethodModifiersValid): Allow override
15584         modifiers in method declarations in structs.  Otherwise, you won't
15585         be able to override things like Object.Equals().
15586
15587 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15588
15589         * class.cs (Method, Property, Indexer): Do not allow the public
15590         modifier to be used in explicit interface implementations.
15591
15592         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
15593         override modifiers in method declarations in structs
15594
15595 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
15596
15597         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
15598         integer or real overflow, report an error
15599
15600 2002-07-02  Martin Baulig  <martin@gnome.org>
15601
15602         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
15603         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
15604         to tell the runtime about our newly created System.Object and
15605         System.ValueType types.
15606
15607 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
15608
15609         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
15610         struct instead of Ldarg/Starg.
15611
15612 2002-07-02  Martin Baulig  <martin@gnome.org>
15613
15614         * expression.cs (Indirection.Indirection): Call
15615         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
15616
15617 2002-07-02  Martin Baulig  <martin@gnome.org>
15618
15619         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
15620         ValueType, call TypeManager.TypeToCoreType() on it.
15621         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
15622         the OpCodes.Newarr argument.
15623
15624 2002-07-02  Martin Baulig  <martin@gnome.org>
15625
15626         * expression.cs (Invocation.EmitCall): When compiling corlib,
15627         replace all calls to the system's System.Array type to calls to
15628         the newly created one.
15629
15630         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
15631         System.Array methods.
15632         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
15633         from the system's System.Array type which must be replaced.
15634
15635 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
15636
15637         * typemanager.cs: load unverifiable_code_ctor so we can build
15638         corlib using the correct type. Avoid using GetTypeCode() with
15639         TypeBuilders.
15640         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
15641         TypeManager.object_type to allow building corlib.
15642
15643 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
15644
15645         * ecore.cs: handle System.Enum separately in LoadFromPtr().
15646
15647 2002-07-01  Martin Baulig  <martin@gnome.org>
15648
15649         * class.cs: Make the last change actually work, we need to check
15650         whether `ifaces != null' to avoid a crash.
15651
15652 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
15653
15654         * class.cs: when we build structs without fields that implement
15655         interfaces, we need to add the interfaces separately, since there is
15656         no API to both set the size and add the interfaces at type creation
15657         time.
15658
15659 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
15660
15661         * expression.cs: the dimension arguments to the array constructors
15662         need to be converted if they are a long.
15663
15664 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
15665
15666         * class.cs: don't emit ldarg.0 if there is no parent constructor
15667         (fixes showstopper for corlib).
15668
15669 2002-06-29  Martin Baulig  <martin@gnome.org>
15670
15671         MCS now compiles corlib on GNU/Linux :-)
15672
15673         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
15674         ie. check for MethodImplOptions.InternalCall.
15675
15676         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
15677         and TypeManager.attribute_type are null, so we must explicitly check
15678         whether parent is not null to find out whether it's an attribute type.
15679         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
15680         and SetBuilder, not only if the property is neither abstract nor external.
15681         This is necessary to set the MethodImplOptions on the accessor methods.
15682         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
15683         SetBuilder, see Property.Emit().
15684
15685         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
15686         populate "System.Object", "System.ValueType" and "System.Attribute" since
15687         they've already been populated from BootCorlib_PopulateCoreTypes().
15688
15689 2002-06-29  Martin Baulig  <martin@gnome.org>
15690
15691         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
15692         is the NullLiteral, we also need to make sure that target_type is not
15693         an enum type.   
15694
15695 2002-06-29  Martin Baulig  <martin@gnome.org>
15696
15697         * rootcontext.cs (RootContext.ResolveCore): We must initialize
15698         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
15699         before calling BootstrapCorlib_ResolveDelegate ().
15700
15701 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15702
15703         * statement.cs: fixed build-breaker. All tests passed ok.
15704
15705 2002-06-27  Martin Baulig  <martin@gnome.org>
15706
15707         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
15708         for System.Decimal when compiling corlib.
15709
15710 2002-06-27  Martin Baulig  <martin@gnome.org>
15711
15712         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
15713         switch blocks which contain nothing but a default clause.
15714
15715 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
15716
15717        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
15718
15719 2002-06-27  Martin Baulig  <martin@gnome.org>
15720
15721         * ecore.cs (PropertyExpr.PropertyExpr): Call
15722         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
15723
15724         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
15725         is already a TypeBuilder.
15726
15727 2002-06-27  Martin Baulig  <martin@gnome.org>
15728
15729         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
15730         `target_type == TypeManager.array_type', not IsAssignableFrom() in
15731         the "from an array-type to System.Array" case.  This makes it work
15732         when compiling corlib.
15733
15734 2002-06-27  Martin Baulig  <martin@gnome.org>
15735
15736         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
15737         non-static PropertyExpr, set its InstanceExpression.  This makes
15738         the `ICollection.Count' property work in System/Array.cs.
15739
15740 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
15741
15742         * driver.cs: Made error handling more consistent.  Errors now
15743         tracked by Report class, so many methods which used to return int
15744         now return void.  Main() now prints success/failure and 
15745         errors/warnings message.
15746
15747         Renamed '--probe' compiler argument to '--expect-error'.  Removed
15748         the magic number return values (123 and 124).  Now, if the
15749         expected error occurs, the compiler exits with success (exit value
15750         0).  If the compilation completes without seeing that particular
15751         error, the compiler exits with failure (exit value 1).  The
15752         makefile in mcs/errors has been changed to handle the new behaviour.
15753
15754         * report.cs: Made 'expected error' number a property and renamed
15755         it from 'Probe' to 'ExpectedError'.
15756
15757         * genericparser.cs: Removed error handling support, since it is
15758         now all done by Report class.
15759
15760         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
15761         class, so parse() no longer returns an int.
15762
15763         * namespace.cs: Use Report.Error instead of GenericParser.error
15764
15765 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
15766
15767         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
15768         TypeContainer.AddOperator): At the front of the list put the
15769         explicit implementations, so they get resolved/defined first. 
15770
15771 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
15772
15773         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
15774         interface type is implemented by this TypeContainer.  Used during
15775         explicit interface implementation.
15776
15777         (Property.Define, Indexer.Define, Method.Define): Validate that
15778         the given interface in the explicit implementation is one of the
15779         base classes for the containing type.
15780
15781         Also if we are explicitly implementing an interface, but there is
15782         no match in the pending implementation table, report an error.
15783
15784         (Property.Define): Only define the property if we are
15785         not explicitly implementing a property from an interface.  Use the
15786         correct name also for those properties (the same CSC uses,
15787         although that is really not needed).
15788
15789         (Property.Emit): Do not emit attributes for explicitly implemented
15790         properties, as there is no TypeBuilder.
15791
15792         (Indexer.Emit): ditto.
15793
15794         Hiding then means that we do not really *implement* a pending
15795         implementation, which makes code fail.
15796
15797 2002-06-22  Martin Baulig  <martin@gnome.org>
15798
15799         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
15800         the return value of Object.GetType().  [FIXME: we need to do this whenever
15801         we get a type back from the reflection library].
15802
15803 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
15804
15805         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
15806
15807 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
15808
15809         * attribute.cs: Return null if we can not look up the type.
15810
15811         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
15812         the interface types found.
15813
15814         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
15815         interface types found.
15816
15817         * typemanager.cs (GetInterfaces): Make this routine returns alll
15818         the interfaces and work around the lame differences between
15819         System.Type and System.Reflection.Emit.TypeBuilder in the results
15820         result for GetInterfaces.
15821
15822         (ExpandInterfaces): Given an array of interface types, expand and
15823         eliminate repeated ocurrences of an interface.  This expands in
15824         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
15825         be IA, IB, IC.
15826
15827 2002-06-21  Martin Baulig  <martin@gnome.org>
15828
15829         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
15830         on System.Enum.
15831
15832 2002-06-21  Martin Baulig  <martin@gnome.org>
15833
15834         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
15835         and called with one of the core types, return the corresponding typebuilder for
15836         that type.
15837
15838         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
15839         element type.
15840
15841 2002-06-21  Martin Baulig  <martin@gnome.org>
15842
15843         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
15844         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
15845         (Expression.ConvertReferenceExplicit): Likewise.
15846
15847         * expression.cs (ElementAccess.DoResolve): Likewise.
15848         (ElementAccess.DoResolveLValue): Likewise.
15849
15850 2002-06-10  Martin Baulig  <martin@gnome.org>
15851
15852         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
15853         add the "value" parameter to the parameter list.
15854
15855         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
15856         to our caller.
15857
15858 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
15859
15860         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
15861         the argument to an int, uint, long or ulong, per the spec.  Also
15862         catch negative constants in array creation.
15863
15864 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
15865
15866         * class.cs: do not allow the same interface to appear twice in
15867         the definition list.
15868
15869 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
15870
15871         * ecore.cs: don't use ldlen with System.Array.
15872
15873 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
15874
15875         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
15876
15877 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
15878
15879         * modifiers.cs: produce correct field attributes for protected
15880         internal. Easy fix so miguel can work on ther harder stuff:-)
15881
15882 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
15883
15884         * pending.cs: New file.  Move the code from class.cs here.
15885         Support clearning the pending flag for all methods (when not doing
15886         explicit interface implementation).
15887
15888 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
15889
15890         * rootcontext.cs: added a couple more types needed to bootstrap.
15891
15892 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
15893
15894         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
15895         constructor in the type, instead of any constructor in the type
15896         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
15897         a bug in the Mono runtime when applying the params attribute). 
15898
15899 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
15900         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
15901
15902 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
15903
15904         * expression.cs (Unary.ResolveOperator): Use TypeManager
15905         to resolve the type.
15906
15907 2002-06-13  Ravi Pratap  <ravi@ximian.com>
15908
15909         * cs-parser.jay (enum_member_declaration): Pass in the attributes
15910         attached.
15911
15912         * enum.cs (AddEnumMember): Add support to store the attributes associated 
15913         with each member too.
15914
15915         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
15916         field builders too - this takes care of the enum member case.
15917
15918 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
15919
15920         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
15921         address-of operator on both value types and pointers.
15922
15923 2002-06-10  Martin Baulig  <martin@gnome.org>
15924
15925         * interface.cs (Interface.PopulateIndexer): Add the indexer's
15926         PropertyBuilder to the `property_builders' list.
15927
15928         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
15929         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
15930         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
15931         find any indexers which are inherited from an interface.
15932
15933 2002-06-09  Martin Baulig  <martin@gnome.org>
15934
15935         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
15936         the same type as the constant if necessary.  There's also a test-130.cs
15937         for this.
15938
15939         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
15940
15941         * typemanager.cs (TypeManager.ChangeType): Previously known as
15942         Enum.ChangeEnumType().
15943
15944 2002-06-09  Martin Baulig  <martin@gnome.org>
15945
15946         * expression.cs (Cast.TryReduce): Added support for consts.
15947
15948 2002-06-08  Ravi Pratap  <ravi@ximian.com>
15949
15950         * class.cs (Accessor): Hold attributes information so we can pass
15951         it along.
15952
15953         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
15954         Modify to pass in attributes attached to the methods.
15955
15956         (add_accessor_declaration, remove_accessor_declaration): Ditto.
15957
15958         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
15959         to handle the Accessor kind :-)
15960
15961         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
15962
15963 2002-06-08  Martin Baulig  <martin@gnome.org>
15964
15965         * expression.cs (Unary.TryReduceNegative): Added support for
15966         ULongConstants.
15967
15968 2002-06-08  Martin Baulig  <martin@gnome.org>
15969
15970         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
15971         name can't be found in the `defined_names' - the caller will do a
15972         MemberLookup in this case and thus find methods in System.Enum
15973         such as Enum.IsDefined().
15974
15975 2002-06-08  Martin Baulig  <martin@gnome.org>
15976
15977         * enum.cs (Enum.ChangeEnumType): This is a custom version of
15978         Convert.ChangeType() which works with TypeBuilder created types.
15979         (Enum.LookupEnumValue, Enum.Define): Use it here.
15980
15981         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
15982         `TypeBuilder.BaseType != null' check.
15983         (TypeContainer.FindMembers): Only lookup parent members if we
15984         actually have a parent.
15985         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
15986         (ConstructorInitializer.Resolve): Likewise.
15987
15988         * interface.cs (Interface.FindMembers): Added
15989         `TypeBuilder.BaseType != null' check.
15990
15991         * rootcontext.cs (RootContext.ResolveCore): Added
15992         "System.Runtime.CompilerServices.IndexerNameAttribute" to
15993         classes_second_stage.
15994
15995         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
15996         debug_type and trace_type when compiling with --nostdlib.       
15997
15998 2002-06-07  Martin Baulig  <martin@gnome.org>
15999
16000         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16001         (AddField): Set it to true when adding a non-static field.
16002         (DefineType): Use `have_nonstatic_fields' to find out whether we
16003         have non-static fields, not `Fields != null'.
16004
16005 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16006
16007         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16008         dereferencing a null on the static-field code path)
16009
16010 2002-05-30  Martin Baulig  <martin@gnome.org>
16011
16012         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16013         to take command line arguments.  Use reflection to call the new
16014         custom `Initialize' function on the symbol writer and pass it the
16015         command line arguments.
16016
16017         * driver.cs (--debug-args): New command line argument to pass command
16018         line arguments to the symbol writer.
16019
16020 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16021
16022         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16023         the target type for indexers and properties.  Thanks to Joe for
16024         catching this.
16025
16026 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16027
16028         * typemanager.cs (MethodFlags): returns the method flags
16029         (Obsolete/ShouldIgnore) that control warning emission and whether
16030         the invocation should be made, or ignored. 
16031
16032         * expression.cs (Invocation.Emit): Remove previous hack, we should
16033         not do this on matching a base type, we should do this based on an attribute
16034
16035         Only emit calls to System.Diagnostics.Debug and
16036         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16037         on the command line.
16038
16039         * rootcontext.cs: Global settings for tracing and debugging.
16040
16041         * cs-tokenizer.cs (define): New utility function to track
16042         defines.   Set the global settings for TRACE and DEBUG if found.
16043
16044 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16045
16046         * interface.cs (Populate*): Pass in the TypeContainer as well as
16047         the DeclSpace as parameters so that we can create EmitContexts and
16048         then use that to apply attributes etc.
16049
16050         (PopulateMethod, PopulateEvent, PopulateProperty)
16051         (PopulateIndexer): Apply attributes everywhere.
16052
16053         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16054         etc.
16055
16056         (ApplyAttributes): Update accordingly.
16057
16058         We now apply interface attributes for all members too.
16059
16060 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16061
16062         * class.cs (Indexer.Define); Correctly check if we are explicit
16063         implementation (instead of checking the Name for a ".", we
16064         directly look up if the InterfaceType was specified).
16065
16066         Delay the creation of the PropertyBuilder.
16067
16068         Only create the PropertyBuilder if we are not an explicit
16069         interface implementation.   This means that explicit interface
16070         implementation members do not participate in regular function
16071         lookups, and hence fixes another major ambiguity problem in
16072         overload resolution (that was the visible effect).
16073
16074         (DefineMethod): Return whether we are doing an interface
16075         implementation. 
16076
16077         * typemanager.cs: Temporary hack until we get attributes in
16078         interfaces (Ravi is working on that) and we get IndexerName
16079         support in interfaces.
16080
16081         * interface.cs: Register the indexers as properties.
16082
16083         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16084         warning, I have verified that this is a bug in the .NET runtime
16085         (JavaScript suffers of the same problem).
16086
16087         * typemanager.cs (MemberLookup): When looking up members for
16088         interfaces, the parent of an interface is the implicit
16089         System.Object (so we succeed in searches of Object methods in an
16090         interface method invocation.  Example:  IEnumerable x;  x.ToString
16091         ()) 
16092
16093 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16094
16095         * class.cs (Event): Events should also register if they do
16096         implement the methods that an interface requires.
16097
16098         * typemanager.cs (MemberLookup); use the new GetInterfaces
16099         method. 
16100
16101         (GetInterfaces): The code used to lookup interfaces for a type is
16102         used in more than one place, factor it here. 
16103
16104         * driver.cs: Track the errors at the bottom of the file, we kept
16105         on going.
16106
16107         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16108         instance if the method we are calling is static!
16109
16110 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16111
16112         * attribute.cs (ApplyAttributes): Make this function filter out
16113         the IndexerName attribute (as that attribute in reality is never
16114         applied) and return the string constant for the IndexerName
16115         attribute. 
16116
16117         * class.cs (TypeContainer.Emit): Validate that all the indexers
16118         have the same IndexerName attribute, and if so, set the
16119         DefaultName attribute on the class. 
16120
16121         * typemanager.cs: The return value might contain other stuff (not
16122         only methods).  For instance, consider a method with an "Item"
16123         property and an Item method.
16124
16125         * class.cs: If there is a problem with the parameter types,
16126         return. 
16127
16128 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16129
16130         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16131         looks at user defined conversion after making a call to 
16132         StandardConversionExists - we need this for overload resolution.
16133
16134         * expression.cs : Update accordingly the various method calls.
16135
16136         This fixes 2 bugs filed against implicit user defined conversions 
16137
16138 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16139
16140         * statement.cs: Track the result of the assignment.
16141
16142 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16143
16144         * expression.cs (MemberAccess): Improved error reporting for
16145         inaccessible members.
16146
16147 2002-05-22  Martin Baulig  <martin@gnome.org>
16148
16149         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16150         itself with debugging support.
16151
16152 2002-05-22  Martin Baulig  <martin@gnome.org>
16153
16154         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16155         Removed, this isn't needed anymore.
16156
16157 2002-05-20  Martin Baulig  <martin@gnome.org>
16158
16159         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16160         be underlying type for an enum.
16161
16162 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16163
16164         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16165         that splits out the loading of just the core types.
16166
16167         * rootcontext.cs (ResolveCore): Split the struct resolution in
16168         two, so we can load the enumeration underlying types before any
16169         enums are used.
16170
16171         * expression.cs (Is): Bandaid until we fix properly Switch (see
16172         bug #24985 for details).
16173
16174         * typemanager.cs (ImplementsInterface): The hashtable will contain
16175         a null if there are no interfaces implemented.
16176
16177 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16178
16179         * cs-parser.jay (indexer_declarator): It is fine to have array
16180         parameters
16181
16182 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16183
16184         * typemanager.cs: (RegisterBuilder): New function used to register
16185         TypeBuilders that implement interfaces.  Since
16186         TypeBuilder.GetInterfaces (as usual) does not work with lame
16187         Reflection.Emit. 
16188         (AddUserType): register interfaces.
16189
16190         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16191         dealing with TypeBuilder.  Also, arrays are showing up as
16192         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16193         methods can not be invoked on them!
16194
16195         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16196         (ImplicitReferenceConversionExists): Split out from
16197         StandardConversionExists. 
16198
16199         * expression.cs (As): We were only implementing one of the three
16200         cases for the as operator.  We now implement them all.
16201         (Is): Implement the various other cases for Is as well.
16202
16203         * typemanager.cs (CACHE): New define used to control if we want or
16204         not the FindMembers cache.  Seems to have a negative impact on
16205         performance currently
16206
16207         (MemberLookup): Nested types have full acess to
16208         enclosing type members
16209
16210         Remove code that coped with instance/static returns for events, we
16211         now catch this in RealFindMembers.
16212
16213         (RealFindMembers): only perform static lookup if the instance
16214         lookup did not return a type or an event.  
16215
16216 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16217
16218         * assign.cs (CompoundAssign): We pass more semantic information
16219         now to Compound Assignments than we did before: now we have all
16220         the information at hand, and now we resolve the target *before* we
16221         do the expression expansion, which allows the "CacheValue" method
16222         to have the effect we intended (before, a [x] += 1 would generate
16223         two differen ArrayAccess expressions from the ElementAccess,
16224         during the resolution process).
16225
16226         (CompoundAssign.DoResolve): Resolve target and original_source here.
16227
16228 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16229
16230         * expression.cs (ArrayAccess): dropped debugging information. 
16231
16232         * typemanager.cs: Small bug fix: I was always returning i_members,
16233         instead of one of i_members or s_members (depending on which had
16234         the content).
16235
16236         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16237         method is invoked before any code generation takes place, and it
16238         is a mechanism to inform that the expression will be invoked more
16239         than once, and that the method should use temporary values to
16240         avoid having side effects
16241
16242         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16243
16244         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16245         implementation.
16246
16247         * expression.cs (Indirection, ArrayAccess): Add support for
16248         CacheTemporaries in these two bad boys. 
16249
16250         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16251         ldobj or ldind_ref.  
16252         (StoreFromPtr): Handle stobj as well.
16253
16254         * expression.cs (UnaryMutator): Share more code.
16255
16256         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16257         down: I was not tracking the Filter function as well, which
16258         was affecting the results of the cache.
16259
16260 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16261
16262         * attribute.cs: Remove the hack to handle the CharSet property on
16263         StructLayouts. 
16264
16265 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
16266
16267         * attribute.cs (DoResolve): More uglyness, we now only try to
16268         resolve the attribute partially, to extract the CharSet
16269         information (only if we are a StructLayout attribute).  Otherwise 
16270
16271         (GetExtraTypeInfo): Add some code to conditionally kill in the
16272         future this.   I am more and more convinced that the .NET
16273         framework has special code to handle the attribute setting on
16274         certain elements.
16275
16276         * expression.cs (IsParamsMethodApplicable): Revert my previous
16277         foreach change here, it was wrong.
16278
16279 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
16280
16281         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
16282         (pp_expr): do not abort on unknown input, just return.
16283         (eval): abort if there are pending chars.
16284
16285         * attribute.cs (Attribute.Resolve): Positional parameters are
16286         optional.  Deal with that case.
16287
16288         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
16289         the Ansi/Unicode/Auto information for the type.
16290
16291         (TypeContainer.DefineType): instantiate the EmitContext here, as
16292         we will be using it during the type definition (to resolve
16293         attributes) and during the emit phase.
16294
16295         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
16296         to pull type information out of the attributes
16297
16298         (Attribute.Resolve): track the constructor builder, and allow for
16299         multiple invocations (structs and classes will use this).
16300
16301         * ecore.cs (MemberLookupFinal): new version with all the
16302         parameters customizable.
16303
16304         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
16305         constructors.  Return if the result value is null (as the error
16306         would have been flagged already by MemberLookupFinal)
16307
16308         Do not allow instances of abstract classes or interfaces to be
16309         created.
16310
16311         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
16312         We have to compare the assembly property here when dealing with
16313         FamANDAssem and Assembly access modifiers, because we might be
16314         creating an assembly from *modules* (that means that we are not
16315         getting TypeBuilders for types defined in other modules that are
16316         part of this assembly).
16317
16318         (Method.Emit): If the method is marked abstract and has a body,
16319         emit an error. 
16320
16321         (TypeContainer.DefineMembers): If both the defined member and the
16322         parent name match are methods, then do not emit any warnings: let
16323         the Method.Define routine take care of flagging warnings.  But if
16324         there is a mismatch (method overrides something else, or method is
16325         overriwritten by something, then emit warning).
16326
16327         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
16328         set to null, this means `do not check for the return type on the
16329         signature'. 
16330
16331         (Method.Define): set the return type for the method signature to
16332         null, so that we get methods with the same name and parameters and
16333         different return types.  This is used to flag warning 114 (you are
16334         hiding a method, and you probably want to use the new/override
16335         keywords instead).
16336
16337         * typemanager.cs (MemberLookup): Implemented proper access
16338         control, closing a long standing set of bug reports.  The problem
16339         was that the Framework only has two bits: Public and NonPublic,
16340         and NonPublic includes private and protected methods, but we need
16341         to enforce the FamANDAssem, FamOrAssem and Family. 
16342
16343 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
16344
16345         * statement.cs (GotoCase): Return true: Ammounts to giving up
16346         knowledge on whether we return or not, and letting the other case
16347         be responsible for it.
16348
16349 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
16350
16351         * driver.cs: Do not load directories for each file processed, only
16352         do it if there is a pattern.
16353
16354         * ecore.cs: Report readonly assigns here as well, as we might have
16355         been resolved only by MemberAccess.
16356
16357         (SimpleName.SimpleNameResolve): Also be useful for LValue
16358         resolution.   We need this to propagate assign to local readonly variables
16359
16360         * typemanager.cs: Use a ptrhashtable for the criteria, because we
16361         do not want to reuse potential criteria memory.
16362
16363         * class.cs (MyEventBuilder): Set reflected_type;
16364
16365         * ecore.cs (Constantify): Added support for constifying bools.
16366
16367         (RootContext.LookupType): Added a cache for values looked up in
16368         the declaration space.
16369
16370         * typemanager.cs (FindMembers): Now is a front-end to
16371         RealFindMembers, and provides a two-level hashtable-based cache to
16372         the request.  
16373
16374         15% performance improvement: from 22.5 to 19.2 seconds.
16375
16376         * expression.cs (IsParamsMethodApplicable): use foreach.
16377         (Invocation.DoResolve): ditto.
16378         (New.DoResolve): ditto.
16379         (ArrayCreation.DoResolve): ditto.
16380
16381         * ecore.cs (FindMostEncompassingType): use foreach.
16382
16383         * delegate.cs (NewDelegate.DoResolve): Use foreach
16384
16385         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
16386         (RemoveMethods): use foreach.
16387
16388         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
16389         nested foreach statements instead of for, and also break out of
16390         the inner loop once a match is found.
16391
16392         (Invocation.OverloadResolve): Use foreach, simplify the code. 
16393
16394 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
16395
16396         * cfold.cs (BinaryFold): During an enumeration evaluation context,
16397         we actually unwrap the expression to allow for extra information
16398         to be extracted. 
16399
16400         * expression.cs: Use Shr_Un on unsigned operations. 
16401
16402 2002-05-08  Ravi Pratap  <ravi@ximian.com>
16403
16404         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
16405         applicable operators was not being considered correctly. This closes
16406         the bug Miguel reported.
16407
16408 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
16409
16410         * attribute.cs: check that the type derives from System.Attribute
16411         and report the correct error in that case (moved the duplicate code to
16412         its own method, too).
16413
16414 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
16415
16416         * attribute.cs: lookup attribute type name as the spec says: first the
16417         bare attribute name and then name + "Attribute" (nant compiles with
16418         mcs after this fix).
16419
16420 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
16421
16422         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
16423         Because of the way we parse things, we should try to see if a
16424         UIntConstant can fit in an integer.
16425
16426 2002-05-07  Ravi Pratap  <ravi@ximian.com>
16427
16428         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
16429         when we are in an explicit context.
16430
16431         (ConvertReferenceExplicit): When converting from Iface type S to Class
16432         T make sure the rules are implemented as an OR.
16433
16434         * parameter.cs (ParameterType): Make it a property for now although the
16435         purpose really isn't anything immediate.
16436
16437         * expression.cs (Is*Applicable): Do better checking on the parameter type
16438         of a ref/out parameter. The ones from the system assemblies are already 
16439         marked with the correct type so we don't need to do any correction.
16440
16441         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
16442         the object type is standard too so include that.
16443
16444 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16445
16446         * ecore.cs (StandardConversionExists): Augment with missing code:
16447         deal with IntConstant, LongConstants and Enumerations.
16448
16449         * assign.cs: Report the error, instead of failing silently
16450
16451         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
16452         typecontainer that they are declared, because the
16453         typecontainer/namespace will have the list of using clauses that
16454         need to be applied.
16455
16456         Assembly Attributes were escaping the normal registration
16457         mechanism. 
16458
16459         (EmitCode): Apply attributes within an EmitContext that represents
16460         the container they were declared on.
16461
16462         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
16463
16464 2002-05-06  Ravi Pratap  <ravi@ximian.com>
16465
16466         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
16467         Revamp completely - make much cleaner as we now operate only
16468         on a set of Types.
16469
16470         (FindMostSpecificSource, FindMostSpecificTarget): New methods
16471         to implement the logic detailed in the spec more correctly.
16472
16473         (UserDefinedConversion): Update accordingly.
16474
16475 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16476
16477         * statement.cs: Return flow analysis information up.
16478
16479         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
16480         and the default.
16481
16482         (token): Do not consume an extra character before calling
16483         decimal_digits.
16484
16485 2002-05-06  Piers Haken <piersh@friskit.com>
16486
16487         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
16488
16489 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
16490
16491         * class.cs (Constructor.Emit): Set the IsStatic flag in the
16492         EmitContext during the instance constructor initializer
16493         resolution, to stop access to instance variables.
16494
16495         This is mandated by the spec, last paragraph of the `constructor
16496         initializers' section. 
16497
16498 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
16499
16500         * cs-parser.jay, class.cs (Accessor): new class used to represent
16501         an accessor (get or set).  In the past we used `null' to represent
16502         a missing accessor.  But this is ambiguous because there was no
16503         way to tell in abstract indexers/properties if one of them was
16504         specified.
16505
16506         Now there is a way of addressing that.
16507
16508         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
16509         instead of FindMembers.
16510
16511         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
16512         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
16513
16514         * attribute.cs: Treat indexers and properties as the same in terms
16515         of applying attributes
16516
16517         * ecore.cs (FindMostEncompassedType): Use statically initialized
16518         EmptyExpressions()s like we do elsewhere to avoid creating useless
16519         objects (and we take this out of the tight loop).
16520
16521         (GetConversionOperators): Move the code to extract the actual
16522         operators to a separate routine to clean things up.
16523
16524 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
16525
16526         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
16527         events are always registered FieldBuilders.
16528
16529         * class.cs (FieldBase): New class shared by Fields 
16530
16531         * delegate.cs: If we are a toplevel delegate, use our full name.
16532         If we are a nested delegate, then only use our tail name.
16533
16534 2002-05-02  Ravi Pratap  <ravi@ximian.com>
16535
16536         * expression.cs (IsApplicable): Ensure that we add the "&" to
16537         ref/out types before comparing it with the type of the argument.
16538
16539         (IsParamsMethodApplicable): Ditto.
16540
16541         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
16542         silly me ;-)
16543
16544         * delegate.cs : Handle the case when we have more than one applicable
16545         method. Flag an error only when we finish checking all.
16546
16547 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
16548
16549         * expression.cs: Add support for boolean static initializers.
16550
16551 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
16552
16553         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
16554
16555         * parameter.cs (ComputeParameterTypes,
16556         ComputeAndDefineParameterTypes): Better error handling: now we
16557         clear the `types' cache if we fail during any of the type lookups.
16558         We also return the status code correctly to our caller
16559
16560         * delegate.cs: If we fail to define a delegate, abort the extra
16561         steps. 
16562
16563         * expression.cs (Binary.ResolveOperator): for
16564         operator==(object,object) and operator !=(object, object) we also
16565         have to verify that there is an implicit conversion from one to
16566         the other.
16567
16568         (ArrayAccess.DoResolve): Array Access can operate on
16569         non-variables. 
16570
16571 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
16572
16573         * assign.cs (CompoundAssign): A new class used as a "flag" that
16574         the assignment actually is happening as part of a compound
16575         assignment operator.
16576
16577         During compound assignment, a few new rules exist to enable things
16578         like:
16579
16580         byte b |= 1 + 2
16581
16582         From the spec:
16583
16584         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
16585         to the type of x) if y is implicitly convertible to the type of x,
16586         and the operator is a builtin operator and the return type of the
16587         operator is explicitly convertible to the type of x. 
16588
16589         * rootcontext.cs: Reset warning level to 2.  4 catches various
16590         "interesting" features in mcs, we must clean this up at some
16591         point, but currently am trying to kill other bugs ;-)
16592
16593         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
16594         in container classes as well.  
16595
16596         * expression.cs (Binary.ResolveOperator): Handle string case
16597         before anything else (as operator overloading does emit an error
16598         before doing anything else).
16599
16600         This code could go away when we move to a table driven model, but
16601         i could not come up with a good plan last night.
16602
16603 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
16604
16605         * typemanager.cs (CSharpName): reimplementation using regex.
16606         * class.cs: added null check for fields in Emit
16607         * rootcontext.cs: set warninglevel to 4
16608
16609 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
16610
16611         * typemanager.cs (CSharpName): reimplemented with Lupus
16612         suggestion.
16613
16614 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
16615
16616         * statement.cs (If): correclty implement Resolve, because we were
16617         not catching sem errors in there.  The same process is needed
16618         everywhere else. 
16619         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
16620
16621
16622         (Statement.Warning_DeadCodeFound): Factorize code.
16623         (While): Report dead code here too.
16624
16625         (Statement): Added Resolve virtual method to allow
16626         for resolution split from the emit code.
16627
16628 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16629
16630         * statement.cs (EmitBoolExpression): No longer try to resolve the
16631         expression here.    
16632         (MakeBoolean): New utility function that resolve, implicitly
16633         converts to boolean and tags the expression. 
16634
16635
16636         (If, Do): Implement dead code elimination.
16637         (While): Implement loop inversion
16638
16639         (Do, While, For, If): Resolve the expression prior to calling our
16640         code generation.
16641
16642 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
16643
16644         * class.cs:
16645           - added method Report28 (warning: program has more than one entry point)
16646           - added method IsEntryPoint, implements paragraph 10.1 of the spec
16647           - modified method Method.Define, the part at the end of the method
16648
16649         * rootcontext.cs: added static public Location EntryPointLocation;
16650           
16651         * ../errors/cs0028.cs : Add test case for the above warning.              
16652
16653         * typemanager.cs:
16654           - modified method CSharpName to allow arrays of primitive type to
16655             be printed nicely (e.g. instead of System.Int32[][] it now prints
16656             int[][])
16657           - added method CSharpSignature: returns the signature of a method
16658             in string format to be used in reporting errors, warnings, etc.
16659
16660         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
16661         with String.Empty.
16662
16663 2002-04-26  Ravi Pratap  <ravi@ximian.com>
16664
16665         * delegate.cs (Define): Fix extremely silly bug where I was
16666         setting the type of the 'object' parameter of the BeginInvoke
16667         method to System.IAsyncResult instead of System.Object ;-)
16668
16669 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
16670
16671         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
16672         here. 
16673
16674         (Constructor.Emit): return if we fail to initialize the
16675         constructor.  Another door closed!  
16676
16677         * expression.cs (New.DoResolve): Improve error message (from -6 to
16678         1501).  Use DeclaredOnly lookup to find the exact constructor.
16679
16680         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
16681         loop.  This is useful.
16682
16683         * cs-parser.jay: Adjust the default parameters so that destructors
16684         have the proper signature.
16685
16686 2002-04-26  Martin Baulig  <martin@gnome.org>
16687
16688         * driver.cs (LoadAssembly): If `assembly' contains any characters
16689         which are only valid in path names and not in assembly names
16690         (currently slash, backslash and point), use Assembly.LoadFrom ()
16691         instead of Assembly.Load () on the `assembly' (before iteration
16692         over the link_paths).
16693
16694 2002-04-26  Martin Baulig  <martin@gnome.org>
16695
16696         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
16697
16698 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
16699
16700         * class.cs (Property): use the new typemanager.MemberLookup
16701
16702         (TypeContainer.MemberLookup): Implement using the
16703         TypeManager.MemberLookup now. 
16704
16705         * typemanager.cs: Make MemberLookup a function of the TypeManager,
16706         and return MemberInfos, so that these can be used without an
16707         EmitContext (what we had before).
16708
16709 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
16710
16711         * expression.cs: Fix the case where the argument to params if the
16712         type of the params.  I omitted handling this before.   Fixed
16713
16714 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16715
16716         * driver.cs: Call BootCorlib_PopulateCoreType
16717
16718         * class.cs (Property.CheckBase): Check for properties only, not
16719         for all members. 
16720
16721         * interface.cs: Temporary hack: try/catch around the
16722         CustomAttributeBuilder, because I am getting an exception that I
16723         do not understand.
16724
16725         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
16726         types whose definitions are required to be there (attributes are
16727         defined before standard types).
16728
16729         Compute definitions as we boot the various types, as they are used
16730         immediately (value_type class will need object_type, but if we do
16731         not initialize object_type, we will pass a null, which will let
16732         the runtime pick the System.Object from the existing corlib, which
16733         is not what we want).
16734
16735 2002-04-22  Patrik Torstensson <totte@labs2.com>
16736
16737         * cs-tokenizer.cs: fixed a number of trim() issues.
16738
16739 2002-04-22  Ravi Pratap  <ravi@ximian.com>
16740
16741         * expression.cs (Argument.Type): Ensure that we return the correct
16742         type when we have out or ref parameters [in which case we 
16743         append a "&"].
16744
16745 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
16746
16747         * class.cs (Property, Indexer): Allow extern modifier in there. 
16748
16749         * typemanager.cs (InitBaseTypes): Initializes object_type and
16750         value_type, since those will be used early on during the bootstrap
16751         process to compile corlib.
16752
16753         (InitCoreTypes): Move code from here to InitBaseTypes.
16754
16755 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
16756
16757         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
16758         single-dimension arrays as using the ldlen opcode.  
16759
16760         Daniel Lewis discovered this optimization.  
16761
16762         * typemanager.cs: Add signature for System.Array::get_Length
16763
16764 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16765
16766         * statement.cs: report the error when the foreach does not apply to an
16767         array nor a collection.
16768
16769 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
16770
16771         * expression.cs: Add implicit conversions to the operator ~.
16772
16773         * constant.cs (DecimalConstant.Emit): Emit decimal value.
16774
16775         * typemanager.cs: Locate the decimal constructor.
16776
16777 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16778
16779         * attribute.cs: use the new property of TypeOf.
16780         * expression.cs: added 'get' property around typearg.
16781
16782         These changes fix a build breaker reported by NickD. Is this the
16783         correct way to fix?  If not, please, revert my changes and make it
16784         work :-).
16785
16786 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
16787
16788         * attribute.cs: Add support for typeof in attribute invocations.
16789         I am not sure that this is right though.
16790
16791 2002-04-14  Duncan Mak  <duncan@ximian.com>
16792
16793         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
16794         Binary.Operator.Division case.
16795
16796 2002-04-13  Ravi Pratap  <ravi@ximian.com>
16797
16798         * class.cs (DefineType): Ensure that we do a proper check on
16799         attribute types and also register it with the TypeManager.
16800
16801         (TypeContainer.Targets): The default for attribute types is
16802         AttributeTargets.All.
16803
16804         * attribute.cs (ApplyAttributes): Registering the attribute type
16805         is done elsewhere, not when we discover we have a Usage attribute.
16806
16807 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16808
16809         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
16810         and get rid of is_delegate parameter.
16811
16812         * everywhere : update.
16813
16814 2002-04-12  Ravi Pratap  <ravi@ximian.com>
16815
16816         * cs-parser.jay (compilation_unit): Revamp completely to use
16817         some new ideas that I got from Rhys' grammar to solve the problems
16818         with assembly level attributes.
16819
16820         (outer_declaration): New grammar production.
16821
16822         (attribute_sections): Add.
16823
16824         (opt_attributes): Base on attribute_sections
16825
16826         (namespace_declaration): Allow opt_attributes to tackle the case
16827         when we have assembly level attributes - we are clever in this
16828         regard now ;-)
16829
16830         * attribute.cs (ApplyAttributes): Do not worry about assembly 
16831         attributes in the non-global context.
16832
16833         * rootcontext.cs (AddGlobalAttributes): Go back to using this
16834         instead of SetGlobalAttributes.
16835
16836         * class.cs, rootcontext.cs : Ensure we define and generate 
16837         attribute types before anything else.
16838
16839         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
16840         and flag the new error -20 for the case when the attribute type
16841         does not have valid targets specified. csc does not catch this.
16842
16843         * ../errors/errors.txt : update for error # -20
16844
16845 2002-04-11  Ravi Pratap  <ravi@ximian.com>
16846
16847         * support.cs (InternalParameters.ParameterModifier): Do some null
16848         checking and return sane values.
16849
16850         * class.cs (Method.Define): If we are a PInvoke method, ensure
16851         that we are static and extern. Report error # 601
16852
16853         * ../errors/cs0601.cs : Add test case for the above error.
16854
16855 2002-04-07  Ravi Pratap  <ravi@ximian.com>
16856
16857         * rootcontext.cs (attribute_types): We need to keep type of
16858         all attribute types separately and emit code for them first.
16859
16860         (RegisterAttribute) : Implement.
16861
16862         * class.cs (DefineType): Check if the current Type is a custom
16863         attribute type and register it accordingly.
16864
16865         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
16866         adding the first attribute twice and rename to
16867
16868         (SetGlobalAttributes): this.
16869
16870         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
16871         lookups.
16872
16873         * attribute.cs (ApplyAttributes): Take an additional argument telling us
16874         if we are processing global arguments. Hmm, I am unsure of this.
16875
16876 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16877
16878         * expression.cs: added static array of strings to avoid calling
16879         Enum.ToString () for Operator in Binary. Significant recover of
16880         performance.
16881
16882 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
16883
16884         * class.cs (FindMembers): Allow the Builders of the various
16885         members to be null.  If they are skip them.  This only happens
16886         during the PInvoke declaration.
16887
16888 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
16889
16890         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
16891         failure, so we do not keep going afterwards.
16892
16893         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
16894         wanted to pass `false' as the `is_delegate' argument.  If this is
16895         the case, why not use delegate_type == null to mean `is_delegate =
16896         false' and anything else as is_delegate = true.
16897
16898 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
16899
16900         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
16901         code for the section, not the beginning of the tests.
16902
16903 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
16904
16905         * cfold.cs: Handle operator + (Enum x, Underlying x) 
16906
16907         * expression.cs (Binary): same.  Warn about errors where we have
16908         Enum/Enum in operator + as well.
16909
16910 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
16911
16912         * statement.cs:
16913                 - added support for switch(bool)
16914                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
16915                 - add TableSwitchEmit() to handle table-based switch statements
16916
16917 2002-04-05  Ravi Pratap  <ravi@ximian.com>
16918
16919         * expression.cs (Invocation.OverloadResolve): Factor out code which
16920         does parameter compatibility checking with arguments so that we can 
16921         re-use the code even from Delegate.VerifyApplicability
16922
16923         (VerifyArgumentsCompat): Move above code here.
16924
16925         * delegate.cs (VerifyApplicability): Get rid of duplicate code
16926         and instead make a call to the above method.
16927
16928 2002-03-31  Ravi Pratap  <ravi@ximian.com>
16929
16930         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
16931         We use it to keep track of classes which are attribute types.
16932
16933 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
16934
16935         * delegate.cs (Delegate.Define): Correctly define the types in the
16936         presence of fixed and array parameters.
16937
16938         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
16939         doing FindMembers.
16940
16941         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
16942         include NonPublic after the first iteration.
16943
16944         * class.cs (Indexer.CheckBase): Only check if both parents are
16945         non-null. 
16946
16947         * cs-parser.jay (accessor_body): If empty, set to null.
16948
16949         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
16950         same code path here to resolve constants names that we did have in
16951         MemberAccess.DoResolve.  There is too much code duplicated here.
16952
16953 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
16954
16955         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
16956
16957         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
16958         to MakeUnionSet.
16959
16960         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
16961         tokens, numbers and strings.
16962
16963         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
16964         parenthesis.
16965
16966         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
16967         asyncronous parameters and the regular parameters.  
16968
16969         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
16970         specify the target directory.
16971
16972         * expression.cs: (This.DoResolve): Simplify
16973         (As.Emit): Optimize, do not generate IsInst if the expression is
16974         always of the given type.
16975
16976         (Is.DoResolve): Bug fix, we were reporting both always/never for
16977         the is expression.
16978
16979         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
16980         creating too many unnecessary arrays.
16981
16982 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
16983
16984         * class.cs (EmitFieldInitializer): Use Assign expression to assign
16985         fields instead of rolling our own initializer.   Takes care of all
16986         implicit conversions, and drops unnecessary static checks/argument.
16987
16988 2002-03-31  Dick Porter  <dick@ximian.com>
16989
16990         * driver.cs: use the GetDirectories() return values properly, and
16991         use "/" as path separator.
16992
16993 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
16994
16995         * expression.cs (Unary): Optimize - - expr into expr.
16996         (Binary): Optimize a + (-b) into a -b.
16997
16998         * codegen.cs (CodeGen): Made all methods static.
16999
17000 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17001
17002         * rootcontext.cs: 
17003
17004         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17005         TypeBuilder property.
17006
17007         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17008         instead. 
17009
17010         * tree.cs: Removed the various RecordXXXX, and replaced with a
17011         single RecordDecl.  Removed all the accessor methods, and just
17012         left a single access point Type 
17013
17014         * enum.cs: Rename DefineEnum to DefineType.
17015
17016         * decl.cs: New abstract method `DefineType' used to unify the
17017         Defines for Enumerations, Interfaces, TypeContainers and
17018         Delegates.
17019
17020         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17021         LookupBaseClasses method that used to live in class.cs and
17022         interface.cs here, and renamed to FindType.
17023
17024         * delegate.cs: Implement DefineType.  Take advantage of the
17025         refactored pattern for locating the parent builder without taking
17026         the parent_builder argument (which we know does not work if we are
17027         nested, and triggering a toplevel definition).
17028
17029 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17030
17031         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17032         accessibility of a member has changed during override and report
17033         an error if so.
17034
17035         * class.cs (Method.Define, Property.Define): Only complain on
17036         overrides if the method is private, any other accessibility is
17037         fine (and since we just checked the permission is the same, we are
17038         good to go).
17039
17040         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17041         and elif are processed always.  The other pre-processing
17042         directives are only processed if we are "taking" the path
17043
17044 2002-03-29  Martin Baulig  <martin@gnome.org>
17045
17046         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17047         current location is not Null.
17048
17049         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17050         a separate method so we can profile it.
17051
17052         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17053         `span.Seconds' are just seconds, but no minutes or hours.
17054         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17055
17056 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17057
17058         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17059         Remove the gratuitous set of Final:
17060
17061                                 // If an interface implementation, then we can set Final.
17062                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17063                                     implementing.DeclaringType.IsInterface)
17064                                         flags |= MethodAttributes.Final;
17065
17066         I do not know what I was smoking when I used that.
17067
17068
17069         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17070         step into fixing the name resolution issues for delegates and
17071         unifying the toplevel name resolution.
17072
17073 2002-03-28  Martin Baulig  <martin@gnome.org>
17074
17075         * class.cs (Method.Emit): If we have a symbol writer, call its
17076         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17077         tell it about the current method.
17078
17079         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17080         writer that we're going to emit the first byte of IL code for a new
17081         statement (a new source line).
17082         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17083         EmitContext.Mark() before emitting any code.
17084
17085         * location.cs (SymbolDocument): Return null when we're Null.
17086
17087         * statement.cs (Statement): Moved the `Location loc' variable here.
17088         (Statement.EmitBoolExpression): If we have a symbol writer, call
17089         ec.Mark() before emitting any code to tell it that we're at the
17090         beginning of a new statement.
17091         (StatementExpression): Added `Location' argument to the constructor.
17092         (Block): Added public readonly variable `StartLocation' and public
17093         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17094         (Block): Added constructor which takes a start and end location.
17095         (Block.SetEndLocation): New method. This sets the end location.
17096         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17097         local variables we create.
17098         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17099         each statement and do also mark the begin and end of the block.
17100
17101         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17102         tell it the current lexer.Location, use Location.Null for the end of the
17103         block.
17104         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17105         current block, set its end location using SetEndLocation().
17106         (statement_expression): StatementExpression constructor now takes the
17107         lexer.Location as additional argument.
17108         (for_statement, declare_local_variables): Likewise.
17109         (declare_local_variables): When creating a new implicit block, use the
17110         new Block constructor and pass it the lexer.Location.
17111
17112 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17113
17114         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17115         members also on the parent interfaces recursively.
17116
17117 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17118
17119         * report.cs: Use new formats, since Gonzalo finished the missing
17120         bits. 
17121
17122         * expression.cs (Binary.ResolveOperator): added missing operator|
17123         operator& and operator^ for bool/bool.
17124
17125         * cs-parser.jay: CheckDef now takes a Location argument that is
17126         used to report errors more precisly (instead of reporting the end
17127         of a definition, we try to track something which is a lot closer
17128         to the source of the problem).
17129
17130         * cs-tokenizer.cs: Track global token use, so we can properly flag
17131         the use of #define/#undef after the first token has been seen.
17132
17133         Also, rename the reportXXXX to Error_DescriptiveName
17134
17135         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17136         TypeContainer, so that Enum and Interface can use this too.
17137
17138         * class.cs (TypeContainer.LookupInterfaceOrClass,
17139         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17140         `builder' argument.  Typically this was used to pass the parent
17141         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17142         the definition).  
17143
17144         The problem is that a nested class could trigger the definition of
17145         a toplevel class, and the builder would be obviously wrong in that
17146         case. 
17147
17148         So we drop this argument, and we compute dynamically the
17149         TypeBuilder/ModuleBuilder (the correct information was available
17150         to us anyways from DeclSpace.Parent)
17151
17152         * interface.cs (Interface.DefineInterface): Drop builder
17153         parameter cleanup like class.cs
17154
17155         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17156         like class.cs
17157
17158         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17159         values. 
17160
17161         (Try.Emit): Propagate the returns value from the statement.
17162
17163         (Return.Emit): Even if we are leavning 
17164
17165         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17166
17167         * modifiers.cs: Fix the computation of MethodAttributes flags.
17168
17169 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17170
17171         * driver.cs: allow compilation of files that start with '/'.
17172         Add a default case when checking the argument of --target.
17173
17174 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17175
17176         * interface.cs: Implement the same search algorithm for types in
17177         the interface code.
17178
17179         * delegate.cs: Do not allow multiple definition.
17180
17181         * Recovered ChangeLog that got accidentally amputated
17182
17183         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17184
17185         * rootcontext.cs: Load manually enum to allow core classes to
17186         contain enumerations.
17187
17188         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17189         Update to new static methods in TypeManager.
17190
17191         * typemanager.cs (GetMethod, GetConstructor): Use our
17192         implementation of FindMembers to find the members, since during
17193         corlib compilation, the types are TypeBuilders and GetMethod and
17194         GetConstructor do not work.
17195
17196         Make all methods in TypeManager static.
17197
17198         (InitCodeHelpers): Split the functionality from
17199         the InitCodeTypes function.
17200
17201         * driver.cs: Call InitCodeHelpers after we have populated the
17202         types. 
17203
17204         * cs-parser.jay (delegate_declaration): we did not used to compute
17205         the delegate name correctly for void delegates.
17206
17207 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17208
17209         * rootcontext.cs (RootContext): Init the interface_resolve_order
17210         and type_container_resolve_order always.
17211
17212         (ResolveCore, BootstrapCorlib_ResolveClass,
17213         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17214         compiler when compiling with --nostdlib
17215
17216         * class.cs (TypeContainer.DefineType): Check that our parent is
17217         not null.  This test is most important when we are bootstraping
17218         the core types.
17219
17220         * codegen.cs: Split out the symbol writing code.
17221
17222 2002-03-25  Martin Baulig  <martin@gnome.org>
17223
17224         * driver.cs (-g): Made -g an alias for --debug.
17225
17226 2002-03-24  Martin Baulig  <martin@gnome.org>
17227
17228         * codegen.cs (SymbolWriter): New public variable. Returns the
17229         current symbol writer.
17230         (CodeGen): Added `bool want_debugging_support' argument to the
17231          constructor. If true, tell the ModuleBuild that we want debugging
17232         support and ask it for the ISymbolWriter.
17233         (Save): If we have a symbol writer, call it's Close() method after
17234         saving the assembly.
17235
17236         * driver.c (--debug): New command line argument to create a
17237         debugger information file.
17238
17239         * location.cs (SymbolDocument): New public property. Returns an
17240         ISymbolDocumentWriter object for the current source file or null
17241         if we don't have a symbol writer.
17242
17243 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17244
17245         * driver.cs (LoadAssembly): Correctly return when all the paths
17246         have been tried and not before.
17247
17248         * statement.cs (Switch.Emit): return the actual coverage for this
17249         statement (returns/not-returns)
17250
17251         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17252         switch of the statement if we are the last switch section.  That
17253         kills two problems: try/catch problems (we used to emit an empty
17254         nop at the end) and switch statements where all branches would
17255         return. 
17256
17257 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17258
17259         * driver.cs: Add default assemblies (the equivalent to the
17260         Microsoft CSC.RSP file)
17261
17262         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17263         also update tokens_seen and set it to false.
17264
17265         * driver.cs: Implement --recurse for Mike.
17266
17267         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
17268         correctly splitting out the paths.
17269
17270 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
17271
17272         * interface.cs (Interface.PopulateProperty): Instead of using
17273         `parent' as the declaration space for the set parameters, use
17274         `this' 
17275
17276         * support.cs (InternalParameters): InternalParameters constructor
17277         takes a DeclSpace instead of a TypeContainer.
17278
17279         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
17280         types are being initialized, load the address of it before calling
17281         the function.  
17282
17283         (New): Provide a mechanism to disable the generation of local
17284         value type temporaries when the caller will be providing us with
17285         an address to store it.
17286
17287         (ArrayCreation.EmitDynamicInitializers): Use it.
17288
17289 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
17290
17291         * expression.cs (Invocation.EmitArguments): Only probe for array
17292         property if there is more than one argument.  Sorry about that.
17293
17294         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
17295         empty param arrays.
17296
17297         * class.cs (Method.LabelParameters): Fix incorrect code path that
17298         prevented the `ParamArrayAttribute' from being applied to the
17299         params attribute.
17300
17301 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
17302
17303         * support.cs (ReflectionParameters): Correctly compute whether the
17304         last argument is a params array.  Fixes the problem with
17305         string.Split ('a')
17306
17307         * typemanager.cs: Make the assemblies array always be non-null
17308         (empty, but non-null)
17309
17310         * tree.cs (RecordDecl): New function that abstracts the recording
17311         of names.  This reports error 101, and provides a pointer to the
17312         previous declaration.  Fixes a crash in the compiler.
17313
17314         * cs-parser.jay (constructor_declaration): Update to new grammar,
17315         and provide a constructor_body that can be empty.
17316
17317 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
17318
17319         * driver.cs: Add support for --resources.
17320
17321         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
17322         Make all types for the various array helper methods be integer.
17323
17324         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
17325         CheckState to ConvCast.
17326
17327         (ConvCast): Now it takes a `checked' state argument, to avoid
17328         depending on the emit context for the conversion, and just using
17329         the resolve time setting.
17330
17331         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
17332         instead of Invocation.EmitArguments.  We do not emit the original
17333         arguments, instead we emit those which have been converted to
17334         unsigned int expressions.
17335
17336         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
17337
17338         * codegen.cs: ditto.
17339
17340         * expression.cs (LocalVariableReference): Drop the use of the
17341         Store function that depended on the variable index.
17342
17343         * statement.cs (VariableInfo): Drop the `Idx' property from this
17344         class, as this is not taking into account the indexes for
17345         temporaries tat we generate during the execution, getting the
17346         indexes wrong.
17347
17348         * class.cs: First emit class initializers, then call the parent
17349         constructor. 
17350
17351         * expression.cs (Binary): Fix opcode emision.
17352         (UnaryMutator.EmitCode): Support checked code generation
17353
17354         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
17355         matches for events for both the Static and Instance scans,
17356         pointing to the same element.   Fix that.
17357
17358 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
17359
17360         * rootcontext.cs (ResolveTree): Always set the
17361         interface_resolve_order, because nested interfaces will be calling
17362         into us.
17363
17364         * class.cs (GetInterfaceOrClass): Track the same resolution
17365         process used by TypeManager.LookupType.  This fixes the nested
17366         type lookups in class declarations (separate path from
17367         LookupType). 
17368
17369         (TypeContainer.DefineType): Also define nested interfaces.
17370         (TypeContainer.RegisterOrder): New public function used to
17371         register the order in which child interfaces need to be closed.
17372
17373         Nested interfaces need to be closed after their parents have been
17374         created. 
17375
17376         * interface.cs (InterfaceAttr): Put all the logic for computing
17377         the interface attribute here. 
17378
17379         (DefineInterface): Register our interface order with the
17380         RootContext or with the TypeContainer depending on the case.
17381
17382 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17383
17384         * cs-parser.jay: rework foreach statement to work with the new
17385         changes to the policy on SimpleNames.
17386
17387         * report.cs: support Stacktrace on warnings as well.
17388
17389         * makefile: drop --unsafe and /unsafe from the compile.
17390
17391 2002-03-13  Ravi Pratap  <ravi@ximian.com>
17392
17393         * ecore.cs (StandardConversionExists): Modify to take an Expression
17394         as the first parameter. Ensure we do null -> reference type conversion
17395         checking.
17396
17397         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
17398         temporary Expression objects.
17399
17400 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
17401
17402         * interface.cs: workaround bug in method overloading resolution
17403         (there is already a bugzilla bug for it).
17404
17405 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
17406
17407         We could also solve this problem by having a separate path for
17408         performing type lookups, instead of DoResolve, we could have a
17409         ResolveType entry point, and only participating pieces of the
17410         production (simplename, deref, array) would implement this. 
17411
17412         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
17413         signal SimpleName to only resolve type names and not attempt to
17414         resolve anything else.
17415
17416         * expression.cs (Cast): Set the flag.
17417
17418         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
17419
17420         * class.cs: Only report 108 if there is no `new' modifier.
17421
17422         * cs-parser.jay: rework foreach statement to work with the new
17423         changes to the policy on SimpleNames.
17424
17425         * report.cs: support Stacktrace on warnings as well.
17426
17427         * makefile: drop --unsafe and /unsafe from the compile.
17428
17429 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
17430
17431         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17432         lookups here, instead of doing that at parse time.  This means
17433         that our grammar will not introduce `LocalVariableReferences' as
17434         expressions at this point.  That solves the problem of code like
17435         this:
17436
17437         class X {
17438            static void Main ()
17439            { int X = 1;
17440             { X x = null }}}
17441
17442         This is only half the fix.  The full fix requires parameters to
17443         also be handled in this way.
17444
17445         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
17446         makes the use more obvious of the DeclSpace.  The
17447         ec.TypeContainer.TypeBuilder is now only used to pull the
17448         TypeBuilder for it.
17449
17450         My theory is that I can get rid of the TypeBuilder completely from
17451         the EmitContext, and have typecasts where it is used (from
17452         DeclSpace to where it matters).  
17453
17454         The only pending problem is that the code that implements Aliases
17455         is on TypeContainer, and probably should go in DeclSpace.
17456
17457         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
17458         lookups here, instead of doing that at parse time.  This means
17459         that our grammar will not introduce `LocalVariableReferences' as
17460         expressions at this point.  That solves the problem of code like
17461         this:
17462
17463         class X {
17464            static void Main ()
17465            { int X = 1;
17466             { X x = null }}}
17467
17468         This is only half the fix.  The full fix requires parameters to
17469         also be handled in this way.
17470
17471         * class.cs (Property.DefineMethod): When implementing an interface
17472         method, set newslot, when implementing an abstract method, do not
17473         set the flag (before we tried never setting it, or always setting
17474         it, which is the difference).
17475         (Indexer.DefineMethod): same.
17476         (Method.DefineMethod): same.
17477
17478         * ecore.cs: Only set the status used flag if we get back a Field.
17479
17480         * attribute.cs: Temporary hack, so Paolo can keep working.
17481
17482 2002-03-08  Ravi Pratap  <ravi@ximian.com>
17483
17484         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
17485         the unmanaged type in the case we have a MarshalAs attribute.
17486
17487         (Resolve): Handle the case when we are parsing the special MarshalAs
17488         attribute [we need to store the unmanaged type to use later]
17489
17490         * typemanager.cs (marshal_as_attr_type): Built in type for the 
17491         MarshalAs Attribute.
17492
17493         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
17494         on parameters and accordingly set the marshalling info.
17495
17496 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
17497
17498         * class.cs: Optimizing slightly by removing redundant code after
17499         we switched to the `NoTypes' return value.
17500         (Property.DefineMethod): use NoTypes here too.
17501
17502         This fixes the bug I introduced in my last batch of changes.
17503
17504 2002-03-05  Ravi Pratap  <ravi@ximian.com>
17505
17506         * tree.cs (RecordEnum): Add. We now keep track of enums too.
17507
17508         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
17509         Enums since those are types too. 
17510
17511         * cs-parser.jay (enum_declaration): Record enums as we parse them.
17512
17513         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
17514         thanks to a call during the lookup process.
17515
17516 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
17517
17518         * statement.cs (Foreach): Lots of work to accomodate a particular
17519         kind of foreach statement that I had not kept in mind.  It is
17520         possible to have foreachs on classes that provide a GetEnumerator
17521         method that return objects that implement the "pattern" for using
17522         a foreach, there is no need to support GetEnumerator
17523         specifically. 
17524
17525         This is needed to compile nant.
17526
17527         * decl.cs: Only report 114 if the member is not `Finalize' and if
17528         the warning level is at least 2.
17529
17530         * class.cs: Moved the compare function from Method to
17531         MethodSignature. 
17532
17533         (MethodSignature.InheritableMemberSignatureCompare): Add new
17534         filter function that is used to extract inheritable methods from a
17535         class. 
17536
17537         (Method.Define): Use the new `inheritable_method_signature_filter'
17538         delegate
17539
17540         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
17541         command. 
17542
17543 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
17544
17545         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
17546
17547         * cs-parser.jay: Add opt_semicolon to the interface declaration.
17548
17549         * expression.cs: Pass location information to
17550         ConvertImplicitStandard. 
17551
17552         * class.cs: Added debugging code to track return values from
17553         interfaces. 
17554
17555 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
17556
17557         * expression.cs (Is.DoResolve): If either side of the `is' is an
17558         interface, do not flag the warning.
17559
17560         * ecore.cs (ImplicitReferenceConversion): We need a separate test
17561         for interfaces
17562
17563         * report.cs: Allow for --fatal to be used with --probe.
17564
17565         * typemanager.cs (NoTypes): Move the definition for the empty Type
17566         array here. 
17567
17568         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
17569         properties. 
17570         (TypeContainer.DefineProxy): New function used to proxy to parent
17571         implementations when implementing interfaces.
17572         (TypeContainer.ParentImplements): used to lookup if our parent
17573         implements a public function that is required by an interface.
17574         (TypeContainer.VerifyPendingMethods): Hook this up.
17575
17576         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
17577         `modules' and `assemblies' arraylists into arrays.  We only grow
17578         these are the very early start up of the program, so this improves
17579         the speedof LookupType (nicely measured).
17580
17581         * expression.cs (MakeByteBlob): Replaced unsafe code with
17582         BitConverter, as suggested by Paolo.
17583
17584         * cfold.cs (ConstantFold.Binary): Special case: perform constant
17585         folding of string concatenation, but if either side is a string,
17586         and the other is not, then return null, and let the runtime use
17587         the concatenation on the string plus the object (using
17588         `Object.ToString'). 
17589
17590 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
17591
17592         Constant Folding has been implemented now.
17593
17594         * expression.cs (Unary.Reduce): Do not throw an exception, catch
17595         the error instead on types that are not supported in one's
17596         complement. 
17597
17598         * constant.cs (Constant and all children): New set of functions to
17599         perform implict and explicit conversions.
17600
17601         * ecore.cs (EnumConstant): Implement the new functions to perform
17602         conversion by proxying to the child expression.
17603
17604         * codegen.cs: (ConstantCheckState): Constant evaluation has its
17605         own separate setting that can not be turned off from the command
17606         line using --unchecked or --checked and is only controlled using
17607         the checked/unchecked statements and expressions.  This setting is
17608         used by the constant folder to flag errors.
17609
17610         * expression.cs (CheckedExpr, UncheckedExpr): Set the
17611         ConstantCheckState as well.   
17612
17613         During Resolve, they also have to flag the state, because the
17614         constant folder runs completely in the Resolve phase.
17615
17616         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
17617         well.
17618
17619 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17620
17621         * cfold.cs: New file, this file contains the constant folder.
17622
17623         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
17624         argument to track whether we are using the resulting address to
17625         load or store a value and provide better error messages. 
17626
17627         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
17628         new AddressOf arguments.
17629
17630         * statement.cs (Foreach.EmitCollectionForeach): Update
17631
17632         * expression.cs (Argument.Emit): Call AddressOf with proper
17633         arguments to track usage.
17634
17635         (New.DoEmit): Call AddressOf with new arguments.
17636
17637         (Unary.Emit): Adjust AddressOf call.
17638
17639 2002-03-01  Ravi Pratap  <ravi@ximian.com>
17640
17641         * cs-parser.jay (member_access): Change the case for pre-defined types
17642         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
17643         this suggestion.
17644
17645         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
17646         a method body.
17647
17648         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
17649         essentially like methods and apply attributes like MethodImplOptions to them too.
17650
17651         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
17652         not being null.
17653
17654         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
17655         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
17656         is the DeclSpace.
17657
17658         * Update code everywhere accordingly.
17659
17660         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
17661
17662         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
17663
17664 2002-02-28  Ravi Pratap  <ravi@ximian.com>
17665
17666         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
17667         try performing lookups against those instead of jumping straight into using
17668         the 'using' clauses.
17669
17670         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
17671
17672         (LookupType): Perform lookups in implicit parents too.
17673
17674         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
17675         sequence as RootContext.LookupType. 
17676
17677         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
17678         the various cases of namespace lookups into this method.
17679
17680 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
17681
17682         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
17683         in positional arguments)
17684
17685         * class.cs (Operator): Update the AllowedModifiers to contain
17686         extern. 
17687
17688         * cs-parser.jay: Update operator declaration to allow for the
17689         operator body to be empty.
17690
17691         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
17692         values. 
17693
17694 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
17695
17696         * class.cs (Method.Emit): Label parameters.
17697
17698         * driver.cs: Return 1 or 0 as the program exit code.
17699
17700 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
17701
17702         * expression.cs: Special case the `null' object when trying to
17703         auto-compute the type, as anything can be explicitly converted to
17704         that. 
17705
17706         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
17707         spotting this Paolo.
17708
17709         (Expression.ImplicitNumericConversion): Perform comparissions of
17710         the type using the underlying type in the case of an enumeration
17711         rather than using the enumeration type for the compare.
17712
17713         Cope with the underlying == type case, which is not possible to
17714         catch before. 
17715
17716         (Expression.ConvertNumericExplicit): Perform comparissions of
17717         the type using the underlying type in the case of an enumeration
17718         rather than using the enumeration type for the compare.
17719
17720         * driver.cs: If the user does not supply an extension, assume .exe
17721
17722         * cs-parser.jay (if_statement): Rewrote so that we can track the
17723         location for the if statement.
17724
17725         * expression.cs (Binary.ConstantFold): Only concat strings when
17726         the operation is "+", not everything ;-)
17727
17728         * statement.cs (Statement.EmitBoolExpression): Take a location
17729         argument. 
17730         (If, While, Do): Track location.
17731
17732         * expression.cs (Binary.ResolveOperator): In the object + string
17733         case, I was missing a call to ConvertImplicit
17734
17735 2002-02-25  Ravi Pratap  <ravi@ximian.com>
17736
17737         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
17738         Location arguments. Ensure we use RootContext.LookupType to do our work
17739         and not try to do a direct Type.GetType and ModuleBuilder.GetType
17740
17741         * interface.cs (PopulateMethod): Handle the type of the parameter being
17742         null gracefully.
17743
17744         * expression.cs (Invocation.BetterFunction): Handle the case when we 
17745         have a params method with no fixed arguments and a call is made with no
17746         arguments.
17747
17748 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
17749
17750         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
17751         the verbatim-string-literal
17752
17753         * support.cs (InternalParameters.ParameterModifier): handle null
17754         fixed parameters.
17755         (InternalParameters.ParameterType): ditto.
17756
17757         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
17758         duplicating the name of the variable parameter.
17759         (GetParameterByName): Fix bug where we were not looking up array
17760         paramters if they were the only present (thanks Paolo!).
17761         (GetParameterInfo): We only have an empty set of types if both
17762         fixed and array are set to null.
17763         (GetParameterInfo-idx): Handle FixedParameter == null
17764
17765         * cs-parser.jay: Handle the case where there is no catch
17766         statements (missing null test).
17767
17768 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
17769
17770         * driver.cs (MainDriver): Be conservative on our command line
17771         handling.
17772
17773         Catch DirectoryNotFoundException when calling GetFiles.
17774
17775         (SplitPathAndPattern): Used to split the input specification into
17776         a path and a pattern that we can feed to Directory.GetFiles.
17777
17778 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
17779
17780         * statement.cs (Fixed): Implement the last case of the Fixed
17781         statement (string handling).
17782
17783         * expression.cs (StringPtr): New class used to return a char * to
17784         a string;  Used by the Fixed statement.
17785
17786         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
17787
17788         * expression.cs (Binary.ResolveOperator): Remove redundant
17789         MemberLookup pn parent type.
17790         Optimize union call, we do not need a union if the types are the same.
17791         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
17792         type.
17793
17794         Specialize the use of MemberLookup everywhere, instead of using
17795         the default settings. 
17796
17797         (StackAlloc): Implement stackalloc keyword.
17798
17799         * cs-parser.jay: Add rule to parse stackalloc.
17800
17801         * driver.cs: Handle /h, /help, /?
17802
17803         * expression.cs (MakeByteBlob): Removed the hacks we had in place
17804         before we supported unsafe code.
17805
17806         * makefile: add --unsafe to the self compilation of mcs.
17807
17808 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
17809
17810         * expression.cs (PointerArithmetic): New class that is used to
17811         perform pointer arithmetic.
17812         (Binary.Resolve): Handle pointer arithmetic
17813         Handle pointer comparission.
17814         (ArrayPtr): Utility expression class that is used to take the
17815         address of an array.
17816
17817         (ElementAccess): Implement array access for pointers
17818
17819         * statement.cs (Fixed): Implement fixed statement for arrays, we
17820         are missing one more case before we are done.
17821
17822         * expression.cs (Indirection): Implement EmitAssign and set the
17823         ExprClass to Variable.  This allows pointer dereferences to be
17824         treated as variables, and to have values assigned to them.
17825
17826         * ecore.cs (Expression.StoreFromPtr): New utility function to
17827         store values dereferencing.
17828
17829 2002-02-20  Ravi Pratap  <ravi@ximian.com>
17830
17831         * expression.cs (Binary.ResolveOperator): Ensure that we are
17832         not trying to operate on a void type - this fixes the reported
17833         bug.
17834
17835         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
17836         the parent implementation is sealed.
17837
17838         * ../errors/cs0239.cs : Add.
17839
17840         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
17841
17842         * typemanager.cs (unverifiable_code_type): Corresponds to 
17843         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
17844         which have unsafe code in them.
17845
17846         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
17847         unsafe context.
17848
17849 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
17850
17851         * cs-tokenizer.cs: Add support for @"litreal strings"
17852
17853         Make tokenizer accept pre-processor directives
17854         on any column (remove the old C-like limitation). 
17855
17856         * rootcontext.cs (EmitCode): Emit any global attributes.
17857         (AddGlobalAttributes): Used to keep track of assembly attributes. 
17858
17859         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
17860
17861         * cs-parser.jay: Add support for global attributes.  
17862
17863 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
17864
17865         * expression.cs (Indirection): New helper class.  Unary will
17866         create Indirection classes to be able to implement the
17867         IMemoryLocation interface on it.
17868
17869 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
17870
17871         * cs-parser.jay (fixed_statement): reference the right statement.
17872
17873         * statement.cs (Fixed.Emit): Finish implementing the fixed
17874         statement for the &x case.
17875
17876 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
17877
17878         * class.cs (Property.Define, Method.Define): Remove newslot when
17879         `implementing'.  
17880
17881         * modifiers.cs: My use of NewSlot when `Abstract' was set was
17882         wrong.  NewSlot should only be used if the `new' keyword is present.
17883
17884         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
17885         locating our system dir.  Sorry about this.
17886
17887 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17888
17889         * driver.cs (GetSystemDir): Compute correctly the location of our
17890         system assemblies.  I was using the compiler directory instead of
17891         the library directory.
17892
17893 2002-02-13  Ravi Pratap  <ravi@ximian.com>
17894
17895         * expression.cs (BetterFunction): Put back in what Miguel commented out
17896         since it is the correct fix. The problem is elsewhere ;-)
17897
17898         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
17899         parameters of the parms method are themselves compatible or not !
17900
17901         (StandardConversionExists): Fix very dangerous bug where we were forgetting
17902         to check that a class implements an interface before saying that an implicit
17903         conversion was allowed. Use ImplementsInterface to do the checking.
17904
17905 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
17906
17907         * class.cs (Method.Define): Track whether we are an explicit
17908         implementation or not.  And only call DefineMethodOverride if we
17909         are an explicit implementation.
17910
17911         (Property.DefineMethod): Ditto.
17912
17913 2002-02-11  Ravi Pratap  <ravi@ximian.com>
17914
17915         * expression.cs (BetterFunction): Catch hideous bug which was
17916          preventing us from detecting ambiguous calls due to implicit casts i.e
17917         cs0121.
17918
17919 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
17920
17921         * support.cs (Pair): Remove un-needed method.  I figured why I was
17922         getting the error in cs-parser.jay, the variable in a foreach loop
17923         is readonly, and the compiler does not really treat this as a variable.
17924
17925         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
17926         instead of EQUALS in grammar.  
17927
17928         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
17929
17930         * expression.cs (Unary.DoResolve): Check whether the argument is
17931         managed or not.
17932
17933 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
17934
17935         * support.cs: Api for Pair to set a value.  Despite the fact that
17936         the variables are public the MS C# compiler refuses to compile
17937         code that accesses the field if the variable is part of a foreach
17938         statement. 
17939
17940         * statement.cs (Fixed): Begin implementation of the fixed
17941         statement.
17942
17943         (Block.AddVariable): Return the VariableInfo on success and null
17944         on failure instead of true/false. 
17945
17946         * cs-parser.jay (foreach): Catch errors on variables already
17947         defined (we were ignoring this value before) and properly unwind
17948         the block hierarchy
17949
17950         (fixed_statement): grammar for the fixed statement.
17951
17952 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
17953
17954         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
17955         pointer types to be incretemented.
17956
17957         (SizeOf): Implement.
17958
17959         * cs-parser.jay (pointer_member_access): Implement
17960         expr->IDENTIFIER production.
17961
17962         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
17963         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
17964         on safe contexts.
17965
17966         (Unary): Implement indirection.
17967
17968         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
17969         use in non-unsafe context).
17970
17971         (SimpleName.DoResolve): Check for pointers in field access on safe
17972         contexts. 
17973
17974         (Expression.LoadFromPtr): Factor the load-indirect code in this
17975         function.  This was duplicated in UnboxCast and ParameterReference
17976
17977 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
17978
17979         * expression.cs (ComposedCast): report an error if a pointer cast
17980         is used in a safe region.
17981
17982         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
17983         pointer type casts in unsafe context.
17984
17985         * codegen.cs (EmitContext): Set up IsUnsafe.
17986
17987         * cs-parser.jay (non_expression_type): Add productions for pointer
17988         casts. 
17989
17990         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
17991         code.  We should not use force into static mode if the method is
17992         not virtual.  Fixes bug in MIS
17993
17994         * statement.cs (Do.Emit, While.Emit, For.Emit,
17995         Statement.EmitBoolExpression): Add support to Do and While to
17996         propagate infinite loop as `I do return' semantics.
17997
17998         Improve the For case to also test for boolean constants.
17999
18000         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18001         to the list of attributes we can add.
18002
18003         Remove `EmitContext' argument.
18004
18005         * class.cs (Method.Define): Apply parameter attributes.
18006         (Constructor.Define): Apply parameter attributes.
18007         (MethodCore.LabelParameters): Move here the core of labeling
18008         parameters. 
18009
18010         * support.cs (ReflectionParameters.ParameterModifier,
18011         InternalParameters.ParameterModifier): Use IsByRef on the type and
18012         only return the OUT bit for these parameters instead of in/out/ref
18013         flags.
18014
18015         This is because I miss-understood things.  The ParameterInfo.IsIn
18016         and IsOut represent whether the parameter has the [In] and [Out]
18017         attributes set.  
18018
18019 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18020
18021         * ecore.cs (FieldExpr.Emit): Release temporaries.
18022
18023         * assign.cs (LocalTemporary.Release): new function.
18024
18025         * codegen.cs (EmitContext.GetTemporaryStorage,
18026         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18027         temporary storage.  Now we can "put back" localbuilders when we
18028         are done with them
18029
18030 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18031
18032         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18033         need to make a copy of the variable to generate verifiable code.
18034
18035 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18036
18037         * driver.cs: Compute dynamically the system directory.
18038
18039         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18040         Slower, but more generally useful.  Used by the abstract
18041         registering implementation. 
18042
18043         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18044         the rules for the special rule on Type/instances.  First check if
18045         we have the same name, and if so, try that special static path
18046         rather than the instance path.
18047
18048 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18049
18050         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18051         for, while and if.
18052
18053         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18054         Enum, ValueType, Delegate or Array for non-corlib compiles.
18055
18056         * cs-tokenizer.cs: Catch long identifiers (645)
18057
18058         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18059         piece of code.
18060
18061         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18062         fix, we were returning too early, so we were not registering
18063         pending methods from abstract classes.
18064
18065         Do not register pending methods if the class is abstract.
18066
18067         * expression.cs (Conditional.DoResolve): Report circular implicit
18068         conversions when we neecd to compute it for conditional
18069         expressions. 
18070
18071         (Is.DoResolve): If the expression is always of the provided type,
18072         flag warning 183.  If the expression can not ever be of the
18073         provided type flag warning 184.
18074
18075         * class.cs: Catch 169 as well.
18076
18077         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18078         read. 
18079
18080 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18081
18082         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18083
18084 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18085
18086         * interface.cs: (PopulateMethod): Check for pointers being defined
18087         only if the unsafe context is active.
18088         (PopulateProperty): ditto.
18089         (PopulateIndexer): ditto.
18090
18091         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18092         specified.  If pointers are present, make sure that they are
18093         present in an unsafe context.
18094         (Constructor, Constructor.Define): ditto.
18095         (Field, Field.Define): ditto.
18096         (Property, Property.Define): ditto.
18097         (Event, Event.Define): ditto.
18098
18099         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18100         hashtable if there are classes or structs defined.
18101
18102         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18103         code, as the constant resolution moved.
18104
18105         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18106         the metadata, so we can flag error 133. 
18107
18108         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18109         pointer is being declared in an unsafe context.
18110
18111 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18112
18113         * modifiers.cs (Modifiers.Check): Require a Location argument.
18114         Report error 227 for Unsafe use.
18115
18116         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18117
18118         * statement.cs (For.Emit): If the test is null, then report that
18119         we do `return', as we wont reach anything afterwards.
18120
18121         (Switch.SwitchGoverningType): Track the expression that matched
18122         the conversion.
18123
18124         * driver.cs: Allow negative numbers as an error code to flag.
18125
18126         * cs-parser.jay: Handle 1551.
18127
18128         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18129
18130 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18131
18132         * cs-parser.jay: Report 1518 (type declaration can only contain
18133         class, struct, interface, enum or delegate)
18134
18135         (switch_label): Report 1523 (keywords `case' or `default' must
18136         preced code)
18137
18138         (opt_switch_sections): Report 1522 (empty switch)
18139
18140         * driver.cs: Report 1515 (response file specified multiple times)
18141         Report 1516 (Source file specified multiple times).
18142
18143         * expression.cs (Argument.Resolve): Signal 1510
18144
18145         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18146         access not allowed in static code)
18147
18148 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18149
18150         * typemanager.cs (IsPointerType): Utility method which we are going
18151         to need a lot.
18152
18153         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18154         the object type, so we take care of that.
18155
18156         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18157
18158         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18159         added to non-params parameters :-)
18160
18161         * typemanager.cs (CSharpName): Include 'void' type too. 
18162
18163         (void_ptr_type): Include in the set of core types.
18164
18165         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18166         duplicating code.
18167
18168         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18169         an unsafe context.
18170
18171         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18172         completely forgotten about it.
18173
18174 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18175
18176         * cs-parser.jay (pointer_type): Add. This begins our implementation
18177         of parsing rules for unsafe code.
18178
18179         (unsafe_statement): Implement.
18180
18181         (embedded_statement): Modify to include the above.
18182
18183         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18184
18185         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18186         if the current context is an unsafe one.
18187
18188         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18189         are handled differently, we need separate rules for them.
18190
18191         (local_variable_declaration): Update to use local_variable_pointer_type
18192         to allow variable declarations of unmanaged pointer types.
18193
18194         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18195         in unsafe contexts.
18196
18197         * ../errors/cs0214.cs : Add.
18198
18199 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18200
18201         * makefile: remove 'response' file when cleaning.
18202
18203 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18204
18205         * cs-parser.jay: Report 1524.
18206
18207 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18208
18209         * typemanager.cs (RegisterMethod): drop checking if we have
18210         registered this from here
18211
18212 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18213
18214         * class.cs (Method.EmitDestructor): Implement calling our base
18215         destructor. 
18216
18217         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18218         value of InFinally.
18219
18220         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18221         this routine and will wrap the call in a try/catch block.  Deal
18222         with the case.
18223
18224 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18225
18226         * ecore.cs (Expression.MemberLookup): instead of taking a
18227         parameter `same_type' that was used to tell whether we could
18228         access private members we compute our containing type from the
18229         EmitContext.
18230
18231         (FieldExpr): Added partial support for volatile fields.  This does
18232         not work for volatile fields exposed from assemblies, as I can not
18233         figure out how to extract the modreq from it.
18234
18235         Updated all the source files to use this.
18236
18237         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18238         because it is referenced by MemberLookup very often. 
18239
18240 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18241
18242         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18243         TypeBuilder.GetCustomAttributes to retrieve what we need.
18244
18245         Get rid of redundant default_member_attr_type as this is the same as
18246         default_member_type which already exists.
18247
18248         * interface.cs, attribute.cs : Update accordingly.
18249
18250 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18251
18252         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18253         work for TYpeBuilders though.  Ravi, can you please fix this?
18254
18255         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18256
18257         * expression.cs (Argument.Emit): Handle the case of ref objects
18258         being passed to ref functions;  
18259
18260         (ParameterReference.EmitLoad): Loads the content of the pointer
18261         without dereferencing.
18262
18263 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18264
18265         * cs-tokenizer.cs: Implemented the pre-processing expressions.
18266
18267 2002-01-08  Ravi Pratap  <ravi@ximian.com>
18268
18269         * class.cs (Indexer.DefineMethod): Incorporate the interface
18270         type in the name of the method if we are doing explicit interface
18271         implementation.
18272
18273         * expression.cs (ConversionExists): Remove as it is completely obsolete.
18274
18275         (BetterConversion): Fix extremely trivial bug where we were referring to
18276         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
18277         again !
18278
18279         * ../errors/bug16.cs : Add although we have fixed it.
18280
18281 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18282
18283         * expression.cs (BaseIndexer): Begin implementation.
18284
18285         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
18286
18287         * cs-parser.jay (indexer_declarator): Use qualified_identifier
18288         production directly to remove a shift/reduce, and implement
18289         explicit interface implementation.
18290
18291         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
18292         after a floating point suffix.
18293
18294         * expression.cs (DoNumericPromotions): Improved the conversion for
18295         uint/uint.  If we have a constant, we avoid doing a typecast to a
18296         larger type.
18297
18298         * class.cs (Indexer): Implement explicit interface implementation
18299         for indexers.
18300
18301 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
18302
18303         * class.cs: make the default instance constructor public and hidebysig.
18304
18305 2001-01-03  Ravi Pratap  <ravi@ximian.com>
18306
18307         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
18308         so we can call it from elsewhere.
18309
18310         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
18311         we emit it internally if the class has a defined indexer; otherwise the user
18312         emits it by decorating the class definition with the DefaultMemberAttribute.
18313
18314         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
18315         attribute is not used on a type which defines an indexer.
18316
18317         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
18318         character when we skip whitespace.
18319
18320         * ../errors/cs0646.cs : Add.
18321
18322 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
18323
18324         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
18325         again. 
18326
18327         * makefile: Add practical target `mcs3.exe' which builds the third
18328         generation compiler. 
18329
18330         * expression.cs (New): Fix structures constructor calling.
18331
18332         * class.cs (Property, Method, Indexer): Emit Final flag on the
18333         method if we are an interface implementation and we are not
18334         abstract. 
18335
18336         * ecore.cs (PropertyExpr): New public field `IsBase', tells
18337         whether this property is referencing a `base' method.
18338
18339         * expression.cs (Invocation.EmitCall): take an extra argument:
18340         is_base, this is used to determine whether the `call' or
18341         `callvirt' opcode should be used.
18342
18343
18344         * delegate.cs: update EmitCall.
18345
18346         * class.cs (Method.Define): Set NewSlot for the cases where we are
18347         not implementing an interface method.
18348
18349         (Property.Define): ditto.
18350
18351 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
18352
18353         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
18354         'r'.  Allows mcs to parse itself fully.
18355
18356 2002-01-02  Ravi Pratap  <ravi@ximian.com>
18357
18358         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
18359         of the number of initializers that require the InitializeArray method.
18360
18361         (CheckIndices): Store the Expression in all cases - not the plain value. Also
18362         update the above field where necessary.
18363
18364         (MakeByteBlob): Update accordingly.
18365
18366         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
18367         greater than 2.
18368
18369         (EmitDynamicInitializers): Update in accordance with the new optimization.
18370
18371         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
18372         same OpCode applies.
18373
18374         * cs-parser.jay : Fix some glaring errors I introduced.
18375
18376 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
18377
18378         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
18379         so that we can check for name clashes there too.
18380
18381         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
18382         for interface indexers.
18383
18384         * interfaces.cs (Define): Emit the default member attribute.
18385
18386         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
18387         variable was being referred to while setting the value ;-)
18388
18389 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
18390
18391         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
18392         byte-by-byte information when we know the data is zero.
18393
18394         Make the block always a multiple of 4, because
18395         DefineInitializedData has a bug.
18396
18397         * assign.cs: Fix, we should assign from the temporary, not from
18398         the source. 
18399
18400         * expression.cs (MakeByteBlob): Fix my incorrect code.
18401
18402 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
18403
18404         * typemanager.cs (EnumToUnderlying): This function is used to get
18405         the underlying type from an enumeration, because it does not
18406         always work. 
18407
18408         * constant.cs: Use the I4_S form for values between -128 and 127.
18409
18410         * statement.cs (Block.LookupLabel): Looks up a label.
18411         (Block): Drop support for labeled blocks.
18412
18413         (LabeledStatement): New kind of statement that represents a label
18414         only.
18415
18416         (Goto): Finally implement this bad boy.
18417
18418         * cs-parser.jay: Update to reflect new mechanism to implement
18419         labels.
18420
18421 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
18422
18423         * codegen.cs (EmitContext.This): a codegen property that keeps the
18424         a single instance of this instead of creating many different this
18425         instances. 
18426
18427         * delegate.cs (Delegate.DoResolve): Update to use the property;
18428
18429         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
18430
18431         * expression.cs (BaseAccess.DoResolve): Ditto.
18432
18433 2001-12-29  Ravi Pratap  <ravi@ximian.com>
18434
18435         * typemanager.cs (methodimpl_attr_type): Add to hold the type
18436         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
18437
18438         (InitCoreTypes): Update accordingly.
18439
18440         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
18441         so we can quickly store the state.
18442
18443         (ApplyAttributes): Set the correct implementation flags
18444         for InternalCall methods.
18445
18446 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
18447
18448         * expression.cs (EmitCall): if a method is not virtual, then do
18449         not use callvirt on it.
18450
18451         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
18452         user defined stuff) requires the use of stobj, which takes an
18453         address on the stack instead of an array and an index.  So emit
18454         the Ldelema operation for it.
18455
18456         (EmitStoreOpcode): Use stobj for valuetypes.
18457
18458         (UnaryMutator.EmitCode): Use the right 1 value depending on
18459         whether we are dealing with int64/uint64, float or doubles.
18460
18461         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
18462         constructors that I implemented last night.
18463
18464         (Constructor.IsDefault): Fix to work properly for static
18465         constructors.
18466
18467         * cs-parser.jay (CheckDef): report method signature errors.
18468         Update error number 103 to be 132.
18469
18470         * decl.cs: New AdditionResult enumeration value: MethodExists.
18471         Although we do this check for methods later on in the semantic
18472         analysis, catching repeated default constructors is so easy that
18473         we catch these here. 
18474
18475         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
18476         promotions code.
18477
18478         (ParameterReference.EmitAssign, Emit): handle
18479         bools as bytes.
18480
18481         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
18482         (ArrayAccess.EmitStoreOpcode): ditto.
18483
18484         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
18485
18486         * expression.cs (MakeByteBlob): Complete all the missing types
18487         (uint, short, ushort, byte, sbyte)
18488
18489         * class.cs: Only init instance field initializers on instance
18490         constructors. 
18491
18492         Rename `constructors' to instance_constructors. 
18493
18494         (TypeContainer.AddConstructor): Only add constructors to the list
18495         if it is not static.
18496
18497         Make sure that we handle default_static_constructor independently
18498         everywhere where we handle instance_constructors
18499
18500 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
18501
18502         * class.cs: Do not lookup or create a base initializer for a
18503         static constructor.
18504
18505         (ConstructorInitializer.Resolve): use the proper type to lookup
18506         for constructors.
18507
18508         * cs-parser.jay: Report error 1585 (modifiers between type and name).
18509
18510         * enum.cs, interface.cs: Remove CloseType, this is taken care by
18511         in DeclSpace. 
18512
18513         * decl.cs: CloseType is now an virtual method, the default
18514         implementation just closes this type.
18515
18516 2001-12-28  Ravi Pratap  <ravi@ximian.com>
18517
18518         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
18519         to PreserveSig by default. Also emit HideBySig on such methods.
18520
18521         Basically, set the defaults to standard values.
18522
18523         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
18524         argument, if candidate is better, it can't be worse than the best !
18525
18526         (Invocation): Re-write bits to differentiate between methods being
18527         applicable in their expanded form and their normal form - for params
18528         methods of course.
18529
18530         Get rid of use_standard everywhere as only standard conversions are allowed
18531         in overload resolution. 
18532
18533         More spec conformance.
18534
18535 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18536
18537         * driver.cs: Add --timestamp, to see where the compiler spends
18538         most of its time.
18539
18540         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
18541         `this' in static code.
18542
18543         (SimpleName.DoResolve): Implement in terms of a helper function
18544         that allows static-references to be passed upstream to
18545         MemberAccess.
18546
18547         (Expression.ResolveWithSimpleName): Resolve specially simple
18548         names when called by MemberAccess to implement the special
18549         semantics. 
18550
18551         (Expression.ImplicitReferenceConversion): Handle conversions from
18552         Null to reference types before others, as Null's type is
18553         System.Object. 
18554
18555         * expression.cs (Invocation.EmitCall): Handle the special case of
18556         calling methods declared on a reference type from a ValueType
18557         (Base classes System.Object and System.Enum)
18558
18559         (MemberAccess.Resolve): Only perform lookups on Enumerations if
18560         the left hand side is a TypeExpr, not on every enumeration. 
18561
18562         (Binary.Resolve): If types are reference types, then do a cast to
18563         object on operators != and == of both arguments.
18564
18565         * typemanager.cs (FindMembers): Extract instance and static
18566         members if requested.
18567
18568         * interface.cs (PopulateProperty): Use void_type instead of null
18569         as the return type for the setter method.
18570
18571         (PopulateIndexer): ditto.
18572
18573 2001-12-27  Ravi Pratap  <ravi@ximian.com>
18574
18575         * support.cs (ReflectionParameters): Fix minor bug where we
18576         were examining the wrong parameter for the ParamArray attribute.
18577
18578         Cope with requests for the type of the parameter at position
18579         greater than the params parameter's. We now return the element
18580         type of the params array as that makes more sense.
18581
18582         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
18583         accordingly as we no longer have to extract the element type
18584         ourselves.
18585
18586         (Invocation.OverloadResolve): Update.
18587
18588 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
18589
18590         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
18591         against IEnumerator, test whether the return value is a descendant
18592         of the IEnumerator interface.
18593
18594         * class.cs (Indexer.Define): Use an auxiliary method to implement
18595         the other bits of the method definition.  Begin support for
18596         explicit interface implementation.
18597
18598         (Property.DefineMethod): Use TypeManager.void_type instead of null
18599         for an empty return value.
18600
18601 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
18602
18603         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
18604         dealing with a FieldExpr which is composed of a FieldBuilder, in
18605         the code path we did extract the constant, but we should have
18606         obtained the underlying value to be able to cast it (otherwise we
18607         end up in an infinite loop, this is what Ravi was running into).
18608
18609         (ArrayCreation.UpdateIndices): Arrays might be empty.
18610
18611         (MemberAccess.ResolveMemberAccess): Add support for section
18612         14.5.4.1 that deals with the special case of E.I when E is a type
18613         and something else, that I can be a reference to a static member.
18614
18615         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
18616         handle a particular array type to create byte blobs, it is just
18617         something we dont generate byteblobs for.
18618
18619         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
18620         arguments. 
18621
18622         * location.cs (Push): remove the key from the hashtable that we
18623         are about to add.   This happens for empty files.
18624
18625         * driver.cs: Dispose files after we have parsed them.
18626
18627         (tokenize): new function that only runs the tokenizer on its
18628         input, for speed testing.
18629
18630 2001-12-26  Ravi Pratap  <ravi@ximian.com>
18631
18632         * class.cs (Event.Define): Define the private field only if there
18633         are no accessors defined.
18634
18635         * expression.cs (ResolveMemberAccess): If there is no associated
18636         field with the event, that means we have an event defined with its
18637         own accessors and we should flag error cs0070 since transforming
18638         ourselves into a field is not valid in that case.
18639
18640         * ecore.cs (SimpleName.DoResolve): Same as above.
18641
18642         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
18643         and charset to sane values.
18644
18645 2001-12-25  Ravi Pratap  <ravi@ximian.com>
18646
18647         * assign.cs (DoResolve): Perform check on events only if they 
18648         are being accessed outside the declaring type.
18649
18650         * cs-parser.jay (event_declarations): Update rules to correctly
18651         set the type of the implicit parameter etc.
18652
18653         (add_accessor, remove_accessor): Set current local parameters.
18654
18655         * expression.cs (Binary): For delegate addition and subtraction,
18656         cast the return value from the method into the appropriate delegate
18657         type.
18658
18659 2001-12-24  Ravi Pratap  <ravi@ximian.com>
18660
18661         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
18662         of these as the workaround is unnecessary.
18663
18664         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
18665         delegate data - none of that is needed at all.
18666
18667         Re-write bits to extract the instance expression and the delegate method
18668         correctly.
18669
18670         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
18671         on delegates too.
18672
18673         * attribute.cs (ApplyAttributes): New method to take care of common tasks
18674         of attaching attributes instead of duplicating code everywhere.
18675
18676         * everywhere : Update code to do attribute emission using the above method.
18677
18678 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18679
18680         * expression.cs (IsParamsMethodApplicable): if there are not
18681         parameters, return immediately.
18682
18683         * ecore.cs: The 0 literal can be implicity converted to an enum
18684         type. 
18685
18686         (SimpleName.DoResolve): First lookup the type, then lookup the
18687         members. 
18688
18689         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
18690         want to get its address.  If the InstanceExpression is not
18691         addressable, store the result in a temporary variable, then get
18692         the address of it.
18693
18694         * codegen.cs: Only display 219 errors on warning level or above. 
18695
18696         * expression.cs (ArrayAccess): Make it implement the
18697         IMemoryLocation interface.
18698
18699         (Binary.DoResolve): handle the operator == (object a, object b)
18700         and operator != (object a, object b) without incurring into a
18701         BoxedCast (because 5 != o should never be performed).
18702
18703         Handle binary enumerator operators.
18704
18705         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
18706         value type, otherwise use Ldelem_ref.
18707
18708         Use precomputed names;
18709
18710         (AddressOf): Implement address of
18711
18712         * cs-parser.jay (labeled_statement): Fix recursive block
18713         addition by reworking the production.
18714
18715         * expression.cs (New.DoEmit): New has a special case:
18716                 
18717                  If we are dealing with a ValueType, we have a few
18718                  situations to deal with:
18719                 
18720                     * The target of New is a ValueType variable, that is
18721                       easy, we just pass this as the variable reference
18722                 
18723                     * The target of New is being passed as an argument,
18724                       to a boxing operation or a function that takes a
18725                       ValueType.
18726                 
18727                       In this case, we need to create a temporary variable
18728                       that is the argument of New.
18729
18730
18731 2001-12-23  Ravi Pratap  <ravi@ximian.com>
18732
18733         * rootcontext.cs (LookupType): Check that current_type is not null before
18734         going about looking at nested types.
18735
18736         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
18737         not implement the IAssignMethod interface any more.
18738
18739         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
18740         where we tranform them into FieldExprs if they are being resolved from within
18741         the declaring type.
18742
18743         * ecore.cs (SimpleName.DoResolve): Do the same here.
18744
18745         * assign.cs (DoResolve, Emit): Clean up code considerably. 
18746
18747         * ../errors/bug10.cs : Add.
18748
18749         * ../errors/cs0070.cs : Add.
18750
18751         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
18752
18753         * assign.cs : Get rid of EventIsLocal everywhere.
18754
18755 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
18756
18757         * ecore.cs (ConvertIntLiteral): finished the implementation.
18758
18759         * statement.cs (SwitchLabel): Convert the value we are using as a
18760         key before looking up the table.
18761
18762 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18763
18764         * codegen.cs (EmitTopBlock): Require a Location argument now.
18765
18766         * cs-parser.jay (constructor_declarator): We need to setup
18767         current_local_parameters before we parse the
18768         opt_constructor_initializer, to allow the variables to be bound
18769         to the constructor arguments.
18770
18771         * rootcontext.cs (LookupType): First lookup nested classes in our
18772         class and our parents before we go looking outside our class.
18773
18774         * expression.cs (ConstantFold): Extract/debox the values at the
18775         beginnning. 
18776
18777         * rootcontext.cs (EmitCode): Resolve the constants first before we
18778         resolve the types.  This is not really needed, but it helps debugging.
18779
18780         * statement.cs: report location.
18781
18782         * cs-parser.jay: pass location to throw statement.
18783
18784         * driver.cs: Small bug fix.
18785
18786         * report.cs: Updated format to be 4-zero filled digits.
18787
18788 2001-12-22  Ravi Pratap  <ravi@ximian.com>
18789
18790         * expression.cs (CheckIndices): Fix minor bug where the wrong
18791         variable was being referred to ;-)
18792
18793         (DoEmit): Do not call EmitStaticInitializers when the 
18794         underlying type is System.Object.
18795
18796 2001-12-21  Ravi Pratap  <ravi@ximian.com>
18797
18798         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
18799         and do the usual workaround for SRE.
18800
18801         * class.cs (MyEventBuilder.EventType): New member to get at the type
18802         of the event, quickly.
18803
18804         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
18805
18806         * assign.cs (Assign.DoResolve): Handle the case when the target
18807         is an EventExpr and perform the necessary checks.
18808
18809         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
18810         interface.
18811
18812         (SimpleName.MemberStaticCheck): Include check for EventExpr.
18813
18814         (EventExpr): Set the type in the constructor itself since we 
18815         are meant to be born fully resolved.
18816
18817         (EventExpr.Define): Revert code I wrote earlier.
18818                 
18819         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
18820         instance expression is null. The instance expression is a This in that case
18821         or a null, depending on whether it is a static method or not.
18822
18823         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
18824         refers to more than one method.
18825
18826         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
18827         and accordingly flag errors.
18828
18829 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18830
18831         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
18832
18833 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
18834
18835         * location.cs (ToString): Provide useful rutine.
18836
18837 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
18838
18839         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
18840         objects, return the actual integral boxed.
18841
18842         * statement.cs (SwitchLabel): define an ILLabel for each
18843         SwitchLabel. 
18844
18845         (Switch.CheckSwitch): If the value is a Literal, extract
18846         the underlying literal.
18847
18848         Also in the unused hashtable we had, add the SwitchLabel so we can
18849         quickly look this value up.
18850
18851         * constant.cs: Implement a bunch of new constants.  Rewrite
18852         Literal based on this.  Made changes everywhere to adapt to this.
18853
18854         * expression.cs (Expression.MakeByteBlob): Optimize routine by
18855         dereferencing array only once, and also copes with enumrations.
18856
18857         bytes are two bytes wide, not one.
18858
18859         (Cast): Perform constant conversions.
18860
18861         * ecore.cs (TryImplicitIntConversion): Return literals instead of
18862         wrappers to the literals here.
18863
18864         * expression.cs (DoNumericPromotions): long literals can converted
18865         to ulong implicity (this is taken care of elsewhere, but I was
18866         missing this spot).
18867
18868         * ecore.cs (Expression.Literalize): Make the return type Literal,
18869         to improve type checking.
18870
18871         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
18872
18873 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18874
18875         * literal.cs: Revert code from ravi that checked the bounds.  The
18876         bounds are sane by the definition of the type itself. 
18877
18878         * typemanager.cs: Fix implementation of ImplementsInterface.  We
18879         need to actually look up in our parent hierarchy for interfaces
18880         implemented. 
18881
18882         * const.cs: Use the underlying type for enumerations
18883
18884         * delegate.cs: Compute the basename for the delegate creation,
18885         that should fix the delegate test case, and restore the correct
18886         Type Lookup semantics in rootcontext
18887
18888         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
18889         referencing a nested type with the Reflection API is using the "+"
18890         sign. 
18891
18892         * cs-parser.jay: Do not require EOF token at the end.
18893
18894 2001-12-20  Ravi Pratap  <ravi@ximian.com>
18895
18896         * rootcontext.cs (LookupType): Concatenate type names with
18897         a '.' instead of a '+' The test suite passes again.
18898
18899         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
18900         field of the enumeration.
18901
18902         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
18903         the case when the member is an EventExpr.
18904
18905         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
18906         static has an associated instance expression.
18907
18908         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
18909
18910         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
18911
18912         * class.cs (Event.Define): Register event and perform appropriate checks
18913         for error #111.
18914
18915         We define the Add and Remove methods even if the use provides none because
18916         in that case, we provide default implementations ourselves.
18917
18918         Define a private field of the type of the event. This is done by the CSC compiler
18919         and we should be doing it too ;-)
18920
18921         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
18922         More methods we use in code we generate.
18923
18924         (multicast_delegate_type, delegate_type): Two separate types since the distinction
18925         is important.
18926
18927         (InitCoreTypes): Update accordingly for the above.
18928
18929         * class.cs (Event.Emit): Generate code for default accessors that we provide
18930
18931         (EmitDefaultMethod): Do the job in the above.
18932
18933         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
18934         appropriate place.
18935
18936 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
18937
18938         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
18939         builders even if we were missing one.
18940
18941         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
18942         pass the Basename as our class name instead of the Name.  The
18943         basename will be correctly composed for us.
18944
18945         * parameter.cs (Paramters): Now takes a Location argument.
18946
18947         * decl.cs (DeclSpace.LookupType): Removed convenience function and
18948         make all the code call directly LookupType in RootContext and take
18949         this chance to pass the Location information everywhere.
18950
18951         * Everywhere: pass Location information.
18952
18953 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
18954
18955         * class.cs (Constructor.Define): Updated way of detecting the
18956         length of the parameters.
18957
18958         (TypeContainer.DefineType): Use basename as the type name for
18959         nested types.
18960
18961         (TypeContainer.Define): Do not recursively define types here, as
18962         definition is taken care in order by the RootContext.
18963
18964         * tree.cs: Keep track of namespaces in a per-file basis.
18965
18966         * parameter.cs (Parameter.ComputeSignature): Update to use
18967         DeclSpace. 
18968
18969         (Parameters.GetSignature): ditto.
18970
18971         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
18972         instead of a TypeContainer.
18973
18974         (Interface.SemanticAnalysis): Use `this' instead of our parent to
18975         resolve names.  Because we need to be resolve in our context, not
18976         our parents.
18977
18978         * driver.cs: Implement response files.
18979
18980         * class.cs (TypeContainer.DefineType): If we are defined, do not
18981         redefine ourselves.
18982
18983         (Event.Emit): Emit the code for add/remove handlers.
18984         (Event.Define): Save the MethodBuilders for add/remove.
18985
18986         * typemanager.cs: Use pair here too.
18987
18988         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
18989         DictionaryEntry requires the first argument to be non-null.  
18990
18991         (enum_declaration): Compute full name for registering the
18992         enumeration.
18993
18994         (delegate_declaration): Instead of using
18995         formal_parameter_list, use opt_formal_parameter_list as the list
18996         can be empty.
18997
18998         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
18999         (EventParsing): New property that controls whether `add' and
19000         `remove' are returned as tokens or identifiers (for events);
19001
19002 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19003
19004         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19005         use MyEventBuilder only and let it wrap the real builder for us.
19006
19007         (MyEventBuilder): Revamp constructor etc.
19008
19009         Implement all operations that we perform on EventBuilder in precisely the same
19010         way here too.
19011
19012         (FindMembers): Update to use the EventBuilder member.
19013
19014         (Event.Emit): Update accordingly.
19015
19016 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19017
19018         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19019         by calling the appropriate methods.
19020
19021         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19022         useful.
19023
19024         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19025
19026 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19027
19028         * delegate.cs (Delegate.Populate): Check that the return type
19029         and various parameters types are indeed accessible.
19030
19031         * class.cs (Constructor.Define): Same here.
19032
19033         (Field.Define): Ditto.
19034
19035         (Event.Define): Ditto.
19036
19037         (Operator.Define): Check that the underlying Method defined itself
19038         correctly - so it's MethodBuilder should not be null.
19039
19040         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19041         expression happens to be null.
19042
19043         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19044         members but as of now we don't seem to be able to do anything really useful with it.
19045
19046         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19047         not the EventBuilder.
19048
19049 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19050
19051         * cs-tokenizer.cs: Add support for defines.
19052         Add support for #if, #elif, #else, #endif
19053
19054         (eval_var): evaluates a variable.
19055         (eval): stubbed for evaluating functions.
19056
19057         * cs-parser.jay: Pass the defines information
19058
19059         * driver.cs: Add --define command line option.
19060
19061         * decl.cs: Move MemberCore here.
19062
19063         Make it the base class for DeclSpace.  This allows us to catch and
19064         report 108 and 109 for everything now.
19065
19066         * class.cs (TypeContainer.Define): Extract all the members
19067         before populating and emit the warning 108 (new keyword required
19068         to override) instead of having each member implement this.
19069
19070         (MemberCore.Define): New abstract method, we will be using this in
19071         the warning reporting engine in Populate.
19072
19073         (Operator.Define): Adjust to new MemberCore protocol. 
19074
19075         * const.cs (Const): This does not derive from Expression, it is a
19076         temporary object we use to create fields, it is a MemberCore. 
19077
19078         * class.cs (Method.Define): Allow the entry point to be in a
19079         specific class.
19080
19081         * driver.cs: Rewrite the argument handler to clean it up a bit.
19082
19083         * rootcontext.cs: Made it just an auxiliary namespace feature by
19084         making everything static.
19085
19086         * driver.cs: Adapt code to use RootContext type name instead of
19087         instance variable.
19088
19089         * delegate.cs: Remove RootContext argument.
19090
19091         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19092         argument. 
19093
19094         * class.cs (Event.Define): The lookup can fail.
19095
19096         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19097
19098         * expression.cs: Resolve the this instance before invoking the code.
19099
19100 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19101
19102         * cs-parser.jay: Add a production in element_access that allows
19103         the thing to become a "type" reference.  This way we can parse
19104         things like "(string [])" as a type.
19105
19106         Note that this still does not handle the more complex rules of
19107         casts. 
19108
19109
19110         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19111
19112         * ecore.cs: (CopyNewMethods): new utility function used to
19113         assemble the list of methods from running FindMembers.
19114
19115         (MemberLookup): Rework FindMembers so that 
19116
19117 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19118
19119         * class.cs (TypeContainer): Remove Delegates who fail to be
19120         defined.
19121
19122         * delegate.cs (Populate): Verify that we dont get null return
19123         values.   TODO: Check for AsAccessible.
19124
19125         * cs-parser.jay: Use basename to emit error 574 (destructor should
19126         have the same name as container class), not the full name.
19127
19128         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19129         possible representation.  
19130
19131         Also implements integer type suffixes U and L.
19132
19133 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19134
19135         * expression.cs (ArrayCreation.DoResolve): We need to do the
19136         argument resolution *always*.
19137
19138         * decl.cs: Make this hold the namespace.  Hold the root context as
19139         well.
19140         (LookupType): Move here.
19141
19142         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19143
19144         * location.cs (Row, Name): Fixed the code, it was always returning
19145         references to the first file.
19146
19147         * interface.cs: Register properties defined through interfaces.
19148
19149         * driver.cs: Add support for globbing on the command line
19150
19151         * class.cs (Field): Make it derive from MemberCore as well.
19152         (Event): ditto.
19153
19154 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19155
19156         * class.cs (Event::Define): Check that the type of the event is a delegate
19157         type else flag error #66.
19158
19159         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19160         same.
19161
19162         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19163         values of EntryPoint, CharSet etc etc.
19164
19165         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19166
19167         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19168         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19169         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19170         which needs this to do its work.
19171
19172         * ../errors/cs0066.cs : Add.
19173
19174 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19175
19176         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19177         helper functions.
19178
19179         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19180         clears out the parameters field.
19181         (MemberSignatureCompare): Cleanup
19182
19183         (MemberCore): New base class used to share code between MethodCore
19184         and Property.
19185
19186         (RegisterRequiredImplementations) BindingFlags.Public requires
19187         either BindingFlags.Instace or Static.  Use instance here.
19188
19189         (Property): Refactored code to cope better with the full spec.
19190
19191         * parameter.cs (GetParameterInfo): Return an empty array instead
19192         of null on error.
19193
19194         * class.cs (Property): Abstract or extern properties have no bodies.
19195
19196         * parameter.cs (GetParameterInfo): return a zero-sized array.
19197
19198         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19199         method modifier validation to the typecontainer so we can reuse
19200         this on properties.
19201
19202         (MethodCore.ParameterTypes): return an empty sized array of types.
19203
19204         (Property.Define): Test property modifier validity.
19205
19206         Add tests for sealed/override too.
19207
19208         (Method.Emit): abstract or extern methods have no bodies.
19209
19210 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19211
19212         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19213         thing.
19214
19215         (Method::Define, ::Emit): Modify accordingly.
19216
19217         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19218
19219         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19220
19221         * makefile: Pass in /unsafe.
19222
19223 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19224
19225         * class.cs (MakeKey): Kill routine.
19226
19227         * class.cs (TypeContainer.Define): Correctly define explicit
19228         method implementations (they require the full interface name plus
19229         the method name).
19230
19231         * typemanager.cs: Deply the PtrHashtable here and stop using the
19232         lame keys.  Things work so much better.
19233
19234         This of course broke everyone who depended on `RegisterMethod' to
19235         do the `test for existance' test.  This has to be done elsewhere.
19236
19237         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19238         the object stupid Equals method (because, that like fails all over
19239         the place).  We still do not use it.
19240
19241         * class.cs (TypeContainer.SetRequiredInterface,
19242         TypeContainer.RequireMethods): Killed these two routines and moved
19243         all the functionality to RegisterRequiredImplementations.
19244
19245         (TypeContainer.RegisterRequiredImplementations): This routine now
19246         registers all the implementations required in an array for the
19247         interfaces and abstract methods.  We use an array of structures
19248         which can be computed ahead of time to reduce memory usage and we
19249         also assume that lookups are cheap as most classes will not
19250         implement too many interfaces.
19251
19252         We also avoid creating too many MethodSignatures.
19253
19254         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19255         clear the "pending" bit if we find that there are problems with
19256         the declaration.
19257
19258         (TypeContainer.VerifyPendingMethods): Update to report errors of
19259         methods that look like implementations but are not.
19260
19261         (TypeContainer.Define): Add support for explicit interface method
19262         implementation. 
19263
19264 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19265
19266         * typemanager.cs: Keep track of the parameters here instead of
19267         being a feature of the TypeContainer.
19268
19269         * class.cs: Drop the registration of parameters here, as
19270         InterfaceMethods are also interface declarations.
19271
19272         * delegate.cs: Register methods with the TypeManager not only with
19273         the TypeContainer.  This code was buggy.
19274
19275         * interface.cs: Full registation here.
19276
19277 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
19278
19279         * expression.cs: Remove reducer for binary expressions, it can not
19280         be done this way.
19281
19282         * const.cs: Put here the code that used to go into constant.cs
19283
19284         * constant.cs: Put here the code for constants, this is a new base
19285         class for Literals.
19286
19287         * literal.cs: Make Literal derive from Constant.
19288
19289 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
19290
19291         * statement.cs (Return.Emit): Report error 157 if the user
19292         attempts to return from a finally block.
19293
19294         (Return.Emit): Instead of emitting a return, jump to the end of
19295         the function.
19296
19297         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
19298         LocalBuilder to store the result of the function.  ReturnLabel is
19299         the target where we jump.
19300
19301
19302 2001-12-09  Radek Doulik  <rodo@ximian.com>
19303
19304         * cs-parser.jay: remember alias in current namespace
19305
19306         * ecore.cs (SimpleName::DoResolve): use aliases for types or
19307         namespaces
19308
19309         * class.cs (LookupAlias): lookup alias in my_namespace
19310
19311         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
19312         aliases hashtable
19313         (LookupAlias): lookup alias in this and if needed in parent
19314         namespaces
19315
19316 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
19317
19318         * support.cs: 
19319
19320         * rootcontext.cs: (ModuleBuilder) Made static, first step into
19321         making things static.  I need this to avoid passing the
19322         TypeContainer when calling ParameterType.
19323
19324         * support.cs (InternalParameters.ParameterType): Remove ugly hack
19325         that did string manipulation to compute the type and then call
19326         GetType.  Use Parameter.ParameterType instead.
19327
19328         * cs-tokenizer.cs: Consume the suffix for floating values.
19329
19330         * expression.cs (ParameterReference): figure out whether this is a
19331         reference parameter or not.  Kill an extra variable by computing
19332         the arg_idx during emission.
19333
19334         * parameter.cs (Parameters.GetParameterInfo): New overloaded
19335         function that returns whether a parameter is an out/ref value or not.
19336
19337         (Parameter.ParameterType): The type of the parameter (base,
19338         without ref/out applied).
19339
19340         (Parameter.Resolve): Perform resolution here.
19341         (Parameter.ExternalType): The full type (with ref/out applied).
19342
19343         * statement.cs (Using.Emit, Using.EmitExpression): Implement
19344         support for expressions on the using statement.
19345
19346 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
19347
19348         * statement.cs (Using.EmitLocalVariableDecls): Split the
19349         localvariable handling of the using statement.
19350
19351         (Block.EmitMeta): Keep track of variable count across blocks.  We
19352         were reusing slots on separate branches of blocks.
19353
19354         (Try.Emit): Emit the general code block, we were not emitting it. 
19355
19356         Check the type of the declaration to be an IDisposable or
19357         something that can be implicity converted to it. 
19358
19359         Emit conversions if required.
19360
19361         * ecore.cs (EmptyExpression): New utility class.
19362         (Expression.ImplicitConversionExists): New utility function.
19363
19364 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
19365
19366         * statement.cs (Using): Implement.
19367
19368         * expression.cs (LocalVariableReference): Support read only variables.
19369
19370         * statement.cs: Remove the explicit emit for the Leave opcode.
19371         (VariableInfo): Add a readonly field.
19372
19373 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
19374
19375         * ecore.cs (ConvCast): new class used to encapsulate the various
19376         explicit integer conversions that works in both checked and
19377         unchecked contexts.
19378
19379         (Expression.ConvertNumericExplicit): Use new ConvCast class to
19380         properly generate the overflow opcodes.
19381
19382 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19383
19384         * statement.cs: The correct type for the EmptyExpression is the
19385         element_type, not the variable type.  Ravi pointed this out.
19386
19387 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19388
19389         * class.cs (Method::Define): Handle PInvoke methods specially
19390         by using DefinePInvokeMethod instead of the usual one.
19391
19392         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
19393         above to do the task of extracting information and defining the method.
19394
19395 2001-12-04  Ravi Pratap  <ravi@ximian.com>
19396
19397         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
19398         of the condition for string type.
19399
19400         (Emit): Move that here. 
19401
19402         (ArrayCreation::CheckIndices): Keep string literals in their expression
19403         form.
19404
19405         (EmitDynamicInitializers): Handle strings appropriately.
19406
19407 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
19408
19409         * codegen.cs (EmitContext): Replace multiple variables with a
19410         single pointer to the current Switch statement.
19411
19412         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
19413         EmitContext.
19414
19415 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19416
19417         * statement.cs 
19418
19419         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
19420         default'.
19421
19422         (Foreach.Emit): Foreach on arrays was not setting
19423         up the loop variables (for break/continue).
19424
19425         (GotoCase): Semi-implented.
19426
19427 2001-12-03  Ravi Pratap  <ravi@ximian.com>
19428
19429         * attribute.cs (CheckAttribute): Handle system attributes by using
19430         Attribute.GetAttributes to examine information we need.
19431
19432         (GetValidPlaces): Same here.
19433
19434         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
19435
19436         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
19437
19438         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
19439
19440         (Method::Define): Set appropriate flags if we have a DllImport attribute.
19441
19442         (Method::Emit): Handle the case when we are a PInvoke method.
19443
19444 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
19445
19446         * expression.cs: Use ResolveWithSimpleName on compound names.
19447
19448 2001-12-02  Ravi Pratap  <ravi@ximian.com>
19449
19450         * constant.cs (EmitConstant): Make sure we resolve the associated expression
19451         before trying to reduce it.
19452
19453         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
19454
19455         * constant.cs (LookupConstantValue): Implement.
19456
19457         (EmitConstant): Use the above in emitting the constant.
19458
19459         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
19460         that are user-defined by doing a LookupConstantValue on them.
19461
19462         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
19463         too, like above.
19464
19465 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
19466
19467         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
19468
19469         (BaseAccess.DoResolve): Implement.
19470
19471         (MemberAccess.DoResolve): Split this routine into a
19472         ResolveMemberAccess routine that can be used independently
19473
19474 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
19475
19476         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
19477         As that share bits of the implementation.  Is returns a boolean,
19478         while As returns the Type that is being probed.
19479
19480 2001-12-01  Ravi Pratap  <ravi@ximian.com>
19481
19482         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
19483         instead of a Literal - much easier.
19484
19485         (EnumInTransit): Remove - utterly useless :-)
19486
19487         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
19488
19489         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
19490
19491         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
19492         chain when we have no associated expression.
19493
19494 2001-11-30  Ravi Pratap  <ravi@ximian.com>
19495
19496         * constant.cs (Define): Use Location while reporting the errror.
19497
19498         Also emit a warning when 'new' is used and there is no inherited
19499         member to hide.
19500
19501         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
19502         populated.
19503
19504         (LookupEnumValue): Implement to lookup an enum member's value and define it
19505         if necessary.
19506
19507         (Populate): Re-write accordingly to use the above routine.
19508
19509 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
19510
19511         * expression.cs (This): Fix prototype for DoResolveLValue to
19512         override the base class DoResolveLValue.
19513
19514         * cs-parser.cs: Report errors cs574 and cs575 (destructor
19515         declarations) 
19516
19517         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
19518         (we need to load the address of the field here).  This fixes
19519         test-22. 
19520
19521         (FieldExpr.DoResolveLValue): Call the DoResolve
19522         function to initialize the Instance expression.
19523
19524         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
19525         correctly the GetEnumerator operation on a value type.
19526
19527         * cs-parser.jay: Add more simple parsing error catches.
19528
19529         * statement.cs (Switch): Add support for string switches.
19530         Handle null specially.
19531
19532         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
19533
19534 2001-11-28  Ravi Pratap  <ravi@ximian.com>
19535
19536         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
19537
19538         (declare_local_constant): New helper function.
19539
19540         * statement.cs (AddConstant): Keep a separate record of constants
19541
19542         (IsConstant): Implement to determine if a variable is a constant.
19543
19544         (GetConstantExpression): Implement.
19545
19546         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
19547
19548         * statement.cs (IsVariableDefined): Re-write.
19549
19550 2001-11-27  Ravi Pratap  <ravi@ximian.com>
19551
19552         * class.cs (TypeContainer::FindMembers): Look for constants
19553         in the case when we are looking for MemberTypes.Field
19554
19555         * expression.cs (MemberAccess::DoResolve): Check that in the
19556         case we are a FieldExpr and a Literal, we are not being accessed
19557         by an instance reference.
19558
19559         * cs-parser.jay (local_constant_declaration): Implement.
19560
19561         (declaration_statement): Implement for constant declarations.
19562
19563 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
19564
19565         * statement.cs (Switch): Catch double defaults.
19566
19567         (Switch): More work on the switch() statement
19568         implementation.  It works for integral values now, need to finish
19569         string support.
19570
19571
19572 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19573
19574         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
19575         integer literals into other integer literals.  To be used by
19576         switch. 
19577
19578 2001-11-24  Ravi Pratap  <ravi@ximian.com>
19579
19580         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
19581         some memory.
19582
19583         (EmitDynamicInitializers): Cope with the above since we extract data
19584         directly from ArrayData now.
19585
19586         (ExpectInitializers): Keep track of whether initializers are mandatory
19587         or not.
19588
19589         (Bounds): Make it a hashtable to prevent the same dimension being 
19590         recorded for every element in that dimension.
19591
19592         (EmitDynamicInitializers): Fix bug which prevented the Set array method
19593         from being found.
19594
19595         Also fix bug which was causing the indices to be emitted in the reverse
19596         order.
19597
19598 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
19599
19600         * expression.cs (ArrayCreation): Implement the bits that Ravi left
19601         unfinished.  They do not work, because the underlying code is
19602         sloppy.
19603
19604 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19605
19606         * cs-parser.jay: Remove bogus fixme.
19607
19608         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
19609         on Switch statement.
19610
19611 2001-11-23  Ravi Pratap  <ravi@ximian.com>
19612
19613         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
19614         the same. 
19615
19616         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
19617         parameter. Apparently, any expression is allowed. 
19618
19619         (ValidateInitializers): Update accordingly.
19620
19621         (CheckIndices): Fix some tricky bugs thanks to recursion.
19622
19623         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
19624         I was being completely brain-dead.
19625
19626         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
19627         and re-write acordingly.
19628
19629         (DelegateInvocation): Re-write accordingly.
19630
19631         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
19632
19633         (MakeByteBlob): Handle types more correctly.
19634
19635         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
19636         initialization from expressions but it is incomplete because I am a complete
19637         Dodo :-|
19638
19639 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19640
19641         * statement.cs (If.Emit): Fix a bug that generated incorrect code
19642         on If.  Basically, we have to return `true' (ie, we do return to
19643         our caller) only if both branches of the if return.
19644
19645         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
19646         short-circuit operators, handle them as short circuit operators. 
19647
19648         (Cast.DoResolve): Resolve type.
19649         (Cast.Cast): Take an expression as the target type.
19650
19651         * cs-parser.jay (cast_expression): Remove old hack that only
19652         allowed a limited set of types to be handled.  Now we take a
19653         unary_expression and we resolve to a type during semantic
19654         analysis.
19655
19656         Use the grammar productions from Rhys to handle casts (this is
19657         not complete like Rhys syntax yet, we fail to handle that corner
19658         case that C# has regarding (-x), but we will get there.
19659
19660 2001-11-22  Ravi Pratap  <ravi@ximian.com>
19661
19662         * class.cs (EmitFieldInitializer): Take care of the case when we have a
19663         field which is an array type.
19664
19665         * cs-parser.jay (declare_local_variables): Support array initialization too.
19666
19667         * typemanager.cs (MakeKey): Implement.
19668
19669         (everywhere): Use the above appropriately.
19670
19671         * cs-parser.jay (for_statement): Update for array initialization while
19672         declaring variables.
19673
19674         * ecore.cs : The error message was correct, it's the variable's names that
19675         were misleading ;-) Make the code more readable.
19676
19677         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
19678         the correct type etc.
19679
19680         (ConvertExplicit): Handle Enum types by examining the underlying type.
19681
19682 2001-11-21  Ravi Pratap  <ravi@ximian.com>
19683
19684         * parameter.cs (GetCallingConvention): Always return
19685         CallingConventions.Standard for now.
19686
19687 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * expression.cs (Binary.ResolveOperator): Update the values of `l'
19690         and `r' after calling DoNumericPromotions.
19691
19692         * ecore.cs: Fix error message (the types were in the wrong order).
19693
19694         * statement.cs (Foreach.ProbeCollectionType): Need to pass
19695         BindingFlags.Instance as well 
19696
19697         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
19698         implicit int literal conversion in an empty cast so that we
19699         propagate the right type upstream.
19700
19701         (UnboxCast): new class used to unbox value types.
19702         (Expression.ConvertExplicit): Add explicit type conversions done
19703         by unboxing.
19704
19705         (Expression.ImplicitNumericConversion): Oops, forgot to test for
19706         the target type before applying the implicit LongLiterals to ULong
19707         literal cast.
19708
19709 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
19710
19711         * cs-parser.jay (for_statement): Reworked the way For works: now
19712         we declare manually any variables that are introduced in
19713         for_initializer to solve the problem of having out-of-band code
19714         emition (that is what got for broken).
19715
19716         (declaration_statement): Perform the actual variable declaration
19717         that used to be done in local_variable_declaration here.
19718
19719         (local_variable_declaration): Do not declare anything, just pass
19720         the information on a DictionaryEntry
19721
19722 2001-11-20  Ravi Pratap  <ravi@ximian.com>
19723
19724         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
19725         re-write of the logic to now make it recursive.
19726
19727         (UpdateIndices): Re-write accordingly.
19728
19729         Store element data in a separate ArrayData list in the above methods.
19730
19731         (MakeByteBlob): Implement to dump the array data into a byte array.
19732
19733 2001-11-19  Ravi Pratap  <ravi@ximian.com>
19734
19735         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
19736         into CheckIndices.
19737
19738         * constant.cs (Define): Implement.
19739
19740         (EmitConstant): Re-write fully.
19741
19742         Pass in location info.
19743
19744         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
19745         respectively.
19746
19747         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
19748         DictionaryEntry since we need location info too.
19749
19750         (constant_declaration): Update accordingly.
19751
19752         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
19753         code into another method : UpdateIndices.
19754
19755 2001-11-18  Ravi Pratap  <ravi@ximian.com>
19756
19757         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
19758         some type checking etc.
19759
19760 2001-11-17  Ravi Pratap  <ravi@ximian.com>
19761
19762         * expression.cs (ArrayCreation::ValidateInitializers): Implement
19763         bits to provide dimension info if the user skips doing that.
19764
19765         Update second constructor to store the rank correctly.
19766
19767 2001-11-16  Ravi Pratap  <ravi@ximian.com>
19768
19769         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
19770         and try to implement.
19771
19772         * ../errors/cs0150.cs : Add.
19773
19774         * ../errors/cs0178.cs : Add.
19775
19776 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
19777
19778         * statement.cs: Implement foreach on multi-dimensional arrays. 
19779
19780         * parameter.cs (Parameters.GetParameterByName): Also lookup the
19781         name of the params argument.
19782
19783         * expression.cs: Use EmitStoreOpcode to get the right opcode while
19784         initializing the array.
19785
19786         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
19787         we can use this elsewhere.
19788
19789         * statement.cs: Finish implementation of foreach for single
19790         dimension arrays.
19791
19792         * cs-parser.jay: Use an out-of-band stack to pass information
19793         around, I wonder why I need this.
19794
19795         foreach_block: Make the new foreach_block the current_block.
19796
19797         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
19798         function used to return a static Parameters structure.  Used for
19799         empty parameters, as those are created very frequently.
19800
19801         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
19802
19803 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19804
19805         * interface.cs : Default modifier is private, not public. The
19806         make verify test passes again.
19807
19808 2001-11-15  Ravi Pratap  <ravi@ximian.com>
19809
19810         * support.cs (ReflectionParameters): Fix logic to determine
19811         whether the last parameter is a params one. Test 9 passes again.
19812
19813         * delegate.cs (Populate): Register the builders we define with
19814         RegisterParameterForBuilder. Test 19 passes again.
19815
19816         * cs-parser.jay (property_declaration): Reference $6 instead
19817         of $$ to get at the location.
19818
19819         (indexer_declaration): Similar stuff.
19820
19821         (attribute): Ditto.
19822
19823         * class.cs (Property): Register parameters for the Get and Set methods
19824         if they exist. Test 23 passes again.
19825
19826         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
19827         call to EmitArguments as we are sure there aren't any params arguments. 
19828         Test 32 passes again.
19829
19830         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
19831         IndexOutOfRangeException. 
19832
19833         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
19834         Test 33 now passes again.
19835
19836 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
19837
19838         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
19839         broke a bunch of things.  Will have to come up with a better way
19840         of tracking locations.
19841
19842         * statement.cs: Implemented foreach for single dimension arrays.
19843
19844 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
19845
19846         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
19847         an error.  This removes the lookup from the critical path.
19848
19849         * cs-parser.jay: Removed use of temporary_loc, which is completely
19850         broken. 
19851
19852 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
19853
19854         * support.cs (ReflectionParameters.ParameterModifier): Report
19855         whether the argument is a PARAMS argument or not.
19856
19857         * class.cs: Set the attribute `ParamArrayAttribute' on the
19858         parameter argument.
19859
19860         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
19861         and cons_param_array_attribute (ConstructorInfo for
19862         ParamArrayAttribute)., 
19863
19864         * codegen.cs: Emit the return using the `Return' statement, that
19865         way we can report the error correctly for missing return values. 
19866
19867         * class.cs (Method.Emit): Clean up.
19868
19869         * expression.cs (Argument.Resolve): Take another argument: the
19870         location where this argument is used.  Notice that this is not
19871         part of the "Argument" class as to reduce the size of the
19872         structure (we know the approximate location anyways).
19873
19874         Test if the argument is a variable-reference, if not, then
19875         complain with a 206.
19876
19877         (Argument.Emit): Emit addresses of variables.
19878
19879         (Argument.FullDesc): Simplify.
19880
19881         (Invocation.DoResolve): Update for Argument.Resolve.
19882
19883         (ElementAccess.DoResolve): ditto.
19884
19885         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
19886         method should be virtual, as this method is always virtual.
19887
19888         (NewDelegate.DoResolve): Update for Argument.Resolve.
19889
19890         * class.cs (ConstructorInitializer.DoResolve): ditto.
19891
19892         * attribute.cs (Attribute.Resolve): ditto.
19893
19894 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
19895
19896         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
19897
19898         * expression.cs (ParameterReference): Drop IStackStorage and implement
19899         IAssignMethod instead. 
19900
19901         (LocalVariableReference): ditto.
19902
19903         * ecore.cs (FieldExpr): Drop IStackStorage and implement
19904         IAssignMethod instead. 
19905
19906 2001-11-13  Miguel de Icaza <miguel@ximian.com>
19907
19908         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
19909         enumerations that are used in heavily used structures derive from
19910         byte in a laughable and pathetic attempt to reduce memory usage.
19911         This is the kind of pre-optimzations that you should not do at
19912         home without adult supervision.
19913
19914         * expression.cs (UnaryMutator): New class, used to handle ++ and
19915         -- separatedly from the other unary operators.  Cleans up the
19916         code, and kills the ExpressionStatement dependency in Unary.
19917
19918         (Unary): Removed `method' and `Arguments' from this class, making
19919         it smaller, and moving it all to SimpleCall, so I can reuse this
19920         code in other locations and avoid creating a lot of transient data
19921         strucutres when not required.
19922
19923         * cs-parser.jay: Adjust for new changes.
19924
19925 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
19926
19927         * enum.cs (Enum.Populate): If there is a failure during
19928         definition, return
19929
19930         * cs-parser.jay (opt_enum_base): we used to catch type errors
19931         here, but this is really incorrect.  The type error should be
19932         catched during semantic analysis.
19933
19934 2001-12-11  Ravi Pratap  <ravi@ximian.com>
19935
19936         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
19937         current_local_parameters as expected since I, in my stupidity, had forgotten
19938         to do this :-)
19939
19940         * attribute.cs (GetValidPlaces): Fix stupid bug.
19941
19942         * class.cs (Method::Emit): Perform check on applicability of attributes.
19943
19944         (Constructor::Emit): Ditto.
19945
19946         (Field::Emit): Ditto.
19947
19948         (Field.Location): Store location information.
19949
19950         (Property, Event, Indexer, Operator): Ditto.
19951
19952         * cs-parser.jay (field_declaration): Pass in location for each field.
19953
19954         * ../errors/cs0592.cs : Add.
19955
19956 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19957
19958         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
19959
19960         (InitCoreTypes): Update accordingly.
19961
19962         (RegisterAttrType, LookupAttr): Implement.
19963
19964         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
19965         info about the same.
19966
19967         (Resolve): Update to populate the above as necessary.
19968
19969         (Error592): Helper.
19970
19971         (GetValidPlaces): Helper to the above.
19972
19973         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
19974
19975         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
19976
19977 2001-11-12  Ravi Pratap  <ravi@ximian.com>
19978
19979         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
19980
19981         * ../errors/cs0617.cs : Add.
19982
19983 2001-11-11  Ravi Pratap  <ravi@ximian.com>
19984
19985         * enum.cs (Emit): Rename to Populate to be more consistent with what
19986         we expect it to do and when exactly it is called.
19987
19988         * class.cs, rootcontext.cs : Update accordingly.
19989
19990         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
19991         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
19992
19993         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
19994
19995         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
19996         of a fieldinfo using the above, when dealing with a FieldBuilder.
19997
19998 2001-11-10  Ravi Pratap  <ravi@ximian.com>
19999
20000         * ../errors/cs0031.cs : Add.
20001
20002         * ../errors/cs1008.cs : Add.
20003
20004         * ../errrors/cs0543.cs : Add.
20005
20006         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20007         enum type.
20008
20009         (FindMembers): Implement.
20010
20011         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20012         enums and delegates too.
20013
20014         (enum_types): Rename to builder_to_enum.
20015
20016         (delegate_types): Rename to builder_to_delegate.
20017
20018         * delegate.cs (FindMembers): Implement.
20019
20020 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20021
20022         * typemanager.cs (IsEnumType): Implement.
20023
20024         * enum.cs (Emit): Re-write parts to account for the underlying type
20025         better and perform checking etc.
20026
20027         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20028         of the underlying type.
20029
20030         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20031         value
20032
20033         * enum.cs (error31): Helper to report error #31.
20034
20035         * cs-parser.jay (enum_declaration): Store location of each member too.
20036
20037         * enum.cs (member_to_location): New hashtable. 
20038
20039         (AddEnumMember): Update location hashtable.
20040
20041         (Emit): Use the location of each member while reporting errors.
20042
20043 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20044
20045         * cs-parser.jay: A for_initializer if is a
20046         local_variable_declaration really ammount to have an implicit
20047         block with the variable declaration and no initializer for for.
20048
20049         * statement.cs (For.Emit): Cope with null initializers.
20050
20051         This fixes the infinite loop on for initializers.
20052
20053 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20054
20055         * enum.cs: More cleanup.
20056
20057         * ecore.cs: Remove dead code.
20058
20059         * class.cs (Property.Emit): More simplification.
20060         (Event.Emit): ditto.
20061
20062         Reworked to have less levels of indentation.
20063
20064 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20065
20066         * class.cs (Property): Emit attributes.
20067
20068         (Field): Ditto.
20069
20070         (Event): Ditto.
20071
20072         (Indexer): Ditto.
20073
20074         (Operator): Ditto.
20075
20076         * enum.cs (Emit): Ditto.
20077
20078         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20079         Enums too.
20080
20081         * class.cs (Field, Event, etc.): Move attribute generation into the
20082         Emit method everywhere.
20083
20084         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20085         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20086         as we had no way of defining nested enums !
20087
20088         * rootcontext.cs : Adjust code accordingly.
20089
20090         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20091
20092 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20093
20094         * expression.cs (EvalConstantExpression): Move into ecore.cs
20095
20096         * enum.cs (Enum): Rename some members and make them public and readonly
20097         according to our convention.
20098
20099         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20100         nothing else.
20101
20102         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20103
20104         (Enum::Emit): Write a simple version for now which doesn't try to compute
20105         expressions. I shall modify this to be more robust in just a while.
20106
20107         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20108
20109         (TypeContainer::CloseType): Create the Enum types too.
20110
20111         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20112
20113         * expression.cs (EvalConstantExpression): Get rid of completely.
20114
20115         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20116         user-defined values and other cases.
20117
20118         (IsValidEnumLiteral): Helper function.
20119
20120         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20121         out there in the case we had a literal FieldExpr.
20122
20123         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20124
20125         (Literalize): Revamp a bit to take two arguments.
20126
20127         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20128
20129 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20130
20131         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20132
20133         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20134
20135         (Resolve): Use the above to ensure we have proper initializers.
20136
20137 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20138
20139         * expression.cs (Expression::EvalConstantExpression): New method to 
20140         evaluate constant expressions.
20141
20142         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20143
20144 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20145
20146         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20147         in an array.
20148
20149         (Binary.ResolveOperator): Handle operator != (object a, object b)
20150         and operator == (object a, object b);
20151
20152         (Binary.DoNumericPromotions): Indicate whether the numeric
20153         promotion was possible.
20154
20155         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20156         Implement.  
20157
20158         Made the ArrayAccess implement interface IAssignMethod instead of
20159         IStackStore as the order in which arguments are passed reflects
20160         this.
20161
20162         * assign.cs: Instead of using expr.ExprClass to select the way of
20163         assinging, probe for the IStackStore/IAssignMethod interfaces.
20164
20165         * typemanager.cs: Load InitializeArray definition.
20166
20167         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20168         static data that can be used to initialize arrays. 
20169
20170 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20171
20172         * expression.cs: Handle operator== and operator!= for booleans.
20173
20174         (Conditioal.Reduce): Implement reducer for the ?: operator.
20175
20176         (Conditional.Resolve): Implement dead code elimination.
20177
20178         (Binary.Resolve): Catch string literals and return a new
20179         concatenated string.
20180
20181         (Unary.Reduce): Implement reduction of unary expressions.
20182
20183         * ecore.cs: Split out the expression core handling here.
20184
20185         (Expression.Reduce): New method used to perform constant folding
20186         and CSE.  This is needed to support constant-expressions. 
20187
20188         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20189         targets, and optimize for !x.
20190
20191 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20192
20193         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20194         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20195         set custom atttributes.
20196
20197         * literal.cs (Literal::GetValue): New abstract method to return the actual
20198         value of the literal, cast as an object.
20199
20200         (*Literal): Implement GetValue method.
20201
20202         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20203         expressions to the arraylist but objects of type Argument.
20204
20205         * class.cs (TypeContainer::Emit): Emit our attributes too.
20206
20207         (Method::Emit, Constructor::Emit): Ditto.
20208
20209         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20210         to be ignoring earlier.
20211
20212 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20213
20214         * attribute.cs (AttributeSection::Define): Implement to do the business
20215         of constructing a CustomAttributeBuilder.
20216
20217         (Attribute): New trivial class. Increases readability of code.  
20218
20219         * cs-parser.jay : Update accordingly.
20220
20221         (positional_argument_list, named_argument_list, named_argument): New rules
20222
20223         (attribute_arguments): Use the above so that we are more correct.
20224
20225 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20226
20227         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20228         to perform all checks for a method with a params parameter.
20229
20230         (Invocation::OverloadResolve): Update to use the above method and therefore
20231         cope correctly with params method invocations.
20232
20233         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20234         params too.
20235
20236         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20237         constructors in our parent too because we can't afford to miss out on 
20238         protected ones ;-)
20239
20240         * attribute.cs (AttributeSection): New name for the class Attribute
20241
20242         Other trivial changes to improve readability.
20243
20244         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20245         use the new class names.
20246
20247 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20248
20249         * class.cs (Method::Define): Complete definition for params types too
20250
20251         (Indexer::Define): Ditto.
20252
20253         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20254         Cope everywhere with a request for info about the array parameter.
20255
20256 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20257
20258         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20259
20260         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20261         local_variable_type to extract the string corresponding to the type.
20262
20263         (local_variable_type): Fixup the action to use the new helper method.
20264
20265         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
20266         go.
20267
20268         * expression.cs : Clean out code which uses the above.
20269
20270 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20271
20272         * typemanager.cs (RegisterMethod): Check if we already have an existing key
20273         and bale out if necessary by returning a false.
20274
20275         (RegisterProperty): Ditto.
20276
20277         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
20278         and print out appropriate error messages.
20279
20280         * interface.cs (everywhere): Ditto.
20281
20282         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
20283         location to constructor.
20284
20285         * class.cs (Property, Event, Indexer): Update accordingly.
20286
20287         * ../errors/cs111.cs : Added.
20288
20289         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
20290         of a method, as laid down by the spec.
20291
20292         (Invocation::OverloadResolve): Use the above method.
20293
20294 2001-10-31  Ravi Pratap  <ravi@ximian.com>
20295
20296         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
20297         now take a TypeContainer and a Parameters object.
20298
20299         (ParameterData): Modify return type of ParameterModifier method to be 
20300         Parameter.Modifier and not a string.
20301
20302         (ReflectionParameters, InternalParameters): Update accordingly.
20303
20304         * expression.cs (Argument::GetParameterModifier): Same here.
20305
20306         * support.cs (InternalParameters::ParameterType): Find a better way of determining
20307         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
20308         symbol in it at all so maybe this is only for now.
20309
20310 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20311
20312         * support.cs (InternalParameters): Constructor now takes an extra argument 
20313         which is the actual Parameters class.
20314
20315         (ParameterDesc): Update to provide info on ref/out modifiers.
20316
20317         * class.cs (everywhere): Update call to InternalParameters to pass in
20318         the second argument too.
20319
20320         * support.cs (ParameterData): Add ParameterModifier, which is a method 
20321         to return the modifier info [ref/out etc]
20322
20323         (InternalParameters, ReflectionParameters): Implement the above.
20324
20325         * expression.cs (Argument::ParameterModifier): Similar function to return
20326         info about the argument's modifiers.
20327
20328         (Invocation::OverloadResolve): Update to take into account matching modifiers 
20329         too.
20330
20331         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
20332         a new SetFormalParameters object which we pass to InternalParameters.
20333
20334 2001-10-30  Ravi Pratap  <ravi@ximian.com>
20335
20336         * expression.cs (NewArray): Merge into the ArrayCreation class.
20337
20338 2001-10-29  Ravi Pratap  <ravi@ximian.com>
20339
20340         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
20341         NewUserdefinedArray into one as there wasn't much of a use in having
20342         two separate ones.
20343
20344         * expression.cs (Argument): Change field's name to ArgType from Type.
20345
20346         (Type): New readonly property which returns the proper type, taking into 
20347         account ref/out modifiers.
20348
20349         (everywhere): Adjust code accordingly for the above.
20350
20351         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
20352         whether we are emitting for a ref or out parameter.
20353
20354         * expression.cs (Argument::Emit): Use the above field to set the state.
20355
20356         (LocalVariableReference::Emit): Update to honour the flag and emit the
20357         right stuff.
20358
20359         * parameter.cs (Attributes): Set the correct flags for ref parameters.
20360
20361         * expression.cs (Argument::FullDesc): New function to provide a full desc.
20362
20363         * support.cs (ParameterData): Add method ParameterDesc to the interface.
20364
20365         (ReflectionParameters, InternalParameters): Implement the above method.
20366
20367         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
20368         reporting errors.
20369
20370         (Invocation::FullMethodDesc): Ditto. 
20371
20372 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
20373
20374         * cs-parser.jay: Add extra production for the second form of array
20375         creation. 
20376
20377         * expression.cs (ArrayCreation): Update to reflect the above
20378         change. 
20379
20380         * Small changes to prepare for Array initialization.
20381
20382 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
20383
20384         * typemanager.cs (ImplementsInterface): interface might be null;
20385         Deal with this problem;
20386
20387         Also, we do store negative hits on the cache (null values), so use
20388         this instead of calling t.GetInterfaces on the type everytime.
20389
20390 2001-10-28  Ravi Pratap  <ravi@ximian.com>
20391
20392         * typemanager.cs (IsBuiltinType): New method to help determine the same.
20393
20394         * expression.cs (New::DoResolve): Get rid of array creation code and instead
20395         split functionality out into different classes.
20396
20397         (New::FormArrayType): Move into NewBuiltinArray.
20398
20399         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
20400         quite useless.
20401
20402         (NewBuiltinArray): New class to handle creation of built-in arrays.
20403
20404         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
20405         account creation of one-dimensional arrays.
20406
20407         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
20408
20409         (NewUserdefinedArray::DoResolve): Implement.
20410
20411         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
20412
20413         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
20414         we maintain inside the TypeManager. This is necessary to perform lookups on the
20415         module builder.
20416
20417         (LookupType): Update to perform GetType on the module builders too.     
20418
20419         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
20420
20421         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
20422
20423 2001-10-23  Ravi Pratap  <ravi@ximian.com>
20424
20425         * expression.cs (New::DoResolve): Implement guts of array creation.
20426
20427         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
20428
20429 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
20430
20431         * expression.cs: Fix bug I introduced lsat night that broke
20432         Delegates. 
20433
20434         (Expression.Resolve): Report a 246 error (can not resolve name)
20435         if we find a SimpleName in the stream.
20436
20437         (Expression.ResolveLValue): Ditto.
20438
20439         (Expression.ResolveWithSimpleName): This function is a variant of
20440         ResolveName, this one allows SimpleNames to be returned without a
20441         warning.  The only consumer of SimpleNames is MemberAccess
20442
20443 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
20444
20445         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
20446         might arrive here.  I have my doubts that this is correct.
20447
20448         * statement.cs (Lock): Implement lock statement.
20449
20450         * cs-parser.jay: Small fixes to support `lock' and `using'
20451
20452         * cs-tokenizer.cs: Remove extra space
20453
20454         * driver.cs: New flag --checked, allows to turn on integer math
20455         checking. 
20456
20457         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
20458         Threading.Monitor.Exit 
20459
20460 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
20461
20462         * expression.cs (IndexerAccess::DoResolveLValue): Set the
20463         Expression Class to be IndexerAccess.
20464
20465         Notice that Indexer::DoResolve sets the eclass to Value.
20466
20467 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
20468
20469         * class.cs (TypeContainer::Emit): Emit code for indexers.
20470
20471         * assign.cs (IAssignMethod): New interface implemented by Indexers
20472         and Properties for handling assignment.
20473
20474         (Assign::Emit): Simplify and reuse code. 
20475
20476         * expression.cs (IndexerAccess, PropertyExpr): Implement
20477         IAssignMethod, clean up old code. 
20478
20479 2001-10-22  Ravi Pratap  <ravi@ximian.com>
20480
20481         * typemanager.cs (ImplementsInterface): New method to determine if a type
20482         implements a given interface. Provides a nice cache too.
20483
20484         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
20485         method.
20486
20487         (ConvertReferenceExplicit): Ditto.
20488
20489         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
20490         various methods, with correct names etc.
20491
20492         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
20493         Operator.UnaryNegation.
20494
20495         * cs-parser.jay (operator_declarator): Be a little clever in the case where
20496         we have a unary plus or minus operator.
20497
20498         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
20499         UnaryMinus.
20500
20501         * everywhere : update accordingly.
20502
20503         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
20504         respectively.
20505
20506         * class.cs (Method::Define): For the case where we are implementing a method
20507         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
20508         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
20509
20510 2001-10-21  Ravi Pratap  <ravi@ximian.com>
20511
20512         * interface.cs (FindMembers): Implement to work around S.R.E
20513         lameness.
20514
20515         * typemanager.cs (IsInterfaceType): Implement.
20516
20517         (FindMembers): Update to handle interface types too.
20518
20519         * expression.cs (ImplicitReferenceConversion): Re-write bits which
20520         use IsAssignableFrom as that is not correct - it doesn't work.
20521
20522         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
20523         and accordingly override EmitStatement.
20524
20525         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
20526         using the correct logic :-)
20527
20528 2001-10-19  Ravi Pratap  <ravi@ximian.com>
20529
20530         * ../errors/cs-11.cs : Add to demonstrate error -11 
20531
20532 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
20533
20534         * assign.cs (Assign::Resolve): Resolve right hand side first, and
20535         then pass this as a hint to ResolveLValue.
20536
20537         * expression.cs (FieldExpr): Add Location information
20538
20539         (FieldExpr::LValueResolve): Report assignment to readonly
20540         variable. 
20541
20542         (Expression::ExprClassFromMemberInfo): Pass location information.
20543
20544         (Expression::ResolveLValue): Add new method that resolves an
20545         LValue. 
20546
20547         (Expression::DoResolveLValue): Default invocation calls
20548         DoResolve. 
20549
20550         (Indexers): New class used to keep track of indexers in a given
20551         Type. 
20552
20553         (IStackStore): Renamed from LValue, as it did not really describe
20554         what this did.  Also ResolveLValue is gone from this interface and
20555         now is part of Expression.
20556
20557         (ElementAccess): Depending on the element access type
20558
20559         * typemanager.cs: Add `indexer_name_type' as a Core type
20560         (System.Runtime.CompilerServices.IndexerNameAttribute)
20561
20562         * statement.cs (Goto): Take a location.
20563
20564 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20565
20566         * delegate.cs (Delegate::VerifyDelegate): New method to verify
20567         if two delegates are compatible.
20568
20569         (NewDelegate::DoResolve): Update to take care of the case when
20570         we instantiate a delegate from another delegate.
20571
20572         * typemanager.cs (FindMembers): Don't even try to look up members
20573         of Delegate types for now.
20574
20575 2001-10-18  Ravi Pratap  <ravi@ximian.com>
20576
20577         * delegate.cs (NewDelegate): New class to take care of delegate
20578         instantiation.
20579
20580         * expression.cs (New): Split the delegate related code out into 
20581         the NewDelegate class.
20582
20583         * delegate.cs (DelegateInvocation): New class to handle delegate 
20584         invocation.
20585
20586         * expression.cs (Invocation): Split out delegate related code into
20587         the DelegateInvocation class.
20588
20589 2001-10-17  Ravi Pratap  <ravi@ximian.com>
20590
20591         * expression.cs (New::DoResolve): Implement delegate creation fully
20592         and according to the spec.
20593
20594         (New::DoEmit): Update to handle delegates differently.
20595
20596         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
20597         because of which we were printing out arguments in reverse order !
20598
20599         * delegate.cs (VerifyMethod): Implement to check if the given method
20600         matches the delegate.
20601
20602         (FullDelegateDesc): Implement.
20603
20604         (VerifyApplicability): Implement.
20605
20606         * expression.cs (Invocation::DoResolve): Update to accordingly handle
20607         delegate invocations too.
20608
20609         (Invocation::Emit): Ditto.
20610
20611         * ../errors/cs1593.cs : Added.
20612
20613         * ../errors/cs1594.cs : Added.
20614
20615         * delegate.cs (InstanceExpression, TargetMethod): New properties.
20616
20617 2001-10-16  Ravi Pratap  <ravi@ximian.com>
20618
20619         * typemanager.cs (intptr_type): Core type for System.IntPtr
20620
20621         (InitCoreTypes): Update for the same.
20622
20623         (iasyncresult_type, asynccallback_type): Ditto.
20624
20625         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
20626         correct.
20627
20628         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
20629         too.
20630
20631         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
20632         the builders for the 4 members of a delegate type :-)
20633
20634         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
20635         type.
20636
20637         * expression.cs (New::DoResolve): Implement guts for delegate creation.
20638
20639         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
20640
20641 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
20642
20643         * statement.cs (Break::Emit): Implement.   
20644         (Continue::Emit): Implement.
20645
20646         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20647         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20648         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
20649         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
20650         end loop
20651
20652         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
20653         properties that track the label for the current loop (begin of the
20654         loop and end of the loop).
20655
20656 2001-10-15  Ravi Pratap  <ravi@ximian.com>
20657
20658         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
20659         use of emitting anything at all.
20660
20661         * class.cs, rootcontext.cs : Get rid of calls to the same.
20662
20663         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
20664
20665         (Populate): Define the constructor correctly and set the implementation
20666         attributes.
20667
20668         * typemanager.cs (delegate_types): New hashtable to hold delegates that
20669         have been defined.
20670
20671         (AddDelegateType): Implement.
20672
20673         (IsDelegateType): Implement helper method.
20674
20675         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
20676
20677         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
20678         and accordingly handle it.
20679
20680         * delegate.cs (Populate): Take TypeContainer argument.
20681         Implement bits to define the Invoke method. However, I still haven't figured out
20682         how to take care of the native int bit :-(
20683
20684         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
20685         Qualify the name of the delegate, not its return type !
20686
20687         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
20688         conversion.
20689
20690         (StandardConversionExists): Checking for array types turns out to be recursive.
20691
20692         (ConvertReferenceExplicit): Implement array conversion.
20693
20694         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
20695
20696 2001-10-12  Ravi Pratap  <ravi@ximian.com>
20697
20698         * cs-parser.jay (delegate_declaration): Store the fully qualified
20699         name as it is a type declaration.
20700
20701         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
20702         readonly.
20703
20704         (DefineDelegate): Renamed from Define. Does the same thing essentially,
20705         as TypeContainer::DefineType.
20706
20707         (Populate): Method in which all the definition of the various methods (Invoke)
20708         etc is done.
20709
20710         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
20711         see.
20712
20713         (CloseDelegate): Finally creates the delegate.
20714
20715         * class.cs (TypeContainer::DefineType): Update to define delegates.
20716         (Populate, Emit and CloseType): Do the same thing here too.
20717
20718         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
20719         delegates in all these operations.
20720
20721 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
20722
20723         * expression.cs: LocalTemporary: a new expression used to
20724         reference a temporary that has been created.
20725
20726         * assign.cs: Handle PropertyAccess back here, so that we can
20727         provide the proper semantic access to properties.
20728
20729         * expression.cs (Expression::ConvertReferenceExplicit): Implement
20730         a few more explicit conversions. 
20731
20732         * modifiers.cs: `NEW' modifier maps to HideBySig.
20733
20734         * expression.cs (PropertyExpr): Make this into an
20735         ExpressionStatement, and support the EmitStatement code path. 
20736
20737         Perform get/set error checking, clean up the interface.
20738
20739         * assign.cs: recognize PropertyExprs as targets, and if so, turn
20740         them into toplevel access objects.
20741
20742 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
20743
20744         * expression.cs: PropertyExpr::PropertyExpr: use work around the
20745         SRE.
20746
20747         * typemanager.cs: Keep track here of our PropertyBuilders again to
20748         work around lameness in SRE.
20749
20750 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
20751
20752         * expression.cs (LValue::LValueResolve): New method in the
20753         interface, used to perform a second resolution pass for LValues. 
20754
20755         (This::DoResolve): Catch the use of this in static methods.
20756
20757         (This::LValueResolve): Implement.
20758
20759         (This::Store): Remove warning, assigning to `this' in structures
20760         is 
20761
20762         (Invocation::Emit): Deal with invocation of
20763         methods on value types.  We need to pass the address to structure
20764         methods rather than the object itself.  (The equivalent code to
20765         emit "this" for structures leaves the entire structure on the
20766         stack instead of a pointer to it). 
20767
20768         (ParameterReference::DoResolve): Compute the real index for the
20769         argument based on whether the method takes or not a `this' pointer
20770         (ie, the method is static).
20771
20772         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
20773         value types returned from functions when we need to invoke a
20774         method on the sturcture.
20775
20776
20777 2001-10-11  Ravi Pratap  <ravi@ximian.com>
20778
20779         * class.cs (TypeContainer::DefineType): Method to actually do the business of
20780         defining the type in the Modulebuilder or Typebuilder. This is to take
20781         care of nested types which need to be defined on the TypeBuilder using
20782         DefineNestedMethod.
20783
20784         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
20785         methods in RootContext, only ported to be part of TypeContainer.
20786
20787         (TypeContainer::GetInterfaceOrClass): Ditto.
20788
20789         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
20790
20791         * interface.cs (Interface::DefineInterface): New method. Does exactly
20792         what RootContext.CreateInterface did earlier, only it takes care of nested types 
20793         too.
20794
20795         (Interface::GetInterfaces): Move from RootContext here and port.
20796
20797         (Interface::GetInterfaceByName): Same here.
20798
20799         * rootcontext.cs (ResolveTree): Re-write.
20800
20801         (PopulateTypes): Re-write.
20802
20803         * class.cs (TypeContainer::Populate): Populate nested types too.
20804         (TypeContainer::Emit): Emit nested members too.
20805
20806         * typemanager.cs (AddUserType): Do not make use of the FullName property,
20807         instead just use the name argument passed in as it is already fully
20808         qualified.
20809
20810         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
20811         to TypeContainer mapping to see if a type is user-defined.
20812
20813         * class.cs (TypeContainer::CloseType): Implement. 
20814
20815         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
20816         the default constructor.
20817
20818         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
20819         twice.
20820
20821         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
20822
20823         * interface.cs (CloseType): Create the type here.
20824
20825         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
20826         the hierarchy.
20827
20828         Remove all the methods which are now in TypeContainer.
20829
20830 2001-10-10  Ravi Pratap  <ravi@ximian.com>
20831
20832         * delegate.cs (Define): Re-write bits to define the delegate
20833         correctly.
20834
20835 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
20836
20837         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
20838
20839         * expression.cs (ImplicitReferenceConversion): handle null as well
20840         as a source to convert to any reference type.
20841
20842         * statement.cs (Return): Perform any implicit conversions to
20843         expected return type.  
20844
20845         Validate use of return statement.  
20846
20847         * codegen.cs (EmitContext): Pass the expected return type here.
20848
20849         * class.cs (Method, Constructor, Property): Pass expected return
20850         type to EmitContext.
20851
20852 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
20853
20854         * expression.cs: Make DoResolve take an EmitContext instead of a
20855         TypeContainer.
20856
20857         Replaced `l' and `location' for `loc', for consistency.
20858
20859         (Error, Warning): Remove unneeded Tc argument.
20860
20861         * assign.cs, literal.cs, constant.cs: Update to new calling
20862         convention. 
20863
20864         * codegen.cs: EmitContext now contains a flag indicating whether
20865         code is being generated in a static method or not.
20866
20867         * cs-parser.jay: DecomposeQI, new function that replaces the old
20868         QualifiedIdentifier.  Now we always decompose the assembled
20869         strings from qualified_identifier productions into a group of
20870         memberaccesses.
20871
20872 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
20873
20874         * rootcontext.cs: Deal with field-less struct types correctly now
20875         by passing the size option to Define Type.
20876
20877         * class.cs: Removed hack that created one static field. 
20878
20879 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20880
20881         * statement.cs: Moved most of the code generation here. 
20882
20883 2001-10-09  Ravi Pratap  <ravi@ximian.com>
20884
20885         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
20886         seem very right.
20887
20888         (ElementAccess): Remove useless bits for now - keep checks as the spec
20889         says.
20890
20891 2001-10-08  Ravi Pratap  <ravi@ximian.com>
20892
20893         * expression.cs (ElementAccess::DoResolve): Remove my crap code
20894         and start performing checks according to the spec.
20895
20896 2001-10-07  Ravi Pratap  <ravi@ximian.com>
20897
20898         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
20899         rank_specifiers instead.
20900
20901         (rank_specifiers): Change the order in which the rank specifiers are stored
20902
20903         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
20904
20905         * expression.cs (ElementAccess): Implement the LValue interface too.
20906
20907 2001-10-06  Ravi Pratap  <ravi@ximian.com>
20908
20909         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
20910         except that user defined conversions are not included.
20911
20912         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
20913         perform the conversion of the return type, if necessary.
20914
20915         (New::DoResolve): Check whether we are creating an array or an object
20916         and accordingly do the needful.
20917
20918         (New::Emit): Same here.
20919
20920         (New::DoResolve): Implement guts of array creation.
20921
20922         (New::FormLookupType): Helper function.
20923
20924 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
20925
20926         * codegen.cs: Removed most of the code generation here, and move the
20927         corresponding code generation bits to the statement classes. 
20928
20929         Added support for try/catch/finalize and throw.
20930
20931         * cs-parser.jay: Added support for try/catch/finalize.
20932
20933         * class.cs: Catch static methods having the flags override,
20934         virtual or abstract.
20935
20936         * expression.cs (UserCast): This user cast was not really doing
20937         what it was supposed to do.  Which is to be born in fully resolved
20938         state.  Parts of the resolution were being performed at Emit time! 
20939
20940         Fixed this code.
20941
20942 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20943
20944         * expression.cs: Implicity convert the result from UserCast.
20945
20946 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20947
20948         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
20949         prevented it from working correctly. 
20950
20951         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
20952         merely ConvertImplicit.
20953
20954 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
20955
20956         * typemanager.cs: Make the LookupTypeContainer function static,
20957         and not per-instance.  
20958
20959         * class.cs: Make static FindMembers (the one that takes a Type
20960         argument). 
20961
20962         * codegen.cs: Add EmitForeach here.
20963
20964         * cs-parser.jay: Make foreach a toplevel object instead of the
20965         inline expansion, as we need to perform semantic analysis on it. 
20966
20967 2001-10-05  Ravi Pratap  <ravi@ximian.com>
20968
20969         * expression.cs (Expression::ImplicitUserConversion): Rename to
20970         UserDefinedConversion.
20971
20972         (Expression::UserDefinedConversion): Take an extra argument specifying 
20973         whether we look for explicit user conversions too.
20974
20975         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
20976
20977         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
20978
20979         (ExplicitUserConversion): Make it a call to UserDefinedConversion
20980         with the appropriate arguments.
20981
20982         * cs-parser.jay (cast_expression): Record location too.
20983
20984         * expression.cs (Cast): Record location info.
20985
20986         (Expression::ConvertExplicit): Take location argument.
20987
20988         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
20989         to determine if we are doing explicit conversions.
20990
20991         (UserCast::Emit): Update accordingly.
20992
20993         (Expression::ConvertExplicit): Report an error if everything fails.
20994
20995         * ../errors/cs0030.cs : Add.
20996
20997 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
20998
20999         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21000         virtual and newslot bits. 
21001
21002         * class.cs (TypeContainer::RegisterRequiredImplementations):
21003         Record methods we need.
21004
21005         (TypeContainer::MakeKey): Helper function to make keys for
21006         MethodBases, since the Methodbase key is useless.
21007
21008         (TypeContainer::Populate): Call RegisterRequiredImplementations
21009         before defining the methods.   
21010
21011         Create a mapping for method_builders_to_methods ahead of time
21012         instead of inside a tight loop.
21013
21014         (::RequireMethods):  Accept an object as the data to set into the
21015         hashtable so we can report interface vs abstract method mismatch.
21016
21017 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21018
21019         * report.cs: Make all of it static.
21020
21021         * rootcontext.cs: Drop object_type and value_type computations, as
21022         we have those in the TypeManager anyways.
21023
21024         Drop report instance variable too, now it is a global.
21025
21026         * driver.cs: Use try/catch on command line handling.
21027
21028         Add --probe option to debug the error reporting system with a test
21029         suite. 
21030
21031         * report.cs: Add support for exiting program when a probe
21032         condition is reached.
21033
21034 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21035
21036         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21037         we do a forcible conversion regardless of type, to check if 
21038         ForceConversion returns a null.
21039
21040         (Binary::error19): Use location to report error.
21041
21042         (Unary::error23): Use location here too.
21043
21044         * ../errors/cs0019.cs : Check in.
21045
21046         * ../errors/cs0023.cs : Check in.
21047
21048         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21049         case of a non-null MethodInfo object with a length of 0 !
21050
21051         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21052         an applicable member - according to the spec :-)
21053         Also fix logic to find members in base types.
21054
21055         (Unary::ResolveOperator): Same here.
21056
21057         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21058         as I was getting thoroughly confused between this and error19 :-)
21059
21060         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21061         (::FindMostEncompassedType): Implement.
21062         (::FindMostEncompassingType): Implement.
21063         (::StandardConversionExists): Implement.
21064
21065         (UserImplicitCast): Re-vamp. We now need info about most specific
21066         source and target types so that we can do the necessary conversions.
21067
21068         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21069         mathematical union with no duplicates.
21070
21071 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21072
21073         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21074         in order from base classes to child classes, so that we can in
21075         child classes look up in our parent for method names and
21076         attributes (required for handling abstract, virtual, new, override
21077         constructs: we need to instrospect our base class, and if we dont
21078         populate the classes in order, the introspection might be
21079         incorrect.  For example, a method could query its parent before
21080         the parent has any methods and would determine that the parent has
21081         no abstract methods (while it could have had them)).
21082
21083         (RootContext::CreateType): Record the order in which we define the
21084         classes.
21085
21086 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21087
21088         * class.cs (TypeContainer::Populate): Also method definitions can
21089         fail now, keep track of this.
21090
21091         (TypeContainer::FindMembers): Implement support for
21092         DeclaredOnly/noDeclaredOnly flag.
21093
21094         (Constructor::Emit) Return the ConstructorBuilder.
21095
21096         (Method::Emit) Return the MethodBuilder. 
21097         Check for abstract or virtual methods to be public.
21098
21099         * rootcontext.cs (RootContext::CreateType): Register all the
21100         abstract methods required for the class to be complete and the
21101         interface methods that must be implemented. 
21102
21103         * cs-parser.jay: Report error 501 (method requires body if it is
21104         not marked abstract or extern).
21105
21106         * expression.cs (TypeOf::Emit): Implement.
21107
21108         * typemanager.cs: runtime_handle_type, new global type.
21109
21110         * class.cs (Property::Emit): Generate code for properties.
21111
21112 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21113
21114         * expression.cs (Unary::ResolveOperator): Find operators on base type
21115         too - we now conform exactly to the spec.
21116
21117         (Binary::ResolveOperator): Same here.
21118
21119         * class.cs (Operator::Define): Fix minor quirk in the tests.
21120
21121         * ../errors/cs0215.cs : Added.
21122
21123         * ../errors/cs0556.cs : Added.
21124
21125         * ../errors/cs0555.cs : Added.
21126
21127 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21128
21129         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21130         single integer which is really efficient
21131
21132 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21133
21134         *  expression.cs (Expression::ImplicitUserConversion): Use location
21135         even in the case when we are examining True operators.
21136  
21137         * class.cs (Operator::Define): Perform extensive checks to conform
21138         with the rules for operator overloading in the spec.
21139
21140         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21141         some of the other conversions mentioned in the spec.
21142
21143         * typemanager.cs (array_type): New static member for the System.Array built-in
21144         type.
21145
21146         (cloneable_interface): For System.ICloneable interface.
21147
21148         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21149         we start resolving the tree and populating types.
21150
21151         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21152  
21153 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21154
21155         * expression.cs (Expression::ExprClassFromMemberInfo,
21156         Expression::Literalize): Create literal expressions from
21157         FieldInfos which are literals.
21158
21159         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21160         type casts, because they were wrong.  The test suite in tests
21161         caught these ones.
21162
21163         (ImplicitNumericConversion): ushort to ulong requires a widening
21164         cast. 
21165
21166         Int32 constant to long requires widening cast as well.
21167
21168         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21169         for integers because the type on the stack is not i4.
21170
21171 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21172
21173         * expression.cs (report118): require location argument. 
21174
21175         * parameter.cs: Do not dereference potential null value.
21176
21177         * class.cs: Catch methods that lack the `new' keyword when
21178         overriding a name.  Report warnings when `new' is used without
21179         anything being there to override.
21180
21181         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21182
21183         * class.cs: Only add constructor to hashtable if it is non-null
21184         (as now constructors can fail on define).
21185
21186         (TypeManager, Class, Struct): Take location arguments.
21187
21188         Catch field instance initialization in structs as errors.
21189
21190         accepting_filter: a new filter for FindMembers that is static so
21191         that we dont create an instance per invocation.
21192
21193         (Constructor::Define): Catch errors where a struct constructor is
21194         parameterless 
21195
21196         * cs-parser.jay: Pass location information for various new
21197         constructs. 
21198
21199         * delegate.cs (Delegate): take a location argument.
21200
21201         * driver.cs: Do not call EmitCode if there were problesm in the
21202         Definition of the types, as many Builders wont be there. 
21203
21204         * decl.cs (Decl::Decl): Require a location argument.
21205
21206         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21207         into integers, and find the most appropiate integer for it.
21208
21209         * literal.cs: Implement ULongLiteral.
21210
21211         * rootcontext.cs: Provide better information about the location of
21212         failure when CreateType fails.
21213
21214 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21215
21216         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21217         as well.
21218
21219         * expression.cs (Binary::CheckShiftArguments): Add missing type
21220         computation.
21221         (Binary::ResolveOperator): Add type to the logical and and logical
21222         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21223         before.
21224
21225         (Binary::DoNumericPromotions): In the case where either argument
21226         is ulong (and most signed types combined with ulong cause an
21227         error) perform implicit integer constant conversions as well.
21228
21229 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21230
21231         * expression.cs (UserImplicitCast): Method should always be
21232         non-null. 
21233         (Invocation::BetterConversion): Simplified test for IntLiteral.
21234
21235         (Expression::ImplicitNumericConversion): Split this routine out.
21236         Put the code that performs implicit constant integer conversions
21237         here. 
21238
21239         (Expression::Resolve): Become a wrapper around DoResolve so we can
21240         check eclass and type being set after resolve.
21241
21242         (Invocation::Badness): Remove this dead function
21243
21244         (Binary::ResolveOperator): Do not compute the expensive argumnets
21245         unless we have a union for it.
21246
21247         (Probe::Emit): Is needs to do an isinst and then
21248         compare against null.
21249
21250         (::CanConvert): Added Location argument.  If the Location argument
21251         is null (Location.Null), then we do not report errors.  This is
21252         used by the `probe' mechanism of the Explicit conversion.  We do
21253         not want to generate an error for something that the user
21254         explicitly requested to be casted.  But the pipeline for an
21255         explicit cast first tests for potential implicit casts.
21256
21257         So for now, if the Location is null, it means `Probe only' to
21258         avoid adding another argument.   Might have to revise this
21259         strategy later.
21260
21261         (ClassCast): New class used to type cast objects into arbitrary
21262         classes (used in Explicit Reference Conversions).
21263
21264         Implement `as' as well.
21265
21266         Reverted all the patches from Ravi below: they were broken:
21267
21268                 * The use of `level' as a mechanism to stop recursive
21269                   invocations is wrong.  That was there just to catch the
21270                   bug with a strack trace but not as a way of addressing
21271                   the problem.
21272
21273                   To fix the problem we have to *understand* what is going
21274                   on and the interactions and come up with a plan, not
21275                   just get things going.
21276
21277                 * The use of the type conversion cache that I proposed
21278                   last night had an open topic: How does this work across
21279                   protection domains.  A user defined conversion might not
21280                   be public in the location where we are applying the
21281                   conversion, a different conversion might be selected
21282                   (ie, private A->B (better) but public B->A (worse),
21283                   inside A, A->B applies, but outside it, B->A will
21284                   apply).
21285
21286                 * On top of that (ie, even if the above is solved),
21287                   conversions in a cache need to be abstract.  Ie, `To
21288                   convert from an Int to a Short use an OpcodeCast', not
21289                   `To convert from an Int to a Short use the OpcodeCast on
21290                   the variable 5' (which is what this patch was doing).
21291
21292 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21293
21294         * expression.cs (Invocation::ConversionExists): Re-write to use
21295         the conversion cache
21296
21297         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
21298         cache all conversions done, not just user-defined ones.
21299
21300         (Invocation::BetterConversion): The real culprit. Use ConversionExists
21301         to determine if a conversion exists instead of acutually trying to 
21302         perform the conversion. It's faster too.
21303
21304         (Expression::ConvertExplicit): Modify to use ConversionExists to check
21305         and only then attempt the implicit conversion.
21306
21307 2001-09-28  Ravi Pratap  <ravi@ximian.com>
21308
21309         * expression.cs (ConvertImplicit): Use a cache for conversions
21310         already found. Check level of recursion and bail out if necessary.
21311
21312 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21313
21314         * typemanager.cs (string_concat_string_string, string_concat_object_object):
21315         Export standard methods that we expect for string operations.
21316
21317         * statement.cs (Block::UsageWarning): Track usage of variables and
21318         report the errors for not used variables.
21319
21320         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
21321         operator. 
21322
21323 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21324
21325         * codegen.cs: remove unnneded code 
21326
21327         * expression.cs: Removed BuiltinTypeAccess class
21328
21329         Fix the order in which implicit conversions are
21330         done.  
21331
21332         The previous fixed dropped support for boxed conversions (adding a
21333         test to the test suite now)
21334
21335         (UserImplicitCast::CanConvert): Remove test for source being null,
21336         that code is broken.  We should not feed a null to begin with, if
21337         we do, then we should track the bug where the problem originates
21338         and not try to cover it up here.
21339
21340         Return a resolved expression of type UserImplicitCast on success
21341         rather than true/false.  Ravi: this is what I was talking about,
21342         the pattern is to use a static method as a "constructor" for
21343         objects. 
21344
21345         Also, do not create arguments until the very last minute,
21346         otherwise we always create the arguments even for lookups that
21347         will never be performed. 
21348
21349         (UserImplicitCast::Resolve): Eliminate, objects of type
21350         UserImplicitCast are born in a fully resolved state. 
21351
21352         * typemanager.cs (InitCoreTypes): Init also value_type
21353         (System.ValueType). 
21354
21355         * expression.cs (Cast::Resolve): First resolve the child expression.
21356
21357         (LValue): Add new method AddressOf to be used by
21358         the `&' operator.  
21359
21360         Change the argument of Store to take an EmitContext instead of an
21361         ILGenerator, because things like FieldExpr need to be able to call
21362         their children expression to generate the instance code. 
21363
21364         (Expression::Error, Expression::Warning): Sugar functions for
21365         reporting errors.
21366
21367         (Expression::MemberLookup): Accept a TypeContainer instead of a
21368         Report as the first argument.
21369
21370         (Expression::ResolvePrimary): Killed.  I still want to improve
21371         this as currently the code is just not right.
21372
21373         (Expression::ResolveMemberAccess): Simplify, but it is still
21374         wrong. 
21375
21376         (Unary::Resolve): Catch errors in AddressOf operators.
21377
21378         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
21379         index to a byte for the short-version, or the compiler will choose
21380         the wrong Emit call, which generates the wrong data.
21381
21382         (ParameterReference::Emit, ::Store): same.
21383
21384         (FieldExpr::AddressOf): Implement.
21385
21386         * typemanager.cs: TypeManager: made public variable instead of
21387         property.
21388
21389         * driver.cs: document --fatal.
21390
21391         * report.cs (ErrorMessage, WarningMessage): new names for the old
21392         Error and Warning classes.
21393
21394         * cs-parser.jay (member_access): Turn built-in access to types
21395         into a normal simplename
21396
21397 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21398
21399         * expression.cs (Invocation::BetterConversion): Fix to cope
21400         with q being null, since this was introducing a bug.
21401
21402         * expression.cs (ConvertImplicit): Do built-in conversions first.
21403
21404 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21405
21406         * expression.cs (UserImplicitCast::Resolve): Fix bug.
21407
21408 2001-09-27  Ravi Pratap  <ravi@ximian.com>
21409
21410         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
21411         I had introduced long ago (what's new ?).
21412
21413         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
21414         the work of all the checking. 
21415         (ConvertImplicit): Call CanConvert and only then create object if necessary.
21416         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
21417
21418         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
21419         that is the right way. 
21420
21421         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
21422         overloading resolution. Use everywhere instead of cutting and pasting code.
21423
21424         (Binary::ResolveOperator): Use MakeUnionSet.
21425
21426         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
21427         we have to convert to bool types. Not complete yet.
21428
21429 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
21430
21431         * typemanager.cs (TypeManager::CSharpName): support ushort.
21432
21433         * expression.cs (Expression::TryImplicitIntConversion): Attempts
21434         to provide an expression that performsn an implicit constant int
21435         conversion (section 6.1.6).
21436         (Expression::ConvertImplicitRequired): Reworked to include
21437         implicit constant expression conversions.
21438
21439         (Expression::ConvertNumericExplicit): Finished.
21440
21441         (Invocation::Emit): If InstanceExpression is null, then it means
21442         that we perform a call on this.
21443
21444 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21445
21446         * expression.cs (Unary::Emit): Remove some dead code.
21447         (Probe): Implement Resolve and Emit for `is'.
21448         (Expression::ConvertImplicitRequired): Attempt to do constant
21449         expression conversions here.  Maybe should be moved to
21450         ConvertImplicit, but I am not sure.
21451         (Expression::ImplicitLongConstantConversionPossible,
21452         Expression::ImplicitIntConstantConversionPossible): New functions
21453         that tell whether is it possible to apply an implicit constant
21454         expression conversion.
21455
21456         (ConvertNumericExplicit): Started work on explicit numeric
21457         conversions.
21458
21459         * cs-parser.jay: Update operator constants.
21460
21461         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
21462         (Parameters::GetSignature): Hook up VerifyArgs here.
21463         (Parameters::VerifyArgs): Verifies that no two arguments have the
21464         same name. 
21465
21466         * class.cs (Operator): Update the operator names to reflect the
21467         ones that the spec expects (as we are just stringizing the
21468         operator names).
21469
21470         * expression.cs (Unary::ResolveOperator): Fix bug: Use
21471         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
21472         previous usage did only work for our methods.
21473         (Expression::ConvertImplicit): Handle decimal implicit numeric
21474         conversions as well.
21475         (Expression::InternalTypeConstructor): Used to invoke constructors
21476         on internal types for default promotions.
21477
21478         (Unary::Emit): Implement special handling for the pre/post
21479         increment/decrement for overloaded operators, as they need to have
21480         the same semantics as the other operators.
21481
21482         (Binary::ResolveOperator): ditto.
21483         (Invocation::ConversionExists): ditto.
21484         (UserImplicitCast::Resolve): ditto.
21485
21486 2001-09-26  Ravi Pratap  <ravi@ximian.com>
21487
21488         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
21489         operator, return after emitting body. Regression tests pass again !
21490
21491         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
21492         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
21493         (Invocation::OverloadResolve): Ditto.
21494         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
21495
21496         * everywhere : update calls to the above methods accordingly.
21497
21498 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
21499
21500         * assign.cs (Assign): Make it inherit from ExpressionStatement.
21501
21502         * expression.cs (ExpressionStatement): New base class used for
21503         expressions that can appear in statements, so that we can provide
21504         an alternate path to generate expression that do not leave a value
21505         on the stack.
21506
21507         (Expression::Emit, and all the derivatives): We no longer return
21508         whether a value is left on the stack or not.  Every expression
21509         after being emitted leaves a single value on the stack.
21510
21511         * codegen.cs (EmitContext::EmitStatementExpression): Use the
21512         facilties of ExpressionStatement if possible.
21513
21514         * cs-parser.jay: Update statement_expression.
21515
21516 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
21517
21518         * driver.cs: Change the wording of message
21519
21520 2001-09-25  Ravi Pratap  <ravi@ximian.com>
21521
21522         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
21523         the type of the expression to the return type of the method if
21524         we have an overloaded operator match ! The regression tests pass again !
21525         (Unary::ResolveOperator): Ditto.
21526
21527         * expression.cs (Invocation::ConversionExists): Correct the member lookup
21528         to find "op_Implicit", not "implicit" ;-)
21529         (UserImplicitCast): New class to take care of user-defined implicit conversions.
21530         (ConvertImplicit, ForceConversion): Take TypeContainer argument
21531
21532         * everywhere : Correct calls to the above accordingly.
21533
21534         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
21535         (ConvertImplicit): Do user-defined conversion if it exists.
21536
21537 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
21538
21539         * assign.cs: track location.
21540         (Resolve): Use implicit conversions on assignment.
21541
21542         * literal.cs: Oops.  Not good, Emit of short access values should
21543         pass (Bytes) or the wrong argument will be selected.
21544
21545         * expression.cs (Unary::Emit): Emit code for -expr.
21546
21547         (Unary::ResolveOperator): Handle `Substract' for non-constants
21548         (substract from zero from the non-constants).
21549         Deal with Doubles as well. 
21550
21551         (Expression::ConvertImplicitRequired): New routine that reports an
21552         error if no implicit conversion exists. 
21553
21554         (Invocation::OverloadResolve): Store the converted implicit
21555         expressions if we make them
21556
21557 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21558
21559         * class.cs (ConstructorInitializer): Take a Location argument.
21560         (ConstructorBaseInitializer): Same here.
21561         (ConstructorThisInitializer): Same here.
21562
21563         * cs-parser.jay : Update all calls accordingly.
21564
21565         * expression.cs (Unary, Binary, New): Take location argument.
21566         Update accordingly everywhere.
21567
21568         * cs-parser.jay : Update all calls to the above to take a location
21569         argument.
21570
21571         * class.cs : Ditto.
21572
21573 2001-09-24  Ravi Pratap  <ravi@ximian.com>
21574
21575         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
21576         (Invocation::BetterConversion): Same here
21577         (Invocation::ConversionExists): Ditto.
21578
21579         (Invocation::ConversionExists): Implement.
21580
21581 2001-09-22  Ravi Pratap  <ravi@ximian.com>
21582
21583         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
21584         Also take an additional TypeContainer argument.
21585
21586         * All over : Pass in TypeContainer as argument to OverloadResolve.
21587
21588         * typemanager.cs (CSharpName): Update to check for the string type and return
21589         that too.
21590
21591         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
21592         a given method.
21593
21594 2001-09-21  Ravi Pratap  <ravi@ximian.com>
21595
21596         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
21597         (Invocation::BetterFunction): Implement.
21598         (Invocation::BetterConversion): Implement.
21599         (Invocation::ConversionExists): Skeleton, no implementation yet.
21600
21601         Okay, things work fine !
21602
21603 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
21604
21605         * typemanager.cs: declare and load enum_type, delegate_type and
21606         void_type. 
21607
21608         * expression.cs (Expression::Emit): Now emit returns a value that
21609         tells whether a value is left on the stack or not.  This strategy
21610         might be reveted tomorrow with a mechanism that would address
21611         multiple assignments.
21612         (Expression::report118): Utility routine to report mismatches on
21613         the ExprClass.
21614
21615         (Unary::Report23): Report impossible type/operator combination
21616         utility function.
21617
21618         (Unary::IsIncrementableNumber): Whether the type can be
21619         incremented or decremented with add.
21620         (Unary::ResolveOperator): Also allow enumerations to be bitwise
21621         complemented. 
21622         (Unary::ResolveOperator): Implement ++, !, ~,
21623
21624         (Invocation::Emit): Deal with new Emit convetion.
21625
21626         * All Expression derivatives: Updated their Emit method to return
21627         whether they leave values on the stack or not.
21628
21629         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
21630         stack for expressions that are statements. 
21631
21632 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21633
21634         * expression.cs (LValue): New interface.  Must be implemented by
21635         LValue objects.
21636         (LocalVariableReference, ParameterReference, FieldExpr): Implement
21637         LValue interface.
21638
21639         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
21640         interface for generating code, simplifies the code.
21641
21642 2001-09-20  Ravi Pratap  <ravi@ximian.com>
21643
21644         * expression.cs (everywhere): Comment out return statements in ::Resolve
21645         methods to avoid the warnings.
21646
21647 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
21648
21649         * driver.cs (parse): Report error 2001 if we can not open the
21650         source file.
21651
21652         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
21653         not resolve it.
21654
21655         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
21656         object. 
21657
21658         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
21659         otherwise nested blocks end up with the same index.
21660
21661         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
21662
21663         * expression.cs:  Instead of having FIXMEs in the Resolve
21664         functions, throw exceptions so it is obvious that we are facing a
21665         bug. 
21666
21667         * cs-parser.jay (invocation_expression): Pass Location information.
21668
21669         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
21670         Use a basename for those routines because .NET does not like paths
21671         on them. 
21672
21673         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
21674         already defined.
21675
21676 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
21677
21678         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
21679         are loading the correct data types (throws an exception if not).
21680         (TypeManager::InitCoreTypes): Use CoreLookupType
21681
21682         * expression.cs (Unary::ResolveOperator): return the child
21683         expression for expressions which are just +expr.
21684         (Unary::ResolveOperator): Return negative literals for -LITERAL
21685         expressions (otherwise they are Unary {Literal}).
21686         (Invocation::Badness): Take into account `Implicit constant
21687         expression conversions'.
21688
21689         * literal.cs (LongLiteral): Implement long literal class.
21690         (IntLiteral): export the `Value' of the intliteral. 
21691
21692 2001-09-19  Ravi Pratap  <ravi@ximian.com>
21693
21694         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
21695
21696         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
21697         instead of 'Operator'
21698
21699         * expression.cs (Binary::ResolveOperator): Update accordingly.
21700         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
21701         and 'Minus'
21702
21703         * cs-parser.jay (unary_expression): Update to use the new names.
21704
21705         * gen-treedump.cs (GetUnary): Same here.
21706
21707         * expression.cs (Unary::Resolve): Implement.
21708         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
21709         operators are found instead of making noise ;-)
21710         (Unary::ResolveOperator): New method to do precisely the same thing which
21711         Binary::ResolveOperator does for Binary expressions.
21712         (Unary.method, .Arguments): Add.
21713         (Unary::OperName): Implement.   
21714         (Unary::ForceConversion): Copy and Paste !
21715
21716         * class.cs (Operator::Define): Fix a small bug for the case when we have 
21717         a unary operator.
21718
21719         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
21720         for the inbuilt operators. Only overloading works for now ;-)
21721
21722 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
21723
21724         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
21725         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
21726
21727         * expression.cs (This::Emit): Implement. 
21728         (This::Resolve): Implement.
21729         (TypeOf:Resolve): Implement.
21730         (Expression::ResolveSimpleName): Add an implicit this to instance
21731         field references. 
21732         (MemberAccess::Resolve): Deal with Parameters and Fields. 
21733         Bind instance variable to Field expressions.
21734         (FieldExpr::Instance): New field used to track the expression that
21735         represents the object instance.
21736         (FieldExpr::Resolve): Track potential errors from MemberLookup not
21737         binding 
21738         (FieldExpr::Emit): Implement.
21739
21740         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
21741         the last instruction contains a return opcode to avoid generating
21742         the last `ret' instruction (this generates correct code, and it is
21743         nice to pass the peverify output).
21744
21745         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
21746         initializer for static and instance variables.
21747         (Constructor::Emit): Allow initializer to be null in the case of
21748         static constructors.  Only emit initializer for instance
21749         constructors. 
21750
21751         (TypeContainer::FindMembers): Return a null array if there are no
21752         matches.
21753
21754         Also fix the code for the MemberTypes.Method branch, as it was not
21755         scanning that for operators (or tried to access null variables before).
21756
21757         * assign.cs (Assign::Emit): Handle instance and static fields. 
21758
21759         * TODO: Updated.
21760
21761         * driver.cs: Stop compilation if there are parse errors.
21762
21763         * cs-parser.jay (constructor_declaration): Provide default base
21764         initializer for non-static constructors.
21765         (constructor_declarator): Do not provide a default base
21766         initializers if none was specified.
21767         Catch the fact that constructors should not have parameters.
21768
21769         * class.cs: Do not emit parent class initializers for static
21770         constructors, that should be flagged as an error.
21771
21772 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21773
21774         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
21775         Move back code into TypeContainer::Populate.
21776
21777 2001-09-18  Ravi Pratap  <ravi@ximian.com>
21778
21779         * class.cs (TypeContainer::AddConstructor): Fix the check to
21780         compare against Name, not Basename. 
21781         (Operator::OpType): Change Plus and Minus to Add and Subtract.
21782
21783         * cs-parser.jay : Update accordingly.
21784
21785         * class.cs (TypeContainer::FindMembers): For the case where we are searching
21786         for methods, don't forget to look into the operators too.
21787         (RegisterMethodBuilder): Helper method to take care of this for
21788         methods, constructors and operators.
21789         (Operator::Define): Completely revamp.
21790         (Operator.OperatorMethod, MethodName): New fields.
21791         (TypeContainer::Populate): Move the registering of builders into
21792         RegisterMethodBuilder.
21793         (Operator::Emit): Re-write.
21794
21795         * expression.cs (Binary::Emit): Comment out code path to emit method
21796         invocation stuff for the case when we have a user defined operator. I am
21797         just not able to get it right !
21798
21799 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21800
21801         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
21802         argument. 
21803
21804         (Expression::MemberLookup): Provide a version that allows to
21805         specify the MemberTypes and BindingFlags. 
21806
21807         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
21808         so it was not fetching variable information from outer blocks.
21809
21810         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
21811         Beforefieldinit as it was buggy.
21812
21813         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
21814         that Ravi put here.  
21815
21816         * class.cs (Constructor::Emit): Only emit if block is not null.
21817         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
21818         deal with this by semantically definining it as if the user had
21819         done it.
21820
21821         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
21822         constructors as we now "emit" them at a higher level.
21823
21824         (TypeContainer::DefineDefaultConstructor): Used to define the
21825         default constructors if none was provided.
21826
21827         (ConstructorInitializer): Add methods Resolve and Emit. 
21828
21829         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
21830
21831 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21832
21833         * class.cs (TypeContainer::EmitDefaultConstructor): Register
21834         the default constructor builder with our hashtable for methodbuilders
21835         to methodcores.
21836
21837         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
21838         and argument_count is 0 in which case we have a match.
21839         (Binary::ResolveOperator): More null checking and miscellaneous coding
21840         style cleanup.
21841
21842 2001-09-17  Ravi Pratap  <ravi@ximian.com>
21843
21844         * rootcontext.cs (IsNameSpace): Compare against null.
21845
21846         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
21847
21848         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
21849         and Unary::Operator.
21850
21851         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
21852         accordingly.
21853
21854         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
21855         we have overloaded operators.
21856         (Binary::ResolveOperator): Implement the part which does the operator overload
21857         resolution.
21858
21859         * class.cs (Operator::Emit): Implement.
21860         (TypeContainer::Emit): Emit the operators we have too.
21861
21862         * expression.cs (Binary::Emit): Update to emit the appropriate code for
21863         the case when we have a user-defined operator.
21864
21865 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
21866
21867         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
21868
21869 2001-09-16  Ravi Pratap  <ravi@ximian.com>
21870
21871         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
21872         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
21873         (Constructor::Emit): Implement.
21874         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
21875         if we have no work to do. 
21876         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
21877         Emit method.
21878
21879         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
21880         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
21881
21882         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
21883         of parent.parent.
21884
21885 2001-09-15  Ravi Pratap  <ravi@ximian.com>
21886
21887         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
21888         in the source.
21889         (Tree::RecordNamespace): Method to do what the name says ;-)
21890         (Tree::Namespaces): Property to get at the namespaces hashtable.
21891
21892         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
21893         keep track.
21894
21895         * rootcontext.cs (IsNamespace): Fixed it :-)
21896
21897 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21898
21899         * class.cs (TypeContainer::FindMembers): Add support for
21900         constructors. 
21901         (MethodCore): New class that encapsulates both the shared aspects
21902         of a Constructor and a Method.  
21903         (Method, Constructor): Factored pieces into MethodCore.
21904
21905         * driver.cs: Added --fatal which makes errors throw exceptions.
21906         Load System assembly as well as part of the standard library.
21907
21908         * report.cs: Allow throwing exceptions on errors for debugging.
21909
21910         * modifiers.cs: Do not use `parent', instead use the real type
21911         container to evaluate permission settings.
21912
21913         * class.cs: Put Ravi's patch back in.  He is right, and we will
21914         have to cope with the
21915
21916 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21917
21918         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
21919         FamORAssem, not FamANDAssem.
21920
21921 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
21922
21923         * driver.cs: Added --parse option that only parses its input files
21924         and terminates.
21925
21926         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
21927         incorrect.  IsTopLevel is not used to tell whether an object is
21928         root_types or not (that can be achieved by testing this ==
21929         root_types).  But to see if this is a top-level *class* (not
21930         necessarly our "toplevel" container). 
21931
21932 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21933
21934         * enum.cs (Enum::Define): Modify to call the Lookup method on the
21935         parent instead of a direct call to GetType.
21936
21937 2001-09-14  Ravi Pratap  <ravi@ximian.com>
21938
21939         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
21940         Modifiers.TypeAttr. This should just be a call to that method.
21941
21942         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
21943         object so that we can determine if we are top-level or not.
21944
21945         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
21946         TypeContainer too.
21947
21948         * enum.cs (Enum::Define): Ditto.
21949
21950         * modifiers.cs (FieldAttr): Re-write.
21951
21952         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
21953         (TypeContainer::HaveStaticConstructor): New property to provide access
21954         to precisely that info.
21955
21956         * modifiers.cs (MethodAttr): Re-write.
21957         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
21958
21959         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
21960         of top-level types as claimed.
21961
21962 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
21963
21964         * expression.cs (MemberLookup): Fruitless attempt to lookup
21965         constructors.  Maybe I need to emit default constructors?  That
21966         might be it (currently .NET emits this for me automatically).
21967         (Invocation::OverloadResolve): Cope with Arguments == null.
21968         (Invocation::EmitArguments): new function, shared by the new
21969         constructor and us.
21970         (Invocation::Emit): Handle static and instance methods.  Emit
21971         proper call instruction for virtual or non-virtual invocations.
21972         (New::Emit): Implement.
21973         (New::Resolve): Implement.
21974         (MemberAccess:Resolve): Implement.
21975         (MethodGroupExpr::InstanceExpression): used conforming to the spec
21976         to track instances.
21977         (FieldExpr::Resolve): Set type.
21978
21979         * support.cs: Handle empty arguments.
21980                 
21981         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
21982         SimpleLookup): Auxiliary routines to help parse a qualifier
21983         identifier.  
21984
21985         Update qualifier_identifier rule.
21986
21987         * codegen.cs: Removed debugging messages.
21988
21989         * class.cs: Make this a global thing, this acts just as a "key" to
21990         objects that we might have around.
21991
21992         (Populate): Only initialize method_builders_to_methods once.
21993
21994         * expression.cs (PropertyExpr): Initialize type from the
21995         PropertyType. 
21996
21997         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
21998         Resolve pattern.  Attempt to implicitly convert value to boolean.
21999         Emit code.
22000
22001         * expression.cs: Set the type for the int32/int32 argument case.
22002         (Binary::ResolveOperator): Set the return type to boolean for
22003         comparission operators
22004
22005         * typemanager.cs: Remove debugging print code.
22006
22007         (Invocation::Resolve): resolve type.
22008
22009         * class.cs: Allocate a MemberInfo of the correct size, as the code
22010         elsewhere depends on the test to reflect the correct contents.
22011
22012         (Method::) Keep track of parameters, due to System.Reflection holes
22013
22014         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22015         mapping here.
22016
22017         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22018         of the exact size and return that.
22019
22020         (Class::LookupMethodByBuilder): New function that maps
22021         MethodBuilders to its methods.  Required to locate the information
22022         on methods because System.Reflection bit us again.
22023
22024         * support.cs: New file, contains an interface ParameterData and
22025         two implementations: ReflectionParameters and InternalParameters
22026         used to access Parameter information.  We will need to grow this
22027         as required.
22028
22029         * expression.cs (Invocation::GetParameterData): implement a cache
22030         and a wrapper around the ParameterData creation for methods. 
22031         (Invocation::OverloadResolve): Use new code.
22032
22033 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22034
22035         * class.cs (TypeContainer::EmitField): Remove and move into 
22036         (Field::Define): here and modify accordingly.
22037         (Field.FieldBuilder): New member.
22038         (TypeContainer::Populate): Update accordingly.
22039         (TypeContainer::FindMembers): Implement.
22040
22041 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22042
22043         * statement.cs: (VariableInfo::VariableType): New field to be
22044         initialized with the full type once it is resolved. 
22045
22046 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22047
22048         * parameter.cs (GetParameterInfo): Use a type cache to compute
22049         things only once, and to reuse this information
22050
22051         * expression.cs (LocalVariableReference::Emit): Implement.
22052         (OpcodeCast::Emit): fix.
22053
22054         (ParameterReference::Resolve): Implement.
22055         (ParameterReference::Emit): Implement.
22056
22057         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22058         that are expressions need to stay as Expressions.
22059
22060         * typemanager.cs (CSharpName): Returns the C# name of a type if
22061         possible. 
22062
22063         * expression.cs (Expression::ConvertImplicit): New function that
22064         implements implicit type conversions.
22065
22066         (Expression::ImplicitReferenceConversion): Implements implicit
22067         reference conversions.
22068
22069         (EmptyCast): New type for transparent casts.
22070
22071         (OpcodeCast): New type for casts of types that are performed with
22072         a sequence of bytecodes.
22073
22074         (BoxedCast): New type used for casting value types into reference
22075         types.  Emits a box opcode.
22076
22077         (Binary::DoNumericPromotions): Implements numeric promotions of
22078         and computation of the Binary::Type.
22079
22080         (Binary::EmitBranchable): Optimization.
22081
22082         (Binary::Emit): Implement code emission for expressions.
22083
22084         * typemanager.cs (TypeManager): Added two new core types: sbyte
22085         and byte.
22086
22087 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22088
22089         * class.cs (TypeContainer::FindMembers): Method which does exactly
22090         what Type.FindMembers does, only we don't have to use reflection. No
22091         implementation yet.
22092
22093         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22094         typecontainer objects as we need to get at them.
22095         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22096
22097         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22098         typecontainer object.
22099
22100         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22101         of just a Report object.
22102
22103 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22104
22105         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22106         "remove_"
22107         (TypeContainer::Populate): Now define the delegates of the type too.
22108         (TypeContainer.Delegates): Property to access the list of delegates defined
22109         in the type.
22110
22111         * delegates.cs (Delegate::Define): Implement partially.
22112
22113         * modifiers.cs (TypeAttr): Handle more flags.
22114
22115 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22116
22117         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22118         and not <=
22119         (Operator::Define): Re-write logic to get types by using the LookupType method
22120         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22121         (Indexer::Define): Ditto.
22122         (Event::Define): Ditto.
22123         (Property::Define): Ditto.
22124
22125 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22126
22127         * class.cs (TypeContainer::Populate): Now define operators too. 
22128         (TypeContainer.Operators): New property to access the list of operators
22129         in a type.
22130         (Operator.OperatorMethodBuilder): New member to hold the method builder
22131         for the operator we are defining.
22132         (Operator::Define): Implement.
22133
22134 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22135
22136         * class.cs (Event::Define): Make the prefixes of the accessor methods
22137         addOn_ and removeOn_ 
22138
22139         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22140         of the location being passed in too. Ideally, this should go later since all
22141         error reporting should be done through the Report object.
22142
22143         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22144         (Populate): Iterate thru the indexers we have and define them too.
22145         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22146         for the get and set accessors.
22147         (Indexer::Define): Implement.
22148
22149 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22150
22151         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22152         my previous implementation, did not work.
22153
22154         * typemanager.cs: Add a couple of missing types (the longs).
22155
22156         * literal.cs: Use TypeManager.bool_type instead of getting it.
22157
22158         * expression.cs (EventExpr): New kind of expressions.
22159         (Expressio::ExprClassFromMemberInfo): finish
22160
22161 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22162
22163         * assign.cs: Emit stores to static fields differently.
22164
22165 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22166
22167         * Merge in changes and adjust code to tackle conflicts. Backed out my
22168         code in Assign::Resolve ;-) 
22169
22170 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22171
22172         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22173         instead Report.Error and also pass in the location.
22174         (CSharpParser::Lexer): New readonly property to return the reference
22175         to the Tokenizer object.
22176         (declare_local_variables): Use Report.Error with location instead of plain 
22177         old error.
22178         (CheckDef): Ditto.
22179
22180         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22181         (Operator.CheckBinaryOperator): Ditto.
22182
22183         * cs-parser.jay (operator_declarator): Update accordingly.
22184
22185         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22186         (CheckBinaryOperator): Same here.
22187
22188         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22189         on the name without any prefixes of namespace names etc. This is because we
22190         already might have something already fully qualified like 
22191         'System.Console.WriteLine'
22192
22193         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22194
22195 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22196
22197         * cs-tokenizer.cs (location): Return a string which also contains
22198         the file name.
22199
22200         * expression.cs (ElementAccess): New class for expressions of the
22201         type 'element access.'
22202         (BaseAccess): New class for expressions of the type 'base access.'
22203         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22204         respectively.
22205
22206         * cs-parser.jay (element_access): Implement action.
22207         (base_access): Implement actions.
22208         (checked_expression, unchecked_expression): Implement.
22209
22210         * cs-parser.jay (local_variable_type): Correct and implement.
22211         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22212
22213         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22214
22215         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22216         name and the specifiers.
22217
22218         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22219
22220         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22221         making them all public ;-)
22222
22223         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22224         class anyways.
22225
22226 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22227
22228         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22229         PropertyExprs.
22230         (FieldExpr, PropertyExprs): New resolved expressions.
22231         (SimpleName::MemberStaticCheck): Perform static checks for access
22232         to non-static fields on static methods. Maybe this should be
22233         generalized for MemberAccesses. 
22234         (SimpleName::ResolveSimpleName): More work on simple name
22235         resolution. 
22236
22237         * cs-parser.jay (primary_expression/qualified_identifier): track
22238         the parameter index.
22239
22240         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22241         (EmitContext::EmitBoolExpression): Chain to expression generation
22242         instead of temporary hack.
22243         (::EmitStatementExpression): Put generic expression code generation.
22244
22245         * assign.cs (Assign::Emit): Implement variable assignments to
22246         local variables, parameters and fields.
22247
22248 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22249
22250         * statement.cs (Block::GetVariableInfo): New method, returns the
22251         VariableInfo for a variable name in a block.
22252         (Block::GetVariableType): Implement in terms of GetVariableInfo
22253
22254         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22255         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22256
22257 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22258
22259         * cs-parser.jay (operator_declaration): Continue on my quest : update
22260         to take attributes argument.
22261         (event_declaration): Ditto.
22262         (enum_declaration): Ditto.
22263         (indexer_declaration): Ditto.
22264
22265         * class.cs (Operator::Operator): Update constructor accordingly.
22266         (Event::Event): Ditto.
22267
22268         * delegate.cs (Delegate::Delegate): Same here.
22269
22270         * enum.cs (Enum::Enum): Same here.
22271
22272 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22273
22274         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
22275
22276         * ../tests/cs0658.cs : New file to demonstrate error 0658.
22277
22278         * attribute.cs (Attributes): New class to encapsulate all attributes which were
22279         being passed around as an arraylist.
22280         (Attributes::AddAttribute): Method to add attribute sections.
22281
22282         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
22283         (struct_declaration): Update accordingly.
22284         (constant_declaration): Update.
22285         (field_declaration): Update.
22286         (method_header): Update.
22287         (fixed_parameter): Update.
22288         (parameter_array): Ditto.
22289         (property_declaration): Ditto.
22290         (destructor_declaration): Ditto.
22291
22292         * class.cs (Struct::Struct): Update constructors accordingly.
22293         (Class::Class): Ditto.
22294         (Field::Field): Ditto.
22295         (Method::Method): Ditto.
22296         (Property::Property): Ditto.
22297         (TypeContainer::OptAttribute): update property's return type.
22298
22299         * interface.cs (Interface.opt_attributes): New member.
22300         (Interface::Interface): Update to take the extra Attributes argument.
22301
22302         * parameter.cs (Parameter::Parameter): Ditto.
22303
22304         * constant.cs (Constant::Constant): Ditto.
22305
22306         * interface.cs (InterfaceMemberBase): New OptAttributes field.
22307         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
22308         the attributes as a parameter.
22309         (InterfaceProperty): Update constructor call.
22310         (InterfaceEvent): Ditto.
22311         (InterfaceMethod): Ditto.
22312         (InterfaceIndexer): Ditto.
22313
22314         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
22315         pass the attributes too.
22316         (interface_event_declaration): Ditto.
22317         (interface_property_declaration): Ditto.
22318         (interface_method_declaration): Ditto.
22319         (interface_declaration): Ditto.
22320
22321 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
22322
22323         * class.cs (Method::Define): Track the "static Main" definition to
22324         create an entry point. 
22325
22326         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
22327         EntryPoint if we find it. 
22328
22329         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
22330         (EmitContext::ig): Make this variable public.
22331
22332         * driver.cs: Make the default output file be the first file name
22333         with the .exe extension.  
22334
22335         Detect empty compilations
22336
22337         Handle various kinds of output targets.  Handle --target and
22338         rename -t to --dumper.
22339
22340         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
22341         methods inherited from Expression return now an Expression.  This
22342         will is used during the tree rewriting as we resolve them during
22343         semantic analysis.
22344
22345         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
22346         the spec.  Missing entirely is the information about
22347         accessability of elements of it.
22348
22349         (Expression::ExprClassFromMemberInfo): New constructor for
22350         Expressions that creates a fully initialized Expression based on
22351         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
22352         a Type.
22353
22354         (Invocation::Resolve): Begin implementing resolution of invocations.
22355
22356         * literal.cs (StringLiteral):  Implement Emit.
22357
22358 2001-09-05  Ravi Pratap  <ravi@ximian.com>
22359
22360         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
22361         member.
22362
22363 2001-09-04  Ravi Pratap  <ravi@ximian.com>
22364
22365         * cs-parser.jay (attribute_arguments): Implement actions.
22366         (attribute): Fix bug in production. Implement action.
22367         (attribute_list): Implement.
22368         (attribute_target): Implement.
22369         (attribute_target_specifier, opt_target_specifier): Implement
22370         (CheckAttributeTarget): New method to check if the attribute target
22371         is valid.
22372         (attribute_section): Implement.
22373         (opt_attributes): Implement.
22374
22375         * attribute.cs : New file to handle attributes.
22376         (Attribute): Class to hold attribute info.
22377
22378         * cs-parser.jay (opt_attribute_target_specifier): Remove production
22379         (attribute_section): Modify production to use 2 different rules to 
22380         achieve the same thing. 1 s/r conflict down !
22381         Clean out commented, useless, non-reducing dimension_separator rules.
22382
22383         * class.cs (TypeContainer.attributes): New member to hold list
22384         of attributes for a type.
22385         (Struct::Struct): Modify to take one more argument, the attribute list.
22386         (Class::Class): Ditto.
22387         (Field::Field): Ditto.
22388         (Method::Method): Ditto.
22389         (Property::Property): Ditto.
22390
22391         * cs-parser.jay (struct_declaration): Update constructor call to
22392         pass in the attributes too.
22393         (class_declaration): Ditto.
22394         (constant_declaration): Ditto.
22395         (field_declaration): Ditto.
22396         (method_header): Ditto.
22397         (fixed_parameter): Ditto.
22398         (parameter_array): Ditto.
22399         (property_declaration): Ditto.
22400
22401         * constant.cs (Constant::Constant): Update constructor similarly.
22402         Use System.Collections.
22403
22404         * parameter.cs (Parameter::Parameter): Update as above.
22405
22406 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22407
22408         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
22409         (TypeContainer.delegates): New member to hold list of delegates.
22410
22411         * cs-parser.jay (delegate_declaration): Implement the action correctly 
22412         this time as I seem to be on crack ;-)
22413
22414 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
22415
22416         * rootcontext.cs (RootContext::IsNamespace): new function, used to
22417         tell whether an identifier represents a namespace.
22418
22419         * expression.cs (NamespaceExpr): A namespace expression, used only
22420         temporarly during expression resolution.
22421         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
22422         utility functions to resolve names on expressions.
22423
22424 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
22425
22426         * codegen.cs: Add hook for StatementExpressions. 
22427
22428         * class.cs: Fix inverted test for static flag in methods.
22429
22430 2001-09-02  Ravi Pratap  <ravi@ximian.com>
22431
22432         * class.cs (Operator::CheckUnaryOperator): Correct error number used
22433         to make it coincide with MS' number.
22434         (Operator::CheckBinaryOperator): Ditto.
22435
22436         * ../errors/errors.txt : Remove error numbers added earlier.
22437
22438         * ../errors/cs1019.cs : Test case for error # 1019
22439
22440         * ../errros/cs1020.cs : Test case for error # 1020
22441
22442         * cs-parser.jay : Clean out commented cruft.
22443         (dimension_separators, dimension_separator): Comment out. Ostensibly not
22444         used anywhere - non-reducing rule.
22445         (namespace_declarations): Non-reducing rule - comment out.
22446
22447         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
22448         with TypeContainer::AddEnum.
22449
22450         * delegate.cs : New file for delegate handling classes.
22451         (Delegate): Class for declaring delegates.
22452
22453         * makefile : Update.
22454
22455         * cs-parser.jay (delegate_declaration): Implement.
22456
22457 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
22458
22459         * class.cs (Event::Define): Implement.
22460         (Event.EventBuilder): New member.
22461
22462         * class.cs (TypeContainer::Populate): Update to define all enums and events
22463         we have.
22464         (Events): New property for the events arraylist we hold. Shouldn't we move to using
22465         readonly fields for all these cases ?
22466
22467 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22468
22469         * class.cs (Property): Revamp to use the convention of making fields readonly.
22470         Accordingly modify code elsewhere.
22471
22472         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
22473         the Define method of the Property class.
22474
22475         * class.cs : Clean up applied patch and update references to variables etc. Fix 
22476         trivial bug.
22477         (TypeContainer::Populate): Update to define all the properties we have. Also
22478         define all enumerations.
22479
22480         * enum.cs (Define): Implement.
22481
22482 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
22483
22484         * cs-parser.jay (overloadable_operator): The semantic value is an
22485         enum of the Operator class.
22486         (operator_declarator): Implement actions.
22487         (operator_declaration): Implement.
22488
22489         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
22490         validity of definitions.
22491         (Operator::CheckBinaryOperator): Static method to check for binary operators
22492         (TypeContainer::AddOperator): New method to add an operator to a type.
22493
22494         * cs-parser.jay (indexer_declaration): Added line to actually call the
22495         AddIndexer method so it gets added ;-)
22496
22497         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
22498         already taken care of by the MS compiler ?  
22499
22500 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22501
22502         * class.cs (Operator): New class for operator declarations.
22503         (Operator::OpType): Enum for the various operators.
22504
22505 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
22506
22507         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
22508         ostensibly handle this in semantic analysis.
22509
22510         * cs-parser.jay (general_catch_clause): Comment out
22511         (specific_catch_clauses, specific_catch_clause): Ditto.
22512         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
22513         (catch_args, opt_catch_args): New productions.
22514         (catch_clause): Rewrite to use the new productions above
22515         (catch_clauses): Modify accordingly.
22516         (opt_catch_clauses): New production to use in try_statement
22517         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
22518         and re-write the code in the actions to extract the specific and
22519         general catch clauses by being a little smart ;-)
22520
22521         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
22522         Hooray, try and catch statements parse fine !
22523
22524 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22525
22526         * statement.cs (Block::GetVariableType): Fix logic to extract the type
22527         string from the hashtable of variables.
22528
22529         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
22530         I end up making that mistake ;-)
22531         (catch_clauses): Fixed gross error which made Key and Value of the 
22532         DictionaryEntry the same : $1 !!
22533
22534 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22535
22536         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
22537
22538         * cs-parser.jay (event_declaration): Correct to remove the semicolon
22539         when the add and remove accessors are specified. 
22540
22541 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
22542
22543         * cs-parser.jay (IndexerDeclaration): New helper class to hold
22544         information about indexer_declarator.
22545         (indexer_declarator): Implement actions.
22546         (parsing_indexer): New local boolean used to keep track of whether
22547         we are parsing indexers or properties. This is necessary because 
22548         implicit_parameters come into picture even for the get accessor in the 
22549         case of an indexer.
22550         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
22551
22552         * class.cs (Indexer): New class for indexer declarations.
22553         (TypeContainer::AddIndexer): New method to add an indexer to a type.
22554         (TypeContainer::indexers): New member to hold list of indexers for the
22555         type.
22556
22557 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22558
22559         * cs-parser.jay (add_accessor_declaration): Implement action.
22560         (remove_accessor_declaration): Implement action.
22561         (event_accessors_declaration): Implement
22562         (variable_declarators): swap statements for first rule - trivial.
22563
22564         * class.cs (Event): New class to hold information about event
22565         declarations.
22566         (TypeContainer::AddEvent): New method to add an event to a type
22567         (TypeContainer::events): New member to hold list of events.
22568
22569         * cs-parser.jay (event_declaration): Implement actions.
22570
22571 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
22572
22573         * cs-parser.jay (dim_separators): Implement. Make it a string
22574         concatenating all the commas together, just as they appear.
22575         (opt_dim_separators): Modify accordingly
22576         (rank_specifiers): Update accordingly. Basically do the same
22577         thing - instead, collect the brackets here.
22578         (opt_rank_sepcifiers): Modify accordingly.
22579         (array_type): Modify to actually return the complete type string
22580         instead of ignoring the rank_specifiers.
22581         (expression_list): Implement to collect the expressions
22582         (variable_initializer): Implement. We make it a list of expressions
22583         essentially so that we can handle the array_initializer case neatly too.
22584         (variable_initializer_list): Implement.
22585         (array_initializer): Make it a list of variable_initializers
22586         (opt_array_initializer): Modify accordingly.
22587
22588         * expression.cs (New::NType): Add enumeration to help us
22589         keep track of whether we have an object/delegate creation
22590         or an array creation.
22591         (New:NewType, New::Rank, New::Indices, New::Initializers): New
22592         members to hold data about array creation.
22593         (New:New): Modify to update NewType
22594         (New:New): New Overloaded contructor for the array creation
22595         case.
22596
22597         * cs-parser.jay (array_creation_expression): Implement to call
22598         the overloaded New constructor.
22599
22600 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
22601
22602         * class.cs (TypeContainer::Constructors): Return member
22603         constructors instead of returning null.
22604
22605 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
22606
22607         * typemanager.cs (InitCoreTypes): Initialize the various core
22608         types after we have populated the type manager with the user
22609         defined types (this distinction will be important later while
22610         compiling corlib.dll)
22611
22612         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
22613         on Expression Classification.  Now all expressions have a method
22614         `Resolve' and a method `Emit'.
22615
22616         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
22617         generation from working.     Also add some temporary debugging
22618         code. 
22619
22620 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
22621
22622         * codegen.cs: Lots of code generation pieces.  This is only the
22623         beginning, will continue tomorrow with more touches of polish.  We
22624         handle the fundamentals of if, while, do, for, return.  Others are
22625         trickier and I need to start working on invocations soon.
22626
22627         * gen-treedump.cs: Bug fix, use s.Increment here instead of
22628         s.InitStatement. 
22629
22630         * codegen.cs (EmitContext): New struct, used during code
22631         emission to keep a context.   Most of the code generation will be
22632         here. 
22633
22634         * cs-parser.jay: Add embedded blocks to the list of statements of
22635         this block.  So code generation proceeds in a top down fashion.
22636
22637 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
22638
22639         * statement.cs: Add support for multiple child blocks.
22640
22641 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
22642
22643         * codegen.cs (EmitCode): New function, will emit the code for a
22644         Block of code given a TypeContainer and its ILGenerator. 
22645
22646         * statement.cs (Block): Standard public readonly optimization.
22647         (Block::Block constructors): Link children. 
22648         (Block::Child): Child Linker.
22649         (Block::EmitVariables): Emits IL variable declarations.
22650
22651         * class.cs: Drop support for MethodGroups here, delay until
22652         Semantic Analysis.
22653         (Method::): Applied the same simplification that I did before, and
22654         move from Properties to public readonly fields.
22655         (Method::ParameterTypes): Returns the parameter types for the
22656         function, and implements a cache that will be useful later when I
22657         do error checking and the semantic analysis on the methods is
22658         performed.
22659         (Constructor::GetCallingConvention): Renamed from CallingConvetion
22660         and made a method, optional argument tells whether this is a class
22661         or a structure to apply the `has-this' bit.
22662         (Method::GetCallingConvention): Implement, returns the calling
22663         convention. 
22664         (Method::Define): Defines the type, a second pass is performed
22665         later to populate the methods.
22666
22667         (Constructor::ParameterTypes): implement a cache similar to the
22668         one on Method::ParameterTypes, useful later when we do semantic
22669         analysis. 
22670
22671         (TypeContainer::EmitMethod):  New method.  Emits methods.
22672
22673         * expression.cs: Removed MethodGroup class from here.
22674
22675         * parameter.cs (Parameters::GetCallingConvention): new method.
22676
22677 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
22678
22679         * class.cs (TypeContainer::Populate): Drop RootContext from the
22680         argument. 
22681
22682         (Constructor::CallingConvention): Returns the calling convention.
22683         (Constructor::ParameterTypes): Returns the constructor parameter
22684         types. 
22685
22686         (TypeContainer::AddConstructor): Keep track of default constructor
22687         and the default static constructor.
22688
22689         (Constructor::) Another class that starts using `public readonly'
22690         instead of properties. 
22691
22692         (Constructor::IsDefault): Whether this is a default constructor. 
22693
22694         (Field::) use readonly public fields instead of properties also.
22695
22696         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
22697         track of static constructors;  If none is used, turn on
22698         BeforeFieldInit in the TypeAttributes. 
22699
22700         * cs-parser.jay (opt_argument_list): now the return can be null
22701         for the cases where there are no arguments. 
22702
22703         (constructor_declarator): If there is no implicit `base' or
22704         `this', then invoke the default parent constructor. 
22705
22706         * modifiers.cs (MethodAttr): New static function maps a set of
22707         modifiers flags into a MethodAttributes enum
22708         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
22709         MethodAttr, TypeAttr to represent the various mappings where the
22710         modifiers are used.
22711         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
22712
22713 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
22714
22715         * parameter.cs (GetParameterInfo): Fix bug where there would be no
22716         method arguments.
22717
22718         * interface.cs (PopulateIndexer): Implemented the code generator
22719         for interface indexers.
22720
22721 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
22722
22723         * interface.cs (InterfaceMemberBase): Now we track the new status
22724         here.  
22725
22726         (PopulateProperty): Implement property population.  Woohoo!  Got
22727         Methods and Properties going today. 
22728
22729         Removed all the properties for interfaces, and replaced them with
22730         `public readonly' fields. 
22731
22732 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
22733
22734         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
22735         initialize their hashtables/arraylists only when they are needed
22736         instead of doing this always.
22737
22738         * parameter.cs: Handle refs and out parameters.
22739
22740         * cs-parser.jay: Use an ArrayList to construct the arguments
22741         instead of the ParameterCollection, and then cast that to a
22742         Parameter[] array.
22743
22744         * parameter.cs: Drop the use of ParameterCollection and use
22745         instead arrays of Parameters.
22746
22747         (GetParameterInfo): Use the Type, not the Name when resolving
22748         types. 
22749
22750 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
22751
22752         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
22753         and instead use public readonly fields.
22754
22755         * class.cs: Put back walking code for type containers.
22756
22757 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
22758
22759         * class.cs (MakeConstant): Code to define constants.
22760
22761         * rootcontext.cs (LookupType): New function.  Used to locate types 
22762
22763
22764 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
22765
22766         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
22767         this System.Reflection code is.  Kudos to Microsoft
22768
22769         * typemanager.cs: Implement a type cache and avoid loading all
22770         types at boot time.  Wrap in LookupType the internals.  This made
22771         the compiler so much faster.  Wow.  I rule!
22772
22773         * driver.cs: Make sure we always load mscorlib first (for
22774         debugging purposes, nothing really important).
22775
22776         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
22777         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
22778
22779         * rootcontext.cs: Lookup types on their namespace;  Lookup types
22780         on namespaces that have been imported using the `using' keyword.
22781
22782         * class.cs (TypeContainer::TypeAttr): Virtualize.
22783         (Class::TypeAttr): Return attributes suitable for this bad boy.
22784         (Struct::TypeAttr): ditto.
22785         Handle nested classes.
22786         (TypeContainer::) Remove all the type visiting code, it is now
22787         replaced with the rootcontext.cs code
22788
22789         * rootcontext.cs (GetClassBases): Added support for structs. 
22790
22791 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
22792
22793         * interface.cs, statement.cs, class.cs, parameter.cs,
22794         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
22795         Drop use of TypeRefs, and use strings instead.
22796
22797 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
22798
22799         * rootcontext.cs: 
22800
22801         * class.cs (Struct::Struct): set the SEALED flags after
22802         checking the modifiers.
22803         (TypeContainer::TypeAttr): new property, returns the
22804         TypeAttributes for a class.  
22805
22806         * cs-parser.jay (type_list): Oops, list production was creating a
22807         new list of base types.
22808
22809         * rootcontext.cs (StdLib): New property.
22810         (GetInterfaceTypeByName): returns an interface by type name, and
22811         encapsulates error handling here.
22812         (GetInterfaces): simplified.
22813         (ResolveTree): Encapsulated all the tree resolution here.
22814         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
22815         types. 
22816
22817         * driver.cs: Add support for --nostdlib, to avoid loading the
22818         default assemblies.
22819         (Main): Do not put tree resolution here. 
22820
22821         * rootcontext.cs: Beginning of the class resolution.
22822
22823 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
22824
22825         * rootcontext.cs: Provide better error reporting. 
22826
22827         * cs-parser.jay (interface_base): set our $$ to be interfaces.
22828
22829         * rootcontext.cs (CreateInterface): Handle the case where there
22830         are no parent interfaces.
22831
22832         (CloseTypes): Routine to flush types at the end.
22833         (CreateInterface): Track types.
22834         (GetInterfaces): Returns an array of Types from the list of
22835         defined interfaces.
22836
22837         * typemanager.c (AddUserType): Mechanism to track user types (puts
22838         the type on the global type hash, and allows us to close it at the
22839         end). 
22840
22841 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
22842
22843         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
22844         RecordInterface instead.
22845
22846         * cs-parser.jay: Updated to reflect changes above.
22847
22848         * decl.cs (Definition): Keep track of the TypeBuilder type that
22849         represents this type here.  Not sure we will use it in the long
22850         run, but wont hurt for now.
22851
22852         * driver.cs: Smaller changes to accomodate the new code.
22853
22854         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
22855         when done. 
22856
22857         * rootcontext.cs (CreateInterface):  New method, used to create
22858         the System.TypeBuilder type for interfaces.
22859         (ResolveInterfaces): new entry point to resolve the interface
22860         hierarchy. 
22861         (CodeGen): Property, used to keep track of the code generator.
22862
22863 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
22864
22865         * cs-parser.jay: Add a second production for delegate_declaration
22866         with `VOID'.
22867
22868         (enum_body): Put an opt_comma here instead of putting it on
22869         enum_body or enum_member_declarations so we can handle trailing
22870         commas on enumeration members.  Gets rid of a shift/reduce.
22871
22872         (type_list): Need a COMMA in the middle.
22873
22874         (indexer_declaration): Tell tokenizer to recognize get/set
22875
22876         * Remove old targets.
22877
22878         * Re-add the parser target.
22879
22880 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22881
22882         * cs-parser.jay: Add precendence rules for a number of operators
22883         ot reduce the number of shift/reduce conflicts in the grammar.
22884
22885 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
22886
22887         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
22888         and put it here.
22889
22890         Get rid of old crufty code.
22891
22892         * rootcontext.cs: Use this to keep track of the parsed
22893         representation and the defined types available to the program. 
22894
22895         * gen-treedump.cs: adjust for new convention.
22896
22897         * type.cs: Split out the type manager, and the assembly builder
22898         from here. 
22899
22900         * typemanager.cs: the type manager will live here now.
22901
22902         * cil-codegen.cs: And the code generator here. 
22903
22904 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
22905
22906         * makefile: Fixed up for easy making.
22907
22908 2001-07-13  Simon Cozens <simon@simon-cozens.org>
22909
22910         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
22911         the 
22912
22913         (unary_expression): Expand pre_increment_expression and
22914         post_decrement_expression to reduce a shift/reduce.
22915
22916 2001-07-11  Simon Cozens
22917
22918         * cs-tokenizer.cs: Hex numbers should begin with a 0.
22919
22920         Improve allow_keyword_as_indent name.
22921
22922 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
22923
22924         * Adjustments for Beta2. 
22925
22926 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
22927
22928         * decl.cs: Added `Define' abstract method.
22929         (InTransit): new property, used to catch recursive definitions. 
22930
22931         * interface.cs: Implement `Define'. 
22932
22933         * modifiers.cs: Map Modifiers.constants to
22934         System.Reflection.TypeAttribute flags.
22935
22936         * class.cs: Keep track of types and user-defined types.
22937         (BuilderInit): New method for creating an assembly
22938         (ResolveType): New function to launch the resolution process, only
22939         used by interfaces for now.
22940
22941         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
22942         that are inserted into the name space. 
22943
22944 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
22945
22946         * ARGH.  I have screwed up my tree so many times due to the use of
22947         rsync rather than using CVS.  Going to fix this at once. 
22948
22949         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
22950         load types.
22951
22952 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
22953
22954         * Experiment successful: Use System.Type rather that our own
22955         version of Type.  
22956
22957 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
22958
22959         * cs-parser.jay: Removed nsAliases from here.
22960
22961         Use new namespaces, handle `using XXX;' 
22962
22963         * namespace.cs: Reimplemented namespace handling, use a recursive
22964         definition of the class.  Now we can keep track of using clauses
22965         and catch invalid using clauses.
22966
22967 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
22968
22969         * gen-treedump.cs: Adapted for all the renaming.
22970
22971         * expression.cs (Expression): this class now has a Type property
22972         which returns an expression Type.
22973
22974         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
22975         `Type', as this has a different meaning now in the base
22976
22977 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
22978
22979         * interface.cs, class.cs: Removed from all the sources the
22980         references to signature computation, as we can not do method
22981         signature computation during the parsing time, as we are not
22982         trying to solve at that point distinguishing:
22983
22984         class X {
22985                 void a (Blah x) {}
22986                 void a (NS.Blah x) {}
22987         }
22988
22989         Which depending on the context might be valid or not, as we do not
22990         know if Blah is the same thing as NS.Blah at that point.
22991
22992         * Redid everything so the code uses TypeRefs now instead of
22993         Types.  TypeRefs are just temporary type placeholders, that need
22994         to be resolved.  They initially have a pointer to a string and the
22995         current scope in which they are used.  This is used later by the
22996         compiler to resolve the reference to an actual Type. 
22997
22998         * DeclSpace is no longer a CIR.Type, and neither are
22999         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23000         are all DeclSpaces, but no Types. 
23001
23002         * type.cs (TypeRefManager): This implements the TypeRef manager,
23003         which keeps track of all the types that need to be resolved after
23004         the parsing has finished. 
23005
23006 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23007
23008         * ARGH.  We are going to have to store `foreach' as a class rather
23009         than resolving it, as we need to verify error 1579 after name
23010         resolution.   *OR* we could keep a flag that says `This request to
23011         IEnumerator comes from a foreach statement' which we can then use
23012         to generate the error.
23013
23014 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23015
23016         * class.cs (TypeContainer.AddMethod): we now add methods to the
23017         MethodGroup instead of the method hashtable.  
23018
23019         * expression.cs: Add MethodGroup abstraction, which gets us one
23020         step closer to the specification in the way we handle method
23021         declarations.  
23022
23023         * cs-parser.jay (primary_expression): qualified_identifier now
23024         tried to match up an identifier to a local variable reference or
23025         to a parameter reference.
23026
23027         current_local_parameters is now a parser global variable that
23028         points to the current parameters for the block, used during name
23029         lookup.
23030
23031         (property_declaration): Now creates an implicit `value' argument to
23032         the set accessor.
23033
23034 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23035
23036         * parameter.cs: Do not use `param' arguments as part of the
23037         signature, per the spec.
23038
23039 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23040
23041         * decl.cs: Base class for classes, structs and interfaces.  This
23042         is the "Declaration Space" 
23043
23044         * cs-parser.jay: Use CheckDef for checking declaration errors
23045         instead of having one on each function.
23046
23047         * class.cs: Factor out some code for handling error handling in
23048         accordance to the "Declarations" section in the "Basic Concepts"
23049         chapter in the ECMA C# spec.
23050
23051         * interface.cs: Make all interface member classes derive from
23052         InterfaceMemberBase.
23053
23054 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23055
23056         * Many things: all interfaces are parsed and generated in
23057         gen-treedump.  Support for member variables, constructors,
23058         destructors, properties, constants is there.
23059
23060         Beginning of the IL backend, but very little done, just there for
23061         testing purposes. 
23062
23063 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23064
23065         * cs-parser.jay: Fix labeled statement.
23066
23067         * cs-tokenizer.cs (escape): Escape " and ' always.
23068         ref_line, ref_name: keep track of the line/filename as instructed
23069         by #line by the compiler.
23070         Parse #line.
23071
23072 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23073
23074         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23075         to match the values in System.CodeDOM.
23076
23077         Divid renamed to Divide.
23078
23079         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23080         statements. 
23081         (Statements.set): remove.
23082
23083         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23084         statements. 
23085
23086         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23087         falseStatements always have valid values. 
23088
23089         * cs-parser.jay: Use System.CodeDOM now.
23090