In mcs and gmcs:
[mono.git] / mcs / gmcs / ChangeLog
1 2006-07-28  Raja R Harinath  <rharinath@novell.com>
2
3         * class.cs (TypeContainer.AddMemberType): Rename from
4         AddToTypeContainer.
5         (TypeContainer.AddMember): Rename from AddToMemberContainer.
6         (AddTypeContainer): New.  Combine AddClassOrStruct and
7         AddInterface.
8         (AddPartial): Update.  Add 'is_partial' argument.
9         * roottypes.cs: Update to changes.
10         * cs-parser.jay (push_current_class): New helper for handling
11         current_container and current_class.
12         (struct_declaration, interface_declaration, class_declaration):
13         Use it.
14
15 2006-07-26  Raja R Harinath  <rharinath@novell.com>
16
17         * roottypes.cs: Rename from tree.cs.
18
19         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
20         * tree.cs (Tree, ITreeDump): Remove types.
21         * rootcontext.cs (tree, Tree): Remove fields.
22         (root, ToplevelTypes): New.
23         * *.cs: Update to rename.
24
25         * tree.cs (Tree.RecordDecl): Remove.
26         (RootTypes.AddToTypeContainer): Record the toplevel type in its
27         namespace here.
28         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
29
30 2006-07-23  Raja R Harinath  <harinath@gmail.com>
31
32         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
33         DoFlowAnalysis and OmitStructFlowAnalysis here.
34         (ec.With): Rename from WithUnsafe and generalize.
35         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
36         (ec.WithFlowAnalyis): New.
37         * ecore.cs, expression.cs, statement.cs: Update.
38
39 2006-07-22  Raja R Harinath  <harinath@gmail.com>
40
41         * statement.cs (Block.ResolveMeta): Simplify slightly.
42
43         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
44         multiple boolean fields.  Convert InUnsafe, constant_check_state,
45         check_state to flags.
46         (CheckState, ConstantCheckState): Update.
47         (InUnsafe): New read-only property.
48         (FlagsHandle): Rename from CheckStateHandle and convert to handle
49         arbitrary flags.
50         (WithUnsafe): New helper similar to WithCheckState.
51         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
52         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
53
54 2006-07-21  Raja R Harinath  <rharinath@novell.com>
55
56         Make comparisons use the same IL irrespective of whether they're
57         in a 'checked' or 'unchecked' context: one of the issues in #78899
58         * codegen.cs (EmitContext.CheckState): Make read-only property.
59         (EmitContext.ConstantCheckState): Likewise.
60         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
61         helper that implement a save/restore stack for CheckState
62         values.  This is the only way to change check-state.
63         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
64         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
65         (CheckedExpr.EmitBranchable): New forwarding method.
66         (UnCheckedExpr): Likewise.
67         * statement.cs (Block.ResolveMeta): Use WithCheckState.
68         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
69         (Checked.Resolve, checked.DoEmit): Likewise.
70
71 2006-07-21  Martin Baulig  <martin@ximian.com>
72
73         * generic.cs (TypeManager.InferType): When inferring an array
74         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
75
76 2006-07-21  Martin Baulig  <martin@ximian.com>
77
78         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
79         and allow IList`1 and all its base interfaces.
80
81         * convert.cs (Convert.ImplicitReferenceConversion): Allow
82         converting from an array-type of T to IList<T>.
83
84 2006-07-21  Martin Baulig  <martin@ximian.com>
85
86         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
87
88 2006-07-20  Miguel de Icaza  <miguel@novell.com>
89
90         * anonymous.cs: Cache the resolved anonymous delegate, and return
91         this so that the ResolveTopBlock is only triggered once, not
92         twice.
93
94         Currently we trigger ResolvetopBlock twice due to a first pass of
95         argument check compatibility, and a second pass that does the
96         actual resolution.   
97
98 2006-07-16  Marek Safar  <marek.safar@seznam.cz>
99
100         A fix for #70506
101         * driver.cs (MainDriver): When a file extension is missing,
102         use a default one.
103
104 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
105
106         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
107         modifiers.
108         * rootcontext.cs (Reset): Add helper_classes.
109
110 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
111
112         A fix for #78860
113         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
114         correctly.
115
116 2006-07-13  Miguel de Icaza  <miguel@novell.com>
117
118         * statement.cs (Lock): Handle expressions of type
119         TypeManager.null_type specially.  Fixes #78770
120
121 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
122
123         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
124         to an event.
125
126 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
127
128         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
129         for accessors as well.
130         * ecore.cs (EventExpr): Add AccessorTable.
131
132 2006-07-03  Martin Baulig  <martin@ximian.com>
133
134         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
135         instances of value types.
136
137         * convert.cs (Convert.ExplicitConversion): Correctly handle
138         object->nullable conversions.   
139
140 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
141
142         A fix for #78738
143         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
144         for CS0122 where appropriate.
145         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
146         level attributes.
147         (Filter): Assembly can be null in the case of top level attributes.
148
149 2006-06-28  Raja R Harinath  <rharinath@novell.com>
150
151         Fix #78716
152         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
153         no arguments, return 'false': nothing can be inferred.
154
155 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
156
157         A fix for #78690
158
159         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
160         is done at global level.
161
162 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
163
164         A fix for #77002, Implemented TypeForwarder support.
165
166         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
167         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
168         attribute handling.
169         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
170         * typemanager.cs (): Add type_forwarder_attr_type.
171
172 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
173
174         * report.cs: Add CS0469 warning.
175
176 2006-06-22  Martin Baulig  <martin@ximian.com>
177
178         * class.cs
179         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
180         for interfaces; fixes #78686, which is a modification of #78380
181         with interfaces instead of classes.
182
183 2006-06-21  Martin Baulig  <martin@ximian.com>
184
185         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
186         the `try'-block, so we also report CS0016 etc. there.
187
188 2006-06-21  Martin Baulig  <martin@ximian.com>
189
190         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
191         handle SetAssigned() and SetMemberIsUsed() for generic types;
192         fixes #77545.
193
194 2006-06-21  Martin Baulig  <martin@ximian.com>
195
196         * delegate.cs
197         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
198
199 2006-06-21  Martin Baulig  <martin@ximian.com>
200
201         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
202         also report CS1686 for parameters.
203
204 2006-06-21  Martin Baulig  <martin@ximian.com>
205
206         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
207         instead of an error if the value is not implicitly convertible to
208         the switch types; fixes #77964.
209
210 2006-06-21  Raja R Harinath  <rharinath@novell.com>
211
212         Fix #78673
213         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
214         FieldBuilder is null.
215
216         Fix #78662
217         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
218         'left' and 'right' before error-checking.
219
220 2006-06-19  Martin Baulig  <martin@ximian.com>
221
222         * convert.cs
223         (Convert.ImplicitConversionStandard): Cleanup and correctly
224         implement nullable conversions.
225         (Convert.ImplicitStandardConversionExists): Likewise.
226         (Convert.ExplicitConversion): Likewise.
227
228 2006-06-19  Martin Baulig  <martin@ximian.com>
229
230         * generic.cs
231         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
232         methods; make the ctors protected.
233
234 2006-06-19  Martin Baulig  <martin@ximian.com>
235
236         Fixed #78380; added gtest-273.cs.
237
238         * ecore.cs
239         (Expression.ResolveAsBaseTerminal): Move the constraint checking
240         into ResolveAsTypeTerminal().
241
242         * generic.cs
243         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
244         TypeManager.FindMembers() to check for the default ctor.
245
246 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
247
248         * generic.cs: Fixed NullableInfo accessibility.
249
250 2006-06-16  Martin Baulig  <martin@ximian.com>
251
252         * generic.cs
253         (Constraints.InflatedConstraints.inflate): Correctly inflate
254         generic types; fixes #78400.
255
256 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
257
258         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
259         Fixed bug #78601.
260         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
261         (FieldExpr.DoResolve): likewise.
262         (PropertyExpr.InstanceResolve): likewise.
263         (EventExpr.InstanceResolve): likewise. 
264
265 2006-06-15  Martin Baulig  <martin@ximian.com>
266
267         * statement.cs
268         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
269         argument; always allow a `null' label if true.
270         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
271         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
272         we have a `null' label and mark the new `null_target' label;
273         default to the `default' label.
274         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
275
276 2006-06-15  Martin Baulig  <martin@ximian.com>
277
278         * class.cs (Operator.Define): Allow an implicit/explicit operator
279         to convert to/from a nullable value of the enclosing type.
280
281         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
282         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
283
284         * convert.cs
285         (Convert.ImplicitStandardConversionExists): Add support for lifted
286         implicit/explicit conversions.
287         (Convert.ImplicitConversionStandard): Likewise.
288
289 2006-06-13  Martin Baulig  <martin@ximian.com>
290
291         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
292         type arguments and create a ConstructedType if necessary.  Fixes #78400.
293
294 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
295
296         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
297         attribute applicable tests for attribute argument.
298
299 2006-06-02  Raja R Harinath  <rharinath@novell.com>
300
301         Fix #78079
302         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
303         (Binary.OverloadResolve_PredefinedIntegral): New.
304         (Binary.OverloadResolve_PredefinedFloating): New.
305         (Binary.OverloadResolve_PredefinedString): New.
306         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
307         Follow the standard more closely, and treat numeric promotions in
308         terms of overload resolution.
309         (Binary.CheckShiftArguments): Simplify.
310
311 2006-06-01  Raja R Harinath  <rharinath@novell.com>
312
313         * flowanalysis.cs (MyBitVector): Simplify representation.
314         (MyBitVector.Clone): Avoid allocating BitArray.
315         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
316         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
317         (*): Update.  Change all references to MyBitVector.And and
318         MyBitVector.Or to &= and |=.
319
320 2006-05-31  Raja R Harinath  <rharinath@novell.com>
321
322         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
323         Use bne.un instead of ceq+brfalse.
324
325         Fix cs0208-[23].cs
326         * typemanager.cs (IsUnmanagedType): Disallow generic types and
327         generic parameters.
328
329 2006-05-29  Raja R Harinath  <rharinath@novell.com>
330
331         Fix cs0231-[34].cs.
332         * cs-parser.jay (formal_parameter_list): Extend the pattern below
333         to param arguments too.
334
335 2006-05-26  Miguel de Icaza  <miguel@novell.com>
336
337         * cs-parser.jay: Catch another parsing form for arglist being
338         followed by other arguments.  Fixes #78313.
339
340 2006-05-25  Raja R Harinath  <rharinath@novell.com>
341
342         Fix #78324
343         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
344         also when one of the operands is a null literal.
345         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
346         to improve clarity, and generate slightly better code.
347
348 2006-05-24  Raja R Harinath  <rharinath@novell.com>
349
350         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
351         checking of out parameters to ...
352         (FlowBranchingToplevel.Merge): ... here.
353         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
354         set, propagate the origin upward, and only complain if there was
355         no other error.
356         (FlowBranchingException.AddContinueOrigin): Likewise.
357         (FlowBranchingException.AddReturnOrigin): Likewise.
358         (FlowBranchingException.AddGotoOrigin): Likewise.       
359
360 2006-05-23  Raja R Harinath  <rharinath@novell.com>
361
362         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
363         unreachable, skip it.
364         (FlowBranchingException.Merge): Always propagate jumps, even if
365         the finally block renders subsequent code unreachable.
366
367 2006-05-18  Raja R Harinath  <rharinath@novell.com>
368
369         Fix #77601
370         * statement.cs (Goto.Resolve): Move responsibility for resolving
371         'goto' to FlowBranching.AddGotoOrigin.
372         (Goto.SetResolvedTarget): New.  Callback to set the
373         LabeledStatement that's the target of the goto.
374         (Goto.DoEmit): Use Leave instead of Br when crossing an
375         unwind-protect boundary.
376         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
377         LookupLabel and adjust to new semantics.
378         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
379         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
380         Goto.SetResolvedTarget to update target.
381         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
382         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
383         AddBreakOrigin & co.  Delay propagation until ...
384         (FlowBranchingException.Merge): ... this.
385
386         * statement.cs (Block.Resolve): Always depend on flow-branching to
387         determine unreachability.  Kill workaround that originally emitted
388         only one statement after an "unreachable" label (see infloop in
389         test-515.cs).
390
391         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
392         This is still "wrong", but anything better would probably need a
393         multi-pass algorithm.
394         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
395         usage vector.  Force current usage vector to be reachable, to
396         optimistically signify backward jumps.
397         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
398         detected.
399         (FlowBranchingLabeled.Merge): New.  If no backward jump was
400         detected, return the original salted-away usage vector instead,
401         updated with appropriate changes.  Print unreachable warning if
402         necessary.
403         * statement.cs (Block.Resolve): Don't print unreachable warning on
404         a labeled statement.
405
406 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
407
408         * driver.cs: Pass filename without path to AssemblyBuilder's
409         AddResourceFile. Fixes bug #78407.
410
411 2006-05-17  Raja R Harinath  <rharinath@novell.com>
412
413         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
414         * flowanalysis.cs (FlowBranchingLabeled): ... here.
415         (FlowBranching.MergeChild): Overwrite
416         reachability information from Labeled branchings too.
417
418 2006-05-16  Raja R Harinath  <rharinath@novell.com>
419
420         * statement.cs (Goto.Resolve): Merge jump origins here ...
421         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
422
423         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
424         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
425         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
426         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
427         here, ...
428         * statement.cs (Goto.Resolve): ... not here.
429         (Goto.Emit): Remove CS1632 check.
430
431 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
432
433         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
434         error message.
435
436 2006-05-11  Raja R Harinath  <rharinath@novell.com>
437
438         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
439         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
440         (FlowBranchingException.Label): Likewise.
441
442         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
443         given value.
444         (MyBitVector.Or): Use it to avoid losing information (Count).
445         (FlowBranching.MergeOrigins): Likewise.
446
447         * flowanalysis.cs (UsageVector.IsDirty): Remove.
448         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
449         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
450         (UsageVector.ToString): Simplify.
451         (UsageVector.MergeSiblings): Move here from ...
452         (FlowBranching.Merge): ... here.
453         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
454         not a MyBitVector.
455
456 2006-05-10  Raja R Harinath  <rharinath@novell.com>
457
458         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
459         null bitvector is treated as all-true.
460
461         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
462         (MyBitVector): Rationalize invariants.  'vector != null' implies
463         that we have our own copy of the bitvector.  Otherwise,
464         'InheritsFrom == null' implies all inherited bits are true.
465
466 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
467
468         * statement.cs (LocalInfo): Add IsConstant.
469         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
470         local variable for constants.
471
472 2006-05-09  Raja R Harinath  <rharinath@novell.com>
473
474         * flowanalysis.cs (MyBitVector.Empty): New.
475         (MyBitVector): Don't allow InheritedFrom to be null.
476         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
477         (UsageVector, FlowBranching): Update to changes.
478
479         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
480         recursion.  The 'Parent == null' condition isn't sufficient for
481         anonymous methods.
482         (FlowBranching.AddBreakOrigin): Likewise.
483         (FlowBranching.AddContinueOrigin): Likewise.
484         (FlowBranching.AddReturnOrigin): Likewise.
485         (FlowBranching.StealFinallyClauses): Likewise.
486         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
487         (FlowBranching.CheckOutParameters): Likewise.
488         (FlowBranchingToplevel): Terminate all the above recursions here.
489         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
490         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
491
492         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
493         toplevel block.
494         (FlowBranchingToplevel): New.  Empty for now.
495         (FlowBranching.MergeTopBlock): Update.
496         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
497         branching for the anonymous delegate.
498         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
499
500         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
501         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
502         information at the start of the merge.  Reorganize.
503
504 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
505
506         * class.cs (MethodData.Define): Method cannot implement interface accessor.
507
508 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
509
510         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
511         to newly introduced ctor.
512
513         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
514         message to one place.
515         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
516         global namespace.
517
518 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
519
520         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
521
522         * ecore.cs (Expression.ResolveAsConstant): Updated.
523
524         * statement.cs (ResolveMeta): Updated.
525
526 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
527
528         * cs-parser.jay: __arglist cannot be used in initializer.
529
530 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
531
532         A fix for #77879
533         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
534         private types.
535
536 2006-05-05  Raja R Harinath  <rharinath@novell.com>
537
538         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
539         (LabeledStatement): Add 'name' parameter.
540         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
541         (Block.AddLabel): Update to changes.
542         * cs-parser.jay (labeled_statement): Likewise.
543
544         * flowanalysis.cs (BranchingType.Labeled): New.
545         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
546         (FlowBranchingLabeled): New.  Does nothing for now, but will
547         eventually handle 'goto' flows.
548         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
549         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
550         that's terminated ...
551         (Block.Resolve): ... here.
552
553         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
554         (UsageVector.MergeFinallyOrigins): Likewise.
555         (FlowBranching.InTryOrCatch): Likewise.
556         (FlowBranching.AddFinallyVector): Likewise.
557         (FlowBranchingException): Update to changes.
558
559         Fix #78290
560         * statement.cs (Return.Resolve): Move error checking to ...
561         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
562         (FlowBranchingException): Handle return origins like break and
563         continue origins.
564         (FlowBranching.UsageVector.CheckOutParameters): Remove.
565
566 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
567
568         A fix for #76122
569         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
570         filter.
571
572 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
573
574         A fix for #77543
575         * class.cs (MethodData.Define): Do public accessor check only when method
576         implements an interface.
577
578 2006-05-04  Raja R Harinath  <rharinath@novell.com>
579
580         Remove special handling of 'break'
581         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
582         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
583         (UsageVector.Break): Remove.
584         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
585         reachability.
586         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
587
588         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
589         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
590
591 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
592
593         A fix for #75726
594         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
595         be the interface member.
596
597 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
598
599         A fix for #60069
600         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
601         for emitting small (int) values.
602
603 2006-05-03  Raja R Harinath  <rharinath@novell.com>
604
605         Fix #59427
606         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
607         control-flow passes through the 'finally' after merging-in all the
608         control-flows from 'try' and the 'catch' clauses.
609
610         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
611         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
612         always true at the only non-recursive entry point.
613         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
614         FlowBranchingBreakable.
615         (FlowBranchingLoop): Remove.
616         * statement.cs (Return.DoResolve): Update to changes.
617
618         Fix #76471, #76665
619         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
620         (FlowBranching.CreateBranching): Handle it: create a
621         FlowBranchingContinuable.
622         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
623         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
624         except that it handles the 'continue' command.
625         (FlowBranching.UsageVector.MergeOrigins): Rename from
626         MergeBreakOrigins.
627         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
628         except that it overrides AddContinueOrigin.
629         (FlowBranchingException): Override AddContinueOrigin, similar to
630         AddBreakOrigin.
631         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
632         Create a new branching around the embedded statement.
633         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
634         control flow after the embedded statement.
635         (Continue.Resolve): Move all error checking to AddContinueOrigin.
636
637         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
638         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
639         FlowBranchingBreakable.
640         (FlowBranchingSwitch): Remove.
641
642         Fix test-503.cs
643         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
644         error reporting to ...
645         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
646         Rename from 'AddBreakVector'.  Add new location argument.  Return
647         a bool indicating whether the 'break' crosses an unwind-protect.
648         (FlowBranchingException.AddBreakOrigin): Add.
649         (FlowBranchingException.Merge): Propagate 'break's to surrounding
650         flowbranching after updating with the effects of the 'finally'
651         clause.
652         (FlowBranchingBreakable): New common base class for
653         FlowBranchingLoop and FlowBranchingSwitch.
654
655         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
656         embedded statement.
657         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
658
659 2006-05-02  Raja R Harinath  <rharinath@novell.com>
660
661         * statement.cs (Do.Resolve): If the loop is infinite, set the
662         barrier.
663         (While.Resolve, For.Resolve): Set a barrier after the embedded
664         statement.  There's no direct control flow that goes from the end
665         of the embedded statement to the end of the loop.
666         * flowanalysis.cs (FlowBranching.Infinite): Remove.
667         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
668         above ensure that the reachability is correctly computed.
669
670         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
671         (UsageVector.MergeBreakOrigins): If the current path is
672         unreachable, treat it as if all parameters/locals are initialized.
673         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
674         infinite loops before merging-in break origins.
675
676         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
677         (Reachability.Reachable): Split part into ...
678         (Reachability.Unreachable): ... this.  Simplify.
679         (Reachability.IsUnreachable): Use 'Unreachable' instead.
680
681         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
682         (Reachability.SetThrowsSometimes): Likewise.
683         (FlowBranchingBlock.MergeTopBlock): Don't compare against
684         TriState.Always, use corresponding property.
685         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
686         (Block.Resolve): Likewise.  Remove some redundant checks.
687
688 2006-05-02  Raja R Harinath  <harinath@gmail.com>
689
690         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
691         (Reachability.Meet): Don't bother checking AlwaysThrows --
692         barrier is always set.
693         (FlowBranchingBlock.Merge): Likewise.
694
695 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
696
697         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
698         defined, so it's references should also compile only for NET_2_0
699         (as occurs in mcs version)
700
701 2006-05-01  Raja R Harinath  <harinath@gmail.com>
702
703         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
704         checks for unreachable.
705
706 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
707
708         A fix for #77980
709         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
710
711         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
712         whether field is really assigned.
713
714 2006-04-30  Raja R Harinath  <harinath@gmail.com>
715
716         * flowanalysis.cs (Reachability): Make 4-argument constructor
717         private.
718         (Reachability.Meet): Rename from 'And'.  Remove static variant.
719         (Reachability.Always): Rename from the highly misleading
720         'Reachability.Never'.
721         (FlowBranching.Merge): Update to changes.  Mark an impossible
722         situation with a 'throw'.
723         (*): Update to changes.
724
725 2006-04-29  Raja R Harinath  <harinath@gmail.com>
726
727         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
728         Remove 'Undefined'.
729         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
730         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
731         (*): Update to changes.
732         * statement.cs: Update to changes.
733
734 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
735
736         A fix for #78049
737         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
738
739 2006-04-28  Raja R Harinath  <harinath@gmail.com>
740
741         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
742         dummy UsageVector.
743
744         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
745         argument to two arguments: an usage-vector and a bool.  Move call
746         to FlowBranching.Merge () ...
747         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
748
749         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
750         handling of loop and switch reachability to ...
751         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
752
753 2006-04-27  Raja R Harinath  <harinath@gmail.com>
754
755         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
756         handling to FlowBranchingLoop.InLoop.
757         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
758
759 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
760
761         A fix for #78115
762         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
763         anonymous method is allowed from AnonymousContainer here.
764
765         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
766
767 2006-04-24  Raja R Harinath  <rharinath@novell.com>
768
769         Fix #78156
770         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
771
772 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
773
774         A fix for #49011.
775         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
776         (DoubleConstant.Reduce): Ditto.
777
778 2006-04-23  Raja R Harinath  <rharinath@novell.com>
779
780         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
781         Remove 'lvalue_right_side' argument.  Move parts to ...
782         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
783         (LocalVariable.DoResolveLValue): ... these.
784
785 2006-04-21  Raja R Harinath  <rharinath@novell.com>
786
787         Fix cs1655.cs
788         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
789         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
790         (LocalVariableReference.DoResolveBase): Use it to implement new
791         CS1655 check.
792         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
793         (Argument.Resolve): Simplify.  Move CS1510 check ...
794         * ecore.cs (Expression.ResolveLValue): ... here.
795         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
796         (PropertyExpr.DoResolveLValue): Likewise.
797         (FieldExpr.Report_AssignToReadonly): Likewise.
798         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
799         LValueMemberAccess or LValueMemberOutAccess on instance depending
800         on it.
801         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
802         DoResolve as appropriate.
803
804 2006-04-20  Raja R Harinath  <rharinath@novell.com>
805
806         Fix #75800
807         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
808         implicit conversions on 'out' and 'ref' arguments.
809
810         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
811         improve clarity.  Remove dead code.
812
813         Fix #66031
814         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
815         (Catch.Resolve): Resolve VarBlock if it exists.
816
817 2006-04-19  Miguel de Icaza  <miguel@novell.com>
818
819         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
820         twice, this was some residual code, the enumerator was emitted
821         properly in the two branche of if later.
822
823         Fixes #78031
824         
825         Thanks to Martin for finding the source of the problem
826         
827 2006-04-19  Raja R Harinath  <rharinath@novell.com>
828
829         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
830         cast is never an lvalue.
831         (Cast.DoResolve, Cast.ResolveRest): Combine.
832         (Argument.Emit): Simplify slightly.  Move 'Expr is
833         IMemoryLocation' check ...
834         (Argument.Resolve): ... here.
835         (Argument.Error_LValueRequired): Remove.  Inline into only user.
836
837         Simplifications.  Fix cs0191-2.cs
838         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
839         CS1649 and CS1651 to ...
840         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
841         the actual selection of the error code and message to a lookup
842         table.  Add a dummy return value to simplify callsites.
843         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
844         readonly fields of other instances of the same type.  Move CS0197
845         warning from ...
846         * expression.cs (Argument.Resolve): ... here.  Simplify code.
847         Ensure that ec.InRefOutArgumentResolving is only set during LValue
848         resolution of an out or ref argument.  The code simplification
849         above uses this invariant.
850
851 2006-04-18  Raja R Harinath  <rharinath@novell.com>
852
853         Possibly fix #77752.  Fix cs1690-[4-7].cs.
854         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
855         CheckMarshallByRefAccess.  Drop parameter.
856         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
857         warning.
858         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
859         InstanceExpression.
860         * report.cs (AllWarnings): Add CS1690.
861         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
862         for ref access too.
863         (LocalVariableReference.DoResolveBase): Update.
864
865 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
866
867         * class.cs (MethodOrOperator): Moved common parts from method class.
868         detect obsolete attributes.
869         (Method.Define): Simplified as it reuses code from base.
870         (Constructor.ValidAttributeTargets): Fixed issue found during
871         refactoring.
872         (Destructor.ValidAttributeTargets): Fixed issue found during
873         refactoring.
874         (Operator): Finished refactoring set off by #78020. Operator class is now
875         ordinary method class.
876
877         * anonymous.cs: Updated.
878
879 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
880
881         * class.cs (Constructor.Emit): Don't emit the attributes twice.
882
883 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
884
885         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
886         detect obsolete attributes.
887         (Method.CreateEmitContext): Moved to MethodOrOperator.
888
889 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
890
891         A fix for #78048.
892         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
893         customized exception to make crash detection easier.
894         (MethodOrOperator): Started to work on new base class for methods and
895         operators.
896         (Method): Derives from MethodOrOperator.
897         (Constructor.Emit): Emits its own attributes.
898         (AbstractPropertyEventMethod.Emit): Ditto.
899         (Operator): Derives from MethodOrOperator, will refactor fully in extra
900         patch.
901         (Operator.Emit): It's temporary more tricky than should be.
902         
903         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
904
905         * report.cs (InternalErrorException): Add ctor with inner exception.
906
907 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
908
909         A fix for #76744.
910         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
911         only not visible.
912
913 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
914
915         A fix for #77916.
916         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
917         array.
918
919 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
920
921         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
922         attribute is present and Guid not.
923         (Interface.ApplyAttributeBuilder): Ditto.
924
925         * attribute.cs: Add error message.
926
927 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
928
929         A fix for #78020.
930
931         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
932         sources (it's composite) so hold them in extra array as they are used in
933         Emit phase only. It worked in the previous versions by mistake.
934         (Attribute.Emit): Emit attribute for more owners when exist.
935
936         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
937         it has now different behaviour.
938
939 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
940
941         * constant.cs (Constant.IsDefaultInitializer): New method.
942
943         * class.cs: Updated.
944
945         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
946         re-initialize default values. It saves KBs almost for every assembly.
947         Thanks Zoltan for the idea.
948         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
949         (ArrayCreation.DoResolve): Resolve only once.
950         (ArrayCreation.Emit): Emit static initializer only when it is faster.
951         (ArrayCreation.GetAttributableValue): Cope with optimized values.
952
953 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
954
955         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
956         From #77961.
957
958 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
959
960         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
961         in an embedded statement too.
962
963 2006-04-01  Raja R Harinath  <rharinath@novell.com>
964
965         Fix #77929
966         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
967         testing.
968
969         Fix #77958
970         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
971
972         Fix #77962
973         * report.cs (SymbolRelatedToPreviousError): Drop generic type
974         arguments before checking whether a type is reflected or not.
975
976         Fix #77954
977         * expression.cs (Invocation.IsApplicable): Ensure a generic method
978         definition doesn't take part in overload resolution.
979         (Invocation.IsParamsMethodApplicable): Likewise.
980         (Invocation.OverloadResolve): When replacing a reflected override
981         method with its base definition, ensure that type arguments are
982         applied.
983
984 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
985
986         A fix for #77966.
987
988         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
989         was not specified.
990
991         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
992
993 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
994
995         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
996         phase.
997
998         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
999         LocalTemporary change.
1000
1001         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1002         TypeContainer.
1003         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1004         initializers optimization.
1005         (ClassOrStruct.TypeAttr): Moved from modifiers.
1006         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1007         (FieldBase.ResolveInitializer): Resolves initializer.
1008         (FieldBase.HasDefaultInitializer): New property.
1009
1010         * cs-parser.jay: Removed message.
1011
1012         * expression.cs (CompilerGeneratedThis): New specialization.
1013
1014         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1015
1016 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1017
1018         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1019
1020 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1021
1022         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1023         be now EnumConstants only.
1024
1025 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1026
1027         * attribute.cs, driver.cs: Reset more caches.
1028
1029 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1030
1031         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1032
1033 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1034
1035         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1036         for easier reuse. Updated all overrides.
1037         (IntegralConstant): New base class for all integral constants.
1038         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1039         of the constant range, report custom error.
1040         (UIntConstant.Reduce): Fixed uint conversion.
1041
1042         * ecore.cs, literal.cs: Reduce updates.
1043
1044 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1045
1046         A fix for #75813.
1047
1048         * class.cs (Constructor.Define): Removed extra if for default ctors.
1049         A patch from Atsushi Enomoto.
1050
1051 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1052
1053         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1054         GetAttributableValue.
1055
1056         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1057         when required.
1058
1059         * convert.cs (ImplicitConversionRequired): Error message moved to
1060         DoubleLiteral.
1061
1062         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1063         automatic implicit conversion of an output value.
1064         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1065
1066         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1067         conversion.
1068         (TypeOf.GetAttributableValue): Add extra handling for object type.
1069
1070         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1071         special error message.
1072
1073 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1074
1075         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1076         InternalCall.
1077         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1078         compatible with MS runtime.
1079
1080 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1081
1082         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1083         attribute arguments here.
1084
1085         * class.cs (Indexer.Define): The check was moved to attribute class.
1086
1087 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1088
1089         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1090
1091 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1092
1093         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1094
1095         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1096         the blocks too.
1097
1098 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1099
1100         * doc-bootstrap.cs : fix build.
1101
1102 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1103
1104         * expression.cs (StringConcat.Append): Issue a warning when empty string
1105         is going to append.
1106
1107 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1108
1109         * assign.cs (CompoundAssign.ResolveSource): Removed.
1110
1111         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1112         clean up.
1113
1114         * class.cs (TypeContainer.FindMethods): Removed.
1115         (TypeContainer.CheckMemberUsage): Made static.
1116
1117         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1118
1119         * constant.cs (CheckRange): Removed unused type argument.
1120         (CheckUnsigned): Removed unused type argument.
1121
1122         * cs-parser.jay: Updated after MemberAccess clean up.
1123         Uses Length for empty string test.
1124
1125         * cs-tokenizer.cs: Uses Length for empty string test.
1126         (IsCastToken): Made static.
1127         (is_hex): Made static.
1128         (real_type_suffix): Made static.
1129
1130         * decl.cs (SetupCache): Made static.
1131         (OnGenerateDocComment): Removed unused ds argument.
1132
1133         * delegate.cs (VerifyDelegate): Removed unused argument.
1134
1135         * doc.cs: Uses Length for empty string test.
1136
1137         * driver.cs: Uses Length for empty string test.
1138
1139         * enum.cs (IsValidEnumType): Made static
1140
1141         * expression.cs (EnumLiftUp): Removed unused argument.
1142         (ResolveMethodGroup): Ditto.
1143         (BetterConversion): Ditto.
1144         (GetVarargsTypes): Ditto.
1145         (UpdateIndices): Ditto.
1146         (ValidateInitializers): Ditto.
1147         (MemberAccess.ctor): Ditto.
1148         (GetIndexersForType): Ditto.
1149
1150         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1151
1152         * iterators.cs: Updated after MemberAccess clean up.
1153
1154         * location.cs: Uses Length for empty string test.
1155
1156         * namespace.cs: Uses Length for empty string test.
1157
1158          * report.cs (CheckWarningCode): Made static.
1159
1160         * statement.cs (LabeledStatement): Removed unused argument.
1161
1162         * typemanager.cs (FilterNone): Removed.
1163
1164 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1165
1166         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1167         obsolete.
1168
1169         * class.cs: Updated.
1170
1171 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1172
1173         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1174
1175 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1176
1177         A fix for #77816.
1178
1179         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1180         host container.
1181         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1182         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1183         Add more error reporting; Fixed issue with params.
1184
1185         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1186
1187         * cs-parser.jay: AnonymousMethod requires host container.
1188
1189         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1190
1191 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1192
1193         * class.cs: Change 'TypeContainer ds' constructor argument to
1194         'DeclSpace parent'.  Some classes were missed below due to
1195         different naming convention.
1196
1197         * class.cs (MemberCore.Parent): Delete.  This makes the
1198         ParentContainer changes below enforceable by the compiler.
1199
1200         Treat pointers to enclosing declaration space as 'DeclSpace', not
1201         'TypeContainer'.
1202         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1203         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1204
1205         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1206         of TypeContainer.
1207         (Block.AddThisVariable): Likewise.
1208         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1209         (AbstractPropertyEventMethod.Emit): Likewise.
1210         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1211         (GetMethod.Define, SetMethod.Define): Likewise.
1212         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1213         (DelegateMethod.EmitMethod): Likewise.
1214
1215         Fix regression test-partial-13.cs.
1216         Rationalize use of PartialContainer.  Ensure that the partial
1217         class semantics can be tied to type-correctness, i.e., any
1218         violation will cause a compile error.
1219         * class.cs, const.cs: Access all fields that belong to class
1220         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1221         Resolve()-like functions still use 'Parent'.
1222
1223         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1224         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1225         (PropertyMethod.CheckModifiers): Remove unused argument.
1226         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1227         DeclSpace.
1228
1229 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1230
1231         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1232
1233 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1234
1235         Make semantics of PartialContainer simpler.
1236         * decl.cs (DeclSpace.IsPartial): Remove.
1237         * class.cs (TypeContainer.IsPartial): Likewise.
1238         (TypeContainer..ctor): Set PartialContainer to point to self.
1239         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1240         (TypeContainer.FindNestedType): Likewise.
1241         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1242
1243 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1244
1245         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1246
1247 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1248
1249         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1250         classes.
1251
1252 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1253
1254         * class.cs (Operator.Define): An error for base conversion was not
1255         reported correctly.
1256
1257 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1258
1259         A fix for #77593, #77574.
1260
1261         * class.cs (MethodCore.CheckBase): Another if for operator.
1262
1263 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1264
1265         A fix for #77822.
1266
1267         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1268         reporting, it's more tricky than I thought.
1269
1270 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1271
1272         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1273         were not resolved
1274
1275         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1276         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1277         conversion test.
1278         
1279         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1280         not needed.
1281
1282 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1283
1284         A fix for #77353.
1285
1286         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1287         (Event.Define): ditto
1288         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1289
1290         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1291         Removed redundant code and set NewSlot for Invoke method too.
1292
1293         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1294         (Parameters.MergeGenerated): New method. Use this method when you merge
1295         compiler generated argument with user arguments.
1296
1297 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1298
1299         * attribute.cs (ResolveAsTypeTerminal): Removed.
1300
1301         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1302         specialization for predefined types; 30% speed up.
1303         Finally placed obsolete check to right place.
1304         (Expression.ResolveType): Removed.
1305
1306         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1307         Updated after ResolveType was removed.
1308
1309         * expression.cs (Cast.ctor): Check void cast.
1310         (Binary.ResolveAsTypeTerminal): Is never type.
1311         (Conditional.ResolveAsTypeTerminal): Is never type.
1312
1313         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1314
1315 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1316
1317         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1318
1319 2006-03-23  Martin Baulig  <martin@ximian.com>
1320
1321         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1322         type check if either of the types is an open generic type.
1323
1324 2006-03-23  Martin Baulig  <martin@ximian.com>
1325
1326         * convert.cs
1327         (Convert.ExplicitTypeParameterConversion): New method; implement
1328         explicit type parameter conversions.
1329
1330 2006-03-23  Martin Baulig  <martin@ximian.com>
1331
1332         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1333         blindly allow all conversions if we do not have any constraints.
1334
1335 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1336
1337         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1338         these two separated members to simplify the code.
1339         (Attribute.Resolve): Refactored to use new fields and methods.
1340         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1341         implemented obsolete attribute checking.
1342         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1343         implemented obsolete checking again. It look line never ending quest ;-)
1344         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1345
1346         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1347
1348         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1349
1350         *class.cs (Property.Define): Add RegisterProperty call.
1351
1352         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1353         argument groups (only 2).
1354
1355         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1356         encoding expression to arguments.
1357         (Expression.ExprClassToResolveFlags): Just turned to property.
1358
1359         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1360         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1361         optimized as well as implemented support for zero-length attributes.
1362
1363         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1364         Add caching of PropertyInfo's.
1365
1366 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1367
1368         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1369         error multiple times.
1370
1371 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1372
1373         New partial class implementation.
1374         A fix for #77027, #77029, #77403
1375
1376         * attribute.cs (Attributable): Made attributes protected.
1377
1378         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1379         the replacements of ClassPart and PartialContainer.
1380         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1381         (TypeContainer.AddInterface): Ditto.
1382         (TypeContainer.AddPartial): The main method for partial classes. It checks
1383         for errors and merges ModFlags and attributes. At the end class is added to
1384         partial_parts list.
1385         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1386         required here.
1387         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1388         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1389         from the rest of partial classes.
1390         (TypeContainer.GetClassBases): Simplified.
1391         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1392         DefineType.
1393         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1394         (TypeContainer.HasExplicitLayout): Uses Flags now.
1395         (PartialContainer): Removed.
1396         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1397         (StaticClass): Was merged with Class.
1398         (Class.GetClassBases): class and static class bases are verified here.
1399         (Class.TypeAttr): Added static attributes when class is static.
1400         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1401         (MemberBase): In some cases we need to call parent container for partial
1402         class. It should be eliminated but it's not easy now.
1403
1404         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1405
1406         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1407         partial classed to accumulate class comments.
1408         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1409
1410         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1411
1412         * driver.cs (MainDriver): Tree.GetDecl was removed.
1413
1414         * modifiers.cs (Modifiers): Add partial modifier.
1415
1416         * tree.cs (Tree.decl): Removed.
1417         (RootTypes): Started to use this class more often for root types
1418         specializations.
1419
1420 2006-03-23  Raja R Harinath  <rharinath@novell.com>
1421
1422         * generic.cs (TypeParameter.UpdateConstraints): Update
1423         'constraints' if null.
1424
1425 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1426
1427         A fix for #77615
1428
1429         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1430         external interface does not have an attribute.
1431
1432 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1433
1434         Another prerequisites for new partial classs implementation.
1435         
1436         * attribute.cs (Attribute.Equal): Implemented.
1437         (Attribute.Emit): Changed as attributes can be applied more than twice.
1438         (Attributes.Emit): Check for duplicate attributes here.
1439
1440         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1441         as a parameter, clean-up.
1442
1443 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1444
1445         A fix for #77485
1446
1447         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1448         contains obsolete attribute check which can in some cases look for base
1449         type of current class which is not initialized yet.
1450         (TypeContainer.BaseType): Replacement of ptype.
1451
1452         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1453
1454 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1455
1456         First of prerequisites for new partial classs implemention.
1457         
1458         * attribute.cs (Attributable): Extended by ResolveContext;
1459         Attributes finally have correct context for resolving in all cases.
1460         (AttachTo): Attribute owner is assigned here.
1461
1462         * codegen.cs (IResolveContext): Introduce new interface to hold
1463         all information needed in resolving phase.
1464         (EmitContext): Implements IResolveContext; more clean-up needed here.
1465         
1466         * decl.cs (MemberCore): Implemented IResolveContext.
1467
1468         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1469         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1470         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1471         Refactored to use new IResolveContext instead of EmitContext; cleanup
1472
1473 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1474
1475         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1476         mcs to keep code differences small.
1477         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1478         * typemanager.cs (parameter_default_value_attribute_type): New.
1479         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1480         CS1908 check.
1481
1482 2006-03-22  Martin Baulig  <martin@ximian.com>
1483
1484         * generic.cs
1485         (Nullable.NullableLiteral): Derive from `NullLiteral'.
1486
1487         * convert.cs
1488         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1489         instead of the normal `NullLiteral'.
1490
1491 2006-03-21  Martin Baulig  <martin@ximian.com>
1492
1493         Fix #77583.
1494         * generic.cs (TypeManager.InferType): If `pt' is a generic
1495         parameter, don't check whether `pt == at'.
1496
1497 2006-03-20  Raja R Harinath  <rharinath@novell.com>
1498
1499         Fix #77852
1500         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1501         (TypeParameter.Resolve): Update to change.
1502         (ConstraintChecker.CheckConstraints): Resolve type-argument
1503         constraints before use.
1504
1505 2006-03-16  Martin Baulig  <martin@ximian.com>
1506
1507         * generic.cs
1508         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1509         and don't have any instance constructors, also lookup in the base class.
1510         (TypeManager.IsNullableValueType): New public method.
1511
1512         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1513         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1514         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1515
1516         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1517         instead of just TypeManager.IsNullableType() to determine whether
1518         a lifted operator exists.
1519         (UnaryMutator.DoResolve): Likewise.
1520         (Conditional.DoResolve): Likewise.
1521         (Binary.DoResolve): A lifted operator only exists if both operands
1522         are valuetypes and at least one of them is a nullable type.
1523
1524 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1525
1526         * iterator.cs : yield break is allowed in try statement which has
1527           catch clauses. Fixed bug #77767.
1528
1529 2006-03-12  Martin Baulig  <martin@ximian.com>
1530
1531         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1532         private IsSignatureEqual() to compare types; see the comment in
1533         that method; fixes #77674.
1534
1535 2006-03-10  Raja R Harinath  <rharinath@novell.com>
1536
1537         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1538         (Expression.ResolveAsTypeTerminal): Likewise.
1539         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1540         * expression.cs, generic.cs, iterators.cs: Likewise.
1541         * parameter.cs, statement.cs, typemanager.cs: Likewise.
1542
1543 2006-03-09  Martin Baulig  <martin@ximian.com>
1544
1545         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1546         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1547
1548 2006-03-09  Martin Baulig  <martin@ximian.com>
1549
1550         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1551         `prepared' flag is set.
1552
1553         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1554         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1555         issues; see gtest-254.cs.
1556
1557 2006-03-07  Martin Baulig  <martin@ximian.com>
1558
1559         * generic.cs (TypeManager.InferType): Allow infering
1560         `IEnumerable<T>' with an array of T; see gtest-251.cs.
1561
1562 2006-03-06  Martin Baulig  <martin@ximian.com>
1563
1564         * generic.cs
1565         (TypeManager.InferType): Fix gtest-250.cs.
1566
1567         * typemanager.cs
1568         (TypeManager.IsSubclassOf): Also check the base class.
1569
1570         * expression.cs
1571         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1572         fixes gtest-249.cs.
1573
1574 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1575
1576         Fix #77679.
1577         * expression.cs (ParameterReference.DoResolveBase): Change return
1578         type to bool.
1579         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1580         Update.
1581
1582         Fix #77628.
1583         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1584
1585         Fix #77642.
1586         * typemanager.cs (GetFullNameSignature): Don't nullref on
1587         protected accessors.
1588
1589 2006-02-16  Martin Baulig  <martin@ximian.com>
1590
1591         * generic.cs
1592         (TypeManager.GetGenericFieldDefinition): New public method; use it
1593         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1594
1595 2006-02-14  Martin Baulig  <martin@ximian.com>
1596
1597         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1598
1599 2006-02-14  Martin Baulig  <martin@ximian.com>
1600
1601         * generic.cs
1602         (TypeManager.DropGenericMethodArguments): New public method; don't
1603         use GetGenericMethodDefinition() on something which is not a
1604         generic method.
1605
1606 2006-02-14  Martin Baulig  <martin@ximian.com>
1607
1608         * generic.cs
1609         (ConstraintChecker.CheckConstraints): If a type parameter has the
1610         `struct' constraint, the type must be a non-nullable valuetype.
1611
1612 2006-02-10  Martin Baulig  <martin@ximian.com>
1613
1614         * typemanager.cs
1615         (TypeManager.IsOverride): Make this work for instantiated methods
1616         in a generic class; fixes #77509.
1617         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1618         rather than calling it directly; fixes #77488.  
1619
1620 2006-02-08  Martin Baulig  <martin@ximian.com>
1621
1622         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1623         reporting into CheckConstraint() so we can use the correctly
1624         instantiated type.
1625
1626 2006-02-08  Martin Baulig  <martin@ximian.com>
1627
1628         * expression.cs (BaseAccess): Add support for generic methods.
1629
1630         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1631         the new MethodGroupExpr.
1632
1633 2006-02-07  Martin Baulig  <martin@ximian.com>
1634
1635         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1636         also reference types; fixes #77483.
1637
1638 2006-02-07  Martin Baulig  <martin@ximian.com>
1639
1640         * generic.cs
1641         (TypeManager.IsGenericMethod): We now return whether something is
1642         an instantiated generic method (and not a generic method def).
1643         (TypeManager.IsGenericMethodDefinition): New public method.
1644
1645         * typemanager.cs
1646         (TypeManager.CSharpSignature): Only include type arguments for
1647         "real" generic methods, not for any instantiated method.
1648         (TypeManager.GetMethodName): Likewise, but also allow generic
1649         method definitions here.
1650
1651 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1652
1653         * codegen.cs (EmitScopeInitFromBlock): check here the
1654         capture_context, there is no need to make two calls to the
1655         EmitContext. 
1656
1657         * anonymous.cs: Add some debugging messages that might help me
1658         track other instances of this problem in the future (the
1659         regression of test 467).
1660
1661         * cs-parser.jay: track the variable block, as we need to initalize
1662         any captured variables declared in this block for the "catch"
1663         portion of the "Try" statement.
1664
1665         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1666         scope initialization for captured variables. 
1667
1668         Also, move the emit for the variables after the block location has
1669         been marked.
1670
1671 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1672
1673        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1674         
1675 2006-02-06  Martin Baulig  <martin@ximian.com>
1676
1677         * class.cs (TypeContainer.DefineType): If we're a struct, pass
1678         `TypeManager.value_type' as parent type to
1679         ModuleBuilder.DefineType().  Fixes #77358.      
1680
1681 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1682
1683         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1684         commit yesterday, the initialization for the roots is necessary.
1685         What is not necessary is the scope activation.
1686
1687 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1688
1689         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1690         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1691         CS0206 checks.
1692         (Argument.Resolve): Remove CS0206 checks.
1693
1694 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1695
1696         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1697         scopes for all the roots, the scopes will now be emitted when the
1698         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1699
1700         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1701         code.  This reduces a lot of existing cruft.
1702         
1703         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1704         that the ScopeInfo is generated as we enter the scope, not at the
1705         time of use, which is what we used to do before.
1706
1707         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1708         every time a Block is about to be emitted if we have a
1709         CaptureContext. 
1710
1711 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1712
1713         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1714         attribute for mscorlib too.
1715
1716         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1717         (Reset): Update.
1718         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1719
1720         * typemanager.cs (cons_param_array_attribute): Make private.
1721         (Reset): Set it to null.
1722         (InitCoreHelpers): Don't initialize it.
1723         (ConsParamArrayAttribute): New.  Initialize it as needed.
1724         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1725
1726 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1727
1728         * expression.cs: There might be errors reported during the
1729         selection of applicable methods.  If there are errors, do not
1730         continue execution as it will lead the compiler to crash.
1731
1732 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1733
1734         * expression.cs: Member access is not allowed on anonymous
1735         methods.  Fixes #77402.
1736
1737 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1738
1739         Fix #77401
1740         * cs-parser.jay (VariableDeclaration): Don't set
1741         current_array_type to null.
1742         (field_declaration, event_declaration, declaration_statement):
1743         Set it to null here.
1744
1745 2006-01-29  Raja R Harinath  <harinath@gmail.com>
1746
1747         Fix part of #77397
1748         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1749
1750 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1751
1752         * typemanager.cs (GenericParameterPosition): New.
1753         * doc.cs: Use it.
1754
1755 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1756
1757         * doc.cs : To process "include" elements, first we should create
1758           another list than XmlNodeList, because it could result in node
1759           removal, which could result in that the XmlNodeList gives up
1760           yielding next node.
1761
1762 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1763
1764         * expression.cs: Introduce an error report that we were not
1765         catching before.   Gonzalo ran into it.
1766
1767 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1768
1769         A fix for bug: #76957
1770         
1771         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1772         ComputeMethodHost before creating the method, this is a new
1773         requirement. 
1774
1775         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1776         that this method references (RegisterScope).  The actual scope
1777         where the method is hosted is computed with the ComputeMethodHost
1778         before we create the method.
1779
1780         Moved the Deepest routine here.
1781
1782         (AnonymousContainer.ComputeMethodHost): New routine used to
1783         compute the proper ScopeInfo that will host the anonymous method.
1784
1785         (ScopeInfo): Deal with multiple roots.  The problem was that we
1786         did not have a unique root where all ScopeInfos could be hanged
1787         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1788         of roots.  
1789
1790         Remove AdjustMethodScope which is now computed at the end.  Remove
1791         LinkScope which did a partial link, instead link all ScopeInfos
1792         before code generation from the new "LinkScopes" routine. 
1793
1794         Simplify all the Add* routines as they no longer need to maintain
1795         the tree, they just need to record that they are using variables
1796         from a ScopeInfo.
1797
1798         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1799         routines to produce the forest of ScopeInfo trees.
1800
1801         * class.cs (TypeContainer.AppendMethod): This is just like
1802         AddMethod, but ensures that an interface implementation method
1803         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1804         methods, but at the end.
1805
1806         We use this functionality to ensure that the generated MoveNext
1807         method in the iterator class is resolved/emitted before the
1808         enumerator methods created.   
1809
1810         This is required because the MoveNext method computes the right
1811         ScopeInfo for the method.  And the other methods will eventually
1812         need to resolve and fetch information computed from the anonymous
1813         method. 
1814
1815         
1816 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1817
1818         Improve implementation of section 14.4.2.2 (Better function member).
1819         * expression.cs (Invocation.MoreSpecific): Compare all type
1820         arguments before deciding if one type is more specific than
1821         another.  Handle array types too.  Return the more specific type.
1822         (Invocation.BetterFunction): Add more tie-breaking rules from
1823         section 14.4.2.2.  Perform "more specific" check after
1824         other tie-breaking rules.  Compare all parameter types before
1825         choosing the "more specific" method.
1826
1827 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1828             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1829
1830         Fix rest of #76995.
1831         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1832         the 'aliases' hash.
1833         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1834         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1835
1836 2006-01-18  Martin Baulig  <martin@ximian.com>
1837
1838         * class.cs (TypeContainer.AddToMemberContainer): Use
1839         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1840         fixes #77124.
1841
1842 2006-01-18  Martin Baulig  <martin@ximian.com>
1843
1844         Fix #76417: a generic class may now have methods which may unify
1845         for some type parameter substitutions.
1846
1847         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1848         for methods which may unify anymore.
1849
1850         * expression.cs (Invocation.MoreSpecific): New private static
1851         method; checks whether one method is more specific than another
1852         according to 14.4.2.2 of the spec.
1853         (Invocation.BetterFunction): Implement the tie-breaking rules from
1854         14.4.2.2 of the spec: if two methods unify for some type parameter
1855         substitution, we need to pick the more specific one.
1856
1857 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1858
1859         Fix #76656, cs0231-2.cs.
1860         * cs-parser.jay (formal_parameter_list): Make error case catch
1861         more issues.
1862         (parenthesized_expression_0): Add CS1026 check.
1863         (invocation_expression): Remove unused { $$ = lexer.Location }.
1864
1865 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1866
1867         Fix #76824.
1868         * cs-parser.jay (statement_expression): Don't list out the
1869         individual statement-expressions.  Convert syntax error into
1870         CS0201 check.
1871
1872 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1873
1874         Fix #76874.
1875         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1876         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1877         CheckIntermediateModification.
1878         (FieldExpr.DoResolve): Add new two-argument version that
1879         allows us to resolve the InstanceExpression as an lvalue.
1880         The one-argument variant is now just a wrapper.
1881         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1882         Resolve the lhs as an lvalue if the it has a value type.
1883         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1884         from Assign.DoResolve.
1885         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1886         resolved as an lvalue.
1887         (PropertyExpr.DoResolve): Update.
1888         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1889         has a value type.  Move CS1612 check here from
1890         CheckIntermediateModification.
1891         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1892         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1893         'right_side' of a ResolveLValue on an 'out' argument.
1894         (EmptyExpression.LValueMemberAccess): New.  Used as the
1895         'right_side' of a propagated ResolveLValue on a value type.
1896         (LocalVariableReference.DoResolveBase): Recognize
1897         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1898         Add CS1654 check.
1899         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1900         EmptyExpression.Null.
1901
1902 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1903
1904         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1905           Type.IsGenericParameter(). Fixed bug #77183.
1906         * doc.cs : it is now identical to doc.cs in mcs.
1907
1908 2006-01-16  Martin Baulig  <martin@ximian.com>
1909
1910         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1911
1912 2006-01-16  Martin Baulig  <martin@ximian.com>
1913
1914         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1915         ctors; fixes #77250.
1916
1917 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1918
1919         This fixes the problem where we used ldfld instead of ldflda to
1920         load the "THIS" pointer on captured parameters, when THIS is a
1921         value type.  See bug #77205.
1922         
1923         * iterators.cs (CapturedThisReference.Emit): Pass false to
1924         EmitThis (we do not need the address).
1925
1926         * codegen.cs (EmitThis): it needs to know whether we need the
1927         address of `this' or not.  This is used by value types.  
1928
1929         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1930         every other call passes false.
1931
1932 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1933
1934         Fix #77221.
1935         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1936         GetOverride.
1937         * expression.cs (Invocation.OverloadResolve): Update.
1938         (Invocation.DoResolve): Avoid double resolution of invocation.
1939
1940 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1941
1942         Fix #77180.
1943         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1944         unary negation of floating point types as 0-expr; negation cannot
1945         overflow in floating point types.
1946
1947         Fix #77204.
1948         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1949         on operands of 'void' type.
1950
1951         Fix #77200.
1952         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1953         and ExclusiveOr for boolean constants too.
1954
1955 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1956
1957         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1958
1959 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1960
1961         * cs-tokenizer.cs (Position): New class used to save and restore
1962         the position state in the tokenizer.  Before this patch the save
1963         and restore was not complete enough so the line and columns would
1964         start to drift and the debugger and stack traces will get the
1965         wrong data.
1966
1967 2006-01-10  Martin Baulig  <martin@ximian.com>
1968
1969         * generic.cs
1970         (TypeParameter.InflateConstraints): New public method.
1971
1972         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
1973         constraints; fixes #77042.
1974
1975 2006-01-10  Martin Baulig  <martin@ximian.com>
1976
1977         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
1978         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
1979         #77061. 
1980
1981 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1982
1983         Fix #75636.
1984         * expression.cs (Invocation.OverloadResolve): Replace reflected
1985         override methods with their base virtual methods, rather than
1986         skipping over them.
1987         * typemanager.cs (TypeManager.GetOverride): New.
1988
1989 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1990
1991         * driver.cs: Report the case of no source files and no -out:
1992         argument provided.
1993
1994 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1995
1996         Fix #77035.
1997         * expression.cs (ComposedCast.GetSignatureForError): Define.
1998
1999 2006-01-05  Jb Evain  <jbevain@gmail.com>
2000
2001         * class.cs (Property.Define, Indexer.Define): do not tag the
2002         properties as SpecialName | RTSpecialName.
2003
2004 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2005
2006         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2007         doing a low-level comparission of parameter types.  It was lacking
2008         a check for __argslist. 
2009
2010 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2011
2012         * expression.cs (ParameterReference.DoResolveBase): Allow
2013         reference parameters if they are local to this block. 
2014
2015         This allows the ref and out parameters of a delegate to be used in
2016         an anonymous method, for example:
2017
2018         delegate void set (out int x);
2019
2020         set s = delegate (out int x){
2021                 x = 0;
2022         };
2023
2024         This is used by functionality introduced late in the C# language.
2025         
2026         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2027         method that take ref and out parameters. 
2028
2029         Fixes #77119 which was a late change in the spec.
2030
2031 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2032
2033         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2034         parent if its the same scope.  Fixes #77060.
2035
2036 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2037
2038         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2039
2040 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2041
2042         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2043         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2044         that doesn't contain the full public key. This is a update of the
2045         friend assemblies in .Net 2.0 release.
2046         
2047 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2048
2049         Fix #76995
2050
2051         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2052         ListDictionary, to contain the ExternAliasEntry entries (in
2053         addition to the NamespaceEntry.aliases hashtable). This field is
2054         shared between the original entry and its doppelganger (bodyless 
2055         copy of it).
2056         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2057         extern_aliases field.
2058         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2059         lookup in extern_aliases.
2060
2061 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2062
2063         Fix #77006.
2064         * class.cs (TypeContainer.Mark_HasEquals): New.
2065         (TypeContainer.Mark_HasGetHashCode): New.
2066         (ClassPart): Override them.
2067         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2068
2069         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2070         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2071         DeclSpace.
2072
2073         Fix #77008.
2074         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2075         'parent' argument to the base constructor.
2076
2077         Remove all mention of TypeContainer from decl.cs.
2078         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2079         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2080         (DeclSpace.DeclSpace): Likewise.
2081         (DeclSpace.DefineMembers): Remove unused argument.
2082         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2083         debugging check -- we don't care if the debug code throws an
2084         InvalidCastException instead of an InternalErrorException.
2085         * class.cs (TypeContainer.DefineMembers): Update to changes.
2086         (TypeContainer.DoDefineMembers): Likewise.
2087         (TypeContainer.GetMethods): Likewise.
2088         (PropertyMember.Define): Likewise.
2089         (MemberBase.Parent): New property that forwards to
2090         MemberCore.Parent, but ensures that we get a TypeContainer.
2091         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2092         (RootContext.PopulateTypes): Likewise.  Remove special case code
2093         for !RootContext.StdLib: DefineMembers is idempotent.
2094
2095 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2096
2097         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2098
2099 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2100
2101         * doc.cs : The search for referenced namespace was insufficient to
2102           get global one as it used to do. Fixed bug #76965.
2103
2104 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2105
2106         * doc.cs : check name in cref in the last phase that whether it is
2107           namespace or not.
2108
2109 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2110
2111         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2112           Mono.C5.
2113
2114 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2115
2116         * doc.cs : so it turned out that we cannot skip override check for 
2117           interface members. Fixed bug #76954.
2118
2119 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2120
2121         * cs-tokenizer.cs : fixed bug #75984:
2122           - #warning and #error should not be handled when the source line
2123             is disabled.
2124           - #line is not checked strictly when the source line is disabled.
2125           - #define and #undef is on the other hand checked strictly at any
2126             state.
2127
2128 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2129
2130         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2131           CS1027 report.
2132
2133 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2134
2135         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2136
2137         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2138         nested types.
2139
2140 2005-12-14  Martin Baulig  <martin@ximian.com>
2141
2142         * typemanager.cs (TypeManager.GetFullName): Make this public;
2143         `Type.Fullname' now never returns null.
2144
2145         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2146         explicit interface implementations; we're now using the same
2147         naming convention than csc does.
2148
2149 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2150
2151         * convert.cs (ExplicitConversionCore): Check the return value from
2152         ExplicitConversionCore which can return null on failure.  Fixes #76914
2153
2154 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2155
2156         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2157         instead of IsGenericInstance.
2158         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2159         code that's now covered by the more general test.
2160         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2161
2162         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2163         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2164         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2165         * generic.cs, report.cs, typemanager.cs: Likewise.
2166
2167 2005-12-08  Martin Baulig  <martin@ximian.com>
2168
2169         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2170
2171         * typemanager.cs (TypeManager.CSharpSignature): Include type
2172         arguments in the signature of a generic method.
2173
2174 2005-12-07  Martin Baulig  <martin@ximian.com>
2175
2176         Add support for custom attributes on type parameters.
2177
2178         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2179
2180         * generic.cs (TypeParameterName): New public class; we use this
2181         instead of a `string' to store the name of a type parameter, so we
2182         can also have `Attributes'.
2183         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2184         array instead of a `string[]' array.
2185         (TypeParameter.ctor): We now also take an `Attributes' argument.
2186         (TypeParameter.EmitAttributes): New public method; emit our
2187         `OptAttributes' here.
2188         (GenericMethod.EmitAttributes): New public method; emit the custom
2189         attributes on all our type parameters.
2190
2191         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2192         our type parameters.
2193         (MethodData.Define): If we're a generic method, call
2194         EmitAttributes() on it.
2195
2196 2005-12-07  Martin Baulig  <martin@ximian.com>
2197
2198         * generic.cs
2199         (ConstraintChecker): New public abstract class; move the
2200         constraint checking here from `ConstructedType' and also do
2201         constraint checking for generic methods here.
2202
2203         * expression.cs (Invocation.OverloadResolve): Use
2204         ConstraintChecker.CheckConstraints() if we resolved to a generic
2205         method.  Fix #76806.
2206
2207 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2208
2209         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2210
2211         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2212         event initializers.
2213         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2214         (FieldBase.Initializer): Initializer is now optional.
2215         (EventField.Define): Only event field can have initializer.
2216
2217         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2218
2219         * const.cs (Const): Reuse initializer.
2220
2221         * cs-parser.jay: Updated after FieldBase changes.
2222         Added current_array_type to simplify array initializers.
2223
2224         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2225
2226         * expression.cs, iterators.cs: Updated.
2227
2228         * namespace.cs (NamespaceEntry): Made UsingFound private.
2229
2230 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2231
2232         * parameterCollection.cs: Obsolete, removed.
2233         * parser.cs: Obsolete, removed.
2234
2235 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2236
2237         Fix #76849.
2238         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2239
2240         * enum.cs (Enum.Define): Set obsolete context here.
2241
2242 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2243
2244         * doc.cs :
2245           - FindDocumentedMember() now expects 1) paramList as null
2246             when "we don't have to check the number of parameters" and
2247             2) Type.EmptyTypes when "there is no arguments".
2248           - Introduced FoundMember struct to hold the exact type which was
2249             used to find the documented member (the above change broke
2250             test-xml-044; it might be better just to use DeclaringType than
2251             what MS does, like this change does, but it depends on usage.)
2252
2253 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2254
2255         * doc.cs : documented member might be from DeclaringType for nested
2256           types. Fixed bug #76782.
2257
2258 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2259
2260         * anonymous.cs: Have the param code handle leaving copies on the
2261         stack etc. Allows anonymous params to take part in the assignment
2262         code (++, +=, etc). Fixes bug #76550
2263
2264         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2265         it down to the anon code.
2266
2267         * iterators.cs: Use dummy var here
2268
2269         * codegen.cs: Handle new vars
2270
2271 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2272
2273         Fix #76849.
2274         * class.cs (MethodData.Define): Set proper Obsolete context.
2275
2276         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2277         obsolete context.
2278         (FieldExpr.DoResolve): Ditto.
2279
2280 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2281
2282         Fix #76849.
2283         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2284         parent is not obsolete.
2285
2286 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2287
2288         * doc.cs : (FindDocumentedMember) find parameterless members first
2289           and get CS0419 in the early stage. Fixed first case of bug #76727.
2290
2291 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2292
2293         Fix #76859.
2294         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2295         no error was reported.
2296
2297         *expression.cs (Binary.DoResolve): left can be null.
2298
2299 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2300
2301         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2302         abstract method and all overrides.
2303         * support.cs (ParameterData.GenericConstraints): Delete.
2304         (ReflectionParameters.type_params): Delete.
2305         (ReflectionParameters.ReflectionParameters): Make private.
2306         (ReflectionParameters.GetConstaints): New factory method.
2307         * generic.cs (TypeParameterDefineType): Use it.
2308         (TypeManager.GetTypeParameterConstraints): Likewise.
2309
2310 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2311
2312         Fix #76783.
2313         * class.cs (MethodData.Emit): Parameters should be labeled first.
2314
2315 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2316
2317         Fix #76761.
2318         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2319
2320 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2321
2322         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2323
2324         * class.cs (MethodCore): Parameter clean up.
2325         (IMethodData): Added ParameterInfo.
2326         (MethodData): Parameter clean up.
2327         (Indexer.Define): Parameter clean up.
2328
2329         * anonymous.cs,
2330         * codegen.cs,
2331         * cs-parser.jay,
2332         * decl.cs,
2333         * doc.cs,
2334         * ecore.cs,
2335         * flowanalysis.cs,
2336         * iterators.cs,
2337         * pending.cs,
2338         * statement.cs,
2339         * typemanager.cs: Parameter clean up.
2340
2341         * delegate.cs (Define): Get rid of duplicated code.
2342
2343         * expression.cs (ParameterReference): Removed useless parameters
2344         and simplified.
2345         (Invocation): Ditto.
2346
2347         * parameter.cs (ParamsParameter): New class, params specialization.
2348         (ArglistParameter): Attemp to separate arglist.
2349         (Parameter): Refactored to be reusable and faster.
2350         (Parameter.Modifier): Made understandable.
2351         (Parameters): Changed to be used as a class for `this' assembly
2352         parameters. Refactored to use new specialized classes.
2353
2354         * support.cs (ParameterData): Added Types property.
2355         (InternalParameters): Deleted.
2356
2357 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2358
2359         * doc.cs : the previous patch does not actually fix the bug.
2360           PropertyInfo override check is now implemented and really fixed it.
2361         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2362
2363 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2364
2365         * doc.cs : apply "override filter" also to properties.
2366           Fixed bug #76730.
2367
2368 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2369
2370         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2371           no need to check overrides. For classes, omit those results from 
2372           interfaces since they must exist in the class. Fixed bug #76726.
2373
2374 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2375
2376         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2377           with different parameters. Fixed the second problem in #76685.
2378
2379 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2380
2381         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2382           get expected 'protected' access in CheckValidFamilyAccess()).
2383           Fixed bug #76692.
2384
2385 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2386
2387         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2388           Fixed bug #76705.  CS1569 was incorrectly commented out.
2389
2390 2005-11-23  Martin Baulig  <martin@ximian.com>
2391
2392         * generic.cs (Constraints.Define): Removed.
2393         (TypeParameter.DefineConstraints): Removed.
2394         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2395         on the GenericTypeParameterBuilder here.
2396
2397 2005-11-23  Martin Baulig  <martin@ximian.com>
2398
2399         * typemanager.cs (TypeManager.GetProperty): Make this public.
2400
2401         * generic.cs (Nullable.NullableInfo.ctor): Use
2402         TypeManager.GetProperty() rather than using reflection directly.
2403
2404 2005-11-17  Martin Baulig  <martin@ximian.com>
2405
2406         * expression.cs (Indexers.GetIndexersForType): Added support for
2407         generic parameters; fixes #76587.
2408
2409 2005-11-17  Martin Baulig  <martin@ximian.com>
2410
2411         * anonymous.cs
2412         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2413         inherit the scope from our parent.  Fixes #76653.
2414
2415 2005-11-15  Martin Baulig  <martin@ximian.com>
2416
2417         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2418         instead of `ScopeTypeBuilder' to refer to the "current" type.
2419         (AnonymousMethod.CreateScopeType): Correctly create the helper
2420         class if we're inside a generic type definition.
2421
2422 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2423
2424         * doc.cs : use Invocation.IsOverride() to do real override check.
2425         * expression.cs : made Invocation.IsOverride() internal.
2426
2427 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2428
2429         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2430           TypeBuilder.FindMembers() and filter overriden base members out.
2431           Fixed bug #76990.
2432
2433 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2434
2435         * doc.cs : ref/out parameters are represented as '@' (instead of
2436           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2437
2438 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2439
2440         * doc.cs : when there was no '.' in cref to methods in doc comment,
2441           then parameters were missing in the output. Fixed bug #76691.
2442
2443 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2444
2445         * driver.cs : don't output docs when there is an error.
2446           Fixed bug #76693.
2447
2448 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2449
2450         * doc.cs :
2451           Now it should detect indexers. Fixed primary concern in bug #76685.
2452           Fixed CS0419 message to not show the identical member signature in
2453           the message.
2454
2455 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2456
2457         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2458           instead of Type.FindMembers() since it does not handle events.
2459           Fixed bug #71604.
2460
2461 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2462
2463         * codegen.cs: Fixed typo (speficied -> specified).
2464
2465 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2466
2467         Fix #76369.
2468         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2469
2470 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2471
2472         * attribute.cs: Changed error message.
2473
2474         * cs-tokenizer.cs: One more check.
2475
2476 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2477
2478         * statement.cs (Block.Resolve): Ignore empty statement.
2479
2480 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2481
2482         * report.cs: Made error/warning methods more strict to avoid
2483         their misuse.
2484
2485         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2486         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2487         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2488         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2489
2490 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2491
2492         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
2493         Use the more explicit AssemblyName.FullName instead of 
2494         AssemblyName.Name to report errors.
2495         
2496 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2497
2498         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2499         with mcs.
2500
2501 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2502
2503         * class.cs,
2504         * convert.cs,
2505         * cs-parser.jay,
2506         * decl.cs,
2507         * enum.cs,
2508         * expression.cs,
2509         * generic.cs,
2510         * pending.cs,
2511         * report.cs: Fixed error reporting and typos.
2512
2513         * generic.cs (TypeParameter.GetSignatureForError): New method.
2514         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2515
2516         * typemanager.cs (GetFullName): Refactored.
2517
2518 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2519
2520         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2521         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2522
2523         * class.cs (TypeContainer.IsComImport): New property.
2524         (Constructor.Define): Create proper ctor for ComImport types.
2525
2526         * expression.cs (New.CheckComImport): Fixed.
2527
2528 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2529
2530         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2531         that a parameter has been captured does not mean that we do not
2532         have to do the rest of the processing.  This fixes the second part
2533         of #76592.  If there was another anonymous method capturing
2534         values in the past, the Scope would never be set for the second
2535         method that captured the same parameter.
2536
2537         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2538         properly manipulate the stack.   Second part of fix for #76592.
2539
2540         * expression.cs (New): Add support for invoking "new" on
2541         interfaces that have been flagged with the ComImport attribute and
2542         the CoClass.  Fixes #76637 
2543
2544         * statement.cs (Try.DoEmit): When a variable is captured, do not
2545         try to emit the vi.LocalBuilder variable as it has been captured.
2546         Create a temporary variable and store the results on the
2547         FieldBuilder.  Fixes #76642
2548
2549 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2550
2551         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2552
2553         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2554
2555         * expression.cs (Binary.DoResolve): Added && optimalization.
2556     
2557         * typemanager.cs (AddUserType): Removed useless argument.
2558
2559 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2560
2561         * statement.cs (Block.variables): Uses ListDictionary.
2562
2563 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2564
2565         Fix #75969.
2566         * class.cs (PartialContainer.EmitType): Customized to emit
2567         security attributes.
2568         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2569         for partial classes.
2570
2571 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2572
2573         Fix #76599.
2574         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2575         access has to be fixed.
2576         
2577         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2578
2579 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2580
2581         Fix #76590.
2582         * ecore.cs (NullCast.Reduce): Implemented.
2583
2584         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2585         constant type.
2586         
2587         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2588         properly.
2589         (Foreach.Resolve): Catch null properly.
2590
2591 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2592  
2593         * cs-tokenizer.cs: Warning text fix.
2594
2595         * driver.cs: AllWarningNumbers exposed on public interface.
2596
2597         * report.cs (): Reviewed warning numbers.
2598         (IsValidWarning): Use binary search.
2599
2600 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2601  
2602         * driver.cs: Implemeted resource visibility.
2603         (Resources): New class for code sharing between /res: and
2604         /linkres:
2605  
2606 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2607
2608         decl.cs (CurrentTypeParameters): Fixed to be public.
2609
2610 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2611
2612         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2613
2614 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2615
2616         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2617
2618 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
2619
2620         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2621
2622 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2623
2624         Add friend assembly access support.
2625         * typemanager.cs: assembly_internals_vis_attrs
2626         cache for friend assembly access. 
2627         (TypeManager.IsFriendAssembly): New method for
2628         checking friend assembly access.
2629         (TypeManager.Error_FriendAccessNameNotMatching): New
2630         helper method.
2631         (TypeManager.CompareKeyTokens): Likewise.
2632         (TypeManager.Filter): Handle friend accessible
2633         members.
2634
2635         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2636         friend accessible types.
2637
2638         * ecore.cs (Expression.IsAccessorAccessible): Handle
2639         friend accessible properties.
2640
2641         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2642         accessible types.
2643         
2644 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2645
2646         Fix #76568.
2647         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2648         folding.
2649         
2650         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2651         contants only.
2652         
2653         * ecore.cs (NullCast): Child is contant only.
2654         
2655         * literal.cs (NullLiteral.Reduce): null can be converted to any
2656         reference type.
2657
2658 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2659
2660         * driver.cs: Use Encoding.Default as default code page instead
2661           of ISO-28591.
2662
2663 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2664
2665         Fix #76085.
2666         * expression.cs (Invocation.Error_InvalidArguments): Handle
2667         __arglist parameters.
2668         (Invocation.VerifyArgumentsCompat): Likewise.
2669         * support.cs (ReflectionParameters.GetSignatureForError): Print
2670         __arglist parameters.
2671         (InternalParamters.GetSignatureForError): Likewise.
2672         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2673
2674 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2675
2676         * attribute.cs (GetPropertyValue): Made public.
2677
2678         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2679         Resolve.
2680         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2681         attribute.
2682         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2683         is not defined.
2684         
2685         * driver.cs: Reflect method name change.
2686         
2687         * statement.cs (Try.Resolve): Warn when try has both general
2688         exception handlers.
2689         
2690         * typemanager.cs: runtime_compatibility_attr_type new predefined
2691         type.
2692
2693 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2694
2695         Fix #76419.
2696         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2697         treat it as an empty parameter list.
2698
2699 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2700
2701         Fix #76271.     
2702         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2703         ResolveAsTypeStep silent.
2704         * statement.cs (Block.AddConstant): Mark block as used.
2705         (Block.ResolveMeta): Avoid piling on error messages
2706         if a constant initializer resolution fails.
2707
2708 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2709
2710         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2711         Remove.
2712         (NamespaceEntry.VerifyAllUsing): New.
2713         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2714         behaviour.  Delegates actual resolution of alias to ...
2715         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2716         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2717         Update.
2718         * driver.cs (Driver.MainDriver): Update.
2719         
2720         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2721         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2722         property.
2723         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2724         Remove.
2725         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2726         RootNamespace.DefineNamespacesForAll.
2727
2728 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2729
2730         * typemanager.cs (assemblies, external_aliases, modules)
2731         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2732         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2733         overhead.  Move resposibility ...
2734         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2735         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2736
2737 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2738
2739         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2740         cached_namespaces.  Improve usage.
2741         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2742         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2743         Move from GlobalRootNamespace and simplify.
2744         (RootNamespace.Global): Make instance variable.
2745         (RootNamespace.RootNamespace): Add "alias name" parameter.
2746         (GlobalRootNamespace): Simplify drastically.
2747         (Namespace.Lookup): Don't use GetNamespace.
2748         * typemanager.cs (GetRootNamespace): Rename from
2749         ComputeNamespaceForAlias.
2750         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2751
2752 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2753
2754         * anonymous.cs (AnonymousContainer): Don't crash when container
2755         doesn't exist.
2756
2757 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2758
2759         * expression.cs (Binary.DoResolve): Warn when comparing same
2760         values.
2761
2762 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2763
2764         Fix #76486.
2765         * expression.cs (Binary.DoResolve): It looks like there are no
2766         convetsion rules in enum context.
2767
2768 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2769
2770         Add support for extern alias qualifiers.
2771         * typemanager.cs: Move some LookupTypeReflection code
2772         to namespace.cs, to have cleaner code. Added some methods
2773         to help us keep track of the extern aliased references.
2774         * driver.cs: Add suport for extern alias assemblies on command
2775         line and check for their warnings/errors. Also keep track of the
2776         extern aliased assemblies.
2777         * namespace.cs: Move the global functionality of Namespace
2778         to GlobalRootNamespace/RootNamespace. Now the global namespace
2779         is GlobalRootNamespace.Globa. Also the code moved from 
2780         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2781         Finally added LocalAliasEntry (AliasEntry before) and
2782         ExternAliasEntry, to handle alias statements.
2783         * cs-parser.jay: Add support in the grammar for extern alias
2784         statement.
2785         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2786         Update callings to Namespace (now in GlobalRootNamespace).
2787
2788 2005-10-25  Martin Baulig  <martin@ximian.com>
2789
2790         * convert.cs (ImplicitTypeParameterConversion): Make base
2791         interfaces actually work; fixes #76557.
2792
2793 2005-10-25  Martin Baulig  <martin@ximian.com>
2794
2795         * generic.cs
2796         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2797         all the type parameters; fixes #76551.
2798
2799 2005-10-25  Martin Baulig  <martin@ximian.com>
2800
2801         Fix #76472.
2802
2803         * generic.cs
2804         (GenericMethod.ctor): Added `Expression return_type' and
2805         `Parameters parameters' arguments.
2806         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2807         parameter and return types to check their constraints if they're
2808         generic types.
2809
2810         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2811         boolean field.
2812
2813         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2814         constraints of a generic type if `ec.ResolvingGenericMethod'.
2815
2816         * class.cs (MethodCore.DoDefineParameters): Set
2817         `ec.ResolvingGenericMethod' if we're a generic method.
2818         (MemberBase.MemberType): Likewise.
2819
2820 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2821
2822         * typemanager.cs (TypeManager): Added 
2823         TypeManager.internals_visible_attr_type to cache
2824         S.R.CompilerServices.InternalsVisibleToAttribute.
2825
2826         * codegen.cs (AssemblyClass): Added checks for 
2827         InternalsVisibleToAttribute in new method 
2828         CheckInternalsVisibleAttribute () and also cache the
2829         AssemblyName in AssemblyClass.Name.
2830         
2831 2005-10-24  Martin Baulig  <martin@ximian.com>
2832
2833         * typemanager.cs
2834         (TypeManager.ExpandInterfaces): Added overloaded version which
2835         just takes a `Type[]' array.
2836
2837         * generic.cs
2838         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2839         just use the interfaces which were explicitly specified and not
2840         the interfaces they inherit.  Fixes #76482.
2841         (TypeParameter.FindMembers): Expand the interfaces here.
2842
2843 2005-10-21  Martin Baulig  <martin@ximian.com>
2844
2845         * generic.cs
2846         (Constraints.Resolve): Also resolve the actual types here.
2847         (Constraints.ResolveTypes): Just check the constraints here.
2848         Fixes #76363; see gtest-218.cs.
2849
2850 2005-10-21  Martin Baulig  <martin@ximian.com>
2851
2852         * convert.cs
2853         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2854         instead of a `BoxedCast'; fixes gtest-217.cs.
2855
2856 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2857
2858         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2859           1) "new()" is specified as generic parameter constraint and 2) the
2860           type is TypeBuilder and 3) the type is abstract even if it has a
2861           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2862
2863 2005-10-20  Martin Baulig  <martin@ximian.com>
2864
2865         * generic.cs
2866         (GenericConstraints.TypeParameter): New public property.
2867         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2868         (TypeParameter.DeclSpace): New public property.
2869         (TypeParameter.DefineType): Inflate the constraints if our
2870         `DeclSpace' is an `Iterator'.   
2871
2872 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2873
2874         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2875           GenericMethod argument to compare methods' generic type arguments.
2876           Fixed bug #76382.
2877
2878 2005-10-19  Martin Baulig  <martin@ximian.com>
2879
2880         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2881         not ResolveType() when resolving the base type, so we're not
2882         checking the constraints here.
2883         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2884         if we have any.
2885
2886 2005-10-19  Martin Baulig  <martin@ximian.com>
2887
2888         * generic.cs (ConstructedType.CheckConstraints): Committing
2889         untested fix for #76441.
2890
2891 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2892
2893         Fix #76371.
2894         * class.cs (TypeContainer.DefineType): Move updating of
2895         topological sort earlier in the code.
2896         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2897
2898 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2899
2900         Fix #76273.
2901         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2902         
2903         * constant.cs (Constant.TryReduce): Moved from Cast class.
2904         (Reduce): Made little bit more OO and fixed missing conversions.
2905         
2906         * ecore.cs (Reduce): Implemented.
2907         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2908         
2909         * literal.cs (Reduce): Implemented.
2910         
2911         * class.cs: Reverted Miguel's wrong commit.
2912
2913 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2914
2915         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2916
2917 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2918
2919         * cs-parser.jay, expression.cs : CS0214 was missing error location
2920           for constants. Fixed bug #76404.
2921
2922 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2923
2924         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2925         InstanceExpression.
2926         (PropertyExpr.EmitCall): Likewise.
2927         * expression.cs (Invocation.EmitArguments): Handle case where
2928         arguments == null.
2929         (Invocation.EmitCall): Avoid allocating temporary variable if
2930         there are no arguments.
2931
2932 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2933
2934         Fix #76370.
2935         * convert.cs (ExplicitConversionCore): Fixed object->enum
2936         conversion.
2937
2938 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2939
2940         Fix #76323.
2941         * convert.cs (ImplicitConversionStandard): Move conversion of
2942         void* to arbitrary pointer types ...
2943         (ExplicitConversionStandard): .. here.
2944         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2945         error to always print typenames.
2946
2947 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2948
2949         * convert.cs (GetConversionOperator): Rename from
2950         GetConversionOperators.  Move operator selection code from ...
2951         (UserDefinedConversion): ... here.
2952
2953 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2954
2955         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2956         conversion.
2957
2958 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2959
2960         * assign.cs (Assign.DoResolve): Error method changed.
2961
2962         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2963         
2964         * const.cs (ResolveValue): Reset in_transit immediately.
2965         
2966         * constant.cs: Error method changed.
2967         
2968         * convert.cs: Removed useless location parameter.
2969         (ExplicitNumericConversion): Don't do double enum check.
2970         (ExplicitConversionCore): Renamed from ExplicitConversion.
2971         (ExplicitUnsafe): Extracted from ExplicitConversion.
2972         (ExplicitConversion): Uses for error reporting.
2973         
2974         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2975         error messages.
2976         (ResolveBoolean): Uses common error method.
2977         (CastToDecimal): Get rid of ec.
2978         (CastFromDecimal): Optimized.
2979         (ConvCast): Get rid of ec.
2980         
2981         * enum.cs (ResolveValue): Reset in_transit immediately.
2982         (Emit): Return after first error.
2983         
2984         * expression.cs: Convert changes.
2985         
2986         * literal.cs: Error method changed.
2987         
2988         * statement.cs: Error method changed.
2989
2990 2005-10-06  Raja R Harinath  <rharinath@novell.com>
2991
2992         Fix gtest-131.cs and gtest-211.cs.
2993         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
2994         Only emit code for a label if it is used.  Unreachable code can
2995         violate ECMA evaluation stack invariants.
2996
2997 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2998
2999         * anonymous.cs: Implemented ExprClassName.
3000         
3001         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3002         delegate.
3003         
3004         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3005         check.
3006         
3007         * class.cs (StaticClass.DefineContainerMembers): Report protected
3008         members as error.
3009         
3010         * codegen.cs: if(ed) PRODUCTION.
3011         
3012         * convert.cs (Error_CannotImplicitConversion): Better error
3013         distinction.
3014         
3015         * cs-parser.jay: More error checks.
3016         
3017         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3018         
3019         * driver.cs (CSCParseOption): Enabled wrong option check.
3020         
3021         * ecore.cs (Expression.ExprClassName): Turned to property.
3022         (MemberExpr.CheckIntermediateModification): For checking boxed
3023         value types     modification.
3024         
3025         * statement.cs (Fixed.Resolve): Expression type must be
3026         convertible to fixed type.
3027         (CollectionForeach.GetEnumeratorFilter,TryType):
3028         Small refactoring for easier error checking.
3029
3030 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3031
3032         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3033         attributes.
3034         
3035         * class.cs (GeneratedBaseInitializer): New class for customization
3036         compiler generated initializers.
3037         (MemberBase.DoDefine): Check Obsolete attribute here.
3038         (FieldMember.DoDefine): Ditto.
3039         
3040         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3041         constants.
3042         
3043         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3044         (MemberCore.GetObsoleteAttribute): Removed argument.
3045         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3046         (MemberCore.CheckObsoleteType): New helper.
3047         
3048         * delegate.cs,
3049         * enum.cs,
3050         * statement.cs: Updates after MemberCore changes.
3051         
3052         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3053         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3054         
3055         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3056         obsolete attribute for compiler construct.
3057         (As.DoResolve): Cache result.
3058         
3059         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3060
3061 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3062
3063         * expression.cs (Probe): instead of having a "Type probe_type"
3064         keep the extra information as a TypeExpr probe_type_expr since the
3065         "As" operator needs to perform some type checks.
3066
3067         * (As.DoResolve): If the type is a type parameter, ensure that it
3068         is constrained by a class.
3069
3070 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3071
3072         * statement.cs (Lock): Use the TemporaryVariable class instead of
3073         manually using local variables as those do not work when variables
3074         are captured.
3075
3076         * ecore.cs: Moved the TemporaryVariable class from being a nested
3077         class inside Foreach to be a public class that can be employed in
3078         other places. 
3079
3080 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3081
3082         * cs-parser.jay: interface_accessors replaced by
3083         accessor_declarations.
3084
3085         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3086         location.
3087         
3088         * statement.cs (GotoCase.Resolve): Convert null constant to
3089         null case.
3090         (SwitchLabel.ResolveAndReduce): Ditto.
3091         (SwitchLabel.NullStringCase): Custom null stamp.
3092         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3093         
3094         typemanager.cs (CSharpSignature): Don't skip first argument
3095         for full names.
3096
3097 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3098
3099         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3100         expression.cs, iterators.cs, literal.cs: Store constants and
3101         literals location.
3102         
3103         * class.cs (MemberBase.ShortName): Pass location.
3104         
3105         * cs-parser.jay: Some location fixes.
3106         
3107         * ecore.cs (Expression.Location): Made virtual.
3108
3109 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3110
3111         Fix #72930.
3112         * const.cs (Const.ResolveValue): Check for assigning non-null
3113         value to reference type.
3114
3115 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3116
3117         Fix #76133.
3118         * expression.cs (This.VerifyFixed): In a value type T, the type of
3119         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3120         value type R, 'this' is treated as a value parameter.
3121
3122 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3123
3124         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3125         if the underlying types are the same, otherwise we need to produce
3126         code that will do the proper cast.
3127
3128         This was exposed by Marek's constant rewrite which produced
3129         invalid code for the call site:
3130
3131         enum X : long { a }
3132         void Method (X v) {}
3133
3134         Method ((X) 5)
3135
3136         This fixes test-49.cs
3137
3138 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3139
3140         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3141           Type/Object should be allowed as well. Fixed bug #75968.
3142
3143 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3144
3145         * expression.cs : (Binary.DoResolve): when one is enum constant and
3146           another is constant 0, then return enum one *as enum type*.
3147           Fixed bug 74846.
3148
3149 2005-10-04  Martin Baulig  <martin@ximian.com>
3150
3151         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3152         `SetMemberIsUsed()' work for generics, too.
3153
3154 2005-10-04  Martin Baulig  <martin@ximian.com>
3155
3156         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3157         for corlib.  Fixes #75691.
3158
3159 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3160
3161         Fix #76255.
3162         * driver.cs: Fix compilation files with full root path.
3163
3164 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3165
3166         * report.cs (SymbolRelatedToPreviousError): Format the output so
3167         it does not use an open parenthesis that is never closed. 
3168
3169         * driver.cs: Follow coding guidelines
3170
3171 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3172
3173         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3174
3175         * location.cs (InEmacs): in this mode, do not report column
3176         location as it confuses Emacs.
3177
3178 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3179
3180         * support.cs (SeekableStreamReader.Position): Don't error out when
3181         the requested position is just beyond the end of the current
3182         buffered data.
3183
3184 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3185
3186         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3187         try to keep in sync with the byte count of the underlying Stream.
3188         However, this limits us to a window size of 2048 characters: i.e.,
3189         the maximum lookahead of our lexer/parser can be 2048 characters.
3190
3191 2005-09-22  Martin Baulig  <martin@ximian.com>
3192
3193         * driver.cs: Removed a debugging FIXME.
3194
3195 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3196
3197         * cs-parser.jay (type_arguments): Add CS1644 check.
3198         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3199
3200 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3201
3202         * Makefile (PROGRAM): Make profile specific.
3203         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3204         the current directory.
3205
3206         Fix test-455.cs.
3207         * expression.cs (Invocation.EmitCall): Remove optimization on
3208         this_call since it doesn't handle 'this' being a value type.
3209
3210 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3211
3212         * driver.cs: Ensure file handles are closed after parsing
3213
3214 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3215
3216         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3217         if the underlying types are the same, otherwise we need to produce
3218         code that will do the proper cast.
3219
3220         This was exposed by Marek's constant rewrite which produced
3221         invalid code for the call site:
3222
3223         enum X : long { a }
3224         void Method (X v) {}
3225
3226         Method ((X) 5)
3227
3228         This fixes test-49.cs
3229
3230 2005-09-05  Martin Baulig  <martin@ximian.com>
3231
3232         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3233         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3234
3235         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3236
3237 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3238
3239         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3240           to be a pointer type due to the spec 25.2, so check if declaring
3241           type is generic type definition. Fixed bug #75772.
3242
3243 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3244
3245         Fixed bug #75957.
3246         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3247           both types are not defined by methods.
3248         * expression.cs : (Invocation.IsApplicable): it should work when
3249           the argument type is equal to the parameter type, not only when
3250           ImplicitConversionExists() returns true.
3251
3252 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3253
3254         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3255         internal.
3256
3257         Fix #75941.
3258         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3259         flow-branching for LocalVariableReferences in case we were invoked
3260         from a MemberAccess.
3261         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3262         Carved out of ...
3263         (LocalVariableReference.DoResolveBase): ... this.
3264         (MemberAccess.Resolve): Do the check that was disabled during
3265         SimpleNameResolve.
3266
3267 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3268
3269         * class.cs :
3270           (PartialContainer.Create): check abstract/sealed/static strictly
3271           but abstract/sealed can exist only at one side. Fixed bug #75883.
3272
3273 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3274
3275         Fix #75945.
3276         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3277         specified, don't default to UnmanagedType.I4.
3278
3279 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3280
3281         * expression.cs : conditional operator should check possibly
3282           incorrect assign expression. Fixed bug #75946.
3283
3284 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3285
3286         Fix #75934.
3287         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3288         (ScopeInfo.EmitScopeType): Use it to construct field names from
3289         names of captured locals.
3290
3291         Fix #75929.
3292         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3293         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3294         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3295         (ExplicitConversion): Remove enum cases already handled by
3296         implicit conversion.  Move implicit conversion check to the beginning.
3297         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3298         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3299         Don't treat System.Enum as a struct.
3300
3301 2005-08-30  Jb Evain  <jbevain@gmail.com>
3302
3303         * attribute.cs: handles as expression in parameters.
3304
3305 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3306
3307         Fix #75802.
3308         * class.cs (TypeContainer.VerifyClsName): Don't use a
3309         PartialContainer when verifying CLS compliance.
3310         (AbstractPropertyEventMethod): Set Parent here, ...
3311         (PropertyMethod): ... not here.
3312
3313 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3314
3315         * attribute.cs : escaped attribute name should not be allowed to be
3316           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3317
3318 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3319
3320         Fix #75927.
3321         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3322         when converting a long constant to unsigned long.
3323         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3324         detect where IsApplicable and VerifyArgumentsCompat disagree.
3325
3326 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3327         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3328
3329         Fix #75848.
3330         * class.cs (TypeContainer.CanElideInitializer): New helper.
3331         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3332         can safely emitting the initializer of a field.
3333
3334 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3335
3336         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3337           allowed inside a switch (without loop). Fixed bug #75433.
3338
3339 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3340
3341         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3342         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3343
3344 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3345
3346         * driver.cs : kinda reverting the default encoding changes (not exact 
3347           revert since I noticed that "codepage:reset" might not work fine).
3348
3349 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3350
3351         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3352           Location. Now getter and setter store location correctly.
3353           (errors/cs0111-12.cs now reports the expected location.)
3354
3355 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3356
3357         * driver.cs : Use default encoding on the environment.
3358           Removed (now that) extra parameter for SeekableStreamReader.
3359         * support.cs : (SeekableStreamReader) third .ctor() argument for
3360           StreamReader is not required (always true). preamble size could
3361           be acquired in simpler and safe way.
3362
3363 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3364
3365         * cs-parser.jay: report CS0642 at warning level 3
3366           and report CS0642 for an if else statement also
3367           fixes bug #74745. Patch by John Luke (and a bit
3368           modified by me).
3369           Removed extra CS0642 warning check for "while",
3370           "for" and "fixed".
3371         * statement.cs: In Block.Resolve(), CS0642 check
3372           is reimplemented to check a sequence of an empty
3373           statement and a block.
3374
3375           Both fix bug #66777.
3376
3377 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3378
3379         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3380         detection until I fix it.
3381         
3382         * cs-tokenizer.cs: Changed error message.
3383         
3384         * cs-parser.jay: Fixed 2 error locations.
3385         
3386         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3387         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3388         properties.
3389         
3390         * enum.cs (GetSignatureForError): Fixed.
3391         
3392         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3393         method detection.
3394         
3395         * class.cs,
3396         * typemanager.cs (RegisterProperty): Removed.
3397         
3398         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3399
3400 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3401
3402         Fix #75874.
3403         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3404         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3405
3406 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3407
3408         * expression.cs : tiny fix is required for not warning positive ulong.
3409           See test-441.cs.
3410
3411 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3412
3413         * expression.cs : add CS0652 check for constant and integral
3414           expression. Fixed bug #53974.
3415
3416 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3417
3418         * expression.cs : in DoNumericPromotions(), check if there is implicit
3419           conversion overload for string (to check CS0034). Fixed bug #52492.
3420
3421 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3422
3423         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3424
3425 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3426
3427         * ecore.cs : report location when it is *not* Null.
3428
3429 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3430
3431         * codegen.cs,
3432           ecore.cs,
3433           flowanalysis.cs,
3434           expression.cs:
3435           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3436           correctly. Fixed bug #75721.
3437
3438 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3439
3440         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3441         loop that performs 'min (pos, char_count)'.
3442
3443         Fix #75862.
3444         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3445         converted value in Operator.OnesComplement.
3446
3447 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3448
3449         * anonymous.cs: If the anon method is pulled into a helper class,
3450         it needs to be `internal' not `private'. Fixes runtime behavior on
3451         msft. bug #75704
3452
3453 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3454
3455         Fix #75803
3456         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3457         is a partial class.
3458
3459 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3460
3461         The big constants rewrite
3462         Fix #75746, #75685 and more
3463         As a side effect saved 1MB for MWF ;-)
3464         
3465         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3466         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3467         enum based for corlib compilation.
3468         
3469         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3470         subtractions.
3471         
3472         * class.cs (FixedField.Define): Use ResolveAsConstant.
3473         
3474         * const.cs (IConstant): Interface constants and enums.
3475         (Const.ResolveValue): New method for constant resolvning.
3476         (ExternalConstant): Constants from imported assemblies.
3477         
3478         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3479         conversion; like enums.
3480         (Constant.ToType): Converts this constant to different type.
3481         (Constant.Increment): Adds 1.
3482         
3483         * convert.cs (ImplicitConversionRequired): Simplified.
3484         
3485         * cs-parser.jay: Create EnumMember directly.
3486         
3487         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3488         
3489         * doc.cs (GenerateEnumDocComment): Removed.
3490         
3491         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3492         (ConvertIntLiteral): Removed.
3493         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3494         
3495         * enum.cs (EnumMember): Implement IConstant.
3496         (Enum.IsValidEnumConstant): Removed.
3497         (Enum.GetNextDefaultValue): Removed.
3498         (Enum.FindMembers): Updated.
3499         (Enum.GenerateDocComment): Iterate enum members.
3500         
3501         * expression.cs (Cast.TryReduce): Handle enums correctly.
3502         (New.Constantify): Made public.
3503         (MemberAccess.DoResolve): Removed contant specific if(s).
3504         
3505         * literal.cs (NullLiteral): Implement new abstract methods.
3506         
3507         * statement.cs (GotoCase.Resolve): Use new constant methods.
3508         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3509         
3510         * typemanager.cs (LookupEnum): Removed.
3511         (IsEnumType): Fixed to work with corlib.
3512         (RegisterConstant): Removed.
3513         (LookupConstant): Removed.
3514         (GetConstant): Changed to work with IConstant.
3515
3516 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3517
3518         * location.cs : Fixed overflown (>255) column number.
3519
3520 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3521
3522         First cut of the qualified-alias-member feature.
3523         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3524         token.
3525         * cs-parser.jay (DOUBLE_COLON): New token.
3526         (namespace_or_type_name): Add rule for recognizing
3527         qualified-alias-members.
3528         (primary_expression): Likewise.
3529         (element_access): Allow QualifiedAliasMember as a possible
3530         type-bearing expression.
3531         (local_variable_type, local_variable_pointer_type): Likewise.
3532         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3533         aliases in the current and enclosing namespace declarations.
3534         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3535         * decl.cs (MemberName.is_double_colon): New.
3536         (MemberName.MemberName): Add new constructor for alias-member.
3537         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3538         * expression.cs (QualifiedAliasMember): New expression type.
3539
3540 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3541
3542         * location.cs : it borked when no argument was specified.
3543
3544 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3545
3546         * location.cs : tiny ToString() format fix.
3547
3548 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3549
3550         * statement.cs : oops, it was missing.
3551
3552 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3553
3554         A set of fixes for precise line/column location.
3555
3556         * location.cs :
3557           "token" field now holds a file/line "delta", a line number offset 
3558           from the segment, and a column number. See also:
3559           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3560           December/009508.html
3561           Removed static IsNull. Use instance IsNull property instead.
3562         * cs-tokenizer.cs :
3563           For some tokens it stores Location. For Identifier it stores
3564           LocatedToken which is a pair of string name and location.
3565           Column numbers are adjusted only at getChar().
3566         * report.cs :
3567           Use Location.ToString() for reporting (it now contains column).
3568         * cs-parser.jay :
3569           Largely modified to use LocatedToken instead of
3570           string (IDENTIFIER), and to acquire Location from some tokens.
3571         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3572           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3573           codegen.cs :
3574           Now MemberName holds Location. DeclSpace.ctor() receives Location
3575           as a parameter. Removed extra parameters to all derived classes.
3576           Replaced Location.IsNull() with instance property.
3577         * assign.cs, expression.cs :
3578           Added .ctor() overload that omits Location.
3579         * attribute.cs :
3580           Added "nameEscaped" flag that indicates the identifier was escaped
3581           in the source file. This fixes bug #57047.
3582
3583 2005-09-02  Martin Baulig  <martin@ximian.com>
3584
3585         * class.cs: Make CS3005 a warning, not an error.
3586
3587 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3588
3589         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3590         New method, looking for lo-case imported cls type.
3591
3592         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3593         here.
3594
3595         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3596
3597         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3598
3599         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3600         all_imported_types.
3601         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3602
3603         Optimized to save 3.5 MB for SWF compilation.
3604
3605 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3606
3607         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3608         (PartialContainer.Create): Moved logic AddToContainer.
3609         (PartialContainer.MarkForDuplicationCheck): Shares name.
3610         
3611         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3612         place.
3613         
3614         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3615         initialization.
3616         (Namespace.GetSignatureForError): New method.
3617         
3618         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3619         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3620
3621 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3622
3623         Fix #75669.
3624         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3625         member lookup rather than qualifier_type, since qualifier_type can
3626         be null.
3627
3628 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3629
3630         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3631         enum member.
3632
3633 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3634
3635         * statement.cs: Copy the local exception into the exception
3636         captured local.  Fixes 75674
3637
3638 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3639
3640         Fix #75658.
3641         * expression.cs (Invocation.OverloadResolve): Don't report error
3642         CS1501 if error CS1502 has been reported.
3643         (New.DoResolve): Delegate CS1501 reporting to
3644         Invocation.OverloadResolve.
3645
3646         Fix #75656.
3647         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3648         invariant-meaning-in-block property in an enclosing block if
3649         necessary.
3650
3651 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3652
3653         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3654         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3655         (Switch.CheckSwitch): Just save 50kb for SWF.
3656
3657 2005-07-27  Martin Baulig  <martin@ximian.com>
3658
3659         * anonymous.cs (CaptureContext.AddField): Added
3660         `AnonymousContainer am' argument; compute its toplevel scope if
3661         it's not already computed.  Fixes #75649.
3662
3663 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3664
3665         Fix #75628.
3666         * class.cs (Constructor.Emit): Reset block to null if the block
3667         resolve fails.
3668
3669 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3670
3671         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3672
3673 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3674
3675         * class.cs (MethodData.Define): Check whether accessor implementing
3676         interface is public.
3677
3678         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3679
3680 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3681
3682         Fix #57245
3683         * namespace.cs (LookupType): Moved same type check to...
3684         
3685         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3686         with the same name.
3687
3688 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3689
3690         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3691         already found a typebuilder.
3692         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3693         MemberNames, not strings.
3694
3695         * const.cs (Error_ExpressionMustBeConst): 
3696         Rename from Error_EpressionMustBeConst.
3697         * const.cs, class.cs, statement.cd: Update.
3698
3699 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3700
3701         Fix #65573
3702
3703         * const.cs (Const.LookupConstantValue): Report missing contant expression
3704         everytime.
3705         (Error_EpressionMustBeConstant): Only one error method.
3706
3707         * class.cs, statement.c: Updated.
3708
3709 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3710
3711         * statement.cs (Block.Flags): Add back HasVarargs.
3712         (Block.flags): Make protected.
3713         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3714
3715         * typemanager.cs (types, typecontainers, user_types): Remove.
3716         (UserTypes, TypeContainers): Likewise.
3717         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3718         (CleanUp, Reset): Update.
3719         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3720         (GetNestedType): Use Type.GetNestedType.
3721         (CoreLookupType): Take two arguments, the namespace and the
3722         basename of the type.  Update to use the Namespace.Lookup
3723         mechanism.
3724         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3725         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3726         string concatenation and substring matches.
3727         * class.cs, enum.cs, delegate.cs: Update to changes.
3728
3729 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3730
3731         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3732         Expression and made virtual.
3733
3734         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3735         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3736
3737         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3738
3739         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3740         error message.
3741
3742         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3743         change.
3744
3745 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3746
3747         Fix #57707
3748         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3749         AssemblyCultureAttribute is not used on executable.
3750
3751         * rootcontext.cs,
3752         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3753
3754 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3755
3756         Fix #60638.
3757         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3758         New.  Reports CS0252/CS0253.
3759         Mostly taken from preliminary patch by Duncak Mak.
3760         (Binary.DoResolveOperator): Store results of operator lookup.
3761         Use them to detect if we need to warn about unintended reference
3762         comparisons.
3763
3764 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3765
3766         Fix #72969.
3767         * namespace.cs (Namespace.Lookup): Add back location parameter.
3768         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3769         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3770
3771         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3772         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3773         (Namespace.LookupType): ... this.
3774         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3775         of namespaces.
3776         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3777         purported to handle pointers.
3778         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3779         CoreLookupType.
3780
3781 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3782
3783         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3784         type as namespace.
3785
3786 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3787
3788         * namespace.cs (Namespace.Lookup): Drop location parameter.
3789         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3790         (NamespaceEntry.Lookup): ... this.
3791         (NamespaceEntry.Error_AmbiguousTypeReference):
3792         Move here from DeclSpace.
3793         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3794         names ...
3795         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3796         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3797         Move to NamespaceEntry.
3798         * delegate.cs, expression.cs: Update to changes.
3799
3800 2005-08-31  Martin Baulig  <martin@ximian.com>
3801
3802         Committing a patch from Atsushi Enomoto for #75850.
3803
3804         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3805         Prefer a generic enumerator over a non-generic one.
3806
3807 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3808
3809         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3810         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3811
3812 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3813
3814         * driver.cs : reverting default encoding change as well as mcs.
3815
3816 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3817
3818         * driver.cs, support.cs : merged r48826.
3819           Marek Safer wrote:
3820           > could you integrate your mcs changes to gmcs otherwise
3821           > gmcs cannot compile some files.
3822
3823 2005-08-20  Martin Baulig  <martin@ximian.com>
3824
3825         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3826         scope if we don't already have it.
3827
3828         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3829         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3830         fixes #75867.
3831
3832 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3833
3834         * statement.cs: Copy the local exception into the exception
3835         captured local.  Fixes 75674
3836
3837 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3838
3839         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3840         type as namespace.
3841
3842 2005-08-12  Martin Baulig  <martin@ximian.com>
3843
3844         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3845         for nested types here to avoid hitting the cache too early.
3846
3847 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3848
3849         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3850         an error. 
3851
3852 2005-08-03  Martin Baulig  <martin@ximian.com>
3853
3854         Make iterators in generic methods work; see gtest-191.cs.
3855
3856         * generic.cs
3857         (Constraints.Resolve): Protect against being called twice.
3858
3859         * class.cs
3860         (TypeContainer.GetClassBases): Make this `protected virtual'.
3861
3862         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3863         (Iterator.GetClassBases): Override this and compute the base
3864         classes here.
3865         (Iterator.DefineNestedTypes): If we're a generic method, all our
3866         method type parameters become class type parameters on the proxy
3867         class.
3868
3869         * statement.cs
3870         (ToplevelBlock.Parameters): Make this a property, not a field.
3871         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3872
3873 2005-08-03  Martin Baulig  <martin@ximian.com>
3874
3875         * typemanager.cs (TypeManager.IsSubclassOf): Use
3876         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3877         (TypeManager.GetFullName_recursed): Improved.
3878
3879 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3880
3881         Fix #75417
3882         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3883         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3884         invocation_type == mi.DeclaringType, since the first one also checks
3885         other condition used by generic instances.
3886         
3887 2005-07-27  Martin Baulig  <martin@ximian.com>
3888
3889         * anonymous.cs (CaptureContext.AddField): Added
3890         `AnonymousContainer am' argument; compute its toplevel scope if
3891         it's not already computed.  Fixes #75649.
3892
3893 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3894
3895         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3896         CheckAttributeType and refactored.
3897         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3898         ResolveAsTypeTerminal error handling.
3899         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3900         handling.
3901         (GetSignatureForError): Print errors in same way.
3902
3903         * class.cs,
3904         * codegen.cs: Reflect attribute GetSignatureForError change.
3905
3906         * ecore.cs,
3907         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3908
3909         * namespace.cs (UsingEntry): Refactored to make fields private.
3910
3911         * assign.cs,
3912         statement.cs: Error_UnexpectedKind has extra parameter.
3913
3914 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3915
3916         * ecore.cs (IAlias): Remove.
3917         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3918         that implement the interface.
3919         * namespace.cs (Namespace): Likewise.
3920         (Namespace.declspaces): Renamed from 'defined_names'.
3921         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3922         DeclSpace instead of an IAlias.
3923         * tree.cs (Tree.AddDecl): Update.
3924
3925 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3926
3927         * statement.cs (Block.Flags); Remove HasVarargs.
3928         (Block.HasVarargs): Move to ToplevelBlock.
3929         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3930         (Block.Variables): Make protected.  Initialize variable hashtable
3931         if necessary.
3932         (Block.AddVariable): Update.
3933         (Block.Resolve): Update to changes.
3934         (ToplevelBlock.HasVarargs): New boolean.
3935         (ToplevelBlock.ThisVariable): Move here from Block.
3936         (ToplevelBlock.AddThisVariable): Likewise.
3937         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3938         * expression.cs (This.ResolveBase): Update to changes.
3939         (ArglistAccess.DoResolve): Likewise.
3940
3941 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3942
3943         Fix #75321
3944         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3945
3946         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3947         not used and not used & assigned.
3948         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3949
3950 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3951
3952         Fix #75053
3953         * expression.cs (Is.DoResolve): null is never provided type.
3954
3955 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3956
3957         Fix #52496
3958         * cs-parser.jay: Less strict event error rule to catch more errors.
3959
3960 2005-07-11  Martin Baulig  <martin@ximian.com>
3961
3962         * generic.cs (ConstructedType.CheckConstraints): Improve the check
3963         for the constructor constraint: we do not only have to check
3964         whether the class has a public constructor, but also ensure that
3965         it's parameterless.  Fixes #75492.
3966
3967 2005-07-11  Martin Baulig  <martin@ximian.com>
3968
3969         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
3970         between type parameters if they either have the reference type
3971         constraint or the class constraint.
3972
3973 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
3974
3975         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
3976
3977 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3978
3979         Fix #74975
3980         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3981         (ExtractSecurityPermissionSet): Cope with self referencing security
3982         attributes properly.
3983
3984         * driver.cs (SetOutputFile): Made public property OutputFile.
3985
3986 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3987
3988         Fix #75486.
3989         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3990         has_nonstatic_fields.  Make into a FieldBase pointer.
3991         (TypeContainer.AddField): Add CS0282 check.
3992         (TypeContainer.EmitType): Update.
3993
3994 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3995
3996         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3997         compare if they start with __.
3998
3999 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4000
4001         * statement.cs (Switch.SwitchGoverningType): Only look at
4002         UserCasts that don't need implicit standard conversions to one of
4003         the allowed switch types (Fixes test-322.cs).
4004         (LocalInfo.Resolve): Re-enable sanity-test.
4005
4006 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4007
4008         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4009         
4010         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4011         
4012         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4013
4014 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4015
4016         Fix #75472.
4017         * ecore.cs (SimpleName.GetSignatureForError): Add.
4018         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4019         (MemberAccess.GetSignatureForError): Add.
4020
4021 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4022  
4023         The big error and warning messages review.
4024         
4025         * anonymous.cs,
4026         * assign.cs,
4027         * attribute.cs,
4028         * class.cs,
4029         * codegen.cs,
4030         * convert.cs,
4031         * cs-parser.jay,
4032         * cs-tokenizer.cs,
4033         * decl.cs,
4034         * delegate.cs,
4035         * doc.cs,
4036         * driver.cs,
4037         * ecore.cs,
4038         * enum.cs,
4039         * expression.cs,
4040         * flowanalysis.cs,
4041         * iterators.cs,
4042         * literal.cs,
4043         * location.cs,
4044         * modifiers.cs,
4045         * namespace.cs,
4046         * parameter.cs,
4047         * pending.cs,
4048         * report.cs,
4049         * rootcontext.cs,
4050         * statement.cs,
4051         * support.cs,
4052         * tree.cs,
4053         * typemanager.cs: Updated.
4054         
4055         * class.cs: (MethodCore.SetYields): Moved here to share.
4056         (PropertyMethod.Define): Moved iterator setup here.
4057         
4058         * iterators.cs: Add orig_method to have full access to parent
4059         container.
4060
4061 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4062
4063         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4064         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4065         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4066         variable of struct type.
4067         * expression.cs (Unary.ResolveOperator): Update to change.
4068         (Indirection.VerifyFixed): Likewise.
4069         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4070         (ParameterReference.VerifyFixed): Value parameters are fixed.
4071         (This.VerifyFixed): Treat 'this' as a value parameter.
4072         * statement.cs (LocalInfo.IsFixed): Remove.
4073
4074 2005-07-01  Martin Baulig  <martin@ximian.com>
4075
4076         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4077         `ec.EmitThis ()' to get the correct scope.
4078
4079 2005-07-01  Martin Baulig  <martin@ximian.com>
4080
4081         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4082         instance is a ParameterReference; fixes #75299.
4083
4084 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4085
4086         Fix #75412.
4087         * expression.cs (Indexers.map): Remove.
4088         (Indexers.Append): Filter out inaccessible setters and getters.
4089         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4090
4091         Fix #75283.
4092         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4093         Refactored from ...
4094         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4095         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4096         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4097         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4098
4099 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4100
4101         Fix #75322
4102         * class.cs (FieldBase.GetInitializerExpression): One more field
4103         for backup.
4104
4105 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4106
4107         * pending.cs: Do not define a proxy if the base method is virtual,
4108         it will be picked up by the runtime (bug 75270).
4109
4110 2005-07-08  Martin Baulig  <martin@ximian.com>
4111
4112         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4113         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4114
4115 2005-07-07  Martin Baulig  <martin@ximian.com>
4116
4117         * generic.cs (ConstructedType.CheckConstraint): Use
4118         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4119         called recursively; fixes #75329.
4120
4121 2005-07-06  Martin Baulig  <martin@ximian.com>
4122
4123         * generic.cs (TypeManager.InferTypeArguments): Added support for
4124         anonymous methods; fixes #75461.
4125
4126 2005-07-01  Martin Baulig  <martin@ximian.com>
4127
4128         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4129         `ec.EmitThis ()' to get the correct scope.
4130
4131 2005-07-01  Martin Baulig  <martin@ximian.com>
4132
4133         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4134         instance is `This'; fixes #75299.
4135
4136 2005-06-30  Martin Baulig  <martin@ximian.com>
4137
4138         * class.cs (Indexer): Implement IIteratorContainer; added support
4139         for iterators in indexers.
4140
4141         * codegen.cs
4142         (EmitContext.CurrentIterator): Make this a property, not a field.
4143
4144         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4145
4146 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4147
4148         * pending.cs: Do not define a proxy if the base method is virtual,
4149         it will be picked up by the runtime (bug 75270).
4150
4151 2005-06-28  Martin Baulig  <martin@ximian.com>
4152
4153         * cs-parser.jay (interface_method_declaration): Avoid a
4154         reduce/reduce conflict by moving some of the code into a separate
4155         `interface_method_declaration_body' rule; fixes #75368.
4156
4157 2005-06-28  Martin Baulig  <martin@ximian.com>
4158
4159         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4160         array check after the check for TypeBuilder's.
4161
4162 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4163
4164         * convert.cs (FindMostEncompassedType): Add two trivial special
4165         cases (number_of_types == 0 || number_of_types == 1).
4166         (FindMostEncompasingType): Likewise.
4167
4168 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4169
4170         Some cleanups preparing for the fix of #75283.
4171         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4172         error testing.
4173         (EventExpr.InstanceResolve): Likewise.
4174         (EventExpr.DoResolve): Remove redundant checks.
4175
4176 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4177
4178         * class.cs: Small fix.
4179
4180 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4181
4182         Fix #75160.
4183         * class.cs (GetPartialBases): Fix return value check of
4184         part.GetClassBases.
4185
4186 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4187
4188         Ensure that partial classes are registered in their enclosing
4189         namespace.  Initial part of fix of #75160.
4190         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4191         Register declspace with namespace here, not in
4192         DeclSpace.RecordDecl.
4193         * cs-parser.jay: Pass namespace to RecordDecl.
4194         * class.cs (PartialContainer.Create): Likewise.
4195         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4196         called.
4197         * decl.cs (Declspace.RecordDecl): Remove.
4198         * namespace.cs (NamespaceEntry.DefineName): Remove.
4199
4200 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4201
4202         * rootcontext.cs: Reset TargetExt as well.
4203
4204 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4205
4206         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4207         -langversion:ISO-1.
4208
4209 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4210
4211         Fix #75080, cs0119.cs.
4212         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4213         of ...
4214         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4215         allowing ExprClass.Type and ExprClass.Namespace for
4216         ResolveFlags.VariableOrValue.
4217         (Expression.Resolve) [1-argument variant]: Change default resolve
4218         flags based on language version.
4219         (Expression.Error_UnexpectedKind): Use a simple string array
4220         rather than an ArrayList.
4221         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4222         not ExprClass.Type.
4223         (TypeOfVoid.DoResolve): Likewise.
4224         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4225         flags argument -- it always has the same value.
4226
4227 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4228
4229         Fix #75081.
4230         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4231         Use it in the error message.
4232         * assign.cs, expression.cs, statement.cs: Update.
4233
4234 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4235
4236         Fix #75088.
4237         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4238         the "almostMatchedMember" case too.
4239         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4240         that failed the accessibility checks to 'almost_match'.
4241
4242 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4243
4244         * attribute.cs: Use internal MethodBuilder methods to set
4245         ExactSpelling and SetLastError on PInvoke methods, instead
4246         of passing them via charset.  Fixes #75060.
4247
4248 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4249
4250         * parameter.cs (Parameter): Remove TODO comment.
4251         (Parameter.DefineParameter): Remove Location parameter.
4252         (Parameters.LabelParameters): Likewise.
4253         * class.cs (Constructor.Emit): Update to change.
4254         (MethodData.Emit): Likewise.
4255         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4256         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4257
4258 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4259
4260         * parameter.cs,
4261           Removed Parameters.Location and added Parameter.Location instead.
4262           Removed Location parameter from Emit() and GetSignature().
4263         * anonymous.cs,
4264           class.cs,
4265           cs-parser.jay,
4266           delegate.cs,
4267           iterators.cs,
4268           statement.cs :
4269           Modified all related calls.
4270
4271 2005-06-21  Martin Baulig  <martin@ximian.com>
4272
4273         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4274         left-hand side is not a nullable type; fixes #75328.
4275
4276 2005-06-21  Martin Baulig  <martin@ximian.com>
4277
4278         * typemanager.cs
4279         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4280         (TypeManager.GetFullNameSignature): Likewise.
4281
4282         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4283         `source.FullName' and `target.FullName' to check whether there are
4284         two conflicting definitions.
4285
4286 2005-06-21  Martin Baulig  <martin@ximian.com>
4287
4288         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4289         a BoxedCast - also for reference types - to be compatible with csc.
4290
4291 2005-06-21  Martin Baulig  <martin@ximian.com>
4292
4293         * expression.cs (MemberAccess.DoResolve): Add support for nested
4294         types in a generic instance; fixes #75320.
4295
4296 2005-06-20  Martin Baulig  <martin@ximian.com>
4297
4298         * generic.cs (TypeManager.InferType): Also walk the class
4299         hierarchy for generic instances; fixes #75261.
4300
4301 2005-06-17  Martin Baulig  <martin@ximian.com>
4302
4303         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4304         to make things work for corlib.
4305
4306 2005-06-15  Martin Baulig  <martin@ximian.com>
4307
4308         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4309         obsolete `SecurityAction' values.
4310
4311 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4312
4313         * rootcontext.cs: Reset TargetExt as well.
4314         
4315 2005-06-09  Martin Baulig  <martin@ximian.com>
4316
4317         * delegate.cs (Delegate.VerifyMethod): Added
4318         `MethodGroupExpr old_mg' argument; inherit its
4319         `HasTypeParameters'; fix #75085.
4320
4321 2005-06-09  Martin Baulig  <martin@ximian.com>
4322
4323         * expression.cs (Invocation.OverloadResolve): Correctly handle
4324         generic methods for the SetMemberIsUsed(); fix #75064.
4325
4326 2005-06-09  Martin Baulig  <martin@ximian.com>
4327
4328         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4329         fixes #75062.
4330
4331 2005-06-08  Martin Baulig  <martin@ximian.com>
4332
4333         * cs-parser.jay (nullable_type_or_conditional): If we put the
4334         nullable back and our `type' is a `ComposedCast', remove the
4335         nullable from it.  Fixes #75156.
4336
4337         * expression.cs (ComposedCast.RemoveNullable): New public method.
4338
4339 2005-06-08  Martin Baulig  <martin@ximian.com>
4340
4341         The big Iterators rewrite :-)
4342
4343         * iterators.cs: Rewrite this to use the anonymous methods framework.
4344
4345         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4346         before the TypeContainers; see 2test-21.cs.
4347
4348         * class.cs
4349         (TypeContainer.DefineType): Don't create a new EmitContext if we
4350         already have one (this only happens if we're an Iterator).
4351         (TypeContainer.Define): Also call Define() on all our iterators.
4352         (Method.CreateEmitContext): Added support for iterators.
4353
4354         * anonymous.cs
4355         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4356         (AnonymousContainer.CreateMethodHost): Moved here from
4357         AnonymousMethod and made abstract.
4358         (AnonymousContainer.CreateScopeType): New abstract method.
4359         (AnonymousContainer.IsIterator): New public property.
4360         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4361         get the ScopeTypeBuilder rather than manually defining it here. 
4362         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4363         iterators here.
4364
4365         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4366         before RootContext.DefineTypes().
4367
4368         * codegen.cs (EmitContext.RemapToProxy): Removed.
4369         (EmitContext.CurrentAnonymousMethod): Changed type from
4370         AnonymousMethod -> AnonymousContainer.
4371         (EmitContext.ResolveTopBlock): Protect from being called twice.
4372         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4373         (EmitContext.EmitThis): Removed the iterators hacks; use the
4374         anonymous methods framework for that.
4375
4376         * statement.cs
4377         (ToplevelBlock.Container): Make this a property, not a field.
4378         (ToplevelBlock.ReParent): New public method; move the
4379         ToplevelBlock into a new container.
4380         (Foreach.TemporaryVariable): Simplify.
4381
4382 2005-06-05  Martin Baulig  <martin@ximian.com>
4383
4384         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4385         (Block.AddTemporaryVariable): New public method; creates a new
4386         `LocalInfo' for a temporary variable.
4387         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4388         variables here.
4389         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4390         non-iterator variables.
4391
4392 2005-06-05  Martin Baulig  <martin@ximian.com>
4393
4394         * statement.cs (Foreach.TemporaryVariable): Create the
4395         LocalBuilder in the Emit phase and not in Resolve since in some
4396         situations, we don't have an ILGenerator during Resolve; see
4397         2test-19.cs for an example.
4398
4399 2005-06-04  Martin Baulig  <martin@ximian.com>
4400
4401         The big Foreach rewrite - Part II.
4402
4403         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4404         with `PropertyInfo ienumerator_getcurrent'.
4405
4406         * codegen.cs (VariableStorage): Removed.
4407
4408         * statement.cs
4409         (Foreach): Derive from Statement, not ExceptionStatement.
4410         (Foreach.CollectionForeach): New nested class.  Moved all the code
4411         dealing with collection foreach here.
4412         (Foreach.ForeachHelperMethods): Removed.
4413         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4414
4415 2005-05-23  Martin Baulig  <martin@ximian.com>
4416
4417         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4418         don't need to.  Fix #75014.
4419
4420 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4421
4422         Improve user-defined conversion handling.
4423         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4424         applicable operators.
4425         (AddConversionOperators): New.  Helper for GetConversionOperators.
4426         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4427         there is only one most encompassed/encompassing type.
4428         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4429         "applicable operator" handling.
4430         (UserConversion): Move cache here from GetConversionOperators.
4431         Directly cache the chosen operator, rather than the whole
4432         MethodGroup.
4433         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4434         case.  Allow conversion of decimal to sbyte and byte too.
4435         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4436         New static methods.  Used to avoid allocating EmptyExpressions in
4437         convert.cs.
4438
4439 2005-05-24  Duncan Mak  <duncan@novell.com>
4440
4441         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4442         another class, used in Convert.ExplicitNumericConversion.
4443         (CastToDecimal): New class, similar to above, but casts to
4444         System.Decimal, used in Convert.ImplicitNumericConversion and also
4445         in explicit convesion from double/float to decimal.
4446
4447         * convert.cs (ImplicitNumericConversion): Handle implicit
4448         conversions to System.Decimal.
4449         (ExplicitNumericConversion): handle explicit conversions to
4450         System.Decimal.
4451
4452         This fixes #68711.
4453         
4454 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4455
4456         * typemanager.cs: Do not throw an exception in the TypeBuilder
4457         case, we take care of it on the TypeCode.
4458
4459 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4460         
4461         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4462         is back.
4463         
4464         * cs-parser.jay: Catch more lexical errors.
4465         
4466         * report.cs: Add one more Error method.
4467         
4468         * rootcontext.cs,
4469         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4470
4471 2005-05-20  Martin Baulig  <martin@ximian.com>
4472
4473         * class.cs (TypeContainer.CircularDepException): Removed.
4474         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4475         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4476         (CS0146) and interface (CS0529) dependencies here.
4477
4478 2005-05-20  Martin Baulig  <martin@ximian.com>
4479
4480         * expression.cs (New.DoResolve): Move the CS0712 check above the
4481         CS0144 check; otherwise it can never be reached.
4482
4483 2005-05-20  Martin Baulig  <martin@ximian.com>
4484
4485         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4486
4487 2005-05-20  Martin Baulig  <martin@ximian.com>
4488
4489         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4490
4491         * typemanager.cs (TypeManager.IsAttributeType): New public method.
4492
4493 2005-05-19  Martin Baulig  <martin@ximian.com>
4494
4495         * delegate.cs
4496         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4497         to disable error reporting.
4498
4499         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4500         here since we don't want to report an error; see the new test-336.cs.
4501
4502 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4503
4504         * statement.cs (ToplevelBlock.GetParameterReference)
4505         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4506         Move here from class Block.
4507         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4508         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4509
4510 2005-05-18  Martin Baulig  <martin@ximian.com>
4511
4512         Fix #74978.
4513
4514         * flowanalysis.cs
4515         (FlowBranching.Reachability): Add non-static public And() and Or()
4516         methods.
4517         (FlowBranchingSwitch): New class; do the `break_origins' thing
4518         like in FlowBranchingLoop.
4519         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4520         reachability, not just locals and parameters.
4521         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4522         switch; MergeBreakOrigins() now takes care of that.
4523
4524 2005-05-18  Martin Baulig  <martin@ximian.com>
4525
4526         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4527         a loop and may leave it, reset the barrier; fixes #74974.
4528
4529 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4530
4531         Fix test-382.cs.  Emit values of decimal constants.
4532         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4533         Carved out of ...
4534         (TypeContainer.AddField): ... this.
4535         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4536         with initializers to include 'Const's.
4537         (ClassPart.RegisterFieldForInitialization): Forward to
4538         PartialContainer.
4539         * const.cs (Const.Const): Pass initializer to base class.
4540         (Const.Define): In case of decimal constants, register them for
4541         initialization in a static constructor.
4542
4543 2005-05-14  Martin Baulig  <martin@ximian.com>
4544
4545         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4546         do not call ResolveUnreachable() on unreachable statements in
4547         here, see the comment in the source code.
4548
4549 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4550
4551         Fix #74934.
4552         * expression.cs (BinaryResolveOperator): If one of the operands of
4553         an equality comparison is 'null' and the other is a pointer type,
4554         convert the null to a NullPointer.
4555         * convert.cs (ImplicitReferenceConversion): If the expression is a
4556         NullLiteral and the target type is a pointer type, return a
4557         NullPointer instead.
4558         (ImplicitConversionStandard): Likewise.
4559
4560 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4561         
4562         * cs-parser.jay: Set readonly context based on special constructs.
4563         
4564         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4565         readonly variable error handling.
4566         
4567         * rootcontext.cs (EmitCode): Don't verify members when error
4568         occurred.
4569         
4570         * statement.cs (LocalInfo): Add reaodnly context information.
4571         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4572
4573 2005-05-17  Martin Baulig  <martin@ximian.com>
4574
4575         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4576         #70970. 
4577
4578 2005-05-13  Martin Baulig  <martin@ximian.com>
4579
4580         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4581         handle unreachable blocks.
4582
4583 2005-05-13  Martin Baulig  <martin@ximian.com>
4584
4585         * class.cs
4586         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4587         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4588         #74905. 
4589
4590 2005-05-13  Martin Baulig  <martin@ximian.com>
4591
4592         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4593         instance variable, not a local.  Fix #74873.
4594         (Block.ResolveUnreachable): Set it to true here.
4595
4596 2005-05-12  Martin Baulig  <martin@ximian.com>
4597
4598         * cs-parser.jay (property_declaration): Pass the `current_class',
4599         not the `current_container' to Property's .ctor.  Fixes #74912.
4600
4601 2005-05-11  Martin Baulig  <martin@ximian.com>
4602
4603         * typemanager.cs (Closure): Copy this from MCS and merge all the
4604         GMCS-specific changes into it.
4605
4606 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4607
4608         Fix #74920.
4609         * typemanager.cs (unmanaged_enclosing_types): New.
4610         (IsUnmanagedType): Avoid infloops by using
4611         'unmanaged_enclosing_types' to talk with recursive invocations.
4612
4613 2005-05-11  Duncan Mak  <duncan@novell.com>
4614
4615         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4616         continuing to process for 'arg'.
4617         (handle_preprocessing_directive): Check the argument of the #endif
4618         directive and report error CS1025 if there are any trailing
4619         characters.
4620
4621         According to the C# spec, having even whitespace after the #endif
4622         directive is illegal; however, because we call arg.TrimEnd ()
4623         beforehand, we have the same behavior as csc, allowing whitespace
4624         after the directive.
4625
4626         Fixes #74892.
4627
4628 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4629
4630         Fix #74863.
4631         
4632         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4633         (Constructor.GetObsoleteAttribute): Implemented correctly.
4634
4635 2005-05-10  Martin Baulig  <martin@ximian.com>
4636
4637         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4638         resolve the type; fixes #74864.
4639         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4640         in DoResolve(); fixes #74862.
4641
4642 2005-05-10  Martin Baulig  <martin@ximian.com>
4643
4644         * support.cs (ReflectionParameters.ParameterModifier): Use
4645         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4646         and `ParameterAttributes.In'.  Fixes #74884.
4647
4648 2005-05-10  Martin Baulig  <martin@ximian.com>
4649
4650         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4651         the cache if we're just looking for `MemberTypes.NestedType' in a
4652         generic instance.
4653
4654         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4655         constraints if we're still resolving the type tree.
4656         (Expression.MemberLookup): If we're resolving the type tree, only
4657         look for `MemberTypes.NestedType' since we're only interested in
4658         getting types.
4659
4660         * class.cs (TypeContainer.DefineType): Don't resolve the type
4661         parameters here; do this later in ResolveType() after the type
4662         tree has been resolved.
4663         (TypeContainer.ResolveType): New public method; this is called
4664         after the type tree is resolved and before the types are being
4665         populated.  We resolve the generic constraints here.
4666         (TypeContainer.DoDefineMember): Check the constraints on our base
4667         class and interfaces.
4668
4669         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4670         set the `ResolvingTypeTree' flag on the EmitContext.
4671
4672         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4673
4674 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4675
4676         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4677         
4678         * expression.cs (Argument.GetParameterModifier): Turned to property.
4679         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4680         
4681         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4682         its C# equivalent.
4683         
4684 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4685
4686         Fix #74852.
4687         * decl.cs (MemberCache.AddMethods): Register override methods,
4688         rather than non-override methods.
4689         * typemanager.cs (RegisterOverride): New.
4690         (IsOverride): Update.
4691
4692 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4693
4694         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4695
4696 2005-05-06  Martin Baulig  <martin@ximian.com>
4697
4698         * attribute.cs
4699         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4700         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4701
4702 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4703
4704         Fix #73105.
4705         
4706         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4707         recursive declaration.
4708         
4709         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4710         
4711 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4712
4713         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4714         
4715         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4716
4717 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4718
4719         Fix #74797.
4720         * decl.cs (DeclSpace.FamilyAccessible): 
4721         Use TypeManager.IsNestedFamilyAccessible.
4722
4723         Fix reopened #64812.
4724         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4725         internal'.
4726
4727 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4728             Abin Thomas  <projectmonokochi@rediffmail.com>
4729             Anoob V E  <projectmonokochi@rediffmail.com>
4730             Harilal P R  <projectmonokochi@rediffmail.com>
4731
4732         Fix #64812.
4733         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4734         allow access to all static members.
4735
4736 2005-05-04  Martin Baulig  <martin@ximian.com>
4737
4738         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4739
4740 2005-05-04  Martin Baulig  <martin@ximian.com>
4741
4742         Fix #74655.
4743
4744         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4745         section at the end; make things work if `default' is not the last
4746         section.        
4747
4748 2005-05-04  Martin Baulig  <martin@ximian.com>
4749
4750         Fix #70400.
4751
4752         * statement.cs (Switch): Replaced the `got_default' field with a
4753         `default_section' one.
4754         (Switch.CheckSwitch): Set `default_section' here.
4755         (Switch.Resolve): If we're a constant switch and the constant is
4756         not found, use the default section.
4757
4758 2005-05-03  Martin Baulig  <martin@ximian.com>
4759
4760         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4761
4762         * statement.cs (Foreach.ArrayForeach): New nested class.
4763         (Foreach.TemporaryVariable): New nested class.
4764         (Foreach.EmitArrayForeach): Removed; this is now in the new
4765         ArrayForeach class.
4766
4767 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4768
4769         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4770         more conservative.
4771         (VerifyPendingMethods): Revert change below.
4772
4773         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4774         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4775         that used to trigger warning -28.  Remove warning -28.
4776         * expression.cs (Invocation.OverloadResolve): Use
4777         TypeManager.IsOverride to distinguish override methods.
4778
4779         Fix #74773.
4780         * pending.cs (VerifyPendingMethods): If a base type implements the
4781         requested interface, don't bother checking individual methods of
4782         the base type.  As a side-effect, this prevents the creation of
4783         unnecessary proxies.
4784
4785 2005-05-02  Martin Baulig  <martin@ximian.com>
4786
4787         Fix #70182.
4788
4789         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4790         Also `And' the locals if the old vector is null.
4791         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4792         null; in this case we basically reset all the variables.        
4793
4794 2005-05-02  Martin Baulig  <martin@ximian.com>
4795
4796         Fix #74529.
4797
4798         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4799         Added `FlowBranching branching' argument; always `and' the
4800         variables instead of `or'ing them unless we're an infinite loop.
4801
4802         * statement.cs (While.Resolve): Create a new sibling unless we're
4803         infinite.       
4804
4805 2005-05-02  Martin Baulig  <martin@ximian.com>
4806
4807         Fix #70140.
4808
4809         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4810         arguments; use it instead of creating a new TopLevelBlock.
4811         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4812         our ConstructorInitializer.
4813
4814         * statement.cs
4815         (TopLevelBlock.TopLevelBranching): New public property.
4816         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4817         and create our `TopLevelBranching'.
4818
4819         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4820         anonymous method host, use `block.TopLevelBranching' rather than
4821         creating a new branching.
4822
4823 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4824
4825         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4826         a ScopeInfo, if any of the current children is a child of the new
4827         entry, move those children there.
4828
4829 2005-04-30  Martin Baulig  <martin@ximian.com>
4830
4831         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4832         at the beginning of a SwitchSection.  Fix #73335.
4833
4834 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4835
4836         Fix #74378
4837         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4838         
4839         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4840         (FieldExpr.DoResolve): Obsolete members are ignored for field
4841         initializers.
4842         
4843 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4844
4845         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4846         of arrays detection.
4847
4848         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4849         verification.
4850         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4851
4852         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4853         arrays report.
4854
4855 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4856
4857         * cs-parser.jay: Use the prefered version of -unsafe in error
4858         message.
4859
4860 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4861
4862         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4863         circumstances.
4864
4865 2005-04-20  John Luke  <john.luke@gmail.com>
4866
4867         * driver.cs: fix typo in error message, --outout to --output
4868
4869 2005-04-30  Martin Baulig  <martin@ximian.com>
4870
4871         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4872         handle the .NET 2.x security attributes.
4873
4874 2005-04-30  Martin Baulig  <martin@ximian.com>
4875
4876         * typemanager.cs
4877         (TypeManager.ExpandInterfaces): Don't add things twice.
4878
4879         * class.cs
4880         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4881
4882 2005-04-29  Martin Baulig  <martin@ximian.com>
4883
4884         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4885
4886         * anonymous.cs: Added support for anonymous generic methods.
4887
4888 2005-04-29  Martin Baulig  <martin@ximian.com>
4889
4890         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4891         generic instances.
4892
4893 2005-04-29  Martin Baulig  <martin@ximian.com>
4894
4895         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4896
4897         * expression.cs (New.DoResolve): Fix the CS0304 check.
4898
4899 2005-04-29  Martin Baulig  <martin@ximian.com>
4900
4901         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4902         naming schema.
4903
4904         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4905         explicit interface implementation, compare the interface types.
4906         (MethodData.Define): Use the new naming scheme from the latest
4907         .NET 2.x beta2.
4908         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4909
4910         * decl.cs (MemberName.GetMemberName): Removed.
4911         (MemberName.MethodName, FullName): New properties.
4912
4913 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4914
4915         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4916
4917 2005-04-22  Martin Baulig  <martin@ximian.com>
4918
4919         * generic.cs (GenericMethod): Create the EmitContext in the
4920         `Define()'; in `Define(MethodBuilder)', create the type parameters
4921         before calling `Define()'.  Fixes #73933.
4922
4923 2005-04-22  Martin Baulig  <martin@ximian.com>
4924
4925         * generic.cs
4926         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4927         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4928
4929         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4930         ConstructedType, check its constraints.
4931
4932 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4933
4934         * codegen.cs (InRefOutArgumentResolving): New field.
4935         
4936         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4937         fields outside contructor.
4938         
4939         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4940         
4941 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4942
4943         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4944         parameter code was not completed ever, so it was not as up-to-date
4945         as local variables.  Must finish it.
4946
4947         The bug fix was to compare the Toplevel of the block, not the
4948         current block.  Thanks for Ben for pointing this out. 
4949
4950 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4951
4952         * decl.cs (AddMethods): Use the declaring type of the problem
4953         method to determine if we want to squash a warning.
4954
4955 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4956
4957         * attribute.cs: Removed debug output.
4958
4959         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4960         
4961         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4962         Report.Stderr.
4963         
4964 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4965
4966         Fix #74481.
4967         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4968         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4969         all null comparisons against reference types.
4970
4971 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4972
4973         Fix# 74565
4974         * class.cs (TypeContainer.CircularDepException) New nested
4975         exception class.
4976         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4977         (TypeContainer.DefineType): Removed error, reset InTransit before
4978         exit.
4979         (Class.DefineType): Throw exception when is in Transit.
4980         Catch exception and report error.
4981         (Struct.DefineType): Throw exception when is in Transit.
4982         Catch exception and report error.
4983         (Interface.DefineType): Throw exception when is in Transit.
4984         Catch exception and report error.
4985
4986         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4987         handle nested exception handlers.
4988
4989         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4990         a catch.
4991
4992         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4993         InFinally and InCatch storage.
4994
4995         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4996         (Catch.Resolve): Set and Restore ec.InCatch.
4997         (Try.Resolve): Set and Restore ec.InFinally.
4998         (Try.HasCatch): True when try has catch.
4999
5000 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5001
5002         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5003           for the same event member, so exclude such cases from warning 419.
5004           Fixed bug #74633.
5005
5006 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5007
5008         * expression.cs (Binary.ResolveOperator): Apply patch from John
5009         Luke to fix bug 59864: operators &, | and ^ on enumerations
5010         require that the same enum type on both sides.
5011
5012         * driver.cs: Add warnings to old flag usage, this is to assist
5013         people who produce Makefiles and hope that the Makefiles will be
5014         used on Windows.
5015
5016         * class.cs (TypeContainer.EmitType): Moved the definition of the
5017         special $PRIVATE$ field from the resolve phase to the Emit phase.
5018         During resolve we do not know if we are a struct with
5019         HasExplicitLayout, we know this only after the attributes for the
5020         type are emitted.
5021
5022         Set the FieldOffset to zero on the dummy field that we create for
5023         the class.   Fixes 74590.
5024
5025 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5026
5027         Fix #73834.
5028         * ecore.cs (PropertyExpr.resolved): New.
5029         (DoResolve): Use it to handle a case of double resolution here.
5030         Handle a case of identical-name-and-type-name.
5031         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5032         resolution by storing the results of expression resolution back
5033         into the "probes" array.
5034
5035 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5036
5037         Fix cs0208-7.cs and cs0208-8.cs.
5038         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5039         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5040         error reporting to point out the reason a struct is not unmanaged.
5041
5042 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5043
5044         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5045           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5046
5047 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5048
5049         Fix #74528.
5050         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5051         IdenticalNameAndTypeName here.
5052         (EventExpr.InstanceResolve): Likewise.
5053
5054 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5055
5056         C# 2.0 DefaultCharSetAttribute implementation
5057         
5058         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5059         which allows us to set GlobalNamespace for every resolve.
5060         (Attribute.ResolveArguments): Cut from Resolve.
5061         (Attribute.GetCharSetValue): Returns CharSet named argument.
5062         (Attribute.DefinePInvokeMethod): Gets default charset from
5063         module settings.
5064         (GlobalAttribute.ResolveAsTypeStep): Override.
5065         (GlobalAttribute.ResolveArguments): Override.
5066         
5067         * class.cs (TypeAttr): Is protected.
5068         
5069         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5070         (ModuleClass.DefaultCharSetType): New memeber.
5071         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5072         
5073         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5074         charset from module.
5075         
5076         * delegate.cs (TypeAttr): Override.
5077         (Delegate.DefineType): Use this TypeAttr.
5078         
5079         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5080         at very early stage (before types are defined) to resolve model
5081         module attributes. It will probably not work with corlib but it
5082         should be ok.
5083         
5084         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5085         charset from module.
5086         
5087         * typemanager.cs (default_charset_type): New type.
5088
5089 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5090
5091         * decl.cs (MemberCache.AddMethods): Don't warn if
5092         System.Object.Finalize has buggy MethodAttributes.
5093
5094         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5095         removed below.
5096
5097 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5098
5099         * doc.cs : detect ambiguous reference to overloaded members.
5100           Fixed bug #71603. MS 1.1 csc does not detect it.
5101
5102 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5103
5104         * doc.cs : delegates must not be referenced with parameters.
5105           Fixed bug #71605.
5106
5107 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5108
5109         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5110
5111 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5112
5113         * driver.cs (MainDriver): Stop processing if the CLS stage found
5114         errors. 
5115
5116         (CompilerCallableEntryPoint.InvokeCompiler): Always
5117         reset after execution;   Take a TextWriter argument for the
5118         output.
5119
5120         * report.cs: Use the error stream instead of hardcoding stderr. 
5121
5122 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5123
5124         * class.cs: Reduce code paths to test, too small of an
5125         optimization to make it worth the extra testing.  Always perform
5126         it. 
5127
5128 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5129
5130         Fix #74510.
5131         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5132         operators that had errors reported on them.
5133
5134 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5135
5136         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5137         argument types.
5138         (Attribute.Resolve): Add named argument type checking.
5139         
5140         * class.cs (FixedField.Define): Use IsPrimitiveType
5141         
5142         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5143         
5144         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5145         unsafe parameter types.
5146         
5147         * statement.cs (Using.ResolveExpression): Add better error description.
5148         
5149         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5150         
5151 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5152
5153         Fix #74484.
5154         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5155         AttributeUsageAttribute in the emitcontext of the attribute class,
5156         not in the emitcontext of the attributable entity it was attached to.
5157         * cs-parser.jay: Use 'current_class', not 'current_container',
5158         when creating a GlobalAttribute.
5159
5160 2005-04-08  Alp Toker  <alp@atoker.com>
5161
5162         * pending.cs: The fix to #58413 failed to compile methods implementing
5163         interfaces with/without params modifiers and vice versa, even though
5164         params modifiers aren't part of the signature. Make the modifier check
5165         less strict as in csc.
5166
5167 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5168             Anoob V E  <projectmonokochi@rediffmail.com>
5169             Harilal P R  <projectmonokochi@rediffmail.com>
5170
5171         Fix #58413.
5172         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5173         modifiers of pending methods.
5174         (PendingImplementation.PendingImplementation): Initialize it.
5175         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5176         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5177         with ParameterData.  Add check for modifiers.
5178         * class.cs (MethodData.Define): Update to changes.
5179
5180 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5181
5182         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5183
5184 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5185
5186         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5187         property.
5188         
5189         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5190         
5191         * rootcontext.cs,
5192         * typemanager.cs: Registered RequiredAttributeAttribute.
5193         
5194 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5195
5196         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5197         Warning CS0169 is back at level 3.
5198         (IMethodData.SetMemberIsUsed): New method.
5199         
5200         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5201         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5202         
5203         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5204
5205         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5206         contants.
5207         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5208         is used.
5209         
5210         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5211         is used.
5212         
5213         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5214         to avoid the problems with nested types.
5215
5216 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5217             Anoob V.E  <projectmonokochi@rediffmail.com>
5218             Harilal P.R  <projectmonokochi@rediffmail.com>
5219             Raja R Harinath  <rharinath@novell.com>
5220
5221         Fix #73820.
5222         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5223         attribute.
5224         * typemanager (GetConstructor): Make public.
5225
5226 2005-04-05  John Luke  <john.luke@gmail.com>
5227             Raja R Harinath  <rharinath@novell.com>
5228
5229         Fix #62232.
5230         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5231         struct too.  Return false quicker in a few cases.
5232         (VerifyUnManaged): Use it.
5233
5234 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5235
5236         Fix #74041.
5237         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5238         not 'unreachable_seen'.
5239
5240 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5241
5242         * attribute.cs (Attribute.GetValue): Removed unused.
5243         
5244         * codegen.cs (CodeGen.TrimExt): Removed unused.
5245         
5246         * cs-parser.jay (output): Removed unused.
5247         
5248         * cs-tokenizer.cs (hex_digits): Removed unused.
5249         
5250         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5251         
5252         * expression.cs (Indirection.LoadExprValue): Removed unused.
5253         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5254         
5255         * iterators.cs (Iterator.param_types): Removed unused.
5256         
5257         * statement.cs (Goto.block): Removed unused.
5258         (ToplevelBlock.did): Removed unused.
5259         (Switch.ResolveConstantSwitch): Removed unused.
5260
5261 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5262
5263         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5264         resetting thingy.
5265
5266 2005-04-19  Martin Baulig  <martin@ximian.com>
5267
5268         Merged r42462 from MCS and made it work for GMCS.
5269
5270         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5271
5272         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5273
5274 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5275
5276         Fix #74232 and cs0208-3.cs.
5277         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5278         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5279         unmanaged type.  Don't use FieldBuilders when 't' is a
5280         TypeBuilder.  Use ModFlags and MemberType fields.
5281         * class.cs (MemberBase.member_type): Rename from MemberType.
5282         (MemberBase.MemberType): New property.  Determines member_type on
5283         demand.
5284         (MemberBase.DoDefine): Don't initialize MemberType here.
5285         (FieldMember.Define): Likewise.
5286
5287 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5288
5289         Fix #74241
5290         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5291         Attributes are emitted there.
5292         
5293 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5294
5295         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5296         keyword in 'partial enum' too.
5297         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5298         is not allowed).
5299         Report from Kamil Skalski <nazgul@omega.pl>.
5300
5301         Fix #74309.
5302         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5303         have partial containers too.
5304
5305         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5306         in block' checks to Block.CheckInvariantMeaningInBlock.
5307         * statement.cs (Block.GetKnownVariableInfo): Make private.
5308         (Block.IsVariableUsedInChildBlock): Remove.
5309         (Block.IsVariableUsedInBlock): Likewise.
5310         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5311         conflicting declaration.
5312         (Block.AddVariable): Make error messages less long-winded and more
5313         specific.  Show location of conflicting declaration.
5314         * parameter.cs (Parameters.Location): New readonly property.
5315
5316 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5317
5318         Clean up semantics of invoking ResolveMemberAccess.
5319         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5320         can have an instance, ensure that we pass in a non-TypeExpression
5321         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5322         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5323         argument.  Update to changes and simplify.
5324         (FieldExpr.Emitinstance): Remove CS0120 check.
5325         (PropertyExpr.EmitInstance): Likewise.
5326         * expression.cs (Argument.Resolve): Likewise.
5327         (Invocation.DoResolve): Update to changes in semantics of
5328         InstanceExpression.
5329
5330 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5331
5332         Fix #74241
5333         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5334         customization.
5335         
5336         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5337
5338 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5339
5340         Fix difference in behaviour with commandline invocation.
5341         * driver.cs (Driver.Reset): New.
5342         (CompilerCallableEntryPoint): Call it.
5343
5344         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5345         variable" warnings if the boolean expression failed to resolve.
5346
5347 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5348
5349         * attribute.cs: Fix the union of several permissions when some of them
5350         are unrestricted (so the result isn't an unrestricted permission set).
5351         Fix #74036.
5352
5353 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5354
5355         * ecore.cs (MemberExpr): New class.  Convert from interface
5356         IMemberExpr.
5357         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5358         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5359         error checks.
5360         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5361         (MethodGroupExpr.IsExplicitImpl): Remove.
5362         (Expression.GetFieldFromEvent): Remove.
5363         (SimpleName.MemberStaticCheck): Remove.
5364         (SimpleName.DoSimpleNameResolve): Update to changes.
5365         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5366         (MemberAccess.IdenticalNameAndTypeName): Remove.
5367         (MemberAccess.error176): Move to MemberExpr.
5368         (MemberAccess.DoResolve): Update to changes.
5369         (BaseAccess.DoResolve): Likewise.
5370
5371 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5372
5373         C# 2.0 Conditional attribute class implementation
5374         
5375         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5376         Analyzes class whether it has attribute which has ConditionalAttribute
5377         and its condition is not defined.
5378         
5379         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5380         (Class.IsExcluded): New method. Search for at least one defined
5381         condition in ConditionalAttribute of attribute class.
5382
5383 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5384
5385         * ecore.cs (PropertyExpr): Derive from Expression, not
5386         ExpressionStatement.
5387         (PropertyExpr.EmitStatement): Remove.
5388
5389 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5390
5391         Fix #74060.
5392         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5393         internal field "value__" of an enum be private.  The examples for
5394         "value__" that I found on MSDN all used FieldAttributes.Private.
5395
5396         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5397         Don't mention IL method attribute names.
5398
5399         Fix #47991.  Remove a TODO.
5400         * statement.cs (Block.Toplevel): Make into a field.
5401         (Block.Parameters): Move into ToplevelBlock.
5402         (Block.known_variables): Rename from child_variable_names.
5403         (Block.Block): Remove variants that take Parameters.  Initialize
5404         'Toplevel' with the immediately surrounding toplevel block.
5405         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5406         LocalInfo parameter.
5407         (Block.GetKnownVariableInfo): New.
5408         (Block.IsVariableNameUsedInChildBlock): Update.
5409         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5410         the block, even though it may not be in scope.
5411         (Block.AddVariable): Remove Parameters parameter.  Use
5412         Toplevel.Parameters instead.
5413         (Block.AddConstant): Remove Parameters parameter.
5414         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5415         (Block.IsParamaterReference): Likewise.
5416         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5417         (ToplevelBlock.Parameters): New.  Moved from Block.
5418         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5419         initialize Parameters to a non-null value.
5420         * cs-parser.jay: Update to changes.
5421         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5422         simple names that mean different things in the same block.  Use
5423         Block.IsVariableNameUsedInBlock.
5424
5425 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5426
5427         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5428
5429 2005-03-26  Raja R Harinath  <harinath@acm.org>
5430
5431         Fix #73038.
5432         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5433         fails to resolve, ensure that the LHS is still resolved as an
5434         lvalue.
5435
5436 2005-03-25  Raja R Harinath  <harinath@acm.org>
5437
5438         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5439         ec.ContainerType.
5440         (Enum.current_ec): Remove.
5441         (Enum.LookupEnumValue): Remove EmitContext argument.
5442         Just uses the one created during DefineType.
5443         (Enum.FindMembers): Update.
5444         * expression.cs (MemberAccess.DoResolve): Update.
5445
5446 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5447
5448         * assign.cs (Assign.DoResolve): Check for CS1717 when
5449         source and target are same (uses Equals).
5450
5451         * expression.cs (LocalVariableReference, ParameterReference,
5452         This): Implemented Equals, GetHashCode.
5453
5454         * statement.cs (Block.GetParameterReference): Removed useless
5455         local variable.
5456
5457 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5458
5459         Fix cs0128.cs
5460         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5461         blocks before deciding whether the error is cs0136 or cs0128.
5462
5463         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5464         (using_alias_directive, using_namespace_directive): Pass
5465         MemberName, not an expression to Namespace.UsingAlias and
5466         Namespace.Using.
5467         (MakeName): Use the MemberName of the namespace.
5468         * namespace.cs (Namespace.MemberName): New.
5469         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5470         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5471         Likewise.
5472         * decl.cs (MemberName.Name): Make readonly.
5473         (MemberName.FromDotted): New "constructor".
5474         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5475         (MemberCore.Name): Compute from MemberName on demand.
5476         (MemberCore.SetMemberName): Provide a way to change the
5477         MemberName.
5478         (MemberCore.AddToContainer): Don't take a fullname parameter.
5479         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5480         fully qualified name of the container to the member name.
5481         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5482         only if the type is a member of the root container.
5483         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5484         MemberName.Left rather than searching for an embedded ".".
5485         (PartialContainer.CreatePart): Update to changes in RootContext.
5486         (MemberBase.ShortName): Turn into a property.  Use
5487         MemberCore.SetMemberName.
5488         (MemberBase.ExplicitInterfaceName): Remove.
5489         (MemberBase.UpdateMemberName): Remove.
5490         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5491         (PropertyBase.SetMemberName): New override.
5492         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5493         (Tree.GetDecl): New.
5494         (Tree.AllDecls): Rename from Decls.
5495         * attribute.cs, enum.cs, report.cs: Update to changes.
5496         * driver.cs (MainDriver): Use MemberName.FromDotted on
5497         RootContext.MainClass.
5498
5499 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5500
5501         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5502         checks.
5503
5504         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5505
5506 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5507
5508         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5509         property accessor modifiers.
5510
5511         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5512         fixed buffer attribute (CS1716).
5513         (PropertyMethod.HasCustomAccessModifier): When property accessor
5514         has custom modifier.
5515
5516         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5517         modifiers.
5518         (PropertyExpr.DoResolveLValue): Add CS0272.
5519
5520 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5521
5522         * convert.cs: When converting to a pointer, use the proper Conv.U
5523         or Conv.I depending on the source data type.
5524
5525         * cs-tokenizer.cs: Make the size for large decimal constants,
5526         fixes #72957.
5527
5528 2005-03-17  Martin Baulig  <martin@ximian.com>
5529
5530         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5531         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5532
5533 2005-03-17  Martin Baulig  <martin@ximian.com>
5534
5535         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5536         to bool so we can return an error condition.
5537         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5538         returned an error.
5539
5540 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5541
5542         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5543         attributes.
5544
5545 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5546
5547         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5548         Refactor to avoid traversing the list of assemblies, and to avoid
5549         string concatenation.
5550         * typemanager.cs (guid_attr_type): Remove.
5551         (negative_hits, pointers, references): Remove hashes.
5552         (type_hash): New.
5553         (GetConstructedType): New.  Uses type_hash to handle constructed
5554         types (arrays, references, pointers).
5555         (GetReferenceType, GetPointerType): Use it.
5556         (GetNestedType): New.  Uses type_hash to handle nested types of
5557         reflected types.
5558         (LookupType, LookupTypeDirect): Remove.
5559         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5560         'types' hash and LookupTypeReflection directly.
5561         (params_string, params_object): Use GetConstructedType.
5562         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5563         top-level types.
5564         (Namespace.Lookup): Use cached_types.
5565         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5566         provided by old TypeManager.LookupType.
5567         * rootcontext.cs (MakeFQN): Remove.
5568         * decl.cs (DeclSpace.MakeFQN): Likewise.
5569         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5570         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5571         TypeManager.GetConstructedType.
5572         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5573
5574 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
5575
5576         * cs-parser.jay: Fix build.
5577
5578 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5579
5580         * class.cs (TypeContainer.CircularDepException) New nested
5581         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5582
5583         * cs-parser.jay: Reports CS1527 for any namespace element.
5584
5585         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5586         Added CS0407.
5587
5588         * expression.cs (ParameterReference.IsAssigned): Changed error to
5589         CS0269.
5590         (Error_WrongNumArguments): Moved CS0245 detection here.
5591
5592         * statement.cs (Return.Resolve): Add CS1622 report.
5593
5594 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5595
5596         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5597
5598 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5599
5600         * attribute.cs expression.cs: Get rid of some allocations.
5601
5602 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5603
5604         * doc.cs : just eliminate the latest change.
5605
5606 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5607
5608         * doc.cs : commented out the latest change. It breaks xml-030.cs
5609
5610 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5611
5612         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5613           fail. So invoke CreateType() in FindDocumentedType().
5614
5615 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5616
5617         * cs-tokenizer.cs : added IsKeyword().
5618         * doc.cs : Detect keyword incorrectly used as identifier.
5619           Allow identifiers prefixed by @.
5620
5621 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5622
5623         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5624         It caused exception in namespace resolving (again!).
5625         
5626         * class.cs (Class.ctor): Removed exit.
5627         (PropertyMethod.ctor): ditto.
5628         
5629         * codegen.cs (Codegen.Reset): Reset static data.
5630         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5631         
5632         * cs-tokenizer.cs (Cleanup): Removed.
5633         
5634         * driver.cs (GetSystemDir): Rewrote to one line command.
5635         It caused problem with unloaded dynamic modules.
5636         (UnixParseOption): Removed Exit.
5637         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5638         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5639         Now can be mcs used as library.
5640         
5641         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5642         empty location.
5643         
5644         * location.cs (Reset): Reset static data.
5645         
5646         * namespace.cs (Reset): Reset static data.
5647         
5648         * report.cs (Report.Reset): Reset static data.
5649         
5650         * rootcontext.cs (RootContext.Reset): Reset static data.
5651         
5652         * tree.cs (RootTypes.ctor): Use Location.Null
5653         
5654         * typemanager.cs (TypeManager.Reset): Reset static data.
5655         (CoreLookupType): Removed Exit.
5656         (TypeHandle.Reset): Reset static data.
5657         
5658 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5659
5660         Fix #73516.
5661         * typemanager.cs (ComputeNamespaces): Import namespaces from
5662         referenced modules too.
5663
5664 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5665
5666         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5667         than '.'.
5668
5669 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5670
5671         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5672         enclosing DeclSpace.  This ensures that a name-lookup populates
5673         more caches and there are fewer 'TypeExpression's.  Carve out
5674         nested type lookup into ...
5675         (LookupNestedTypeInHierarchy): ... this.
5676
5677 2005-04-15  Martin Baulig  <martin@ximian.com>
5678
5679         Merged r41590 from MCS and make it work in the generics land.
5680
5681         * generic.cs (TypeParameter.UpdateConstraints): Removed the
5682         `check' argument.
5683
5684         * class.cs (PartialContainer.UpdateConstraints): Removed.
5685         (PartialContainer.CheckConstraints): Removed.
5686         (PartialContainer.SetParameterInfo): Store the constraints here.
5687         (PartialContainer.DefineTypeParameters): New public method;
5688         resolve the type parameter's constraints here.  Note that the
5689         PartialContainer doesn't have an EmitContext anymore, so we must
5690         do this in the ClassPart.
5691
5692 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5693
5694         Clean up a few partial-class semantics.  
5695         Fixes test-357.cs and cs1618-2.cs.
5696         * cs-parser.jay (struct_declaration): Use 'current_class' as
5697         parent of newly-created struct.  Remove call to Register ().
5698         Use 'pop_current_class' to complete handing the current struct.
5699         (interface_declaration): Likewise.
5700         (class_declaration): Likewise.
5701         (enum_declaration): Use 'current_class' as parent of newly created
5702         enum.
5703         (delegate_declaration): Likewise.
5704         (pop_current_class): New function.  This is used to handle closing
5705         up the 'current_class' and 'current_container', and pointing them
5706         to the enclosing class/container.
5707         (CSharpParser): Initialize 'current_class' too.
5708         * decl.cs (MemberCore): Add check for invariant: a partial
5709         container is not a parsed entity, and thus does not enclose any
5710         parsed members.
5711         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5712         (DeclSpace.BaseTypeExpr): Use it.
5713         (DeclSpace.LookupType): Add check for invariant.
5714         * class.cs (TypeContainer): Add check for invariant: a nested
5715         class should have the same NamespaceEntry as its enclosing class.
5716         (TypeContainer.EmitFieldInitializers): Make virtual.
5717         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5718         MemberCore.
5719         (TypeContainer.Register): Remove.
5720         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5721         null.  Use TypeResolveEmitContext for resolving base types and
5722         interfaces.  Move initialization of Parts.TypeBuilder here from
5723         ...
5724         (TypeContainer.DefineNestedTypes): ... here.
5725         (PartialContainer): Take a Namespace not a NamespaceEntry.
5726         (PartialContainer.Create): Don't use Register.  Call the
5727         appropriate Add... function directly.
5728         (ClassPart): Take both the PartialContainer and the enclosing
5729         class as constructor arguments.
5730         (ClassPart.EmitFieldInitializers): Override.
5731         (ClassPart.PartFindNestedTypes): Remove.
5732         (FieldBase.GetInitializerExpression): Resolve the initializer
5733         expression in the emit context of the enclosing class.
5734         * tree.cs (RootTypes): Remove Register ().
5735         
5736 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5737
5738         * cs-parser.jay: Removed CS0134.
5739         
5740         * driver.cs: Removed CS1901.
5741         
5742         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5743         for predefined types.
5744
5745 2005-03-07  Duncan Mak  <duncan@novell.com>
5746
5747         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5748         well. Fixes bug #73454.
5749
5750 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5751
5752         * cs-tokenizer.cs (xtoken): Add CS1035.
5753         
5754         * class.cs (MethodData.Define): Add CS0683.
5755         (FieldMember.ctor): Add CS0681.
5756
5757 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5758
5759         * ecore.cs (SimpleName.DoResolve): Rename from
5760         SimpleName.DoResolveAllowStatic.
5761         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5762         Pass 'intermediate' flag to MemberStaticCheck.
5763         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5764         of "intermediate" lookups via MemberAccess.
5765         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5766         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5767
5768 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5769
5770         Fix #73394.
5771         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5772         slipped in because of variable names that are identical to a
5773         builtin type's BCL equivalent ('string String;', 'int Int32;').
5774         (PropertyExpr.EmitInstance): Likewise.
5775
5776 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5777
5778         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5779         
5780         * report.cs (warning_ignore_table): Made public.
5781
5782 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5783
5784         Fix #73282.
5785         * class.cs (MethodData.Emit): Pass 'container' to
5786         container.GetObsoleteAttribute instead of 'container.Parent'.
5787
5788 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5789
5790         * cs-parser.jay: Add 1534 error test.
5791
5792         * iterators.cs (Yield.CheckContext): Add error 1629.
5793         (Iterator.ctor): Save unsafe modifier.
5794         (MoveNextMethod.DoEmit): Restore unsafe context.
5795
5796         * namespace.cs (UsingAlias): Better error message.
5797
5798 2005-03-03  Dan Winship  <danw@novell.com>
5799
5800         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5801         the warning message [#73219]
5802
5803 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5804
5805         Fix compile with MCS 1.0.0.0.
5806         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5807         w_restore to not depend on string constant folding.
5808
5809 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5810
5811         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5812         CS0246 check to users who passed 'silent = false'.
5813         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5814         check.
5815         (SimpleName.SimpleNameResolve): Update.
5816         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5817         (MemberAccess.IdenticalNameAndTypeName): Update.
5818         * doc.cs (FindDocumentedTypeNonArray): Update.
5819
5820 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5821
5822         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5823         * parameters.cs (ComputeAndDefineParameters): Remove.
5824         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5825         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5826         Use GetParameterInfo.
5827
5828 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5829
5830         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5831
5832 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5833
5834         Unify DeclSpace.LookupType and DeclSpace.FindType.
5835         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5836         is in charge of defining nested types on demand.
5837         (DeclSpace.LookupType): Use it when the current_type is a
5838         TypeBuilder.  Use LookupTypeDirect for reflected types.
5839         (DeclSpace.FindType): Remove.
5840         (DeclSpace.LookupInterfaceOrClass): Likewise.
5841         (DeclSpace.DefineTypeAndParents): Likewise.
5842         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5843         DeclSpace.LookupType.
5844         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5845         * typemanager.cs (LookupType): Simplify.
5846         (AddUserType): Remove type from negative_hits.
5847         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5848         * class.cs (TypeContainer.FindMembers): Move handling of nested
5849         types ...
5850         (TypeContainer.FindMembers_NestedTypes): ... here.
5851         (TypeContainer.FindNestedType): Implement override.
5852         (ClassPart.FindNestedType): Delegate to PartialContainer.
5853         (ClassPart.PartFindNestedType): Looks up the nested types of the
5854         part alone.
5855
5856 2005-04-14  Martin Baulig  <martin@ximian.com>
5857
5858         * generic.cs (ConstructedType): Moved all the type lookup and
5859         nested class logic into SimpleName.
5860         (ConstructedType.ResolveConstructedType): Our underlying type is
5861         already fully resolved; all the type lookup stuff is in
5862         SimpleName.
5863
5864         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5865         constructed types here instead of in ConstructedType.
5866
5867         * decl.cs (MemberName.GetTypeExpression): Always create a
5868         SimpleName, not a ConstructedType.
5869         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5870
5871 2005-03-02  Martin Baulig  <martin@ximian.com>
5872
5873         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5874         static constructor in static classes.
5875
5876 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5877
5878         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5879         sizeParamIndex is not specified.
5880
5881 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5882
5883         Fix #73117
5884         * report.cs (WarningMessage.IsEnabled): Missing null check.
5885
5886 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5887
5888         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5889         in the fields and not in the properties.
5890
5891 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5892
5893         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5894         fields as well.
5895
5896 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5897
5898         * attribute.cs: Small refactoring (improved robustness).
5899         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5900         (ValidateGuid): Removed.
5901         (Resolve): Removed referenced to above mentioned.
5902         (GetAttributeUsage): Made private and changed to work without
5903         class assistance.
5904         (GetIndexerAttributeValue): Don't crash.
5905         (GetConditionalAttributeValue): Ditto.
5906         (GetClsCompliantAttributeValue): Ditto.
5907         (ExtractSecurityPermissionSet): All attributes exceptions are
5908         error 648.
5909         (GetPropertyValue): New helper.
5910         (GetMethodImplOptions): New method.
5911         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5912         some missing properties.
5913         
5914         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5915         (Method.ApplyAttributeBuilder): Updated.
5916         
5917         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5918         exception.
5919
5920 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5921
5922         Fix #73052.
5923         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5924         non-simple types (array, pointer, reference).
5925
5926 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5927
5928         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5929
5930         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5931         for operators.
5932         (Method.CheckBase): Catch wrong destructor here.
5933         (MethodData.Define): Add errors 550, 668.
5934
5935         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5936
5937         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5938
5939         * pending.cs (VerifyPendingMethods): Add error 551.
5940
5941         * typemanager.cs (CSharpName): Next error report helper.
5942
5943 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5944
5945         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5946         attributes. Removed useless attribute double check.
5947         It saves almost 2MBs for corlib.
5948
5949 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5950
5951         Fix #72924.
5952         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5953         called twice in case of error.
5954
5955 2005-02-23  Chris Toshok  <toshok@ximian.com>
5956
5957         Fix compiler portions of #72827.
5958         * statement.cs (Block.Emit): call Begin/EndScope on the
5959         EmitContext instead of the ILGenerator.
5960
5961         * codegen.cs (EmitContext.BeginScope): new method, call
5962         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5963         we have one.)
5964         (EmitContext.BeginScope): same, but EndScope and CloseScope
5965
5966         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5967         offset and call the superclass's OpenScope(int) with it.
5968         (SymbolWriter.CloseScope): get the current il
5969         offset and call superclass's CloseScope(int) with it.
5970
5971 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5972
5973         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5974         CS1677 for out and ref as well.
5975
5976         * class.cs (Method.Define): Add error CS1599 detection.
5977         
5978         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5979         
5980         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5981         
5982         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5983         
5984         * support.cs.cs (ModifierDesc): New helper method.
5985
5986 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5987             Abin Thomas  <projectmonokochi@rediffmail.com>
5988             Anoob V E  <projectmonokochi@rediffmail.com>
5989             Harilal P R  <projectmonokochi@rediffmail.com>
5990
5991         Fix #57851, #72718.
5992         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5993         MemberLookup (used for error reporting) actually returns a result.
5994         Fix error report number (122, not 112).
5995
5996 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5997             Anoob V E  <projectmonokochi@rediffmail.com>
5998             Harilal P R  <projectmonokochi@rediffmail.com>
5999
6000         Fix #71134.
6001         * pending.cs (PendingImplementation.GetAbstractMethods):
6002         Find NonPublic members too.
6003
6004 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6005
6006         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6007         Fixed error 217.
6008         
6009         * class.cs (MethodCore.CheckMethodAgainstBase):
6010         Add error 239 report.
6011
6012 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6013
6014         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6015         
6016         * class.cs (Operator.Define): Add error 217 report.
6017         
6018 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6019
6020         Fix #68955.
6021         * expression.cs (Invocation.IsApplicable): Make public.
6022         (Invocation.IsParamsMethodApplicable): Likewise.
6023         * delegate.cs (Delegate.VerifyApplicability): Don't use
6024         Invocation.VerifyArgumentCompat for parameter applicability
6025         testing.  Use Invocation.IsApplicable and
6026         Invocation.IsParamsMethodApplicable.
6027
6028 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6029
6030         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6031         
6032         * class.cs (Operator.Define): Add error 217 report.
6033         
6034 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6035
6036         * namespace.cs (UsingEntry.Resolve): Undo change below.
6037
6038 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6039
6040         Fix #72756.
6041         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6042         disable the error message when the extended MemberLookup also
6043         fails.
6044         (Expression.MemberLookupFinal): Update.
6045         (SimpleName.DoSimpleNameResolve): Update.
6046         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6047         Don't use MemberLookupFinal.
6048         (New.DoResolve): Update.
6049         (BaseAccess.CommonResolve): Update.
6050
6051 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6052
6053         Fix #72732.
6054         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6055         occured previously, don't resolve again.
6056
6057 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6058
6059         Fix #69949
6060         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6061         argument. Call ResolveAttributeUsage for unresolved.
6062         when types doesn't match ctor arguments.
6063         
6064         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6065         for nested attribute classes.
6066         (Class.attribute_usage): Removed.
6067         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6068         for attribute class.
6069         
6070         * ecore.cs (IsAttribute): Removed.
6071         
6072         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6073         
6074         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6075         now normal types.
6076         (attribute_types): Removed.
6077         (EmitCode): Global attributes are emited as the latest.
6078
6079 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6080
6081         * class.cs (EmitFieldInitializers): Don't emit field initializer
6082         for default values when optimilization is on.
6083         
6084         * constant.cs (Constant.IsDefaultValue): New property.
6085         
6086         * driver.cs: Add /optimize handling.
6087         
6088         * constant.cs,
6089         * ecore.cs,
6090         * literal.cs: Implement new IsDefaultValue property.
6091         
6092         * rootcontext.cs (Optimize): New field, holds /optimize option.
6093
6094 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6095
6096         Fix crasher in re-opened #72347.
6097         * namespace.cs (Namespace.Lookup): Return null if
6098         DeclSpace.DefineType returns null.
6099
6100         Fix #72678.
6101         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6102
6103 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6104
6105         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6106         now returns null if it cannot resolve to an lvalue.
6107         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6108         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6109         returned null.  Remove check for SimpleName.
6110         (EventExpr.DoResolveLValue): New.
6111         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6112         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6113         error from ...
6114         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6115         avoid CS0131 error.
6116         (Unary.ResolveOperator): Move CS0211 check ...
6117         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6118         CS0131 error.
6119         (Unary.DoResolveLValue): Simplify.
6120         (AddressOf.DoResolveLValue): New.
6121         (ArrayAccess.DoResolveLValue): New.
6122
6123 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6124
6125         * attribute.cs (Attribute.Resolve): Add arguments casting for
6126         when types doesn't match ctor arguments.
6127
6128 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6129
6130         Fix parts of #63202.
6131         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6132         lookup of operator in base type.  Ensure that all checks happen
6133         when the operator resolves to an "op_..." method.
6134
6135 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6136
6137         Fix #71992.
6138         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6139         'ignore_cs0104' parameter.  Pass it to ...
6140         (NamespaceEntry.Lookup): ... this.
6141         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6142         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6143         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6144         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6145         Update.  Request that cs0104 errors be ignored.
6146         (ComposedCast.ResolveAsTypeStep): Update.
6147
6148 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6149
6150         Fix #59209.
6151         * expression.cs (Invocation.BetterFunction): Remove support for
6152         comparing virtual functions and their overrides.
6153         (Invocation.IsOverride): New.
6154         (Invocation.OverloadResolve): Don't consider 'override' functions
6155         during candidate selection.  Store them in a lookaside list.
6156         If the selected method is a 'virtual' function, use the list to
6157         find any overrides that are closer to the LHS type.
6158
6159 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6160
6161         * expression.cs (New.DoResolve): Add complex core type reduction.
6162         (New.Constantify): Converts complex core type syntax like 'new int ()'
6163         to simple constant.
6164         
6165 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6166
6167         * decl.cs (EntryType.EntryType): New constructor to create an
6168         updated copy of a cache entry.
6169         (MemberCache.AddMethods): Use it.
6170         (MemberCache.ClearDeclaredOnly): Remove.
6171         (MemberCache.MemberCache): Update.
6172
6173 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6174
6175         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6176         variable.  This one is represents the actual low-level declaration
6177         of the method, as opposed to the semantic level `IsStatic'.   
6178
6179         An anonymous method which is hosted into a static method might be
6180         actually an instance method.  IsStatic would reflect the
6181         container, while MethodIsStatic represents the actual code
6182         generated.
6183
6184         * expression.cs (ParameterReference): Use the new MethodIsStatic
6185         instead of IsStatic.
6186
6187         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6188         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6189         set on the current EmitContext. 
6190
6191         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6192         resolve our casted expression as an LValue.  This triggers the
6193         proper LValue processing that is later required by Assign.
6194
6195         This fixes 72347.
6196
6197         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6198
6199 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6200
6201         C# 2.0 Fixed buffer implementation
6202
6203         * anonymous.cs: Update after RegisterHelperClass renaming.
6204
6205         * attribute.cs (AttributeTester.fixed_buffer_cache):
6206         Cache of external fixed buffers.
6207         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6208         implementation if field is fixed buffer else null.
6209
6210         * class.cs
6211         (TypeContainer.AddField): Accept FieldMember instead of Field.
6212         (FieldBase.IsFieldClsCompliant): Extracted code from
6213         VerifyClsCompliance descendant customization.
6214         (FixedField): New class handles fixed buffer fields.
6215         (FixedFieldExternal): Keeps information about imported fixed
6216         buffer.
6217         (IFixedField): Make access to internal or external fixed buffer
6218         same.
6219
6220         * cs-parser.jay: Add fixed buffer parsing.
6221
6222         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6223         buffer.
6224
6225         * expression.cs (Indirection): Extended implementation to accept
6226         fixed buffer field.
6227         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6228         (ElementAccess.MakePointerAccess): Get type as parameter.
6229         (DoResolve): Add fixed buffer field expression conversion.
6230         (DoResolveLValue): Ditto.
6231         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6232         (ArrayPtr): Derives from FixedBufferPtr.
6233         (ArrayPtr.Emit): Add extra emit for array elements.
6234
6235         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6236
6237         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6238         for compiler generated types.
6239         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6240
6241         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6242         and consume less memory.
6243         (Fixed.Resolve): Add fixed buffer case.
6244
6245         * typemanager.cs (compiler_generated_attr_ctor,
6246         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6247         (HasElementType): Add our own implementation to work on every
6248         runtime.
6249
6250 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6251
6252         * anonymous.cs (CaptureContext): Track whether `this' has been
6253         referenced.   
6254
6255         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6256         only captured `this' if it was implicitly done (instance
6257         methods/variables were used). 
6258
6259         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6260         `this' must be captured.
6261
6262 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6263  
6264         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6265         is null it means that there has been no need to capture anything,
6266         so we just create a sibling.
6267
6268         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6269
6270         Just a partial fix.  The other half is fairly elusive.
6271         
6272 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6273
6274         Fix #52586, cs0121-4.cs.
6275         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6276         and return a hashtable.
6277         (MemberCache.ClearDeclaredOnly): New.
6278         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6279         the method_hash of a base type too.
6280         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6281         type methods.  Overwrite entries with the same MethodHandle so
6282         that the ReflectedType is correct.  The process leaves in base
6283         virtual functions and their overrides as distinct entries.
6284         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6285         matters since it was boxed in a ArrayList before.
6286         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6287         modifier.
6288         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6289         case of a virtual function and its override (choose the overload
6290         as better).
6291         (Invocation.OverloadResolve): Avoid 'override' members during
6292         'applicable_type' calculation.
6293
6294 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6295
6296         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6297         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6298         GetTypeHandle.  It is possible for a reflected type to derive from
6299         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6300         System.Array during mscorlib compilation).
6301         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6302         contain a method_hash, don't create one either.  Don't create a
6303         deep copy of the base cache's method_hash.
6304         (MemberCache.SetupCache): Rename back from DeepCopy.
6305         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6306         already initialized.  If we see an override function, add its
6307         underlying base virtual function to the member_hash too.
6308
6309 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6310
6311         Combine two near-redundant caches.
6312         * typemanager.cs (method_params): Rename from method_internal_params.
6313         (TypeManager.GetParameterData): New.  Replace
6314         Invocation.GetParameterData.
6315         (TypeManager.LookupParametersByBuilder): Remove.
6316         * expression.cs (Invocation.method_parameter_cache): Remove.
6317         (Invocation.GetParameterData): Remove.
6318         Update to changes.
6319         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6320         Update to changes.
6321
6322 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6323
6324         Fix #72015.
6325         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6326         TypeManager.multicast_delegate_type is null, resolve it by looking
6327         up "System.MulticastDelegate".
6328         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6329
6330 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6331             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6332             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6333
6334         Fix cs0164.cs.
6335         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6336         (LabeledStatement.AddReference): New.  Set 'referenced'.
6337         (Goto.Resolve): Use it.
6338
6339 2005-02-05  John Luke  <john.luke@gmail.com>
6340
6341         * driver.cs: remove duplicate -doc line in Usage ()
6342
6343 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6344
6345         * location.cs (Location.AddFile): Fix CS2002 error report.
6346
6347 2005-02-02  Martin Baulig  <martin@ximian.com>
6348
6349         * delegate.cs (Delegate.DefineType): Report an internal error if
6350         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6351         details.        
6352
6353 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6354
6355         Fix a crasher in a variant of #31984.
6356         * const.cs (Constant.CheckBase): New override that defers the
6357         new-or-override check in case the base type hasn't been populated
6358         yet.
6359         (Constant.Define): Ensure the new-or-override check is performed.
6360
6361 2005-02-01  Duncan Mak  <duncan@ximian.com>
6362
6363         * const.cs (LookupConstantValue): Check that `ce' is not null
6364         before calling GetValue ().
6365
6366 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6367
6368         Fix test-334.cs (#69519).
6369         * cs-parser.jay (using_alias_directive): Pass in an expression to
6370         NamespaceEntry.UsingAlias.
6371         (using_namespace_directive): Pass in an expression to
6372         NamespaceEntry.Using.
6373         (namespace_name): Don't flatten to a string.
6374         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6375         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6376         ResolveAsTypeStep.
6377         (NamespaceEntry.UsingEntry): Likewise.
6378         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6379         changes.
6380         (NamespaceEntry.LookupForUsing): Remove.
6381         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6382         names.
6383         (NamespaceEntry.Lookup): Remove support for dotted names.
6384
6385 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6386
6387         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6388         split into two.
6389         (NamespaceEntry.ImplicitParent): Compute on demand.
6390         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6391         parallels the current.
6392         (NamespaceEntry.LookupForUsing): Use it.
6393         (NamespaceEntry.Lookup): If the current namespace-entry is
6394         implicit, don't search aliases and using tables.
6395
6396 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6397
6398         Fix #31984.
6399         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6400         BaseCache here.
6401         (TypeContainer.BaseCache): Compute on demand.
6402         (TypeContainer.FindMembers): Define constants and types if they're
6403         not already created.
6404         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6405         check.
6406         * const.cs (Constant.Define): Make idempotent.
6407
6408 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6409
6410         * pending.cs: Produce better code (no nops produced by using Ldarg
6411         + value).
6412         
6413         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6414         i - 1' it should be arg + 1.
6415
6416         Fixes bug #71819.
6417
6418 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6419
6420         * attribute.cs (Attribute.CheckAttributeType): Make private
6421         non-virtual.
6422         (Attribute.ResolveType): Make virtual.
6423         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6424         handling of RootContext.Tree.Types.
6425
6426 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6427
6428         Update attribute-handling to use the SimpleName/MemberAccess
6429         mechanisms.
6430         * cs-parser.jay (attribute): Pass in an expression to the
6431         constructors of Attribute and GlobalAttribute.
6432         * attribute.cs (Attribute): Take an expression for the name.
6433         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6434         passed in attribute name expression.
6435         (Attribute.CheckAttributeType): Use it.
6436         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6437         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6438         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6439         argument to prevent error messages if the lookup fails.
6440
6441 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6442
6443         * expression.cs (Indirection): Implemented IVariable interface
6444         to support indirection in AddressOf operator.
6445         (PointerArithmetic.Emit): Add optimalization for case where
6446         result can be precomputed.
6447
6448 2005-01-26  Martin Baulig  <martin@ximian.com>
6449
6450         * class.cs (TypeContainer.AttributeTargets): Return the correct
6451         AttributeTargets depending on our `Kind' instead of throwing an
6452         exception; fixes #71632.
6453
6454 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6455
6456         Fix #71257
6457         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6458         constant members.
6459
6460 2005-03-17  Martin Baulig  <martin@ximian.com>
6461
6462         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6463         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6464
6465 2005-03-17  Martin Baulig  <martin@ximian.com>
6466
6467         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6468         to bool so we can return an error condition.
6469         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6470         returned an error.
6471
6472 2005-03-17  Martin Baulig  <martin@ximian.com>
6473
6474         * generic.cs (TypeMananager.IsIEnumerable): New public method.
6475
6476         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6477         converting from an array-type of T to `IEnumerable<T>'.
6478
6479 2005-03-16  Martin Baulig  <martin@ximian.com>
6480
6481         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6482         (Nullable.LiftedUnaryMutator): New public class.
6483
6484         * expression.cs (UnaryMutator.DoResolve): Added support for
6485         Nullable Types.
6486
6487 2005-03-14  Martin Baulig  <martin@ximian.com>
6488
6489         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6490
6491 2005-03-14  Martin Baulig  <martin@ximian.com>
6492
6493         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6494         the comparision operators `<', `>', `<=' and `>='.
6495
6496 2005-03-13  Martin Baulig  <martin@ximian.com>
6497
6498         * generic.cs
6499         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6500         avoid confusion with the `NullLiteral'.
6501         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6502
6503 2005-03-13  Martin Baulig  <martin@ximian.com>
6504
6505         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6506         comparing arbitrary types with the null literal.
6507
6508 2005-03-13  Martin Baulig  <martin@ximian.com>
6509
6510         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6511         boolean operators '&&', '||', '&' and '|'.
6512         (Nullable.OperatorTrueOrFalse): New public class.
6513
6514         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6515         instead of a `StaticCallExpr'; added support for nullables.
6516
6517 2005-03-10  Martin Baulig  <martin@ximian.com>
6518
6519         * expression.cs
6520         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6521         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
6522
6523 2005-03-07  Martin Baulig  <martin@ximian.com>
6524
6525         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6526         it work if `expr' is not an IMemoryLocation.
6527         (Nullable.Lifted): Implement IMemoryLocation.
6528         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6529         target type.
6530
6531 2005-03-05  Martin Baulig  <martin@ximian.com>
6532
6533         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6534         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6535         (Nullable): Added support for lifted unary and binary operators.
6536
6537         * expression.cs (Unary.DoResolve): Added support for nullable types.
6538         (Binary.DoResolve): Likewise.
6539         (Conditional.DoResolve): Likewise.
6540
6541 2005-03-02  Martin Baulig  <martin@ximian.com>
6542
6543         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6544
6545         * class.cs (ClassPart.SetParameterInfo): Override this.
6546         (PartialContainer.SetParameterInfo): Override this.
6547         (TypeContainer.CheckConstraints): New protected method.
6548         (PartialContainer.CheckConstraints): Override this and check
6549         whether the same contraints were specified in all parts of a
6550         partial generic type definition.
6551         (PartialContainer.UpdateConstraints): New public method.
6552
6553         * generic.cs (TypeParameter.UpdateConstraints): New public method.
6554
6555 2005-03-02  Martin Baulig  <martin@ximian.com>
6556
6557         Committing a patch from Carlos Alberto Cortez to fix #72887.
6558
6559         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6560         casts from `T []' to `int []'.
6561
6562 2005-03-02  Martin Baulig  <martin@ximian.com>
6563
6564         * generic.cs (TypeManager.IsEqual): Make this symmetric.
6565
6566         * expression.cs (Binary.ResolveOperator): When resolving a
6567         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6568         `=='.  Fixes #71866.  See gen-127.cs.
6569
6570 2005-03-02  Martin Baulig  <martin@ximian.com>
6571
6572         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6573         static constructor in static classes.
6574
6575 2005-03-02  Martin Baulig  <martin@ximian.com>
6576
6577         * generic.cs
6578         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6579         (Nullable.LiftedConversion): Added support for user-defined
6580         conversions.
6581
6582         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6583
6584         * cs-parser.jay: Use ComposedCast everywhere instead of
6585         NullableType, so we don't need to check for NullableType
6586         everywhere.
6587         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6588         case where we'll be resolved into a `parenthesized_expression_0'
6589         afterwards.
6590
6591         * convert.cs
6592         (Convert.UserDefinedConversion): Added nullable conversions.
6593
6594 2005-02-28  Martin Baulig  <martin@ximian.com>
6595
6596         * generic.cs (TypeManager.IsNullableType): New static method.
6597         (Nullable): New abstract class.
6598         (Nullable.NullLiteral): New public class.
6599         (Nullable.LiftedConversion): New public class.
6600
6601         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6602         `builtin_types opt_nullable'.
6603
6604         * convert.cs
6605         (Convert.ImplicitConversionStandard): Added nullable conversions.
6606         (Convert.ExplicitConversionStandard): Likewise.
6607         (Convert.ExplicitConversion): Likewise.
6608
6609 2005-02-26  Martin Baulig  <martin@ximian.com>
6610
6611         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6612         begin with a "?", for instance "?[]".  Don't do a type lookup if
6613         `dim' is empty.
6614
6615 2005-02-25  Martin Baulig  <martin@ximian.com>
6616
6617         The first part of Nullable Types :-)
6618
6619         * generic.cs (NullableType): New public class.
6620         (NullCoalescingOperator): New public class.
6621         (TypeArguments.Resolve): Add a CS0306 check.
6622
6623         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6624         (opt_nullable): New rule.
6625         (type): Added `opt_nullable' to `namespace_or_type_name',
6626         `builtin_types' and `pointer_type'.
6627         (array_type): Added `opt_nullable'.
6628         (opt_rank_specifier_or_nullable): New rule; this is the
6629         combination of `opt_rank_specifier' and `opt_nullable'.
6630         (opt_error): New rule; catch errors here.
6631         (nullable_type_or_conditional): New rule; we use this to check for
6632         nullable and still detect the conditional operator.
6633         (local_variable_type): Use `opt_rank_specifier_or_nullable'
6634         instead `opt_rank_specifier'.
6635
6636         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6637         for nullables.
6638
6639 2005-02-24  Martin Baulig  <martin@ximian.com>
6640
6641         * README, README.Changes: Removed; they're old and obsolete.
6642
6643 2005-02-22  Martin Baulig  <martin@ximian.com>
6644
6645         * generic.cs (TypeParameter.Resolve): If resolving the constraints
6646         returned an error, set `constraints' to null to avoid a crash
6647         later on.
6648         (TypeParameter.ResolveType): Likewise.
6649
6650 2005-02-22  Martin Baulig  <martin@ximian.com>
6651
6652         * generic.cs
6653         (Constraints.ResolveTypes): Protect against being called twice.
6654         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6655         (TypeParameter.ResolveType): New public method; calls
6656         constraints.ResolveTypes().
6657         (TypeParameter.DefineType): Moved constraints.ResolveType() out
6658         into the new ResolveType().
6659         (GenericMethod.Define): Call ResolveType() on all our
6660         TypeParameter's.        
6661
6662 2005-02-21  Martin Baulig  <martin@ximian.com>
6663
6664         * generic.cs
6665         (TypeManager.generic_nullable_type): New static public field.
6666         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6667
6668         * rootcontext.cs
6669         (RootContext.ResolveCore): Resolve "System.Nullable`1".
6670
6671 2005-02-15  Martin Baulig  <martin@ximian.com>
6672
6673         * generic.cs (ConstructedType.Constraints): Correctly check
6674         constraints if the argument type is a type parameter; fixes
6675         #72326. 
6676
6677 2005-02-02  Martin Baulig  <martin@ximian.com>
6678
6679         * delegate.cs (Delegate.DefineType): Report an internal error if
6680         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6681         details.        
6682
6683 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6684
6685         * pending.cs: Produce better code (no nops produced by using Ldarg
6686         + value).
6687         
6688         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6689         i - 1' it should be arg + 1.
6690
6691         Fixes bug #71819.
6692         
6693 2005-01-26  Martin Baulig  <martin@ximian.com>
6694
6695         * cs-parser.jay (indexer_declarator): Don't report an error if we
6696         have type parameters since we can be an explicit interface
6697         implementation; fixes #71449.
6698
6699 2005-01-26  Martin Baulig  <martin@ximian.com>
6700
6701         * class.cs (TypeContainer.AttributeTargets): Return the correct
6702         AttributeTargets depending on our `Kind' instead of throwing an
6703         exception; fixes #71632.
6704
6705 2005-01-26  Martin Baulig  <martin@ximian.com>
6706
6707         * delegate.cs (Delegate.DefineType): Correctly define our type
6708         parameters.  Fixes #71483.
6709
6710 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6711
6712         Fix #71602.
6713         * expression.cs (MemberAccess.DoResolve): Don't complain with
6714         cs0572 when the LHS of a member access has identical name and type
6715         name.
6716
6717 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6718
6719         Fix #71651, #71675
6720         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6721         CreatePermission.
6722         Create custom PermissionSet only for PermissionSetAttribute.
6723
6724 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6725
6726         Fix #71649
6727         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6728         delegates in static class.
6729
6730 2005-01-24  Martin Baulig  <martin@ximian.com>
6731
6732         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6733         merging an implicit block, just use its reachability.
6734
6735         * statement.cs (Block.Resolve): Make the unreachable code check
6736         work wrt. implicit blocks; see test-337 from #63842.
6737
6738 2005-01-21  Alp Toker  <alp@atoker.com>
6739  
6740         * cs-parser.jay: destructor_declaration's container is PartialContainer
6741         not Class when partial types are used, so use Kind prop instead of
6742         'is'.
6743         
6744 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6745
6746         * cs-parser.jay: Improve error reporting when an interface
6747         declares new types.
6748
6749 2005-01-20  Dick Porter  <dick@ximian.com>
6750
6751         * support.cs: SeekableStreamReader fix from Sandor Dobos
6752         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6753         chars are read.  Fixes bug 70369.
6754
6755 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6756
6757         * cs-parser.jay (catch_clause): Simplify current_block handling
6758         somewhat.
6759
6760 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6761
6762         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6763         code with ImplicitStandardConversion to handle the implicit
6764         conversion of method groups into valid delegate invocations. 
6765
6766         The problem is that in parameter handling we were using this code
6767         path.  Fixes bug #64698
6768
6769 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6770
6771         * cs-parser.jay: Fix several infelicities.
6772         - Avoid assigning to the parser value stack.  Code like 
6773           '$3 = null' is unclean.  Synthesize a value for the code block
6774           instead. 
6775         - Avoid using oob_stack for storing location information.  Use ...
6776         (_mark_): ... this.  New (empty) rule.  Saves the current location
6777         in $$.
6778         (foreach_statement): Avoid using oob_stack for current_block
6779         handling.  Use technique used in for_statement and
6780         using_statement.  Synthesize a value for the code block to store
6781         additional intermediate information.
6782
6783 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6784
6785         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6786         of a different type is only allowed to private fields of a
6787         containing type, not on fields of a base class.
6788
6789         See test-174.cs and error cs0122-9.cs
6790
6791 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6792
6793         Fix test-335.cs (bug #58126).
6794         * cs-parser.jay (argument): Split out non-expression parts of the
6795         rule into 'non_simple_argument'.
6796         (invocation_expression): Support parenthesized invocations with
6797         multiple arguments, and with single non-simple arguments.
6798
6799 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6800
6801         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6802         places.
6803
6804 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6805
6806         Fix cs0038-1.cs, cs1640-6.cs.
6807         * ecore.cs (Expression.Resolve): Remove special-case for
6808         SimpleName in error-handling.
6809         (Expression.almostMatchedMembers): Relax access permission to
6810         protected.
6811         (Expression.MemberLookupFailed): Handle duplicates in
6812         almostMatchedMembers list.
6813         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6814         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6815         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6816         overload if the passed in MemberInfo is a MethodBase.
6817
6818 2005-01-25  Martin Baulig  <martin@ximian.com>
6819
6820         * doc.cs
6821         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6822
6823 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6824
6825         Fix #70749
6826         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6827         for non-CAS & merge permission sets properly.
6828
6829 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6830
6831         Improve standard-compliance of simple name and member access 
6832         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6833         * ecore.cs (FullNamedExpression): New abstract base class 
6834         for Namespaces and TypeExpressions.
6835         (ResolveFlags.SimpleName): Remove.
6836         (SimpleName): Remove support for dotted names.
6837         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6838         DeclSpace.FindType and DeclSpace.LookupType.
6839         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6840         (Expression.ExprClassName): Make member function.
6841         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6842         a namespace.  Remove creation of dotted "SimpleName"s.
6843         (MemberAccess.DoResolve): Likewise.
6844         * decl.cs (DeclSpace.Cache): Make private.
6845         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6846         (DeclSpace.FindType): Update.
6847         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6848         FullNamedExpression.
6849         * namespace.cs (Namespace): Derive from FullNamedExpression
6850         so that it can be part of expression resolution.
6851         (Namespace.Lookup): Return an FullNamedExpression.
6852         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6853         namespace.
6854         * rootcontext.cs (NamespaceLookup): Remove.
6855         (LookupType): Move to DeclSpace.
6856         * attribute.cs (CheckAttributeType): Update.
6857         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6858         (FindDocumentedTypeNonArray): Likewise.
6859
6860 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6861
6862         Fix cs0509.cs, cs1632.cs.
6863         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6864         is the same as IsInterface.
6865         (TypeContainer.GetClassBases): Likewise.
6866         * statement.cs (LabeledStatement.ig): New field.
6867         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6868         label.
6869         (LabeledStatement.DoEmit): Check that the label was created with
6870         the same ILGenerator.
6871
6872 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6873
6874         Fix #71058
6875         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6876         accessors to its properties.
6877
6878         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6879         from accessors to property.
6880         
6881 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6882
6883         Fix #70722
6884         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6885         only for overrides.
6886         
6887 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6888
6889         * attribute.cs: Check for null and empty strings.  
6890
6891         I have lost another battle to Paolo.
6892
6893 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6894
6895         Fix #70942
6896         * class.cs (PropertyMethod): Set Parent field in ctors.
6897         (SetMethod.InternalParameters): Add unsafe switch hack.
6898         Override MarkForDuplicationCheck where it is appropriate.
6899
6900         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6901         It says whether container allows members with the same name.
6902         Base default is no.
6903         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6904         Removed is_method parameter.
6905
6906 2005-01-06  Duncan Mak  <duncan@ximian.com>
6907
6908         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6909         because the previous change led to incorrect reporting of CS1032
6910         ("Cannot define/undefine preprocessor symbols after first token in
6911         file"). Instead of using `tokens_seen' as the only flag that
6912         triggers CS1040, introduce `comments_seen'. This new flag is used
6913         to signify having seen comments on the current line, so it is
6914         unset after a newline.
6915
6916 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6917
6918         * doc.cs : When searching for a type, find nested type too.
6919           This fixes bug #71040.
6920
6921 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6922
6923         * doc.cs :
6924           - Warn missing member comment on those classes which also does not
6925             have doc comments. Fixed bug #71041.
6926           - Don't warn missing doc comment on default constructor.
6927             Fixed bug #71042.
6928
6929 2005-01-06  Duncan Mak  <duncan@ximian.com>
6930
6931         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6932         comments, set `tokens_seen' to true. This allows us to detect
6933         misplaced preprocessor directives (i.e. not at the beginning of
6934         the a line, nor after whitespaces). In that case, report error
6935         CS1040. This fixes bug #56460.
6936
6937         * cs-parser.jay (interface_member_declaration): Add checks for
6938         IsExplicitImpl, and report CS0541 error if an interface member is
6939         defined as an explicit interface declaration.
6940
6941 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6942
6943         Fix #70817
6944         * class.cs (PropertyMethod): Set Parent field in ctors.
6945         (SetMethod.InternalParameters): Add unsafe switch hack.
6946         
6947         * decl.cs (MemberCore.Parent): Cannot be readonly.
6948
6949 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6950
6951         * decl.cs (DeclSpace.ResolveType): Remove.
6952         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6953         Merge in code from ...
6954         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6955         * class.cs, enum.cs: Update to changes.
6956
6957 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
6958
6959         * anonymous.cs: Ensure that we init the scope of our parent if it
6960         has not been initialized yet.
6961
6962 2004-12-30  Duncan Mak  <duncan@ximian.com>
6963
6964         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
6965         if field.FieldBuilder is null. Fixes #70758.
6966
6967         * convert.cs: Fixed some typos and updated some of the comments.
6968         (ImplicitStandardConversionExists):
6969         (TryImplicitIntConversion): If `target_type' is an interface and
6970         the type of `ic' implements this interface, return true or a new
6971         BoxedCast instead of null. This fixes #70468.
6972
6973 2004-12-29  Duncan Mak  <duncan@ximian.com>
6974
6975         * expression.cs (Argument.Emit): Check that Expr is
6976         IMemoryLocation before casting to it, and report CS1510 otherwise.
6977
6978         This fixes #70402.
6979
6980 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
6981
6982         * statement.cs (Block.ThisVariable): remove the recursion here, to
6983         make the --profile more sane.
6984
6985 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
6986
6987         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
6988         assembly, by JB Evain.
6989
6990 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6991
6992         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
6993           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
6994         "parent" refers to enclosing type/class.  "base" refers to superclass.
6995
6996 2004-12-17  Raja R Harinath  <rharinath@novell.com>
6997
6998         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
6999         Ensure that we only have GlobalAttributes.
7000         * attribute.cs (Attribute.Emit): Make non-virtual.
7001         (GlobalAttribute.Emit): Remove.
7002         (Attribute.Resolve): Make virtual.
7003         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7004         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7005         the argument. Don't create one.
7006         (Attribute.GetObsoleteAttribute): Likewise.
7007         (Attribute.GetClsCompliantAttributeValue): Likewise.
7008         * class.cs, decl.cs: Update to changes.
7009
7010 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7011
7012         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7013         
7014         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7015         
7016         * statement.cs (Foreach.Resolve): Add error 186 report.
7017
7018 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7019
7020         * expression.cs (Conditional.DoResolve): Add warning 429.
7021         
7022         * statement.cs (If.Resolve): Add warning 665.
7023
7024 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7025
7026         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7027         except when in the parser, and in GlobalAttribute.
7028         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7029         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7030         RootContext.Tree.Types.NamespaceEntry once work is done.
7031         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7032         and resets RootContext.Tree.Types.NamespaceEntry.
7033
7034 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7035
7036         * cs-parser.jay: Don't create a block for every variable.
7037
7038 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7039
7040         * location.cs: Provide extra information.
7041
7042         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7043         variables from the captured environment, it is the ldarg_0.
7044
7045 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7046
7047         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7048         find a conclusion.
7049         
7050         * class.cs: Changed warning level for 169 to avoid developer
7051         displeasure from warning flooding. It will be changed back when they
7052         fix most of current BCL warnings.
7053         
7054         * RootContext.cs: Pushed default WarningLevel to 3.
7055         
7056         * statement.cs: Removed unused variable.
7057
7058 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7059
7060         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7061         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7062         Add error 502 report.
7063         (StaticClass.DefineType): Add error 441 report.
7064         (Class.AllowedModifiersProp): New virtual property as temporary
7065         extension to AllowedModifiers.
7066         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7067         to share implementation with StaticClass and don't call virtual
7068         methods from ctor.
7069         
7070         * driver.cs (MainDriver): Add error 1558 test.
7071
7072         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7073         report. Moved error 36 test here.
7074
7075         * statement.cs (Throw.Resolve): Add error 724 report.
7076
7077         * typemanager.cs: Add out_attribute_type core type.
7078         
7079 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7080
7081         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7082         3018 report.
7083         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7084
7085         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7086         3017 report.
7087         
7088         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7089
7090         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7091         Add error 3023 report.
7092         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7093
7094         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7095         implementation.
7096
7097 2004-12-12  John Luke  <john.luke@gmail.com>
7098
7099         * driver.cs (AddArgs): take -- into account when
7100         adding arguments, fixes bug 65710 
7101
7102 2004-12-12  Martin Baulig  <martin@ximian.com>
7103
7104         * expression.cs (Unary.TryReduceNegative): Added support for
7105         SByteConstant and ByteConstant.
7106         (Unary.Reduce): Check error values from TryReduceNegative().
7107
7108 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7109
7110         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7111         and report exception as error 182.
7112
7113 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7114
7115         * driver.cs (Main): Fix message when there are warnings.
7116
7117 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7118
7119         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7120
7121 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7122
7123         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7124         Reduced number of warnings.
7125         
7126         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7127
7128 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7129
7130         * driver.cs: Removed message.
7131
7132         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7133
7134 2004-12-08    <vargaz@freemail.hu>
7135
7136         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7137
7138 2004-12-08  Martin Baulig  <martin@ximian.com>
7139
7140         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7141         instead of a CS3002 for properties and indexer.
7142
7143 2004-12-08  Martin Baulig  <martin@ximian.com>
7144
7145         * decl.cs (MemberName.ToString): Make this work again.
7146
7147 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7148
7149         * attribute.cs (Resolve): Add error 591 detection.
7150
7151         * class.cs (FieldMember.Define): Add error 1547 detection.
7152         (Indexer.Define): Add error 620 detection.
7153         (Operator.Define): Add error 590 detection.
7154
7155         * ecore.cs: Missing argument for error 79.
7156
7157         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7158         detection.
7159
7160 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7161
7162         Fix #70106
7163         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7164         only.
7165
7166 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7167
7168         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7169           Some operator comments were suppressed.
7170         * doc.cs : Implicit/explicit operator name in doc comments are like
7171           "op_Explicit(type)~returnType", so added suffix handling.
7172
7173 2005-01-21  Alp Toker  <alp@atoker.com>
7174
7175         * cs-parser.jay: destructor_declaration's container is PartialContainer
7176         not Class when partial types are used, so use Kind prop instead of 'is'.
7177
7178 2004-12-12  Martin Baulig  <martin@ximian.com>
7179
7180         * expression.cs (Unary.TryReduceNegative): Added support for
7181         SByteConstant and ByteConstant.
7182         (Unary.Reduce): Check error values from TryReduceNegative().
7183
7184 2004-12-11  Martin Baulig  <martin@ximian.com>
7185
7186         * support.cs (ReflectionParameters.ParameterName): If we have a
7187         `gpd', call `ParameterName' on it.
7188
7189         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7190
7191         * pending.cs (PendingImplementation.DefineProxy): Call
7192         DefineParameter() for all of the MethodBuilder's arguments.
7193
7194 2004-12-09  Martin Baulig  <martin@ximian.com>
7195
7196         * doc.cs (DocUtil): Make this a static class.
7197
7198 2004-12-09  Martin Baulig  <martin@ximian.com>
7199
7200         * expression.cs (Invocation.InferType): Moved the type inference
7201         implementation into TypeManager.
7202
7203         * generics.cs (TypeManager): Moved the type inference
7204         implementation here.
7205
7206 2004-12-09  Martin Baulig  <martin@ximian.com>
7207
7208         * typemanager.cs (TypeManager): Make this a partial class.
7209
7210         * generics.cs
7211         (TypeManager): Move the generics part of `TypeManager' here.
7212
7213 2004-12-08  Martin Baulig  <martin@ximian.com>
7214
7215         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7216         instead of a CS3002 for properties and indexer.  Added CS3024
7217         check for generic interfaces.
7218
7219         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7220         instances are not CLS-compliant.
7221
7222 2004-12-08  Martin Baulig  <martin@ximian.com>
7223
7224         * cs-parser.jay
7225         (void_pointer_expression): New rule for `void*', `void**' etc.
7226         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7227
7228 2004-12-08  Martin Baulig  <martin@ximian.com>
7229
7230         * expression.cs (Invocation.InferType): Removed the hack for
7231         MethodCore.MayUnify().  
7232
7233         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7234         this actually work.
7235
7236         * class.cs (MethodCore.MayUnify): Use
7237         TypeManager.MayBecomeEqualGenericTypes().       
7238
7239 2004-12-08  Martin Baulig  <martin@ximian.com>
7240
7241         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7242         parameter, box it.  Fixes #69233.
7243
7244 2004-12-08  Martin Baulig  <martin@ximian.com>
7245
7246         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7247         have the ctor constraint.  Fixes #68326.
7248
7249 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7250
7251         * cs-parser.jay : interface comment was not consumed because of
7252           extra opt_semicolon before doc handling.
7253
7254 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7255
7256         Fix test-327.cs, test-328.cs, and put in early infrastructure
7257         for eventually fixing #52697.
7258         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7259         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7260         from other methods.
7261         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7262         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7263         (VerifyUsing, error246): Update.
7264         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7265         'NamespaceEntry.LookupNamespaceOrType'.
7266
7267 2004-12-07  Martin Baulig  <martin@ximian.com>
7268
7269         * driver.cs: Call it "BETA SOFTWARE" :-)
7270
7271 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7272
7273         Fix crash on cs0657-17.cs.
7274         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7275         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7276         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7277         the case where the NamespaceEntry gets overwritten.
7278
7279 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7280
7281         Fixed #69195, #56821
7282         * ecore.cs (ResolveBoolean): Tiny refactoring.
7283
7284         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7285         of right expression resolving when left is false constant and
7286         operator is LogicalAnd OR true constant and operator is LogicalOr.
7287
7288         * statement.cs (ResolveUnreachable): Always reports warning.
7289
7290 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7291
7292         * class.cs: Distinguish between 1721 and 1722 (just a little help
7293         for the programmer).
7294
7295 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7296
7297         * delegate.cs: Only allow this on new versions of the language. 
7298
7299 2004-12-02  Duncan Mak  <duncan@ximian.com>
7300
7301         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7302         Expression class.
7303         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7304         here as a static method. Take an additional bool out parameter
7305         `must_do_cs1540_check' for signaling to InstanceResolve.
7306         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7307         member field from PropertyExpr class and made it an argument of
7308         the method instead.
7309         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7310         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7311         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7312         and `remove_accessor' as well as InstanceResolve: report CS0122
7313         where applicable.
7314
7315         Fixes #70129.
7316
7317 2004-12-07  Martin Baulig  <martin@ximian.com>
7318
7319         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7320         and CS0692 where appropriate.
7321
7322 2004-12-06  Martin Baulig  <martin@ximian.com>
7323
7324         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7325         IsDuplicateImplementation() and improved it.
7326
7327         * expression.cs (Invocation.InferTypeArguments): Added
7328         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7329         and removed the "ref" modifier from `infered_types'.
7330
7331         * decl.cs (MemberName.ToString): Removed the exception.
7332
7333 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7334
7335         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7336           comments are allowed.
7337
7338 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7339
7340         * delegate.cs: Add checks for subtypes in paramaters and return values
7341         in VerifyMethod () to add support for Covariance/Contravariance
7342         in delegates.
7343         
7344 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7345
7346         * report.cs: Remove extra closing parenthesis.
7347
7348         * convert.cs (Error_CannotImplicitConversion): If the name of the
7349         types are the same, provide some extra information.
7350
7351 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7352
7353         Fix bug #70102
7354         * attribute.cs (Resolve): Improved implementation of params
7355         attribute arguments.
7356
7357         * support.cs (ParameterData): Add HasParams to be faster.
7358
7359 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7360
7361         all things are for /doc support:
7362
7363         * doc.cs: new file that supports XML documentation generation.
7364         * mcs.exe.sources: added doc.cs.
7365         * driver.cs:
7366           Handle /doc command line option.
7367           Report error 2006 instead of 5 for missing file name for /doc.
7368           Generate XML documentation when required, after type resolution.
7369         * cs-tokenizer.cs:
7370           Added support for picking up documentation (/// and /** ... */),
7371           including a new XmlCommentState enumeration.
7372         * cs-parser.jay:
7373           Added lines to fill Documentation element for field, constant,
7374           property, indexer, method, constructor, destructor, operator, event
7375           and class, struct, interface, delegate, enum.
7376           Added lines to warn incorrect comment.
7377         * rootcontext.cs :
7378           Added Documentation field (passed only when /doc was specified).
7379         * decl.cs:
7380           Added DocComment, DocCommentHeader, GenerateDocComment() and
7381           OnGenerateDocComment() and some supporting private members for
7382           /doc feature to MemberCore.
7383         * class.cs:
7384           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7385         * delegate.cs:
7386           Added overriden DocCommentHeader.
7387         * enum.cs:
7388           Added overriden DocCommentHeader and GenerateDocComment().
7389
7390 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7391
7392         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7393         unwrapping the enumeration values, chain to
7394         DoConstantNumericPromotions again, so we can promote things to the
7395         fundamental types (takes care of enums that are bytes, sbytes).
7396
7397         Fixes bug #62054.
7398
7399 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7400
7401         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7402         Fix long-standing bug in type-lookup.  Use FindType instead of
7403         LookupType when ec.ResolvingTypeTree.
7404         (Attribute.ResolveType, Attribute.Resolve)
7405         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7406         Update to changes.
7407         (Attributes.Search): Remove internal version.  Update.
7408         (Attributes.SearchMulti): Update.
7409         (Attributes.GetClsCompliantAttribute): Remove.
7410         (Attributes.GetIndexerNameAttribute): Remove.
7411         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7412         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7413         * class.cs (Indexer.Define): Likewise.
7414
7415 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7416
7417         Fix bug #68790
7418         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7419         MarshallByReference members access.
7420
7421         * expression.cs: Use CheckMarshallByRefAccess;
7422         Better error CS0197 message.
7423
7424         * report.cs: Print whole related error message.
7425
7426 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7427
7428         * class (GetClassBases): Better error 60 report.
7429         (EventProperty): Disabled warning 67 detection.
7430
7431 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7432
7433         Fix bug #60324
7434         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7435
7436         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7437         precise values.
7438
7439 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7440
7441         Fix bug #49488
7442         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7443
7444         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7445
7446 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7447
7448         * attribute.cs (Attribute.Resolve): Refine error reporting and
7449         report a cs0117 if the identifier does not exist, to distinguish
7450         from 0617 which is a miss-use of the actual identifier.
7451
7452         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7453         between cs0070 and cs0079.
7454
7455         * class.cs (MemberBase.DoDefine): When reporting a wrong
7456         accessibility level, we use MethodCore to compare instead of
7457         Method (this was a regression in some refactoring effort).
7458
7459         So now we correctly report cs0056 again.
7460
7461         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7462         testing the target_type (which was known to be object_type) and
7463         not the source type (which is anonymous_method).
7464
7465         Fixed reporting of error cs1660.
7466
7467         * expression.cs (UserCast.Source): Expose the underlying cast.
7468
7469         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7470         allowed types to find a match to int32 first (most common).
7471
7472         In addition, it ignores any ImplicitUserConversions that did an
7473         internal implicit conversion (as the switch statement allows only
7474         one integral conversion to exist).
7475
7476         * class.cs (PartialContainer.Create): rename `name' to
7477         `member_name' for clarity.  Then replace the string calls with a
7478         call to MemberName.GetPartialName, as now using
7479         MemberName.ToString is an error (this is due to the side effects
7480         it had, that were fixed in the past).
7481
7482         This will restore the error reporting on a number of partial class
7483         errors that were missusing this (and getting an exception as a
7484         results, which is now just a plain textual warning, because
7485         yyparse debug output would crash otherwise).
7486
7487 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7488
7489         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7490
7491 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7492
7493         * rootcontext.cs (LookupType): Make sure to cache lookups that
7494         don't give us a negative result. This saves about 5% of corlib
7495         compilation time.
7496
7497 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7498
7499         * report.cs (AbstractMessage.Print): messages are sent to stderr
7500
7501         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7502         non-interface in the list of interfaces (at this point, either
7503         parent was properly set, or a base class is being listed in the
7504         interfaces section).
7505
7506         This flags error 1722, and resolves the crash from bug 69259.
7507
7508 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7509
7510         * statement.cs (Using.EmitExpressionFinally): make this work right
7511         for valuetypes. Fixes 69926.
7512
7513 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7514
7515         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7516         converted to an enum" here, before we try to change the underlying
7517         type.  This code exists, but it is a different code path than the
7518         one used while encoding constants.
7519
7520         (ImplicitReferenceConversionExists): In addition, resynchronized
7521         the code here, so it matches the same code in
7522         ImplicitReferenceConversionExists for the `from any class-type S
7523         to any interface-type T'.       
7524
7525 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7526
7527         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7528
7529 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7530
7531         * cs-parser.jay: Use verbosity accordingly. 
7532
7533 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7534
7535         * expression.cs (Unary.ResolveOperator): Do not report warning;
7536         AddressOf reads from variable.
7537         
7538         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7539
7540 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7541
7542         Fix bug #69462
7543
7544         * attribute.cs (Attributable): Removed CheckTargets.
7545         (Attributes.Emit): Explicit attribute targets are tested here.
7546
7547         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7548         not enabled for interfaces.
7549
7550         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7551         (GetAssemblyName): Ouch next bug there.
7552
7553 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7554
7555         * expression.cs: Error 275 added.
7556         
7557 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7558
7559         Fix bug #69177 (Implemented decimal constant support)
7560
7561         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7562         (BinaryFold): Add DecimalConstant.
7563
7564         * const.cs (Define): Decimal constant 
7565         (is not constant.
7566         (ChangeType): Add decimal type handling.
7567         (LookupConstantValue): Don't set value for decimal type but
7568         emit DecimalConstantAttribute. Needed for constant optimization.
7569
7570         * constant.cs (ToDecimal): New method.
7571         (ConvertToDecimal): New method.
7572         (IntConstant): Implemented ConvertToDecimal.
7573         (DecimalConstant.Emit): Emit optimized version for decimals in
7574         int range.
7575
7576         * expression.cs (ResolveOperator): Changed order of constant
7577         reduction to work correctly with native types which have
7578         overloaded operators.
7579         (ResolveMemberAccess): Extract constant value from attribute
7580         for decimal type.
7581
7582         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7583
7584         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7585         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7586         (ChangeType): Decimal is special.
7587         (TypeToCoreType): Add decimal type.
7588
7589 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7590
7591         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7592         decimal types.
7593
7594 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7595
7596         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7597         test cs1667-5.cs.
7598
7599 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7600
7601         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7602
7603         * pending.cs (PendingImplementation): Grab only interfaces.
7604
7605 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7606
7607         * statement.cs (ForeachHelperMethods): Add location member and
7608         error 202 detection.
7609
7610 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7611
7612         * expression.cs (DoResolveBase): Fixed wrong warning for out
7613         variables.
7614
7615 2004-12-04  Martin Baulig  <martin@ximian.com>
7616
7617         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7618         to check whether the conversion is ok.
7619
7620         * typemanager.cs (TypeManager.GetTypeArguments): Just return
7621         `Type.EmptyTypes' if we're not a generic TypeContainer.
7622
7623 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7624
7625         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7626         old bug: when converting from the null literal to a pointer,
7627         return an EmptyCast, not the NullLiteral.
7628
7629         This fixes #69921, the recent null_type changes probably made this
7630         bug more prominent.
7631
7632 2004-12-03  Martin Baulig  <martin@ximian.com>
7633
7634         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7635         method as our child, call AnonymousMethod.Compatible() on it.
7636
7637 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7638
7639         * class.cs (FieldBase): Use an unused bit field from the field to
7640         encode the `has_offset' property from the FieldMember.  This saves
7641         a couple of Ks on bootstrap compilation.
7642
7643         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7644         method as our child, return the AnonymousMethod resolved
7645         expression.
7646
7647         * expression.cs (New.DoResolve): Allow return values from
7648         NewDelegate to also include AnonymousMethods.
7649
7650         Fixes #70150.
7651
7652 2004-11-29  Raja R Harinath  <rharinath@novell.com>
7653
7654         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7655         cs1648 report.
7656         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7657         System.Runtime.InteropServices._Exception, since it's a base
7658         interface of the core type System.Exception in the net_2_0 profile.
7659
7660 2004-11-27  Martin Baulig  <martin@ximian.com>
7661
7662         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7663
7664 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7665
7666         * Makefile: Convert to use executable.make.
7667         * gmcs.exe.sources: New.
7668
7669 2004-11-25  Martin Baulig  <martin@ximian.com>
7670
7671         * expression.cs (Invocation.InferType): Added support for byref types.
7672
7673 2004-11-25  Martin Baulig  <martin@ximian.com>
7674
7675         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7676         in TypeManager.TypeToCoreType().
7677
7678 2004-11-25  Martin Baulig  <martin@ximian.com>
7679
7680         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7681         "Dispose" method from the `current_type'.
7682         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7683         DoDefineMembers() instead of using the MethodBuilder; this is
7684         required for generic iterators.
7685
7686         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7687
7688 2004-11-24  Martin Baulig  <martin@ximian.com>
7689
7690         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7691
7692 2004-11-20  Martin Baulig  <martin@ximian.com>
7693
7694         * expression.cs (Invocation.InferType): Correctly infer generic
7695         instances; see gen-103.cs.
7696         (Invocation.InferTypeArguments): If a generic method doesn't have
7697         any unbound type parameters, we don't need to infer anything.
7698
7699 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7700
7701         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7702
7703 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7704
7705         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7706         (TypeHandle.GetMemberCache): New.
7707         (TypeHandle.TypeHandle): Update.
7708         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7709         (TypeManager.LookupParentInterfacesCache):
7710         Rename from LookupInterfaceCache.  Optimize slightly.
7711         (TypeManager.MemberLookup_FindMembers): Update.
7712         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7713         multi-type variant.
7714         (AddCacheContents): Rename from AddHashtable.
7715         * class.cs (TypeContainer.parent_container): Remove.
7716         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7717         (TypeContainer.DoDefineMembers): Don't initialize it.
7718         Update to name changes.
7719         
7720 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7721
7722         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7723         that factors the code to check access modifiers on override.  
7724
7725         (PropertyBase): Use the code here.
7726
7727         Patch from Lluis S'anchez, fixes bug #69361.
7728
7729 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7730
7731         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7732         routine that is used to report the use of a captured variable
7733         whose address has been taken.
7734
7735         There are two checks: one when variables are being captured and
7736         the other check is when the address of a variable is taken. 
7737         
7738         (because an anonymous methods might be resolved before *or* after
7739         the address has been taken) and 
7740
7741         * expression.cs (Conditional.DoResolve): Remove the special
7742         casing that Martin added to trueExpr and falseExpr being both
7743         NullLiteral.  We get the right behavior now just by introducing
7744         the null_type into the compiler. 
7745
7746         * convert.cs (ExplicitConversion): Change the code to use
7747         null_type instead of testing `expr is NullLiteral'.
7748         (ImplicitConversionStandard): use null_type too.
7749         (ImplicitReferenceConversionExists): use null_type too.
7750         (ImplicitReferenceConversion): use null_type too.
7751
7752         * literal.cs: The type of `NullLiteral' is now null_type instead
7753         of object_type. 
7754         (Resolve): Set the type here.
7755
7756         * typemanager.cs: Introduce null_type.
7757
7758 2004-11-18  Martin Baulig  <martin@ximian.com>
7759
7760         * rootcontext.cs
7761         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7762
7763 2004-11-18  Martin Baulig  <martin@ximian.com>
7764
7765         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7766
7767 2004-11-18  Martin Baulig  <martin@ximian.com>
7768
7769         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7770         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7771         call ResolveConstructedType() on it to resolve it without checking
7772         constraints.
7773         (Constraints.ResolveTypes): Check them here.
7774         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7775         but don't check constraints.
7776         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7777         check constraints here.
7778         (ConstructedType.ResolveConstructedType): New public method.  This
7779         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7780         resolve ourselves without checking constraints.
7781
7782         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7783
7784 2004-11-18  Martin Baulig  <martin@ximian.com>
7785
7786         * decl.cs
7787         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7788
7789         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7790
7791 2004-11-18  Martin Baulig  <martin@ximian.com>
7792
7793         * ecore.cs (TypeExpr.ResolveType): Removed.
7794         (Expression.ResolveAsTypeTerminal): We always return a fully
7795         resolved `TypeExpr', so we can just access its `Type'.
7796
7797         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7798
7799 2004-11-17  Martin Baulig  <martin@ximian.com>
7800
7801         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7802         sure we don't return any unresolved TypeExpr's.
7803         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7804         a `TypeExpr'.
7805         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7806
7807         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7808         unresolved `ConstructedType's.
7809
7810 2004-11-17  Martin Baulig  <martin@ximian.com>
7811
7812         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7813
7814 2004-11-17  Martin Baulig  <martin@ximian.com>
7815
7816         * ecore.cs
7817         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7818
7819         * decl.cs (DeclSpace.ResolveType): Removed.
7820         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7821
7822 2004-11-17  Martin Baulig  <martin@ximian.com>
7823
7824         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7825         direction, like FindMembers() does.  Fixes #69546, testcase is in
7826         test-315.cs.    
7827
7828 2004-11-16  Martin Baulig  <martin@ximian.com>
7829
7830         This is based on a patch from Marek Safar, see bug #69082.
7831         Fixes bugs #63705 and #67130.
7832
7833         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7834         method; create a MemberCache for an interface type and cache the
7835         result.
7836
7837         * decl.cs (IMemberContainer.ParentContainer): Removed.
7838         (IMemberContainer.ParentCache): New property.
7839         (MemberCache.SetupCacheForInterface): Removed.
7840         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7841         to create a cache for an interface's "parent".
7842
7843         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7844         interfaces too.
7845
7846 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7847
7848         * statement.cs: Avoid adding bools to a hashtable.
7849
7850 2004-11-15  Martin Baulig  <martin@ximian.com>
7851
7852         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7853
7854 2004-11-11  Martin Baulig  <martin@ximian.com>
7855
7856         * typemanager.cs (TypeManager.GetMethodName): New method.
7857
7858         * class.cs (MethodData.Define): Include the generic arity in the
7859         name of an explicit interface; also add it to the method name.
7860
7861         * pending.cs (PendingImplementation.InterfaceMethod): The method
7862         name now includes the generic arity.
7863
7864 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7865
7866         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7867         calling an unsafe method from a safe location.
7868
7869 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7870
7871         Fix #69167
7872         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7873
7874 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7875
7876         * namespace.cs (VerifyUsing): use GetPartialName instead of
7877         ToString. 
7878
7879 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7880
7881         * statement.cs (Return.Resolve): Fix regression in typo: if
7882         `in_exc', we have to request a NeedReturnLabel, this was a typo
7883         introduced in the anonymous method check-in.  Fixes #69131.
7884
7885         * Indexers were using the ShortName when defining themselves,
7886         causing a regression in the compiler bootstrap when applying the
7887         patch from 2004-11-02 (first part), now they use their full name
7888         and the bug is gone.
7889
7890 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7891
7892         * driver.cs: Strip the path from the names of embedded resources. Fixes
7893         #68519.
7894
7895 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7896
7897         Fix error message regression: cs0104-2.cs.
7898         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7899         (AliasEntry.Resolve): Update.
7900         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7901         'silent' flag.
7902         (RootContext.LookupType): Update.
7903
7904 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7905
7906         * cs-parser.jay: Add support for handling accessor modifiers
7907         * class: Add support port accessor modifiers and error checking,
7908         define PropertyMethod.Define as virtual (not abstract anymore)
7909         * ecore.cs: Add checking for proeprties access with access modifiers
7910         * iterators.cs: Modify Accessor constructor call based in the modified
7911         constructor
7912 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7913
7914         * expression.cs (StringConcat): Handle being called twice,
7915         as when we have a concat in a field init with more than two
7916         ctors in the class
7917
7918 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7919
7920         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7921         special case explicit implementations, we should always produce
7922         the .property or .event declaration.
7923         
7924         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7925         since it will not return correct data if people use this
7926         unresolved in the presence of using statements (see test-313).
7927
7928         * class.cs (MethodData.Define): If we are an explicit interface
7929         implementation, set the method name to the full name of the
7930         interface plus the name of the method.  
7931
7932         Notice that using the method.MethodName.GetFullName() does not
7933         work, as it will only contain the name as declared on the source
7934         file (it can be a shorthand in the presence of using statements)
7935         and not the fully qualifed type name, for example:
7936
7937         using System;
7938
7939         class D : ICloneable {
7940                 object ICloneable.Clone ()  {
7941                 }
7942         }
7943
7944         Would produce a method called `ICloneable.Clone' instead of
7945         `System.ICloneable.Clone'.
7946
7947         * namespace.cs (Alias.Resolve): Use GetPartialName.
7948         
7949 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7950
7951         * cs-parser.jay: Add error 1055 report.
7952
7953 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7954
7955         * assign.cs (Assign.DoResolve): Only do the transform of
7956         assignment into a New if the types are compatible, if not, fall
7957         through and let the implicit code deal with the errors and with
7958         the necessary conversions. 
7959
7960 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7961
7962         * cs-parser.jay: Add error 1031 report.
7963
7964         * cs-tokenizer.cs: Add location for error 1038.
7965
7966 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7967
7968         * cs-parser.jay: Add error 1016 report.
7969
7970 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7971
7972         * cs-parser.jay: Add errors 1575,1611 report.
7973
7974 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7975
7976         * cs-parser.jay: Add error 1001 report.
7977
7978 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7979
7980         Fix #68850
7981         * attribute.cs (GetMarshal): Add method argument for
7982         caller identification.
7983
7984         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
7985         agument for GetMarshal and RuntimeMissingSupport.
7986
7987 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
7988
7989         * attribute.cs (ExtractSecurityPermissionSet): Removed
7990         TypeManager.code_access_permission_type.
7991
7992         * typemanager.cs: Removed TypeManager.code_access_permission_type.
7993
7994 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
7995
7996         * expression.cs (LocalVariableReference.DoResolveLValue): Check
7997         for obsolete use of a variable here.   Fixes regression on errors
7998         cs0619-25 and cs0619-26.
7999
8000 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8001
8002         Fix #62358, implemented security attribute encoding.
8003
8004         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8005         Tests permitted SecurityAction for assembly or other types.
8006         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8007         data from SecurityPermissionAttribute to PermisionSet class.
8008
8009         * class.cs (ApplyAttributeBuilder): Added special handling
8010         for System.Security.Permissions.SecurityAttribute based types.
8011
8012         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8013         special handling for System.Security.Permissions.SecurityAttribute
8014         based types.
8015
8016         * enum.cs (ApplyAttributeBuilder): Added special handling
8017         for System.Security.Permissions.SecurityAttribute based types.
8018
8019         * parameter.cs (ApplyAttributeBuilder): Added special handling
8020         for System.Security.Permissions.SecurityAttribute based types.
8021
8022         * rootcontext.cs: Next 2 core types.
8023
8024         * typemanager.cs (TypeManager.security_permission_attr_type):
8025         Built in type for the SecurityPermission Attribute.
8026         (code_access_permission_type): Build in type.
8027
8028 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8029
8030         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8031         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8032         all of this information into
8033         EmitContext.EmitCapturedVariableInstance.
8034         
8035         * codegen.cs (EmitCapturedVariableInstance): move here the
8036         funcionality of emitting an ldarg.0 in the presence of a
8037         remapping.   This centralizes the instance emit code.
8038
8039         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8040         then emit a load of this: it means that we have reached the
8041         topmost ScopeInfo: the one that contains the pointer to the
8042         instance of the class hosting the anonymous method.
8043
8044         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8045         captures to the topmost CaptureContext.
8046
8047 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8048
8049         * expression.cs (LocalVariableReference): Move the knowledge about
8050         the iterators into codegen's EmitCapturedVariableInstance.
8051
8052 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8053
8054         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8055         all code paths return a value from an anonymous method (it is the
8056         same as the 161 error, but for anonymous methods).
8057
8058 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8059
8060         The introduction of anonymous methods in the compiler changed
8061         various ways of doing things in the compiler.  The most
8062         significant one is the hard split between the resolution phase
8063         and the emission phases of the compiler.
8064
8065         For instance, routines that referenced local variables no
8066         longer can safely create temporary variables during the
8067         resolution phase: they must do so from the emission phase,
8068         since the variable might have been "captured", hence access to
8069         it can not be done with the local-variable operations from the runtime.
8070         
8071         * statement.cs 
8072
8073         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8074         is a toplevel block.
8075
8076         (ToplevelBlock): A new kind of Block, these are the blocks that
8077         are created by the parser for all toplevel method bodies.  These
8078         include methods, accessors and anonymous methods.
8079
8080         These contain some extra information not found in regular blocks:
8081         A pointer to an optional CaptureContext (for tracking captured
8082         local variables and parameters).  A pointer to the parent
8083         ToplevelBlock.
8084         
8085         (Return.Resolve): Catch missmatches when returning a value from an
8086         anonymous method (error 1662).
8087         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8088         phase.
8089
8090         (Break.Resolve): ditto.
8091
8092         (SwitchLabel): instead of defining the labels during the
8093         resolution phase, we now turned the public ILLabel and ILLabelCode
8094         labels into methods called GetILLabelCode() and GetILLabel() that
8095         only define the label during the Emit phase.
8096
8097         (GotoCase): Track the SwitchLabel instead of the computed label
8098         (its contained therein).  Emit the code by using
8099         SwitchLabel.GetILLabelCode ().
8100
8101         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8102         whether the Local has been captured or not.
8103
8104         (LocalInfo.IsCaptured): New property, used to tell whether the
8105         local has been captured.
8106         
8107         * anonymous.cs: Vastly updated to contain the anonymous method
8108         support.
8109
8110         The main classes here are: CaptureContext which tracks any
8111         captured information for a toplevel block and ScopeInfo used to
8112         track the activation frames for various local variables.   
8113
8114         Each toplevel block has an optional capture context associated
8115         with it.  When a method contains an anonymous method both the
8116         toplevel method and the anonymous method will create a capture
8117         context.   When variables or parameters are captured, they are
8118         recorded on the CaptureContext that owns them, for example:
8119
8120         void Demo () {
8121              int a;
8122              MyDelegate d = delegate {
8123                  a = 1;
8124              }
8125         }
8126
8127         Here `a' will be recorded as captured on the toplevel
8128         CapturedContext, the inner captured context will not have anything
8129         (it will only have data if local variables or parameters from it
8130         are captured in a nested anonymous method.
8131
8132         The ScopeInfo is used to track the activation frames for local
8133         variables, for example:
8134
8135         for (int i = 0; i < 10; i++)
8136                 for (int j = 0; j < 10; j++){
8137                    MyDelegate d = delegate {
8138                         call (i, j);
8139                    }
8140                 }
8141
8142         At runtime this captures a single captured variable `i', but it
8143         captures 10 different versions of the variable `j'.  The variable
8144         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8145         recorded on a child.  
8146
8147         The toplevel ScopeInfo will also track information like the `this'
8148         pointer if instance variables were referenced (this is necessary
8149         as the anonymous method lives inside a nested class in the host
8150         type of the method). 
8151
8152         (AnonymousMethod): Expanded to track the Toplevel, implement
8153         `AnonymousMethod.Compatible' to tell whether an anonymous method
8154         can be converted to a target delegate type. 
8155
8156         The routine now also produces the anonymous method content
8157
8158         (AnonymousDelegate): A helper class that derives from
8159         DelegateCreation, this is used to generate the code necessary to
8160         produce the delegate for the anonymous method that was created. 
8161
8162         * assign.cs: API adjustments for new changes in
8163         Convert.ImplicitStandardConversionExists.
8164
8165         * class.cs: Adjustments to cope with the fact that now toplevel
8166         blocks are of type `ToplevelBlock'. 
8167
8168         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8169         insteda of standard blocks.
8170
8171         Flag errors if params arguments are passed to anonymous methods.
8172
8173         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8174         `CurrentAnonymousMethod' which points to the current Anonymous
8175         Method.  The variable points to the AnonymousMethod class that
8176         holds the code being compiled.  It is set in the new EmitContext
8177         created for the anonymous method.
8178
8179         (EmitContext.Phase): Introduce a variable and an enumeration to
8180         assist in enforcing some rules about when and where we are allowed
8181         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8182         only one that enfonces this right now).
8183
8184         (EmitContext.HaveCaptureInfo): new helper method that returns
8185         whether we have a CapturedContext initialized.
8186
8187         (EmitContext.CaptureVariable): New method used to register that a
8188         LocalInfo must be flagged for capturing. 
8189
8190         (EmitContext.CapturedParameter): New method used to register that a
8191         parameters must be flagged for capturing. 
8192         
8193         (EmitContext.CapturedField): New method used to register that a
8194         field must be flagged for capturing. 
8195
8196         (EmitContext.HaveCapturedVariables,
8197         EmitContext.HaveCapturedFields): Return whether there are captured
8198         variables or fields. 
8199
8200         (EmitContext.EmitMethodHostInstance): This is used to emit the
8201         instance for the anonymous method.  The instance might be null
8202         (static methods), this (for anonymous methods that capture nothing
8203         and happen to live side-by-side with the current method body) or a
8204         more complicated expression if the method has a CaptureContext.
8205
8206         (EmitContext.EmitTopBlock): Routine that drives the emission of
8207         code: it will first resolve the top block, then emit any metadata
8208         and then emit the code.  The split is done so that we can extract
8209         any anonymous methods and flag any captured variables/parameters.
8210         
8211         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8212         during this phase, the ILGenerator should not be used as labels
8213         and local variables declared here might not be accessible to any
8214         code that is part of an anonymous method.  
8215
8216         Exceptions to this include the temporary variables that are
8217         created by some statements internally for holding temporary
8218         variables. 
8219         
8220         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8221         metadata for a cb
8222
8223         (EmitContext.TemporaryReturn): This method is typically called
8224         from the Emit phase, and its the only place where we allow the
8225         ReturnLabel to be defined other than the EmitMeta.  The reason is
8226         that otherwise we would have to duplicate a lot of logic in the
8227         Resolve phases of various methods that today is on the Emit
8228         phase. 
8229
8230         (EmitContext.NeedReturnLabel): This no longer creates the label,
8231         as the ILGenerator is not valid during the resolve phase.
8232
8233         (EmitContext.EmitThis): Extended the knowledge in this class to
8234         work in anonymous methods in addition to iterators. 
8235
8236         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8237         code is necessary on the stack to access the instance to a local
8238         variable (the variable will be accessed as a field).
8239
8240         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8241         EmitContext.EmitAddressOfParameter): Routines to support
8242         parameters (not completed at this point). 
8243         
8244         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8245         will also remove the parameters.
8246
8247         * convert.cs (Convert): Define a `ConstantEC' which points to a
8248         null.  This is just to prefity some code that uses
8249         ImplicitStandardConversion code and do not have an EmitContext
8250         handy.
8251
8252         The idea is to flag explicitly that at that point in time, it is
8253         known that the conversion will not trigger the delegate checking
8254         code in implicit conversions (which requires a valid
8255         EmitContext). 
8256
8257         Everywhere: pass new EmitContext parameter since
8258         ImplicitStandardConversionExists now requires it to check for
8259         anonymous method conversions. 
8260
8261         (Convert.ImplicitStandardConversionExists): If the type of an
8262         expression is the anonymous_method_type, and the type is a
8263         delegate, we invoke the AnonymousMethod.Compatible method to check
8264         whether an implicit conversion is possible. 
8265
8266         (Convert.ImplicitConversionStandard): Only do implicit method
8267         group conversions if the language level is not ISO_1.
8268
8269         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8270         MethodInfo for the Invoke method.  used by Delegate and
8271         AnonymousDelegate.
8272
8273         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8274         method conversions if the target type is a delegate.
8275
8276         Removed extra debugging nops.
8277
8278         (LocalVariableReference): Turn the `local_info' into a public
8279         field. 
8280
8281         Add `prepared' field, the same hack used for FieldExprs to cope
8282         with composed assignments, as Local variables do not necessarily
8283         operate purely on the stack as they used to: they can be captured
8284         fields. 
8285
8286         Add `temp' for a temporary result, like fields.
8287
8288         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8289
8290         It now copes with Local variables that are captured and emits the
8291         proper instance variable to load it from a field in the captured
8292         case. 
8293
8294         (ParameterReference.DoResolveBase): During the resolve phase,
8295         capture parameters if we are in an anonymous method.
8296
8297         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8298         anonymous method, use the EmitContext helper routines to emit the
8299         parameter reference.
8300
8301         * iterators.cs: Set RemapToProxy to true/false during the
8302         EmitDispose class.
8303
8304         * parameters.cs (GetParameterByName): New helper method. 
8305
8306         * typemanager.cs (anonymous_method_type) a new type that
8307         represents an anonyous method.  This is always an internal type,
8308         used as a fencepost to test against the anonymous-methodness of an
8309         expression. 
8310         
8311 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8312
8313         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8314         561 report.
8315         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8316
8317 2004-11-10  Martin Baulig  <martin@ximian.com>
8318
8319         * expression.cs (Invocation.BetterFunction): If two methods have
8320         equal parameter types, but only one of them is generic, the
8321         non-generic one wins.
8322         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8323         instance; just use `Type.IsValueType' to determine whether
8324         something is a struct or not.
8325         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8326         so we can be called multiple times.
8327
8328 2004-11-10  Martin Baulig  <martin@ximian.com>
8329
8330         * generic.cs (TypeParameter.DefineConstraints): New public method.
8331         (TypeParameter.CheckAccessLevel): Override this and return true.
8332         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8333         override ResolveType() anymore.
8334         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8335
8336 2004-11-10  Martin Baulig  <martin@ximian.com>
8337
8338         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8339         call DeclSpace.ResolveNestedType() on it.
8340
8341 2004-11-10  Martin Baulig  <martin@ximian.com>
8342
8343         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8344         non-null, call ParameterModifier() on it.
8345
8346 2004-11-10  Martin Baulig  <martin@ximian.com>
8347
8348         * iterators.cs
8349         (Iterators): Added `current_type' and `this_type' fields.
8350         (Iterators.DefineIterator): Create a new EmitContext and store it
8351         in `ec'; compute `this_type'.
8352
8353 2004-11-10  Martin Baulig  <martin@ximian.com>
8354
8355         * typemanager.cs
8356         (TypeManager.IsPrivateAccessible): New public method.
8357         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8358
8359 2004-11-10  Martin Baulig  <martin@ximian.com>
8360
8361         * class.cs (TypeContainer.DefineType): Call
8362         TypeBuilder.DefineGenericParameters() before resolving the type
8363         parameters.
8364         (MethodData.parent_method): New protected field.
8365         (MethodData..ctor): Added `MethodInfo parent_method' argument.
8366         (MethodData.Define): Compute `parent_method'.
8367
8368         * decl.cs
8369         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8370         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8371         (DeclSpace.ec): New protected field; store the EmitContext here.
8372         (DeclSpace.EmitContext): New public property.
8373         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8374         (DeclSpace.ResolveNestedType): New public method.
8375         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8376         (DeclSpace.NestedAccessible): Added `Type tb' argument.
8377         (DeclSpace.FamilyAccessible): Likewise.
8378         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8379         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8380         EmitContext.
8381
8382         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8383         field.
8384
8385         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8386         (Enum.Emit): Don't create a new EmitContext.
8387
8388 2004-10-18  Martin Baulig  <martin@ximian.com>
8389
8390         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8391         `Type' directly, but call ResolveType() on it.
8392         (Catch.Resolve): Likewise.
8393         (Foreach.Resolve): Likewise.
8394
8395 2004-10-18  Martin Baulig  <martin@ximian.com>
8396
8397         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8398         `Type' directly, but call ResolveType() on it.
8399         (Probe.DoResolve): Likewise.
8400         (ArrayCreation.LookupType): Likewise.
8401         (TypeOf.DoResolve): Likewise.
8402         (SizeOf.DoResolve): Likewise.
8403
8404 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8405
8406         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8407         the ResolveType.
8408
8409 2004-10-17  John Luke  <john.luke@gmail.com>
8410
8411         * class.cs (Operator.GetSignatureForError): use CSharpName
8412
8413         * parameter.cs (Parameter.GetSignatureForError): Returns
8414         correct name even if was not defined.
8415
8416 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8417
8418         Fix #65816.
8419         * class.cs (TypeContainer.EmitContext): New property.
8420         (DefineNestedTypes): Create an emitcontext for each part.
8421         (MethodCore.DoDefineParameters): Use container's emitcontext.
8422         Pass type array to InternalParameters.
8423         (MemberBase.DoDefine): Use container's emitcontext.
8424         (FieldMember.Define): Likewise.
8425         (Event.Define): Likewise.
8426         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8427         Pass type array to InternalParameters.
8428         (SetIndexerMethod.GetParameterInfo): Likewise.
8429         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8430         * delegate.cs (Define): Pass emitcontext to
8431         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8432         array to InternalParameters.
8433         * expression.cs (ParameterReference.DoResolveBase): Pass
8434         emitcontext to GetParameterInfo.
8435         (ComposedCast.DoResolveAsTypeStep): Remove check on
8436         ec.ResolvingTypeTree.
8437         * parameter.cs (Parameter.Resolve): Change argument to
8438         EmitContext.  Use ResolveAsTypeTerminal.
8439         (Parameter.GetSignature): Change argument to EmitContext.
8440         (Parameters.ComputeSignature): Likewise.
8441         (Parameters.ComputeParameterTypes): Likewise.
8442         (Parameters.GetParameterInfo): Likewise.
8443         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8444         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8445         * support.cs (InternalParameters..ctor): Remove variant that takes
8446         a DeclSpace.
8447         * typemanager.cs (system_intptr_expr): New.
8448         (InitExpressionTypes): Initialize it.
8449
8450 2004-10-12  Chris Toshok  <toshok@ximian.com>
8451
8452         * cs-parser.jay: fix location for try_statement and catch_clause.
8453
8454 2004-10-18  Martin Baulig  <martin@ximian.com>
8455
8456         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8457         `Type' directly, but call ResolveType() on it.
8458         (MemberBase.DoDefine): Likewise.
8459
8460         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8461         `Type' directly, but call ResolveType() on it.
8462         (ComposedCast.DoResolveAsTypeStep): Likewise.
8463
8464         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8465         `Type' directly, but call ResolveType() on it.
8466
8467 2004-10-17  John Luke  <john.luke@gmail.com>
8468
8469         * class.cs (Operator.GetSignatureForError): use CSharpName
8470
8471         * parameter.cs (Parameter.GetSignatureForError): Returns
8472         correct name even if was not defined.
8473
8474 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8475
8476         Fix #65816.
8477         * class.cs (TypeContainer.EmitContext): New property.
8478         (DefineNestedTypes): Create an emitcontext for each part.
8479         (MethodCore.DoDefineParameters): Use container's emitcontext.
8480         Pass type array to InternalParameters.
8481         (MemberBase.DoDefine): Use container's emitcontext.
8482         (FieldMember.Define): Likewise.
8483         (Event.Define): Likewise.
8484         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8485         Pass type array to InternalParameters.
8486         (SetIndexerMethod.GetParameterInfo): Likewise.
8487         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8488         * delegate.cs (Define): Pass emitcontext to
8489         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8490         array to InternalParameters.
8491         * expression.cs (ParameterReference.DoResolveBase): Pass
8492         emitcontext to GetParameterInfo.
8493         (ComposedCast.DoResolveAsTypeStep): Remove check on
8494         ec.ResolvingTypeTree.
8495         * parameter.cs (Parameter.Resolve): Change argument to
8496         EmitContext.  Use ResolveAsTypeTerminal.
8497         (Parameter.GetSignature): Change argument to EmitContext.
8498         (Parameters.ComputeSignature): Likewise.
8499         (Parameters.ComputeParameterTypes): Likewise.
8500         (Parameters.GetParameterInfo): Likewise.
8501         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8502         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8503         * support.cs (InternalParameters..ctor): Remove variant that takes
8504         a DeclSpace.
8505         * typemanager.cs (system_intptr_expr): New.
8506         (InitExpressionTypes): Initialize it.
8507
8508 2004-10-12  Chris Toshok  <toshok@ximian.com>
8509
8510         * cs-parser.jay: fix location for try_statement and catch_clause.
8511
8512 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8513
8514         More DeclSpace.ResolveType avoidance.
8515         * decl.cs (MemberCore.InUnsafe): New property.
8516         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8517         with newly created EmitContext.
8518         (FieldMember.Define): Likewise.
8519         * delegate.cs (Delegate.Define): Likewise.
8520         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8521         only if normal name-lookup fails.
8522         (TypeExpr.DoResolve): Enable error-checking.
8523         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8524         (SizeOf.DoResolve): Likewise.
8525         (ComposedCast.DoResolveAsTypeStep): Likewise.
8526         (StackAlloc.DoResolve): Likewise.
8527         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8528         (Block.Unsafe): New property.
8529         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8530         (Unsafe): Set 'unsafe' flag of contained block.
8531         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8532         (Fixed.Resolve): Likewise.
8533         (Catch.Resolve): Likewise.
8534         (Using.ResolveLocalVariableDecls): Likewise.
8535         (Foreach.Resolve): Likewise.
8536
8537 2004-10-05  John Luke <john.luke@gmail.com>
8538
8539         * cs-parser.jay: add location to error CS0175
8540
8541 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8542
8543         * ecore.cs (Expression.Constantity): Add support for turning null
8544         into a constant.
8545
8546         * const.cs (Const.Define): Allow constants to be reference types
8547         as long as the value is Null.
8548
8549 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8550
8551         * namespace.cs (NamespaceEntry.Using): No matter which warning
8552         level is set, check if this namespace name has already been added.
8553
8554 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8555
8556         * expression.cs: reftype [!=]= null should always use br[true,false].
8557         # 67410
8558
8559 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8560
8561         Fix #67108
8562         * attribute.cs: Enum conversion moved to 
8563         GetAttributeArgumentExpression to be applied to the all
8564         expressions.
8565
8566 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8567
8568         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8569         * class.c (TypeContainer.DefineType): Flag error if
8570         base types aren't accessible due to access permissions.
8571         * decl.cs (DeclSpace.ResolveType): Move logic to
8572         Expression.ResolveAsTypeTerminal.
8573         (DeclSpace.ResolveTypeExpr): Thin layer over
8574         Expression.ResolveAsTypeTerminal.
8575         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8576         Refactor code into NestedAccess.  Use it.
8577         (DeclSpace.NestedAccess): New.
8578         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8579         argument to silence errors.  Check access permissions.
8580         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8581         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8582         (Cast.DoResolve): Likewise.
8583         (New.DoResolve): Likewise.
8584         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8585         (TypeOf.DoResolve): Likewise.
8586
8587         * expression.cs (Invocation.BetterConversion): Return the Type of
8588         the better conversion.  Implement section 14.4.2.3 more faithfully.
8589         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8590         section 14.4.2.2 explicit.
8591         (Invocation.OverloadResolve): Update.
8592         (Invocation): Remove is_base field.
8593         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8594         (Invocation.Emit): Likewise.
8595
8596 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8597
8598         * cs-parser.jay: Reverted 642 warning fix.
8599
8600 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8601
8602         Fix bug #66615
8603         * decl.cs (FindMemberWithSameName): Indexer can have more than
8604         1 argument.
8605
8606 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8607
8608         * expression.cs (LocalVariableReference.DoResolveLValue):
8609         Do not report warning 219 for out values.
8610         (EmptyExpression.Null): New member to avoid extra allocations.
8611
8612 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8613
8614         * cs-parser.jay: Fix wrong warning 642 report.
8615
8616         * cs-tokenizer.cs (CheckNextToken): New helper;
8617         Inspect next character if is same as expected.
8618
8619 2004-09-23  Martin Baulig  <martin@ximian.com>
8620
8621         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8622         (Convert.ImplicitReferenceConversionExists): Likewise.
8623
8624 2004-11-09  Raja R Harinath  <rharinath@novell.com>
8625
8626         * Makefile (DISTFILES): Comment out a few missing files.
8627
8628 2004-10-29  Raja R Harinath  <rharinath@novell.com>
8629
8630         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8631         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
8632         (gmcs.exe): Invoke bootstrap-libs.
8633         (clean-local): Clean the net_2_0_bootstrap profile too.
8634         (PROGRAM_INSTALL_DIR): New.
8635         (install-local): Use it.
8636
8637 2004-10-13  Martin Baulig  <martin@ximian.com>
8638
8639         * generic.cs (TypeManager.InflatedConstraints): New nested class.
8640         (TypeParameter.DefineType): If we're a method type parameter and
8641         that method is overriding something, "inflate" its constraints.
8642
8643 2004-10-12  Martin Baulig  <martin@ximian.com>
8644
8645         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8646         and have type arguments, create and resolve a ConstructedType.
8647
8648 2004-10-12  Martin Baulig  <martin@ximian.com>
8649
8650         * decl.cs (MemberCache.FindMemberToOverride): Use
8651         TypeManager.IsEqual() to compare the parameters and Type.Equals()
8652         to compare the invocationType.
8653
8654         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8655         When comparing two type parameters, only do the signature-only
8656         comparision for method type parameters.
8657
8658 2004-10-11  Martin Baulig  <martin@ximian.com>
8659
8660         * report.cs: Don't make --fatal abort on warnings, we have
8661         -warnaserror for that.
8662
8663 2004-10-11  Martin Baulig  <martin@ximian.com>
8664
8665         * typemanager.cs
8666         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8667         (TypeManager.IsEqual): Call ourself recursively instead of using
8668         Type.IsEqual(). 
8669
8670 2004-10-11  Martin Baulig  <martin@ximian.com>
8671
8672         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8673         on our own type parameters, not on the ones we inherit from a containing
8674         class.
8675
8676         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8677         the comparision.
8678
8679         * generic.cs (TypeParameter.Define): We may only be called once.
8680
8681         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8682         instead of TypeManager.IsEqual().
8683
8684 2004-09-28  Martin Baulig  <martin@ximian.com>
8685
8686         * generic.cs
8687         (GenericConstraints.EffectiveBaseClass): New public property.
8688         (TypeParameter.GenericConstraints): New public property.
8689         (ConstructedType.CheckConstraints): Improved.
8690
8691         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8692         (Convert.TypeParameterConversion): New private method; use this in
8693         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8694         for all conversions related to type parameters.
8695
8696 2004-09-24  Martin Baulig  <martin@ximian.com>
8697
8698         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8699         type parameter conversions for type parameters which are known to
8700         be reference types.
8701
8702 2004-09-24  Martin Baulig  <martin@ximian.com>
8703
8704         * generic.cs (GenericConstraints): Added `IsReferenceType' and
8705         `IsValueType' properties.
8706
8707         * support.cs (ReflectionConstraints): Use
8708         Type.GetGenericParameterConstraints() instead of the old hack.
8709
8710 2004-09-24  Martin Baulig  <martin@ximian.com>
8711
8712         * generic.cs (GenericConstraints): Moved here and made it an
8713         abstract class.
8714
8715         * support.cs (GenericConstraints): Moved to generic.cs.
8716
8717 2004-09-24  Martin Baulig  <martin@ximian.com>
8718
8719         * support.cs
8720         (ReflectionConstraints): Un-nested this class and made it public.
8721
8722         * typemanager.cs
8723         (TypeManager.GetTypeParameterConstraints): New public method.
8724         (TypeManager.HasConstructorConstraint): Use the attributes.
8725
8726 2004-09-24  Martin Baulig  <martin@ximian.com>
8727
8728         * support.cs (GenericConstraints): Replaced `HasConstructor',
8729         `IsReferenceType' and `IsValueType' with `Attributes'.
8730         (ReflectionParameters.ReflectionConstraints): Removed the Create()
8731         method and made the .ctor public.
8732
8733         * generic.cs (Constraints.Attributes): New public property.
8734         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8735         `IsReferenceType' -> `HasReferenceTypeConstraint' and
8736         `IsValueType' -> `HasValueTypeConstraint'.
8737
8738 2004-09-23  Martin Baulig  <martin@ximian.com>
8739
8740         * generic.cs (Constraints): Reflect latest runtime changes.
8741
8742 2004-09-23  Martin Baulig  <martin@ximian.com>
8743
8744         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8745         (Convert.ImplicitReferenceConversionExists): Likewise.
8746
8747 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8748
8749         * class.cs (Operator.Define): Add error 448 and 559 report.
8750         
8751 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8752
8753         * class.cs (MemberBase.IsTypePermitted): New protected
8754         method for checking error CS0610.
8755
8756 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8757
8758         * class.cs (TypeContainer.HasExplicitLayout): New property
8759         Returns whether container has StructLayout attribute set Explicit.
8760         (FieldMember): New abstract class for consts and fields.
8761         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8762         (Field): Reuse FieldMember.
8763
8764         * const.cs (Const): Reuse FieldMember.
8765
8766         * rootcontext.cs: EmitConstants call moved to class.
8767
8768 2004-09-22  Martin Baulig  <martin@ximian.com>
8769
8770         Marek and me just fixed one of our oldest bugs: #28562 :-)
8771
8772         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8773
8774         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8775         we're an EnumConstant, just return that.
8776         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8777         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8778         to get the value which'll actually be written into the attribute.
8779         However, we have to use GetValue() to access the attribute's value
8780         in the compiler.        
8781
8782 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8783
8784         * constant.cs (Constant.IsNegative): New abstract property
8785         IsNegative.
8786
8787         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8788         (StackAlloc.DoResolve): Reused IsNegative.
8789
8790 2004-09-22  Martin Baulig  <martin@ximian.com>
8791
8792         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8793         public method; like LookupTypeContainer, but also works for
8794         generic instances.
8795
8796         * report.cs (Report.SymbolRelatedToPreviousError): Use
8797         TypeManager.LookupGenericTypeContainer().       
8798
8799 2004-09-22  Martin Baulig  <martin@ximian.com>
8800
8801         Thanks to Peter Sestoft for this bug report.
8802
8803         * expression.cs (Conditional): If both the `trueExpr' and the
8804         `falseExpr' is a NullLiteral, return a NullLiteral.
8805
8806 2004-09-22  Martin Baulig  <martin@ximian.com>
8807
8808         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8809         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8810         for the "get_Current" call.
8811
8812 2004-09-21  Martin Baulig  <martin@ximian.com>
8813
8814         * convert.cs (Convert.ImplicitReferenceConversion): When
8815         converting to an interface type, first check whether we're
8816         converting from a reference type.
8817
8818 2004-09-14  Martin Baulig  <martin@ximian.com>
8819
8820         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8821
8822 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8823
8824         Fixed bug #61902
8825         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8826         called and is obsolete then this member suppress message
8827         when call is inside next [Obsolete] method or type.
8828
8829         * expression.cs: Use TestObsoleteMethodUsage member.
8830
8831 2004-09-14  Martin Baulig  <martin@ximian.com>
8832
8833         * genericparser.cs: Removed.
8834
8835 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8836
8837         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8838
8839 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8840
8841         * attribute.cs (Attribute.Resolve): Add error 653 report.
8842
8843         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8844         report.
8845         (Method.ApplyAttributeBuilder): Add error 685 report.
8846         (Operator.Define): Add error 564 report.
8847
8848         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8849
8850         * expression.cs (Invocation.DoResolve): Add error
8851         245 and 250 report.
8852
8853         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8854         error 674 report.
8855
8856 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8857
8858         * class.cs (ConstructorInitializer.Resolve):
8859         Wrong error number (515->516).
8860
8861 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8862
8863         * class.cs (Indexer.Define): Add error 631 report.
8864
8865 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8866
8867         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8868
8869 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8870
8871         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8872
8873 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8874
8875         * cs-parser.jay: Added error CS0241 report.
8876
8877 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8878
8879         * cs-parser.jay (fixed_statement): Introduce a scope for the
8880         declaration in the 'fixed' statement.
8881
8882 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8883
8884         * cs-parser.jay: Added CS0230 error report.
8885
8886 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8887
8888         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8889
8890 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8891
8892         * expression.cs (Argument.Resolve): Added error CS0192 and
8893         CS0199 report.
8894
8895 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8896
8897         C# 2.0 #pragma warning feature
8898
8899         * cs-tokenizer.cs (PreProcessPragma): New method; 
8900         Handles #pragma directive.
8901
8902         * report.cs (WarningRegions): New class; Support
8903         class for #pragma warning directive. It tests whether
8904         warning is enabled for a given line.
8905
8906 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8907
8908         * const.cs: Add more descriptive error report, tahnks to
8909         Sebastien. 
8910
8911 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8912
8913         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8914
8915 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8916
8917         * expression.cs: Apply patch from Ben: Remove dead code from
8918         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8919         as that code just threw an exception anwyays.
8920
8921         * const.cs: Remove the call to the turnintoconstant, for details
8922         see bug: #63144
8923         
8924         * literal.cs: The type of the null-literal is the null type;  So
8925         we use a placeholder type (literal.cs:System.Null, defined here)
8926         for it.
8927
8928         * expression.cs (Conditional.DoResolve): Remove some old code that
8929         is no longer needed, conversions have been fixed.
8930
8931         (ArrayCreationExpression.DoResolve): Return false if we fail to
8932         resolve the inner expression.
8933
8934 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8935
8936         Fix test-290.cs.
8937         * cs-parser.jay (delegate_declaration): Record a delegate
8938         declaration as a type declaration.
8939         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8940
8941 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8942
8943         * parameter.cs: Do not crash if the type can not be resolved. 
8944
8945         * expression.cs: Report errors with unsafe pointers, fixes #64896
8946
8947 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8948
8949         * expression.cs: Pointer arith always needs to do a conv.i
8950         if the operand is a long. fix 65320
8951
8952 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8953
8954         Fixed cs0619-37.cs, cs0619-38.cs
8955
8956         * enum.cs (GetObsoleteAttribute): Removed.
8957
8958         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
8959         on Enum member is double staged. The first is tested member
8960         and then enum.
8961
8962 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8963
8964         Fixed #56986, #63631, #65231
8965
8966         * class.cs: (TypeContainer.AddToMemberContainer): New method,
8967         adds member to name container.
8968         (TypeContainer.AddToTypeContainer): New method, adds type to
8969         name container.
8970         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
8971         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
8972         AddOperator): Simplified by reusing AddToMemberContainer.
8973         (TypeContainer.UserDefinedStaticConstructor): Changed to property
8974         instead of field.
8975         (Method.CheckForDuplications): Fixed implementation to test all
8976         possibilities.
8977         (MemberBase): Detection whether member is explicit interface
8978         implementation is now in constructor.
8979         (MemberBase.UpdateMemberName): Handles IndexerName.
8980         (Accessor): Changed to keep also location information.
8981         (AbstractPropertyEventMethod): Is derived from MemberCore.
8982         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
8983         will be emited or not.
8984         (PropertyBase.AreAccessorsDuplicateImplementation):
8985         Tests whether accessors are not in collision with some method.
8986         (Operator): Is derived from MethodCore to simplify common
8987         operations.
8988
8989         * decl.cs (Flags.TestMethodDuplication): Test for duplication
8990         must be performed.
8991         (DeclSpace.AddToContainer): Adds the member to defined_names
8992         table. It tests for duplications and enclosing name conflicts.
8993
8994         * enum.cs (EnumMember): Clean up to reuse the base structures
8995
8996 2004-09-03  Martin Baulig  <martin@ximian.com>
8997
8998         Merged latest changes into gmcs.  Please keep this comment in
8999         here, it makes it easier for me to see what changed in MCS since
9000         the last time I merged.
9001
9002 2004-09-03  Martin Baulig  <martin@ximian.com>
9003
9004         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9005         into TypeContainer, to make partial classes work again.
9006
9007 2004-09-03  Martin Baulig  <martin@ximian.com>
9008
9009         * rootcontext.cs (RootContext.V2): Removed.
9010
9011 2004-03-23  Martin Baulig  <martin@ximian.com>
9012
9013         * expression.cs (Invocation.OverloadResolve): Added `bool
9014         may_fail' argument and use it instead of the Location.IsNull() hack.
9015
9016 2004-09-09  Martin Baulig  <martin@ximian.com>
9017
9018         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9019
9020 2004-09-09  Martin Baulig  <martin@ximian.com>
9021
9022         * generic.cs (TypeParameter.DefineType): Added support for
9023         explicit interface methods.
9024
9025 2004-09-09  Martin Baulig  <martin@ximian.com>
9026
9027         * README.Changes: New document.  Started to list important changes
9028         between MCS and GMCS here.
9029
9030 2004-09-08  Martin Baulig  <martin@ximian.com>
9031
9032         * class.cs
9033         (TypeContainer.CheckRecursiveDefinition): New protected method.
9034         (TypeContainer.DefineType): Move the CS0146 check into
9035         CheckRecursiveDefinition().     
9036
9037 2004-09-06  Martin Baulig  <martin@ximian.com>
9038
9039         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9040         types for the constructor constraint.
9041
9042 2004-09-03  Martin Baulig  <martin@ximian.com>
9043
9044         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9045         into TypeContainer, to make partial classes work again.
9046
9047 2004-09-03  Martin Baulig  <martin@ximian.com>
9048
9049         * rootcontext.cs (RootContext.V2): Removed.
9050
9051 2004-03-23  Martin Baulig  <martin@ximian.com>
9052
9053         * expression.cs (Invocation.OverloadResolve): Added `bool
9054         may_fail' argument and use it instead of the Location.IsNull() hack.
9055
9056 2004-09-03  Martin Baulig  <martin@ximian.com>
9057
9058         Merged latest changes into gmcs.  Please keep this comment in
9059         here, it makes it easier for me to see what changed in MCS since
9060         the last time I merged.
9061
9062 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9063
9064         Fix #61128.
9065         * expression.cs (BetterConversion): Don't allow either conversion 
9066         to be null.  Remove redundant implicit conversion test when 'q ==
9067         null' -- when this function is invoked, we already know that the
9068         implicit conversion exists.
9069         (BetterFunction): Assume that 'best' is non-null.  Remove
9070         redundant reimplementation of IsApplicable when 'best' is null.
9071         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9072         number of arguments.
9073         (IsAncestralType): Extract from OverloadResolve.
9074         (OverloadResolve): Make robust to the MethodGroupExpr being
9075         unsorted.  Implement all the logic of Section 14.5.5.1, and
9076         support overloading of methods from multiple applicable types.
9077         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9078
9079         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9080         (RealError, Warning): Append type of report to related symbol.
9081
9082 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9083
9084         * enum.cs: Fixed CLS-Compliance checks for enum members.
9085         Error tests cs3008-8.cs, cs3014-8.cs
9086
9087 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9088
9089         Fixed bug #62342, #63102
9090         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9091         like ImplementMethod.
9092
9093 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9094
9095         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9096         Fixed bug #65170.
9097
9098 2004-09-02  Martin Baulig  <martin@ximian.com>
9099
9100         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9101         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9102         on the MethodBase.
9103
9104 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9105
9106         C# 2.0 Static classes implemented
9107
9108         * class.cs (TypeContainer): instance_constructors,
9109         initialized_fields, initialized_static_fields,
9110         default_constructor, base_inteface_types are protected to be
9111         accessible from StaticClass.
9112         (TypeContainer.DefineDefaultConstructor): New virtual method
9113         for custom default constructor generating
9114         (StaticClass): New class to handle "Static classes" feature.
9115
9116         * cs-parser.jay: Handle static keyword on class like instance
9117         of StaticClass.
9118
9119         * driver.cs: Added "/langversion" command line switch with two
9120         options (iso-1, default).
9121
9122 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9123
9124         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9125
9126 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9127
9128         * delegate.cs: Style.
9129
9130 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9131
9132         * delegate.cs: Add seperate instance expr field for miguel.
9133
9134 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9135
9136         * PointerArithmetic (Resolve): make sure we are not doing
9137         pointer arith on void*. Also, make sure we are resolved
9138         by not setting eclass until resolve.
9139
9140         All callers: Make sure that PointerArithmetic gets resolved.
9141
9142 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9143
9144         * ArrayCreation (LookupType): If the type does not resolve 
9145         to an array, give an error.
9146
9147 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9148
9149         * statement.cs (Try.Resolve): Fixed bug #64222
9150
9151 2004-08-27  Martin Baulig  <martin@ximian.com>
9152
9153         * class.cs
9154         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9155         crash here.     
9156
9157 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9158
9159         * ecore.cs (Constantify): Get underlying type via
9160         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9161         Windows in special cases.
9162
9163 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9164
9165         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9166         for obtaining also private methods.
9167         (GetRemoveMethod): Used GetRemoveMethod (true)
9168         for obtaining also private methods.
9169
9170 2004-09-02  Martin Baulig  <martin@ximian.com>
9171
9172         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9173         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9174         on the MethodBase.
9175
9176 2004-08-27  Martin Baulig  <martin@ximian.com>
9177
9178         * class.cs
9179         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9180         crash here.     
9181
9182 2004-08-25  Martin Baulig  <martin@ximian.com>
9183
9184         * support.cs (ReflectionParameters..ctor): If this is a generic
9185         method, retrieve and store its type parameters.
9186         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9187         (ReflectionParameters.GenericConstraints): The argument specifies
9188         the type parameter, not the method parameter.
9189         (InternalParameters.GenericConstraints): Likewise.
9190
9191         * generic.cs (TypeParameter.DefineType): Correctly handle
9192         constraints wrt. generic methods in interfaces and their
9193         implementations.        
9194
9195 2004-08-24  Martin Baulig  <martin@ximian.com>
9196
9197         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9198         (Constraints.IsSubclassOf): New internal method.
9199
9200         * typemanager.cs (TypeManager.FindMembers): Added special support
9201         for GenericTypeParameterBuilder's.      
9202         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9203         type parameters.
9204
9205 2004-08-24  Martin Baulig  <martin@ximian.com>
9206
9207         * typemanager.cs
9208         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9209         this for accessibility checks.
9210         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9211         IsNestedFamilyAccessible.
9212         (TypeManager.IsSubclassOf): New method, do what the name actually
9213         says.   
9214
9215 2004-08-24  Martin Baulig  <martin@ximian.com>
9216
9217         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9218         as a SimpleName, include the generic arity.
9219
9220 2004-08-24  Martin Baulig  <martin@ximian.com>
9221
9222         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9223         MethodAttributes.HideBySig for operators.
9224
9225 2004-08-23  Martin Baulig  <martin@ximian.com>
9226
9227         Back to the old error reporting system :-)
9228
9229         * report.cs (Message): Removed.
9230         (Report.MessageData, ErrorData, WarningData): Removed.
9231         (Report.Error, Warning): Back to the old system.
9232
9233 2004-08-23  Martin Baulig  <martin@ximian.com>
9234
9235         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9236
9237         * class.cs (TypeContainer.ParentContainer): New public virtual
9238         method; replaces the explicit interface implementation.
9239         (ClassPart.ParentContainer): Override.
9240
9241 2004-08-23  Martin Baulig  <martin@ximian.com>
9242
9243         * statement.cs (Switch): Added support for constant switches; see
9244         #59428 or test-285.cs.
9245
9246 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9247
9248         Fixed bug #62740.
9249         * statement.cs (GetEnumeratorFilter): Removed useless
9250         logic because C# specs is strict. GetEnumerator must be
9251         public.
9252
9253 2004-08-22  Martin Baulig  <martin@ximian.com>
9254
9255         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9256         a switch and may break, reset the barrier.  Fixes #59867.
9257
9258 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9259
9260         CLS-Compliance speed up (~5% for corlib)
9261
9262         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9263         New method. Tests container for CLS-Compliant names
9264
9265         * class.cs (TypeContainer.VerifyClsName): New method.
9266         Checks whether container name is CLS Compliant.
9267         (Constructor): Implements IMethodData.
9268
9269         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9270         low-case table for CLS Compliance test.
9271         (MemberCache.VerifyClsParameterConflict): New method.
9272         Checks method parameters for CS3006 error.
9273
9274         * enum.cs (EnumMember): Is derived from MemberCore.
9275         (Enum.VerifyClsName): Optimized for better performance.
9276
9277 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9278
9279         * report.cs: Renamed Error_T to Error and changed all
9280         references.
9281
9282 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9283
9284         * class.cs (TypeContainer.IndexerArrayList): New inner class
9285         container for indexers.
9286         (TypeContainer.DefaultIndexerName): New constant for default
9287         indexer name. Replaced all "Item" with this constant.
9288         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9289
9290         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9291         DefaultMemberAttribute constructor.
9292
9293 2004-08-05  Martin Baulig  <martin@ximian.com>
9294
9295         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9296         Fix bug #59429.
9297
9298 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9299
9300         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9301         multi platforms problem.
9302
9303         * compiler.csproj: Included shared files.
9304
9305 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9306
9307         Fix bug 60333, 55971 in the more general way
9308         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9309         Added arg_type argument for constant conversion.
9310         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9311
9312 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9313
9314         Fix bug #59760
9315         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9316         OperatorArrayList, MethodCoreArrayList for typecontainer
9317         containers. Changed class member types to these new types.
9318         (MethodArrayList.DefineMembers): Added test for CS0659.
9319
9320 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9321
9322         * cfold.cs: Synchronize the folding with the code in expression.cs
9323         Binary.DoNumericPromotions for uint operands.
9324
9325         * attribute.cs: Revert patch from Raja, it introduced a regression
9326         while building Blam-1.2.1 (hard to isolate a test case).
9327
9328 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9329
9330         Fix for #55382
9331         * class.cs:
9332         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9333         name collision.
9334         (MethodCore.parent_method): New member. The method we're overriding
9335         if this is an override method.
9336         (MethodCore.CheckBase): Moved from Method class and made common.
9337         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9338         private.
9339         (MethodCore.CheckForDuplications): New abstract method. For custom
9340         member duplication search in a container
9341         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9342         method and its return type.
9343         (Event.conflict_symbol): New member. Symbol with same name in the
9344         parent class.
9345
9346         * decl.cs:
9347         (MemberCache.FindMemberWithSameName): New method. The method
9348         is looking for conflict with inherited symbols.
9349
9350 2004-08-04  Martin Baulig  <martin@ximian.com>
9351
9352         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9353
9354         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9355
9356 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9357
9358         * report.cs (Message): New enum for better error, warning reference in
9359         the code.
9360         (MessageData): New inner abstract class. It generally handles printing of
9361         error and warning messages.
9362         Removed unused Error, Warning, Message methods.
9363
9364 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9365
9366         Fix for cs0592-8.cs test
9367         * attribute.cs
9368         (Attributable.ValidAttributeTargets): Made public.
9369         (Attribute.ExplicitTarget): New member for explicit target value.
9370         (Attribute.CheckTargets): Now we translate explicit attribute
9371         target to Target here.
9372
9373 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9374
9375         * ecore.cs (MethodGroupExpr): new IsBase property.
9376
9377         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9378
9379         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9380         rather than an instance expr.
9381
9382         (DelegateCreation.Emit): Use the method group rather than
9383         the instance expression. Also, if you have base.Foo as the
9384         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9385
9386         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9387
9388         (NewDelegate.DoResolve): Only check for the existance of Invoke
9389         if the method is going to be needed. Use MethodGroupExpr.
9390
9391         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9392
9393         * expression.cs: For pointer arith., make sure to use
9394         the size of the type, not the size of the pointer to
9395         the type.
9396
9397 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9398
9399         Fix for #60722
9400         * class.cs (Class): Added error CS0502 test.
9401
9402 2004-08-03  John Luke  <jluke@cfl.rr.com>
9403             Raja R Harinath  <rharinath@novell.com>
9404
9405         Fix for #60997.
9406         * attribute.cs (Attribute.complained_before): New flag.
9407         (Attribute.ResolveType, Attribute.Resolve),
9408         (Attribute.DefinePInvokeMethod): Set it.
9409         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9410         
9411 2004-08-03  Martin Baulig  <martin@ximian.com>
9412
9413         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9414         use a user-defined operator; we still need to do numeric
9415         promotions in case one argument is a builtin type and the other
9416         one has an implicit conversion to that type.  Fixes #62322.
9417
9418 2004-08-18  Martin Baulig  <martin@ximian.com>
9419
9420         * class.cs (Method.Define): Use the correct method name when
9421         creating the MethodBuilder for a generic method.
9422
9423 2004-08-17  Martin Baulig  <martin@ximian.com>
9424
9425         * generic.cs (Constraints): Support type parameter constraints.
9426
9427 2004-08-16  Martin Baulig  <martin@ximian.com>
9428
9429         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9430         (Token.GENERIC_DIMENSION): New token; this is returned if we
9431         encounter an unbound generic type in a typeof() expression.
9432
9433         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9434         this token is only generated while parsing a typeof() expression.
9435         (typeof_expression): Removed the old unbound_type hack.
9436
9437         * generic.cs (TypeArguments.IsUnbound): New public property.
9438
9439         * decl.cs (MemberName): Added support for unbound types.
9440
9441 2004-08-14  Martin Baulig  <martin@ximian.com>
9442
9443         * typemanager.cs
9444         (TypeManager.IsEqualGenericInstance): New static method.
9445         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9446         just used to check accessibility, so follow the rules of 26.1.6.        
9447
9448         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9449         ConstructedType instead of a TypeExpression if we have type arguments.
9450
9451         * cs-parser.jay (typeof_expression): Support unbound generic types.
9452
9453         * ecore.cs (UnboundTypeExpression): New public class.
9454
9455 2004-08-12  Martin Baulig  <martin@ximian.com>
9456
9457         * typemanager.cs (TypeManager.IsNestedChildOf): Use
9458         TypeManager.IsEqual() rather than `=='.
9459
9460         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9461         generic instances as well.
9462
9463 2004-08-12  Martin Baulig  <martin@ximian.com>
9464
9465         * expression.cs (Invocation.InferType): We can only infer method
9466         type parameters.  Fixes #62647.
9467
9468 2004-08-11  Martin Baulig  <martin@ximian.com>
9469
9470         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9471         before resolving the base classes.
9472
9473 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9474
9475         * Makefile: install .mdb file too.
9476
9477 2004-08-05  Martin Baulig  <martin@ximian.com>
9478
9479         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9480         initializer, the current type is just the TypeBuilder, not the
9481         instantiated generic type.
9482         (FieldExpr.IsFieldInitializer): New public property.
9483
9484 2004-08-04  Martin Baulig  <martin@ximian.com>
9485
9486         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9487
9488         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9489
9490 2004-08-03  Martin Baulig  <martin@ximian.com>
9491
9492         * class.cs (MethodData.Define): If we're an explicit
9493         implementation, remove the generic arity from the type name.
9494
9495 2004-08-03  Martin Baulig  <martin@ximian.com>
9496
9497         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9498         use a user-defined operator; we still need to do numeric
9499         promotions in case one argument is a builtin type and the other
9500         one has an implicit conversion to that type.  Fixes #62322.
9501
9502 2004-08-02  Martin Baulig  <martin@ximian.com>
9503
9504         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9505         `TypeExpr[]' array.
9506         (TypeContainer.GetClassBases): Return the unexpanded list of
9507         interfaces; we expand them later.
9508         (TypeContainer.DefineType): After creating the TypeBuilder, call
9509         TypeManager.ExpandInterfaces() to get an expanded and resolved
9510         list of interfaces.
9511
9512         * ecore.cs (TypeExpr.GetInterfaces): Removed
9513
9514         * generics.cs (Constraints.InterfaceConstraints): Remove.
9515         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9516         register the interface constraints.
9517
9518         * typemanager.cs
9519         (TypeManager.AddUserType): Removed the `ifaces' argument.
9520         (TypeManager.AddTypeParameter): Likewise.
9521         (TypeManager.AddUserInterface): Removed, was unused.
9522         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9523         `TypeExpr[]' array for the interfaces.
9524         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9525         has been defined, returns a list of the resolved interfaces types.
9526         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9527         (TypeManager.GetExplicitInterfaces): Likewise.  
9528
9529 2004-08-02  Martin Baulig  <martin@ximian.com>
9530
9531         * expression.cs (Invocation.EmitCall): If we're invoking a method
9532         on a type parameter, use the new `Constrained' prefix opcode.
9533
9534 2004-08-02  Martin Baulig  <martin@ximian.com>
9535
9536         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9537         (LocalInfo.IsThis): New public property.
9538         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9539
9540 2004-08-01  Martin Baulig  <martin@ximian.com>
9541
9542         * class.cs (TypeContainer.GetClassBases): Don't set the default
9543         here since we may get called from GetPartialBases().
9544         (TypeContainer.DefineType): If GetClassBases() didn't return a
9545         parent, use the default one.
9546
9547 2004-07-30  Martin Baulig  <martin@ximian.com>
9548
9549         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9550
9551         * class.cs (SourceMethod): New public class, derive from the
9552         symbol writer's ISourceMethod.
9553         (Method): Use the new symbol writer API.
9554
9555         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9556         as argument and use the new symbol writer.
9557
9558         * location.cs
9559         (SourceFile): Implement the symbol writer's ISourceFile.
9560         (Location.SymbolDocument): Removed.
9561         (Location.SourceFile): New public property.
9562
9563         * symbolwriter.cs: Use the new symbol writer API.
9564
9565 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9566
9567         * Makefile (install-local): Remove.  Functionality moved to
9568         executable.make.
9569
9570 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9571
9572         * Makefile: Install mcs.exe.config file together with mcs.exe.
9573         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9574         correct runtime version.
9575         
9576 2004-07-25  Martin Baulig  <martin@ximian.com>
9577
9578         * class.cs
9579         (TypeContainer.RegisterOrder): Removed, this was unused.
9580         (TypeContainer, interface_order): Removed.
9581         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9582         TypeContainer as argument since we can also be called with a
9583         `PartialContainer' for a partial class/struct/interface.
9584         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9585         of checking whether we're an `Interface' - we could be a
9586         `PartialContainer'.
9587         (PartialContainer.Register): Override; call
9588         AddClass()/AddStruct()/AddInterface() on our parent.
9589
9590         * cs-parser.jay (interface_member_declaration): Add things to the
9591         `current_container', not the `current_class'.
9592
9593         * rootcontext.cs (RegisterOrder): The overloaded version which
9594         takes an `Interface' was unused, removed.
9595
9596         * typemanager.cs (TypeManager.LookupInterface): Return a
9597         `TypeContainer', not an `Interface'.
9598         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9599         contain a `PartialContainer' for an interface, so check it's
9600         `Kind' to figure out what it is.
9601
9602 2004-07-25  Martin Baulig  <martin@ximian.com>
9603
9604         * class.cs (Class.DefaultTypeAttributes): New public constant.
9605         (Struct.DefaultTypeAttributes): Likewise.
9606         (Interface.DefaultTypeAttributes): Likewise.
9607         (PartialContainer.TypeAttr): Override this and add the
9608         DefaultTypeAttributes.
9609
9610 2004-07-25  Martin Baulig  <martin@ximian.com>
9611
9612         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9613         we can just use the `Parent' field instead.
9614
9615 2004-07-25  Martin Baulig  <martin@ximian.com>
9616
9617         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9618
9619 2004-07-25  Martin Baulig  <martin@ximian.com>
9620
9621         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9622         our parts before defining any methods.
9623         (TypeContainer.VerifyImplements): Make this virtual.
9624         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9625         on our PartialContainer.
9626
9627 2004-07-25  Martin Baulig  <martin@ximian.com>
9628
9629         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9630
9631         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9632         argument, we can just use the `Parent' field instead.
9633
9634         * class.cs
9635         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9636         (MemberBase.DoDefine): Likewise.
9637
9638 2004-07-24  Martin Baulig  <martin@ximian.com>
9639
9640         * decl.cs (MemberCore.Parent): New public field.
9641         (DeclSpace.Parent): Moved to MemberCore.
9642
9643         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9644         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9645         parent's .ctor.
9646         (FieldBase, Field, Operator): Likewise.
9647         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9648         (EventField, Event): Likewise.
9649
9650 2004-07-23  Martin Baulig  <martin@ximian.com>
9651
9652         * class.cs (PartialContainer): New public class.
9653         (ClassPart): New public class.
9654         (TypeContainer): Added support for partial classes.
9655         (TypeContainer.GetClassBases): Splitted some of the functionality
9656         out into GetNormalBases() and GetPartialBases().
9657
9658         * cs-tokenizer.cs (Token.PARTIAL): New token.
9659         (Tokenizer.consume_identifier): Added some hacks to recognize
9660         `partial', but only if it's immediately followed by `class',
9661         `struct' or `interface'.
9662
9663         * cs-parser.jay: Added support for partial clases.
9664
9665 2004-07-23  Martin Baulig  <martin@ximian.com>
9666
9667         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9668         a `DeclSpace' and also made it readonly.
9669         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9670         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9671         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9672
9673         * cs-parser.jay: Pass the `current_class', not the
9674         `current_container' (at the moment, this is still the same thing)
9675         to a new Method, Property, Event, Indexer or Constructor.
9676
9677 2004-07-23  Martin Baulig  <martin@ximian.com>
9678
9679         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9680         and removed the `current_interface' one.
9681         (struct_declaration, class_declaration, interface_declaration):
9682         Set `current_class' to the newly created class/struct/interface;
9683         set their `Bases' and call Register() before parsing their body.
9684
9685 2004-07-23  Martin Baulig  <martin@ximian.com>
9686
9687         * class.cs (Kind): New public enum.
9688         (TypeContainer): Made this class abstract.
9689         (TypeContainer.Kind): New public readonly field.
9690         (TypeContainer.CheckDef): New public method; moved here from
9691         cs-parser.jay.
9692         (TypeContainer.Register): New public abstract method.
9693         (TypeContainer.GetPendingImplementations): New public abstract
9694         method.
9695         (TypeContainer.GetClassBases): Removed the `is_class' and
9696         `is_iface' parameters.
9697         (TypeContainer.DefineNestedTypes): Formerly known as
9698         DoDefineType().
9699         (ClassOrStruct): Made this class abstract.
9700
9701         * tree.cs (RootTypes): New public type. 
9702
9703 2004-07-20  Martin Baulig  <martin@ximian.com>
9704
9705         * tree.cs (Tree.RecordNamespace): Removed.
9706         (Tree.Namespaces): Removed.
9707
9708         * rootcontext.cs (RootContext.IsNamespace): Removed.
9709
9710         * cs-parser.jay (namespace_declaration): Just create a new
9711         NamespaceEntry here.
9712
9713 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
9714
9715         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9716         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9717         entry to make sure it runs in the correct runtime version.
9718         
9719 2004-07-18  Martin Baulig  <martin@ximian.com>
9720
9721         * generic.cs (ConstructedType.CheckConstraints): Improved
9722         constraints checking.
9723
9724 2004-07-18  Martin Baulig  <martin@ximian.com>
9725
9726         * expression.cs (Invocation.BetterMethod): Call
9727         TypeManager.TypeToCoreType() on all types and removed my previous
9728         hack; we're already doig the right thing here.
9729
9730 2004-07-17  Martin Baulig  <martin@ximian.com>
9731
9732         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9733
9734 2004-07-16  Martin Baulig  <martin@ximian.com>
9735
9736         * iterators.cs: Added generics support.
9737
9738 2004-07-16  Martin Baulig  <martin@ximian.com>
9739
9740         * iterators.cs: Rewrote this.  We're now using one single Proxy
9741         class for both the IEnumerable and the IEnumerator interface and
9742         `Iterator' derives from Class so we can use the high-level API.
9743
9744         * class.cs (TypeContainer.AddIterator): New method.
9745         (TypeContainer.DoDefineType): New protected virtual method, which
9746         is called from DefineType().
9747         (TypeContainer.DoDefineMembers): Call DefineType() and
9748         DefineMembers() on all our iterators.
9749         (TypeContainer.Emit): Call Emit() on all our iterators.
9750         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9751
9752         * codegen.cs (EmitContext.CurrentIterator): New public field.
9753
9754 2004-07-15  Martin Baulig  <martin@ximian.com>
9755
9756         * typemanager.cs
9757         (TypeManager.not_supported_exception_type): New type.   
9758
9759 2004-07-14  Martin Baulig  <martin@ximian.com>
9760
9761         * typemanager.cs
9762         (TypeManager.generic_ienumerable_type): New type.
9763         (TypeManager.generic_ienumerator_type): New type.
9764
9765         * rootcontext.cs
9766         (RootContext.interfaces_first_stage): Added
9767         "System.Collections.Generic.IEnumerator`1" and
9768         "System.Collections.Generic.IEnumerable`1".     
9769
9770 2004-07-14  Martin Baulig  <martin@ximian.com>
9771
9772         * iterators.cs: Use real error numbers.
9773
9774 2004-07-14  Martin Baulig  <martin@ximian.com>
9775
9776         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9777         requires this to be a System.Collection.IEnumerable and not a
9778         class implementing that interface.
9779         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9780
9781 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9782
9783         * class.cs: Fixed previous fix, it broke some error tests.
9784
9785 2004-07-12  Martin Baulig  <martin@ximian.com>
9786
9787         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9788         Fixes #61293.
9789
9790 2004-07-14  Martin Baulig  <martin@ximian.com>
9791
9792         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9793         an exclamation mark (!) for the generic arity to reflect the
9794         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9795
9796 2004-07-13  Martin Baulig  <martin@ximian.com>
9797
9798         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9799         specifiers being part of a type argument.
9800
9801 2004-07-13  Martin Baulig  <martin@ximian.com>
9802
9803         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9804         name for generic types.
9805
9806 2004-07-13  Martin Baulig  <martin@ximian.com>
9807
9808         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9809         bit to fix #60119.
9810
9811 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9812
9813         * assign.cs (LocalTemporary): Add new argument: is_address,If
9814         `is_address' is true, then the value that we store is the address
9815         to the real value, and not the value itself.
9816         
9817         * ecore.cs (PropertyExpr): use the new local temporary
9818         stuff to allow us to handle X.Y += z (where X is a struct)
9819
9820 2004-07-08  Martin Baulig  <martin@ximian.com>
9821
9822         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9823         not always return, just like we're doing in Using.Resolve().
9824
9825 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9826
9827         * cs-parser.jay (fixed_statement): flag this as Pinned.
9828
9829 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9830
9831         * typemanager.cs (TypeManager): Removed MakePinned method, this
9832         mechanism is replaced with the .NET 2.x compatible mechanism of
9833         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9834
9835         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9836         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9837         `IsFixed' property which has a different meaning.
9838
9839 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9840
9841         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9842         visible from inside a nested class, not just the names of the
9843         immediately enclosing class.
9844         Fix for bug #60730.
9845
9846 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9847
9848         * expression.cs (BetterConversion): Remove buggy special-case
9849         handling of "implicit constant expression conversions".  At this
9850         point, we already know that the conversion is possible -- we're
9851         only checking to see which is better.
9852
9853 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9854
9855         * cs-parser.jay: Added error CS0210 test.
9856
9857 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9858
9859         * cs-parser.jay: Added error CS0134 test.
9860
9861 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9862
9863         Fix bug #52507
9864         * cs-parser.jay: Added error CS0145 test.
9865
9866 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9867
9868         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9869
9870 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9871         
9872         * expression.cs (StackAlloc.Resolve): The argument may not
9873         be a constant; deal with this case.
9874         
9875 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9876
9877         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9878         GetIndexerAttributeValue.
9879         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9880
9881         * class.cs (Indexer.Define): Added error tests for CS0415,
9882         CS0609.
9883
9884 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9885
9886         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9887         property code.
9888
9889 2004-06-23  Martin Baulig  <martin@ximian.com>
9890
9891         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9892         neither return nor throw, reset the barrier as well.  Fixes #60457.
9893
9894 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9895
9896         * class.cs : EventAttributes is now set to None by default.
9897           This fixes bug #60459.
9898
9899 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9900
9901         Fix bug #60219
9902         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9903         Don't throw exception but return null (it's sufficient now).
9904
9905 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9906
9907         * typemanager.cs (GetArgumentTypes): Faster implementation.
9908
9909 2004-06-18  Martin Baulig  <martin@ximian.com>
9910
9911         * attribute.cs (Attribute.Resolve): Check whether we're an
9912         EmptyCast which a Constant child.  Fixes #60333.
9913
9914 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9915
9916         * statement.cs (EmitCollectionForeach): Account for the fact that
9917         not all valuetypes are in areas which we can take the address of.
9918         For these variables, we store to a temporary variable. Also, make
9919         sure that we dont emit a `callvirt' on a valuetype method.
9920
9921 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9922
9923         * expression.cs (StackAlloc.DoReSolve): Added test for
9924         negative parameter (CS0247).
9925
9926 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9927
9928         Fix bug #59792
9929         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9930
9931 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9932
9933         Fix bug #59781
9934         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9935         ulong.
9936
9937 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9938
9939         Fix bug #58254 & cs1555.cs, cs1556.cs
9940         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9941
9942 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9943
9944         * cs-parser.jay: Added error CS1669 test for indexers.
9945
9946 2004-06-18  Martin Baulig  <martin@ximian.com>
9947
9948         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9949         argument.  Fixes #60441.
9950
9951 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9952         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9953         The name needs to have the actual name of the method in order
9954         for other tests (such as the one in OverloadResolve for Invoke
9955         on a delegate) to work. As well, it does not really help
9956         error reporting because the method group had multiple methods.
9957         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
9958         Make profiling work.
9959         
9960 2004-06-13  Martin Baulig  <martin@ximian.com>
9961
9962         * cs-parser.jay: Don't allow generic attributes.
9963
9964 2004-06-13  Martin Baulig  <martin@ximian.com>
9965
9966         * class.cs (MemberBase.DoDefineBase): New protected method.
9967         (MemberBase.DoDefine): Compute the `flags' in the new
9968         DoDefineBase() which must be called first.
9969         (Method.Define): Call DoDefineBase() first so we have the flags
9970         when defining the generic method.
9971
9972         * cs-parser.jay (interface_method_declaration): Support generic methods.
9973
9974 2004-06-13  Martin Baulig  <martin@ximian.com>
9975
9976         * decl.cs (TypeName): Removed.
9977         (MemberName): Removed TypeName and MemberNow; now we just have
9978         MemberName.
9979
9980         * cs-parser.jay: Don't distinguish between type arguments and type
9981         parameters in the grammar and simplified the rules a bit.  The
9982         reduce/reduce conflicts are now gone (except the one we inherited
9983         from mcs).
9984
9985 2004-06-11  Martin Baulig  <martin@ximian.com>
9986
9987         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
9988         call this twice: for params and varargs methods.
9989
9990 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9991
9992         * class.cs:
9993         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
9994
9995 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
9996
9997         * attribute.cs (Attribute.GetValidTargets): Made public.
9998
9999         * class.cs: 
10000         (AbstractPropertyEventMethod): New class for better code sharing.
10001         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10002         CS1667 report.
10003         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10004
10005 2004-06-09  Martin Baulig  <martin@ximian.com>
10006
10007         * cs-parser.jay: Removed a reduce/reduce conflict.
10008
10009 2004-06-03  Martin Baulig  <martin@ximian.com>
10010
10011         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10012         GetSimpleName() and return a SimpleName.
10013
10014         * ecore.cs (SimpleName.Arguments): New public field.
10015         (SimpleName): Added overloaded ctor which takes an additional
10016         TypeArguments argument.
10017         (SimpleName.SimpleNameResolve): Added support for generic methods.
10018         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10019         formerly in MemberAccess.DoResolve(), but we also need it in
10020         SimpleNameResolve().
10021
10022         * expression.cs (MemberAccess.DoResolve): Use the new
10023         MethodGroupExpr.ResolveGeneric().       
10024
10025 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10026
10027         * decl.cs: If possible, use lookuptypedirect here. We can only do
10028         this if there is no `.' after the namespace. Avoids using
10029         LookupType, which does lots of slow processing.
10030         (FindNestedType) New method, does what it says :-).
10031         * namespace.cs: use LookupTypeDirect.
10032         * rootcontext.cs: use membercache, if possible.
10033         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10034
10035 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10036
10037         * expression.cs:
10038         According to the spec, 
10039
10040         In a member access of the form E.I, if E is a single identifier,
10041         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10042         field, property, localvariable, or parameter with the same type as
10043         the meaning of E as a type-name (§3.8), then both possible
10044         meanings of E are permitted.
10045
10046         We did not check that E as a simple-name had the same type as E as
10047         a type name.
10048
10049         This trivial check gives us 5-7% on bootstrap time.
10050
10051 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10052
10053         * expression.cs (Invocation.OverloadResolve): Avoid the
10054         use of hashtables and boxing here by allocating on demand.
10055
10056 2004-05-30  Martin Baulig  <martin@ximian.com>
10057
10058         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10059         we're doing a silent lookup.  Don't try to lookup nested types in
10060         TypeManager.object_type (thanks to Ben Maurer).
10061
10062 2004-05-30  Martin Baulig  <martin@ximian.com>
10063
10064         Committing a patch from Ben Maurer.
10065
10066         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10067
10068 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10069
10070         * convert.cs: add a trivial cache for overload operator resolution.
10071
10072 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10073
10074         * attribute.cs
10075         (AttributeTester.GetObsoleteAttribute): Returns instance of
10076         ObsoleteAttribute when type is obsolete.
10077
10078         * class.cs
10079         (TypeContainer.VerifyObsoleteAttribute): Override.
10080         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10081         (MethodCode.VerifyObsoleteAttribute): Override.
10082         (MemberBase.VerifyObsoleteAttribute): Override.
10083
10084         * decl.cs
10085         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10086         and report proper error.
10087
10088         *delegate.cs
10089         (Delegate.VerifyObsoleteAttribute): Override.
10090
10091         * ecore.cs
10092         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10093         and report proper error.
10094         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10095
10096         * enum.cs
10097         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10098         and enum member.
10099
10100         * expression.cs
10101         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10102         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10103         Added test for ObsoleteAttribute.
10104
10105         * statement.cs
10106         (Catch): Derived from Statement.
10107
10108 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10109
10110         * decl.cs: If possible, use lookuptypedirect here. We can only do
10111         this if there is no `.' after the namespace. Avoids using
10112         LookupType, which does lots of slow processing.
10113         (FindNestedType) New method, does what it says :-).
10114         * namespace.cs: use LookupTypeDirect.
10115         * rootcontext.cs: use membercache, if possible.
10116         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10117
10118 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10119
10120         * expression.cs:
10121         According to the spec, 
10122
10123         In a member access of the form E.I, if E is a single identifier,
10124         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10125         field, property, localvariable, or parameter with the same type as
10126         the meaning of E as a type-name (§3.8), then both possible
10127         meanings of E are permitted.
10128
10129         We did not check that E as a simple-name had the same type as E as
10130         a type name.
10131
10132         This trivial check gives us 5-7% on bootstrap time.
10133
10134 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10135
10136         Fixed bug #59071 & cs0160.cs
10137         * statement.cs (Try.Resolve): Check here whether order of catch
10138         clauses matches their dependencies.
10139
10140 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10141
10142         Fixed bug #58624
10143         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10144         unsafe type.
10145
10146 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10147
10148         * expression.cs (Invocation.OverloadResolve): Avoid the
10149         use of hashtables and boxing here by allocating on demand.
10150
10151 2004-05-30  Martin Baulig  <martin@ximian.com>
10152
10153         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10154         we're doing a silent lookup.  Don't try to lookup nested types in
10155         TypeManager.object_type (thanks to Ben Maurer).
10156
10157 2004-05-30  Martin Baulig  <martin@ximian.com>
10158
10159         Committing a patch from Ben Maurer.
10160
10161         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10162
10163 2004-05-29  Martin Baulig  <martin@ximian.com>
10164
10165         * class.cs (IMethodData.ShouldIgnore): New method.
10166
10167         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10168         `Location' argument, we don't need it anywhere.  Use
10169         `IMethodData.ShouldIgnore ()' instead of
10170         `MethodData.GetMethodFlags ()'.
10171         (TypeManager.AddMethod): Removed.
10172         (TypeManager.AddMethod2): Renamed to AddMethod.
10173
10174 2004-05-29  Martin Baulig  <martin@ximian.com>
10175
10176         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10177
10178         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10179         converting from a class type S to an interface type and we already
10180         have an object on the stack, don't box it again.  Fixes #52578.
10181
10182 2004-05-29  Martin Baulig  <martin@ximian.com>
10183
10184         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10185         Added support for `params' parameters.  Fixes #59267.
10186
10187 2004-05-29  Martin Baulig  <martin@ximian.com>
10188
10189         * literal.cs (NullPointer): Provide a private .ctor which sets
10190         `type' to TypeManager.object_type.  Fixes #59048.
10191
10192 2004-05-29  Martin Baulig  <martin@ximian.com>
10193
10194         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10195         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10196
10197         * ecore.cs (EventExpr.instance_expr): Make the field private.
10198
10199 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10200
10201         Fixed bug #50080 & cs0214-2.cs
10202         * expression.cs (Cast.DoResolve): Check unsafe context here.
10203         
10204         * statement.cs (Resolve.DoResolve): Likewise.
10205
10206 2004-05-26  Martin Baulig  <martin@ximian.com>
10207
10208         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10209
10210         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10211         (RootContext.LookupType): Pass down the `silent' flag.
10212
10213 2004-05-25  Martin Baulig  <martin@ximian.com>
10214
10215         * expression.cs
10216         (MethodGroupExpr.IdenticalTypeName): New public property.
10217         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10218         expression actually refers to a type.
10219
10220 2004-05-25  Martin Baulig  <martin@ximian.com>
10221
10222         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10223         for #56176 and made it actually work.
10224
10225 2004-05-25  Martin Baulig  <martin@ximian.com>
10226
10227         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10228         (FieldExpr, PropertyExpr): Override and implement
10229         CacheTemporaries.  Fixes #52279.
10230
10231 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10232
10233         * location.cs: In the new compiler listing a file twice is a
10234         warning, not an error.
10235
10236 2004-05-24  Martin Baulig  <martin@ximian.com>
10237
10238         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10239         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10240
10241 2004-05-24  Martin Baulig  <martin@ximian.com>
10242
10243         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10244         walking the `using' list.  Fixes #53921.
10245
10246 2004-05-24  Martin Baulig  <martin@ximian.com>
10247
10248         * const.cs (Const.LookupConstantValue): Added support for
10249         EmptyCast's; fixes #55251.
10250
10251 2004-05-24  Martin Baulig  <martin@ximian.com>
10252
10253         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10254         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10255         which does the CS0135 check.  The reason is that we first need to
10256         check whether the variable actually exists.
10257
10258 2004-05-24  Martin Baulig  <martin@ximian.com>
10259
10260         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10261         than RootContext.LookupType() to find the explicit interface
10262         type.  Fixes #58584.
10263
10264 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10265
10266         * Makefile: Simplify.  Use executable.make.
10267         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10268
10269 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10270
10271         * decl.cs:
10272         * enum.cs:
10273         Use the invariant culture when doing String.Compare for CLS case
10274         sensitivity.
10275         
10276 2004-05-23  Martin Baulig  <martin@ximian.com>
10277
10278         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10279         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10280
10281         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10282
10283 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10284
10285         * class.cs (MemberBase.Define): Reuse MemberType member for 
10286         resolved type. Other methods can use it too.
10287
10288 2004-05-23  Martin Baulig  <martin@ximian.com>
10289
10290         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10291         the variable also exists in the current block (otherwise, we need
10292         to report a CS0103).  Fixes #58670.
10293
10294 2004-05-23  Martin Baulig  <martin@ximian.com>
10295
10296         * flowanalysis.cs (Reachability.Reachable): Compute this
10297         on-the-fly rather than storing it as a field.
10298
10299 2004-05-23  Martin Baulig  <martin@ximian.com>
10300
10301         * flowanalysis.cs (Reachability.And): Manually compute the
10302         resulting `barrier' from the reachability.      
10303        
10304 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10305
10306         Fix bug #57835
10307         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10308         instance of ObsoleteAttribute when symbol is obsolete.
10309
10310         * class.cs
10311         (IMethodData): Extended interface for ObsoleteAttribute support.
10312
10313 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10314
10315         * attribute.cs: Fix bug #55970
10316
10317 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10318
10319         Fix bug #52705
10320         * attribute.cs
10321         (GetObsoleteAttribute): New method. Creates the instance of
10322         ObsoleteAttribute.
10323         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10324         ObsoleteAttribute when member is obsolete.
10325         (AttributeTester.Report_ObsoleteMessage): Common method for
10326         Obsolete error/warning reporting.
10327
10328         * class.cs
10329         (TypeContainer.base_classs_type): New member for storing parent type.
10330
10331         * decl.cs
10332         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10333         for this MemberCore.
10334
10335 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10336
10337         * attribute.cs, const.cs: Fix bug #58590
10338
10339 2004-05-21  Martin Baulig  <martin@ximian.com>
10340
10341         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10342         out parameters if the end of the method is unreachable.  Fixes
10343         #58098. 
10344
10345 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10346
10347         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10348         Hari was right, why extra method.
10349
10350 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10351
10352         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10353
10354 2004-05-20  Martin Baulig  <martin@ximian.com>
10355
10356         * delegate.cs: Convert this file to Unix mode - like the original
10357         version in mcs is.
10358
10359 2004-05-20  Martin Baulig  <martin@ximian.com>
10360
10361         * attribute.cs: Convert this file to Unix mode - like the original
10362         version in mcs is.
10363
10364 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10365
10366        Fix bug #58688 (MCS does not report error when the same attribute
10367        is assigned twice)
10368
10369        * attribute.cs (Attribute.Emit): Distinction between null and default.
10370
10371 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10372
10373        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10374        of a top-level attribute without an attribute target.
10375        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10376        Make non-static.
10377        (Attribute.Conditional_GetConditionName), 
10378        (Attribute.Obsolete_GetObsoleteMessage): Update.
10379        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10380        part of ScanForIndexerName.
10381        (Attribute.CanIgnoreInvalidAttribute): New function.
10382        (Attribute.ScanForIndexerName): Move to ...
10383        (Attributes.ScanForIndexerName): ... here.
10384        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10385        (Attributes.Search): New internal variant that can choose not to
10386        complain if types aren't resolved.  The original signature now
10387        complains.
10388        (Attributes.GetClsCompliantAttribute): Use internal variant, with
10389        complaints suppressed.
10390        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10391        only if it not useful.
10392        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10393        top-level for attributes that are shared between the assembly
10394        and a top-level class.
10395        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10396        * class.cs: Update to reflect changes.
10397        (DefineIndexers): Fuse loops.
10398        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10399        a couple more variants of attribute names.
10400
10401 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10402
10403         Fix bug #52585 (Implemented explicit attribute declaration)
10404
10405         * attribute.cs:
10406         (Attributable.ValidAttributeTargets): New abstract method. It gets
10407         list of valid attribute targets for explicit target declaration.
10408         (Attribute.Target): It holds target itself.
10409         (AttributeSection): Removed.
10410         (Attribute.CheckTargets): New method. It checks whether attribute
10411         target is valid for the current element.
10412
10413         * class.cs:
10414         (EventProperty): New class. For events that are declared like
10415         property (with add and remove accessors).
10416         (EventField): New class. For events that are declared like field.
10417         class.cs
10418
10419         * cs-parser.jay: Implemented explicit attribute target declaration.
10420
10421         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10422         Override ValidAttributeTargets.
10423
10424         * parameter.cs:
10425         (ReturnParameter): Class for applying custom attributes on 
10426         the return type.
10427         (ParameterAtribute): New class. Class for applying custom
10428         attributes on the parameter type.
10429
10430 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10431
10432         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10433         definitions. 
10434
10435         (Method): Allow UNSAFE here.
10436
10437         * modifiers.cs: Support unsafe reporting.
10438
10439 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10440
10441         * decl.cs: Fix bug #58478.
10442
10443 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10444
10445         * statement.cs: When checking for unreachable code on an EmptyStatement,
10446         set the location. Fixes bug #58488.
10447
10448 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10449
10450         * driver.cs: Add -pkg handling.
10451
10452         From Gonzalo: UseShelLExecute=false
10453
10454 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10455
10456         * attribute.cs:
10457         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10458         for attribute.
10459         (Attribute.IsClsCompliaceRequired): Moved to base for better
10460         accesibility.
10461         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10462         when attribute is AttributeUsageAttribute.
10463         (Attribute.GetValidTargets): Simplified.
10464         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10465         attribute for this type.
10466         (Attribute.ApplyAttributes): Method renamed to Emit and make
10467         non-static.
10468         (GlobalAttributeSection): New class for special handling of global
10469         attributes (assembly, module).
10470         (AttributeSection.Emit): New method.
10471
10472         * class.cs: Implemented Attributable abstract methods.
10473         (MethodCore.LabelParameters): Moved to Parameter class.
10474         (Accessor): Is back simple class.
10475         (PropertyMethod): Implemented Attributable abstract class.
10476         (DelegateMethod): Implemented Attributable abstract class.
10477         (Event): New constructor for disctintion between normal Event
10478         and Event with accessors.
10479
10480         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10481
10482         * codegen.cs, const.cs, decl.cs, delegate.cs:
10483         (CommonAssemblyModulClass): Implemented Attributable abstract class
10484         and simplified.
10485
10486         * enum.cs: Implement IAttributeSupport interface.
10487         (EnumMember): New class for emum members. Implemented Attributable
10488         abstract class
10489
10490         * parameter.cs:
10491         (ParameterBase): Is abstract.
10492         (ReturnParameter): New class for easier [return:] attribute handling.
10493
10494         * typemanager.cs: Removed builder_to_attr.
10495
10496 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10497
10498         Fix bug #57151.
10499         * attribute.cs (Attribute.GetPositionalValue): New function.
10500         * class.cs (TypeContainer.VerifyMembers): New function.
10501         (TypeContainer.Emit): Use it.
10502         (ClassOrStruct): New base class for Class and Struct.
10503         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10504         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10505         class.
10506         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10507         then each non-static field should have a FieldOffset attribute.
10508         Otherwise, none of the fields should have a FieldOffset attribute.
10509         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10510         and FieldOffset attributes.
10511         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10512         (TypeManager.field_offset_attribute_type): New core types.
10513         (TypeManager.InitCoreTypes): Initialize them.
10514
10515 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10516
10517         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10518         Return correct type.
10519         From bug #58270.
10520
10521 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10522
10523         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10524         be implicitly converted to ulong.
10525         
10526         * expression.cs: The logic for allowing operator &, | and ^ worked
10527         was wrong, it worked before because we did not report an error in
10528         an else branch.  Fixes 57895.
10529
10530         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10531         allow volatile fields to be reference types.
10532
10533 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10534
10535         * driver.cs: Add support for /debug-
10536
10537 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10538
10539         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10540         Add a 'complain' parameter to silence errors.
10541         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10542         silently overlooked type-resolutions.
10543         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10544         to reflect changes.
10545         (Attributes.Search): New function.
10546         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10547         (Attributes.GetAttributeFullName): Remove hack.
10548         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10549         Update to reflect changes.
10550         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10551         Use Attributes.Search instead of nested loops.
10552
10553 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10554
10555         * decl.cs:
10556         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10557         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10558         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10559
10560         * report.cs: (Report.Warning): Renamed to Warning_T because of
10561         parameter collision.
10562
10563 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10564
10565         * expression.cs (MemberAccess.ResolveMemberAccess):
10566         Exit with non-zero status after Report.Error.
10567         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10568         Likewise.
10569         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10570
10571 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10572
10573         * support.cs: Don't hang when the file is empty.
10574
10575 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10576
10577         * support.cs: In SeekableStreamReader, compute the preamble size of the
10578           underlying stream. Position changes should take into account that initial
10579           count of bytes.
10580
10581 2004-05-03  Todd Berman  <tberman@sevenl.net>
10582
10583         * driver.cs: remove unused GetSysVersion function.
10584
10585 2004-05-03  Todd Berman  <tberman@sevenl.net>
10586
10587         * driver.cs: Remove the hack from saturday, as well as the hack
10588         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10589         link_paths to get that bit proper.
10590
10591 2004-05-01  Todd Berman  <tberman@sevenl.net>
10592
10593         * driver.cs: Try a LoadFrom before a Load, this checks the current
10594         path. This is currently a bug in mono that is be fixed, however, this
10595         provides a workaround for now. This will be removed when the bug
10596         is fixed.
10597
10598 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10599
10600         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10601         incomplete key pairs (#57941).
10602
10603 2004-05-01  Todd Berman  <tberman@sevenl.net>
10604
10605         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10606         from the GAC
10607
10608 2004-04-30  Jackson Harper  <jackson@ximian.com>
10609
10610         * codegen.cs: Open keys readonly.
10611         
10612 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10613
10614         * typemanager.cs: don't report cyclic struct layout when a struct
10615         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10616         which has 2 Pango.Rectangle fields.
10617
10618 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10619
10620         * expression.cs: Handle IntPtr comparisons with IL code
10621         rather than a method call.
10622
10623 2004-04-29  Martin Baulig  <martin@ximian.com>
10624
10625         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10626         the list of PropertyInfo's in class hierarchy and find the
10627         accessor.  Fixes #56013.
10628
10629 2004-04-29  Martin Baulig  <martin@ximian.com>
10630
10631         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10632
10633 2004-04-29  Martin Baulig  <martin@ximian.com>
10634
10635         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10636
10637         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10638
10639 2004-04-29  Martin Baulig  <martin@ximian.com>
10640
10641         * class.cs (ConstructorInitializer.Resolve): Check whether the
10642         parent .ctor is accessible.  Fixes #52146.
10643
10644 2004-04-29  Martin Baulig  <martin@ximian.com>
10645
10646         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10647
10648         * statement.cs (Using.EmitLocalVariableDecls): Use
10649         TypeManager.idisposable_type, not typeof (IDisposable).
10650         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10651
10652 2004-04-29  Martin Baulig  <martin@ximian.com>
10653
10654         * class.cs (Event.Define): Don't emit the field and don't set
10655         RTSpecialName and SpecialName for events on interfaces.  Fixes
10656         #57703. 
10657
10658 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10659
10660         Refactor Attribute.ApplyAttributes.
10661         * attribute.cs (Attributable): New base class for objects that can
10662         have Attributes applied on them.
10663         (Attribute): Make AttributeUsage fields public.
10664         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10665         (Attribute.IsInternalCall): New property.
10666         (Attribute.UsageAttr): Convert to a public read-only property.
10667         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10668         (Attribute.ResolveType, Attribute.Resolve)
10669         (Attribute.ScanForIndexerName): Update to reflect changes.
10670         (Attribute.CheckAttributeTarget): Re-format.
10671         (Attribute.ApplyAttributes): Refactor, to various
10672         Attributable.ApplyAttributeBuilder methods.
10673         * decl.cs (MemberCore): Make Attributable.
10674         * class.cs (Accessor): Make Attributable.
10675         (MethodData.ApplyAttributes): Use proper attribute types, not
10676         attribute names.
10677         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10678         (TypeContainer.ApplyAttributeBuilder)
10679         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10680         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10681         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10682         (Operator.ApplyAttributeBuilder): New factored-out methods.
10683         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10684         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10685         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10686         * parameter.cs (ParameterBase): New Attributable base class
10687         that can also represent Return types.
10688         (Parameter): Update to the changes.
10689
10690 2004-04-29  Jackson Harper  <jackson@ximian.com>
10691
10692         * driver.cs: Prefer the corlib system version when looking for
10693         assemblies in the GAC. This is still a hack, but its a better hack
10694         now.
10695         
10696 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10697
10698         * decl.cs, enum.cs: Improved error 3005 reporting.
10699   
10700         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10701         (related_symbols): New private member for list of symbols
10702         related to reported error/warning.
10703         
10704         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10705
10706 2004-04-29  Martin Baulig  <martin@ximian.com>
10707
10708         * ecore.cs (Expression.Constantify): If we're an enum and
10709         TypeManager.TypeToCoreType() doesn't give us another type, use
10710         t.UnderlyingSystemType.  Fixes #56178.  
10711
10712 2004-04-29  Martin Baulig  <martin@ximian.com>
10713
10714         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10715         interfaces and for each interface, only add members directly
10716         declared in that interface.  Fixes #53255.
10717
10718 2004-04-28  Martin Baulig  <martin@ximian.com>
10719
10720         * expression.cs (ConditionalLogicalOperator): Use a temporary
10721         variable for `left' to avoid that we evaluate it more than once;
10722         bug #52588.
10723
10724 2004-04-28  Martin Baulig  <martin@ximian.com>
10725
10726         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10727         `void[]' (CS1547).
10728
10729 2004-04-28  Martin Baulig  <martin@ximian.com>
10730
10731         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10732         void (CS1547).
10733
10734         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10735         whether the type is not void (CS1547).
10736
10737 2004-04-28  Martin Baulig  <martin@ximian.com>
10738
10739         * expression.cs (Unary.DoResolveLValue): Override this and report
10740         CS0131 for anything but Operator.Indirection.
10741
10742 2004-04-28  Martin Baulig  <martin@ximian.com>
10743
10744         Committing a patch from Ben Maurer; see bug #50820.
10745
10746         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10747         check for classes.
10748
10749         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10750         classes.        
10751
10752 2004-04-28  Martin Baulig  <martin@ximian.com>
10753
10754         Committing a patch from Ben Maurer; see bug #50820.
10755
10756         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10757         check for classes.
10758
10759         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10760         classes.        
10761
10762 2004-04-28  Martin Baulig  <martin@ximian.com>
10763
10764         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10765         (Block.AddLabel): Call DoLookupLabel() to only search in the
10766         current block.
10767
10768 2004-04-28  Martin Baulig  <martin@ximian.com>
10769
10770         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10771         comparing StringConstants and NullLiterals in Equality and Inequality.
10772
10773 2004-04-28  Jackson Harper  <jackson@ximian.com>
10774
10775         * driver.cs: Attempt to load referenced assemblies from the
10776         GAC. This is the quick and dirty version of this method that
10777         doesnt take into account versions and just takes the first
10778         canidate found. Will be good enough for now as we will not have more
10779         then one version installed into the GAC until I update this method.
10780
10781 2004-04-28  Martin Baulig  <martin@ximian.com>
10782
10783         * typemanager.cs (TypeManager.CheckStructCycles): New public
10784         static method to check for cycles in the struct layout.
10785
10786         * rootcontext.cs (RootContext.PopulateTypes): Call
10787         TypeManager.CheckStructCycles() for each TypeContainer.
10788         [Note: We only need to visit each type once.]
10789
10790 2004-04-28  Martin Baulig  <martin@ximian.com>
10791
10792         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10793
10794         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10795         success and added `out object value'.  Use a `bool resolved' field
10796         to check whether we've already been called rather than
10797         `ConstantValue != null' since this breaks for NullLiterals.
10798
10799 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10800
10801         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10802         setting of this flag, since the 'set' method may be non-public.
10803
10804 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10805
10806         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10807         check on current_vector.Block.
10808
10809 2004-04-27  Martin Baulig  <martin@ximian.com>
10810
10811         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10812         a field initializer.  Fixes #56459.
10813
10814 2004-04-27  Martin Baulig  <martin@ximian.com>
10815
10816         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10817         we're not attempting to use an indexer.  Fixes #52154.
10818
10819 2004-04-27  Martin Baulig  <martin@ximian.com>
10820
10821         * statement.cs (Return): Don't create a return label if we don't
10822         need it; reverts my change from January 20th.  Thanks to Ben
10823         Maurer for this.
10824
10825 2004-04-27  Martin Baulig  <martin@ximian.com>
10826
10827         According to the spec, `goto' can only leave a nested scope, but
10828         never enter it.
10829
10830         * statement.cs (Block.LookupLabel): Only lookup in the current
10831         block, don't recurse into parent or child blocks.
10832         (Block.AddLabel): Check in parent and child blocks, report
10833         CS0140/CS0158 if we find a duplicate.
10834         (Block): Removed this indexer for label lookups.
10835         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10836         this already does the error reporting for us.
10837
10838         * flowanalysis.cs
10839         (FlowBranching.UsageVector.Block): New public variable; may be null.
10840         (FlowBranching.CreateSibling): Added `Block' argument.
10841         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10842         label for the target of a `goto' and check whether we're not
10843         leaving a `finally'.
10844
10845 2004-04-27  Martin Baulig  <martin@ximian.com>
10846
10847         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10848         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10849         just for returns).
10850
10851 2004-04-27  Martin Baulig  <martin@ximian.com>
10852
10853         * statement.cs (Block.AddLabel): Also check for implicit blocks
10854         and added a CS0158 check.
10855
10856 2004-04-27  Martin Baulig  <martin@ximian.com>
10857
10858         * flowanalysis.cs (FlowBranchingLoop): New class.
10859         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10860         UsageVector's instead of an ArrayList.
10861         (FlowBranching.Label): Likewise.
10862         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10863         (FlowBranching.AddBreakVector): New method.
10864
10865 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10866
10867         * attribute.cs: Small regression fix: only convert the type if we
10868         the type is different, fixes System.Drawing build.
10869
10870 2004-04-27  Martin Baulig  <martin@ximian.com>
10871
10872         * attribute.cs (Attribute.Resolve): If we have a constant value
10873         for a named field or property, implicity convert it to the correct
10874         type.
10875
10876 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10877
10878         * statement.cs (Block.Block): Implicit blocks share
10879         'child_variable_names' fields with parent blocks.
10880         (Block.AddChildVariableNames): Remove.
10881         (Block.AddVariable): Mark variable as "used by a child block" in
10882         every surrounding block.
10883         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10884         been used in a child block, complain about violation of "Invariant
10885         meaning in blocks" rule.
10886         * cs-parser.jay (declare_local_variables): Don't use
10887         AddChildVariableNames.
10888         (foreach_statement): Don't create an implicit block: 'foreach'
10889         introduces a scope.
10890
10891 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10892
10893         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10894         converting from 0L to ulong.  Fixes 57522.
10895
10896 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10897
10898         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10899         derived class hides via 'new' keyword field from base class (test-242.cs).
10900         TODO: Handle this in the more general way.
10901         
10902         * class.cs (CheckBase): Ditto.
10903
10904 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10905
10906         * decl.cs (caching_flags): New member for storing cached values
10907         as bit flags.
10908         (MemberCore.Flags): New enum where bit flags for caching_flags
10909         are defined.
10910         (MemberCore.cls_compliance): Moved to caching_flags.
10911         (DeclSpace.Created): Moved to caching_flags.
10912
10913         * class.cs: Use caching_flags instead of DeclSpace.Created
10914         
10915 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10916
10917         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10918         if we are only a derived class, not a nested class.
10919
10920         * typemanager.cs: Same as above, but do this at the MemberLookup
10921         level (used by field and methods, properties are handled in
10922         PropertyExpr).   Allow for the qualified access if we are a nested
10923         method. 
10924
10925 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10926
10927         * class.cs: Refactoring.
10928         (IMethodData): New inteface; Holds links to parent members
10929         to avoid member duplication (reduced memory allocation).
10930         (Method): Implemented IMethodData interface.
10931         (PropertyBase): New inner classes for get/set methods.
10932         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10933         (Event): New inner classes for add/remove methods.
10934         (Event.DelegateMethod): Implemented IMethodData interface.
10935
10936         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10937         EmitContext (related to class.cs refactoring).
10938
10939 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10940
10941         * delegate.cs (Delegate.VerifyApplicability): If the number of
10942         arguments are the same as the number of parameters, first try to
10943         verify applicability ignoring  any 'params' modifier on the last
10944         parameter.
10945         Fixes #56442.
10946
10947 2004-04-08  Martin Baulig  <martin@ximian.com>
10948
10949         Merged latest changes into gmcs.  Please keep this comment in
10950         here, it makes it easier for me to see what changed in MCS since
10951         the last time I merged.
10952
10953 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10954
10955         * class.cs (TypeContainer.AddIndexer): Use
10956         'ExplicitInterfaceName' to determine if interface name was
10957         explicitly specified.  'InterfaceType' is not initialized at this time.
10958         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
10959         Indexers array is already in the required order.  Initialize
10960         'IndexerName' only if there are normal indexers.
10961         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
10962         (TypeContainer.Emit): Emit DefaultMember attribute only if
10963         IndexerName is initialized.
10964         Fixes #56300.
10965
10966 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
10967
10968         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
10969         Fixes #57007
10970
10971 2004-04-15  Raja R Harinath  <rharinath@novell.com>
10972
10973         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
10974         attributes.
10975         Fix for #56456.
10976
10977         * attribute.cs (Attribute.Resolve): Check for duplicate named
10978         attributes.
10979         Fix for #56463.
10980
10981 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
10982
10983         * iterators.cs (MarkYield): track whether we are in an exception,
10984         and generate code accordingly.  Use a temporary value to store the
10985         result for our state.
10986
10987         I had ignored a bit the interaction of try/catch with iterators
10988         since their behavior was not entirely obvious, but now it is
10989         possible to verify that our behavior is the same as MS .NET 2.0
10990
10991         Fixes 54814
10992
10993 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
10994
10995         * iterators.cs: Avoid creating temporaries if there is no work to
10996         do. 
10997
10998         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
10999         Enumerations, use TypeManager.EnumToUnderlying and call
11000         recursively. 
11001
11002         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11003         bug #57013
11004
11005         (This.Emit): Use EmitContext.EmitThis to emit our
11006         instance variable.
11007
11008         (This.EmitAssign): Ditto.
11009
11010         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11011         codepaths, we will move all the functionality into
11012         Mono.CSharp.This 
11013
11014         (FieldExpr.EmitAssign): Ditto.
11015
11016         This fixes several hidden bugs that I uncovered while doing a code
11017         review of this today.
11018
11019         * codegen.cs (EmitThis): reworked so the semantics are more clear
11020         and also support value types "this" instances.
11021
11022         * iterators.cs: Changed so that for iterators in value types, we
11023         do not pass the value type as a parameter.  
11024
11025         Initialization of the enumerator helpers is now done in the caller
11026         instead of passing the parameters to the constructors and having
11027         the constructor set the fields.
11028
11029         The fields have now `assembly' visibility instead of private.
11030
11031 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11032
11033         * expression.cs (Argument.Resolve): Check if fields passed as ref
11034         or out are contained in a MarshalByRefObject.
11035
11036         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11037         another compiler type.
11038
11039 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11040
11041         * class.cs (Indexer.Define): use the new name checking method.
11042         Also, return false on an error.
11043         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11044         (is_identifier_[start/part]_character): make static.
11045
11046 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11047
11048         * expression.cs (Binary.ResolveOperator): Do no append strings
11049         twice: since we can be invoked more than once (array evaluation)
11050         on the same concatenation, take care of this here.  Based on a fix
11051         from Ben (bug #56454)
11052
11053 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11054
11055         * codegen.cs: Fix another case where CS1548 must be reported (when 
11056         delay-sign isn't specified and no private is available #56564). Fix
11057         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11058         error when MCS is used on the MS runtime and we need to delay-sign 
11059         (which seems unsupported by AssemblyBuilder - see #56621).
11060
11061 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11062
11063         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11064         (TypeManager.ComputeNamespaces): Faster implementation for
11065         Microsoft runtime.
11066
11067         * compiler.csproj: Updated AssemblyName to mcs.
11068
11069 2004-05-11  Jackson Harper  <jackson@ximian.com>
11070
11071         * Makefile: Preserve MONO_PATH
11072         
11073 2004-05-11  Jackson Harper  <jackson@ximian.com>
11074
11075         * Makefile: Use mono and mcs to build gmcs
11076         
11077 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11078
11079         * codegen.cs: Add patch from Robert Shade
11080         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11081         sync with mcs.
11082
11083 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11084
11085         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11086         incomplete key pairs (#57941).
11087
11088 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11089
11090         * codegen.cs: Fix another case where CS1548 must be reported (when 
11091         delay-sign isn't specified and no private is available #56564). Fix
11092         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11093         error when MCS is used on the MS runtime and we need to delay-sign 
11094         (which seems unsupported by AssemblyBuilder - see #56621).
11095
11096 2004-04-29  Jackson Harper  <jackson@ximian.com>
11097
11098         * Makefile: Set MONO_PATH to use the bootstrap corlib
11099         * driver.cs: Check the GAC for referenced assemblies.
11100                 
11101 2004-04-29  Martin Baulig  <martin@ximian.com>
11102
11103         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11104
11105 2004-04-07  Martin Baulig  <martin@ximian.com>
11106
11107         * expression.cs (Binary.ResolveOperator): Added special case for
11108         Equality/Inequality between a type parameter and a null literal.
11109
11110 2004-04-07  Martin Baulig  <martin@ximian.com>
11111
11112         * convert.cs: Check null literal -> type parameter conversions.
11113
11114 2004-04-07  Martin Baulig  <martin@ximian.com>
11115
11116         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11117         `class' and `struct' constraints.
11118
11119 2004-04-07  Martin Baulig  <martin@ximian.com>
11120
11121         * generic.cs (SpecialConstraint): New public enum.
11122         (Constraints.Resolve): Added support for the `class' and `struct'
11123         constraints.
11124
11125         * cs-parser.jay (type_parameter_constraint): Added support for the
11126         `class' and `struct' constraints.
11127
11128 2004-04-07  Martin Baulig  <martin@ximian.com>
11129
11130         * support.cs (GenericConstraints): Replaced `Types' by
11131         `ClassConstraint' and `InterfaceConstraints'; added
11132         `HasClassConstraint'.   
11133
11134 2004-04-07  Martin Baulig  <martin@ximian.com>
11135
11136         * generic.cs
11137         (Constraints.InterfaceConstraints): New public property.
11138         (Constraints.Types): Make this property public
11139         (TypeParameter): Implement IMemberContainer.
11140         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11141         instead of a TypeBuilder/MethodBuilder; pass the interface
11142         constraints to TypeManager.AddTypeParameter().
11143         (TypeParameter.DefineType): Just take an EmitContext and no
11144         TypeBuilder/MethodBuilder.  Use the new public API.
11145
11146         * typemanager.cs (TypeManager.AddTypeParameter): Added
11147         `TypeExpr[]' argument; add the interfaces to the
11148         `builder_to_ifaces' hash.
11149         (TypeManager.LookupMemberContainer): For
11150         GenericTypeParameterBuilders, get the TypeParameter from the
11151         `builder_to_type_param'.
11152         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11153         the TypeParameter and call FindMembers on it.
11154
11155 2004-04-07  Martin Baulig  <martin@ximian.com>
11156
11157         * class.cs
11158         (MethodCore.GenericMethod): Moved this field here from Method.
11159         (MethodCore.IsDuplicateImplementation): Take the number of type
11160         parameters into account if we're a generic method.
11161
11162         * expression.cs (Invocation.InferTypeArguments): Don't return true
11163         if `arguments' is null; we still need to check whether we actually
11164         don't need to infer anything in this case.
11165         (MemberAccess): Merged the functionality from GenericMemberAccess
11166         into this class.
11167
11168         * generic.cs (GenericMemberAccess): Removed.
11169
11170 2004-04-05  Martin Baulig  <martin@ximian.com>
11171
11172         * decl.cs (MemberCore): For generic classes, interfaces and
11173         structs, `Name' now includes the number of type parameters
11174         ("Stack!1.Node!1").
11175         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11176         encode the number of type arguments in the type name.
11177
11178         * expression.cs (Expression.MemberLookup): Removed the
11179         `num_type_args' argument; we now encode the number of type
11180         arguments in the type name.
11181
11182         * ecore.cs (SimpleName): Encode the number of type arguments in
11183         the type name itself.
11184
11185         * generic.cs (ConstructedType): Likewise.
11186
11187         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11188         `MemberName'; we now include the number of type parameters in the
11189         type name.
11190
11191         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11192         (TypeManager.MemberLookup): Removed the
11193         `num_type_args' argument; we now encode the number of type
11194         arguments in the type name.     
11195
11196 2004-04-03  Martin Baulig  <martin@ximian.com>
11197
11198         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11199         (MemberCore.MemberName): Moved here from MemberBase.
11200         (DeclSpace.SetParameterInfo): Just take the constraints as an
11201         ArrayList; we already have the type parameters in our
11202         `MemberName'; also do the CS0080 reporting here.
11203
11204         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11205         `IDENTIFIER opt_type_parameter_list'; when constructing our
11206         `MemberName', it'll already include our type parameters.
11207         (class_declaration, interface_declaration): Likewise.
11208         (delegate_declaration): Likewise.
11209         (MakeName): Take a MemberName and return a MemberName.
11210         The following two changes are required to avoid shift/reduce conflicts:
11211         (member_name): Don't include a TypeName anymore; ie. this is now
11212         just 'IDENTIFIER opt_type_parameter_list'.
11213         (property_declaration, event_declaration): Use a
11214         `namespace_or_type_name' instead of a `member_name'.            
11215
11216 2004-04-03  Martin Baulig  <martin@ximian.com>
11217
11218         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11219         `MemberName' class.
11220         (TypeName): Formerly known as MemberName.
11221
11222         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11223         instead of a `MemberName'.
11224
11225         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11226         (member_name): New rule; create a MemberName.
11227
11228 2004-04-02  Martin Baulig  <martin@ximian.com>
11229
11230         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11231         (CS0305 and CS0308).
11232
11233 2004-04-02  Martin Baulig  <martin@ximian.com>
11234
11235         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11236         support for nested types.
11237
11238 2004-04-02  Martin Baulig  <martin@ximian.com>
11239
11240         * ecore.cs (IAlias): New public interface.
11241         (TypeExpr, TypeExpression): Implement IAlias.
11242         (TypeAliasExpression): New public class.
11243
11244         * namespace.cs (Namespace): Implement IAlias.
11245         (Namespace.Lookup): Return an IAlias instead on an object.
11246         (Namespace.DefineName): Take an IAlias instead of an object.
11247         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11248         an object.
11249         (NamespaceEntry.UsingAlias): Take a Membername instead of an
11250         Expression.
11251         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11252         object.
11253         (NamespaceEntry.Lookup): Likewise.
11254
11255         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11256         instead of a Type.      
11257
11258         * decl.cs (DeclSpace): Implement IAlias.
11259         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11260
11261         * generic.cs (ConstructedType): Improved error checking.
11262
11263 2004-04-02  Martin Baulig  <martin@ximian.com>
11264
11265         * convert.cs: Added type parameter conversions.
11266
11267         * ecore.cs
11268         (UnboxCast.Emit): Emit an `unbox.any' for type params.
11269         (ClassCast.Emit): If the source type is a type parameter, box it.
11270         If the target type is a type parameter, emit an `unbox.any'
11271         instead of a `classcast'.1      
11272
11273 2004-04-01  Martin Baulig  <martin@ximian.com>
11274
11275         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11276
11277 2004-04-01  Martin Baulig  <martin@ximian.com>
11278
11279         * generic.cs (ConstructedType.CheckConstraints): Use
11280         Convert.ImplicitStandardConversionExists(); user-defined implicit
11281         conversions are not allowed according to the spec.
11282
11283 2004-03-30  Martin Baulig  <martin@ximian.com>
11284
11285         * expression.cs (New): Added support for type parameters.
11286
11287         * typemanager.cs
11288         (TypeManager.activator_type): New public static field.
11289         (TypeManager.activator_create_instance): Likewise.
11290
11291 2004-03-30  Martin Baulig  <martin@ximian.com>
11292
11293         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11294         public method.
11295
11296 2004-03-30  Martin Baulig  <martin@ximian.com>
11297
11298         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11299         the spec here: the argument type must be convertible to the
11300         constraints.
11301
11302 2004-03-30  Martin Baulig  <martin@ximian.com>
11303
11304         * generic.cs
11305         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11306         TypeManager.AddTypeParameter().
11307         (ConstructedType.CheckConstraints): Re-enable this and actually
11308         check whether we have a constructor constraint.
11309
11310         * typemanager.cs
11311         (TypeManager.builder_to_type_param): New static field.
11312         (TypeManager.AddTypeParameter): New static method.
11313         (TypeManager.LookupTypeParameter): New public method.
11314
11315 2004-03-30  Martin Baulig  <martin@ximian.com>
11316
11317         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11318         the new API to actually define the constructor constraint.
11319
11320         * typemanager.cs
11321         (TypeManager.new_constraint_attr_type): New static field.
11322         (TypeManager.InitCoreTypes): Initialize it.
11323
11324 2004-03-30  Martin Baulig  <martin@ximian.com>
11325
11326         * generic.cs (Constraints): Completed error checking, use correct
11327         error numbers.
11328
11329 2004-03-29  Martin Baulig  <martin@ximian.com>
11330
11331         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11332
11333         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11334         public version which takes a `ParameterData pd' instead of an
11335         `ArrayList args'.
11336
11337 2004-03-29  Martin Baulig  <martin@ximian.com>
11338
11339         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11340         not a MethodInfo.       
11341
11342 2004-03-29  Martin Baulig  <martin@ximian.com>
11343
11344         * expression.cs (Argument.ResolveMethodGroup): If we're a
11345         ConstructedType, call GetMemberAccess() on it.  
11346
11347 2004-03-29  Martin Baulig  <martin@ximian.com>
11348
11349         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11350         (MethodCore.CheckGenericOverride): When overriding a generic
11351         method, check whether the constraints match.
11352
11353         * support.cs (GenericConstraints): New public interface.
11354         (ParameterData.GenericConstraints): New public method.
11355
11356         * parameter.cs (Parameter.Resolve): Check whether we're a generic
11357         method parameter and compute our constraints if appropriate.
11358         (Parameter.GenericConstraints): New public property.
11359
11360         * generic.cs (Constraints): Implement GenericConstraints.
11361
11362 2004-03-29  Martin Baulig  <martin@ximian.com>
11363
11364         * decl.cs (MemberCache.FindMemberToOverride): Use
11365         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11366
11367 2004-03-29  Martin Baulig  <martin@ximian.com>
11368
11369         * generic.cs (GenericMethod.Define): Resolve our type parameters.
11370
11371 2004-03-29  Martin Baulig  <martin@ximian.com>
11372
11373         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11374         not allowed on non-generic declarations").
11375
11376 2004-03-29  Martin Baulig  <martin@ximian.com>
11377
11378         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11379         public version of this method.
11380
11381         * class.cs (MethodCore.IsDuplicateImplementation): Use
11382         Invocation.InferTypeArguments() to check this.
11383
11384 2004-03-29  Martin Baulig  <martin@ximian.com>
11385
11386         * convert.cs: Use TypeManager.IsDelegateType() instead of
11387         comparing types correctly.
11388
11389 2004-03-29  Martin Baulig  <martin@ximian.com>
11390
11391         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11392         types directly to make it work for generic instances.
11393
11394         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11395
11396 2004-03-29  Martin Baulig  <martin@ximian.com>
11397
11398         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11399         support for arrays.     
11400
11401 2004-03-24  Martin Baulig  <martin@ximian.com>
11402
11403         * decl.cs (DeclSpace.FindType): Also use
11404         TypeManager.CheckGeneric() for types from the using clauses.
11405
11406 2004-03-23  Martin Baulig  <martin@ximian.com>
11407
11408         * expression.cs (Invocation.OverloadResolve): Added `bool
11409         may_fail' argument and use it instead of the Location.IsNull() hack.
11410
11411 2004-03-23  Martin Baulig  <martin@ximian.com>
11412
11413         * expression.cs (Invocation.InferType): Use correct type inference
11414         rules here.     
11415
11416 2004-03-23  Martin Baulig  <martin@ximian.com>
11417
11418         * ecore.cs (MethodGroupExpr.Name): Use
11419         TypeManager.CSharpSignature() instead of just the name.
11420
11421         * expression.cs (Invocation.OverloadResolve): Provide better error
11422         reporting.
11423         (Invocation.DoResolve): OverloadResolve() never returns null
11424         without reporting an error, so removed the error -6 reporting here.
11425
11426 2004-03-23  Martin Baulig  <martin@ximian.com>
11427
11428         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11429         generic methods.
11430
11431         * cs-parser.jay (delegate_declaration): Support generic delegates.
11432
11433         * delegate.cs: Support generic delegates.
11434
11435 2004-03-22  Martin Baulig  <martin@ximian.com>
11436
11437         * expression.cs (Invocation.InferParamsTypeArguments): New static
11438         method; does type inference for params arguments.
11439
11440 2004-03-21  Martin Baulig  <martin@ximian.com>
11441
11442         * typemanager.cs (TypeManager.IsGenericMethod): New public static
11443         method; checks whether a method is a generic method.    
11444
11445         * expression.cs (Invocation.InferTypeArguments): New static method;
11446         infer type arguments for generic method invocation.
11447
11448         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11449         property; we set this to true if we're resolving a generic method
11450         invocation and the user specified type arguments, ie. we're not
11451         doing type inference.
11452
11453 2004-03-20  Martin Baulig  <martin@ximian.com>
11454
11455         * class.cs (MethodData.DeclaringType): New public property.
11456         (MethodData.Define): Set DeclaringType here.
11457         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11458         instead of OperatorMethodBuilder.DeclaringType.
11459
11460 2004-03-20  Martin Baulig  <martin@ximian.com>
11461
11462         * cs-tokenizer.cs (xtoken): Return a special
11463         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11464
11465         * cs-parser.jay (default_value_expression): Switch to the new
11466         syntax (14.5.13).
11467
11468 2004-03-19  Martin Baulig  <martin@ximian.com>
11469
11470         * decl.cs (MemberName): New class.  We use this to "construct"
11471         namespace_or_type_name's.
11472
11473         * generics.cs (TypeArguments.GetDeclarations): New public method;
11474         returns the type arguments as a string[] and reports a CS0081 if
11475         one of them is not an identifier.
11476
11477         * class.cs (MemberBase): The .ctor now takes the name as a
11478         MemberName instead of a string.
11479         (MemberBase.ExplicitInterfaceName): Changed type from string to
11480         Expression.
11481         (MemberBase.DoDefine): If we're an explicit implementation, the
11482         InterfaceType may be a generic instance.
11483
11484         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11485         (namespace_name): Call MemberName.GetName () to transform the
11486         MemberName into a string and ensure we don't have any type
11487         arguments.
11488         (type_name): Call MemberName.GetTypeExpression() to transfrom the
11489         MemberName into an expression.
11490         (method_header): Use namespace_or_type_name instead of member_name.     
11491
11492 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11493
11494         * rootcontext.cs: Add new types to the boot resolution.
11495
11496         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11497         MulticastDelegate is not allowed.
11498
11499         * typemanager.cs: Add new types to lookup: System.TypedReference
11500         and ArgIterator.
11501
11502         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11503         check for TypedReference or ArgIterator, they are not allowed. 
11504
11505         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11506         makes us properly catch 1510 in some conditions (see bug 56016 for
11507         details). 
11508
11509 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11510
11511         * CryptoConvert.cs: update from corlib version
11512         with endian fixes.
11513
11514 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11515
11516         * class.cs (Indexer.Define): Check indexername declaration
11517
11518 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11519
11520         * attribute.cs (IsClsCompliant): Fixed problem with handling
11521         all three states (compliant, not-compliant, undetected).
11522
11523 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11524
11525         * attribute.cs (Attribute): Location is now public.
11526         (Resolve): Store resolved arguments (pos_values) in attribute class.
11527         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11528         (GetClsCompliantAttributeValue): New method that gets
11529         CLSCompliantAttribute value.
11530         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11531         if exists else null.
11532         (AttributeTester): New class for CLS-Compliant verification routines.
11533
11534         * class.cs (Emit): Add CLS-Compliant verification.
11535         (Method.GetSignatureForError): Implemented.
11536         (Constructor.GetSignatureForError): Implemented
11537         (Constructor.HasCompliantArgs): Returns if constructor has
11538         CLS-Compliant arguments.
11539         (Constructor.Emit): Override.
11540         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11541         is needed to test only parameters.
11542         (FieldBase.GetSignatureForError): Implemented.
11543         (TypeContainer): New member for storing base interfaces.
11544         (TypeContainer.FindMembers): Search in base interfaces too.
11545
11546         * codegen.cs (GetClsComplianceAttribute): New method that gets
11547         assembly or module CLSCompliantAttribute value.
11548         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11549         for assembly.
11550         (ModuleClass.Emit): Add error 3012 test.
11551
11552         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11553
11554         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11555         state for all decl types.
11556         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11557         if CLS-Compliant tests are required.
11558         (IsClsCompliaceRequired): New method. Analyze whether code
11559         must be CLS-Compliant.
11560         (IsExposedFromAssembly): New method. Returns true when MemberCore
11561         is exposed from assembly.
11562         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11563         value or gets cached value.
11564         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11565         is explicitly marked with CLSCompliantAttribute.
11566         (IsIdentifierClsCompliant): New abstract method. This method is
11567         used to testing error 3005.
11568         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11569         for identifier and parameters CLS-Compliant testing.
11570         (VerifyClsCompliance): New method. The main virtual method for
11571         CLS-Compliant verifications.
11572         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11573         null. I don't know why is null (too many public members !).
11574         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11575         and get value of first CLSCompliantAttribute that found.
11576
11577         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11578         (VerifyClsCompliance): Override and add extra tests.
11579
11580         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11581         clscheck- disable CLS-Compliant verification event if assembly is has
11582         CLSCompliantAttribute(true).
11583
11584         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11585         ApllyAttribute is now called in emit section as in the other cases.
11586         Possible future Emit integration.
11587         (IsIdentifierClsCompliant): New override.
11588         (VerifyClsCompliance): New override.
11589         (GetEnumeratorName): Returns full enum name.
11590
11591         * parameter.cs (GetSignatureForError): Implemented.
11592
11593         * report.cs (WarningData): New struct for Warning message information.
11594         (LocationOfPreviousError): New method.
11595         (Warning): New method. Reports warning based on the warning table.
11596         (Error_T): New method. Reports error based on the error table.
11597
11598         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11599         verifications are done here.
11600
11601         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11602
11603         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11604         CLSCompliantAttribute.
11605         (all_imported_types): New member holds all imported types from other
11606         assemblies.
11607         (LoadAllImportedTypes): New method fills static table with exported types
11608         from all referenced assemblies.
11609         (Modules): New property returns all assembly modules.
11610
11611 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11612
11613         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11614         throwing a parser error.
11615
11616         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11617         which removes the hardcoded get_/set_ prefixes for properties, as
11618         IL allows for the properties to be named something else.  
11619
11620         Bug #56013
11621
11622         * expression.cs: Do not override operand before we know if it is
11623         non-null.  Fix 56207
11624
11625 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11626
11627         * typemanager.cs: support for pinned variables.
11628
11629 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11630
11631         * decl.cs, typemanager.cs: Avoid using an arraylist
11632         as a buffer if there is only one result set.
11633
11634 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11635
11636         * expression.cs: Make sure you cant call a static method
11637         with an instance expression, bug #56174.
11638
11639 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11640
11641         * class.cs (IsDuplicateImplementation): Improve error reporting to
11642         flag 663 (method only differs in parameter modifier).
11643
11644         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11645         in preprocessor directives.
11646
11647         * location.cs (LookupFile): Allow for the empty path.
11648
11649         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11650         better approach for some of that patch, but its failing with the
11651         CharSet enumeration.  For now try/catch will do.
11652
11653         * typemanager.cs: Do not crash if a struct does not have fields.
11654         Fixes 56150.
11655
11656 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11657
11658         * expression.cs: cs0213, cant fix a fixed expression.
11659         fixes 50231.
11660
11661 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11662
11663         * cs-parser.jay: detect invalid embeded statements gracefully.
11664         bug #51113.
11665
11666 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11667
11668         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11669         As a regex:
11670         s/
11671         the invocation type may not be a subclass of the tye of the item/
11672         The type of the item must be a subclass of the invocation item.
11673         /g
11674
11675         Fixes bug #50820.
11676
11677 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11678
11679         * attribute.cs: Added methods to get a string and a bool from an
11680         attribute. Required to information from AssemblyKeyFileAttribute,
11681         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11682         * codegen.cs: Modified AssemblyName creation to include support for
11683         strongnames. Catch additional exceptions to report them as CS1548.
11684         * compiler.csproj: Updated include CryptoConvert.cs.
11685         * compiler.csproj.user: Removed file - user specific configuration.
11686         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11687         Mono.Security assembly. The original class is maintained and tested in
11688         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11689         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11690         like CSC 8.0 (C# v2) supports.
11691         * Makefile: Added CryptoConvert.cs to mcs sources.
11692         * rootcontext.cs: Added new options for strongnames.
11693
11694 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11695
11696         * driver.cs: For --expect-error, report error code `2'
11697         if the program compiled with no errors, error code `1' if
11698         it compiled with an error other than the one expected.
11699
11700 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11701
11702         * compiler.csproj: Updated for Visual Studio .NET 2003.
11703         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11704         * compiler.sln: Updated for Visual Studio .NET 2003.
11705
11706 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11707
11708         * expression.cs: Fix bug #47234. We basically need to apply the
11709         rule that we prefer the conversion of null to a reference type
11710         when faced with a conversion to 'object' (csc behaviour).
11711
11712 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11713
11714         * statement.cs: Shorter form for foreach, eliminates
11715         a local variable. r=Martin.
11716
11717 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11718
11719         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11720         checks if we can use brtrue/brfalse to test for 0.
11721         * expression.cs: use the above in the test for using brtrue/brfalse.
11722         cleanup code a bit.
11723
11724 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11725
11726         * expression.cs: Rewrite string concat stuff. Benefits:
11727
11728         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11729         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11730         rather than a concat chain.
11731
11732         * typemanager.cs: Add lookups for more concat overloads.
11733
11734 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11735
11736         * expression.cs: Emit shorter il code for array init.
11737
11738         newarr
11739         dup
11740         // set 1
11741
11742         // set 2
11743
11744         newarr
11745         stloc.x
11746
11747         ldloc.x
11748         // set 1
11749
11750         ldloc.x
11751         // set 2
11752
11753 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11754
11755         * statement.cs: Before, two switch blocks would be merged if the
11756         total size of the blocks (end_item - begin_item + 1) was less than
11757         two times the combined sizes of the blocks.
11758
11759         Now, it will only merge if after the merge at least half of the
11760         slots are filled.
11761
11762         fixes 55885.
11763
11764 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11765
11766         * class.cs : csc build fix for GetMethods(). See bug #52503.
11767
11768 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11769
11770         * expression.cs: Make sure fp comparisons work with NaN.
11771         This fixes bug #54303. Mig approved this patch a long
11772         time ago, but we were not able to test b/c the runtime
11773         had a related bug.
11774
11775 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11776
11777         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11778
11779 2004-03-19  Martin Baulig  <martin@ximian.com>
11780
11781         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11782         two overloads may unify for some type parameter substitutions and
11783         report a CS0408 if appropriate.
11784
11785 2004-03-19  Martin Baulig  <martin@ximian.com>
11786
11787         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11788         error here and not in our caller.
11789
11790 2004-03-19  Martin Baulig  <martin@ximian.com>
11791
11792         * interface.cs: Completely killed this file.
11793         (Interface): We're now a TypeContainer and live in class.cs.
11794
11795         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11796         argument; we're now also called for interfaces.
11797         (TypeContainer.DefineMembers): Allow this method being called
11798         multiple times.
11799         (TypeContainer.GetMethods): New public method; formerly known as
11800         Interface.GetMethod().  This is used by PendingImplementation.
11801         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11802         it's now private and non-static.
11803         (Interface): Moved this here; it's now implemented similar to
11804         Class and Struct.
11805         (Method, Property, Event, Indexer): Added `bool is_interface'
11806         argument to their .ctor's.
11807         (MemberBase.IsInterface): New public field.
11808
11809         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11810         instances instead of InterfaceMethod, InterfaceProperty, etc.
11811         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11812         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11813
11814 2004-03-19  Martin Baulig  <martin@ximian.com>
11815
11816         * class.cs (MethodCore.IsDuplicateImplementation): New private
11817         method which does the CS0111 checking.
11818         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11819         Use IsDuplicateImplementation().
11820
11821 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11822
11823         * decl.cs (FindMemberToOverride): New method to find the correct
11824         method or property to override in the base class.
11825         * class.cs
11826             - Make Method/Property use the above method to find the
11827               version in the base class.
11828             - Remove the InheritableMemberSignatureCompare as it is now
11829               dead code.
11830
11831         This patch makes large code bases much faster to compile, as it is
11832         O(n) rather than O(n^2) to do this validation.
11833
11834         Also, it fixes bug 52458 which is that nested classes are not
11835         taken into account when finding the base class member.
11836
11837         Reviewed/Approved by Martin.
11838
11839 2004-03-17  Martin Baulig  <martin@ximian.com>
11840
11841         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11842         of type arguments into account; use the `real_num_type_args'
11843         approach like in DoResolveAsTypeStep().
11844
11845         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11846         nested types.
11847
11848 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11849
11850         * interface.cs: In all interface classes removed redundant
11851         member initialization.
11852
11853 2004-03-16  Martin Baulig  <martin@ximian.com>
11854
11855         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11856
11857 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11858
11859         * decl.cs (DefineTypeAndParents): New helper method to define a
11860         type's containers before the type itself is defined;  This is a
11861         bug exposed by the recent changes to Windows.Forms when an
11862         implemented interface was defined inside a class that had not been
11863         built yet.   
11864
11865         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11866
11867         (Check): Loop correctly to report errors modifiers
11868         (UNSAFE was not in the loop, since it was the same as TOP).
11869
11870         * interface.cs: Every interface member now takes a ModFlags,
11871         instead of a "is_new" bool, which we set on the base MemberCore. 
11872
11873         Every place where we called "UnsafeOk" in the interface, now we
11874         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11875         the unsafe settings from the member declaration instead of the
11876         container interface. 
11877
11878         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11879
11880         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11881         `set_indexer_name' to the pending bits (one per type).
11882
11883         We fixed a bug today that was picking the wrong method to
11884         override, since for properties the existing InterfaceMethod code
11885         basically ignored the method name.  Now we make sure that the
11886         method name is one of the valid indexer names.
11887
11888 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11889  
11890         * support.cs (SeekableStreamReader): Keep track of stream byte
11891         positions and don't mix them with character offsets to the buffer.
11892
11893         Patch from Gustavo Giráldez
11894
11895 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11896
11897         * interface.cs (InterfaceSetGetBase): Removed double member
11898         initialization, base class does it as well.
11899
11900 2004-03-13  Martin Baulig  <martin@ximian.com>
11901
11902         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11903         when compiling corlib.
11904
11905 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11906
11907         * convert.cs (ExplicitConversion): We were reporting an error on
11908         certain conversions (object_type source to a value type, when the
11909         expression was `null') before we had a chance to pass it through
11910         the user defined conversions.
11911
11912         * driver.cs: Replace / and \ in resource specifications to dots.
11913         Fixes 50752
11914
11915         * class.cs: Add check for duplicate operators.  Fixes 52477
11916
11917 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11918
11919         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11920         that are in the middle of the statements, not only at the end.
11921         Fixes #54987
11922
11923         * class.cs (TypeContainer.AddField): No longer set the
11924         `HaveStaticConstructor' flag, now we call it
11925         `UserDefineStaticConstructor' to diferentiate the slightly
11926         semantic difference.
11927
11928         The situation is that we were not adding BeforeFieldInit (from
11929         Modifiers.TypeAttr) to classes that could have it.
11930         BeforeFieldInit should be set to classes that have no static
11931         constructor. 
11932
11933         See:
11934
11935         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11936
11937         And most importantly Zoltan's comment:
11938
11939         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11940
11941         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11942          before its static fields are used', i.e. initialization does not need
11943          to be triggered by the first access to the type. Setting this flag
11944          helps the JIT to compile better code, since it can run the static
11945          constructor at JIT time, and does not need to generate code to call it
11946          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11947          this flag for lots of classes like String. 
11948          
11949          csc sets this flag if the type does not have an explicit static 
11950          constructor. The reasoning seems to be that if there are only static
11951          initalizers for a type, and no static constructor, then the programmer
11952          does not care when this initialization happens, so beforefieldinit
11953          can be used.
11954          
11955          This bug prevents the AOT compiler from being usable, since it 
11956          generates so many calls to mono_runtime_class_init that the AOT code
11957          is much slower than the JITted code. The JITted code is faster, 
11958          because it does not generate these calls if the vtable is type is
11959          already initialized, which is true in the majority of cases. But the
11960          AOT compiler can't do this."
11961
11962 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
11963
11964         * class.cs (MethodData.Emit): Refactor the code so symbolic
11965         information is generated for destructors;  For some reasons we
11966         were taking a code path that did not generate symbolic information
11967         before. 
11968
11969 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
11970
11971         * class.cs: Create a Constructor.CheckBase method that
11972         takes care of all validation type code. The method
11973         contains some code that was moved from Define.
11974
11975         It also includes new code that checks for duplicate ctors.
11976         This fixes bug #55148.
11977
11978 2004-03-09  Joshua Tauberer <tauberer@for.net>
11979
11980         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
11981         a { ... }-style array creation invokes EmitStaticInitializers
11982         which is not good for reference-type arrays.  String, decimal
11983         and now null constants (NullCast) are not counted toward
11984         static initializers.
11985
11986 2004-03-05  Martin Baulig  <martin@ximian.com>
11987
11988         * location.cs (SourceFile.HasLineDirective): New public field;
11989         specifies whether the file contains or is referenced by a "#line"
11990         directive.
11991         (Location.DefineSymbolDocuments): Ignore source files which
11992         either contain or are referenced by a "#line" directive.        
11993
11994 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
11995
11996         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
11997         direct access to our parent, so check the method inline there.
11998
11999 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12000
12001         * expression.cs (Invocation.EmitCall): Miguel's last commit
12002         caused a regression. If you had:
12003
12004             T t = null;
12005             t.Foo ();
12006
12007         In Foo the implict this would be null.
12008
12009 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12010
12011         * expression.cs (Invocation.EmitCall): If the method is not
12012         virtual, do not emit a CallVirt to it, use Call.
12013
12014         * typemanager.cs (GetFullNameSignature): Improve the method to
12015         cope with ".ctor" and replace it with the type name.
12016
12017         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12018         as an argument the ConstructorBuilder where it is being defined,
12019         to catch the recursive constructor invocations.
12020
12021 2004-03-16  Martin Baulig  <martin@ximian.com>
12022
12023         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12024         ConstructedType, call ResolveType() on it to get the type rather
12025         than just using `expr.Type'.
12026
12027 2004-03-16  Martin Baulig  <martin@ximian.com>
12028
12029         * generics.cs (ConstructedType.GetMemberAccess): Take the
12030         EmitContext instead on the TypeExpr and use
12031         ec.TypeContainer.CurrentType/ec.ContainerType.
12032
12033 2004-03-16  Martin Baulig  <martin@ximian.com>
12034
12035         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12036         parameters before aliases.
12037
12038 2004-03-16  Martin Baulig  <martin@ximian.com>
12039
12040         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12041         New oublic function; checks whether two generic instances may become
12042         equal under some instantiations (26.3.1).
12043
12044         * class.cs (TypeContainer.Define): Call
12045         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12046         error.
12047
12048 2004-03-16  Martin Baulig  <martin@ximian.com>
12049
12050         * class.cs (TypeContainer.GetClassBases): Moved
12051         Error_TypeParameterAsBase() here and also check whether the base
12052         class is not an attribute.
12053
12054 2004-03-16  Martin Baulig  <martin@ximian.com>
12055
12056         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12057
12058 2004-03-16  Martin Baulig  <martin@ximian.com>
12059
12060         * class.cs (Error_TypeParameterAsBase): Use correct error number
12061         here (CS0689).  
12062
12063 2004-03-16  Martin Baulig  <martin@ximian.com>
12064
12065         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12066         for generics.
12067
12068         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12069         error reporting.
12070
12071 2004-03-15  Martin Baulig  <martin@ximian.com>
12072
12073         * typemanager.cs (TypeManager.GetFullName): New public method.
12074         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12075         argument; only return members with the correct number of type
12076         arguments.
12077         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12078         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12079         whether the number of type arguments matches.
12080
12081         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12082         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12083
12084         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12085         field; it's set by the protected .ctor when we're actually a
12086         GenericMemberAccess.
12087         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12088         arguments and pass it to MemberLookupFinal ().
12089
12090         * ecore.cs (Expression.MemberLookup): Added `int
12091         num_type_arguments' argument; only return members with the correct
12092         number of type arguments.
12093         (Expression.MemberLookupFailed): Check whether the MemberLookup
12094         failed because we did not have the correct number of type
12095         arguments; report CS0305 in this case.
12096
12097         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12098         `e.ResolveAsTypeTerminal()' already did so.
12099
12100 2004-03-15  Martin Baulig  <martin@ximian.com>
12101
12102         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12103         we're a ConstructedType; in this case, the caller must report an
12104         error (for instance CS0131).
12105
12106         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12107         (TypeArguments.Resolve): Actually report errors here.
12108
12109 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12110
12111         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12112         `set_indexer_name' to the pending bits (one per type).
12113
12114         We fixed a bug today that was picking the wrong method to
12115         override, since for properties the existing InterfaceMethod code
12116         basically ignored the method name.  Now we make sure that the
12117         method name is one of the valid indexer names.
12118
12119 2004-03-15  Martin Baulig  <martin@ximian.com>
12120
12121         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12122         for generic instances.
12123
12124 2004-03-13  Martin Baulig  <martin@ximian.com>
12125
12126         * class.cs (TypeContainer.DefineType): Call
12127         TypeManager.AddUserType() immediately after creating the
12128         TypeBuilder; pass all type parameters when creating the
12129         CurrentType.
12130
12131         * decl.cs (DeclSpace.FindNestedType): New public method.
12132         (DeclSpace.FindType): Added `int num_type_args' argument; only
12133         return types with the correct number of type parameters.
12134         (DeclSpace.CountTypeParams): New public property.
12135
12136         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12137         the number of type parameters; defaults to zero.
12138
12139         * generic.cs (TypeArguments.Count): New public property.
12140         (ConstructedType.DoResolveAsTypeStep): First call
12141         ds.FindNestedType() to find out whether we're nested in the
12142         current generic type; in this case, we inherit all type parameters
12143         from the current class.
12144
12145         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12146         num_type_args' argument.
12147         (RootContext.LookupType): Added overloaded version which takes the
12148         number of type arguments; only return types with the correct
12149         number of type arguments.
12150
12151         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12152         checks whether `Type t' has `int num_type_args'.
12153
12154 2004-03-13  Martin Baulig  <martin@ximian.com>
12155
12156         * generic.cs (GenericMethod.DefineType): New method; calls
12157         DefineType() on all the type parameters.
12158
12159         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12160         (MethodData.Define): If we're a generic method, call
12161         GenericMethod.DefineType() to define the type parameters.       
12162
12163 2004-03-10  Martin Baulig  <martin@ximian.com>
12164
12165         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12166         instead of IsAssignableFrom.    
12167
12168 2004-03-10  Martin Baulig  <martin@ximian.com>
12169
12170         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12171
12172         * support.cs (ParameterData.HasArrayParameter): New property.
12173         (ReflectionParameters.ctor): Take a MethodBase instead of a
12174         ParameterInfo[].  If we have any type parameters, get the generic
12175         method definition and ask it whether we have variable arguments.
12176
12177 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12178
12179         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12180         routines to check if a type is an enumerable/enumerator allow
12181         classes that implement the IEnumerable or IEnumerator interfaces.
12182
12183         * class.cs (Property, Operator): Implement IIteratorContainer, and
12184         implement SetYields.
12185
12186         (Property.Define): Do the block swapping for get_methods in the
12187         context of iterators.   We need to check if Properties also
12188         include indexers or not.
12189
12190         (Operator): Assign the Block before invoking the
12191         OperatorMethod.Define, so we can trigger the Iterator code
12192         replacement. 
12193
12194         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12195         Property and Operator classes are not created when we parse the
12196         declarator but until we have the block completed, so we use a
12197         singleton SimpleIteratorContainer.Simple to flag whether the
12198         SetYields has been invoked.
12199
12200         We propagate this setting then to the Property or the Operator to
12201         allow the `yield' to function.
12202
12203 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12204
12205         * codegen.cs: Implemented attribute support for modules.
12206         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12207         Assembly/Module functionality.
12208
12209         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12210         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12211         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12212
12213 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12214
12215         * interface.cs (FindMembers): The operation is performed on all base
12216         interfaces and not only on the first. It is required for future CLS Compliance patch.
12217
12218 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12219
12220         * statement.cs, codegen.cs:
12221         This patch deals with patterns such as:
12222
12223         public class List : IEnumerable {
12224
12225                 public MyEnumerator GetEnumerator () {
12226                         return new MyEnumerator(this);
12227                 }
12228
12229                 IEnumerator IEnumerable.GetEnumerator () {
12230                         ...
12231                 }
12232                 
12233                 public struct MyEnumerator : IEnumerator {
12234                         ...
12235                 }
12236         }
12237
12238         Before, there were a few things we did wrong:
12239         1) we would emit callvirt on a struct, which is illegal
12240         2) we emited ldarg when we needed to emit ldarga
12241         3) we would mistakenly call the interface methods on an enumerator
12242         type that derived from IEnumerator and was in another assembly. For example:
12243
12244         public class MyEnumerator : IEnumerator
12245
12246         Would have the interface methods called, even if there were public impls of the
12247         method. In a struct, this lead to invalid IL code.
12248
12249 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12250
12251         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12252           renamed to Emit.
12253
12254         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12255
12256 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12257
12258         * cs-parser.jay: Fix small regression: we were not testing V2
12259         compiler features correctly.
12260
12261         * interface.cs: If the emit context is null, then create one
12262
12263 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12264
12265         * decl.cs (GetSignatureForError): New virtual method to get full name
12266           for error messages.
12267
12268         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12269           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12270
12271         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12272           Duplicated members and code in these classes has been removed.
12273           Better encapsulation in these classes.
12274
12275 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12276
12277         * assign.cs (Assign.DoResolve): When dealing with compound
12278         assignments, there is a new rule in ECMA C# 2.4 (might have been
12279         there before, but it is documented here) that states that in:
12280
12281         a op= b;
12282
12283         If b is of type int, and the `op' is a shift-operator, then the
12284         above is evaluated as:
12285
12286         a = (int) a op b 
12287
12288         * expression.cs (Binary.ResolveOperator): Instead of testing for
12289         int/uint/long/ulong, try to implicitly convert to any of those
12290         types and use that in pointer arithmetic.
12291
12292         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12293         method to print information for from the type, not from the
12294         null-method we were given.
12295
12296 2004-02-01  Duncan Mak  <duncan@ximian.com>
12297
12298         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12299         parsing for cmd, fixes bug #53694.
12300
12301 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12302
12303         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12304         in the member name duplication tests. Property and operator name duplication
12305         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12306
12307 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12308
12309         * interface.cs (PopulateMethod): Fixed crash when interface method
12310         returns not existing type (error test cs0246-3.cs).
12311
12312 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12313
12314         * cs-parser.jay (interface_accessors): Re-write actions to also
12315         store attributes attached to get and set methods. Fix spelling
12316         while at it.
12317
12318         (inteface_property_declaration): Modify accordingly.
12319
12320         (InterfaceAccessorInfo): New helper class to store information to pass
12321         around between rules that use interface_accessors.
12322
12323         * interface.cs (Emit): Apply attributes on the get and set
12324         accessors of properties and indexers too.
12325
12326         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12327         right MethodBuilder when applying attributes to the get and set accessors.
12328
12329 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12330
12331         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12332
12333 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12334
12335         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12336
12337 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12338
12339         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12340         changes that treat `yield' specially when present before `break'
12341         or `return' tokens.
12342
12343         * cs-tokenizer.cs: yield is no longer a keyword.
12344
12345 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12346
12347         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12348         setting for default constructors.
12349         For default constructors are almost every time set wrong Modifier. The
12350         generated IL code has been alright. But inside mcs this values was
12351         wrong and this was reason why several of my CLS Compliance tests
12352         failed.
12353
12354 2004-02-27  Martin Baulig  <martin@ximian.com>
12355
12356         * generics.cs (ConstructedType.ResolveType): Make the nested type
12357         stuff actually work.
12358
12359 2004-02-25  Martin Baulig  <martin@ximian.com>
12360
12361         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12362         property; returns the type parameters just from the current type,
12363         ie. with the ones from outer classes.
12364         (DeclSpace.LookupGeneric): First search in the current class, then
12365         in outer classes.
12366         (DeclSpace.initialize_type_params): When hiding a type parameter
12367         from an outer class, put it into the `type_param_list' anyways.
12368
12369         * expression.cs (MemberAccess.expr): Made this field protected.
12370
12371         * class.cs (TypeContainer.Define): The `CurrentType' just contains
12372         the type parameters from the current class.
12373
12374         * generic.cs (ConstructedType.ResolveType): Support nested generic
12375         types by taking the type parameters which we inherit from outer
12376         classes into account.
12377         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12378         support for nested generic types.
12379
12380 2004-02-23  Martin Baulig  <martin@ximian.com>
12381
12382         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12383         field and check whether we're nested inside a generic type.
12384         (DeclSpace.ResolveType): If we're resolving to a generic type
12385         definition, create a ConstructedType and return its resolved type.
12386         (DeclSpace.initialize_type_params): New private method;
12387         initializes the `type_param_list' field from the type parameters
12388         from this and all enclosing classes.
12389         (DeclSpace.TypeParameters): Call initialize_type_params() unless
12390         we're already initialized.
12391
12392 2004-02-23  Martin Baulig  <martin@ximian.com>
12393
12394         * class.cs (Method.Define): Create the generic method before
12395         calling DoDefine().
12396         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12397         the TypeContainer one); we use this for generic methods.
12398
12399         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12400         parent's TypeBuilder.
12401
12402 2004-02-18  Martin Baulig  <martin@ximian.com>
12403
12404         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12405         to check for equality.
12406
12407 2004-02-05  Martin Baulig  <martin@ximian.com>
12408
12409         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12410         `ec.TypeContainer.CurrentType', use it instead of
12411         `ec.ContainerType' to check whether we're in the type's ctor.
12412
12413 2004-01-29  Martin Baulig  <martin@ximian.com>
12414
12415         * expression.cs (Invocation.DoResolve): If we're a
12416         `ConstructedType', then we're actually a generic method, so
12417         rewrite the expr as a GenericMemberAccess.
12418
12419         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12420         here; manually parse it into a string.
12421
12422 2004-01-28  Martin Baulig  <martin@ximian.com>
12423
12424         * typemanager.cs (TypeManager.IsEqual): New static method.
12425         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12426         check for equality instead of using `=='.
12427
12428 2004-01-26  Martin Baulig  <martin@ximian.com>
12429
12430         * decl.cs (DeclSpace.CurrentType): New public field.
12431
12432         * expression.cs (This.ResolveBase): If we have an
12433         `ec.TypeContainer.CurrentType', use it instead of
12434         `ec.ContainerType'.
12435
12436         * class.cs (TypeContainer.DefineType): If we're a generic type,
12437         create the `CurrentType' (unresolved).
12438         (TypeContainer.GenericType): New private field.
12439         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12440         it and store it in `GenericType' before creating the MemberCache.
12441         (TypeContainer.GetMembers): If we have a `GenericType', call
12442         TypeManager.FindMembers() on it.
12443
12444         * interface.cs (Interface.GenericType): New private field.
12445         (Interface.DefineType): If we're a generic type, create the
12446         `CurrentType' (unresolved).
12447         (Interface.DefineMembers): If we have a `CurrentType', resolve it
12448         and store it in `GenericType' before creating the MemberCache.
12449         (Interface.GetMembers): If we have a `GenericType', call
12450         TypeManager.FindMembers() on it.
12451
12452 2004-01-22  Martin Baulig  <martin@ximian.com>
12453
12454         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12455         not a QualifiedIdentifier.  This is what `type_name_expression'
12456         was previously doing.
12457         (type_name_expression): Removed; the code is now in
12458         `namespace_or_type_name'.
12459         (qualified_identifier): Removed, use `namespace_or_type_name'
12460         instead.
12461         (QualifiedIdentifier): Removed this class.      
12462
12463 2004-01-22  Martin Baulig  <martin@ximian.com>
12464
12465         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12466         not a string as alias name.
12467
12468 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12469
12470         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12471         #52730 bug, and instead compute correctly the need to use a
12472         temporary variable when requesting an address based on the
12473         static/instace modified of the field and the constructor.
12474  
12475 2004-01-21  Martin Baulig  <martin@ximian.com>
12476
12477         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12478         class and namespace before looking up aliases.  Fixes #52517.
12479
12480 2004-01-21  Martin Baulig  <martin@ximian.com>
12481
12482         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12483         assinged in a 'try'; fixes exception4.cs.
12484
12485 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12486         * class.cs : Implemented parameter-less constructor for TypeContainer
12487
12488         * decl.cs: Attributes are now stored here. New property OptAttributes
12489
12490         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12491
12492         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12493
12494 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12495
12496         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12497           (CSharpSignature): New method for indexer and property signature.
12498
12499 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12500
12501         * pending.cs (IsVirtualFilter): Faster implementation.
12502
12503 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12504
12505         * typemanager.cs: Avoid inclusion of same assembly more than once.
12506
12507 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12508
12509         * cs-parser.jay: Fixed problem where the last assembly attribute
12510           has been applied also to following declaration (class, struct, etc.)
12511           
12512 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12513
12514         * class.cs: Added error CS0538, CS0539 reporting.
12515         Fixed crash on Microsoft runtime when field type is void.
12516
12517         * cs-parser.jay: Added error CS0537 reporting.
12518
12519         * pending.cs: Added error CS0535 reporting.
12520         Improved error report for errors CS0536, CS0534.
12521
12522 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12523
12524         Merge a few bits from the Anonymous Method MCS tree.
12525
12526         * statement.cs (ToplevelBlock): New class for toplevel methods,
12527         will hold anonymous methods, lifted variables.
12528
12529         * cs-parser.jay: Create toplevel blocks for delegates and for
12530         regular blocks of code. 
12531
12532 2004-01-20  Martin Baulig  <martin@ximian.com>
12533
12534         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12535         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12536         and `NeedExplicitReturn'; added `IsLastStatement'.
12537         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12538         have a `ReturnLabel' or we're not unreachable.
12539
12540         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12541         child's reachability; don't just override ours with it.  Fixes
12542         #58058 (lluis's example).
12543         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12544         InFinally(), InLoop(), InSwitch() and
12545         BreakCrossesTryCatchBoundary() methods.
12546
12547         * statement.cs (Return): Do all error checking in Resolve().
12548         Unless we are the last statement in a top-level block, always
12549         create a return label and jump to it.
12550         (Break, Continue): Do all error checking in Resolve(); also make
12551         sure we aren't leaving a `finally'.
12552         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12553         statement in a top-level block.
12554         (Block.Flags): Added `IsDestructor'.
12555         (Block.IsDestructor): New public property.
12556
12557 2004-01-20  Martin Baulig  <martin@ximian.com>
12558
12559         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12560
12561 2004-01-20  Martin Baulig  <martin@ximian.com>
12562
12563         * statement.cs (Statement.ResolveUnreachable): New public method.
12564         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12565         (Block.Resolve): Resolve unreachable statements.
12566
12567 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12568
12569         * expression.cs: We need to fix the case where we do
12570         not have a temp variable here.
12571
12572         * assign.cs: Only expression compound assignments need
12573         temporary variables.
12574
12575 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12576
12577         * flowanalysis.cs: Reduce memory allocation in a few ways:
12578           - A block with no variables should not allocate a bit
12579             vector for itself.
12580           - A method with no out parameters does not need any tracking
12581             for assignment of the parameters, so we need not allocate
12582             any data for it.
12583           - The arrays:
12584                 public readonly Type[] VariableTypes;
12585                 public readonly string[] VariableNames;
12586             Are redundant. The data is already stored in the variable
12587             map, so we need not allocate another array for it.
12588           - We need to add alot of checks for if (params | locals) == null
12589             due to the first two changes.
12590
12591 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12592
12593         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12594         implement IMemoryLocation, we store a copy on a local variable and
12595         take the address of it.  Patch from Benjamin Jemlich
12596
12597         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12598         to use a special "type_name_expression" rule which reduces the
12599         number of "QualifiedIdentifier" classes created, and instead
12600         directly creates MemberAccess expressions.
12601
12602 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12603
12604         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12605         that fixes #52853.  Null literal assignment to ValueType
12606
12607         * class.cs (MethodData.Emit): Instead of checking the name of the
12608         method to determine if its a destructor, create a new derived
12609         class from Method called Destructor, and test for that.  
12610
12611         * cs-parser.jay: Create a Destructor object instead of a Method.  
12612
12613         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12614
12615         Fixes: 52933
12616
12617 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12618
12619         * expression.cs (Binary.ResolveOperator): Perform an implicit
12620         conversion from MethodGroups to their delegate types on the
12621         Addition operation.
12622
12623         * delegate.cs: Introduce a new class DelegateCreation that is the
12624         base class for `NewDelegate' and `ImplicitDelegateCreation',
12625         factor some code in here.
12626
12627         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12628         conversion from MethodGroups to compatible delegate types. 
12629
12630         * ecore.cs (Expression.Resolve): Do not flag error 654
12631         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12632         we allow conversions from MethodGroups to delegate types now.
12633
12634         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12635         assignments in v2 either.
12636
12637 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12638
12639         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12640         static read-only fields in ctors.
12641
12642         Applied patch from Benjamin Jemlich 
12643
12644         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12645
12646 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12647
12648         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12649         here to return true, as they can be used like this:
12650
12651                 (XXX) int.MEMBER ()
12652
12653         Fixed 49836 and all the other dups
12654
12655 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12656
12657         * driver.cs: Implement /win32res and /win32icon.
12658
12659 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12660
12661         * cs-parser.jay: Add a rule to improve error handling for the
12662         common mistake of placing modifiers after the type.
12663
12664 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12665
12666         * cs-parser.jay (interface_event_declaration): Catch
12667         initialization of events on interfaces, and report cs0068
12668
12669         * cs-parser.jay (interface_event_declaration): Catch
12670         initialization of events. 
12671
12672         * ecore.cs: Better report missing constructors.
12673
12674         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12675         the error reporting done in the wrong place.  Fix.
12676
12677         * expression.cs (Binary.ResolveOperator): Catch the 
12678         operator + (E x, E y) error earlier, and later allow for implicit
12679         conversions in operator +/- (E e, U x) from U to the underlying
12680         type of E.
12681
12682         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12683         52596, if the container class is abstract, the default constructor
12684         is protected otherwise its public (before, we were always public).
12685
12686         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12687         fixed statement.
12688
12689         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12690         Jemlich that fixes bug #52597, MCS was generating invalid code for
12691         idisposable structs.   Thanks to Ben for following up with this
12692         bug as well.
12693
12694 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12695
12696         * driver.cs: Allow assemblies without code to be generated, fixes
12697         52230.
12698
12699 2004-01-07  Nick Drochak <ndrochak@gol.com>
12700
12701         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12702
12703 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12704
12705         * cs-parser.jay: Add rules to improve error reporting if fields or
12706         methods are declared at the namespace level (error 116)
12707
12708         * Add rules to catch event add/remove
12709
12710 2004-01-04  David Sheldon <dave-mono@earth.li>
12711
12712   * expression.cs: Added matching ")" to error message for 
12713   CS0077
12714
12715 2004-01-03 Todd Berman <tberman@gentoo.org>
12716
12717         * ecore.cs, attribute.cs:
12718         Applying fix from #52429.
12719
12720 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12721
12722         * ecore.cs, expression.cs, statement.cs:
12723         Total rewrite of how we handle branching. We
12724         now handle complex boolean expressions with fewer
12725         jumps. As well if (x == 0) no longer emits a ceq.
12726
12727         if (x is Foo) is much faster now, because we generate
12728         better code.
12729
12730         Overall, we get a pretty big improvement on our benchmark
12731         tests. The code we generate is smaller and more readable.
12732
12733         I did a full two-stage bootstrap. The patch was reviewed
12734         by Martin and Miguel.
12735
12736 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12737
12738         * cs-parser.jay: Make primary_expression not take a QI.
12739         we dont need this because the member_access rule covers
12740         us here. So we replace the rule with just IDENTIFIER.
12741
12742         This has two good effects. First, we remove a s/r conflict.
12743         Second, we allocate many fewer QualifiedIdentifier objects.
12744
12745 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12746
12747         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12748         set the correct information via SRE. This prevents
12749         hanging on the MS runtime. Fixes #29374.
12750
12751 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12752
12753         * convert.cs: correctly handle conversions to value types
12754         from Enum and ValueType as unboxing conversions.
12755
12756         Fixes bug #52569. Patch by Benjamin Jemlich.
12757
12758 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12759
12760         * expression.cs (BetterConversion): Prefer int -> uint
12761         over int -> ulong (csc's behaviour). This fixed bug #52046.
12762
12763 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12764
12765         * decl.cs (MemberCache.FindMembers): now returns a
12766         MemberInfo [].
12767
12768         * typemanager.cs: In general, go with with ^^.
12769         (CopyNewMethods): take an IList.
12770         (RealMemberLookup): Only allocate an arraylist
12771         if we copy from two sets of methods.
12772
12773         This change basically does two things:
12774         1) Fewer array lists allocated due to CopyNewMethods.
12775         2) the explicit cast in MemberList costed ALOT.
12776
12777 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12778
12779         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12780         a hashtable to avoid needless string allocations when an identifier is
12781         used more than once (the common case).
12782
12783 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12784
12785         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12786         is broken, it will not return anything. So, we
12787         have to use the information we have in mcs to
12788         do the task.
12789
12790         * typemanager.cs: Add a cache for GetInterfaces,
12791         since this will now be used more often (due to ^^)
12792
12793         (GetExplicitInterfaces) New method that gets the
12794         declared, not effective, interfaces on a type
12795         builder (eg, if you have interface IFoo, interface
12796         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12797         { IBar }.
12798
12799         This patch makes MCS able to bootstrap itself on
12800         Windows again.
12801
12802 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12803
12804         * expression.cs: Remove the Nop's that Miguel put
12805         in by mistake.
12806
12807 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12808
12809         * report.cs, codegen.cs: Give the real stack trace to
12810         the error when an exception is thrown.
12811
12812 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12813
12814         * decl.cs: only allocate hashtables for ifaces if 
12815         it is an iface!
12816
12817 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12818
12819         * expression.cs: fix the error from cs0121-2.cs
12820         (a parent interface has two child interfaces that
12821         have a function with the same name and 0 params
12822         and the function is called through the parent).
12823
12824 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12825
12826         * class.cs, rootcontext.cs, typmanager.cs: do not
12827         leak pointers.
12828
12829 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12830
12831         * codegen.cs: remove stack for the ec flow branching.
12832         It is already a linked list, so no need.
12833
12834 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12835
12836         * Makefile: Allow custom profiler here.
12837
12838 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12839
12840         * typemanager.cs (LookupType):
12841           - Use a static char [], because split takes
12842             a param array for args, so it was allocating
12843             every time.
12844           - Do not store true in a hashtable, it boxes.
12845
12846 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12847
12848         * flowanalysis.cs: bytify common enums.
12849
12850 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12851
12852         * modifiers.cs: Add a new set of flags for the
12853         flags allowed on explicit interface impls.
12854         * cs-parser.jay: catch the use of modifiers in
12855         interfaces correctly.
12856         * class.cs: catch private void IFoo.Blah ().
12857
12858         All related to bug #50572.
12859
12860 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12861
12862         * decl.cs: Rewrite the consistant accessability checking.
12863         Accessability is not linear, it must be implemented in
12864         a tableish way. Fixes #49704.
12865
12866 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12867
12868         * expression.cs: Handle negation in a checked context.
12869         We must use subtraction from zero. Fixes #38674.
12870
12871 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12872
12873         * class.cs: Ignore static void main in DLLs.
12874         * rootcontext.cs: Handle the target type here,
12875         since we are have to access it from class.cs
12876         * driver.cs: account for the above.
12877
12878 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12879
12880         * report.cs: Give line numbers and files if available.
12881
12882 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12883
12884         * driver.cs: Implement /addmodule.
12885
12886         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12887         ModuleBuilders.
12888
12889 2003-12-20  Martin Baulig  <martin@ximian.com>
12890
12891         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12892         (FieldBase.IsAssigned): Removed this field.
12893         (FieldBase.SetAssigned): New public method.
12894         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12895
12896 2003-12-20  Martin Baulig  <martin@ximian.com>
12897
12898         * expression.cs (LocalVariableReference.DoResolve): Don't set
12899         `vi.Used' if we're called from DoResolveLValue().
12900
12901         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12902         returns the usage vector it just merged into the current one -
12903         pass this one to UsageWarning().
12904         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12905         of the `EmitContext', don't call this recursively on our children.
12906
12907 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12908
12909         * driver.cs: Implement /target:module.
12910
12911 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12912
12913         * support.cs (CharArrayHashtable): New helper class.
12914
12915         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12916         char arrays, not strings, so we can avoid creating a string in
12917         consume_identifier if the identifier is a keyword.
12918
12919 2003-12-16  Martin Baulig  <martin@ximian.com>
12920
12921         * statement.cs (LocalInfo.Assigned): Removed this property.
12922         (LocalInfo.Flags): Removed `Assigned'.
12923         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12924         and uses flow analysis.
12925         (Block.UsageWarning): Made this method private.
12926         (Block.Resolve): Call UsageWarning() if appropriate.
12927
12928         * expression.cs (LocalVariableReference.DoResolve): Always set
12929         LocalInfo.Used here.
12930
12931 2003-12-13  Martin Baulig  <martin@ximian.com>
12932
12933         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12934         any value here; we're now using flow analysis to figure out
12935         whether a statement/block returns a value.
12936
12937 2003-12-13  Martin Baulig  <martin@ximian.com>
12938
12939         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12940         working again.
12941         (FlowBranching.MergeFinally): Don't call
12942         `branching.CheckOutParameters()' here, this is called in
12943         MergeTopBlock().
12944         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12945         when adding the `finally' vector.       
12946
12947 2003-12-13  Martin Baulig  <martin@ximian.com>
12948
12949         * flowanalysis.cs
12950         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12951         actually work and also fix #48962.
12952
12953 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12954
12955         * decl.cs: Do not check System.Object for nested types,
12956         since we know it does not have any. Big bang for buck:
12957
12958         BEFORE:
12959            Run 1:   8.35 seconds
12960            Run 2:   8.32 seconds
12961            corlib:  17.99 seconds
12962         AFTER:
12963            Run 1:   8.17 seconds
12964            Run 2:   8.17 seconds
12965            corlib:  17.39 seconds
12966
12967 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12968
12969         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
12970         time we are returning 0 members, so we save alot here.
12971
12972 2003-12-11  Martin Baulig  <martin@ximian.com>
12973
12974         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
12975         `MergeChild()', also just take the `FlowBranching' as argument;
12976         call Merge() on it and return the result.
12977         (FlowBranching.Merge): We don't need to do anything if we just
12978         have one sibling.
12979
12980 2003-12-11  Martin Baulig  <martin@ximian.com>
12981
12982         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
12983         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
12984         Maurer for this idea.
12985
12986 2003-12-11  Martin Baulig  <martin@ximian.com>
12987
12988         * flowanalysis.cs (MergeResult): This class is now gone; we now
12989         use the `UsageVector' for this.  The reason for this is that if a
12990         branching just has one sibling, we don't need to "merge" them at
12991         all - that's the next step to do.
12992         (FlowBranching.Merge): We now return a `UsageVector' instead of a
12993         `MergeResult'.
12994
12995 2003-12-11  Martin Baulig  <martin@ximian.com>
12996
12997         Reworked flow analyis and made it more precise and bug-free.  The
12998         most important change is that we're now using a special `Reachability'
12999         class instead of having "magic" meanings of `FlowReturns'.  I'll
13000         do some more cleanups and optimizations and also add some more
13001         documentation this week.
13002
13003         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13004         largely reworked this class.
13005         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13006         the new `Reachability' class instead of having "magic" values here.
13007         (FlowBranching): We're now using an instance of `Reachability'
13008         instead of having separate `Returns', `Breaks' etc. fields.
13009
13010         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13011         based on flow analysis; ignore the return value of block.Emit ().
13012
13013 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13014
13015         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13016         if they are private.
13017
13018 2003-12-09  Martin Baulig  <martin@ximian.com>
13019
13020         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13021         call them directly on the UsageVector.
13022
13023 2003-12-09  Martin Baulig  <martin@ximian.com>
13024
13025         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13026         Changed return type from `FlowReturns' to `Reachability'.
13027
13028 2003-12-09  Martin Baulig  <martin@ximian.com>
13029
13030         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13031         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13032         `Reachable' fields with a single `Reachability' one.
13033
13034 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13035
13036         * class.cs (FindMembers): Remove foreach's.
13037
13038         Bootstrap times:
13039
13040         BEFORE
13041                 Run 1:   8.74 seconds
13042                 Run 2:   8.71 seconds
13043
13044         AFTER
13045                 Run 1:   8.64 seconds
13046                 Run 2:   8.58 seconds
13047
13048
13049 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13050
13051         * cs-parser.jay:
13052         * gen-treedump.cs:
13053         * statement.cs:
13054         This patch does a few things:
13055                 1. EmptyStatement is now a singleton, so it is never reallocated.
13056                 2. All blah is EmptyStatement constructs have been changed to
13057                    blah == EmptyStatement.Value, which is much faster and valid
13058                    now that EmptyStatement is a singleton.
13059                 3. When resolving a block, rather than allocating a new array for
13060                    the non-empty statements, empty statements are replaced with
13061                    EmptyStatement.Value
13062                 4. Some recursive functions have been made non-recursive.
13063         Mainly the performance impact is from (3), however (1) and (2) are needed for
13064         this to work. (4) does not make a big difference in normal situations, however
13065         it makes the profile look saner.
13066
13067         Bootstrap times:
13068
13069         BEFORE
13070         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13071         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13072         Total memory allocated: 56397 KB
13073
13074         AFTER
13075         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13076         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13077         Total memory allocated: 55666 KB
13078
13079 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13080
13081         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13082         than the hashtable in a hashtable version
13083
13084         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13085         we always end up concating a string. This results in a huge perf
13086         loss, because many strings have to be tracked by the GC. In this
13087         patch, we first use a hashtable that works with two keys, so that
13088         the strings do not need to be concat'ed.
13089
13090         Bootstrap times:
13091         BEFORE
13092                 Run 1:   8.74 seconds
13093                 Run 2:   8.71 seconds
13094
13095         AFTER
13096                 Run 1:   8.65 seconds
13097                 Run 2:   8.56 seconds
13098
13099 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13100
13101         * Makefile: Add a new target `do-time' that does a quick and simple
13102         profile, leaving easy to parse output.
13103
13104 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13105
13106         * codegen.cs (Init): Create the dynamic assembly with 
13107         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13108
13109 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13110
13111         * support.cs: Make the PtrHashtable use only one
13112         instance of its comparer.
13113
13114 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13115
13116         * typemanager.cs: Fix lookup of GetNamespaces.
13117
13118 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13119
13120         * expression.cs: Removed redundant line.
13121
13122         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13123         ArrayLists, use for loops with bounds.  
13124
13125         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13126         arraylist.
13127
13128         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13129         arraylists, use for loop with bounds.
13130
13131         The above three changes give us a 0.071 second performance
13132         improvement out of 3.294 seconds down to 3.223.  On my machine
13133         the above changes reduced the memory usage by 1,387 KB during
13134         compiler bootstrap.
13135
13136         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13137         QualifiedIdentifiers.  Before we created a new string through
13138         concatenation, and mostly later on, the result would be
13139         manipulated by DecomposeQI through string manipulation.
13140
13141         This reduced the compiler memory usage for bootstrapping from
13142         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13143         compile times in 0.05 seconds.
13144
13145 2003-11-28  Dick Porter  <dick@ximian.com>
13146
13147         * support.cs: Do string compares with the Invariant culture.
13148
13149         * rootcontext.cs: 
13150         * gen-treedump.cs: 
13151         * expression.cs: 
13152         * driver.cs: 
13153         * decl.cs: 
13154         * codegen.cs: 
13155         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13156         the comparison is done with the Invariant culture.
13157
13158 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13159
13160         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13161         GetEnumerator method.
13162
13163         (ProbeCollectionType): Iterate starting at the most specific type
13164         upwards looking for a GetEnumerator
13165
13166         * expression.cs: Shift count can be up to 31 for int/uint and 63
13167         for long/ulong.
13168
13169 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13170
13171         * statement.cs (Block.LookupLabel): Also look for the label on the
13172         children blocks.  Use a hash table to keep track of visited
13173         nodes. 
13174
13175         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13176         we actually did transform the other operand, otherwise fall back
13177         to the common codepath that casts to long.
13178
13179         * cs-tokenizer.cs: Use the same code pattern as the int case.
13180         Maybe I should do the parsing myself, and avoid depending on the
13181         Parse routines to get this done.
13182
13183 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13184
13185         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13186         which fixes bug 51347.  This time test it.
13187
13188         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13189         attributes for example can not tell the difference between these.
13190         The difference was only a syntax feature of the language. 
13191
13192         * attribute.cs: Apply attributes to delegates.
13193
13194         * delegate.cs: Call the apply attributes method.
13195
13196 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13197
13198         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13199         comparing 0 vs Byte.MinValue, not the value
13200
13201         (ImplicitConversionRequired): When reporting a conversion error,
13202         use error 31 to print out the constant error instead of the
13203         simpler 29.
13204
13205         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13206         which fixes bug 51347.
13207
13208 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13209
13210         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13211         which fixes the -warnaserror command line option.
13212
13213 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13214
13215         * cfold.cs (DoNumericPromotions): During constant folding of
13216         additions on UIntConstant, special case intconstants with
13217         IntConstants like we do on the expression binary operator. 
13218
13219 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13220
13221         * convert.cs (ImplicitReferenceConversion): We were missing a case
13222         (System.Enum are not value types or class types, so we need to
13223         classify them separatedly).
13224
13225         * driver.cs: We do not support error 2007.
13226
13227 2003-11-12 Jackson Harper <jackson@ximian.com>
13228
13229         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13230         system directory. Also use the full file name so users can
13231         libraries names mscorlib-o-tron.dll in a non system dir.
13232         
13233 2004-01-04  David Sheldon <dave-mono@earth.li>
13234
13235         * expression.cs: Added matching ")" to error message for CS0077.
13236
13237 2003-12-19  Martin Baulig  <martin@ximian.com>
13238
13239         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13240         static method; see documentation in the method.
13241         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13242
13243         * convert.cs (Convert.ImplicitReferenceConversion,
13244         Convert.ImplicitReferenceConversionExists): Add support for
13245         generic type declarations; see gen-36.cs.
13246
13247 2003-12-19  Martin Baulig  <martin@ximian.com>
13248
13249         * pending.cs (Pending.InterfaceMethod): Use
13250         `Type.IsAssignableFrom()' instead of `=='.
13251
13252 2003-12-18  Martin Baulig  <martin@ximian.com>
13253
13254         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13255         byref types first.
13256
13257         * convert.cs (Convert.ImplicitStandardConversionExists): Use
13258         `expr_type.Equals (target_type)' instead of `=='.
13259
13260 2003-12-08  Martin Baulig  <martin@ximian.com>
13261
13262         * generics.cs (Constraints.Types): Removed.
13263         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13264         to Type's.
13265         (Constraints.ResolveTypes): New public method; resolves the
13266         TypeExpr's to Type's.
13267         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13268         longer takes the constraints.
13269         (TypeParameter.DefineMethod): Likewise.
13270         (TypeParameter.DefineType): New public method.  Calls
13271         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13272         the constraints.
13273
13274 2003-12-08  Martin Baulig  <martin@ximian.com>
13275
13276         * convert.cs (Convert.ImplicitConversionStandard): Use
13277         `expr_type.Equals (target_type)' instead of `=='.
13278
13279 2003-12-08  Martin Baulig  <martin@ximian.com>
13280
13281         * typemanager.cs (TypeManager.GetReferenceType): Call
13282         `Type.MakeByRefType ()'.
13283
13284 2003-12-08  Martin Baulig  <martin@ximian.com>
13285
13286         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13287         just has some special meaning in some situations.  For instance,
13288         it is allowed to use `where' as the name of a variable etc.
13289
13290 2003-12-04  Martin Baulig  <martin@ximian.com>
13291
13292         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13293         `Type.MakeArrayType()' for array types.
13294
13295 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13296
13297         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13298         debugging message.
13299
13300         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13301         corlib to compile.
13302
13303 2003-11-16  Martin Baulig  <martin@ximian.com>
13304
13305         * codegen.cs (EmitContext.IsGeneric): Removed.
13306
13307         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13308         ResolveGeneric() on the DeclSpace.
13309
13310 2003-11-16  Martin Baulig  <martin@ximian.com>
13311
13312         * generic.cs (TypeArguments.Resolve):
13313         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13314         `ResolveType()' on it to get the Type.
13315
13316 2003-11-15  Martin Baulig  <martin@ximian.com>
13317
13318         * generic.cs (ConstructedType.GetInterfaces): Override this.
13319
13320 2003-11-14  Martin Baulig  <martin@ximian.com>
13321
13322         * interface.cs (Interface.DefineType): Define all type parameters
13323         before adding the interfaces we inherit.
13324
13325 2003-11-11  Martin Baulig  <martin@ximian.com>
13326
13327         * generic.cs (ConstructedType.ResolveType): Always call
13328         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13329
13330 2003-11-10  Martin Baulig  <martin@ximian.com>
13331
13332         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13333         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13334         calling `ResolveType()' on them, directly assign their `Type'.
13335
13336 2003-11-08  Martin Baulig  <martin@ximian.com>
13337
13338         * generic.cs (ConstructedType): Override `IsClass' etc.
13339
13340 2003-11-08  Martin Baulig  <martin@ximian.com>
13341
13342         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13343         return value and the `out parent' parameter.
13344         (TypeContainer.DefineType): Moved the CS0644 check into
13345         GetClassBases().  Don't pass the interface types to the
13346         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13347         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13348
13349         * ecore.cs (TypeExpr.IsAttribute): New property.
13350         (TypeExpr.GetInterfaces): New method.
13351
13352         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13353         TypeExpr instead of a Type.
13354         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13355         (Interface.DefineType): Don't pass the interface types to the
13356         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13357         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13358
13359         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13360         instead of a `Type[]'.
13361         (TypeManager.RegisterBuilder): Likewise.
13362         (TypeManager.AddUserInterface): Likewise.
13363         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13364         `Type[]' and also return a `TypeExpr[]'.
13365         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13366
13367 2003-11-08  Martin Baulig  <martin@ximian.com>
13368
13369         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13370         Expression.     
13371
13372 2003-11-08  Martin Baulig  <martin@ximian.com>
13373
13374         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13375         TypeManager.ResolveExpressionTypes().
13376
13377         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13378         instead of an Expression.
13379         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13380         (TypeExpression): New public class; formerly known as `TypeExpr'.
13381
13382         * expression.cs (ComposedCast): Derive from TypeExpr.
13383
13384         * typemanager.cs (TypeManager.system_*_expr): These are now
13385         TypExpr's instead of Expression's.
13386         (TypeManager.ResolveExpressionTypes): New public static function;
13387         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13388         of them.        
13389
13390 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13391
13392         * expression.cs (New.DoResolve): Do not dereference value that
13393         might be a null return.
13394
13395         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13396         sure that the constant value has the right type.  Fixes an
13397         unreported bug, similar to 50425.
13398
13399         * const.cs (Const.LookupConstantValue): Call
13400         ImplicitStandardConversionExists before doing a conversion to
13401         avoid havng the TypeManager.ChangeType do conversions.
13402
13403         Reduced the number of casts used
13404
13405         (Const.ChangeType): New routine to enable reuse of the constant
13406         type changing code from statement.
13407
13408         * typemanager.cs (ChangeType): Move common initialization to
13409         static global variables.
13410
13411         Fixes #50425.
13412
13413         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13414         every value type to go through, even if it was void.  Fix that. 
13415
13416         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13417         character of the define, and the is_identifier_part_character for
13418         the rest of the string.
13419
13420 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13421
13422         * expression.cs (UnaryMutator.EmitCode): When I updated
13423         LocalVariableReference.DoResolve, I overdid it, and dropped an
13424         optimization done on local variable references.
13425
13426 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13427
13428         * ecore.cs: Convert the return from Ldlen into an int.
13429
13430 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13431
13432         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13433         the accessibility, this is a special case for toplevel non-public
13434         classes (internal for instance).
13435
13436 2003-10-20  Nick Drochak <ndrochak@gol.com>
13437
13438         * ecore.cs: Fix typo and build.  Needed another right paren.
13439
13440 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13441
13442         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13443         `internal' case regular and protected, but not allowing protected
13444         to be evaluated later.  Bug 49840
13445
13446 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13447
13448         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13449         to kb.Nlast, and not the kb.nFirst to isolate the switch
13450         statement.
13451
13452         Extract the underlying type, so enumerations of long/ulong are
13453         treated like long/ulong.
13454
13455 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13456
13457         * expression.cs (New): Overload the meaning of RequestedType to
13458         track the possible creation of the NewDelegate type, since
13459         DoResolve is invoked more than once for new constructors on field
13460         initialization.
13461
13462         See bugs: #48800 and #37014
13463
13464         * cs-parser.jay (declare_local_constants): Take an arraylist
13465         instead of a single constant.
13466
13467         (local_constant_declaration): It should take a
13468         constant_declarators, not a constant_declarator.  Fixes 49487
13469
13470         * convert.cs: Fix error report.
13471
13472 2003-10-13 Jackson Harper <jackson@ximian.com>
13473
13474         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13475         bug #49611
13476         
13477 2003-11-03  Martin Baulig  <martin@ximian.com>
13478
13479         * expression.cs (ArrayAccess.GetStoreOpcode): Added
13480         `out bool has_type_arg'; if set, we need to pass the type to
13481         ig.Emit().
13482         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13483         Stelem_Any/Ldelem_Any for generic parameters.   
13484
13485 2003-11-02  Martin Baulig  <martin@ximian.com>
13486
13487         * expression.cs (Invocation.EmitCall): Use
13488         `TypeManager.IsValueType()' to check whether it's a value type.
13489         Don't set `struct_call' when calling a method on a type parameter.
13490
13491 2003-11-02  Martin Baulig  <martin@ximian.com>
13492
13493         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13494         and removed the TypeBuilder argument.
13495
13496         * typemanager.cs (TypeManager.IsValueType): Return
13497         `t.IsGenericParameter || t.IsValueType'.
13498
13499 2003-10-25  Martin Baulig  <martin@ximian.com>
13500
13501         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13502         call ConstructedType.Resolve() on it.
13503
13504         * generic.cs (ConstructedType.Resolve): Set `type' on success.
13505
13506 2003-10-25  Martin Baulig  <martin@ximian.com>
13507
13508         * class.cs (TypeContainer.GetClassBases): Changed
13509         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
13510         CS8214 reporting here.
13511         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13512         instead of a `Type' for our parent.  In case of a recursive
13513         declaration (see tests/gen-23.cs for an example), our parent is a
13514         ConstructedType and it doesn't have its type set.  So, first
13515         create our own TypeBuilder, then call constructed.Resolve() to get
13516         the parent's type and finally TypeBuilder.SetParent() it.
13517
13518         * ecore.cs (TypeExpr.Name): New public virtual property.
13519
13520         * generic.cs
13521         (ConstructedType): We're now a TypeExpr and not just an Expression.
13522         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13523         arguments here; this is done later.
13524         (ConstructedType.Resolve): New public method to resolve the type
13525         arguments and bind them.
13526
13527 2003-10-21  Martin Baulig  <martin@ximian.com>
13528
13529         * convert.cs: Use `TypeManager.IsValueType' instead of
13530         'type.IsValueType' everywhere.
13531
13532         * typemanager.cs (TypeManager.IsValueType): Return true for type
13533         parameters.  The reason for this is that we need to box a type
13534         parameter when converting it to a reference type.
13535
13536         * cs-parser.jay: Added support for default value expressions.
13537
13538         * generics.cs (DefaultValueExpression): New public class.       
13539
13540 2003-10-17  Martin Baulig  <martin@ximian.com>
13541
13542         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13543         TypeContainer so we can also use this for Interfaces.
13544         (TypeParameter.Resolve): Likewise.
13545
13546         * interface.cs (Interface.DefineType): Added support for generic
13547         interfaces.
13548
13549         * cs-parser.jay: Added support for generic structs and interfaces.
13550
13551 2003-10-17  Martin Baulig  <martin@ximian.com>
13552
13553         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13554         call generic methods :-)
13555
13556 2003-10-16  Martin Baulig  <martin@ximian.com>
13557
13558         * cs-parser.jay (namespace_or_type_name): Only create a
13559         GenericMemberAccess if we actually have type arguments.
13560
13561 2003-10-13  Martin Baulig  <martin@ximian.com>
13562
13563         * class.cs (Method.Define): If we're a generic method, call
13564         TypeBuilder.DefineGenericMethod () before resolving
13565         the parameters.
13566         (MethodData): Added .ctor which takes an additional MethodBuilder
13567         argument; this is used for generic methods.
13568         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13569         we already have a MethodBuilder.
13570
13571 2003-10-10  Martin Baulig  <martin@ximian.com>
13572
13573         * class.cs (Method): Added .ctor which takes a `GenericMethod'
13574         instead of a `DeclSpace'.  This is used for generic methods.
13575
13576         * cs-parser.jay (method_header): Added support for generic
13577         methods; create a `GenericMethod' instance and pass it to the
13578         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13579         parameters and locals.
13580
13581         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13582         since we already have the location.  Check whether we're a generic
13583         type declaration or a generic method and create the correct type
13584         parameter.
13585
13586         * generic.cs (TypeParameter.DefineMethod): New public method.
13587         (GenericMethod): New public class; derives from DeclSpace and is
13588         used for generic methods.       
13589
13590 2003-10-09  Martin Baulig  <martin@ximian.com>
13591
13592         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13593         to the .ctor.
13594         (MethodCore.DoDefineParameters): Removed the TypeContainer
13595         argument; use the DeclSpace which was passed to the .ctor instead.
13596         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13597         TypeContainer; we only need a DeclSpace here.
13598
13599 2003-10-09  Martin Baulig  <martin@ximian.com>
13600
13601         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13602         to the .ctor.
13603         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13604         EmitContext's .ctor.    
13605
13606 2003-10-09  Martin Baulig  <martin@ximian.com>
13607
13608         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13609         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13610         AsAccessible(), moved them as well.
13611
13612         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13613
13614 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13615
13616         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13617         generation for >=, as spotted by Paolo, bug 48679.  
13618         Patch from David Waite.
13619
13620         * cs-tokenizer.cs: Add handling for #pragma.
13621
13622         * cs-parser.jay: Allow for both yield and yield return in the
13623         syntax.  The anti-cobolization of C# fight will go on!
13624
13625         * class.cs (TypeBuilder.DefineType): Catch error condition here
13626         (Parent.DefineType erroring out and returning null).
13627
13628         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13629         coping with enumerations variables, we were mistakenly processing
13630         them as a regular value type instead of built-in types.  Fixes the
13631         bug #48063
13632
13633         * typemanager.cs (IsBuiltinOrEnum): New method.
13634
13635 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13636
13637         * cs-parser.jay: Upgrade: yield now needs the return clause.
13638
13639 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13640
13641         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13642
13643 2003-09-29  Martin Baulig  <martin@ximian.com>
13644
13645         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13646         inflated generic methods.
13647
13648         * generics.cs (ConstructedType): Distinguish between open and
13649         closed constructed types; correctly resolve the arguments.
13650
13651 2003-09-22  Martin Baulig  <martin@ximian.com>
13652
13653         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13654         all type arguments meet their constraints.
13655
13656 2003-09-19  Martin Baulig  <martin@ximian.com>
13657
13658         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13659         `MemberCache parent' argument.  Normally, an interface doesn't
13660         have a parent type except System.Object, but we use this in gmcs
13661         for generic type parameters.
13662
13663 2003-09-18  Martin Baulig  <martin@ximian.com>
13664
13665         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13666         on `type.IsInterface'; don't check whether the type has a parent
13667         to determine whether it's an interface.
13668
13669 2003-09-17  Martin Baulig  <martin@ximian.com>
13670
13671         * generic.cs (ConstructedType.ToString): Always use `name' as the
13672         type name.
13673
13674 2003-09-15  Martin Baulig  <martin@ximian.com>
13675
13676         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13677
13678         * generic.cs (Constraints.Resolve): New public method; this is
13679         called to resolve the constraint types and to check whether all
13680         the constraints are correct.
13681         (Constraints.Types): New public property.
13682         (TypeParameter.Resolve): New public method; resolves all the
13683         type's constraints.
13684
13685         * class.cs (TypeContainer.DefineType): Call
13686         TypeParameter.Resolve() before actually defining the type.
13687
13688 2003-09-15  Martin Baulig  <martin@ximian.com>
13689
13690         * class.cs (TypeContainer.DefineType): Added an error flag to
13691         avoid reporting duplicate CS0146's ("class definition is
13692         circular.").
13693
13694         * driver.cs (Driver.MainDriver): Abort if
13695         RootContext.ResolveTree() reported any errors.
13696
13697 2003-09-07  Martin Baulig  <martin@ximian.com>
13698
13699         * report.cs (Error, Warning): Added overloaded versions which take
13700         a `params object[] args' and call String.Format().
13701
13702 2003-09-07  Martin Baulig  <martin@ximian.com>
13703
13704         * decl.cs (DeclSpace..ctor): Don't call
13705         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13706         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13707         (DeclSpace.RecordDecl): New method.
13708
13709         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13710
13711 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13712
13713         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13714         value attributes to be applied to ParameterBuilders.
13715
13716         * class.cs (MethodCore.LabelParameters): Make static and more
13717         generic so that it can be used from other places - like interface
13718         methods, for instance.
13719
13720         * interface.cs (Interface.Emit): Call LabelParameters before
13721         emitting attributes on the InterfaceMethod.
13722
13723 2003-09-07  Martin Baulig  <martin@ximian.com>
13724
13725         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13726         if the number of type parameters doesn't match.
13727
13728 2003-09-04  Martin Baulig  <martin@ximian.com>
13729
13730         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13731         for arrays of generic type params (ie. `!0[]').
13732
13733 2003-09-04  Martin Baulig  <martin@ximian.com>
13734
13735         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13736         for the moment.
13737
13738 2003-09-04  Martin Baulig  <martin@ximian.com>
13739
13740         * decl.cs (DeclSpace.LookupGeneric): New method.
13741         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13742         moment.
13743
13744         * generic.cs (TypeParameterExpr): Take a TypeParameter as
13745         argument, not just a string.
13746         (TypeParameter.Define): New public method; this is called to
13747         actually define the generic parameter; after this, you can use the
13748         new `Type' property to get the type.
13749
13750 2003-09-04  Martin Baulig  <martin@ximian.com>
13751
13752         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13753         is now an ArrayList; initialize the result of the `TypeParameters'
13754         property here.
13755         (DeclSpace.GetGenericData): Removed.
13756         (DeclSpace.LookupGeneric): Temporarily removed; we need to
13757         implement this in a different way.
13758         (DeclSpace.GetTypeParameters): Removed; there's now a
13759         `TypeParameters' property.
13760         (DeclSpace.TypeParameters): New public property.
13761
13762         * generic.cs (Constraints): Make this class public.
13763         (TypeParameter): New public class.
13764
13765 2003-09-04  Martin Baulig  <martin@ximian.com>
13766
13767         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13768         generic parameters.
13769
13770         * class.cs (TypeContainer.DefineType): Call
13771         TypeBuilder.DefineGenericParameter () on all generic parameters if
13772         this is a generic type.
13773
13774 2003-08-28  Martin Baulig  <martin@ximian.com>
13775
13776         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13777         sample-stack.il".
13778
13779         * sample-hello.cs: Compile this with gmcs: "gmcs
13780         /r:sample-stack.dll sample-hello.cs".
13781
13782 2003-08-28  Martin Baulig  <martin@ximian.com>
13783
13784         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13785         the parameters to the generic type.
13786
13787 2003-08-28  Martin Baulig  <martin@ximian.com>
13788
13789         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13790
13791 2003-08-28  Martin Baulig  <martin@ximian.com>
13792
13793         * cs-parser.jay (opt_type_argument_list): Use
13794         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13795         (primary_expression): Replace `qualified_identifier' with `type_name'.
13796         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13797
13798         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13799         parser to check whether it is syntactically a type parameter list;
13800         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13801         this case.
13802
13803 2003-08-26  Martin Baulig  <martin@ximian.com>
13804
13805         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13806         resolving aliases; fixes #47927.
13807
13808 2003-08-26  Martin Baulig  <martin@ximian.com>
13809
13810         * statement.cs (Using.DoResolve): This is internally emitting a
13811         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13812         do not always return.  Fixes #47681.
13813
13814 2003-08-26  Martin Baulig  <martin@ximian.com>
13815
13816         * decl.cs (MemberCore): Moved WarningNotHiding(),
13817         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13818         into MemberBase.
13819         (AdditionResult): Make this nested in DeclSpace.
13820         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13821         argument; call NamespaceEntry.Define() unless we're nested in a
13822         class or struct.
13823
13824         * namespace.cs (Namespace.DefineName): New public function.  This
13825         is called from DeclSpace's .ctor to add 
13826         (Namespace.Lookup): Include DeclSpaces in the lookup.
13827
13828         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13829
13830         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13831
13832 2003-08-25  Martin Baulig  <martin@ximian.com>
13833
13834         * convert.cs (Convert.ExplicitReferenceConversion): When
13835         converting from an interface type to a class, unbox if the target
13836         type is a struct type.  Fixes #47822.
13837
13838 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13839
13840         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13841         #47854.
13842
13843 2003-08-22  Martin Baulig  <martin@ximian.com>
13844
13845         * class.cs (TypeManager.DefineType): When defining a nested type,
13846         call DefineType() on our parent; fixes #47801.
13847
13848 2003-08-22  Martin Baulig  <martin@ximian.com>
13849
13850         * class.cs (MethodData.Define): While checking if a method is an
13851         interface implementation, improve the test a bit more to fix #47654.
13852
13853 2003-08-22  Martin Baulig  <martin@ximian.com>
13854
13855         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13856         correctly; fixes #47722.
13857
13858 2003-08-22  Martin Baulig  <martin@ximian.com>
13859
13860         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13861         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13862
13863         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13864
13865 2003-08-22  Martin Baulig  <martin@ximian.com>
13866
13867         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13868         can only be assigned in static constructors.  Fixes #47161.
13869
13870 2003-08-22  Martin Baulig  <martin@ximian.com>
13871
13872         Rewrote and improved the flow analysis code.
13873
13874         * flowbranching.cs (FlowBranching): Make this class abstract.
13875         (FlowBranching.CreateBranching): New static function to create a
13876         new flow branching.
13877         (FlowBranchingBlock, FlowBranchingException): New classes.
13878         (FlowBranching.UsageVector.Type): New public readonly field.
13879         (FlowBranching.UsageVector.Breaks): Removed the setter.
13880         (FlowBranching.UsageVector.Returns): Removed the setter.
13881         (FlowBranching.UsageVector): Added Break(), Return(),
13882         NeverReachable() and Throw() methods to modify the reachability.
13883         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13884         done by FlowBranching.Merge().
13885         (FlowBranching.UsageVector.MergeChild): New method; merges the
13886         merge result into the current vector.
13887         (FlowBranching.Merge): New abstract method to merge a branching.
13888
13889 2003-08-12  Martin Baulig  <martin@ximian.com>
13890
13891         * expression.cs (Indirection.CacheTemporaries): Create the
13892         LocalTemporary with the pointer type, not its element type.
13893
13894 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13895
13896         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13897         token was a keyword or not.
13898
13899         Add `error' options where an IDENTIFIER was expected;  Provide
13900         CheckToken and CheckIdentifierToken convenience error reporting
13901         functions. 
13902
13903         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13904
13905         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13906         NameSpaceEntry NameSpaceEntry.
13907
13908         (LookupInterfaceOrClass): Avoid creating a full qualified name
13909         from namespace and name: avoid doing lookups when we know the
13910         namespace is non-existant.   Use new Tree.LookupByNamespace which
13911         looks up DeclSpaces based on their namespace, name pair.
13912
13913         * driver.cs: Provide a new `parser verbose' to display the
13914         exception thrown during parsing.  This is turned off by default
13915         now, so the output of a failure from mcs is more graceful.
13916
13917         * namespace.cs: Track all the namespaces defined in a hashtable
13918         for quick lookup.
13919
13920         (IsNamespace): New method
13921
13922 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13923
13924         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13925         we know that we need to concatenate (full typename can never be
13926         null). 
13927
13928         * class.cs: ditto.
13929
13930         * statement.cs: Use a bitfield;  Do not initialize to null things
13931         which are done by the constructor by default.
13932
13933         * cs-parser.jay: bug fix, parameter was 4, not 3.
13934
13935         * expression.cs: Just use the property;
13936
13937         * statement.cs: No need for GetVariableInfo method.
13938
13939 2003-08-08  Martin Baulig  <martin@ximian.com>
13940
13941         * flowanalysis.cs (FlowReturns): This is now nested in the
13942         `FlowBranching' class.
13943         (MyBitVector): Moved this here from statement.cs.
13944         (FlowBranching.SiblingType): New enum type.
13945         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13946
13947 2003-08-07  Martin Baulig  <martin@ximian.com>
13948
13949         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13950         `FlowBranching' class and called `BranchingType'.
13951
13952 2003-08-07  Martin Baulig  <martin@ximian.com>
13953
13954         * flowanalysis.cs: Moved all the control flow analysis code into
13955         its own file.
13956
13957 2003-08-07  Martin Baulig  <martin@ximian.com>
13958
13959         * assign.cs (Assign.DoResolve): `target' must either be an
13960         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
13961         #37319.
13962
13963 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
13964
13965         * expression.cs (BinaryMethod): This kind of expression is created by the
13966         Binary class if it determines that the operator has to be handled
13967         by a method.
13968
13969         (BinaryDelegate): This kind of expression is created if we are
13970         dealing with a + or - operator on delegates.
13971
13972         (Binary): remove method, argumetns, and DelegateOperator: when
13973         dealing with methods, 
13974
13975         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
13976
13977         * statement.cs (Block): use bitfields for the three extra booleans
13978         we had in use.   Remove unused topblock parameter.
13979
13980         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
13981
13982         * assign.cs: Drop extra unneeded tests.
13983
13984 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
13985
13986         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
13987
13988         * statement.cs (Foreach): Use VariableStorage instead of
13989         LocalBuilders.   
13990
13991         * codegen.cs (VariableStorage): New class used by clients that
13992         require a variable stored: locals or fields for variables that
13993         need to live across yield.
13994
13995         Maybe provide a convenience api for EmitThis+EmitLoad?
13996
13997         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
13998         these bad boys.
13999
14000 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14001
14002         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14003         RemapParameterLValue): New methods that are used to turn a
14004         precomputed FieldInfo into an expression like this:
14005
14006                 instance.FieldInfo
14007
14008         The idea is to use this instead of making LocalVariableReference
14009         have more than one meaning.
14010
14011         * cs-parser.jay: Add error production to BASE.
14012
14013         * ecore.cs: Deal with TypeManager.GetField returning null, which
14014         is now a valid return value.
14015
14016         (FieldExprNoAddress): New expression for Fields whose address can
14017         not be taken.
14018
14019         * expression.cs (LocalVariableReference): During the resolve
14020         phases, create new expressions if we are in a remapping context.
14021         Remove code that dealt with remapping here.
14022
14023         (ParameterReference): same.
14024
14025         (ProxyInstance): New expression, like the `This' expression, but
14026         it is born fully resolved.  We know what we are doing, so remove
14027         the errors that are targeted to user-provided uses of `this'.
14028
14029         * statement.cs (Foreach): our variable is now stored as an
14030         Expression;  During resolution, follow the protocol, dont just
14031         assume it will return this.
14032
14033 2003-08-06  Martin Baulig  <martin@ximian.com>
14034
14035         * support.cs (SeekableStreamReader.cs): New public class.
14036
14037         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14038         SeekableStreamReader instead of the normal StreamReader.
14039
14040 2003-08-04  Martin Baulig  <martin@ximian.com>
14041
14042         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14043         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14044         deambiguate casts and delegate invocations.
14045         (parenthesized_expression): Use the new tokens to ensure this is
14046         not a cast of method invocation.
14047
14048         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14049         when reading a `)' and Deambiguate_CloseParens () was previously
14050         called.
14051
14052         * expression.cs (ParenthesizedExpression): New class.  This is
14053         just used for the CS0075 test.
14054         (Binary.DoResolve): Check for CS0075.   
14055
14056 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14057
14058         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14059         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14060         reference comparison.
14061
14062         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14063         examine the ReturnType for equality - this is necessary in the
14064         cases of implicit and explicit operators whose signature also
14065         includes the return type.
14066
14067 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14068
14069         * namespace.cs: Cache the result of the namespace computation,
14070         instead of computing it every time.
14071
14072 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14073
14074         * decl.cs: Use a global arraylist that we reuse over invocations
14075         to avoid excesive memory consumption.  Reduces memory usage on an
14076         mcs compile by one meg (45 average).
14077
14078         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14079         private, work around that.
14080
14081 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14082
14083         * literal.cs (IntLiteral): Define Zero and One static literals. 
14084
14085         * cs-parser.jay (integer_literal): use static literals to reduce
14086         memory usage for the most used literals (0, 1 and -1).  211kb
14087         reduced in memory usage.
14088
14089         Replace all calls to `new ArrayList' with `new
14090         ArrayList(4)' which is a good average number for most allocations,
14091         and also requires only 16 bytes of memory for its buffer by
14092         default. 
14093
14094         This reduced MCS memory usage in seven megabytes for the RSS after
14095         bootstrapping.
14096
14097 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14098
14099         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14100         handle params methods the correct way by forming only one
14101         applicable set with params and normal methods in them. Earlier we
14102         were looking at params methods only if we found no normal methods
14103         which was not the correct thing to do.
14104
14105         (Invocation.BetterFunction): Take separate arguments indicating
14106         when candidate and the best method are params methods in their
14107         expanded form.
14108
14109         This fixes bugs #43367 and #46199.
14110
14111         * attribute.cs: Documentation updates.
14112
14113         (CheckAttribute): Rename to CheckAttributeTarget.
14114         (GetValidPlaces): Rename to GetValidTargets.
14115
14116         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14117         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14118
14119         Fixes bug #44468.
14120
14121 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14122
14123         * codegen.cs: Compute IsGeneric correctly.
14124
14125         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14126         resolution. 
14127
14128         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14129         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14130         regressions, and I was chasing more bugs than I required.
14131
14132         * interface.cs: Use expressions for base type names (like classes
14133         and structs have been doing for a while now), and resolve that.
14134         This patch should probably go into head as well.
14135
14136         This makes it one less user of FindType.
14137
14138 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14139
14140         This compiler can not self host currently.  Need to fix that.
14141         
14142         * Makefile: compile to `gmcs.exe'
14143
14144         * driver.cs: Turn on v2 by default on gmcs.
14145
14146         * generic.cs (ConstructedType): Does no longer take a container
14147         type argument;  That will be taken care of later.
14148
14149         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14150         Use SimpleName to resolve for now, so we can continue the work on
14151         the parser, until we get Type.GetType that understands generics.
14152
14153         (ConstructedType.ToString): Implement
14154
14155         (TypeArguments.Resolve): Resolve the child expressions as types. 
14156         
14157         * cs-parser.jay: Rename interface_constraints to
14158         type_parameter_constraints
14159
14160         (namespace_or_type_name): Only use constructed types for the basic
14161         construction, we will deal with identifier<...> later.
14162
14163         (type/type_name): No longer call DecomposeQI, as
14164         namespace_or_type_name is always decoded now.
14165         
14166 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14167
14168         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14169         closely: we eliminate methods in base types when we have an
14170         applicable method in a top-level type.
14171
14172         Please see section 14.5.5.1 for an exact description of what goes
14173         on. 
14174
14175         This fixes bug #45127 and a host of other related to corlib compilation.
14176
14177         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14178         array is the method corresponding to the top-level type (this is
14179         because of the changes made to icall.c) so we change this
14180         accordingly.
14181
14182         (MethodGroupExpr.Name): This too.
14183
14184         * typemanager.cs (GetElementType): New method which does the right
14185         thing when compiling corlib. 
14186
14187         * everywhere: Make use of the above in the relevant places.
14188
14189 2003-07-22  Martin Baulig  <martin@ximian.com>
14190
14191         * cs-parser.jay (invocation_expression): Moved
14192         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14193         `cast_expression', but create a InvocationOrCast which later
14194         resolves to either an Invocation or a Cast.
14195
14196         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14197         method; call this before EmitStatement() to make sure that this
14198         expression can be used as a statement.
14199
14200         * expression.cs (InvocationOrCast): New class; resolves to either
14201         an Invocation or a Cast.
14202
14203         * statement.cs (StatementExpression): Call ResolveStatement() on
14204         the ExpressionStatement before emitting it.
14205
14206 2003-07-21  Martin Baulig  <martin@ximian.com>
14207
14208         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14209         `ref' and `out' attributes match; fixes #46220.
14210         (MemberAccess.ResolveMemberAccess): You can't reference a type
14211         through an expression; fixes #33180.
14212         (Indexers.GetIndexersForType): Don't return the indexers from
14213         interfaces the class implements; fixes #46502.
14214
14215 2003-07-21  Martin Baulig  <martin@ximian.com>
14216
14217         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14218         CS0661 checks; fixes bug #30442.
14219
14220 2003-07-21  Martin Baulig  <martin@ximian.com>
14221
14222         * decl.cs (AdditionResult): Added `Error'.
14223
14224         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14225
14226         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14227         cs0031.cs actually work.
14228
14229  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14230  
14231         * cs-parser.jay (namespace_name): do not use
14232         namespace_or_type_name, use qualified_identifier, because
14233         namespace_or_type_name will soon return a composed expression
14234         instead of a string.
14235  
14236         (namespace_or_type_name): Instead of returning a string, now this
14237         production returns an expression.
14238  
14239         * codegen.cs (EmitContext): Setup IsGeneric property based on
14240         whether our DeclSpace is generic, our the method is generic.
14241  
14242         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14243         the method is generic.
14244  
14245         * cs-parser.jay (type_arguments, opt_type_argument_list,
14246         type_parameters, type_parameter_list, opt_type_parameter_list,
14247         type_parameter,, opt_type_parameter_constraints_clauses,
14248         type_parameter_constraints_clauses,
14249         type_parameter_constraint_clause, type_parameter_constraint,
14250         interface_constraints): Add new production
14251  
14252         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14253         DeclSpace is generic or not.
14254  
14255         (DeclSpace.SetParameterInfo): New routine, used to set the
14256         parameter info for a type.
14257  
14258         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14259         returns a GenericTypeExpr
14260  
14261         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14262         generic, lookup the generic argument.
14263  
14264         * attribute.cs: Do not allow TypeParameterExpressions in
14265         Attributes.
14266  
14267         * class.cs: Do not allow the Main method to be defined in a
14268         Generic container.
14269  
14270         * expression.cs (SizeOf): Do not allow generic types to be used as
14271         arguments to sizeof.
14272  
14273         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14274         it: whether a type is generic or not.  Only works for types we are
14275         currently building for now.
14276         
14277 2003-07-20  Martin Baulig  <martin@ximian.com>
14278
14279         * namespace.cs: Fixed that bug which caused a crash when compiling
14280         the debugger's GUI.
14281
14282 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14283
14284         * typemanager.cs (LookupTypeReflection): Never expose types which
14285         are NotPublic, NestedPrivate, NestedAssembly, or
14286         NestedFamANDAssem.  We used to return these, and later do a check
14287         that would report a meaningful error, but the problem is that we
14288         would not get the real match, if there was a name override.
14289
14290 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14291
14292         * namespace.cs (Namespace, Name): Do not compute the namespace
14293         name dynamically, compute it in the constructor.  This reduced
14294         memory usage by 1697 KB.
14295
14296         * driver.cs: Use --pause to pause at the end.
14297
14298 2003-07-17  Peter Williams  <peter@newton.cx>
14299
14300         * Makefile: Change the name of the test target so that it doesn't
14301         conflict with the recursive test target.
14302
14303 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14304
14305         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14306         AddressOf): Do not use EmitThis, that was wrong, use the actual
14307         this pointer.
14308
14309 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14310
14311         * class.cs (MethodData.Define): While checking if a method is an
14312         interface implementation, improve the test: If we are not public
14313         (use new test here: use the computed MethodAttributes directly,
14314         instead of the parsed modifier flags) check if the `implementing'
14315         method comes from an interface or not.
14316
14317         * pending.cs (VerifyPendingMethods): Slightly better error
14318         message.
14319
14320         * makefile: add test target that does the mcs bootstrap.
14321
14322 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14323
14324         * interface.cs (Define): Do nothing here since there are no
14325         members to populate etc. Move the attribute emission out of here
14326         since this was just totally the wrong place to put it. Attribute
14327         application happens during the 'Emit' phase, not in the 'Define'
14328         phase.
14329
14330         (Emit): Add this method and move the attribute emission here
14331
14332         * rootcontext.cs (EmitCode): Call the Emit method on interface
14333         types too.
14334
14335 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14336
14337         * expression.cs (OverloadResolve): Report error only if Location
14338         is not 'Null' which means that there was a probe going on.
14339
14340 2003-07-14  Martin Baulig  <martin@ximian.com>
14341
14342         * expression.cs (ConditionalLogicalOperator): New public class to
14343         implement user defined conditional logical operators.
14344         This is section 14.11.2 in the spec and bug #40505.
14345
14346 2003-07-14  Martin Baulig  <martin@ximian.com>
14347
14348         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14349
14350 2003-07-14  Martin Baulig  <martin@ximian.com>
14351
14352         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14353
14354         * ecore.cs (IVariable.VerifyFixed): New interface method.
14355
14356         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14357         operator, check whether the variable is actually fixed.  Fixes bug
14358         #36055.  Set a variable definitely assigned when taking its
14359         address as required by the spec.
14360
14361         * statement.cs (LocalInfo.IsFixed): New field.
14362         (LocalInfo.MakePinned): Set `IsFixed' to true.
14363
14364 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14365
14366         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14367         for .ctors, ensure that we only ask for members declared in the
14368         attribute type (BindingFlags.DeclaredOnly).
14369
14370         Fixes bug #43632.
14371
14372         * expression.cs (Error_WrongNumArguments): Report error 1501
14373         correctly the way CSC does.
14374
14375 2003-07-13  Martin Baulig  <martin@ximian.com>
14376
14377         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14378         lookup on the fully qualified name, to make things like "X.X" work
14379         where "X.X" is a fully qualified type name, but we also have a
14380         namespace "X" in the using list.  Fixes #41975.
14381
14382 2003-07-13  Martin Baulig  <martin@ximian.com>
14383
14384         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14385         function. If we're a CompoundAssign, we need to create an embedded
14386         CompoundAssign, not an embedded Assign.
14387         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14388         Fixes #45854.
14389
14390 2003-07-13  Martin Baulig  <martin@ximian.com>
14391
14392         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14393         work to fix bug #46088.
14394
14395 2003-07-13  Ravi Pratap <ravi@ximian.com>
14396
14397         * class.cs (Operator.Emit): Do not emit attributes here - it is
14398         taken care of by the Method class that we delegate too. This takes
14399         care of bug #45876.
14400
14401 2003-07-10  Martin Baulig  <martin@ximian.com>
14402
14403         * expression.cs (TypeOfVoid): New class.
14404         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14405
14406 2003-07-10  Martin Baulig  <martin@ximian.com>
14407
14408         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14409         bug #35957.
14410
14411 2003-07-10  Martin Baulig  <martin@ximian.com>
14412
14413         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14414         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14415
14416         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14417
14418         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14419
14420 2003-07-10  Martin Baulig  <martin@ximian.com>
14421
14422         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14423         of decimal.  Fixes #42850.
14424
14425         NOTE: I also fixed the created byte blob, but this doesn't work on
14426         the MS runtime and csc never produces any byte blobs for decimal
14427         arrays.
14428
14429 2003-07-10  Martin Baulig  <martin@ximian.com>
14430
14431         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14432         structs; fixes #32068.
14433         (Block.AddChildVariableNames): Fixed #44302.
14434
14435 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14436
14437         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14438
14439 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14440
14441         * attribute.cs: And this test is onger needed.
14442
14443 2003-07-08  Martin Baulig  <martin@ximian.com>
14444
14445         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14446         inaccessible types.  Fixes #36313.
14447
14448         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14449
14450         * namespace.cs (NamespaceEntry): Create implicit entries for all
14451         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14452         implicit entries for N1.N2 and N1.
14453
14454 2003-07-08  Martin Baulig  <martin@ximian.com>
14455
14456         Rewrote the handling of namespaces to fix a lot of the issues
14457         wrt. `using' aliases etc.
14458
14459         * namespace.cs (Namespace): Splitted this class into a
14460         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14461
14462         * typemanager.cs (TypeManager.IsNamespace): Removed.
14463         (TypeManager.ComputeNamespaces): Only compute namespaces from
14464         loaded assemblies here, not the namespaces from the assembly we're
14465         currently compiling.
14466
14467 2003-07-08  Martin Baulig  <martin@ximian.com>
14468
14469         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14470
14471 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14472
14473         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14474         already fixed it.  
14475
14476         I thought about the memory savings here, but LookupTypeReflection
14477         is used under already very constrained scenarios.  Compiling
14478         corlib or mcs only exposes one hit, so it would not really reduce
14479         any memory consumption.
14480
14481 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14482
14483         * typemanager.cs: fixes bug #45889 by only adding public types from
14484         other assemblies to the list of known types.
14485
14486 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14487
14488         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14489         on the type we resolved.
14490
14491 2003-07-05  Martin Baulig  <martin@ximian.com>
14492
14493         * pending.cs (PendingImplementation.ParentImplements): Don't
14494         create the proxy if the parent is abstract.
14495
14496         * class.cs (TypeContainer.DefineIndexers): Process explicit
14497         interface implementations first.  Fixes #37714.
14498
14499 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14500
14501         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14502         defined recursively;  but since we modify the input parameters
14503         (left is set to `this' temporarily), we reset this value if the
14504         left_is_explicit is false, which gives the original semantics to
14505         the code.  
14506
14507         * literal.cs (NullPointer): new class used to represent a null
14508         literal in a pointer context.
14509
14510         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14511         type is a pointer, use a NullPointer object instead of a
14512         NullLiteral.   Closes 43687
14513
14514         (ExplicitConversion): Convert pointer values using
14515         the conv opcode to the proper type.
14516
14517         * ecore.cs (New): change ValueTypeVariable property into a method,
14518         that returns whether the valuetype is suitable for being used.
14519
14520         * expression.cs (Binary.DoNumericPromotions): Only return if we
14521         the int constant was a valid uint, and we can return both left and
14522         right as uints.  If not, we continue processing, to trigger the
14523         type conversion.  This fixes 39018.
14524
14525         * statement.cs (Block.EmitMeta): During constant resolution, set
14526         the CurrentBlock property on the emitcontext, so that we resolve
14527         constants propertly.
14528
14529 2003-07-02  Martin Baulig  <martin@ximian.com>
14530
14531         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14532         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14533
14534         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14535         than emitting it here.
14536
14537         * statement.cs: Fixed some more flow analysis bugs.
14538
14539 2003-07-02  Martin Baulig  <martin@ximian.com>
14540
14541         * class.cs (MethodData.Define): When implementing interface
14542         methods, set Final unless we're Virtual.
14543
14544         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14545         check work for interface methods.
14546
14547 2003-07-01  Martin Baulig  <martin@ximian.com>
14548
14549         * ecore.cs (EmitContext.This): Replaced this property with a
14550         GetThis() method which takes a Location argument.  This ensures
14551         that we get the correct error location for a CS0188.
14552
14553 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14554
14555         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14556         ImplicitStandardConversion.
14557
14558         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14559
14560 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14561
14562         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14563         optimization.
14564
14565 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14566
14567         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14568         constructors.
14569
14570         (MethodData.Define): Turn off initlocals for unsafe methods.
14571
14572 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14573
14574         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14575         complete;  Fixes #37521.
14576
14577         * delegate.cs: Use Modifiers.TypeAttr to compute the
14578         TypeAttributes, instead of rolling our own.  This makes the flags
14579         correct for the delegates.
14580
14581 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14582
14583         * class.cs (Constructor.Define): Set the private flag for static
14584         constructors as well.
14585
14586         * cs-parser.jay (statement_expression): Set the return value to
14587         null, to avoid a crash when we catch an error.
14588
14589 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14590
14591         * cs-parser.jay: Applied patch from Jackson that adds support for
14592         extern and unsafe modifiers to destructor declarations.
14593
14594         * expression.cs: Report error 21 if the user is trying to index a
14595         System.Array.
14596
14597         * driver.cs: Add an error message, suggested by the bug report.
14598
14599         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14600         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14601
14602 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14603
14604         * namespace.cs: Add some information to reduce FAQs.
14605
14606 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14607
14608         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14609         underlying enumeration types.  Fixes #43915.
14610
14611         * expression.cs: Treat ushort/short as legal values to be used in
14612         bitwise operations.
14613
14614 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14615
14616         * delegate.cs: transfer custom attributes for paramenters from
14617         the delegate declaration to Invoke and BeginInvoke.
14618
14619 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14620
14621         * attribute.cs: handle custom marshalers and emit marshal info
14622         for fields, too.
14623
14624 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14625
14626         * makefile.gnu: Added anonymous.cs to the compiler sources.
14627
14628 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14629
14630         * iterators.cs: Change the name of the proxy class to include two
14631         underscores.
14632
14633         * cs-parser.jay: Update grammar to include anonymous methods.
14634
14635         * anonymous.cs: new file.
14636
14637 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14638
14639         * class.cs (Field.Define): Add missing test for pointers and
14640         safety. 
14641
14642 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14643
14644         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14645         we use the stobj opcode.
14646
14647         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14648         since it wasn't the correct fix. 
14649
14650         It still is puzzling that we are required to use stobj for IntPtr
14651         which seems to be a ValueType.
14652
14653 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14654
14655         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14656         during regular simple name resolution.   Now, the trick is that
14657         instead of returning for processing the simplename, we do a
14658         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14659         contextual lookup type).   If a match is found, return that, if
14660         not, return for further composition.
14661
14662         This fixes long-standing 30485.
14663
14664         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14665         using the address to initialize an object, do an Stobj instead of
14666         using the regular Stelem.
14667
14668         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14669         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14670         Because if we are a BaseIndexerAccess that value will be true.
14671         Fixes 43643.
14672
14673         * statement.cs (GotoCase.Resolve): Return after reporting an
14674         error, do not attempt to continue. 
14675
14676         * expression.cs (PointerArithmetic.Emit): If our operand is a
14677         long, convert our constants to match the operand before
14678         multiplying.  Convert to I type before adding.   Fixes 43670.
14679
14680 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14681
14682         * enum.cs (ImplicitConversionExists) : Rename to
14683         ImplicitEnumConversionExists to remove ambiguity. 
14684
14685         * ecore.cs (NullCast): New type of cast expression class which
14686         basically is very similar to EmptyCast with the difference being
14687         it still is a constant since it is used only to cast a null to
14688         something else
14689         (eg. (string) null)
14690
14691         * convert.cs (ImplicitReferenceConversion): When casting a null
14692         literal, we return a NullCast.
14693
14694         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14695         should be around anymore.
14696
14697         The renaming (reported was slightly wrong). Corrections:
14698
14699         ConvertImplicitStandard -> ImplicitConversionStandard
14700         ConvertExplicitStandard -> ExplicitConversionStandard
14701
14702         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14703         before passing them in !
14704
14705         * convert.cs (ImplicitConversionStandard): When comparing for
14706         equal expr and target types, ensure that expr is not a
14707         NullLiteral.
14708
14709         In general, we must not be checking (expr_type ==
14710         target_type) in the top level conversion methods
14711         (ImplicitConversion, ExplicitConversion etc). This checking is
14712         done in the methods that they delegate to.
14713
14714 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14715
14716         * convert.cs: Move Error_CannotConvertType,
14717         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14718         ImplicitNumericConversion, ImplicitConversionExists,
14719         ImplicitUserConversionExists, StandardConversionExists,
14720         FindMostEncompassedType, FindMostSpecificSource,
14721         FindMostSpecificTarget, ImplicitUserConversion,
14722         ExplicitUserConversion, GetConversionOperators,
14723         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14724         TryImplicitIntConversion, Error_CannotConvertImplicit,
14725         ConvertImplicitRequired, ConvertNumericExplicit,
14726         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14727         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14728         its own file.
14729
14730         Perform the following renames:
14731
14732         StandardConversionExists -> ImplicitStandardConversionExists
14733         ConvertImplicit -> ImplicitConversion
14734         ConvertImplicitStandard -> ImplicitStandardConversion
14735         TryImplicitIntConversion -> ImplicitIntConversion
14736         ConvertImplicitRequired -> ImplicitConversionRequired
14737         ConvertNumericExplicit -> ExplicitNumericConversion
14738         ConvertReferenceExplicit -> ExplicitReferenceConversion
14739         ConvertExplicit -> ExplicitConversion
14740         ConvertExplicitStandard -> ExplicitStandardConversion
14741
14742 2003-05-19  Martin Baulig  <martin@ximian.com>
14743
14744         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14745         (TypeInfo): Added support for structs having structs as fields.
14746
14747         * ecore.cs (FieldExpr): Implement IVariable.
14748         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14749         VariableInfo for the field.
14750
14751 2003-05-18  Martin Baulig  <martin@ximian.com>
14752
14753         * expression.cs (This.DoResolve): Report a CS0027 if we're
14754         emitting a field initializer.
14755
14756 2003-05-18  Martin Baulig  <martin@ximian.com>
14757
14758         * expression.cs (This.ResolveBase): New public function.
14759         (This.DoResolve): Check for CS0188.
14760
14761         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14762         This.Resolve().
14763
14764         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14765         `instance_expression' to null if we don't have any non-static
14766         methods.
14767
14768 2003-05-18  Martin Baulig  <martin@ximian.com>
14769
14770         Reworked the way how local variables and parameters are handled by
14771         the flow analysis code.
14772
14773         * statement.cs (TypeInfo, VariableMap): New public classes.
14774         (VariableInfo): New public class.  This is now responsible for
14775         checking whether a variable has been assigned.  It is used for
14776         parameters and local variables.
14777         (Block.EmitMeta): Take the InternalParameters as argument; compute
14778         the layout of the flow vectors here.
14779         (Block.LocalMap, Block.ParameterMap): New public properties.
14780         (FlowBranching): The .ctor doesn't get the InternalParameters
14781         anymore since Block.EmitMeta() now computes the layout of the flow
14782         vector.
14783         (MyStructInfo): This class is now known as `StructInfo' and nested
14784         in `TypeInfo'; we don't access this directly anymore.
14785
14786         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14787         property and removed IsAssigned(), IsFieldAssigned(),
14788         SetAssigned() and SetFieldAssigned(); we now call them on the
14789         VariableInfo so we don't need to duplicate this code everywhere.
14790
14791         * expression.cs (ParameterReference): Added `Block block' argument
14792         to the .ctor.
14793         (LocalVariableReference, ParameterReference, This): The new
14794         VariableInfo class is now responsible for all the definite
14795         assignment stuff.
14796
14797         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14798         IsParameterAssigned, SetParameterAssigned): Removed.
14799
14800 2003-05-18  Martin Baulig  <martin@ximian.com>
14801
14802         * typemanager.cs (InitCoreTypes): Try calling
14803         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14804         the 3-args-version.  Corlib now also needs our `void_type'.
14805         (GetMethod): Added overloaded version which takes an optional
14806         `bool report_errors' to allow lookups of optional methods.
14807
14808 2003-05-12  Martin Baulig  <martin@ximian.com>
14809
14810         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14811         only used for locals and not for parameters.
14812
14813 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14814
14815         * support.cs (InternalParameters.ParameterType): Return the
14816         ExternalType of the parameter.
14817
14818         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14819         they were unused.
14820
14821 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14822
14823         * class.cs (MethodData.Define): Do not set the `newslot' on
14824         interface members, if they are also flagged as "override".
14825
14826         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14827         better code for ++i and i++.  This only works for static fields
14828         and local variables.
14829
14830         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14831         want to pull the DeclSpace out of the builder_to_declspace instead
14832         of the TypeBuilder (like in TypeContainer.FindMembers).
14833
14834         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14835         instead of LookupTypeContainer.  Fixes the crash on .NET for
14836         looking up interface members.
14837
14838         * const.cs: Create our own emit context during the Definition
14839         stage, so that constants are evaluated in the proper context, when
14840         a recursive definition happens.
14841
14842 2003-05-11  Martin Baulig  <martin@ximian.com>
14843
14844         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14845         new block for a switch section.
14846         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14847         the adding/lookup in the switch block.  Fixes #39828.
14848
14849 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14850
14851         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14852         functionality: I needed to convert the data after I had performed
14853         the add/sub operation into the operands type size.
14854
14855         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14856         pass the type for the box operation, otherwise the resulting
14857         object would have been of type object.
14858
14859         (BoxedCast): Add constructor to specify the type to box as.
14860
14861 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14862
14863         * iterators.cs: I was reusing the `count' variable inadvertently,
14864         take steps to not allow this to happen.
14865
14866 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14867
14868         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14869         by creating an array at the point where the params starts and
14870         putting all those arguments there, then adjusting the size of the
14871         array.
14872
14873 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14874
14875         * expression.cs (New.AddressOf): Implement interface
14876         IMemoryLocation.  This is used when the `new' operator is used in
14877         the context of an invocation to a method on a value type.
14878
14879         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14880         example. 
14881
14882         * namespace.cs: Also check the using aliases here.
14883
14884         * driver.cs: Move the test for using validity after the types have
14885         been entered, so we do a single pass that also includes the using
14886         aliases. 
14887
14888         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14889         in the regular case.   CreateSiblingForFinally is doing extra
14890         error checking.
14891
14892         * attribute.cs (GetAttributeArgumentExpression): Store the result
14893         on an out value, and use the return value to indicate failure
14894         instead of using null (which is a valid return for Constant.GetValue).
14895
14896         * statement.cs: Perform the analysis flow for the increment
14897         portion after the statement, because this will be the real flow of
14898         execution.  Fixes #42385
14899
14900         * codegen.cs (EmitContext.EmitArgument,
14901         EmitContext.EmitStoreArgument): New helper functions when the
14902         RemapToProxy flag is set.
14903
14904         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14905         function.
14906
14907         Add support for remapping parameters. 
14908
14909         * iterators.cs: Propagate parameter values;  Store parameter
14910         values in the proxy classes.
14911
14912 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14913
14914         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14915         need a proxy reference;  I do not know what I was thinking
14916
14917         * cs-parser.jay (constructor_initializer): catch another error,
14918         and display nice message.
14919
14920         (field_declaration): catch void field declaration
14921         to flag a better error. 
14922
14923         * class.cs (MemberBase.CheckBase): Report an error instead of a
14924         warning if a new protected member is declared in a struct. 
14925         (Field.Define): catch the error of readonly/volatile.
14926
14927         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14928
14929         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14930         volatile variable is taken
14931
14932 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14933
14934         * statement.cs (Fixed.Resolve): Report an error if we are not in
14935         an unsafe context.
14936
14937 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14938
14939         * typemanager.cs: reuse the code that handles type clashes for
14940         delegates and enumerations.
14941
14942         * class.cs (Report28): Always report.
14943
14944         * expression.cs (EncodeAsAttribute): Allow nulls here.
14945
14946 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14947
14948         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14949         the functionality for testing whether an expression is valid for
14950         an attribute here.  Also handle the case of arrays of elements
14951         being stored. 
14952
14953         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14954         encoding a linear array into an array of objects that are suitable
14955         to be passed to an CustomAttributeBuilder.
14956
14957         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
14958
14959         * ecore.cs: (FieldExpr): Handle field remapping here.
14960
14961         * iteratators.cs: Pass the instance variable (if the method is an
14962         instance method) to the constructors, so we can access the field
14963         variables on the class.
14964
14965         TODO: Test this with structs.  I think the THIS variable on
14966         structs might have to be a pointer, and not a refenrece
14967
14968 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
14969
14970         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
14971         local variables to fields in a proxy class.
14972
14973         * iterators.cs (PopulateProxy): Rename our internal fields to
14974         <XXX>.  
14975         Create a <THIS> field if we are an instance method, so we can
14976         reference our parent container variables.
14977         (MapVariable): Called back from the EmitContext code to enter a
14978         new variable to field mapping into the proxy class (we just create
14979         a FieldBuilder).
14980
14981         * expression.cs
14982         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
14983         for using the remapped locals to fields.
14984
14985         I placed the code here, because that gives the same semantics to
14986         local variables, and only changes the Emit code.
14987
14988         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
14989         statements inside iterators.
14990         (VariableInfo): Add a FieldBuilder for the cases when we are
14991         remapping local variables to fields in a proxy class
14992
14993         * ecore.cs (SimpleNameResolve): Avoid testing two times for
14994         current_block != null.
14995
14996         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
14997         not cope with strings, as it has been moved to the
14998         TableSwitchEmit.  Fixed bug in switch generation.
14999
15000         * expression.cs (New.DoResolve): Provide more context for the user
15001         when reporting an error.
15002
15003         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15004         pointers. 
15005
15006         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15007         check the permissions for it.  Note than in a type-resolution
15008         context the check was already present in DeclSpace.ResolveType,
15009         but was missing from the MemberAccess.
15010
15011         (ArrayCreation.CheckIndices): warn if the user has
15012         more nested levels of expressions, but there are no more
15013         dimensions specified.  Avoids crash on bug 41906.
15014
15015 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15016
15017         * statement.cs (Block): replace Implicit bool, for a generic
15018         flags.   
15019         New flag: `Unchecked'.  This is used during the EmitMeta phase
15020         (which is out-of-line with the regular Resolve/Emit process for a
15021         statement, as this is done ahead of time, but still gets a chance
15022         to call constant resolve).
15023
15024         (Block.Flags): new enum for adding a new flag.
15025
15026         (Block.EmitMeta): track the state of unchecked.
15027
15028         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15029         to enable constant resolution to work there as well.
15030
15031 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15032
15033         * typemanager.cs (ienumerable_type): Also look up
15034         System.Collections.IEnumerable. 
15035
15036 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15037
15038         TODO: Test more than one conditional per method.
15039
15040         * class.cs (Indexer.Define): Report the location where the user is
15041         referencing the unsupported feature.
15042
15043         (MethodData): Overload the use of `conditionals' to
15044         minimize the creation of needless ArrayLists.   This saves roughly
15045         212kb on my machine.
15046
15047         (Method): Implement the new IIteratorContainer interface.
15048         (Method.SetYields): Implement the method by setting the ModFlags
15049         to contain METHOD_YIELDS.
15050
15051         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15052         which just got set to null.
15053
15054         * iterators.cs: New file.
15055
15056         (Yield, YieldBreak): New statements.
15057
15058         * statement.cs (Return.Resolve): Flag an error if we are used in
15059         an iterator method.
15060
15061         * codegen.cs (InIterator): New flag set if the code is being
15062         compiled in an iterator method.
15063
15064         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15065         internal modifier, and we just use it to avoid adding extra
15066         fields, as this is seldom used.  
15067
15068         * cs-parser.jay: Add yield_statement (yield and yield break).
15069
15070         * driver.cs: New flag -v2 to turn on version 2 features. 
15071
15072         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15073         hashtable when v2 is enabled.
15074
15075 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15076
15077         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15078         there is already a namespace defined with this name.
15079
15080         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15081         people upgraded their corlibs.
15082
15083         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15084         always use fully qualified types, no need to use the compiler
15085         front end.
15086
15087         (TypeManager.IsNamespace): Use binarysearch.
15088
15089         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15090         AddDelegate): I did not quite use the new IsValid API properly: I
15091         have to pass the short-name and the fullname.  I was passing only
15092         the basename instead of the fullname sometimes. 
15093
15094         (TypeContainer.DefineType): call NamespaceClash.
15095
15096         * interface.cs (Interface.DefineType): use NamespaceClash before
15097         defining the type.
15098
15099         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15100         defining the type.
15101
15102         * enum.cs: (Enum.DefineType): use NamespaceClash before
15103         defining the type.
15104
15105         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15106         speed increase.  First, use the negative_hits cache when we get a
15107         negative.  Second, add the type with its full original name
15108         instead of the new . and + encoded name (reflection uses + to
15109         separate type from a nested type).  Use LookupTypeReflection
15110         directly which bypasses the type->name hashtable (that we already
15111         know does not contain the type.
15112
15113         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15114         location/container type. 
15115
15116         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15117
15118 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15119
15120         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15121
15122         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15123         method is being referenced in the method group from a static
15124         context, and report error 120 if so.
15125
15126         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15127         Error118. 
15128
15129         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15130         is created, we create the A namespace).
15131
15132         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15133         Fixes #41591
15134
15135 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15136
15137         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15138         invocation to ModuleBuilder.GetType with the same values will
15139         return a new type instance, so we need to cache its return
15140         values. 
15141
15142         * expression.cs (Binary.ResolveOperator): Only allow the compare
15143         operators on enums if they are of the same type.
15144
15145         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15146         types of ValueType on their own case.  Before we were giving them
15147         the same treatment as objects.
15148
15149         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15150         fullname.  Short name is used to compare against container name.
15151         Fullname is used to check against defined namespace names.
15152
15153         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15154         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15155
15156         (Method.CheckBase): Call parent.
15157         (MemberBase.CheckBase): Check for protected members on sealed
15158         classes.
15159         (PropertyBase.CheckBase): Call parent.
15160         (Field.Define): Call parent.
15161
15162         * report.cs: Negative error codes are now mapped to 8000 - code,
15163         so that the display is render more nicely.
15164
15165         * typemanager.cs: Do not use try/catch, instead report a regular
15166         error. 
15167
15168         (GetPointerType, GetReferenceType): These methods provide
15169         mechanisms to obtain the T* and T& from a T.  We had the code
15170         previously scattered around the code base, and it also used
15171         TypeManager.LookupType that would go through plenty of caches.
15172         This one goes directly to the type source.
15173
15174         In some places we did the Type.GetType followed by
15175         ModuleBuilder.GetType, but not in others, so this unifies the
15176         processing as well.
15177
15178         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15179         statements now that we have namespace information.
15180
15181         * typemanager.cs (IsNamespace): New method, returns whether the
15182         string presented is a namespace or not.
15183
15184         (ComputeNamespaces): New public entry point, computes the list of
15185         available namespaces, using the GetNamespaces API call in Mono, or
15186         the slower version in MS.NET.   
15187
15188         Now before we start the semantic analysis phase, we have a
15189         complete list of namespaces including everything that the user has
15190         provided.
15191
15192         Deleted old code to cache namespaces in .nsc files.
15193
15194 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15195
15196         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15197         class/struct location definition Location for the implicit
15198         constructor location.
15199
15200         (Operator.Define): Use the location of the operator for the
15201         implicit Method definition.
15202
15203         (Constructor.Emit): use the constructor location for the implicit
15204         base initializer constructor.
15205
15206         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15207         and the Expression class now contains two new methods:
15208
15209         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15210         isolate type lookup from the rest of the resolution process.
15211
15212         Since we use Expressions to hold type definitions due to the way
15213         we parse the input we have historically overloaded Resolve to
15214         perform the Type lookups if a special flag is passed.  Now this is
15215         eliminated and two methods take their place. 
15216
15217         The differences in the two methods between xStep and xTerminal is
15218         that xStep is involved in our current lookup system that uses
15219         SimpleNames to compose a name, while xTerminal is used just to
15220         catch the case where the simplename lookup failed.
15221
15222 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15223
15224         * expression.cs (ResolveMemberAccess): Remove redundant code.
15225         TypeExpr expressions are always born fully resolved.
15226
15227         * interface.cs (PopulateMethod): Do not lookup the types twice.
15228         We were doing it once during SemanticAnalysis and once during
15229         PopulateMethod.
15230
15231         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15232         in local variable type definitions, were being returned as a
15233         SimpleName (we decomposed everything into a string), that is
15234         because primary_expression was being used instead of a type in the
15235         grammar (reduce/reduce conflicts).
15236
15237         The part that was wrong is that we converted the expression into a
15238         string (an oversimplification in one hand, compounded with primary
15239         expressions doing string concatenation).
15240
15241         So things like:
15242
15243         A.B.C [] x;
15244
15245         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15246         using clauses from working on this particular context.  And a type
15247         was being matched directly against "A.B.C[]".
15248
15249         We now use the correct approach, and allow for ComposedCast to be
15250         part of the unary expression.  So the "A.B.C []" become a composed
15251         cast of "A.B.C" (as a nested group of MemberAccess with a
15252         SimpleName at the end) plus the rank composition "[]". 
15253
15254         Also fixes 35567
15255
15256 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15257
15258         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15259         for the access level checking.
15260
15261         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15262         `TypeContainer container', because I kept getting confused when I
15263         was debugging this code.
15264
15265         * expression.cs (Indexers): Instead of tracking getters/setters,
15266         we now track them in parallel.  We create one arraylist less, but
15267         most importantly it is possible now for the LValue code to find a
15268         matching get for a set.
15269
15270         (IndexerAccess.DoResolveLValue): Update the code.
15271         GetIndexersForType has been modified already to extract all the
15272         indexers from a type.  The code assumed it did not.
15273
15274         Also make the code set the correct return type for the indexer.
15275         This was fixed a long time ago for properties, but was missing for
15276         indexers.  It used to be void_type.
15277
15278         (Binary.Emit): Test first for doubles instead of
15279         floats, as they are more common.
15280
15281         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15282         when dealing with floats and the <=, >= operators.  This fixes bug
15283         #39314 
15284
15285         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15286         to load the array value by emitting a load on the foreach variable
15287         type.  This was incorrect.  
15288
15289         We now emit the code to load an element using the the array
15290         variable type, and then we emit the conversion operator.
15291
15292         Fixed #40176
15293
15294 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15295
15296         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15297
15298 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15299
15300         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15301         test for protection before we test for signatures. 
15302
15303         (MethodSignature.ToString): implement.
15304
15305         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15306         to the case where we reduced into a LongConstant.
15307
15308         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15309         depend on whether the information is acurrate, because the
15310         Microsoft runtime will always claim that the array type is public,
15311         regardless of the real state.
15312
15313         If the type is a pointer, another problem happens: the type is
15314         reported as non-public in Microsoft.  
15315
15316         In both cases we have to call CheckAccessLevel recursively with
15317         the underlying type as the argument to be tested.
15318
15319 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15320
15321         * assign.cs (Assign.Emit): If we are dealing with a compound
15322         assignment expression, we should use the code path that stores the
15323         intermediate result in a temporary value.  This fixes #40903.
15324
15325         *expression.cs (Indirection.ToString): Provide ToString method for
15326         debugging. 
15327
15328 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15329
15330         * class.cs: Null out fields holding references to Block objects so
15331         they can be garbage collected.
15332
15333         * expression.cs (OverloadResolve): Remove unused local.
15334
15335 2003-04-07  Martin Baulig  <martin@ximian.com>
15336
15337         * codegen.cs (EmitContext.CurrentFile): New public field.
15338         (EmitContext.Mark): Use the CurrentFile to check whether the
15339         location is in the correct file.
15340         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15341
15342 2003-04-07  Martin Baulig  <martin@ximian.com>
15343
15344         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15345
15346         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15347         location.  [FIXME: The location argument which gets passed to this
15348         method is sometimes wrong!]
15349
15350 2003-04-07  Nick Drochak <ndrochak@gol.com>
15351
15352         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15353
15354 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15355
15356         * expression.cs (Indirection.EmitAssign): We were using the
15357         temporary, but returning immediately instead of continuing the
15358         EmitAssing flow.
15359
15360 2003-04-06  Martin Baulig  <martin@ximian.com>
15361
15362         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15363         if it's a nested child, but also deriving from the outer class.
15364         See test 190.cs.
15365
15366         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15367         nested child, but also deriving from the outer class.  See
15368         test-190.cs.
15369         (FilterWithClosure): We may access private members of the outer
15370         class if we're a nested child and deriving from the outer class.
15371         (RealMemberLookup): Only set `closure_private_ok' if the
15372         `original_bf' contained BindingFlags.NonPublic.
15373
15374 2003-04-05  Martin Baulig  <martin@ximian.com>
15375
15376         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15377         probe if its a type parameter, and if so, flag an error.
15378
15379         * decl.cs: Move here the SetParameterInfo code from class.cs.
15380         Handle IsGeneric here.
15381
15382         Handle a variety of errors in the parameter info definition.
15383
15384         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15385         type parameters here.
15386
15387         * cs-parser.jay (class_declaration): report errors for parameters
15388         here as well.
15389
15390 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
15391
15392         * generic.cs: New file, contains support code for generics.
15393
15394         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15395         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15396
15397         Update parser for the above removals.
15398
15399         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
15400         now taken care of in the parser.
15401
15402 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15403
15404         * class.cs (Event.Define): Do not allow abstract events to have
15405         initializers. 
15406
15407 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15408
15409         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15410         block in event declarations.
15411
15412         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15413         value type, get its address.
15414
15415         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15416         leaving a class on the stack instead of a boolean value (int
15417         0/1).  Change the code so we compare against null, and then the
15418         result against zero.
15419
15420         * class.cs (TypeContainer.GetClassBases): We were checking for the
15421         parent class being sealed too late.
15422
15423         * expression.cs (Binary.Emit): For <= and >= when dealing with
15424         floating point values, use cgt.un and clt.un instead of cgt and
15425         clt alone.
15426
15427 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15428
15429         * statement.cs: Apply the same optimization as MS: skip the 
15430         GetEnumerator returning an IEnumerator, and use the one returning a 
15431         CharEnumerator instead. This allows us to avoid the try-finally block 
15432         and the boxing.
15433
15434 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15435
15436         * cs-parser.jay: Attributes cannot be applied to
15437                          namespaces. Fixes #40473
15438
15439 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15440
15441         * class.cs:
15442         (Add*): check if the name is valid using the full name for constants,
15443         fields, properties and events.
15444
15445 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15446
15447         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15448         char constants to be part of the enumeration.
15449
15450         * expression.cs (Conditional.DoResolve): Add support for operator
15451         true. Implements the missing functionality from 14.12
15452
15453         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15454         operator true/false as required by the spec.
15455
15456         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15457         implicit conversion to boolean.
15458
15459         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15460         also one where the type implements `operator true'. 
15461
15462         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15463         get an expression that will invoke operator true based on an
15464         expression.  
15465
15466         (GetConversionOperators): Removed the hack that called op_True
15467         here.  
15468
15469         (Expression.ResolveBoolean): Move this from Statement.
15470
15471 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15472
15473         * ecore.cs (FieldExpr): do not allow initialization of initonly
15474         fields on derived classes
15475
15476 2003-03-13  Martin Baulig  <martin@ximian.com>
15477
15478         * statement.cs (Block.Emit): Call ig.BeginScope() and
15479         ig.EndScope() when compiling with debugging info; call
15480         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15481
15482 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15483
15484         * expression.cs (Indexers): Do not construct immediately, allow
15485         for new members to be appended as we go.  Fixes 38143
15486
15487 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15488
15489         * expression.cs: save/restore context when resolving an unchecked
15490         expression.
15491
15492 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15493
15494         * cfold.cs: Catch division by zero in modulus operator during
15495         constant folding.
15496
15497 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15498
15499         * interface.cs (Interface.DefineMembers): Avoid defining members
15500         twice. 
15501
15502 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15503
15504         * driver.cs: handle the +/- options for -noconfig
15505
15506         * statement.cs (Unckeched.Resolve): Also track the state of
15507         unchecked in the Resolve phase.
15508
15509 2003-02-27  Martin Baulig  <martin@ximian.com>
15510
15511         * ecore.cs (Expression.MemberLookup): Don't create a
15512         MethodGroupExpr for something which is not a method.  Fixes #38291.
15513
15514 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15515
15516         * class.cs (MemberBase.CheckParameters): Also check that the type
15517         is unmanaged if it is a pointer.
15518
15519         * expression.cs (SizeOf.Resolve): Add location information.
15520
15521         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15522         a managed type is declared.
15523
15524         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15525         parameter modifiers as well.  Fixes bug 38606
15526
15527         * class.cs: Very sad.  Am backing out the speed up changes
15528         introduced by the ArrayList -> Array in the TypeContainer, as they
15529         were not actually that much faster, and introduced a bug (no error
15530         reports on duplicated methods).
15531
15532         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15533         source first, this will guarantee that we have a valid expression
15534         before calling in lower levels functions that will require a
15535         resolved object.  Then use this original_source in the
15536         target.ResolveLValue instead of the original source that was
15537         passed to us.
15538
15539         Another change.  Use target.Resolve instead of LValueResolve.
15540         Although we are resolving for LValues, we will let the Assign code
15541         take care of that (it will be called again from Resolve).  This
15542         basically allows code like this:
15543
15544         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15545         class Y { void A (X x) { x [0] += o; }
15546
15547         The problem was that the indexer was trying to resolve for
15548         set_Item (idx, object o) and never finding one.  The real set_Item
15549         was set_Item (idx, X).  By delaying the process we get the right
15550         semantics. 
15551
15552         Fixes bug 36505
15553
15554 2003-02-23  Martin Baulig  <martin@ximian.com>
15555
15556         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15557         while calling DoEmit ().
15558
15559         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15560         source files; if you use the #line directive inside a method, the
15561         compiler stops emitting line numbers for the debugger until it
15562         reaches the end of the method or another #line directive which
15563         restores the original file.
15564
15565 2003-02-23  Martin Baulig  <martin@ximian.com>
15566
15567         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15568
15569 2003-02-23  Martin Baulig  <martin@ximian.com>
15570
15571         * statement.cs (Block.AddChildVariableNames): We need to call this
15572         recursively, not just for our immediate children.
15573
15574 2003-02-23  Martin Baulig  <martin@ximian.com>
15575
15576         * class.cs (Event.Define): Always make the field private, like csc does.
15577
15578         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15579         actually work, fixes bug #37521.
15580
15581 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15582
15583         * delegate.cs: When creating the various temporary "Parameters"
15584         classes, make sure that we call the ComputeAndDefineParameterTypes
15585         on those new parameters (just like we do with the formal ones), to
15586         allow them to be resolved in the context of the DeclSpace.
15587
15588         This fixes the bug that Dick observed in Bugzilla #38530.
15589
15590 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15591
15592         * expression.cs (ResolveMemberAccess): When resolving a constant,
15593         do not attempt to pull a constant if the value was not able to
15594         generate a valid constant.
15595
15596         * const.cs (LookupConstantValue): Do not report more errors than required.
15597
15598 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15599
15600         * expression.cs: fixes bug #38328.
15601
15602 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15603
15604         * class.cs: Changed all the various members that can be part of a
15605         class from being an ArrayList to be an Array of the right type.
15606         During the DefineType type_list, interface_list, delegate_list and
15607         enum_list are turned into types, interfaces, delegates and enums
15608         arrays.  
15609
15610         And during the member population, indexer_list, event_list,
15611         constant_list, field_list, instance_constructor_list, method_list,
15612         operator_list and property_list are turned into their real arrays.
15613
15614         Although we could probably perform this operation earlier, for
15615         good error reporting we need to keep the lists and remove the
15616         lists for longer than required.
15617
15618         This optimization was triggered by Paolo profiling the compiler
15619         speed on the output of `gen-sample-program.pl' perl script. 
15620
15621         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15622         not crash in methods like MemberLookupFailed that use this field.  
15623
15624         This problem arises when the compiler fails to resolve a type
15625         during interface type definition for example.
15626
15627 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15628
15629         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15630         inherit from System.Object, so we have to stop at null, not only
15631         when reaching System.Object.
15632
15633 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15634
15635         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15636         DeclaredOnly because the parent indexer might have had a different
15637         name, but did not loop until the top of the hierarchy was reached.
15638
15639         The problem this one fixes is 35492: when a class implemented an
15640         indexer from an interface, we were getting the interface method
15641         (which was abstract) and we were flagging an error (can not invoke
15642         abstract method).
15643
15644         This also keeps bug 33089 functioning, and test-148 functioning.
15645
15646         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15647         out if a method is special is to see if it is declared in a
15648         property or event, or whether it is one of the predefined operator
15649         names.   This should fix correctly #36804.
15650
15651 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15652
15653         The goal here is to remove the dependency on EmptyCast.Peel ().
15654         Killing it completely.
15655
15656         The problem is that currently in a number of places where
15657         constants are expected, we have to "probe" for an EmptyCast, and
15658         Peel, which is not the correct thing to do, as this will be
15659         repetitive and will likely lead to errors. 
15660
15661         The idea is to remove any EmptyCasts that are used in casts that
15662         can be reduced to constants, so we only have to cope with
15663         constants. 
15664
15665         This bug hunt was triggered by Bug 37363 and the desire to remove
15666         the duplicate pattern where we were "peeling" emptycasts to check
15667         whether they were constants.  Now constants will always be
15668         constants.
15669
15670         * ecore.cs: Use an enumconstant here instead of wrapping with
15671         EmptyCast.  
15672
15673         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15674         throwing me off.  By handling this we can get rid of a few hacks.
15675
15676         * statement.cs (Switch): Removed Peel() code.
15677
15678 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15679
15680         * class.cs: Location information for error 508
15681
15682         * expression.cs (New.DoResolve): Add a guard against double
15683         resolution of an expression.  
15684
15685         The New DoResolve might be called twice when initializing field
15686         expressions (see EmitFieldInitializers, the call to
15687         GetInitializerExpression will perform a resolve on the expression,
15688         and later the assign will trigger another resolution
15689
15690         This leads to bugs (#37014)
15691
15692         * delegate.cs: The signature for EndInvoke should contain any ref
15693         or out parameters as well.  We were not doing this in the past. 
15694
15695         * class.cs (Field.Define): Do not overwrite the type definition
15696         inside the `volatile' group.  Turns out that volatile enumerations
15697         were changing the type here to perform a validity test, which
15698         broke conversions. 
15699
15700 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15701
15702         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15703         and structs, we do not want to load the instance variable
15704
15705         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15706         enum_type has to be handled like an object reference (implicit
15707         conversions exists from this to object), but the regular IsClass
15708         and IsValueType tests will never return true for this one.
15709
15710         Also we use TypeManager.IsValueType instead of type.IsValueType,
15711         just for consistency with the rest of the code (this is only
15712         needed if we ever use the construct exposed by test-180.cs inside
15713         corlib, which we dont today).
15714
15715 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15716
15717         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15718         just InternalCall.
15719
15720 2003-02-09  Martin Baulig  <martin@ximian.com>
15721
15722         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15723         (Namespace.DefineNamespaces): New static public method; this is
15724         called when we're compiling with debugging to add all namespaces
15725         to the symbol file.
15726
15727         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15728         pass it to the Namespace's .ctor.
15729
15730         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15731         and MethodBase arguments; pass the namespace ID to the symwriter;
15732         pass the MethodBase instead of the token to the symwriter.
15733         (SymbolWriter.DefineNamespace): New method to add a namespace to
15734         the symbol file.
15735
15736 2003-02-09  Martin Baulig  <martin@ximian.com>
15737
15738         * symbolwriter.cs: New file.  This is a wrapper around
15739         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15740         methods here in near future.
15741
15742 2003-02-09  Martin Baulig  <martin@ximian.com>
15743
15744         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15745         ILGenerator.MarkSequencePoint() which are actually used by the
15746         symbol writer.
15747
15748 2003-02-09  Martin Baulig  <martin@ximian.com>
15749
15750         * location.cs (SourceFile): New public sealed class.  This
15751         contains the name and an index which is used in the location's token.
15752         (Location): Reserve an appropriate number of bits in the token for
15753         the source file instead of walking over that list, this gives us a
15754         really huge performance improvement when compiling with debugging.
15755
15756         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15757         `SourceFile' argument instead of a string.
15758         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15759         but don't parse/tokenize here, we need to generate the list of all
15760         source files before we do that.
15761         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15762         the files.
15763
15764         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15765         instead of a string.
15766
15767         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15768         of a string.
15769
15770 2003-02-09  Martin Baulig  <martin@ximian.com>
15771
15772         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15773         filename on `#line default'.
15774
15775 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15776
15777         * statement.cs: don't clear the pinned var when the fixed statement
15778         returns from the method (fixes bug#37752).
15779
15780 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15781
15782         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15783         to IsValueType.
15784
15785 2003-02-07  Martin Baulig  <martin@ximian.com>
15786
15787         * driver.cs: Removed the `--debug-args' command line argument.
15788
15789         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15790         automatically by the AsssemblyBuilder.
15791         (CodeGen.InitializeSymbolWriter): We don't need to call any
15792         initialization function on the symbol writer anymore.  This method
15793         doesn't take any arguments.
15794
15795 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15796
15797         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15798         from referenced assemblies as well.
15799
15800 2003-02-02  Martin Baulig  <martin@ximian.com>
15801
15802         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15803
15804 2003-02-02  Martin Baulig  <martin@ximian.com>
15805
15806         * class.cs (Constructor.Emit): Open the symbol writer before
15807         emitting the constructor initializer.
15808         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15809         single-stepping through constructor initializers.
15810
15811 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15812
15813         * class.cs: Handle error 549: do not allow virtual methods in
15814         sealed classes. 
15815
15816 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15817
15818         * decl.cs: Check access levels when resolving types
15819
15820 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15821
15822         * statement.cs: Add parameters and locals set in catch blocks that might 
15823         return to set vector
15824
15825 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15826
15827         * class.cs (Operator): Set the SpecialName flags for operators.
15828
15829         * expression.cs (Invocation.DoResolve): Only block calls to
15830         accessors and operators on SpecialName methods.
15831
15832         (Cast.TryReduce): Handle conversions from char constants.
15833
15834
15835 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15836
15837         * statement.cs: small memory and time optimization in FlowBranching.
15838
15839 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15840
15841         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15842         problem that the last fix but in the other sid (Set).
15843
15844         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15845         access when there is no indexer in the hierarchy.
15846
15847 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15848
15849         * class.cs: Combine some if statements.
15850
15851 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15852
15853         * driver.cs: fixed bug #37187.
15854
15855 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15856
15857         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15858         any indexer, it's needed to build a list with all the indexers in the
15859         hierarchy (AllGetters), else we have problems. Fixes #35653.
15860
15861 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15862
15863         * class.cs (MethodData.Define): It is wrong for an interface
15864         implementation to be static in both cases: explicit and implicit.
15865         We were only handling this in one case.
15866
15867         Improve the if situation there to not have negations.
15868
15869         * class.cs (Field.Define): Turns out that we do not need to check
15870         the unsafe bit on field definition, only on usage.  Remove the test.
15871
15872 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15873
15874         * driver.cs: use assembly.Location instead of Codebase (the latest
15875         patch made mcs fail when using MS assemblies).
15876
15877 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15878
15879         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15880         get the path to *corlib.dll.
15881
15882 2003-01-21  Nick Drochak <ndrochak@gol.com>
15883
15884         * cs-tokenizer.cs:
15885         * pending.cs:
15886         * typemanager.cs: Remove compiler warnings
15887
15888 2003-01-20  Duncan Mak  <duncan@ximian.com>
15889
15890         * AssemblyInfo.cs: Bump the version number to 0.19.
15891
15892 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15893
15894         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15895
15896 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15897
15898         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15899
15900 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15901
15902         * cs-parser.jay: Small fix: we were not comparing the constructor
15903         name correctly.   Thanks to Zoltan for the initial pointer.
15904
15905 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15906
15907         * cs-tokenizer.cs: Set file name when specified with #line
15908
15909 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15910
15911         * cs-parser.jay: Only perform the constructor checks here if we
15912         are named like the class;  This will help provider a better
15913         error.  The constructor path is taken when a type definition is
15914         not found, but most likely the user forgot to add the type, so
15915         report that rather than the constructor error.
15916
15917 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15918
15919         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15920         allocations.
15921
15922 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15923
15924         * cs-parser.jay: Add cleanup call.
15925
15926 2003-01-13  Duncan Mak  <duncan@ximian.com>
15927
15928         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15929         consistent with other methods.
15930
15931 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15932
15933         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15934
15935 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15936
15937         * attribute.cs: only set GuidAttr to true when we have a
15938         GuidAttribute.
15939
15940 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15941
15942         * ecore.cs:
15943         * expression.cs:
15944         * typemanager.cs: fixes to allow mcs compile corlib with the new
15945         Type.IsSubclassOf fix.
15946
15947 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15948
15949         * expression.cs (LocalVariableReference.DoResolve): Classify a
15950         constant as a value, not as a variable.   Also, set the type for
15951         the variable.
15952
15953         * cs-parser.jay (fixed_statement): take a type instead of a
15954         pointer_type, so we can produce a better error message later.
15955
15956         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15957         as an error.  
15958
15959         (For.DoEmit): Make inifinite loops have a
15960         non-conditional branch back.
15961
15962         (Fixed.DoEmit): First populate the pinned variables, then emit the
15963         statement, then clear the variables.  Before I was emitting the
15964         code once for each fixed piece.
15965
15966
15967 2003-01-08  Martin Baulig  <martin@ximian.com>
15968
15969         * statement.cs (FlowBranching.MergeChild): A break in a
15970         SWITCH_SECTION does not leave a loop.  Fixes #36155.
15971
15972 2003-01-08  Martin Baulig  <martin@ximian.com>
15973
15974         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
15975         lives in the same number space than `param_map'.  Fixes #36154.
15976
15977 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
15978
15979         * cs-parser.jay (constructor_declaration): Set the
15980         Constructor.ModFlags before probing for it.  This makes the
15981         compiler report 514, 515 and 132 (the code was there, but got
15982         broken). 
15983
15984         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
15985         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
15986         (GotoCase.Resolve): Set `Returns' to ALWAYS.
15987
15988 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
15989
15990         * enum.cs: create the enum static fields using the enum type.
15991
15992 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
15993
15994         * class.cs: don't try to create the ParamBuilder for the return
15995         type if it's not needed (and handle it breaking for the ms runtime
15996         anyway).
15997
15998 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
15999
16000         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16001
16002 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16003
16004         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16005         the command.   This showed up while compiling the JANET source
16006         code, which used \r as its only newline separator.
16007
16008 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16009
16010         * class.cs (Method.Define): If we are an operator (because it
16011         reuses our code), then set the SpecialName and HideBySig.  #36128
16012
16013 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16014
16015         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16016         exception, report error 120 `object reference required'.
16017
16018         * driver.cs: Add --pause option, used during to measure the size
16019         of the process as it goes with --timestamp.
16020
16021         * expression.cs (Invocation.DoResolve): Do not allow methods with
16022         SpecialName to be invoked.
16023
16024 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16025
16026         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16027         number before adding it.
16028
16029 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16030
16031         * ecore.cs (StandardImplicitConversion): When in an unsafe
16032         context, we allow conversion between void * to any other pointer
16033         type. This fixes bug #35973.
16034
16035 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16036
16037         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16038         is not thrown when extensionless outputs are used 
16039
16040 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16041
16042         * rootcontext.cs: fixed compilation of corlib.
16043
16044 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16045
16046         * attribute.cs (Attributes.Contains): Add new method.
16047
16048         * class.cs (MethodCore.LabelParameters): if the parameter is an
16049         `out' parameter, check that no attribute `[In]' has been passed.
16050
16051         * enum.cs: Handle the `value__' name in an enumeration.
16052
16053 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16054
16055         * decl.cs: Added special case to allow overrides on "protected
16056         internal" methods
16057
16058 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16059
16060         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16061         since it makes much more sense.
16062
16063         (Attributes.ctor): Don't require a Location parameter.
16064
16065         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16066
16067         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16068         since we already have that information per attribute.
16069
16070         * everywhere : make appropriate changes.
16071
16072         * class.cs (LabelParameters): Write the code which actually
16073         applies attributes to the return type. We can't do this on the MS
16074         .NET runtime so we flag a warning in the case an exception is
16075         thrown.
16076
16077 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16078
16079         * const.cs: Handle implicit null conversions here too.
16080
16081 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16082
16083         * class.cs (MethodCore.LabelParameters): Remove the extra
16084         Type [] parameter since it is completely unnecessary. Instead
16085         pass in the method's attributes so that we can extract
16086         the "return" attribute.
16087
16088 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16089
16090         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16091         of ignoring it and letting the compile continue.
16092
16093         * typemanager.cs (ChangeType): use an extra argument to return an
16094         error condition instead of throwing an exception.
16095
16096 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16097
16098         * expression.cs (Unary.TryReduce): mimic the code for the regular
16099         code path.  Perform an implicit cast in the cases where we can
16100         implicitly convert to one of the integral types, and then reduce
16101         based on that constant.   This fixes bug #35483.
16102
16103 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16104
16105         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16106
16107 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16108
16109         * namespace.cs: fixed bug #35489.
16110
16111 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16112
16113         * class.cs: Remove some dead code.
16114
16115         * cs-parser.jay: Estimate the number of methods needed
16116         (RootContext.MethodCount);
16117
16118         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16119         numbers instead of StringBuilders.
16120
16121         * support.cs (PtrHashtable): Add constructor with initial size;
16122         We can now reduce reallocations of the method table.
16123
16124 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16125
16126         * attribute.cs (ApplyAttributes): Keep track of the emitted
16127         attributes on a per-target basis. This fixes bug #35413.
16128
16129 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16130
16131         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16132         default to the Windows 1252 encoding.
16133
16134         (UnixParseOption): Support version, thanks to Alp for the missing
16135         pointer. 
16136
16137         * AssemblyInfo.cs: Add nice assembly information.
16138
16139         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16140         (bug 35169).
16141
16142         * cs-parser.jay: Allow a trailing comma before the close bracked
16143         in the attribute_section production.
16144
16145         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16146         address of the instance was being taken, I will take this out,
16147         because we take the address of the object immediately here.
16148
16149 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16150
16151         * typemanager.cs (AreMultipleAllowed): Take care of the most
16152         obvious case where attribute type is not in the current assembly -
16153         stupid me ;-)
16154
16155 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16156
16157         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16158         definitions, instead of doing that afterwards.  
16159
16160         Also we use a nice little hack, depending on the constructor, we
16161         know if we are a "composed" name or a simple name.  Hence, we
16162         avoid the IndexOf test, and we avoid 
16163
16164         * codegen.cs: Add code to assist in a bug reporter to track down
16165         the source of a compiler crash. 
16166
16167 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16168
16169         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16170         types have been emitted for a given element and flag an error
16171         if something which does not have AllowMultiple set is used more
16172         than once.
16173
16174         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16175         attribute types and their corresponding AllowMultiple properties
16176
16177         (AreMultipleAllowed): Check the property for a given type.
16178
16179         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16180         property in the case we have a TypeContainer.
16181
16182         (Attributes.AddAttribute): Detect duplicates and just skip on
16183         adding them. This trivial fix catches a pretty gross error in our
16184         attribute emission - global attributes were being emitted twice!
16185
16186         Bugzilla bug #33187 is now fixed.
16187
16188 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16189
16190         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16191         instead of pp_and).
16192
16193         * expression.cs (Binary.ResolveOperator): I can only use the
16194         Concat (string, string, string) and Concat (string, string,
16195         string, string) if the child is actually a concatenation of
16196         strings. 
16197
16198 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16199
16200         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16201         context where we need a 2-character lookahead.
16202
16203         * pending.cs (PendingImplementation): Rework so we can keep track
16204         of interface types all the time, and flag those which were
16205         implemented by parents as optional.
16206
16207 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16208
16209         * expression.cs (Binary.ResolveOperator): Use
16210         String.Concat(string,string,string) or
16211         String.Concat(string,string,string,string) when possible. 
16212
16213         * typemanager: More helper methods.
16214
16215
16216 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16217
16218         * pending.cs: remove the bogus return from GetMissingInterfaces()
16219         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16220
16221 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16222
16223         * namespace.cs: avoid duplicated 'using xxx' being added to
16224         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16225         when we get more than one 'using' statement for the same namespace.
16226         Report a CS0105 warning for it.
16227
16228 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16229
16230         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16231         of calling getChar/putback, uses internal knowledge of it.    
16232
16233         (xtoken): Reorder tokenizer so most common patterns are checked
16234         first.  This reduces the compilation time in another 5% (from 8.11s
16235         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16236
16237         The parsing time is 22% of the compilation in mcs, and from that
16238         64% is spent on the tokenization process.  
16239
16240         I tried using a binary search for keywords, but this is slower
16241         than the hashtable.  Another option would be to do a couple of
16242         things:
16243
16244                 * Not use a StringBuilder, instead use an array of chars,
16245                   with a set value.  Notice that this way we could catch
16246                   the 645 error without having to do it *afterwards*.
16247
16248                 * We could write a hand-parser to avoid the hashtable
16249                   compares altogether.
16250
16251         The identifier consumption process takes 37% of the tokenization
16252         time.  Another 15% is spent on is_number.  56% of the time spent
16253         on is_number is spent on Int64.Parse:
16254
16255                 * We could probably choose based on the string length to
16256                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16257                   computations. 
16258
16259         Another 3% is spend on wrapping `xtoken' in the `token' function.
16260
16261         Handle 0xa0 as whitespace (#34752)
16262
16263 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16264
16265         * typemanager.cs (IsCLRType): New routine to tell whether a type
16266         is one of the builtin types.  
16267
16268         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16269         typecode in more places instead of doing pointer comparissions.
16270         We could leverage some knowledge about the way the typecodes are
16271         laid out.
16272
16273         New code to cache namespaces in assemblies, it is currently not
16274         invoked, to be used soon.
16275
16276         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16277
16278         * expression.cs (Binary.ResolveOperator): specially handle
16279         strings, and do not perform user-defined operator overloading for
16280         built-in types.
16281
16282 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16283
16284         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16285         internalcall as it is a pretty simple operation;  Avoid whenever
16286         possible to call Char.IsLetter.
16287
16288         (consume_identifier): Cut by half the number of
16289         hashtable calls by merging the is_keyword and GetKeyword behavior.
16290
16291         Do not short-circuit, because if we do, we
16292         report errors (ie, #if false && true would produce an invalid
16293         directive error);
16294
16295
16296 2002-11-24  Martin Baulig  <martin@ximian.com>
16297
16298         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16299         check constant ranges and report a CS0221.  Fixes #33186.
16300
16301 2002-11-24  Martin Baulig  <martin@ximian.com>
16302
16303         * cs-parser.jay: Make this work for uninitialized variable
16304         declarations in the `for' initializer.  Fixes #32416.
16305
16306 2002-11-24  Martin Baulig  <martin@ximian.com>
16307
16308         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16309         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16310
16311 2002-11-24  Martin Baulig  <martin@ximian.com>
16312
16313         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16314         argument; if true, we also check for user-defined conversions.
16315         This is only needed if both arguments are of a user-defined type.
16316         Fixes #30443, added test-175.cs.
16317         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16318
16319         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16320
16321 2002-11-24  Martin Baulig  <martin@ximian.com>
16322
16323         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16324         function to get the store opcode.
16325         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16326         only emit the Ldelema if the store opcode is Stobj.  You must run
16327         both test-34 and test-167 to test this.  Fixes #34529.
16328
16329 2002-11-23  Martin Baulig  <martin@ximian.com>
16330
16331         * ecore.cs (Expression.MemberLookup): Added additional
16332         `qualifier_type' argument which is used when we're being called
16333         from MemberAccess.DoResolve() and null if we're called from a
16334         SimpleName lookup.
16335         (Expression.MemberLookupFailed): New method to report errors; this
16336         does the CS1540 check and reports the correct error message.
16337
16338         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16339         argument for the CS1540 check and redone the way how we're dealing
16340         with private members.  See the comment in the source code for details.
16341         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16342         `closure_start_type' to `closure_qualifier_type' and check whether
16343         it's not null.  It was not this filter being broken, it was just
16344         being called with the wrong arguments.
16345
16346         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16347         and pass it the correct `qualifier_type'; this also does the error
16348         handling for us.
16349
16350 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16351
16352         * expression.cs (Invocation.EmitParams): If the we are dealing
16353         with a non-built-in value type, load its address as well.
16354
16355         (ArrayCreation): Use a a pretty constant instead
16356         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16357         static initializers.  
16358
16359         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16360         because they are not really value types, just glorified integers. 
16361
16362         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16363
16364         * ecore.cs: Remove redundant code for enumerations, make them use
16365         the same code path as everything else, fixes the casting issue
16366         with enumerations in Windows.Forms.
16367
16368         * attribute.cs: Do only cast to string if it is a string, the
16369         validation happens later.
16370
16371         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16372         people upgrade their corlibs.
16373
16374         * ecore.cs: Oops, enumerations were not following the entire code path
16375
16376 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16377
16378         * typemanager.cs (FilterWithClosure): Commented out the test for
16379         1540 in typemanager.cs, as it has problems when accessing
16380         protected methods from a parent class (see test-174.cs). 
16381
16382         * attribute.cs (Attribute.ValidateGuid): new method.
16383         (Attribute.Resolve): Use above.
16384
16385 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16386
16387         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16388
16389         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16390         handling for enumerations, as we only needed the TypeContainer
16391         functionality to begin with (this is required for the fix below to
16392         work for enums that reference constants in a container class for
16393         example). 
16394
16395         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16396
16397         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16398         a valid TypeBuilder to perform lookups on.o
16399
16400         * class.cs (InheritableMemberSignatureCompare): Use true in the
16401         call to GetGetMethod and GetSetMethod, because we are comparing
16402         the signature, and we need to get the methods *even* if they are
16403         private. 
16404
16405         (PropertyBase.CheckBase): ditto.
16406
16407         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16408         GotoCase.Resolve): Use Peel on EmpytCasts.
16409
16410         * ecore.cs (EmptyCast): drop child, add Peel method.
16411
16412 2002-11-17  Martin Baulig  <martin@ximian.com>
16413
16414         * ecore.cs (EmptyCast.Child): New public property.
16415
16416         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16417         label resolved to an EmptyCast.  Fixes #34162.
16418         (GotoCase.Resolve): Likewise.
16419         (Block.EmitMeta): Likewise.
16420
16421 2002-11-17  Martin Baulig  <martin@ximian.com>
16422
16423         * expression.cs (Invocation.BetterConversion): Prefer int over
16424         uint; short over ushort; long over ulong for integer literals.
16425         Use ImplicitConversionExists instead of StandardConversionExists
16426         since we also need to check for user-defined implicit conversions.
16427         Fixes #34165.  Added test-173.cs.
16428
16429 2002-11-16  Martin Baulig  <martin@ximian.com>
16430
16431         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16432         with the `true' and `false' literals.  Fixes #33151.
16433
16434 2002-11-16  Martin Baulig  <martin@ximian.com>
16435
16436         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16437         October 22nd; don't do the cs1540 check for static members.
16438
16439         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16440         now using our own filter here and doing the cs1540 check again.
16441
16442 2002-11-16  Martin Baulig  <martin@ximian.com>
16443
16444         * support.cs (InternalParameters): Don't crash if we don't have
16445         any fixed parameters.  Fixes #33532.
16446
16447 2002-11-16  Martin Baulig  <martin@ximian.com>
16448
16449         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16450         when looking up static methods to make this work on Windows.
16451         Fixes #33773.
16452
16453 2002-11-16  Martin Baulig  <martin@ximian.com>
16454
16455         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16456         a setter rather than using PropertyInfo.CanWrite.
16457
16458 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16459
16460         * class.cs: Allow acces to block member by subclasses. Fixes build
16461         breaker.
16462
16463 2002-11-14  Martin Baulig  <martin@ximian.com>
16464
16465         * class.cs (Constructor.Emit): Added the extern/block check.
16466         Fixes bug #33678.
16467
16468 2002-11-14  Martin Baulig  <martin@ximian.com>
16469
16470         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16471         iteration while looking for indexers, this is needed because the
16472         indexer may have a different name in our base classes.  Fixed the
16473         error reporting (no indexers at all, not get accessor, no
16474         overloaded match).  Fixes bug #33089.
16475         (IndexerAccess.DoResolveLValue): Likewise.
16476
16477 2002-11-14  Martin Baulig  <martin@ximian.com>
16478
16479         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16480         indexers.  Fixes the first part of bug #33089.
16481         (MethodSignature.InheritableMemberSignatureCompare): Added support
16482         for properties.
16483
16484 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16485
16486         * attribute.cs (Attribute.Resolve): Catch the
16487         NullReferenceException and report it since it isn't supposed to
16488         happen. 
16489
16490 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16491
16492         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16493         LogicalOr and LogicalAnd that can benefit from recursively
16494         handling EmitBranchable.  The code now should be nice for Paolo.
16495
16496 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16497
16498         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16499         the Type lookups, as we perform quite a number of lookups on
16500         non-Types.  This can be removed once we can deterministically tell
16501         whether we have a type or a namespace in advance.
16502
16503         But this might require special hacks from our corlib.
16504
16505         * TODO: updated.
16506
16507         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16508         and double which avoids a conversion from an integer to a double.
16509
16510         * expression.cs: tiny optimization, avoid calling IsConstant,
16511         because it effectively performs the lookup twice.
16512
16513 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16514
16515         But a bogus return here to keep the semantics of the old code
16516         until the Mono runtime is fixed.
16517
16518         * pending.cs (GetMissingInterfaces): New method used to remove all
16519         the interfaces that are already implemented by our parent
16520         classes from the list of pending methods. 
16521
16522         * interface.cs: Add checks for calls after ResolveTypeExpr.
16523
16524 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16525
16526         * class.cs (Class.Emit): Report warning 67: event not used if the
16527         warning level is beyond 3.
16528
16529         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16530         being a NullLiteral.
16531
16532         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16533         specifiers. 
16534
16535         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16536         path that might fail if a type can not be resolved.
16537
16538         * expression.cs (Binary.Emit): Emit unsigned versions of the
16539         operators. 
16540
16541         * driver.cs: use error 5.
16542
16543 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16544
16545         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16546
16547 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16548
16549         * cs-parser.jay (switch_section): A beautiful patch from Martin
16550         Baulig that fixed 33094.
16551
16552 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16553
16554         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16555         Check whether the base is abstract and report an error if so.
16556
16557         * expression.cs (IndexerAccess.DoResolveLValue,
16558         IndexerAccess.DoResolve): ditto. 
16559
16560         (Invocation.DoResolve): ditto.
16561
16562         (Invocation.FullMethodDesc): Improve the report string.
16563
16564         * statement.cs (Block): Eliminate IsVariableDefined as it is
16565         basically just a wrapper for GetVariableInfo.
16566
16567         * ecore.cs (SimpleName): Use new 
16568
16569         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16570         type, as we return the actual parameter ref/unref state on a
16571         different call.
16572
16573 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16574
16575         * support.cs: Return proper flags REF/OUT fixing the previous
16576         commit.  
16577
16578         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16579         not used to mean `ref' but `ref or out' in ParameterReference
16580
16581         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16582         full type signature instead of calling TypeManger.CSharpName
16583         ourselves. 
16584
16585         * support.cs (InternalParameters.ParameterDesc): Do not compare
16586         directly to the modflags, because REF/OUT will actually be bitsets
16587         if set. 
16588
16589         * delegate.cs (VerifyMethod): Check also the modifiers.
16590
16591         * cs-tokenizer.cs: Fix bug where floating point values with an
16592         exponent where a sign was missing was ignored.
16593
16594         * driver.cs: Allow multiple assemblies to be specified in a single
16595         /r: argument
16596
16597 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16598
16599         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16600         because identifiers after a parenthesis would end up in this kind
16601         of production, and we needed to desamiguate it for having casts
16602         like:
16603
16604                 (UserDefinedType *) xxx
16605
16606 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16607
16608         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16609         we should set on the Bindingflags.NonPublic, but not turn on
16610         private_ok.  private_ok controls whether a Private member is
16611         returned (this is chekced on the filter routine), while the
16612         BindingFlags.NonPublic just controls whether private/protected
16613         will be allowed.   This fixes the problem part of the problem of
16614         private properties being allowed to be used in derived classes.
16615
16616         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16617         so we can call the children DoResolveLValue method (this will
16618         properly signal errors on lvalue assignments to base properties)
16619
16620         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16621         getter are null, and we have a property info, we know that this
16622         happened because the lookup failed, so we report an error 122 for
16623         protection level violation.
16624
16625         We also silently return if setter and getter are null in the
16626         resolve functions, this condition only happens if we have flagged
16627         the error before.  This is the other half of the problem. 
16628
16629         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16630         not have accessibility information, that is why we were returning
16631         true in the filter function in typemanager.cs.
16632
16633         To properly report 122 (property is inaccessible because of its
16634         protection level) correctly, we report this error in ResolveAccess
16635         by failing if both the setter and the getter are lacking (ie, the
16636         lookup failed). 
16637
16638         DoResolve and DoLResolve have been modified to check for both
16639         setter/getter being null and returning silently, the reason being
16640         that I did not want to put the knowledge about this error in upper
16641         layers, like:
16642
16643         int old = Report.Errors;
16644         x = new PropertyExpr (...);
16645         if (old != Report.Errors)
16646                 return null;
16647         else
16648                 return x;
16649
16650         So the property expr is returned, but it is invalid, so the error
16651         will be flagged during the resolve process. 
16652
16653         * class.cs: Remove InheritablePropertySignatureCompare from the
16654         class, as we no longer depend on the property signature to compute
16655         whether it is possible to implement a method or not.
16656
16657         The reason is that calling PropertyInfo.GetGetMethod will return
16658         null (in .NET, in Mono it works, and we should change this), in
16659         cases where the Get Method does not exist in that particular
16660         class.
16661
16662         So this code:
16663
16664         class X { public virtual int A { get { return 1; } } }
16665         class Y : X { }
16666         class Z : Y { public override int A { get { return 2; } } }
16667
16668         Would fail in Z because the parent (Y) would not have the property
16669         defined.  So we avoid this completely now (because the alternative
16670         fix was ugly and slow), and we now depend exclusively on the
16671         method names.
16672
16673         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16674         reference method, instead of using the property.
16675
16676         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16677         routines are gone now.
16678
16679         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16680         names, they were incorrectly named.
16681
16682         * cs-tokenizer.cs: Return are more gentle token on failure. 
16683
16684         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16685         had an out-of-sync index variable, which caused it to remove from
16686         the list of pending methods the wrong method sometimes.
16687
16688 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16689
16690         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16691         CanWrite, because those refer to this particular instance of the
16692         property, and do not take into account the fact that we can
16693         override single members of a property.
16694
16695         Constructor requires an EmitContext.  The resolution process does
16696         not happen here, but we need to compute the accessors before,
16697         because the resolution does not always happen for properties.
16698
16699         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16700         subclass, before we did not update this flag, but we did update
16701         bindingflags. 
16702
16703         (GetAccessors): Drop this routine, as it did not work in the
16704         presence of partially overwritten set/get methods. 
16705
16706         Notice that this broke the cs1540 detection, but that will require
16707         more thinking. 
16708
16709 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16710
16711         * class.cs:
16712         * codegen.cs:
16713         * driver.cs: issue a warning instead of an error if we don't support
16714         debugging for the platform. Also ignore a couple of errors that may
16715         arise when trying to write the symbols. Undo my previous patch.
16716
16717 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16718
16719         * driver.cs: ignore /debug switch except for Unix platforms.
16720
16721 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16722
16723         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16724
16725 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16726
16727         * driver.cs: Do not make mcs-debug conditional, so we do not break
16728         builds that use it.
16729
16730         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16731         review this patch.  But basically after all the children variables
16732         have been merged, the value of "Breaks" was not being set to
16733         new_breaks for Switch blocks.  I think that it should be set after
16734         it has executed.  Currently I set this to the value of new_breaks,
16735         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16736         conservative, but I do not understand this code very well.
16737
16738         I did not break anything in the build, so that is good ;-)
16739
16740         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16741
16742 2002-10-20  Mark Crichton  <crichton@gimp.org>
16743
16744         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16745
16746 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16747
16748         * cfold.cs: Fixed compile blocker.
16749
16750 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16751
16752         * driver.cs: I was chekcing the key, not the file.
16753
16754 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16755
16756         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16757         message that we were generating - we just need to silently return
16758         a null.
16759
16760 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * class.cs (Event.Define): Change my previous commit, as this
16763         breaks the debugger.  This is a temporary hack, as it seems like
16764         the compiler is generating events incorrectly to begin with.
16765
16766         * expression.cs (Binary.ResolveOperator): Added support for 
16767         "U operator - (E x, E y)"
16768
16769         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16770         y)".
16771
16772         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16773         init-only variables, but this path did not take into account that
16774         there might be also instance readonly variables.  Correct this
16775         problem. 
16776
16777         This fixes bug 32253
16778
16779         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16780         delegates as well.
16781
16782         * driver.cs: Change the extension for modules to `netmodule'
16783
16784         * cs-parser.jay: Improved slightly the location tracking for
16785         the debugger symbols.
16786
16787         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16788         modifiers that were specified instead of the hardcoded value
16789         (FamAndAssem).  This was basically ignoring the static modifier,
16790         and others.  Fixes 32429.
16791
16792         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16793         fixed a bug in the process (32476)
16794
16795         * expression.cs (ArrayAccess.EmitAssign): Patch from
16796         hwang_rob@yahoo.ca that fixes bug 31834.3
16797
16798 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16799
16800         * driver.cs: Make the module extension .netmodule.
16801
16802 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16803
16804         * driver.cs: Report an error if the resource file is not found
16805         instead of crashing.
16806
16807         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16808         false, like Emit does.
16809
16810 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16811
16812         * typemanager.cs: Remove unused private member.  Also reported mcs
16813         bug to report this as a warning like csc.
16814
16815 2002-10-15  Martin Baulig  <martin@gnome.org>
16816
16817         * statement.cs (Statement.Emit): Made this a virtual method; emits
16818         the line number info and calls DoEmit().
16819         (Statement.DoEmit): New protected abstract method, formerly knows
16820         as Statement.Emit().
16821
16822         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16823
16824 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16825
16826         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16827         have fixed a remaining problem: not every AddXXXX was adding a
16828         fully qualified name.  
16829
16830         Now everyone registers a fully qualified name in the DeclSpace as
16831         being defined instead of the partial name.  
16832
16833         Downsides: we are slower than we need to be due to the excess
16834         copies and the names being registered this way.  
16835
16836         The reason for this is that we currently depend (on the corlib
16837         bootstrap for instance) that types are fully qualified, because
16838         we dump all the types in the namespace, and we should really have
16839         types inserted into the proper namespace, so we can only store the
16840         basenames in the defined_names array.
16841
16842 2002-10-10  Martin Baulig  <martin@gnome.org>
16843
16844         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16845         from bug #31834, see the bug report for a testcase which is
16846         miscompiled.
16847
16848 2002-10-10  Martin Baulig  <martin@gnome.org>
16849
16850         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16851         flow analysis code for this.
16852
16853         * statement.cs (Do, While, For): Tell the flow analysis code about
16854         infinite loops.
16855         (FlowBranching.UsageVector): Added support for infinite loops.
16856         (Block.Resolve): Moved the dead code elimination here and use flow
16857         analysis to do it.
16858
16859 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16860
16861         * class.cs (Field.Define): Catch cycles on struct type
16862         definitions. 
16863
16864         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16865         fields if the fields are static.  We only need to check instance
16866         fields. 
16867
16868         * expression.cs (As.DoResolve): Test for reference type.
16869
16870         * statement.cs (Using.ResolveExpression): Use
16871         ConvertImplicitRequired, not ConvertImplicit which reports an
16872         error on failture
16873         (Using.ResolveLocalVariableDecls): ditto.
16874
16875         * expression.cs (Binary.ResolveOperator): Report errors in a few
16876         places where we had to.
16877
16878         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16879
16880 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16881
16882         * expression.cs: Use StoreFromPtr instead of extracting the type
16883         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16884
16885         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16886         an enumeration value to a System.Enum, but System.Enum is not a
16887         value type, but an class type, so we need to box.
16888
16889         (Expression.ConvertExplicit): One codepath could return
16890         errors but not flag them.  Fix this.  Fixes #31853
16891
16892         * parameter.cs (Resolve): Do not allow void as a parameter type.
16893
16894 2002-10-06  Martin Baulig  <martin@gnome.org>
16895
16896         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16897         if it's a class type and not a struct.  Fixes #31815.
16898
16899 2002-10-06  Martin Baulig  <martin@gnome.org>
16900
16901         * statement.cs: Reworked the flow analysis code a bit to make it
16902         usable for dead code elimination.
16903
16904 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16905
16906         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16907
16908 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16909
16910         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16911         to fix the test 165, will investigate deeper.
16912
16913 2002-10-04  Martin Baulig  <martin@gnome.org>
16914
16915         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16916         finally blocks actually work.
16917         (Try.Resolve): We don't need to create a sibling for `finally' if
16918         there is no finally block.
16919
16920 2002-10-04  Martin Baulig  <martin@gnome.org>
16921
16922         * class.cs (Constructor.Define): The default accessibility for a
16923         non-default constructor is private, not public.
16924
16925 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16926
16927         * class.cs (Constructor): Make AllowedModifiers public, add
16928         EXTERN.
16929
16930         * cs-parser.jay: Perform the modifiers test here, as the
16931         constructor for the Constructor class usually receives a zero
16932         because of the way we create it (first we create, later we
16933         customize, and we were never checking the modifiers).
16934
16935         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16936         is a version of LookupTypeReflection that includes the type-name
16937         cache.  This can be used as a fast path for functions that know
16938         the fully qualified name and are only calling into *.GetType() to
16939         obtain a composed type.
16940
16941         This is also used by TypeManager.LookupType during its type
16942         composition.
16943
16944         (LookupType): We now also track the real type name, as sometimes
16945         we can get a quey for the real type name from things like
16946         ComposedCast.  This fixes bug 31422.
16947
16948         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16949         complete type fullname, it does not have to go through the type
16950         resolution system to obtain the composed version of the type (for
16951         obtaining arrays or pointers).
16952
16953         (Conditional.Emit): Use the EmitBoolExpression to
16954         generate nicer code, as requested by Paolo.
16955
16956         (ArrayCreation.CheckIndices): Use the patch from
16957         hwang_rob@yahoo.ca to validate the array initializers. 
16958
16959 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
16960
16961         * class.cs (ConstructorInitializer.Emit): simplify code by using
16962         Invocation.EmitCall, and at the same time, fix the bugs in calling
16963         parent constructors that took variable arguments. 
16964
16965         * ecore.cs (Expression.ConvertNumericExplicit,
16966         Expression.ImplicitNumericConversion): Remove the code that
16967         manually wrapped decimal (InternalTypeConstructor call is now gone
16968         as well).
16969
16970         * expression.cs (Cast.TryReduce): Also handle decimal types when
16971         trying to perform a constant fold on the type.
16972
16973         * typemanager.cs (IsUnmanagedtype): Partially implemented.
16974
16975         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
16976         that only turned off an error report, and did nothing else. 
16977
16978 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
16979
16980         * driver.cs: Handle and ignore /fullpaths
16981
16982 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
16983
16984         * expression.cs (Binary.ResolveOperator): Catch the case where
16985         DoNumericPromotions returns true, 
16986
16987         (Binary.DoNumericPromotions): Simplify the code, and the tests.
16988
16989 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
16990
16991         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
16992         report error 70.
16993
16994 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
16995
16996         * ecore.cs (ConvertNumericExplicit): It is not enough that the
16997         conversion exists, but it is also required that the conversion be
16998         performed.  This manifested in "(Type64Enum) 2".  
16999
17000         * class.cs (TypeManager.AddMethod): The fix is not to change
17001         AddEnum, because that one was using a fully qualified name (every
17002         DeclSpace derivative does), but to change the AddMethod routine
17003         that was using an un-namespaced name.  This now correctly reports
17004         the duplicated name.
17005
17006         Revert patch until I can properly fix it.  The issue
17007         is that we have a shared Type space across all namespaces
17008         currently, which is wrong.
17009
17010         Options include making the Namespace a DeclSpace, and merge
17011         current_namespace/current_container in the parser.
17012
17013 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17014
17015         * cs-parser.jay: Improve error reporting when we get a different
17016         kind of expression in local_variable_type and
17017         local_variable_pointer_type. 
17018
17019         Propagate this to avoid missleading errors being reported.
17020
17021         * ecore.cs (ImplicitReferenceConversion): treat
17022         TypeManager.value_type as a target just like object_type.   As
17023         code like this:
17024
17025         ValueType v = 1;
17026
17027         Is valid, and needs to result in the int 1 being boxed before it
17028         is assigned to the value type v.
17029
17030         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17031         to validate the enumeration name.
17032
17033         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17034         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17035         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17036
17037         * ecore.cs (TryImplicitIntConversion): When doing an
17038         implicit-enumeration-conversion, check if the type is 64-bits and
17039         perform a conversion before passing to EnumConstant.
17040
17041 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17042
17043         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17044         report ambiguous type references.  Unlike the MS version, we
17045         report what the ambiguity is.   Innovation at work ;-)
17046
17047         (DeclSpace.FindType): Require a location argument to
17048         display when we display an ambiguous error.
17049
17050         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17051
17052         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17053
17054         * expression.cs (EmitDynamicInitializers): Apply patch from
17055         hwang_rob@yahoo.ca that fixes the order in which we emit our
17056         initializers. 
17057
17058 2002-09-21  Martin Baulig  <martin@gnome.org>
17059
17060         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17061         delegate takes no arguments.
17062
17063 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17064
17065         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17066         from integers.
17067
17068         * expression.cs: Extract the underlying type.
17069
17070         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17071
17072         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17073
17074 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17075
17076         * class.cs (TypeContainer.DefineType): We can not use the nice
17077         PackingSize with the size set to 1 DefineType method, because it
17078         will not allow us to define the interfaces that the struct
17079         implements.
17080
17081         This completes the fixing of bug 27287
17082
17083         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17084         means also structs.  This fixes part of the problem. 
17085         (Expresion.ImplicitReferenceConversionExists): ditto.
17086
17087         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17088         error if there were no errors reported during the type lookup
17089         process, to avoid duplicates or redundant errors.  Without this
17090         you would get an ambiguous errors plus a type not found.  We have
17091         beaten the user enough with the first error.  
17092
17093         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17094         reference. 
17095
17096         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17097         during the resolution process, stop the lookup, this avoids
17098         repeated error reports (same error twice).
17099
17100         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17101
17102         * typemanager.cs (LookupType): Redo the type lookup code to match
17103         the needs of System.Reflection.  
17104
17105         The issue is that System.Reflection requires references to nested
17106         types to begin with a "+" sign instead of a dot.  So toplevel
17107         types look like: "NameSpace.TopLevelClass", and nested ones look
17108         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17109         levels. 
17110
17111 2002-09-19  Martin Baulig  <martin@gnome.org>
17112
17113         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17114         says that a method always returns or always throws an exception,
17115         don't report the CS0161.
17116
17117         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17118         set `Returns = new_returns'.
17119
17120 2002-09-19  Martin Baulig  <martin@gnome.org>
17121
17122         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17123         to an enum constant, check for a CS0176.
17124
17125 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17126
17127         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17128         for operators that must be in pairs and report errors.
17129
17130         * ecore.cs (SimpleName.DoResolveType): During the initial type
17131         resolution process, when we define types recursively, we must
17132         check first for types in our current scope before we perform
17133         lookups in the enclosing scopes.
17134
17135         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17136
17137         (Invocation.VerifyArgumentsCompat): Call
17138         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17139         I thought we were supposed to always call this, but there are a
17140         few places in the code where we dont do it.
17141
17142 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17143
17144         * driver.cs: Add support in -linkres and -resource to specify the
17145         name of the identifier.
17146
17147 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17148
17149         * ecore.cs (StandardConversionExists): Sync with the conversion
17150         code: allow anything-* to void* conversions.
17151
17152         (FindMostSpecificSource): Use an Expression argument
17153         instead of a Type, because we might be handed over a Literal which
17154         gets a few more implicit conversions that plain types do not.  So
17155         this information was being lost.
17156
17157         Also, we drop the temporary type-holder expression when not
17158         required.
17159
17160 2002-09-17  Martin Baulig  <martin@gnome.org>
17161
17162         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17163         this is an explicit interface implementation.
17164
17165 2002-09-17  Martin Baulig  <martin@gnome.org>
17166
17167         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17168         different `IndexerName' attributes.
17169
17170         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17171         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17172         virtual CommonResolve().
17173
17174 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17175
17176         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17177         and convert that to the UnderlyingType.
17178
17179         * statement.cs (Foreach.Resolve): Indexers are just like variables
17180         or PropertyAccesses.
17181
17182         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17183         inside quoted strings, we were not doing this before.
17184
17185 2002-09-16  Martin Baulig  <martin@gnome.org>
17186
17187         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17188         resolve it.  This is needed for the definite assignment check of the
17189         instance expression, fixes bug #29846.
17190         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17191
17192 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17193
17194         * parameter.cs: Fix compile error.  Cannot reference static member
17195         from an instance object.  Is this an mcs bug?
17196
17197 2002-09-14  Martin Baulig  <martin@gnome.org>
17198
17199         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17200         multiple times.  Fixes bug #30295, added test-166.cs.
17201
17202 2002-09-14  Martin Baulig  <martin@gnome.org>
17203
17204         * statement.cs (Block.Emit): Don't emit unreachable code.
17205         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17206         `break' statements.
17207         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17208
17209 2002-09-14  Martin Baulig  <martin@gnome.org>
17210
17211         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17212         is set.
17213
17214 2002-09-14  Martin Baulig  <martin@gnome.org>
17215
17216         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17217         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17218         be false on the ms runtime.
17219
17220 2002-09-13  Martin Baulig  <martin@gnome.org>
17221
17222         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17223         the CS0038 error message.
17224
17225 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17226
17227         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17228         constant inside, return it.
17229
17230 2002-09-12  Martin Baulig  <martin@gnome.org>
17231
17232         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17233         implicit conversion can be done between enum types.
17234
17235         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17236         check whether an implicit conversion to the current enum's UnderlyingType
17237         exists and report an error if not.
17238
17239         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17240         without debugging support.
17241
17242         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17243         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17244
17245 2002-09-12  Martin Baulig  <martin@gnome.org>
17246
17247         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17248
17249         * ecore.cs (IMemberExpr.DeclaringType): New property.
17250         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17251         nonstatic member of an outer type (CS0038).
17252
17253 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17254
17255         * driver.cs: Activate the using-error detector at warning level
17256         4 (at least for MS-compatible APIs).
17257
17258         * namespace.cs (VerifyUsing): Small buglett fix.
17259
17260         * pending.cs (PendingImplementation): pass the container pointer. 
17261
17262         * interface.cs (GetMethods): Allow for recursive definition.  Long
17263         term, I would like to move every type to support recursive
17264         definitions, not the current ordering mechanism that we have right
17265         now.
17266
17267         The situation is this: Attributes are handled before interfaces,
17268         so we can apply attributes to interfaces.  But some attributes
17269         implement interfaces, we will now handle the simple cases
17270         (recursive definitions will just get an error).  
17271
17272         * parameter.cs: Only invalidate types at the end if we fail to
17273         lookup all types.  
17274
17275 2002-09-09  Martin Baulig  <martin@gnome.org>
17276
17277         * ecore.cs (PropertyExpr.Emit): Also check for
17278         TypeManager.system_int_array_get_length so this'll also work when
17279         compiling corlib.  Fixes #30003.
17280
17281 2002-09-09  Martin Baulig  <martin@gnome.org>
17282
17283         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17284         and throw an exception if we can't get the type's size.  Fixed #30040,
17285         added test-165.cs.
17286
17287 2002-09-09  Martin Baulig  <martin@gnome.org>
17288
17289         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17290
17291         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17292         context.  Fixes bug #30027.
17293
17294         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17295         virtual functions.  Fixes bug #30043, added test-164.cs.
17296
17297 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17298
17299         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17300
17301 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17302
17303         * driver.cs: Use an object to get the windows codepage since it's not a
17304         static property.
17305
17306 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17307
17308         * statement.cs (For.Emit): for infinite loops (test == null)
17309         return whether there is a break inside, not always "true".
17310
17311         * namespace.cs (UsingEntry): New struct to hold the name of the
17312         using definition, the location where it is defined, and whether it
17313         has been used in a successful type lookup.
17314
17315         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17316         strings.
17317
17318         * decl.cs: ditto.
17319
17320 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17321
17322         * attribute.cs : Fix incorrect code which relied on catching
17323         a NullReferenceException to detect a null being passed in
17324         where an object was expected.
17325
17326 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17327
17328         * statement.cs (Try): flag the catch variable as assigned
17329
17330         * expression.cs (Cast): Simplified by using ResolveType instead of
17331         manually resolving.
17332
17333         * statement.cs (Catch): Fix bug by using ResolveType.
17334
17335 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17336
17337         * expression.cs (BetterConversion): Special case for when we have
17338         a NullLiteral as the argument and we have to choose between string
17339         and object types - we choose string the way csc does.
17340
17341         * attribute.cs (Attribute.Resolve): Catch the
17342         NullReferenceException and report error #182 since the Mono
17343         runtime no more has the bug and having this exception raised means
17344         we tried to select a constructor which takes an object and is
17345         passed a null.
17346
17347 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17348
17349         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17350         message (1502, 1503) when we can't locate a method after overload
17351         resolution. This is much more informative and closes the bug
17352         Miguel reported.
17353
17354         * interface.cs (PopulateMethod): Return if there are no argument
17355         types. Fixes a NullReferenceException bug.
17356
17357         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17358         expressions too. Previously we were checking only in one place for
17359         positional arguments leaving out named arguments.
17360
17361         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17362         type to the enum type is not allowed. Remove code corresponding to
17363         that.
17364
17365         (ConvertNumericExplicit): Allow explicit conversions from
17366         the underlying type to enum type. This precisely follows the spec
17367         and closes a bug filed by Gonzalo.
17368
17369 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17370
17371         * compiler.csproj:
17372         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17373
17374 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17375
17376         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17377         it was important that we stored the right value after the
17378         reduction in `converted'.
17379
17380 2002-09-04  Martin Baulig  <martin@gnome.org>
17381
17382         * location.cs (Location.SymbolDocument): Use full pathnames for the
17383         source files.
17384
17385 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17386
17387         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17388         of the expression resolve mechanism, because that will catch the
17389         SimpleName error failures.
17390
17391         (Conditional): If we can not resolve the
17392         expression, return, do not crash.
17393
17394 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17395
17396         * cs-tokenizer.cs:
17397         (location): display token name instead of its number.
17398
17399 2002-08-28  Martin Baulig  <martin@gnome.org>
17400
17401         * expression.cs (Binary.ResolveOperator): Don't silently return
17402         but return an error if an operator cannot be applied between two
17403         enum types.
17404
17405 2002-08-28  Martin Baulig  <martin@gnome.org>
17406
17407         * class.cs (Constructor.Define): Set the permission attributes
17408         correctly instead of making all constructors public.
17409
17410 2002-08-28  Martin Baulig  <martin@gnome.org>
17411
17412         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17413         for private members before reporting a CS0103; if we find anything,
17414         it's a CS0122.
17415
17416 2002-08-28  Martin Baulig  <martin@gnome.org>
17417
17418         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17419         to check whether `closure_start_type == closure_invocation_type',
17420         we also need to check whether `m.DeclaringType == closure_invocation_type'
17421         before bypassing the permission checks.  We might be accessing
17422         protected/private members from the base class.
17423         (TypeManager.RealMemberLookup): Only set private_ok if private
17424         members were requested via BindingFlags.NonPublic.
17425
17426         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17427
17428         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17429         MethodGroupExpr.IsExplicitImpl if appropriate.
17430         (Invocation.DoResolve): Don't report the CS0120 for explicit
17431         interface implementations.
17432
17433 2002-08-27  Martin Baulig  <martin@gnome.org>
17434
17435         * expression.cs (Invocation.DoResolve): If this is a static
17436         method and we don't have an InstanceExpression, we must report
17437         a CS0120.
17438
17439 2002-08-25  Martin Baulig  <martin@gnome.org>
17440
17441         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17442         `==' between a valuetype and an object.
17443
17444 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17445
17446         * ecore.cs (TypeExpr): Provide a ToString method.
17447
17448 2002-08-24  Martin Baulig  <martin@gnome.org>
17449
17450         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17451         now called proggie.dbg and it's a binary file.
17452
17453 2002-08-23  Martin Baulig  <martin@gnome.org>
17454
17455         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17456
17457 2002-08-23  Martin Baulig  <martin@gnome.org>
17458
17459         * struct.cs (MyStructInfo.ctor): Make this work with empty
17460         structs; it's not allowed to use foreach() on null.
17461
17462 2002-08-23  Martin Baulig  <martin@gnome.org>
17463
17464         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17465         writer the full pathname of the generated assembly.
17466
17467 2002-08-23  Martin Baulig  <martin@gnome.org>
17468
17469         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17470         A `finally' block never returns or breaks; improved handling of
17471         unreachable code.
17472
17473 2002-08-23  Martin Baulig  <martin@gnome.org>
17474
17475         * statement.cs (Throw.Resolve): Allow `throw null'.
17476
17477 2002-08-23  Martin Baulig  <martin@gnome.org>
17478
17479         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17480         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17481         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17482         MemberLookup would return a wrong event if this is an explicit
17483         interface implementation and the class has an event with the same
17484         name.
17485
17486 2002-08-23  Martin Baulig  <martin@gnome.org>
17487
17488         * statement.cs (Block.AddChildVariableNames): New public method.
17489         (Block.AddChildVariableName): Likewise.
17490         (Block.IsVariableNameUsedInChildBlock): Likewise.
17491         (Block.AddVariable): Check whether a variable name has already
17492         been used in a child block.
17493
17494         * cs-parser.jay (declare_local_variables): Mark all variable names
17495         from the current block as being used in a child block in the
17496         implicit block.
17497
17498 2002-08-23  Martin Baulig  <martin@gnome.org>
17499
17500         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17501         find the symbol writer.
17502
17503         * driver.cs: csc also allows the arguments to /define being
17504         separated by commas, not only by semicolons.
17505
17506 2002-08-23  Martin Baulig  <martin@gnome.org>
17507
17508         * interface.cs (Interface.GetMembers): Added static check for events.
17509
17510 2002-08-15  Martin Baulig  <martin@gnome.org>
17511
17512         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17513         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17514
17515         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17516         why the MethodData.EmitDestructor() change was necessary.
17517
17518 2002-08-20  Martin Baulig  <martin@gnome.org>
17519
17520         * class.cs (TypeContainer.FindMembers): Added static check for events.
17521
17522         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17523
17524         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17525         use Type.GetEvents(), not Type.FindMembers().
17526
17527 2002-08-20  Martin Baulig  <martin@gnome.org>
17528
17529         * decl.cs (MemberCache): Added a special method cache which will
17530         be used for method-only searched.  This ensures that a method
17531         search will return a MethodInfo with the correct ReflectedType for
17532         inherited methods.      
17533
17534 2002-08-20  Martin Baulig  <martin@gnome.org>
17535
17536         * decl.cs (DeclSpace.FindMembers): Made this public.
17537
17538 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17539
17540         * delegate.cs: fixed build on windows.
17541         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17542
17543 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17544
17545         * ecore.cs (StandardConversionExists): Return a false
17546         if we are trying to convert the void type to anything else
17547         since that is not allowed.
17548
17549         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17550         we flag error 70 in the event an event is trying to be accessed
17551         directly from outside the declaring type.
17552
17553 2002-08-20  Martin Baulig  <martin@gnome.org>
17554
17555         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17556         MemberCache from typemanager.cs to decl.cs.
17557
17558 2002-08-19  Martin Baulig  <martin@gnome.org>
17559
17560         * class.cs (TypeContainer): Implement IMemberContainer.
17561         (TypeContainer.DefineMembers): Create the MemberCache.
17562         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17563         return public members if BindingFlags.Public was given, check
17564         whether members are static.
17565
17566 2002-08-16  Martin Baulig  <martin@gnome.org>
17567
17568         * decl.cs (DeclSpace.Define): Splitted this in Define and
17569         DefineMembers.  DefineMembers is called first and initializes the
17570         MemberCache.
17571
17572         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17573         DefineMembers() on all our DeclSpaces.
17574
17575         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17576         but call DefineMembers() on all nested interfaces.  We call their
17577         Define() in our new Define() function.
17578
17579         * interface.cs (Interface): Implement IMemberContainer.
17580         (Interface.Define): Moved all code except the attribute stuf to
17581         DefineMembers().
17582         (Interface.DefineMembers): Initialize the member cache.
17583
17584         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17585         need this anymore since we can use MemberCache.FindMembers directly.
17586
17587 2002-08-19  Martin Baulig  <martin@gnome.org>
17588
17589         * typemanager.cs (MemberCache): When creating the cache for an
17590         interface type, add all inherited members.
17591         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17592         to `out bool used_cache' and documented it.
17593         (TypeManager.MemberLookup): If we already used the cache in the first
17594         iteration, we don't need to do the interfaces check.
17595
17596 2002-08-19  Martin Baulig  <martin@gnome.org>
17597
17598         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17599         here from IMemberFinder and don't implement this interface anymore.
17600         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17601
17602         * typemanager.cs (IMemberFinder): This interface is now only used by
17603         classes which actually support the member cache.
17604         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17605         since we only put DeclSpaces into this Hashtable.
17606         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17607         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17608
17609 2002-08-16  Martin Baulig  <martin@gnome.org>
17610
17611         * typemanager.cs (ICachingMemberFinder): Removed.
17612         (IMemberFinder.MemberCache): New property.
17613         (TypeManager.FindMembers): Merged this with RealFindMembers().
17614         This function will never be called from TypeManager.MemberLookup()
17615         so we can't use the cache here, just the IMemberFinder.
17616         (TypeManager.MemberLookup_FindMembers): Check whether the
17617         IMemberFinder has a MemberCache and call the cache's FindMembers
17618         function.
17619         (MemberCache): Rewrote larger parts of this yet another time and
17620         cleaned it up a bit.
17621
17622 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * driver.cs (LoadArgs): Support quoting.
17625
17626         (Usage): Show the CSC-like command line arguments.
17627
17628         Improved a few error messages.
17629
17630 2002-08-15  Martin Baulig  <martin@gnome.org>
17631
17632         * typemanager.cs (IMemberContainer.Type): New property.
17633         (IMemberContainer.IsInterface): New property.
17634
17635         The following changes are conditional to BROKEN_RUNTIME, which is
17636         defined at the top of the file.
17637
17638         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17639         class'es members, but add all members from TypeHandle.ObjectType
17640         if we're an interface.
17641         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17642         is the current type.
17643         (MemberCache.CacheEntry.Container): Removed this field.
17644         (TypeHandle.GetMembers): Include inherited members.
17645
17646 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17647
17648         * typemanager.cs: fixed compilation and added a comment on a field that
17649         is never used.
17650
17651 2002-08-15  Martin Baulig  <martin@gnome.org>
17652
17653         * class.cs (ConstructorInitializer.Resolve): In the
17654         Expression.MemberLookup call, use the queried_type as
17655         invocation_type.
17656
17657         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17658         declared' attribute, it's always true.
17659         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17660         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17661         temporary wrapper for FindMembers which tells MemberLookup whether
17662         members from the base classes are included in the return value.
17663         This will go away soon.
17664         (TypeManager.MemberLookup): Use this temporary hack here; once the
17665         new MemberCache is completed, we don't need to do the DeclaredOnly
17666         looping here anymore since the MemberCache will take care of this.
17667         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17668         (MemberCache): When creating the MemberCache for a class, get
17669         members from the current class and all its base classes.
17670         (MemberCache.CacheEntry.Container): New field.  This is a
17671         temporary hack until the Mono runtime is fixed to distinguish
17672         between ReflectedType and DeclaringType.  It allows us to use MCS
17673         with both the MS runtime and the unfixed Mono runtime without
17674         problems and without accecting performance.
17675         (MemberCache.SearchMembers): The DeclaredOnly looping from
17676         TypeManager.MemberLookup is now done here.      
17677
17678 2002-08-14  Martin Baulig  <martin@gnome.org>
17679
17680         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17681         Type.GetFields on dynamic types but get the fields from the
17682         corresponding TypeContainer.
17683         (MyStructInfo.GetStructInfo): Added check for enum types.
17684
17685         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17686         (MemberList.SyncRoot): Implemented.
17687         (TypeManager.FilterWithClosure): No need to check permissions if
17688         closure_start_type == closure_invocation_type, don't crash if
17689         closure_invocation_type is null.
17690
17691 2002-08-13  Martin Baulig  <martin@gnome.org>
17692
17693         Rewrote TypeContainer.FindMembers to use a member cache.  This
17694         gives us a speed increase of about 35% for the self-hosting MCS
17695         build and of about 15-20% for the class libs (both on GNU/Linux).
17696
17697         * report.cs (Timer): New class to get enhanced profiling.  This
17698         whole class is "TIMER" conditional since it remarkably slows down
17699         compilation speed.
17700
17701         * class.cs (MemberList): New class.  This is an IList wrapper
17702         which we're now using instead of passing MemberInfo[]'s around to
17703         avoid copying this array unnecessarily.
17704         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17705         (ICachingMemberFinder, IMemberContainer): New interface.
17706         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17707         has already been checked, otherwise use it for the name comparision.
17708         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17709         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17710         if possible.  Returns a MemberList, not a MemberInfo [].
17711         (TypeHandle): New class, implements IMemberContainer.  We create
17712         one instance of this class per type, it contains a MemberCache
17713         which is used to do the member lookups.
17714         (MemberCache): New class.  Each instance of this class contains
17715         all members of a type and a name-based hash table.
17716         (MemberCache.FindMembers): This is our new member lookup
17717         function.  First, it looks up all members of the requested name in
17718         the hash table.  Then, it walks this list and sorts out all
17719         applicable members and returns them.
17720
17721 2002-08-13  Martin Baulig  <martin@gnome.org>
17722
17723         In addition to a nice code cleanup, this gives us a performance
17724         increase of about 1.4% on GNU/Linux - not much, but it's already
17725         half a second for the self-hosting MCS compilation.
17726
17727         * typemanager.cs (IMemberFinder): New interface.  It is used by
17728         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17729         Enum, Delegate or Interface.
17730         (TypeManager.finder_to_member_finder): New PtrHashtable.
17731         (TypeManager.finder_to_container): Removed.
17732         (TypeManager.finder_to_delegate): Removed.
17733         (TypeManager.finder_to_interface): Removed.
17734         (TypeManager.finder_to_enum): Removed.
17735
17736         * interface.cs (Interface): Implement IMemberFinder.
17737
17738         * delegate.cs (Delegate): Implement IMemberFinder.
17739
17740         * enum.cs (Enum): Implement IMemberFinder.
17741
17742         * class.cs (TypeContainer): Implement IMemberFinder.
17743
17744 2002-08-12  Martin Baulig  <martin@gnome.org>
17745
17746         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17747
17748 2002-08-12  Martin Baulig  <martin@gnome.org>
17749
17750         * ecore.cs (ITypeExpression): New interface for expressions which
17751         resolve to a type.
17752         (TypeExpression): Renamed to TypeLookupExpression.
17753         (Expression.DoResolve): If we're doing a types-only lookup, the
17754         expression must implement the ITypeExpression interface and we
17755         call DoResolveType() on it.
17756         (SimpleName): Implement the new ITypeExpression interface.
17757         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17758         hack, the situation that we're only looking up types can't happen
17759         anymore when this method is called.  Moved the type lookup code to
17760         DoResolveType() and call it.
17761         (SimpleName.DoResolveType): This ITypeExpression interface method
17762         is now doing the types-only lookup.
17763         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17764         (ResolveFlags): Added MaskExprClass.
17765
17766         * expression.cs (MemberAccess): Implement the ITypeExpression
17767         interface.
17768         (MemberAccess.DoResolve): Added support for a types-only lookup
17769         when we're called via ITypeExpression.DoResolveType().
17770         (ComposedCast): Implement the ITypeExpression interface.
17771
17772         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17773         Expression.Resolve() with ResolveFlags.Type instead.
17774
17775 2002-08-12  Martin Baulig  <martin@gnome.org>
17776
17777         * interface.cs (Interface.Define): Apply attributes.
17778
17779         * attribute.cs (Attribute.ApplyAttributes): Added support for
17780         interface attributes.
17781
17782 2002-08-11  Martin Baulig  <martin@gnome.org>
17783
17784         * statement.cs (Block.Emit): Only check the "this" variable if we
17785         do not always throw an exception.
17786
17787         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17788         whether the property has a set accessor.
17789
17790 2002-08-11  Martin Baulig  <martin@gnome.org>
17791
17792         Added control flow analysis support for structs.
17793
17794         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17795         with control flow analysis turned off.
17796         (IVariable): New interface.
17797         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17798         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17799         (FieldExpr.DoResolve): Resolve the instance expression with flow
17800         analysis turned off and do the definite assignment check after the
17801         resolving when we know what the expression will resolve to.
17802
17803         * expression.cs (LocalVariableReference, ParameterReference):
17804         Implement the new IVariable interface, only call the flow analysis
17805         code if ec.DoFlowAnalysis is true.
17806         (This): Added constructor which takes a Block argument.  Implement
17807         the new IVariable interface.
17808         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17809         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17810         This does the definite assignment checks for struct members.
17811
17812         * class.cs (Constructor.Emit): If this is a non-static `struct'
17813         constructor which doesn't have any initializer, call
17814         Block.AddThisVariable() to tell the flow analysis code that all
17815         struct elements must be initialized before control returns from
17816         the constructor.
17817
17818         * statement.cs (MyStructInfo): New public class.
17819         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17820         argument to this indexer.  If non-zero, check an individual struct
17821         member, not the whole struct.
17822         (FlowBranching.CheckOutParameters): Check struct members.
17823         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17824         overloaded versions of these methods which take an additional
17825         `int field_idx' argument to check struct members.
17826         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17827         overloaded versions of these methods which take an additional
17828         `string field_name' argument to check struct member.s
17829         (VariableInfo): Implement the IVariable interface.
17830         (VariableInfo.StructInfo): New public property.  Returns the
17831         MyStructInfo instance of the variable if it's a struct or null.
17832         (Block.AddThisVariable): New public method.  This is called from
17833         Constructor.Emit() for non-static `struct' constructor which do
17834         not have any initializer.  It creates a special variable for the
17835         "this" instance variable which will be checked by the flow
17836         analysis code to ensure that all of the struct's fields are
17837         initialized before control returns from the constructor.
17838         (UsageVector): Added support for struct members.  If a
17839         variable/parameter is a struct with N members, we reserve a slot
17840         in the usage vector for each member.  A struct is considered fully
17841         initialized if either the struct itself (slot 0) or all its
17842         members are initialized.
17843
17844 2002-08-08  Martin Baulig  <martin@gnome.org>
17845
17846         * driver.cs (Driver.MainDriver): Only report an error CS5001
17847         if there were no compilation errors.
17848
17849         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17850         `UnsafeContext' property to determine whether the parent is in
17851         unsafe context rather than checking the parent's ModFlags:
17852         classes nested in an unsafe class are unsafe as well.
17853
17854 2002-08-08  Martin Baulig  <martin@gnome.org>
17855
17856         * statement.cs (UsageVector.MergeChildren): Distinguish between
17857         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17858         we return.  Added test17() and test18() to test-154.cs.
17859
17860 2002-08-08  Martin Baulig  <martin@gnome.org>
17861
17862         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17863         Family access, make sure the invoking type isn't a subclass of the
17864         queried type (that'd be a CS1540).
17865
17866         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17867         this method which takes an additional `Type invocation_type'.
17868
17869         * expression.cs (BaseAccess.DoResolve): Use the base type as
17870         invocation and query type.
17871         (MemberAccess.DoResolve): If the lookup failed and we're about to
17872         report a CS0122, try a lookup with the ec.ContainerType - if this
17873         succeeds, we must report a CS1540.
17874
17875 2002-08-08  Martin Baulig  <martin@gnome.org>
17876
17877         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17878         (MethodGroupExpr): Implement the IMemberExpr interface.
17879
17880         * expression (MemberAccess.ResolveMemberAccess): No need to have
17881         any special code for MethodGroupExprs anymore, they're now
17882         IMemberExprs.   
17883
17884 2002-08-08  Martin Baulig  <martin@gnome.org>
17885
17886         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17887         Family, FamANDAssem and FamORAssem permissions.
17888         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17889
17890 2002-08-08  Martin Baulig  <martin@gnome.org>
17891
17892         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17893         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17894         or loop block.
17895
17896 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17897
17898         * driver.cs: implemented /resource option to embed managed resources.
17899
17900 2002-08-07  Martin Baulig  <martin@gnome.org>
17901
17902         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17903         (FieldBase.HasFieldInitializer): New public property.
17904         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17905         returns the field initializer and makes sure it is only resolved once.
17906         (TypeContainer.EmitFieldInitializers): Call
17907         FieldBase.GetInitializerExpression to get the initializer, this ensures
17908         that it isn't resolved multiple times.
17909
17910         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17911         the resolving process (SimpleName/MemberLookup) that we're currently
17912         emitting a field initializer (which must not access any instance members,
17913         this is an error CS0236).
17914
17915         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17916         argument, if the `IsFieldInitializer' flag is set, we must report and
17917         error CS0236 and not an error CS0120.   
17918
17919 2002-08-07  Martin Baulig  <martin@gnome.org>
17920
17921         * ecore.cs (IMemberExpr): New public interface.
17922         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17923         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17924         if the expression is an IMemberExpr.
17925
17926         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17927         to be null, implicitly default to `this' if we're non-static in
17928         this case.  Simplified the code a lot by using the new IMemberExpr
17929         interface.  Also fixed bug #28176 here.
17930
17931 2002-08-06  Martin Baulig  <martin@gnome.org>
17932
17933         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17934         ParameterReferences during semantic analysis so that we can do a
17935         type-only search when resolving Cast, TypeOf and SizeOf.
17936         (block): Pass the `current_local_parameters' to the Block's
17937         constructor.
17938
17939         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17940         argument to the constructor.
17941         (ConstructorInitializer.Resolve): Create a temporary implicit
17942         block with the parameters.
17943
17944         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17945         references here if we aren't doing a type-only search.
17946
17947         * statement.cs (Block): Added constructor which takes a
17948         `Parameters parameters' argument.
17949         (Block.Parameters): New public property.
17950
17951         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17952         to `Parameters' and made it public readonly.
17953
17954 2002-08-06  Martin Baulig  <martin@gnome.org>
17955
17956         * ecore.cs (Expression.Warning): Made this public as well.
17957
17958         * report.cs (Report.Debug): Print the contents of collections.
17959
17960 2002-08-06  Martin Baulig  <martin@gnome.org>
17961
17962         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
17963         used to tell Resolve() which kinds of expressions it may return.
17964         (Expression.Resolve): Added overloaded version of this method which
17965         takes a `ResolveFlags flags' argument.  This can be used to tell
17966         Resolve() which kinds of expressions it may return.  Reports a
17967         CS0118 on error.
17968         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
17969         ResolveFlags.SimpleName.
17970         (Expression.Error118): Added overloaded version of this method which
17971         takes a `ResolveFlags flags' argument.  It uses the flags to determine
17972         which kinds of expressions are allowed.
17973
17974         * expression.cs (Argument.ResolveMethodGroup): New public method.
17975         Resolves an argument, but allows a MethodGroup to be returned.
17976         This is used when invoking a delegate.
17977
17978         * TODO: Updated a bit.
17979
17980 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17981
17982         Fixed compilation with csc.
17983
17984         * ecore.cs: Expression.Error made public. Is this correct? Should
17985         Warning be made public too?
17986
17987         * expression.cs: use ea.Location instead of ea.loc.
17988         [FIXME:  Filed as bug #28607: MCS must report these errors.]
17989
17990 2002-08-06  Martin Baulig  <martin@gnome.org>
17991
17992         * ecore.cs (Expression.loc): Moved the location here instead of
17993         duplicating it in all derived classes.
17994         (Expression.Location): New public property.
17995         (Expression.Error, Expression.Warning): Made them non-static and
17996         removed the location argument.
17997         (Expression.Warning): Added overloaded version which takes an
17998         `int level' argument.
17999         (Expression.Error118): Make this non-static and removed the
18000         expression and location arguments.
18001         (TypeExpr): Added location argument to the constructor.
18002
18003         * expression.cs (StaticCallExpr): Added location argument to
18004         the constructor.
18005         (Indirection, PointerArithmetic): Likewise.
18006         (CheckedExpr, UnCheckedExpr): Likewise.
18007         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18008         (StringPtr): Likewise.
18009
18010
18011 2002-08-05  Martin Baulig  <martin@gnome.org>
18012
18013         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18014
18015         * assign.cs (Assign.DoResolve): Check whether the source
18016         expression is a value or variable.
18017
18018         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18019         while resolving the corresponding blocks.
18020
18021         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18022         an error, don't silently return null.
18023
18024         * statement.cs (Block.AddVariable): Do the error reporting here
18025         and distinguish between CS0128 and CS0136.
18026         (Block.DoResolve): Report all unused labels (warning CS0164).
18027         (LabeledStatement): Pass the location to the constructor.
18028         (LabeledStatement.HasBeenReferenced): New property.
18029         (LabeledStatement.Resolve): Set it to true here.
18030
18031         * statement.cs (Return.Emit): Return success even after reporting
18032         a type mismatch error (CS0126 or CS0127), this is what csc does and
18033         it avoids confusing the users with any consecutive errors.
18034
18035 2002-08-05  Martin Baulig  <martin@gnome.org>
18036
18037         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18038
18039         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18040
18041         * expression.cs (MemberAccess.DoResolve): Silently return if an
18042         error has already been reported.
18043
18044         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18045         error has already been reported.
18046
18047 2002-08-05  Martin Baulig  <martin@gnome.org>
18048
18049         * statement.cs (UsageVector): Only initialize the `parameters'
18050         vector if we actually have any "out" parameters.
18051
18052 2002-08-05  Martin Baulig  <martin@gnome.org>
18053
18054         * expression.cs (Binary.ResolveOperator): When combining delegates,
18055         they must have the same type.
18056
18057 2002-08-05  Martin Baulig  <martin@gnome.org>
18058
18059         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18060         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18061         work with the ms runtime and we also don't need it: if we're a
18062         PropertyBuilder and not in the `indexer_arguments' hash, then we
18063         are a property and not an indexer.
18064
18065         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18066         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18067         since the latter one doesn't work with the ms runtime.
18068
18069 2002-08-03  Martin Baulig  <martin@gnome.org>
18070
18071         Fixed bugs #27998 and #22735.
18072
18073         * class.cs (Method.IsOperator): New public field.
18074         (Method.CheckBase): Report CS0111 if there's already a method
18075         with the same parameters in the current class.  Report CS0508 when
18076         attempting to change the return type of an inherited method.
18077         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18078         and it's not marked abstract or extern.
18079         (PropertyBase): New abstract base class for Property and Indexer.
18080         (PropertyBase.CheckBase): Moved here from Property and made it work
18081         for indexers.
18082         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18083         the same so we can reuse it there.
18084         (Property, Indexer): Derive from PropertyBase.
18085         (MethodSignature.inheritable_property_signature_filter): New delegate
18086         to find properties and indexers.
18087
18088         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18089         argument and improved error reporting.
18090
18091         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18092         EmptyReadOnlyParameters and made it a property.
18093
18094         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18095         version of this method which takes a `PropertyInfo indexer'.
18096         (TypeManager.RegisterIndexer): New method.
18097
18098         * class.cs: Added myself as author of this file :-)
18099
18100 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18101
18102         * class.cs: fixed compilation on windoze.
18103
18104 2002-08-03  Martin Baulig  <martin@gnome.org>
18105
18106         * interface.cs (Interface.GetInterfaceBases): Check whether all
18107         base interfaces are at least as accessible than the current one.
18108
18109         * class.cs (TypeContainer.GetClassBases): Check whether base types
18110         are at least as accessible than the current type.
18111         (TypeContainer.AsAccessible): Implemented and made non-static.
18112         (MemberBase.CheckParameters): Report errors if the accessibility
18113         checks fail.
18114
18115         * delegate.cs (Delegate.Delegate): The default visibility is
18116         internal for top-level types and private for nested types.
18117         (Delegate.Define): Report errors if the accessibility checks fail.
18118
18119         * enum.cs (Enum.Enum): The default visibility is internal for
18120         top-level types and private for nested types.
18121         (Enum.DefineType): Compute the correct visibility.
18122
18123         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18124         function which takes a `bool is_toplevel' instead of a TypeContainer.
18125
18126         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18127         builtin type.
18128
18129 2002-08-02  Martin Baulig  <martin@gnome.org>
18130
18131         * expression.cs (LocalVariableReferenc): Added constructor which
18132         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18133         (LocalVariableReference.IsReadOnly): New property.
18134         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18135         variable is readonly, use our own readonly flag to do this; you can
18136         use the new constructor to get a writable reference to a read-only
18137         variable.
18138
18139         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18140         reference to the local variable.
18141
18142 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18143
18144         * rootcontext.cs (ResolveCore): Also include System.Exception
18145
18146         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18147         we reach an EmptyStatement.
18148
18149         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18150         is also fine.
18151
18152         * expression.cs (Binary.ResolveOperator): Check error result in
18153         two places.
18154
18155         use brtrue/brfalse directly and avoid compares to null.
18156
18157 2002-08-02  Martin Baulig  <martin@gnome.org>
18158
18159         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18160         Fixes bug #28407, added test-155.cs.
18161
18162 2002-08-01  Martin Baulig  <martin@gnome.org>
18163
18164         * class.cs (Event.EmitDefaultMethod): Make this work with static
18165         events.  Fixes #28311, added verify-3.cs.
18166
18167 2002-08-01  Martin Baulig  <martin@gnome.org>
18168
18169         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18170         `is_disposable' fields.
18171         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18172         `hm.is_disposable' if we're using the collection pattern.
18173         (Foreach.EmitCollectionForeach): Use the correct type for the
18174         enumerator's local variable, only emit the try/finally block if
18175         necessary (fixes #27713).
18176
18177 2002-08-01  Martin Baulig  <martin@gnome.org>
18178
18179         * ecore.cs (Expression.report118): Renamed to Error118 and made
18180         it public static.
18181
18182         * statement.cs (Throw.Resolve): Check whether the expression is of
18183         the correct type (CS0118) and whether the type derives from
18184         System.Exception (CS0155).
18185         (Catch.Resolve): New method.  Do the type lookup here and check
18186         whether it derives from System.Exception (CS0155).
18187         (Catch.CatchType, Catch.IsGeneral): New public properties.
18188
18189         * typemanager.cs (TypeManager.exception_type): Added.
18190
18191 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18192
18193         * driver.cs: Updated About function.
18194
18195 2002-07-31  Martin Baulig  <martin@gnome.org>
18196
18197         Implemented Control Flow Analysis.
18198
18199         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18200         (EmitContext.CurrentBranching): Added.
18201         (EmitContext.StartFlowBranching): Added.
18202         (EmitContext.EndFlowBranching): Added.
18203         (EmitContext.KillFlowBranching): Added.
18204         (EmitContext.IsVariableAssigned): Added.
18205         (EmitContext.SetVariableAssigned): Added.
18206         (EmitContext.IsParameterAssigned): Added.
18207         (EmitContext.SetParameterAssigned): Added.
18208         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18209         Added control flow analysis stuff here.
18210
18211         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18212         resolve the expression as lvalue.
18213         (LocalVariableReference.DoResolve): Check whether the variable has
18214         already been assigned.
18215         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18216         the parameter as assigned here.
18217         (ParameterReference.DoResolve): Check whether the parameter has already
18218         been assigned.
18219         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18220         expression as lvalue.
18221
18222         * statement.cs (FlowBranching): New class for the flow analysis code.
18223         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18224         (LabeledStatement.IsDefined): New public property.
18225         (LabeledStatement.AddUsageVector): New public method to tell flow
18226         analyis that the label may be reached via a forward jump.
18227         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18228         flow analysis.
18229         (VariableInfo.Number): New public field.  This is used by flow analysis
18230         to number all locals of a block.
18231         (Block.CountVariables): New public property.  This is the number of
18232         local variables in this block (including the locals from all parent
18233         blocks).
18234         (Block.EmitMeta): Number all the variables.
18235
18236         * statement.cs: Added flow analysis support to all classes.
18237
18238 2002-07-31  Martin Baulig  <martin@gnome.org>
18239
18240         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18241         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18242         then use this argument.
18243
18244         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18245
18246         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18247         use this to specify /define options.
18248
18249 2002-07-29  Martin Baulig  <martin@gnome.org>
18250
18251         * statement.cs (Fixed): Moved all code that does variable lookups
18252         and resolvings from Emit to Resolve.
18253
18254         * statement.cs (For): Moved all code that does variable lookups
18255         and resolvings from Emit to Resolve.
18256
18257         * statement.cs (Using): Moved all code that does variable lookups
18258         and resolvings from Emit to Resolve.
18259
18260 2002-07-29  Martin Baulig  <martin@gnome.org>
18261
18262         * attribute.cs (Attribute.Resolve): Explicitly catch a
18263         System.NullReferenceException when creating the
18264         CustromAttributeBuilder and report a different warning message.
18265
18266 2002-07-29  Martin Baulig  <martin@gnome.org>
18267
18268         * support.cs (ParameterData.ParameterName): Added method to
18269         get the name of a parameter.
18270
18271         * typemanager.cs (TypeManager.IsValueType): New public method.
18272
18273 2002-07-29  Martin Baulig  <martin@gnome.org>
18274
18275         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18276         is a flag which specifies that it's either ref or out.
18277         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18278         the out parameter to `out Parameter.Modifier mod', also set the
18279         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18280
18281         * support.cs (InternalParameters.ParameterModifier): Distinguish
18282         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18283         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18284
18285         * expression.cs (Argument.GetParameterModifier): Distinguish
18286         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18287         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18288
18289 2002-07-29  Martin Baulig  <martin@gnome.org>
18290
18291         * expression.cs (ParameterReference.ParameterReference): Added
18292         `Location loc' argument to the constructor.
18293
18294         * cs-parser.jay: Pass location to ParameterReference.
18295
18296 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18297
18298         * statement.cs (Try): Initialize the location.
18299
18300         * cs-parser.jay: pass location to Try.
18301
18302         * expression.cs (Unary.Reduce): Change the prototype to return
18303         whether a constant fold could be performed or not.  The result is
18304         returned in an out parameters.  In the case of Indirection and
18305         AddressOf, we want to perform the full tests.
18306
18307 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18308
18309         * statement.cs (Statement.Emit): Flag dead code.
18310
18311 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18312
18313         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18314
18315 2002-07-27  Martin Baulig  <martin@gnome.org>
18316
18317         * class.cs (MethodData.Define): Put back call to
18318         TypeManager.AddMethod(), accidentally commented this out.
18319
18320         * report.cs (Debug): New public method to print debugging information,
18321         this is `[Conditional ("DEBUG")]'.
18322
18323 2002-07-26  Martin Baulig  <martin@gnome.org>
18324
18325         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18326         (switch_statement): Push the current_block to the switch_stack and
18327         pop it again when we're done with the switch.
18328         (switch_section): The new block is a child of the current_block.
18329         Fixes bug #24007, added test-152.cs.
18330
18331 2002-07-27  Martin Baulig  <martin@gnome.org>
18332
18333         * expression.cs (Invocation.EmitArguments): When calling a varargs
18334         function with only its fixed arguments, we need to pass an empty
18335         array.
18336
18337 2002-07-27  Martin Baulig  <martin@gnome.org>
18338
18339         Mono 0.13 has been released.
18340
18341 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18342
18343         * driver.cs: Rename --resource to --linkres, because that is what
18344         we do currently, we dont support --resource yet.
18345
18346         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18347
18348 2002-07-25  Martin Baulig  <martin@gnome.org>
18349
18350         * class.cs (MethodData): New public class.  This is a `method builder'
18351         class for a method or one accessor of a Property/Indexer/Event.
18352         (MethodData.GetMethodFlags): Moved here from MemberBase.
18353         (MethodData.ApplyAttributes): Likewise.
18354         (MethodData.ApplyObsoleteAttribute): Likewise.
18355         (MethodData.ApplyConditionalAttribute): Likewise.
18356         (MethodData.ApplyDllImportAttribute): Likewise.
18357         (MethodData.CheckAbstractAndExternal): Likewise.
18358         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18359         (MethodData.Emit): Formerly known as Method.Emit().
18360         (MemberBase): Moved everything which was specific to a single
18361         accessor/method to MethodData.
18362         (Method): Create a new MethodData and call Define() and Emit() on it.
18363         (Property, Indexer, Event): Create a new MethodData objects for each
18364         accessor and call Define() and Emit() on them.
18365
18366 2002-07-25  Martin Baulig  <martin@gnome.org>
18367
18368         Made MethodCore derive from MemberBase to reuse the code from there.
18369         MemberBase now also checks for attributes.
18370
18371         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18372         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18373         as virtual.
18374         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18375         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18376         (MemberBase.ApplyAttributes): New virtual method; applies the
18377         attributes to a method or accessor.
18378         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18379         (MemberBase.ApplyConditionalAttribute): Likewise.
18380         (MemberBase.ApplyDllImportAttribute): Likewise.
18381         (MemberBase.CheckAbstractAndExternal): Likewise.
18382         (MethodCore.ParameterTypes): This is now a property instead of a
18383         method, it's initialized from DoDefineParameters().
18384         (MethodCore.ParameterInfo): Removed the set accessor.
18385         (MethodCore.DoDefineParameters): New protected virtual method to
18386         initialize ParameterTypes and ParameterInfo.
18387         (Method.GetReturnType): We can now simply return the MemberType.
18388         (Method.GetMethodFlags): Override the MemberBase version and add
18389         the conditional flags.
18390         (Method.CheckBase): Moved some code from Define() here, call
18391         DoDefineParameters() here.
18392         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18393         here to avoid some larger code duplication.
18394         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18395         ensure that abstract and external accessors don't declare a body.
18396
18397         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18398         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18399         lookup in the attribute's parent classes, so we need to abort as soon
18400         as we found the first match.
18401         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18402         the attribute has no arguments.
18403
18404         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18405         of a Method.
18406
18407 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18408
18409         * cs-parser.jay: reverted previous patch.
18410
18411 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18412
18413         * cs-parser.jay: fixed bug #22119.
18414
18415 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18416
18417         * attribute.cs: fixed compilation. The error was:
18418         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18419         be assigned to before control leaves the current method."
18420         [FIXME:  Filed as bug #28186: MCS must report this error.]
18421
18422 2002-07-25  Martin Baulig  <martin@gnome.org>
18423
18424         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18425         method to pull the condition name ouf of a Conditional attribute.
18426         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18427         the obsolete message and error flag out of an Obsolete attribute.
18428
18429         * class.cs (Method.GetMethodFlags): New public method to get the
18430         TypeManager.MethodFlags for this method.
18431         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18432         private methods.
18433         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18434         if we're overriding a virtual function, set the new private variable
18435         `parent_method'; call the new TypeManager.AddMethod().
18436
18437         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18438         the MethodBuilder and the Method in a PtrHashtable.
18439         (TypeManager.builder_to_method): Added for this purpose.
18440         (TypeManager.MethodFlags): Added IsObsoleteError.
18441         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18442         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18443         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18444         the message from the attribute.
18445
18446 2002-07-24  Martin Baulig  <martin@gnome.org>
18447
18448         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18449         preprocessor directives, ensure that the argument to #define/#undef is
18450         exactly one identifier and that it's actually an identifier.
18451
18452         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18453         did not work ....
18454
18455 2002-07-24  Martin Baulig  <martin@gnome.org>
18456
18457         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18458         initialize it to TypeManager.object_type in the constructor.
18459         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18460         of the `hm.get_current' method if we're using the collection pattern.
18461         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18462         for the explicit conversion to make it work when we're using the collection
18463         pattern and the `Current' property has a different return type than `object'.
18464         Fixes #27713.
18465
18466 2002-07-24  Martin Baulig  <martin@gnome.org>
18467
18468         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18469         does not match, but don't report any errors.  This method is called in
18470         order for all methods in a MethodGroupExpr until a matching method is
18471         found, so we don't want to bail out if the first method doesn't match.
18472         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18473         matches, report the 123.  Fixes #28070.
18474
18475 2002-07-24  Martin Baulig  <martin@gnome.org>
18476
18477         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18478         TypeManager.TypeToCoreType() to the top of the method so the
18479         following equality checks will work.  Fixes #28107.
18480
18481 2002-07-24  Martin Baulig  <martin@gnome.org>
18482
18483         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18484         operand is of type uint, and the other operand is of type sbyte,
18485         short or int, the operands are converted to type long." -
18486         Actually do what this comment already told us.  Fixes bug #28106,
18487         added test-150.cs.
18488
18489 2002-07-24  Martin Baulig  <martin@gnome.org>
18490
18491         * class.cs (MethodBase): New abstract class.  This is now a base
18492         class for Property, Indexer and Event to avoid some code duplication
18493         in their Define() and DefineMethods() methods.
18494         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18495         generic methods for Define() and DefineMethods().
18496         (FieldBase): Derive from MemberBase, not MemberCore.
18497         (Property): Derive from MemberBase, not MemberCore.
18498         (Property.DefineMethod): Moved all the code from this method to the
18499         new MethodBase.DefineAccessor(), just call it with appropriate
18500         argumetnts.
18501         (Property.Define): Call the new Property.DoDefine(), this does some
18502         sanity checks and we don't need to duplicate the code everywhere.
18503         (Event): Derive from MemberBase, not MemberCore.
18504         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18505         accessors, this will also make them work with interface events.
18506         (Indexer): Derive from MemberBase, not MemberCore.
18507         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18508         (Indexer.Define): Use the new MethodBase functions.
18509
18510         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18511         argument to the constructor.
18512         (Interface.FindMembers): Added support for interface events.
18513         (Interface.PopluateEvent): Implemented.
18514
18515         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18516
18517 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18518
18519         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18520         but this is required to check for a method name being the same as
18521         the containing class.  
18522
18523         Handle this now.
18524
18525 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18526
18527         * interface.cs: initialize variable.
18528
18529 2002-07-23  Martin Baulig  <martin@gnome.org>
18530
18531         Implemented the IndexerName attribute in interfaces.
18532
18533         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18534         name if this is an explicit interface implementation.
18535         (Indexer.InterfaceIndexerName): New public variable.  If we're
18536         implementing an interface indexer, this is the IndexerName in that
18537         interface.  Otherwise, it's the IndexerName.
18538         (Indexer.DefineMethod): If we're implementing interface indexer,
18539         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18540         and Pending.ImplementIndexer methods.
18541         (Indexer.Define): Also define the PropertyBuilder if we're
18542         implementing an interface indexer and this is neither an explicit
18543         interface implementation nor do the IndexerName match the one in
18544         the interface.
18545
18546         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18547         If a method is defined here, then we always need to create a proxy
18548         for it.  This is used when implementing interface indexers.
18549         (Pending.IsInterfaceIndexer): New public method.
18550         (Pending.ImplementIndexer): New public method.
18551         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18552         This is used when implementing interface indexers to define a proxy
18553         if necessary.
18554         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18555         define a proxy if necessary.
18556
18557         * interface.cs (Interface.IndexerName): New public variable.
18558         (Interface.PopulateIndexer): Set the IndexerName.
18559         (Interface.DefineIndexers): New private method.  Populate all the
18560         indexers and make sure their IndexerNames match.
18561
18562         * typemanager.cs (IndexerPropertyName): Added support for interface
18563         indexers.
18564
18565 2002-07-22  Martin Baulig  <martin@gnome.org>
18566
18567         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18568         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18569         ret if HasReturnLabel.
18570         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18571         variables.
18572
18573         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18574         and set the ec.LoopBeginTryCatchLevel.
18575         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18576         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18577         the current ec.TryCatchLevel, the branch goes out of an exception
18578         block.  In this case, we need to use Leave and not Br.
18579
18580 2002-07-22  Martin Baulig  <martin@gnome.org>
18581
18582         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18583         block unless the block does not always return or it is contained in
18584         another try { ... } catch { ... } block.  Fixes bug #26506.
18585         Added verify-1.cs to the test suite.
18586
18587 2002-07-22  Martin Baulig  <martin@gnome.org>
18588
18589         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18590         then we do not always return.  Fixes bug #24985.
18591
18592 2002-07-22  Martin Baulig  <martin@gnome.org>
18593
18594         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18595         lookup on a per-class level; ie. walk up the class hierarchy until we
18596         found at least one applicable method, then choose the best among them.
18597         Fixes bug #24463 and test-29.cs.
18598
18599 2002-07-22  Martin Baulig  <martin@gnome.org>
18600
18601         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18602         return types of the methods.  The return type is not part of the
18603         signature and we must not check it to make the `new' modifier work.
18604         Fixes bug #27999, also added test-147.cs.
18605         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18606
18607         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18608         on the method's return type.
18609
18610 2002-07-21  Martin Baulig  <martin@gnome.org>
18611
18612         * assign.cs: Make this work if the rightmost source is a constant and
18613         we need to do an implicit type conversion.  Also adding a few more tests
18614         to test-38.cs which should have caught this.
18615
18616         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18617         target in the makefile for this.  The makefile.gnu is primarily intended
18618         for end-users who don't want to debug the compiler.
18619
18620 2002-07-21  Martin Baulig  <martin@gnome.org>
18621
18622         * assign.cs: Improved the Assign class so it can now handle embedded
18623         assignments (X = Y = Z = something).  As a side-effect this'll now also
18624         consume less local variables.  test-38.cs now passes with MCS, added
18625         a few new test cases to that test.
18626
18627 2002-07-20  Martin Baulig  <martin@gnome.org>
18628
18629         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18630         instructions.  Fixes bug #27977, also added test-146.cs.
18631
18632 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18633
18634         * cs-tokenizer.cs: fixed getHex ().
18635
18636 2002-07-19  Martin Baulig  <martin@gnome.org>
18637
18638         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18639         not Type.GetType() to lookup the array type.  This is needed when
18640         we're constructing an array of a user-defined type.
18641         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18642         single-dimensional arrays, but also for single-dimensial arrays of
18643         type decimal.
18644
18645 2002-07-19  Martin Baulig  <martin@gnome.org>
18646
18647         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18648         this function is called, it's not allowed to share LocalBuilders
18649         among ILGenerators.
18650
18651 2002-07-19  Martin Baulig  <martin@gnome.org>
18652
18653         * expression.cs (Argument.Resolve): Report an error 118 when trying
18654         to pass a type as argument.
18655
18656 2002-07-18  Martin Baulig  <martin@gnome.org>
18657
18658         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18659         Conv_R_Un for the signed `long' type.
18660
18661 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18662
18663         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18664         `expr' for the temporary result, as that will fail if we do
18665         multiple resolves on the same expression.
18666
18667 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18668
18669         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18670         ec.TypeContainer for looking up aliases. 
18671
18672         * class.cs (TypeContainer): Remove LookupAlias from here.
18673
18674         * decl.cs (DeclSpace); Move here.
18675
18676 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18677
18678         * class.cs (FindMembers): Only call filter if the constructor
18679         bulider is not null.
18680
18681         Also handle delegates in `NestedTypes' now.  Now we will perform
18682         type lookups using the standard resolution process.  This also
18683         fixes a bug.
18684
18685         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18686         This uses Expressions (the limited kind that can be parsed by the
18687         tree) instead of strings.
18688
18689         * expression.cs (ComposedCast.ToString): Implement, used to flag
18690         errors since now we have to render expressions.
18691
18692         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18693         FormArrayType. 
18694
18695         * ecore.cs (SimpleName.ToString): ditto.
18696
18697         * cs-parser.jay: Instead of using strings to assemble types, use
18698         Expressions to assemble the type (using SimpleName, ComposedCast,
18699         MemberAccess).  This should fix the type lookups in declarations,
18700         because we were using a different code path for this.
18701
18702         * statement.cs (Block.Resolve): Continue processing statements
18703         even when there is an error.
18704
18705 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18706
18707         * class.cs (Event.Define): Also remove the `remove' method from
18708         the list of pending items.
18709
18710         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18711         generate more compact code. 
18712
18713 2002-07-17  Martin Baulig  <martin@gnome.org>
18714
18715         * const.cs (Const.LookupConstantValue): Add support for constant
18716         `unchecked' and `checked' expressions.
18717         Also adding test case test-140.cs for this.
18718
18719 2002-07-17  Martin Baulig  <martin@gnome.org>
18720
18721         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18722         check whether mi.ReturnType implements the IEnumerator interface; the
18723         `==' and the IsAssignableFrom() will fail in this situation.
18724
18725 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18726
18727         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18728         here too.
18729
18730 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18731
18732         * expression.cs: fixed bug #27811.
18733
18734 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18735
18736         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18737         Molaro: when we are a ref, the value already contains a pointer
18738         value, do not take the address of it.
18739
18740 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18741         * removed mb-parser.jay and mb-tokenizer.cs
18742
18743 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18744
18745         * expression.cs: check against the building corlib void type.
18746
18747 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18748
18749         * ecore.cs: fix for valuetype static readonly fields: when 
18750         initializing them, we need their address, not the address of a copy.
18751
18752 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18753
18754         * typemanager.cs: register also enum_type in corlib.
18755
18756 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18757
18758         * class.cs: allow calling this (but not base) initializers in structs.
18759
18760 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18761
18762         * ecore.cs: make sure we compare against the building base types
18763         in GetTypeSize ().
18764
18765 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18766
18767         * typemanager.cs: fix TypeToCoreType() to handle void and object
18768         (corlib gets no more typerefs after this change).
18769
18770 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18771
18772         * expression.cs (ArrayCreation.EmitArrayArguments): use
18773         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18774
18775         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18776         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18777         array indexes, the runtime actually forbids them.
18778
18779         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18780         for array arguments here.
18781
18782         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18783         instead of the default for ValueTypes.
18784
18785         (New.DoEmit): Use IsValueType instead of
18786         IsSubclassOf (value_type)
18787         (New.DoResolve): ditto.
18788         (Invocation.EmitCall): ditto.
18789
18790         * assign.cs (Assign): ditto.
18791
18792         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18793         Statements *are* currently doing part of their resolution during
18794         Emit.  
18795
18796         Expressions do always resolve during resolve, but statements are
18797         only required to propagate resolution to their children.
18798
18799 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18800
18801         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18802
18803         (LoadAssembly): Do not add the dll if it is already specified
18804
18805         (MainDriver): Add the System directory to the link path at the end,
18806         after all the other -L arguments. 
18807
18808         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18809         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18810         ldelem.u1) and using the opposite for sbytes.
18811
18812         This fixes Digger, and we can finally run it.
18813
18814         * driver.cs (UnixParseOption): Move the option parsing here.  
18815         (CSCParseOption): Implement CSC-like parsing of options.
18816
18817         We now support both modes of operation, the old Unix way, and the
18818         new CSC-like way.  This should help those who wanted to make cross
18819         platform makefiles.
18820
18821         The only thing broken is that /r:, /reference: and /lib: are not
18822         implemented, because I want to make those have the same semantics
18823         as the CSC compiler has, and kill once and for all the confussion
18824         around this.   Will be doing this tomorrow.
18825
18826         * statement.cs (Unsafe.Resolve): The state is checked during
18827         resolve, not emit, so we have to set the flags for IsUnsfe here.
18828
18829 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18830
18831         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18832         not catch the Error_ObjectRefRequired in SimpleName (as it is
18833         possible to have a class/instance variable name that later gets
18834         deambiguated), we have to check this here.      
18835
18836 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18837
18838         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18839         make static and put into Expression.
18840
18841         (Event.Define): Register the private field of the event with the 
18842         TypeManager so that GetFieldFromEvent can get at it.
18843
18844         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18845         keep track of the private field associated with an event which
18846         has no accessors.
18847
18848         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18849         private field.
18850
18851         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18852
18853 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18854
18855         * expression.cs (Binary.EmitBranchable): this routine emits the
18856         Binary expression in a branchable context.  This basically means:
18857         we need to branch somewhere, not just get the value on the stack.
18858
18859         This works together with Statement.EmitBoolExpression.
18860
18861         * statement.cs (Statement.EmitBoolExpression): Use
18862         EmitBranchable. 
18863
18864 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18865
18866         * statement.cs (For): Reduce the number of jumps in loops.
18867
18868         (For): Implement loop inversion for the For statement.
18869
18870         (Break): We can be breaking out of a Try/Catch controlled section
18871         (foreach might have an implicit try/catch clause), so we need to
18872         use Leave instead of Br.
18873
18874         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18875         now).  If the instace expression supports IMemoryLocation, we use
18876         the AddressOf method from the IMemoryLocation to extract the
18877         address instead of emitting the instance.
18878
18879         This showed up with `This', as we were emitting the instance
18880         always (Emit) instead of the Address of This.  Particularly
18881         interesting when This is a value type, as we dont want the Emit
18882         effect (which was to load the object).
18883
18884 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18885
18886         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18887
18888         * statement.cs (Checked): Set the CheckedState during the resolve
18889         process too, as the ConvCast operations track the checked state on
18890         the resolve process, and not emit.
18891
18892         * cs-parser.jay (namespace_member_declaration): Flag that we have
18893         found a declaration when we do.  This is used to flag error 1529
18894
18895         * driver.cs: Report ok when we display the help only.
18896
18897 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18898
18899         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18900
18901 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18902
18903         * cs-tokenizer.cs (define): We also have to track locally the
18904         defines.  AllDefines is just used for the Conditional Attribute,
18905         but we also need the local defines for the current source code. 
18906
18907 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18908
18909         * statement.cs (While, For, Do): These loops can exit through a
18910         Break statement, use this information to tell whether the
18911         statement is the last piece of code.
18912
18913         (Break): Flag that we break.
18914
18915         * codegen.cs (EmitContexts): New `Breaks' state variable.
18916
18917 2002-07-03  Martin Baulig  <martin@gnome.org>
18918
18919         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18920         modifiers in method declarations in structs.  Otherwise, you won't
18921         be able to override things like Object.Equals().
18922
18923 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18924
18925         * class.cs (Method, Property, Indexer): Do not allow the public
18926         modifier to be used in explicit interface implementations.
18927
18928         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18929         override modifiers in method declarations in structs
18930
18931 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18932
18933         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18934         integer or real overflow, report an error
18935
18936 2002-07-02  Martin Baulig  <martin@gnome.org>
18937
18938         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18939         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18940         to tell the runtime about our newly created System.Object and
18941         System.ValueType types.
18942
18943 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18944
18945         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18946         struct instead of Ldarg/Starg.
18947
18948 2002-07-02  Martin Baulig  <martin@gnome.org>
18949
18950         * expression.cs (Indirection.Indirection): Call
18951         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18952
18953 2002-07-02  Martin Baulig  <martin@gnome.org>
18954
18955         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18956         ValueType, call TypeManager.TypeToCoreType() on it.
18957         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
18958         the OpCodes.Newarr argument.
18959
18960 2002-07-02  Martin Baulig  <martin@gnome.org>
18961
18962         * expression.cs (Invocation.EmitCall): When compiling corlib,
18963         replace all calls to the system's System.Array type to calls to
18964         the newly created one.
18965
18966         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
18967         System.Array methods.
18968         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
18969         from the system's System.Array type which must be replaced.
18970
18971 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
18972
18973         * typemanager.cs: load unverifiable_code_ctor so we can build
18974         corlib using the correct type. Avoid using GetTypeCode() with
18975         TypeBuilders.
18976         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
18977         TypeManager.object_type to allow building corlib.
18978
18979 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
18980
18981         * ecore.cs: handle System.Enum separately in LoadFromPtr().
18982
18983 2002-07-01  Martin Baulig  <martin@gnome.org>
18984
18985         * class.cs: Make the last change actually work, we need to check
18986         whether `ifaces != null' to avoid a crash.
18987
18988 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18989
18990         * class.cs: when we build structs without fields that implement
18991         interfaces, we need to add the interfaces separately, since there is
18992         no API to both set the size and add the interfaces at type creation
18993         time.
18994
18995 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18996
18997         * expression.cs: the dimension arguments to the array constructors
18998         need to be converted if they are a long.
18999
19000 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19001
19002         * class.cs: don't emit ldarg.0 if there is no parent constructor
19003         (fixes showstopper for corlib).
19004
19005 2002-06-29  Martin Baulig  <martin@gnome.org>
19006
19007         MCS now compiles corlib on GNU/Linux :-)
19008
19009         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19010         ie. check for MethodImplOptions.InternalCall.
19011
19012         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19013         and TypeManager.attribute_type are null, so we must explicitly check
19014         whether parent is not null to find out whether it's an attribute type.
19015         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19016         and SetBuilder, not only if the property is neither abstract nor external.
19017         This is necessary to set the MethodImplOptions on the accessor methods.
19018         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19019         SetBuilder, see Property.Emit().
19020
19021         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19022         populate "System.Object", "System.ValueType" and "System.Attribute" since
19023         they've already been populated from BootCorlib_PopulateCoreTypes().
19024
19025 2002-06-29  Martin Baulig  <martin@gnome.org>
19026
19027         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19028         is the NullLiteral, we also need to make sure that target_type is not
19029         an enum type.   
19030
19031 2002-06-29  Martin Baulig  <martin@gnome.org>
19032
19033         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19034         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19035         before calling BootstrapCorlib_ResolveDelegate ().
19036
19037 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19038
19039         * statement.cs: fixed build-breaker. All tests passed ok.
19040
19041 2002-06-27  Martin Baulig  <martin@gnome.org>
19042
19043         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19044         for System.Decimal when compiling corlib.
19045
19046 2002-06-27  Martin Baulig  <martin@gnome.org>
19047
19048         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19049         switch blocks which contain nothing but a default clause.
19050
19051 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19052
19053        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19054
19055 2002-06-27  Martin Baulig  <martin@gnome.org>
19056
19057         * ecore.cs (PropertyExpr.PropertyExpr): Call
19058         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19059
19060         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19061         is already a TypeBuilder.
19062
19063 2002-06-27  Martin Baulig  <martin@gnome.org>
19064
19065         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19066         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19067         the "from an array-type to System.Array" case.  This makes it work
19068         when compiling corlib.
19069
19070 2002-06-27  Martin Baulig  <martin@gnome.org>
19071
19072         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19073         non-static PropertyExpr, set its InstanceExpression.  This makes
19074         the `ICollection.Count' property work in System/Array.cs.
19075
19076 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19077
19078         * driver.cs: Made error handling more consistent.  Errors now
19079         tracked by Report class, so many methods which used to return int
19080         now return void.  Main() now prints success/failure and 
19081         errors/warnings message.
19082
19083         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19084         the magic number return values (123 and 124).  Now, if the
19085         expected error occurs, the compiler exits with success (exit value
19086         0).  If the compilation completes without seeing that particular
19087         error, the compiler exits with failure (exit value 1).  The
19088         makefile in mcs/errors has been changed to handle the new behaviour.
19089
19090         * report.cs: Made 'expected error' number a property and renamed
19091         it from 'Probe' to 'ExpectedError'.
19092
19093         * genericparser.cs: Removed error handling support, since it is
19094         now all done by Report class.
19095
19096         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19097         class, so parse() no longer returns an int.
19098
19099         * namespace.cs: Use Report.Error instead of GenericParser.error
19100
19101 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19102
19103         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19104         TypeContainer.AddOperator): At the front of the list put the
19105         explicit implementations, so they get resolved/defined first. 
19106
19107 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19108
19109         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19110         interface type is implemented by this TypeContainer.  Used during
19111         explicit interface implementation.
19112
19113         (Property.Define, Indexer.Define, Method.Define): Validate that
19114         the given interface in the explicit implementation is one of the
19115         base classes for the containing type.
19116
19117         Also if we are explicitly implementing an interface, but there is
19118         no match in the pending implementation table, report an error.
19119
19120         (Property.Define): Only define the property if we are
19121         not explicitly implementing a property from an interface.  Use the
19122         correct name also for those properties (the same CSC uses,
19123         although that is really not needed).
19124
19125         (Property.Emit): Do not emit attributes for explicitly implemented
19126         properties, as there is no TypeBuilder.
19127
19128         (Indexer.Emit): ditto.
19129
19130         Hiding then means that we do not really *implement* a pending
19131         implementation, which makes code fail.
19132
19133 2002-06-22  Martin Baulig  <martin@gnome.org>
19134
19135         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19136         the return value of Object.GetType().  [FIXME: we need to do this whenever
19137         we get a type back from the reflection library].
19138
19139 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19140
19141         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19142
19143 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * attribute.cs: Return null if we can not look up the type.
19146
19147         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19148         the interface types found.
19149
19150         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19151         interface types found.
19152
19153         * typemanager.cs (GetInterfaces): Make this routine returns alll
19154         the interfaces and work around the lame differences between
19155         System.Type and System.Reflection.Emit.TypeBuilder in the results
19156         result for GetInterfaces.
19157
19158         (ExpandInterfaces): Given an array of interface types, expand and
19159         eliminate repeated ocurrences of an interface.  This expands in
19160         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19161         be IA, IB, IC.
19162
19163 2002-06-21  Martin Baulig  <martin@gnome.org>
19164
19165         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19166         on System.Enum.
19167
19168 2002-06-21  Martin Baulig  <martin@gnome.org>
19169
19170         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19171         and called with one of the core types, return the corresponding typebuilder for
19172         that type.
19173
19174         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19175         element type.
19176
19177 2002-06-21  Martin Baulig  <martin@gnome.org>
19178
19179         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19180         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19181         (Expression.ConvertReferenceExplicit): Likewise.
19182
19183         * expression.cs (ElementAccess.DoResolve): Likewise.
19184         (ElementAccess.DoResolveLValue): Likewise.
19185
19186 2002-06-10  Martin Baulig  <martin@gnome.org>
19187
19188         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19189         add the "value" parameter to the parameter list.
19190
19191         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19192         to our caller.
19193
19194 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19195
19196         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19197         the argument to an int, uint, long or ulong, per the spec.  Also
19198         catch negative constants in array creation.
19199
19200 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19201
19202         * class.cs: do not allow the same interface to appear twice in
19203         the definition list.
19204
19205 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19206
19207         * ecore.cs: don't use ldlen with System.Array.
19208
19209 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19210
19211         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19212
19213 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19214
19215         * modifiers.cs: produce correct field attributes for protected
19216         internal. Easy fix so miguel can work on ther harder stuff:-)
19217
19218 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19219
19220         * pending.cs: New file.  Move the code from class.cs here.
19221         Support clearning the pending flag for all methods (when not doing
19222         explicit interface implementation).
19223
19224 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19225
19226         * rootcontext.cs: added a couple more types needed to bootstrap.
19227
19228 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19229
19230         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19231         constructor in the type, instead of any constructor in the type
19232         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19233         a bug in the Mono runtime when applying the params attribute). 
19234
19235 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19236         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19237
19238 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19239
19240         * expression.cs (Unary.ResolveOperator): Use TypeManager
19241         to resolve the type.
19242
19243 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19244
19245         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19246         attached.
19247
19248         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19249         with each member too.
19250
19251         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19252         field builders too - this takes care of the enum member case.
19253
19254 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19255
19256         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19257         address-of operator on both value types and pointers.
19258
19259 2002-06-10  Martin Baulig  <martin@gnome.org>
19260
19261         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19262         PropertyBuilder to the `property_builders' list.
19263
19264         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19265         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19266         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19267         find any indexers which are inherited from an interface.
19268
19269 2002-06-09  Martin Baulig  <martin@gnome.org>
19270
19271         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19272         the same type as the constant if necessary.  There's also a test-130.cs
19273         for this.
19274
19275         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19276
19277         * typemanager.cs (TypeManager.ChangeType): Previously known as
19278         Enum.ChangeEnumType().
19279
19280 2002-06-09  Martin Baulig  <martin@gnome.org>
19281
19282         * expression.cs (Cast.TryReduce): Added support for consts.
19283
19284 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19285
19286         * class.cs (Accessor): Hold attributes information so we can pass
19287         it along.
19288
19289         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19290         Modify to pass in attributes attached to the methods.
19291
19292         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19293
19294         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19295         to handle the Accessor kind :-)
19296
19297         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19298
19299 2002-06-08  Martin Baulig  <martin@gnome.org>
19300
19301         * expression.cs (Unary.TryReduceNegative): Added support for
19302         ULongConstants.
19303
19304 2002-06-08  Martin Baulig  <martin@gnome.org>
19305
19306         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19307         name can't be found in the `defined_names' - the caller will do a
19308         MemberLookup in this case and thus find methods in System.Enum
19309         such as Enum.IsDefined().
19310
19311 2002-06-08  Martin Baulig  <martin@gnome.org>
19312
19313         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19314         Convert.ChangeType() which works with TypeBuilder created types.
19315         (Enum.LookupEnumValue, Enum.Define): Use it here.
19316
19317         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19318         `TypeBuilder.BaseType != null' check.
19319         (TypeContainer.FindMembers): Only lookup parent members if we
19320         actually have a parent.
19321         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19322         (ConstructorInitializer.Resolve): Likewise.
19323
19324         * interface.cs (Interface.FindMembers): Added
19325         `TypeBuilder.BaseType != null' check.
19326
19327         * rootcontext.cs (RootContext.ResolveCore): Added
19328         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19329         classes_second_stage.
19330
19331         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19332         debug_type and trace_type when compiling with --nostdlib.       
19333
19334 2002-06-07  Martin Baulig  <martin@gnome.org>
19335
19336         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19337         (AddField): Set it to true when adding a non-static field.
19338         (DefineType): Use `have_nonstatic_fields' to find out whether we
19339         have non-static fields, not `Fields != null'.
19340
19341 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19342
19343         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19344         dereferencing a null on the static-field code path)
19345
19346 2002-05-30  Martin Baulig  <martin@gnome.org>
19347
19348         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19349         to take command line arguments.  Use reflection to call the new
19350         custom `Initialize' function on the symbol writer and pass it the
19351         command line arguments.
19352
19353         * driver.cs (--debug-args): New command line argument to pass command
19354         line arguments to the symbol writer.
19355
19356 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19357
19358         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19359         the target type for indexers and properties.  Thanks to Joe for
19360         catching this.
19361
19362 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19363
19364         * typemanager.cs (MethodFlags): returns the method flags
19365         (Obsolete/ShouldIgnore) that control warning emission and whether
19366         the invocation should be made, or ignored. 
19367
19368         * expression.cs (Invocation.Emit): Remove previous hack, we should
19369         not do this on matching a base type, we should do this based on an attribute
19370
19371         Only emit calls to System.Diagnostics.Debug and
19372         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19373         on the command line.
19374
19375         * rootcontext.cs: Global settings for tracing and debugging.
19376
19377         * cs-tokenizer.cs (define): New utility function to track
19378         defines.   Set the global settings for TRACE and DEBUG if found.
19379
19380 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19381
19382         * interface.cs (Populate*): Pass in the TypeContainer as well as
19383         the DeclSpace as parameters so that we can create EmitContexts and
19384         then use that to apply attributes etc.
19385
19386         (PopulateMethod, PopulateEvent, PopulateProperty)
19387         (PopulateIndexer): Apply attributes everywhere.
19388
19389         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19390         etc.
19391
19392         (ApplyAttributes): Update accordingly.
19393
19394         We now apply interface attributes for all members too.
19395
19396 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19397
19398         * class.cs (Indexer.Define); Correctly check if we are explicit
19399         implementation (instead of checking the Name for a ".", we
19400         directly look up if the InterfaceType was specified).
19401
19402         Delay the creation of the PropertyBuilder.
19403
19404         Only create the PropertyBuilder if we are not an explicit
19405         interface implementation.   This means that explicit interface
19406         implementation members do not participate in regular function
19407         lookups, and hence fixes another major ambiguity problem in
19408         overload resolution (that was the visible effect).
19409
19410         (DefineMethod): Return whether we are doing an interface
19411         implementation. 
19412
19413         * typemanager.cs: Temporary hack until we get attributes in
19414         interfaces (Ravi is working on that) and we get IndexerName
19415         support in interfaces.
19416
19417         * interface.cs: Register the indexers as properties.
19418
19419         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19420         warning, I have verified that this is a bug in the .NET runtime
19421         (JavaScript suffers of the same problem).
19422
19423         * typemanager.cs (MemberLookup): When looking up members for
19424         interfaces, the parent of an interface is the implicit
19425         System.Object (so we succeed in searches of Object methods in an
19426         interface method invocation.  Example:  IEnumerable x;  x.ToString
19427         ()) 
19428
19429 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19430
19431         * class.cs (Event): Events should also register if they do
19432         implement the methods that an interface requires.
19433
19434         * typemanager.cs (MemberLookup); use the new GetInterfaces
19435         method. 
19436
19437         (GetInterfaces): The code used to lookup interfaces for a type is
19438         used in more than one place, factor it here. 
19439
19440         * driver.cs: Track the errors at the bottom of the file, we kept
19441         on going.
19442
19443         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19444         instance if the method we are calling is static!
19445
19446 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19447
19448         * attribute.cs (ApplyAttributes): Make this function filter out
19449         the IndexerName attribute (as that attribute in reality is never
19450         applied) and return the string constant for the IndexerName
19451         attribute. 
19452
19453         * class.cs (TypeContainer.Emit): Validate that all the indexers
19454         have the same IndexerName attribute, and if so, set the
19455         DefaultName attribute on the class. 
19456
19457         * typemanager.cs: The return value might contain other stuff (not
19458         only methods).  For instance, consider a method with an "Item"
19459         property and an Item method.
19460
19461         * class.cs: If there is a problem with the parameter types,
19462         return. 
19463
19464 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19465
19466         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19467         looks at user defined conversion after making a call to 
19468         StandardConversionExists - we need this for overload resolution.
19469
19470         * expression.cs : Update accordingly the various method calls.
19471
19472         This fixes 2 bugs filed against implicit user defined conversions 
19473
19474 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19475
19476         * statement.cs: Track the result of the assignment.
19477
19478 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19479
19480         * expression.cs (MemberAccess): Improved error reporting for
19481         inaccessible members.
19482
19483 2002-05-22  Martin Baulig  <martin@gnome.org>
19484
19485         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19486         itself with debugging support.
19487
19488 2002-05-22  Martin Baulig  <martin@gnome.org>
19489
19490         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19491         Removed, this isn't needed anymore.
19492
19493 2002-05-20  Martin Baulig  <martin@gnome.org>
19494
19495         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19496         be underlying type for an enum.
19497
19498 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19499
19500         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19501         that splits out the loading of just the core types.
19502
19503         * rootcontext.cs (ResolveCore): Split the struct resolution in
19504         two, so we can load the enumeration underlying types before any
19505         enums are used.
19506
19507         * expression.cs (Is): Bandaid until we fix properly Switch (see
19508         bug #24985 for details).
19509
19510         * typemanager.cs (ImplementsInterface): The hashtable will contain
19511         a null if there are no interfaces implemented.
19512
19513 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19514
19515         * cs-parser.jay (indexer_declarator): It is fine to have array
19516         parameters
19517
19518 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19519
19520         * typemanager.cs: (RegisterBuilder): New function used to register
19521         TypeBuilders that implement interfaces.  Since
19522         TypeBuilder.GetInterfaces (as usual) does not work with lame
19523         Reflection.Emit. 
19524         (AddUserType): register interfaces.
19525
19526         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19527         dealing with TypeBuilder.  Also, arrays are showing up as
19528         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19529         methods can not be invoked on them!
19530
19531         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19532         (ImplicitReferenceConversionExists): Split out from
19533         StandardConversionExists. 
19534
19535         * expression.cs (As): We were only implementing one of the three
19536         cases for the as operator.  We now implement them all.
19537         (Is): Implement the various other cases for Is as well.
19538
19539         * typemanager.cs (CACHE): New define used to control if we want or
19540         not the FindMembers cache.  Seems to have a negative impact on
19541         performance currently
19542
19543         (MemberLookup): Nested types have full acess to
19544         enclosing type members
19545
19546         Remove code that coped with instance/static returns for events, we
19547         now catch this in RealFindMembers.
19548
19549         (RealFindMembers): only perform static lookup if the instance
19550         lookup did not return a type or an event.  
19551
19552 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19553
19554         * assign.cs (CompoundAssign): We pass more semantic information
19555         now to Compound Assignments than we did before: now we have all
19556         the information at hand, and now we resolve the target *before* we
19557         do the expression expansion, which allows the "CacheValue" method
19558         to have the effect we intended (before, a [x] += 1 would generate
19559         two differen ArrayAccess expressions from the ElementAccess,
19560         during the resolution process).
19561
19562         (CompoundAssign.DoResolve): Resolve target and original_source here.
19563
19564 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19565
19566         * expression.cs (ArrayAccess): dropped debugging information. 
19567
19568         * typemanager.cs: Small bug fix: I was always returning i_members,
19569         instead of one of i_members or s_members (depending on which had
19570         the content).
19571
19572         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19573         method is invoked before any code generation takes place, and it
19574         is a mechanism to inform that the expression will be invoked more
19575         than once, and that the method should use temporary values to
19576         avoid having side effects
19577
19578         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19579
19580         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19581         implementation.
19582
19583         * expression.cs (Indirection, ArrayAccess): Add support for
19584         CacheTemporaries in these two bad boys. 
19585
19586         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19587         ldobj or ldind_ref.  
19588         (StoreFromPtr): Handle stobj as well.
19589
19590         * expression.cs (UnaryMutator): Share more code.
19591
19592         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19593         down: I was not tracking the Filter function as well, which
19594         was affecting the results of the cache.
19595
19596 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19597
19598         * attribute.cs: Remove the hack to handle the CharSet property on
19599         StructLayouts. 
19600
19601 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19602
19603         * attribute.cs (DoResolve): More uglyness, we now only try to
19604         resolve the attribute partially, to extract the CharSet
19605         information (only if we are a StructLayout attribute).  Otherwise 
19606
19607         (GetExtraTypeInfo): Add some code to conditionally kill in the
19608         future this.   I am more and more convinced that the .NET
19609         framework has special code to handle the attribute setting on
19610         certain elements.
19611
19612         * expression.cs (IsParamsMethodApplicable): Revert my previous
19613         foreach change here, it was wrong.
19614
19615 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19616
19617         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19618         (pp_expr): do not abort on unknown input, just return.
19619         (eval): abort if there are pending chars.
19620
19621         * attribute.cs (Attribute.Resolve): Positional parameters are
19622         optional.  Deal with that case.
19623
19624         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19625         the Ansi/Unicode/Auto information for the type.
19626
19627         (TypeContainer.DefineType): instantiate the EmitContext here, as
19628         we will be using it during the type definition (to resolve
19629         attributes) and during the emit phase.
19630
19631         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19632         to pull type information out of the attributes
19633
19634         (Attribute.Resolve): track the constructor builder, and allow for
19635         multiple invocations (structs and classes will use this).
19636
19637         * ecore.cs (MemberLookupFinal): new version with all the
19638         parameters customizable.
19639
19640         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19641         constructors.  Return if the result value is null (as the error
19642         would have been flagged already by MemberLookupFinal)
19643
19644         Do not allow instances of abstract classes or interfaces to be
19645         created.
19646
19647         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19648         We have to compare the assembly property here when dealing with
19649         FamANDAssem and Assembly access modifiers, because we might be
19650         creating an assembly from *modules* (that means that we are not
19651         getting TypeBuilders for types defined in other modules that are
19652         part of this assembly).
19653
19654         (Method.Emit): If the method is marked abstract and has a body,
19655         emit an error. 
19656
19657         (TypeContainer.DefineMembers): If both the defined member and the
19658         parent name match are methods, then do not emit any warnings: let
19659         the Method.Define routine take care of flagging warnings.  But if
19660         there is a mismatch (method overrides something else, or method is
19661         overriwritten by something, then emit warning).
19662
19663         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19664         set to null, this means `do not check for the return type on the
19665         signature'. 
19666
19667         (Method.Define): set the return type for the method signature to
19668         null, so that we get methods with the same name and parameters and
19669         different return types.  This is used to flag warning 114 (you are
19670         hiding a method, and you probably want to use the new/override
19671         keywords instead).
19672
19673         * typemanager.cs (MemberLookup): Implemented proper access
19674         control, closing a long standing set of bug reports.  The problem
19675         was that the Framework only has two bits: Public and NonPublic,
19676         and NonPublic includes private and protected methods, but we need
19677         to enforce the FamANDAssem, FamOrAssem and Family. 
19678
19679 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19680
19681         * statement.cs (GotoCase): Return true: Ammounts to giving up
19682         knowledge on whether we return or not, and letting the other case
19683         be responsible for it.
19684
19685 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19686
19687         * driver.cs: Do not load directories for each file processed, only
19688         do it if there is a pattern.
19689
19690         * ecore.cs: Report readonly assigns here as well, as we might have
19691         been resolved only by MemberAccess.
19692
19693         (SimpleName.SimpleNameResolve): Also be useful for LValue
19694         resolution.   We need this to propagate assign to local readonly variables
19695
19696         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19697         do not want to reuse potential criteria memory.
19698
19699         * class.cs (MyEventBuilder): Set reflected_type;
19700
19701         * ecore.cs (Constantify): Added support for constifying bools.
19702
19703         (RootContext.LookupType): Added a cache for values looked up in
19704         the declaration space.
19705
19706         * typemanager.cs (FindMembers): Now is a front-end to
19707         RealFindMembers, and provides a two-level hashtable-based cache to
19708         the request.  
19709
19710         15% performance improvement: from 22.5 to 19.2 seconds.
19711
19712         * expression.cs (IsParamsMethodApplicable): use foreach.
19713         (Invocation.DoResolve): ditto.
19714         (New.DoResolve): ditto.
19715         (ArrayCreation.DoResolve): ditto.
19716
19717         * ecore.cs (FindMostEncompassingType): use foreach.
19718
19719         * delegate.cs (NewDelegate.DoResolve): Use foreach
19720
19721         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19722         (RemoveMethods): use foreach.
19723
19724         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19725         nested foreach statements instead of for, and also break out of
19726         the inner loop once a match is found.
19727
19728         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19729
19730 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19731
19732         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19733         we actually unwrap the expression to allow for extra information
19734         to be extracted. 
19735
19736         * expression.cs: Use Shr_Un on unsigned operations. 
19737
19738 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19739
19740         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19741         applicable operators was not being considered correctly. This closes
19742         the bug Miguel reported.
19743
19744 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19745
19746         * attribute.cs: check that the type derives from System.Attribute
19747         and report the correct error in that case (moved the duplicate code to
19748         its own method, too).
19749
19750 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19751
19752         * attribute.cs: lookup attribute type name as the spec says: first the
19753         bare attribute name and then name + "Attribute" (nant compiles with
19754         mcs after this fix).
19755
19756 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19757
19758         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19759         Because of the way we parse things, we should try to see if a
19760         UIntConstant can fit in an integer.
19761
19762 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19763
19764         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19765         when we are in an explicit context.
19766
19767         (ConvertReferenceExplicit): When converting from Iface type S to Class
19768         T make sure the rules are implemented as an OR.
19769
19770         * parameter.cs (ParameterType): Make it a property for now although the
19771         purpose really isn't anything immediate.
19772
19773         * expression.cs (Is*Applicable): Do better checking on the parameter type
19774         of a ref/out parameter. The ones from the system assemblies are already 
19775         marked with the correct type so we don't need to do any correction.
19776
19777         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19778         the object type is standard too so include that.
19779
19780 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19781
19782         * ecore.cs (StandardConversionExists): Augment with missing code:
19783         deal with IntConstant, LongConstants and Enumerations.
19784
19785         * assign.cs: Report the error, instead of failing silently
19786
19787         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19788         typecontainer that they are declared, because the
19789         typecontainer/namespace will have the list of using clauses that
19790         need to be applied.
19791
19792         Assembly Attributes were escaping the normal registration
19793         mechanism. 
19794
19795         (EmitCode): Apply attributes within an EmitContext that represents
19796         the container they were declared on.
19797
19798         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19799
19800 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19801
19802         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19803         Revamp completely - make much cleaner as we now operate only
19804         on a set of Types.
19805
19806         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19807         to implement the logic detailed in the spec more correctly.
19808
19809         (UserDefinedConversion): Update accordingly.
19810
19811 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19812
19813         * statement.cs: Return flow analysis information up.
19814
19815         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19816         and the default.
19817
19818         (token): Do not consume an extra character before calling
19819         decimal_digits.
19820
19821 2002-05-06  Piers Haken <piersh@friskit.com>
19822
19823         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19824
19825 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19826
19827         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19828         EmitContext during the instance constructor initializer
19829         resolution, to stop access to instance variables.
19830
19831         This is mandated by the spec, last paragraph of the `constructor
19832         initializers' section. 
19833
19834 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19835
19836         * cs-parser.jay, class.cs (Accessor): new class used to represent
19837         an accessor (get or set).  In the past we used `null' to represent
19838         a missing accessor.  But this is ambiguous because there was no
19839         way to tell in abstract indexers/properties if one of them was
19840         specified.
19841
19842         Now there is a way of addressing that.
19843
19844         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19845         instead of FindMembers.
19846
19847         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19848         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19849
19850         * attribute.cs: Treat indexers and properties as the same in terms
19851         of applying attributes
19852
19853         * ecore.cs (FindMostEncompassedType): Use statically initialized
19854         EmptyExpressions()s like we do elsewhere to avoid creating useless
19855         objects (and we take this out of the tight loop).
19856
19857         (GetConversionOperators): Move the code to extract the actual
19858         operators to a separate routine to clean things up.
19859
19860 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19861
19862         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19863         events are always registered FieldBuilders.
19864
19865         * class.cs (FieldBase): New class shared by Fields 
19866
19867         * delegate.cs: If we are a toplevel delegate, use our full name.
19868         If we are a nested delegate, then only use our tail name.
19869
19870 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19871
19872         * expression.cs (IsApplicable): Ensure that we add the "&" to
19873         ref/out types before comparing it with the type of the argument.
19874
19875         (IsParamsMethodApplicable): Ditto.
19876
19877         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19878         silly me ;-)
19879
19880         * delegate.cs : Handle the case when we have more than one applicable
19881         method. Flag an error only when we finish checking all.
19882
19883 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19884
19885         * expression.cs: Add support for boolean static initializers.
19886
19887 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19888
19889         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19890
19891         * parameter.cs (ComputeParameterTypes,
19892         ComputeAndDefineParameterTypes): Better error handling: now we
19893         clear the `types' cache if we fail during any of the type lookups.
19894         We also return the status code correctly to our caller
19895
19896         * delegate.cs: If we fail to define a delegate, abort the extra
19897         steps. 
19898
19899         * expression.cs (Binary.ResolveOperator): for
19900         operator==(object,object) and operator !=(object, object) we also
19901         have to verify that there is an implicit conversion from one to
19902         the other.
19903
19904         (ArrayAccess.DoResolve): Array Access can operate on
19905         non-variables. 
19906
19907 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19908
19909         * assign.cs (CompoundAssign): A new class used as a "flag" that
19910         the assignment actually is happening as part of a compound
19911         assignment operator.
19912
19913         During compound assignment, a few new rules exist to enable things
19914         like:
19915
19916         byte b |= 1 + 2
19917
19918         From the spec:
19919
19920         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19921         to the type of x) if y is implicitly convertible to the type of x,
19922         and the operator is a builtin operator and the return type of the
19923         operator is explicitly convertible to the type of x. 
19924
19925         * rootcontext.cs: Reset warning level to 2.  4 catches various
19926         "interesting" features in mcs, we must clean this up at some
19927         point, but currently am trying to kill other bugs ;-)
19928
19929         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19930         in container classes as well.  
19931
19932         * expression.cs (Binary.ResolveOperator): Handle string case
19933         before anything else (as operator overloading does emit an error
19934         before doing anything else).
19935
19936         This code could go away when we move to a table driven model, but
19937         i could not come up with a good plan last night.
19938
19939 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19940
19941         * typemanager.cs (CSharpName): reimplementation using regex.
19942         * class.cs: added null check for fields in Emit
19943         * rootcontext.cs: set warninglevel to 4
19944
19945 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19946
19947         * typemanager.cs (CSharpName): reimplemented with Lupus
19948         suggestion.
19949
19950 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19951
19952         * statement.cs (If): correclty implement Resolve, because we were
19953         not catching sem errors in there.  The same process is needed
19954         everywhere else. 
19955         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19956
19957
19958         (Statement.Warning_DeadCodeFound): Factorize code.
19959         (While): Report dead code here too.
19960
19961         (Statement): Added Resolve virtual method to allow
19962         for resolution split from the emit code.
19963
19964 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
19965
19966         * statement.cs (EmitBoolExpression): No longer try to resolve the
19967         expression here.    
19968         (MakeBoolean): New utility function that resolve, implicitly
19969         converts to boolean and tags the expression. 
19970
19971
19972         (If, Do): Implement dead code elimination.
19973         (While): Implement loop inversion
19974
19975         (Do, While, For, If): Resolve the expression prior to calling our
19976         code generation.
19977
19978 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
19979
19980         * class.cs:
19981           - added method Report28 (warning: program has more than one entry point)
19982           - added method IsEntryPoint, implements paragraph 10.1 of the spec
19983           - modified method Method.Define, the part at the end of the method
19984
19985         * rootcontext.cs: added static public Location EntryPointLocation;
19986           
19987         * ../errors/cs0028.cs : Add test case for the above warning.              
19988
19989         * typemanager.cs:
19990           - modified method CSharpName to allow arrays of primitive type to
19991             be printed nicely (e.g. instead of System.Int32[][] it now prints
19992             int[][])
19993           - added method CSharpSignature: returns the signature of a method
19994             in string format to be used in reporting errors, warnings, etc.
19995
19996         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
19997         with String.Empty.
19998
19999 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20000
20001         * delegate.cs (Define): Fix extremely silly bug where I was
20002         setting the type of the 'object' parameter of the BeginInvoke
20003         method to System.IAsyncResult instead of System.Object ;-)
20004
20005 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20006
20007         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20008         here. 
20009
20010         (Constructor.Emit): return if we fail to initialize the
20011         constructor.  Another door closed!  
20012
20013         * expression.cs (New.DoResolve): Improve error message (from -6 to
20014         1501).  Use DeclaredOnly lookup to find the exact constructor.
20015
20016         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20017         loop.  This is useful.
20018
20019         * cs-parser.jay: Adjust the default parameters so that destructors
20020         have the proper signature.
20021
20022 2002-04-26  Martin Baulig  <martin@gnome.org>
20023
20024         * driver.cs (LoadAssembly): If `assembly' contains any characters
20025         which are only valid in path names and not in assembly names
20026         (currently slash, backslash and point), use Assembly.LoadFrom ()
20027         instead of Assembly.Load () on the `assembly' (before iteration
20028         over the link_paths).
20029
20030 2002-04-26  Martin Baulig  <martin@gnome.org>
20031
20032         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20033
20034 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20035
20036         * class.cs (Property): use the new typemanager.MemberLookup
20037
20038         (TypeContainer.MemberLookup): Implement using the
20039         TypeManager.MemberLookup now. 
20040
20041         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20042         and return MemberInfos, so that these can be used without an
20043         EmitContext (what we had before).
20044
20045 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20046
20047         * expression.cs: Fix the case where the argument to params if the
20048         type of the params.  I omitted handling this before.   Fixed
20049
20050 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20051
20052         * driver.cs: Call BootCorlib_PopulateCoreType
20053
20054         * class.cs (Property.CheckBase): Check for properties only, not
20055         for all members. 
20056
20057         * interface.cs: Temporary hack: try/catch around the
20058         CustomAttributeBuilder, because I am getting an exception that I
20059         do not understand.
20060
20061         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20062         types whose definitions are required to be there (attributes are
20063         defined before standard types).
20064
20065         Compute definitions as we boot the various types, as they are used
20066         immediately (value_type class will need object_type, but if we do
20067         not initialize object_type, we will pass a null, which will let
20068         the runtime pick the System.Object from the existing corlib, which
20069         is not what we want).
20070
20071 2002-04-22  Patrik Torstensson <totte@labs2.com>
20072
20073         * cs-tokenizer.cs: fixed a number of trim() issues.
20074
20075 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20076
20077         * expression.cs (Argument.Type): Ensure that we return the correct
20078         type when we have out or ref parameters [in which case we 
20079         append a "&"].
20080
20081 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20082
20083         * class.cs (Property, Indexer): Allow extern modifier in there. 
20084
20085         * typemanager.cs (InitBaseTypes): Initializes object_type and
20086         value_type, since those will be used early on during the bootstrap
20087         process to compile corlib.
20088
20089         (InitCoreTypes): Move code from here to InitBaseTypes.
20090
20091 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20092
20093         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20094         single-dimension arrays as using the ldlen opcode.  
20095
20096         Daniel Lewis discovered this optimization.  
20097
20098         * typemanager.cs: Add signature for System.Array::get_Length
20099
20100 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20101
20102         * statement.cs: report the error when the foreach does not apply to an
20103         array nor a collection.
20104
20105 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20106
20107         * expression.cs: Add implicit conversions to the operator ~.
20108
20109         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20110
20111         * typemanager.cs: Locate the decimal constructor.
20112
20113 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20114
20115         * attribute.cs: use the new property of TypeOf.
20116         * expression.cs: added 'get' property around typearg.
20117
20118         These changes fix a build breaker reported by NickD. Is this the
20119         correct way to fix?  If not, please, revert my changes and make it
20120         work :-).
20121
20122 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20123
20124         * attribute.cs: Add support for typeof in attribute invocations.
20125         I am not sure that this is right though.
20126
20127 2002-04-14  Duncan Mak  <duncan@ximian.com>
20128
20129         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20130         Binary.Operator.Division case.
20131
20132 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20133
20134         * class.cs (DefineType): Ensure that we do a proper check on
20135         attribute types and also register it with the TypeManager.
20136
20137         (TypeContainer.Targets): The default for attribute types is
20138         AttributeTargets.All.
20139
20140         * attribute.cs (ApplyAttributes): Registering the attribute type
20141         is done elsewhere, not when we discover we have a Usage attribute.
20142
20143 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20144
20145         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20146         and get rid of is_delegate parameter.
20147
20148         * everywhere : update.
20149
20150 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20151
20152         * cs-parser.jay (compilation_unit): Revamp completely to use
20153         some new ideas that I got from Rhys' grammar to solve the problems
20154         with assembly level attributes.
20155
20156         (outer_declaration): New grammar production.
20157
20158         (attribute_sections): Add.
20159
20160         (opt_attributes): Base on attribute_sections
20161
20162         (namespace_declaration): Allow opt_attributes to tackle the case
20163         when we have assembly level attributes - we are clever in this
20164         regard now ;-)
20165
20166         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20167         attributes in the non-global context.
20168
20169         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20170         instead of SetGlobalAttributes.
20171
20172         * class.cs, rootcontext.cs : Ensure we define and generate 
20173         attribute types before anything else.
20174
20175         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20176         and flag the new error -20 for the case when the attribute type
20177         does not have valid targets specified. csc does not catch this.
20178
20179         * ../errors/errors.txt : update for error # -20
20180
20181 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20182
20183         * support.cs (InternalParameters.ParameterModifier): Do some null
20184         checking and return sane values.
20185
20186         * class.cs (Method.Define): If we are a PInvoke method, ensure
20187         that we are static and extern. Report error # 601
20188
20189         * ../errors/cs0601.cs : Add test case for the above error.
20190
20191 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20192
20193         * rootcontext.cs (attribute_types): We need to keep type of
20194         all attribute types separately and emit code for them first.
20195
20196         (RegisterAttribute) : Implement.
20197
20198         * class.cs (DefineType): Check if the current Type is a custom
20199         attribute type and register it accordingly.
20200
20201         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20202         adding the first attribute twice and rename to
20203
20204         (SetGlobalAttributes): this.
20205
20206         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20207         lookups.
20208
20209         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20210         if we are processing global arguments. Hmm, I am unsure of this.
20211
20212 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20213
20214         * expression.cs: added static array of strings to avoid calling
20215         Enum.ToString () for Operator in Binary. Significant recover of
20216         performance.
20217
20218 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20219
20220         * class.cs (FindMembers): Allow the Builders of the various
20221         members to be null.  If they are skip them.  This only happens
20222         during the PInvoke declaration.
20223
20224 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20225
20226         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20227         failure, so we do not keep going afterwards.
20228
20229         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20230         wanted to pass `false' as the `is_delegate' argument.  If this is
20231         the case, why not use delegate_type == null to mean `is_delegate =
20232         false' and anything else as is_delegate = true.
20233
20234 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20235
20236         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20237         code for the section, not the beginning of the tests.
20238
20239 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20240
20241         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20242
20243         * expression.cs (Binary): same.  Warn about errors where we have
20244         Enum/Enum in operator + as well.
20245
20246 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20247
20248         * statement.cs:
20249                 - added support for switch(bool)
20250                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20251                 - add TableSwitchEmit() to handle table-based switch statements
20252
20253 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20254
20255         * expression.cs (Invocation.OverloadResolve): Factor out code which
20256         does parameter compatibility checking with arguments so that we can 
20257         re-use the code even from Delegate.VerifyApplicability
20258
20259         (VerifyArgumentsCompat): Move above code here.
20260
20261         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20262         and instead make a call to the above method.
20263
20264 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20265
20266         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20267         We use it to keep track of classes which are attribute types.
20268
20269 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20270
20271         * delegate.cs (Delegate.Define): Correctly define the types in the
20272         presence of fixed and array parameters.
20273
20274         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20275         doing FindMembers.
20276
20277         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20278         include NonPublic after the first iteration.
20279
20280         * class.cs (Indexer.CheckBase): Only check if both parents are
20281         non-null. 
20282
20283         * cs-parser.jay (accessor_body): If empty, set to null.
20284
20285         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20286         same code path here to resolve constants names that we did have in
20287         MemberAccess.DoResolve.  There is too much code duplicated here.
20288
20289 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20290
20291         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20292
20293         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20294         to MakeUnionSet.
20295
20296         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20297         tokens, numbers and strings.
20298
20299         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20300         parenthesis.
20301
20302         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20303         asyncronous parameters and the regular parameters.  
20304
20305         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20306         specify the target directory.
20307
20308         * expression.cs: (This.DoResolve): Simplify
20309         (As.Emit): Optimize, do not generate IsInst if the expression is
20310         always of the given type.
20311
20312         (Is.DoResolve): Bug fix, we were reporting both always/never for
20313         the is expression.
20314
20315         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20316         creating too many unnecessary arrays.
20317
20318 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20319
20320         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20321         fields instead of rolling our own initializer.   Takes care of all
20322         implicit conversions, and drops unnecessary static checks/argument.
20323
20324 2002-03-31  Dick Porter  <dick@ximian.com>
20325
20326         * driver.cs: use the GetDirectories() return values properly, and
20327         use "/" as path separator.
20328
20329 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20330
20331         * expression.cs (Unary): Optimize - - expr into expr.
20332         (Binary): Optimize a + (-b) into a -b.
20333
20334         * codegen.cs (CodeGen): Made all methods static.
20335
20336 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20337
20338         * rootcontext.cs: 
20339
20340         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20341         TypeBuilder property.
20342
20343         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20344         instead. 
20345
20346         * tree.cs: Removed the various RecordXXXX, and replaced with a
20347         single RecordDecl.  Removed all the accessor methods, and just
20348         left a single access point Type 
20349
20350         * enum.cs: Rename DefineEnum to DefineType.
20351
20352         * decl.cs: New abstract method `DefineType' used to unify the
20353         Defines for Enumerations, Interfaces, TypeContainers and
20354         Delegates.
20355
20356         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20357         LookupBaseClasses method that used to live in class.cs and
20358         interface.cs here, and renamed to FindType.
20359
20360         * delegate.cs: Implement DefineType.  Take advantage of the
20361         refactored pattern for locating the parent builder without taking
20362         the parent_builder argument (which we know does not work if we are
20363         nested, and triggering a toplevel definition).
20364
20365 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20366
20367         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20368         accessibility of a member has changed during override and report
20369         an error if so.
20370
20371         * class.cs (Method.Define, Property.Define): Only complain on
20372         overrides if the method is private, any other accessibility is
20373         fine (and since we just checked the permission is the same, we are
20374         good to go).
20375
20376         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20377         and elif are processed always.  The other pre-processing
20378         directives are only processed if we are "taking" the path
20379
20380 2002-03-29  Martin Baulig  <martin@gnome.org>
20381
20382         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20383         current location is not Null.
20384
20385         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20386         a separate method so we can profile it.
20387
20388         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20389         `span.Seconds' are just seconds, but no minutes or hours.
20390         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20391
20392 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20393
20394         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20395         Remove the gratuitous set of Final:
20396
20397                                 // If an interface implementation, then we can set Final.
20398                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20399                                     implementing.DeclaringType.IsInterface)
20400                                         flags |= MethodAttributes.Final;
20401
20402         I do not know what I was smoking when I used that.
20403
20404
20405         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20406         step into fixing the name resolution issues for delegates and
20407         unifying the toplevel name resolution.
20408
20409 2002-03-28  Martin Baulig  <martin@gnome.org>
20410
20411         * class.cs (Method.Emit): If we have a symbol writer, call its
20412         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20413         tell it about the current method.
20414
20415         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20416         writer that we're going to emit the first byte of IL code for a new
20417         statement (a new source line).
20418         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20419         EmitContext.Mark() before emitting any code.
20420
20421         * location.cs (SymbolDocument): Return null when we're Null.
20422
20423         * statement.cs (Statement): Moved the `Location loc' variable here.
20424         (Statement.EmitBoolExpression): If we have a symbol writer, call
20425         ec.Mark() before emitting any code to tell it that we're at the
20426         beginning of a new statement.
20427         (StatementExpression): Added `Location' argument to the constructor.
20428         (Block): Added public readonly variable `StartLocation' and public
20429         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20430         (Block): Added constructor which takes a start and end location.
20431         (Block.SetEndLocation): New method. This sets the end location.
20432         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20433         local variables we create.
20434         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20435         each statement and do also mark the begin and end of the block.
20436
20437         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20438         tell it the current lexer.Location, use Location.Null for the end of the
20439         block.
20440         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20441         current block, set its end location using SetEndLocation().
20442         (statement_expression): StatementExpression constructor now takes the
20443         lexer.Location as additional argument.
20444         (for_statement, declare_local_variables): Likewise.
20445         (declare_local_variables): When creating a new implicit block, use the
20446         new Block constructor and pass it the lexer.Location.
20447
20448 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20449
20450         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20451         members also on the parent interfaces recursively.
20452
20453 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20454
20455         * report.cs: Use new formats, since Gonzalo finished the missing
20456         bits. 
20457
20458         * expression.cs (Binary.ResolveOperator): added missing operator|
20459         operator& and operator^ for bool/bool.
20460
20461         * cs-parser.jay: CheckDef now takes a Location argument that is
20462         used to report errors more precisly (instead of reporting the end
20463         of a definition, we try to track something which is a lot closer
20464         to the source of the problem).
20465
20466         * cs-tokenizer.cs: Track global token use, so we can properly flag
20467         the use of #define/#undef after the first token has been seen.
20468
20469         Also, rename the reportXXXX to Error_DescriptiveName
20470
20471         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20472         TypeContainer, so that Enum and Interface can use this too.
20473
20474         * class.cs (TypeContainer.LookupInterfaceOrClass,
20475         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20476         `builder' argument.  Typically this was used to pass the parent
20477         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20478         the definition).  
20479
20480         The problem is that a nested class could trigger the definition of
20481         a toplevel class, and the builder would be obviously wrong in that
20482         case. 
20483
20484         So we drop this argument, and we compute dynamically the
20485         TypeBuilder/ModuleBuilder (the correct information was available
20486         to us anyways from DeclSpace.Parent)
20487
20488         * interface.cs (Interface.DefineInterface): Drop builder
20489         parameter cleanup like class.cs
20490
20491         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20492         like class.cs
20493
20494         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20495         values. 
20496
20497         (Try.Emit): Propagate the returns value from the statement.
20498
20499         (Return.Emit): Even if we are leavning 
20500
20501         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20502
20503         * modifiers.cs: Fix the computation of MethodAttributes flags.
20504
20505 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20506
20507         * driver.cs: allow compilation of files that start with '/'.
20508         Add a default case when checking the argument of --target.
20509
20510 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20511
20512         * interface.cs: Implement the same search algorithm for types in
20513         the interface code.
20514
20515         * delegate.cs: Do not allow multiple definition.
20516
20517         * Recovered ChangeLog that got accidentally amputated
20518
20519         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20520
20521         * rootcontext.cs: Load manually enum to allow core classes to
20522         contain enumerations.
20523
20524         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20525         Update to new static methods in TypeManager.
20526
20527         * typemanager.cs (GetMethod, GetConstructor): Use our
20528         implementation of FindMembers to find the members, since during
20529         corlib compilation, the types are TypeBuilders and GetMethod and
20530         GetConstructor do not work.
20531
20532         Make all methods in TypeManager static.
20533
20534         (InitCodeHelpers): Split the functionality from
20535         the InitCodeTypes function.
20536
20537         * driver.cs: Call InitCodeHelpers after we have populated the
20538         types. 
20539
20540         * cs-parser.jay (delegate_declaration): we did not used to compute
20541         the delegate name correctly for void delegates.
20542
20543 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20544
20545         * rootcontext.cs (RootContext): Init the interface_resolve_order
20546         and type_container_resolve_order always.
20547
20548         (ResolveCore, BootstrapCorlib_ResolveClass,
20549         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20550         compiler when compiling with --nostdlib
20551
20552         * class.cs (TypeContainer.DefineType): Check that our parent is
20553         not null.  This test is most important when we are bootstraping
20554         the core types.
20555
20556         * codegen.cs: Split out the symbol writing code.
20557
20558 2002-03-25  Martin Baulig  <martin@gnome.org>
20559
20560         * driver.cs (-g): Made -g an alias for --debug.
20561
20562 2002-03-24  Martin Baulig  <martin@gnome.org>
20563
20564         * codegen.cs (SymbolWriter): New public variable. Returns the
20565         current symbol writer.
20566         (CodeGen): Added `bool want_debugging_support' argument to the
20567          constructor. If true, tell the ModuleBuild that we want debugging
20568         support and ask it for the ISymbolWriter.
20569         (Save): If we have a symbol writer, call it's Close() method after
20570         saving the assembly.
20571
20572         * driver.c (--debug): New command line argument to create a
20573         debugger information file.
20574
20575         * location.cs (SymbolDocument): New public property. Returns an
20576         ISymbolDocumentWriter object for the current source file or null
20577         if we don't have a symbol writer.
20578
20579 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20580
20581         * driver.cs (LoadAssembly): Correctly return when all the paths
20582         have been tried and not before.
20583
20584         * statement.cs (Switch.Emit): return the actual coverage for this
20585         statement (returns/not-returns)
20586
20587         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20588         switch of the statement if we are the last switch section.  That
20589         kills two problems: try/catch problems (we used to emit an empty
20590         nop at the end) and switch statements where all branches would
20591         return. 
20592
20593 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20594
20595         * driver.cs: Add default assemblies (the equivalent to the
20596         Microsoft CSC.RSP file)
20597
20598         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20599         also update tokens_seen and set it to false.
20600
20601         * driver.cs: Implement --recurse for Mike.
20602
20603         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20604         correctly splitting out the paths.
20605
20606 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20607
20608         * interface.cs (Interface.PopulateProperty): Instead of using
20609         `parent' as the declaration space for the set parameters, use
20610         `this' 
20611
20612         * support.cs (InternalParameters): InternalParameters constructor
20613         takes a DeclSpace instead of a TypeContainer.
20614
20615         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20616         types are being initialized, load the address of it before calling
20617         the function.  
20618
20619         (New): Provide a mechanism to disable the generation of local
20620         value type temporaries when the caller will be providing us with
20621         an address to store it.
20622
20623         (ArrayCreation.EmitDynamicInitializers): Use it.
20624
20625 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20626
20627         * expression.cs (Invocation.EmitArguments): Only probe for array
20628         property if there is more than one argument.  Sorry about that.
20629
20630         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20631         empty param arrays.
20632
20633         * class.cs (Method.LabelParameters): Fix incorrect code path that
20634         prevented the `ParamArrayAttribute' from being applied to the
20635         params attribute.
20636
20637 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20638
20639         * support.cs (ReflectionParameters): Correctly compute whether the
20640         last argument is a params array.  Fixes the problem with
20641         string.Split ('a')
20642
20643         * typemanager.cs: Make the assemblies array always be non-null
20644         (empty, but non-null)
20645
20646         * tree.cs (RecordDecl): New function that abstracts the recording
20647         of names.  This reports error 101, and provides a pointer to the
20648         previous declaration.  Fixes a crash in the compiler.
20649
20650         * cs-parser.jay (constructor_declaration): Update to new grammar,
20651         and provide a constructor_body that can be empty.
20652
20653 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20654
20655         * driver.cs: Add support for --resources.
20656
20657         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20658         Make all types for the various array helper methods be integer.
20659
20660         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20661         CheckState to ConvCast.
20662
20663         (ConvCast): Now it takes a `checked' state argument, to avoid
20664         depending on the emit context for the conversion, and just using
20665         the resolve time setting.
20666
20667         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20668         instead of Invocation.EmitArguments.  We do not emit the original
20669         arguments, instead we emit those which have been converted to
20670         unsigned int expressions.
20671
20672         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20673
20674         * codegen.cs: ditto.
20675
20676         * expression.cs (LocalVariableReference): Drop the use of the
20677         Store function that depended on the variable index.
20678
20679         * statement.cs (VariableInfo): Drop the `Idx' property from this
20680         class, as this is not taking into account the indexes for
20681         temporaries tat we generate during the execution, getting the
20682         indexes wrong.
20683
20684         * class.cs: First emit class initializers, then call the parent
20685         constructor. 
20686
20687         * expression.cs (Binary): Fix opcode emision.
20688         (UnaryMutator.EmitCode): Support checked code generation
20689
20690         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20691         matches for events for both the Static and Instance scans,
20692         pointing to the same element.   Fix that.
20693
20694 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20695
20696         * rootcontext.cs (ResolveTree): Always set the
20697         interface_resolve_order, because nested interfaces will be calling
20698         into us.
20699
20700         * class.cs (GetInterfaceOrClass): Track the same resolution
20701         process used by TypeManager.LookupType.  This fixes the nested
20702         type lookups in class declarations (separate path from
20703         LookupType). 
20704
20705         (TypeContainer.DefineType): Also define nested interfaces.
20706         (TypeContainer.RegisterOrder): New public function used to
20707         register the order in which child interfaces need to be closed.
20708
20709         Nested interfaces need to be closed after their parents have been
20710         created. 
20711
20712         * interface.cs (InterfaceAttr): Put all the logic for computing
20713         the interface attribute here. 
20714
20715         (DefineInterface): Register our interface order with the
20716         RootContext or with the TypeContainer depending on the case.
20717
20718 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20719
20720         * cs-parser.jay: rework foreach statement to work with the new
20721         changes to the policy on SimpleNames.
20722
20723         * report.cs: support Stacktrace on warnings as well.
20724
20725         * makefile: drop --unsafe and /unsafe from the compile.
20726
20727 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20728
20729         * ecore.cs (StandardConversionExists): Modify to take an Expression
20730         as the first parameter. Ensure we do null -> reference type conversion
20731         checking.
20732
20733         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20734         temporary Expression objects.
20735
20736 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20737
20738         * interface.cs: workaround bug in method overloading resolution
20739         (there is already a bugzilla bug for it).
20740
20741 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20742
20743         We could also solve this problem by having a separate path for
20744         performing type lookups, instead of DoResolve, we could have a
20745         ResolveType entry point, and only participating pieces of the
20746         production (simplename, deref, array) would implement this. 
20747
20748         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20749         signal SimpleName to only resolve type names and not attempt to
20750         resolve anything else.
20751
20752         * expression.cs (Cast): Set the flag.
20753
20754         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20755
20756         * class.cs: Only report 108 if there is no `new' modifier.
20757
20758         * cs-parser.jay: rework foreach statement to work with the new
20759         changes to the policy on SimpleNames.
20760         
20761         * report.cs: support Stacktrace on warnings as well.
20762
20763         * makefile: drop --unsafe and /unsafe from the compile.
20764
20765 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20766
20767         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20768         lookups here, instead of doing that at parse time.  This means
20769         that our grammar will not introduce `LocalVariableReferences' as
20770         expressions at this point.  That solves the problem of code like
20771         this:
20772
20773         class X {
20774            static void Main ()
20775            { int X = 1;
20776             { X x = null }}}
20777
20778         This is only half the fix.  The full fix requires parameters to
20779         also be handled in this way.
20780
20781         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20782         makes the use more obvious of the DeclSpace.  The
20783         ec.TypeContainer.TypeBuilder is now only used to pull the
20784         TypeBuilder for it.
20785
20786         My theory is that I can get rid of the TypeBuilder completely from
20787         the EmitContext, and have typecasts where it is used (from
20788         DeclSpace to where it matters).  
20789
20790         The only pending problem is that the code that implements Aliases
20791         is on TypeContainer, and probably should go in DeclSpace.
20792
20793         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20794         lookups here, instead of doing that at parse time.  This means
20795         that our grammar will not introduce `LocalVariableReferences' as
20796         expressions at this point.  That solves the problem of code like
20797         this:
20798
20799         class X {
20800            static void Main ()
20801            { int X = 1;
20802             { X x = null }}}
20803
20804         This is only half the fix.  The full fix requires parameters to
20805         also be handled in this way.
20806
20807         * class.cs (Property.DefineMethod): When implementing an interface
20808         method, set newslot, when implementing an abstract method, do not
20809         set the flag (before we tried never setting it, or always setting
20810         it, which is the difference).
20811         (Indexer.DefineMethod): same.
20812         (Method.DefineMethod): same.
20813
20814         * ecore.cs: Only set the status used flag if we get back a Field.
20815
20816         * attribute.cs: Temporary hack, so Paolo can keep working.
20817
20818 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20819
20820         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20821         the unmanaged type in the case we have a MarshalAs attribute.
20822
20823         (Resolve): Handle the case when we are parsing the special MarshalAs
20824         attribute [we need to store the unmanaged type to use later]
20825
20826         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20827         MarshalAs Attribute.
20828
20829         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20830         on parameters and accordingly set the marshalling info.
20831
20832 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20833
20834         * class.cs: Optimizing slightly by removing redundant code after
20835         we switched to the `NoTypes' return value.
20836         (Property.DefineMethod): use NoTypes here too.
20837
20838         This fixes the bug I introduced in my last batch of changes.
20839
20840 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20841
20842         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20843
20844         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20845         Enums since those are types too. 
20846
20847         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20848
20849         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20850         thanks to a call during the lookup process.
20851
20852 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20853
20854         * statement.cs (Foreach): Lots of work to accomodate a particular
20855         kind of foreach statement that I had not kept in mind.  It is
20856         possible to have foreachs on classes that provide a GetEnumerator
20857         method that return objects that implement the "pattern" for using
20858         a foreach, there is no need to support GetEnumerator
20859         specifically. 
20860
20861         This is needed to compile nant.
20862
20863         * decl.cs: Only report 114 if the member is not `Finalize' and if
20864         the warning level is at least 2.
20865
20866         * class.cs: Moved the compare function from Method to
20867         MethodSignature. 
20868
20869         (MethodSignature.InheritableMemberSignatureCompare): Add new
20870         filter function that is used to extract inheritable methods from a
20871         class. 
20872
20873         (Method.Define): Use the new `inheritable_method_signature_filter'
20874         delegate
20875
20876         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20877         command. 
20878
20879 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20880
20881         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20882
20883         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20884
20885         * expression.cs: Pass location information to
20886         ConvertImplicitStandard. 
20887
20888         * class.cs: Added debugging code to track return values from
20889         interfaces. 
20890
20891 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20892
20893         * expression.cs (Is.DoResolve): If either side of the `is' is an
20894         interface, do not flag the warning.
20895
20896         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20897         for interfaces
20898
20899         * report.cs: Allow for --fatal to be used with --probe.
20900
20901         * typemanager.cs (NoTypes): Move the definition for the empty Type
20902         array here. 
20903
20904         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20905         properties. 
20906         (TypeContainer.DefineProxy): New function used to proxy to parent
20907         implementations when implementing interfaces.
20908         (TypeContainer.ParentImplements): used to lookup if our parent
20909         implements a public function that is required by an interface.
20910         (TypeContainer.VerifyPendingMethods): Hook this up.
20911
20912         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20913         `modules' and `assemblies' arraylists into arrays.  We only grow
20914         these are the very early start up of the program, so this improves
20915         the speedof LookupType (nicely measured).
20916
20917         * expression.cs (MakeByteBlob): Replaced unsafe code with
20918         BitConverter, as suggested by Paolo.
20919
20920         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20921         folding of string concatenation, but if either side is a string,
20922         and the other is not, then return null, and let the runtime use
20923         the concatenation on the string plus the object (using
20924         `Object.ToString'). 
20925
20926 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20927
20928         Constant Folding has been implemented now.
20929
20930         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20931         the error instead on types that are not supported in one's
20932         complement. 
20933
20934         * constant.cs (Constant and all children): New set of functions to
20935         perform implict and explicit conversions.
20936
20937         * ecore.cs (EnumConstant): Implement the new functions to perform
20938         conversion by proxying to the child expression.
20939
20940         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20941         own separate setting that can not be turned off from the command
20942         line using --unchecked or --checked and is only controlled using
20943         the checked/unchecked statements and expressions.  This setting is
20944         used by the constant folder to flag errors.
20945
20946         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20947         ConstantCheckState as well.   
20948
20949         During Resolve, they also have to flag the state, because the
20950         constant folder runs completely in the Resolve phase.
20951
20952         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20953         well.
20954
20955 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20956
20957         * cfold.cs: New file, this file contains the constant folder.
20958
20959         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
20960         argument to track whether we are using the resulting address to
20961         load or store a value and provide better error messages. 
20962
20963         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
20964         new AddressOf arguments.
20965
20966         * statement.cs (Foreach.EmitCollectionForeach): Update
20967
20968         * expression.cs (Argument.Emit): Call AddressOf with proper
20969         arguments to track usage.
20970
20971         (New.DoEmit): Call AddressOf with new arguments.
20972
20973         (Unary.Emit): Adjust AddressOf call.
20974
20975 2002-03-01  Ravi Pratap  <ravi@ximian.com>
20976
20977         * cs-parser.jay (member_access): Change the case for pre-defined types
20978         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
20979         this suggestion.
20980
20981         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
20982         a method body.
20983
20984         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
20985         essentially like methods and apply attributes like MethodImplOptions to them too.
20986
20987         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
20988         not being null.
20989
20990         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
20991         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
20992         is the DeclSpace.
20993
20994         * Update code everywhere accordingly.
20995
20996         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
20997
20998         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
20999
21000 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21001
21002         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21003         try performing lookups against those instead of jumping straight into using
21004         the 'using' clauses.
21005
21006         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21007
21008         (LookupType): Perform lookups in implicit parents too.
21009
21010         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21011         sequence as RootContext.LookupType. 
21012
21013         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21014         the various cases of namespace lookups into this method.
21015
21016 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21017
21018         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21019         in positional arguments)
21020
21021         * class.cs (Operator): Update the AllowedModifiers to contain
21022         extern. 
21023
21024         * cs-parser.jay: Update operator declaration to allow for the
21025         operator body to be empty.
21026
21027         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21028         values. 
21029
21030 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21031
21032         * class.cs (Method.Emit): Label parameters.
21033
21034         * driver.cs: Return 1 or 0 as the program exit code.
21035
21036 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21037
21038         * expression.cs: Special case the `null' object when trying to
21039         auto-compute the type, as anything can be explicitly converted to
21040         that. 
21041
21042         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21043         spotting this Paolo.
21044
21045         (Expression.ImplicitNumericConversion): Perform comparissions of
21046         the type using the underlying type in the case of an enumeration
21047         rather than using the enumeration type for the compare.
21048
21049         Cope with the underlying == type case, which is not possible to
21050         catch before. 
21051
21052         (Expression.ConvertNumericExplicit): Perform comparissions of
21053         the type using the underlying type in the case of an enumeration
21054         rather than using the enumeration type for the compare.
21055
21056         * driver.cs: If the user does not supply an extension, assume .exe
21057
21058         * cs-parser.jay (if_statement): Rewrote so that we can track the
21059         location for the if statement.
21060
21061         * expression.cs (Binary.ConstantFold): Only concat strings when
21062         the operation is "+", not everything ;-)
21063
21064         * statement.cs (Statement.EmitBoolExpression): Take a location
21065         argument. 
21066         (If, While, Do): Track location.
21067
21068         * expression.cs (Binary.ResolveOperator): In the object + string
21069         case, I was missing a call to ConvertImplicit
21070
21071 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21072
21073         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21074         Location arguments. Ensure we use RootContext.LookupType to do our work
21075         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21076
21077         * interface.cs (PopulateMethod): Handle the type of the parameter being
21078         null gracefully.
21079
21080         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21081         have a params method with no fixed arguments and a call is made with no
21082         arguments.
21083
21084 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21085
21086         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21087         the verbatim-string-literal
21088
21089         * support.cs (InternalParameters.ParameterModifier): handle null
21090         fixed parameters.
21091         (InternalParameters.ParameterType): ditto.
21092
21093         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21094         duplicating the name of the variable parameter.
21095         (GetParameterByName): Fix bug where we were not looking up array
21096         paramters if they were the only present (thanks Paolo!).
21097         (GetParameterInfo): We only have an empty set of types if both
21098         fixed and array are set to null.
21099         (GetParameterInfo-idx): Handle FixedParameter == null
21100
21101         * cs-parser.jay: Handle the case where there is no catch
21102         statements (missing null test).
21103
21104 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21105
21106         * driver.cs (MainDriver): Be conservative on our command line
21107         handling.
21108
21109         Catch DirectoryNotFoundException when calling GetFiles.
21110
21111         (SplitPathAndPattern): Used to split the input specification into
21112         a path and a pattern that we can feed to Directory.GetFiles.
21113
21114 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21115
21116         * statement.cs (Fixed): Implement the last case of the Fixed
21117         statement (string handling).
21118
21119         * expression.cs (StringPtr): New class used to return a char * to
21120         a string;  Used by the Fixed statement.
21121
21122         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21123
21124         * expression.cs (Binary.ResolveOperator): Remove redundant
21125         MemberLookup pn parent type.
21126         Optimize union call, we do not need a union if the types are the same.
21127         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21128         type.
21129
21130         Specialize the use of MemberLookup everywhere, instead of using
21131         the default settings. 
21132
21133         (StackAlloc): Implement stackalloc keyword.
21134
21135         * cs-parser.jay: Add rule to parse stackalloc.
21136
21137         * driver.cs: Handle /h, /help, /?
21138
21139         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21140         before we supported unsafe code.
21141
21142         * makefile: add --unsafe to the self compilation of mcs.
21143
21144 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21145
21146         * expression.cs (PointerArithmetic): New class that is used to
21147         perform pointer arithmetic.
21148         (Binary.Resolve): Handle pointer arithmetic
21149         Handle pointer comparission.
21150         (ArrayPtr): Utility expression class that is used to take the
21151         address of an array.
21152
21153         (ElementAccess): Implement array access for pointers
21154
21155         * statement.cs (Fixed): Implement fixed statement for arrays, we
21156         are missing one more case before we are done.
21157
21158         * expression.cs (Indirection): Implement EmitAssign and set the
21159         ExprClass to Variable.  This allows pointer dereferences to be
21160         treated as variables, and to have values assigned to them.
21161
21162         * ecore.cs (Expression.StoreFromPtr): New utility function to
21163         store values dereferencing.
21164
21165 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21166
21167         * expression.cs (Binary.ResolveOperator): Ensure that we are
21168         not trying to operate on a void type - this fixes the reported
21169         bug.
21170
21171         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21172         the parent implementation is sealed.
21173
21174         * ../errors/cs0239.cs : Add.
21175
21176         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21177
21178         * typemanager.cs (unverifiable_code_type): Corresponds to 
21179         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21180         which have unsafe code in them.
21181
21182         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21183         unsafe context.
21184
21185 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21186
21187         * cs-tokenizer.cs: Add support for @"litreal strings"
21188
21189         Make tokenizer accept pre-processor directives
21190         on any column (remove the old C-like limitation). 
21191
21192         * rootcontext.cs (EmitCode): Emit any global attributes.
21193         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21194
21195         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21196
21197         * cs-parser.jay: Add support for global attributes.  
21198
21199 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21200
21201         * expression.cs (Indirection): New helper class.  Unary will
21202         create Indirection classes to be able to implement the
21203         IMemoryLocation interface on it.
21204
21205 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21206
21207         * cs-parser.jay (fixed_statement): reference the right statement.
21208
21209         * statement.cs (Fixed.Emit): Finish implementing the fixed
21210         statement for the &x case.
21211
21212 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21213
21214         * class.cs (Property.Define, Method.Define): Remove newslot when
21215         `implementing'.  
21216
21217         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21218         wrong.  NewSlot should only be used if the `new' keyword is present.
21219
21220         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21221         locating our system dir.  Sorry about this.
21222
21223 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21224
21225         * driver.cs (GetSystemDir): Compute correctly the location of our
21226         system assemblies.  I was using the compiler directory instead of
21227         the library directory.
21228
21229 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21230
21231         * expression.cs (BetterFunction): Put back in what Miguel commented out
21232         since it is the correct fix. The problem is elsewhere ;-)
21233
21234         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21235         parameters of the parms method are themselves compatible or not !
21236
21237         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21238         to check that a class implements an interface before saying that an implicit
21239         conversion was allowed. Use ImplementsInterface to do the checking.
21240
21241 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21242
21243         * class.cs (Method.Define): Track whether we are an explicit
21244         implementation or not.  And only call DefineMethodOverride if we
21245         are an explicit implementation.
21246
21247         (Property.DefineMethod): Ditto.
21248
21249 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21250
21251         * expression.cs (BetterFunction): Catch hideous bug which was
21252          preventing us from detecting ambiguous calls due to implicit casts i.e
21253         cs0121.
21254
21255 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21256
21257         * support.cs (Pair): Remove un-needed method.  I figured why I was
21258         getting the error in cs-parser.jay, the variable in a foreach loop
21259         is readonly, and the compiler does not really treat this as a variable.
21260
21261         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21262         instead of EQUALS in grammar.  
21263
21264         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21265
21266         * expression.cs (Unary.DoResolve): Check whether the argument is
21267         managed or not.
21268
21269 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21270
21271         * support.cs: Api for Pair to set a value.  Despite the fact that
21272         the variables are public the MS C# compiler refuses to compile
21273         code that accesses the field if the variable is part of a foreach
21274         statement. 
21275
21276         * statement.cs (Fixed): Begin implementation of the fixed
21277         statement.
21278
21279         (Block.AddVariable): Return the VariableInfo on success and null
21280         on failure instead of true/false. 
21281
21282         * cs-parser.jay (foreach): Catch errors on variables already
21283         defined (we were ignoring this value before) and properly unwind
21284         the block hierarchy
21285
21286         (fixed_statement): grammar for the fixed statement.
21287
21288 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21289
21290         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21291         pointer types to be incretemented.
21292
21293         (SizeOf): Implement.
21294
21295         * cs-parser.jay (pointer_member_access): Implement
21296         expr->IDENTIFIER production.
21297
21298         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21299         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21300         on safe contexts.
21301
21302         (Unary): Implement indirection.
21303
21304         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21305         use in non-unsafe context).
21306
21307         (SimpleName.DoResolve): Check for pointers in field access on safe
21308         contexts. 
21309
21310         (Expression.LoadFromPtr): Factor the load-indirect code in this
21311         function.  This was duplicated in UnboxCast and ParameterReference
21312
21313 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21314
21315         * expression.cs (ComposedCast): report an error if a pointer cast
21316         is used in a safe region.
21317
21318         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21319         pointer type casts in unsafe context.
21320
21321         * codegen.cs (EmitContext): Set up IsUnsafe.
21322
21323         * cs-parser.jay (non_expression_type): Add productions for pointer
21324         casts. 
21325
21326         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21327         code.  We should not use force into static mode if the method is
21328         not virtual.  Fixes bug in MIS
21329
21330         * statement.cs (Do.Emit, While.Emit, For.Emit,
21331         Statement.EmitBoolExpression): Add support to Do and While to
21332         propagate infinite loop as `I do return' semantics.
21333
21334         Improve the For case to also test for boolean constants.
21335
21336         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21337         to the list of attributes we can add.
21338
21339         Remove `EmitContext' argument.
21340
21341         * class.cs (Method.Define): Apply parameter attributes.
21342         (Constructor.Define): Apply parameter attributes.
21343         (MethodCore.LabelParameters): Move here the core of labeling
21344         parameters. 
21345
21346         * support.cs (ReflectionParameters.ParameterModifier,
21347         InternalParameters.ParameterModifier): Use IsByRef on the type and
21348         only return the OUT bit for these parameters instead of in/out/ref
21349         flags.
21350
21351         This is because I miss-understood things.  The ParameterInfo.IsIn
21352         and IsOut represent whether the parameter has the [In] and [Out]
21353         attributes set.  
21354
21355 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21356
21357         * ecore.cs (FieldExpr.Emit): Release temporaries.
21358
21359         * assign.cs (LocalTemporary.Release): new function.
21360
21361         * codegen.cs (EmitContext.GetTemporaryStorage,
21362         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21363         temporary storage.  Now we can "put back" localbuilders when we
21364         are done with them
21365
21366 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21367
21368         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21369         need to make a copy of the variable to generate verifiable code.
21370
21371 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21372
21373         * driver.cs: Compute dynamically the system directory.
21374
21375         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21376         Slower, but more generally useful.  Used by the abstract
21377         registering implementation. 
21378
21379         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21380         the rules for the special rule on Type/instances.  First check if
21381         we have the same name, and if so, try that special static path
21382         rather than the instance path.
21383
21384 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21385
21386         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21387         for, while and if.
21388
21389         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21390         Enum, ValueType, Delegate or Array for non-corlib compiles.
21391
21392         * cs-tokenizer.cs: Catch long identifiers (645)
21393
21394         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21395         piece of code.
21396
21397         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21398         fix, we were returning too early, so we were not registering
21399         pending methods from abstract classes.
21400
21401         Do not register pending methods if the class is abstract.
21402
21403         * expression.cs (Conditional.DoResolve): Report circular implicit
21404         conversions when we neecd to compute it for conditional
21405         expressions. 
21406
21407         (Is.DoResolve): If the expression is always of the provided type,
21408         flag warning 183.  If the expression can not ever be of the
21409         provided type flag warning 184.
21410
21411         * class.cs: Catch 169 as well.
21412
21413         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21414         read. 
21415
21416 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21417
21418         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21419
21420 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21421
21422         * interface.cs: (PopulateMethod): Check for pointers being defined
21423         only if the unsafe context is active.
21424         (PopulateProperty): ditto.
21425         (PopulateIndexer): ditto.
21426
21427         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21428         specified.  If pointers are present, make sure that they are
21429         present in an unsafe context.
21430         (Constructor, Constructor.Define): ditto.
21431         (Field, Field.Define): ditto.
21432         (Property, Property.Define): ditto.
21433         (Event, Event.Define): ditto.
21434
21435         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21436         hashtable if there are classes or structs defined.
21437
21438         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21439         code, as the constant resolution moved.
21440
21441         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21442         the metadata, so we can flag error 133. 
21443
21444         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21445         pointer is being declared in an unsafe context.
21446
21447 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21448
21449         * modifiers.cs (Modifiers.Check): Require a Location argument.
21450         Report error 227 for Unsafe use.
21451
21452         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21453
21454         * statement.cs (For.Emit): If the test is null, then report that
21455         we do `return', as we wont reach anything afterwards.
21456
21457         (Switch.SwitchGoverningType): Track the expression that matched
21458         the conversion.
21459
21460         * driver.cs: Allow negative numbers as an error code to flag.
21461
21462         * cs-parser.jay: Handle 1551.
21463
21464         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21465
21466 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21467
21468         * cs-parser.jay: Report 1518 (type declaration can only contain
21469         class, struct, interface, enum or delegate)
21470
21471         (switch_label): Report 1523 (keywords `case' or `default' must
21472         preced code)
21473
21474         (opt_switch_sections): Report 1522 (empty switch)
21475
21476         * driver.cs: Report 1515 (response file specified multiple times)
21477         Report 1516 (Source file specified multiple times).
21478
21479         * expression.cs (Argument.Resolve): Signal 1510
21480
21481         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21482         access not allowed in static code)
21483
21484 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21485
21486         * typemanager.cs (IsPointerType): Utility method which we are going
21487         to need a lot.
21488
21489         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21490         the object type, so we take care of that.
21491
21492         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21493
21494         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21495         added to non-params parameters :-)
21496
21497         * typemanager.cs (CSharpName): Include 'void' type too. 
21498
21499         (void_ptr_type): Include in the set of core types.
21500
21501         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21502         duplicating code.
21503
21504         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21505         an unsafe context.
21506
21507         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21508         completely forgotten about it.
21509
21510 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21511
21512         * cs-parser.jay (pointer_type): Add. This begins our implementation
21513         of parsing rules for unsafe code.
21514
21515         (unsafe_statement): Implement.
21516
21517         (embedded_statement): Modify to include the above.
21518
21519         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21520
21521         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21522         if the current context is an unsafe one.
21523
21524         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21525         are handled differently, we need separate rules for them.
21526
21527         (local_variable_declaration): Update to use local_variable_pointer_type
21528         to allow variable declarations of unmanaged pointer types.
21529
21530         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21531         in unsafe contexts.
21532
21533         * ../errors/cs0214.cs : Add.
21534
21535 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21536
21537         * makefile: remove 'response' file when cleaning.
21538
21539 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21540
21541         * cs-parser.jay: Report 1524.
21542
21543 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21544
21545         * typemanager.cs (RegisterMethod): drop checking if we have
21546         registered this from here
21547
21548 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21549
21550         * class.cs (Method.EmitDestructor): Implement calling our base
21551         destructor. 
21552
21553         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21554         value of InFinally.
21555
21556         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21557         this routine and will wrap the call in a try/catch block.  Deal
21558         with the case.
21559
21560 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21561
21562         * ecore.cs (Expression.MemberLookup): instead of taking a
21563         parameter `same_type' that was used to tell whether we could
21564         access private members we compute our containing type from the
21565         EmitContext.
21566
21567         (FieldExpr): Added partial support for volatile fields.  This does
21568         not work for volatile fields exposed from assemblies, as I can not
21569         figure out how to extract the modreq from it.
21570
21571         Updated all the source files to use this.
21572
21573         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21574         because it is referenced by MemberLookup very often. 
21575
21576 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21577
21578         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21579         TypeBuilder.GetCustomAttributes to retrieve what we need.
21580
21581         Get rid of redundant default_member_attr_type as this is the same as
21582         default_member_type which already exists.
21583
21584         * interface.cs, attribute.cs : Update accordingly.
21585
21586 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21587
21588         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21589         work for TYpeBuilders though.  Ravi, can you please fix this?
21590
21591         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21592
21593         * expression.cs (Argument.Emit): Handle the case of ref objects
21594         being passed to ref functions;  
21595
21596         (ParameterReference.EmitLoad): Loads the content of the pointer
21597         without dereferencing.
21598
21599 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21600
21601         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21602
21603 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21604
21605         * class.cs (Indexer.DefineMethod): Incorporate the interface
21606         type in the name of the method if we are doing explicit interface
21607         implementation.
21608
21609         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21610
21611         (BetterConversion): Fix extremely trivial bug where we were referring to
21612         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21613         again !
21614
21615         * ../errors/bug16.cs : Add although we have fixed it.
21616
21617 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21618
21619         * expression.cs (BaseIndexer): Begin implementation.
21620
21621         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21622
21623         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21624         production directly to remove a shift/reduce, and implement
21625         explicit interface implementation.
21626
21627         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21628         after a floating point suffix.
21629
21630         * expression.cs (DoNumericPromotions): Improved the conversion for
21631         uint/uint.  If we have a constant, we avoid doing a typecast to a
21632         larger type.
21633
21634         * class.cs (Indexer): Implement explicit interface implementation
21635         for indexers.
21636
21637 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21638
21639         * class.cs: make the default instance constructor public and hidebysig.
21640
21641 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21642
21643         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21644         so we can call it from elsewhere.
21645
21646         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21647         we emit it internally if the class has a defined indexer; otherwise the user
21648         emits it by decorating the class definition with the DefaultMemberAttribute.
21649
21650         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21651         attribute is not used on a type which defines an indexer.
21652
21653         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21654         character when we skip whitespace.
21655
21656         * ../errors/cs0646.cs : Add.
21657
21658 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21659
21660         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21661         again. 
21662
21663         * makefile: Add practical target `mcs3.exe' which builds the third
21664         generation compiler. 
21665
21666         * expression.cs (New): Fix structures constructor calling.
21667
21668         * class.cs (Property, Method, Indexer): Emit Final flag on the
21669         method if we are an interface implementation and we are not
21670         abstract. 
21671
21672         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21673         whether this property is referencing a `base' method.
21674
21675         * expression.cs (Invocation.EmitCall): take an extra argument:
21676         is_base, this is used to determine whether the `call' or
21677         `callvirt' opcode should be used.
21678
21679
21680         * delegate.cs: update EmitCall.
21681
21682         * class.cs (Method.Define): Set NewSlot for the cases where we are
21683         not implementing an interface method.
21684
21685         (Property.Define): ditto.
21686
21687 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21688
21689         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21690         'r'.  Allows mcs to parse itself fully.
21691
21692 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21693
21694         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21695         of the number of initializers that require the InitializeArray method.
21696
21697         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21698         update the above field where necessary.
21699
21700         (MakeByteBlob): Update accordingly.
21701
21702         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21703         greater than 2.
21704
21705         (EmitDynamicInitializers): Update in accordance with the new optimization.
21706
21707         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21708         same OpCode applies.
21709
21710         * cs-parser.jay : Fix some glaring errors I introduced.
21711
21712 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21713
21714         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21715         so that we can check for name clashes there too.
21716
21717         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21718         for interface indexers.
21719
21720         * interfaces.cs (Define): Emit the default member attribute.
21721
21722         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21723         variable was being referred to while setting the value ;-)
21724
21725 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21726
21727         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21728         byte-by-byte information when we know the data is zero.
21729
21730         Make the block always a multiple of 4, because
21731         DefineInitializedData has a bug.
21732
21733         * assign.cs: Fix, we should assign from the temporary, not from
21734         the source. 
21735
21736         * expression.cs (MakeByteBlob): Fix my incorrect code.
21737
21738 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21739
21740         * typemanager.cs (EnumToUnderlying): This function is used to get
21741         the underlying type from an enumeration, because it does not
21742         always work. 
21743
21744         * constant.cs: Use the I4_S form for values between -128 and 127.
21745
21746         * statement.cs (Block.LookupLabel): Looks up a label.
21747         (Block): Drop support for labeled blocks.
21748
21749         (LabeledStatement): New kind of statement that represents a label
21750         only.
21751
21752         (Goto): Finally implement this bad boy.
21753
21754         * cs-parser.jay: Update to reflect new mechanism to implement
21755         labels.
21756
21757 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21758
21759         * codegen.cs (EmitContext.This): a codegen property that keeps the
21760         a single instance of this instead of creating many different this
21761         instances. 
21762
21763         * delegate.cs (Delegate.DoResolve): Update to use the property;
21764
21765         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21766
21767         * expression.cs (BaseAccess.DoResolve): Ditto.
21768
21769 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21770
21771         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21772         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21773
21774         (InitCoreTypes): Update accordingly.
21775
21776         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21777         so we can quickly store the state.
21778
21779         (ApplyAttributes): Set the correct implementation flags
21780         for InternalCall methods.
21781
21782 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21783
21784         * expression.cs (EmitCall): if a method is not virtual, then do
21785         not use callvirt on it.
21786
21787         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21788         user defined stuff) requires the use of stobj, which takes an
21789         address on the stack instead of an array and an index.  So emit
21790         the Ldelema operation for it.
21791
21792         (EmitStoreOpcode): Use stobj for valuetypes.
21793
21794         (UnaryMutator.EmitCode): Use the right 1 value depending on
21795         whether we are dealing with int64/uint64, float or doubles.
21796
21797         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21798         constructors that I implemented last night.
21799
21800         (Constructor.IsDefault): Fix to work properly for static
21801         constructors.
21802
21803         * cs-parser.jay (CheckDef): report method signature errors.
21804         Update error number 103 to be 132.
21805
21806         * decl.cs: New AdditionResult enumeration value: MethodExists.
21807         Although we do this check for methods later on in the semantic
21808         analysis, catching repeated default constructors is so easy that
21809         we catch these here. 
21810
21811         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21812         promotions code.
21813
21814         (ParameterReference.EmitAssign, Emit): handle
21815         bools as bytes.
21816
21817         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21818         (ArrayAccess.EmitStoreOpcode): ditto.
21819
21820         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21821
21822         * expression.cs (MakeByteBlob): Complete all the missing types
21823         (uint, short, ushort, byte, sbyte)
21824
21825         * class.cs: Only init instance field initializers on instance
21826         constructors. 
21827
21828         Rename `constructors' to instance_constructors. 
21829
21830         (TypeContainer.AddConstructor): Only add constructors to the list
21831         if it is not static.
21832
21833         Make sure that we handle default_static_constructor independently
21834         everywhere where we handle instance_constructors
21835
21836 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21837
21838         * class.cs: Do not lookup or create a base initializer for a
21839         static constructor.
21840
21841         (ConstructorInitializer.Resolve): use the proper type to lookup
21842         for constructors.
21843
21844         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21845
21846         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21847         in DeclSpace. 
21848
21849         * decl.cs: CloseType is now an virtual method, the default
21850         implementation just closes this type.
21851
21852 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21853
21854         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21855         to PreserveSig by default. Also emit HideBySig on such methods.
21856
21857         Basically, set the defaults to standard values.
21858
21859         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21860         argument, if candidate is better, it can't be worse than the best !
21861
21862         (Invocation): Re-write bits to differentiate between methods being
21863         applicable in their expanded form and their normal form - for params
21864         methods of course.
21865
21866         Get rid of use_standard everywhere as only standard conversions are allowed
21867         in overload resolution. 
21868
21869         More spec conformance.
21870
21871 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21872
21873         * driver.cs: Add --timestamp, to see where the compiler spends
21874         most of its time.
21875
21876         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21877         `this' in static code.
21878
21879         (SimpleName.DoResolve): Implement in terms of a helper function
21880         that allows static-references to be passed upstream to
21881         MemberAccess.
21882
21883         (Expression.ResolveWithSimpleName): Resolve specially simple
21884         names when called by MemberAccess to implement the special
21885         semantics. 
21886
21887         (Expression.ImplicitReferenceConversion): Handle conversions from
21888         Null to reference types before others, as Null's type is
21889         System.Object. 
21890
21891         * expression.cs (Invocation.EmitCall): Handle the special case of
21892         calling methods declared on a reference type from a ValueType
21893         (Base classes System.Object and System.Enum)
21894
21895         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21896         the left hand side is a TypeExpr, not on every enumeration. 
21897
21898         (Binary.Resolve): If types are reference types, then do a cast to
21899         object on operators != and == of both arguments.
21900
21901         * typemanager.cs (FindMembers): Extract instance and static
21902         members if requested.
21903
21904         * interface.cs (PopulateProperty): Use void_type instead of null
21905         as the return type for the setter method.
21906
21907         (PopulateIndexer): ditto.
21908
21909 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21910
21911         * support.cs (ReflectionParameters): Fix minor bug where we
21912         were examining the wrong parameter for the ParamArray attribute.
21913
21914         Cope with requests for the type of the parameter at position
21915         greater than the params parameter's. We now return the element
21916         type of the params array as that makes more sense.
21917
21918         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21919         accordingly as we no longer have to extract the element type
21920         ourselves.
21921
21922         (Invocation.OverloadResolve): Update.
21923
21924 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21925
21926         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21927         against IEnumerator, test whether the return value is a descendant
21928         of the IEnumerator interface.
21929
21930         * class.cs (Indexer.Define): Use an auxiliary method to implement
21931         the other bits of the method definition.  Begin support for
21932         explicit interface implementation.
21933
21934         (Property.DefineMethod): Use TypeManager.void_type instead of null
21935         for an empty return value.
21936
21937 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21938
21939         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21940         dealing with a FieldExpr which is composed of a FieldBuilder, in
21941         the code path we did extract the constant, but we should have
21942         obtained the underlying value to be able to cast it (otherwise we
21943         end up in an infinite loop, this is what Ravi was running into).
21944
21945         (ArrayCreation.UpdateIndices): Arrays might be empty.
21946
21947         (MemberAccess.ResolveMemberAccess): Add support for section
21948         14.5.4.1 that deals with the special case of E.I when E is a type
21949         and something else, that I can be a reference to a static member.
21950
21951         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21952         handle a particular array type to create byte blobs, it is just
21953         something we dont generate byteblobs for.
21954
21955         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21956         arguments. 
21957
21958         * location.cs (Push): remove the key from the hashtable that we
21959         are about to add.   This happens for empty files.
21960
21961         * driver.cs: Dispose files after we have parsed them.
21962
21963         (tokenize): new function that only runs the tokenizer on its
21964         input, for speed testing.
21965
21966 2001-12-26  Ravi Pratap  <ravi@ximian.com>
21967
21968         * class.cs (Event.Define): Define the private field only if there
21969         are no accessors defined.
21970
21971         * expression.cs (ResolveMemberAccess): If there is no associated
21972         field with the event, that means we have an event defined with its
21973         own accessors and we should flag error cs0070 since transforming
21974         ourselves into a field is not valid in that case.
21975
21976         * ecore.cs (SimpleName.DoResolve): Same as above.
21977
21978         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
21979         and charset to sane values.
21980
21981 2001-12-25  Ravi Pratap  <ravi@ximian.com>
21982
21983         * assign.cs (DoResolve): Perform check on events only if they 
21984         are being accessed outside the declaring type.
21985
21986         * cs-parser.jay (event_declarations): Update rules to correctly
21987         set the type of the implicit parameter etc.
21988
21989         (add_accessor, remove_accessor): Set current local parameters.
21990
21991         * expression.cs (Binary): For delegate addition and subtraction,
21992         cast the return value from the method into the appropriate delegate
21993         type.
21994
21995 2001-12-24  Ravi Pratap  <ravi@ximian.com>
21996
21997         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
21998         of these as the workaround is unnecessary.
21999
22000         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22001         delegate data - none of that is needed at all.
22002
22003         Re-write bits to extract the instance expression and the delegate method
22004         correctly.
22005
22006         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22007         on delegates too.
22008
22009         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22010         of attaching attributes instead of duplicating code everywhere.
22011
22012         * everywhere : Update code to do attribute emission using the above method.
22013
22014 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22015
22016         * expression.cs (IsParamsMethodApplicable): if there are not
22017         parameters, return immediately.
22018
22019         * ecore.cs: The 0 literal can be implicity converted to an enum
22020         type. 
22021
22022         (SimpleName.DoResolve): First lookup the type, then lookup the
22023         members. 
22024
22025         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22026         want to get its address.  If the InstanceExpression is not
22027         addressable, store the result in a temporary variable, then get
22028         the address of it.
22029
22030         * codegen.cs: Only display 219 errors on warning level or above. 
22031
22032         * expression.cs (ArrayAccess): Make it implement the
22033         IMemoryLocation interface.
22034
22035         (Binary.DoResolve): handle the operator == (object a, object b)
22036         and operator != (object a, object b) without incurring into a
22037         BoxedCast (because 5 != o should never be performed).
22038
22039         Handle binary enumerator operators.
22040
22041         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22042         value type, otherwise use Ldelem_ref.
22043
22044         Use precomputed names;
22045
22046         (AddressOf): Implement address of
22047
22048         * cs-parser.jay (labeled_statement): Fix recursive block
22049         addition by reworking the production.
22050
22051         * expression.cs (New.DoEmit): New has a special case:
22052                 
22053                  If we are dealing with a ValueType, we have a few
22054                  situations to deal with:
22055                 
22056                     * The target of New is a ValueType variable, that is
22057                       easy, we just pass this as the variable reference
22058                 
22059                     * The target of New is being passed as an argument,
22060                       to a boxing operation or a function that takes a
22061                       ValueType.
22062                 
22063                       In this case, we need to create a temporary variable
22064                       that is the argument of New.
22065
22066
22067 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22068
22069         * rootcontext.cs (LookupType): Check that current_type is not null before
22070         going about looking at nested types.
22071
22072         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22073         not implement the IAssignMethod interface any more.
22074
22075         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22076         where we tranform them into FieldExprs if they are being resolved from within
22077         the declaring type.
22078
22079         * ecore.cs (SimpleName.DoResolve): Do the same here.
22080
22081         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22082
22083         * ../errors/bug10.cs : Add.
22084
22085         * ../errors/cs0070.cs : Add.
22086
22087         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22088
22089         * assign.cs : Get rid of EventIsLocal everywhere.
22090
22091 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22092
22093         * ecore.cs (ConvertIntLiteral): finished the implementation.
22094
22095         * statement.cs (SwitchLabel): Convert the value we are using as a
22096         key before looking up the table.
22097
22098 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22099
22100         * codegen.cs (EmitTopBlock): Require a Location argument now.
22101
22102         * cs-parser.jay (constructor_declarator): We need to setup
22103         current_local_parameters before we parse the
22104         opt_constructor_initializer, to allow the variables to be bound
22105         to the constructor arguments.
22106
22107         * rootcontext.cs (LookupType): First lookup nested classes in our
22108         class and our parents before we go looking outside our class.
22109
22110         * expression.cs (ConstantFold): Extract/debox the values at the
22111         beginnning. 
22112
22113         * rootcontext.cs (EmitCode): Resolve the constants first before we
22114         resolve the types.  This is not really needed, but it helps debugging.
22115
22116         * statement.cs: report location.
22117
22118         * cs-parser.jay: pass location to throw statement.
22119
22120         * driver.cs: Small bug fix.
22121
22122         * report.cs: Updated format to be 4-zero filled digits.
22123
22124 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22125
22126         * expression.cs (CheckIndices): Fix minor bug where the wrong
22127         variable was being referred to ;-)
22128
22129         (DoEmit): Do not call EmitStaticInitializers when the 
22130         underlying type is System.Object.
22131
22132 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22133
22134         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22135         and do the usual workaround for SRE.
22136
22137         * class.cs (MyEventBuilder.EventType): New member to get at the type
22138         of the event, quickly.
22139
22140         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22141
22142         * assign.cs (Assign.DoResolve): Handle the case when the target
22143         is an EventExpr and perform the necessary checks.
22144
22145         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22146         interface.
22147
22148         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22149
22150         (EventExpr): Set the type in the constructor itself since we 
22151         are meant to be born fully resolved.
22152
22153         (EventExpr.Define): Revert code I wrote earlier.
22154                 
22155         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22156         instance expression is null. The instance expression is a This in that case
22157         or a null, depending on whether it is a static method or not.
22158
22159         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22160         refers to more than one method.
22161
22162         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22163         and accordingly flag errors.
22164
22165 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22166
22167         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22168
22169 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22170
22171         * location.cs (ToString): Provide useful rutine.
22172
22173 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22174
22175         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22176         objects, return the actual integral boxed.
22177
22178         * statement.cs (SwitchLabel): define an ILLabel for each
22179         SwitchLabel. 
22180
22181         (Switch.CheckSwitch): If the value is a Literal, extract
22182         the underlying literal.
22183
22184         Also in the unused hashtable we had, add the SwitchLabel so we can
22185         quickly look this value up.
22186
22187         * constant.cs: Implement a bunch of new constants.  Rewrite
22188         Literal based on this.  Made changes everywhere to adapt to this.
22189
22190         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22191         dereferencing array only once, and also copes with enumrations.
22192
22193         bytes are two bytes wide, not one.
22194
22195         (Cast): Perform constant conversions.
22196
22197         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22198         wrappers to the literals here.
22199
22200         * expression.cs (DoNumericPromotions): long literals can converted
22201         to ulong implicity (this is taken care of elsewhere, but I was
22202         missing this spot).
22203
22204         * ecore.cs (Expression.Literalize): Make the return type Literal,
22205         to improve type checking.
22206
22207         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22208
22209 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22210
22211         * literal.cs: Revert code from ravi that checked the bounds.  The
22212         bounds are sane by the definition of the type itself. 
22213
22214         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22215         need to actually look up in our parent hierarchy for interfaces
22216         implemented. 
22217
22218         * const.cs: Use the underlying type for enumerations
22219
22220         * delegate.cs: Compute the basename for the delegate creation,
22221         that should fix the delegate test case, and restore the correct
22222         Type Lookup semantics in rootcontext
22223
22224         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22225         referencing a nested type with the Reflection API is using the "+"
22226         sign. 
22227
22228         * cs-parser.jay: Do not require EOF token at the end.
22229
22230 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22231
22232         * rootcontext.cs (LookupType): Concatenate type names with
22233         a '.' instead of a '+' The test suite passes again.
22234
22235         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22236         field of the enumeration.
22237
22238         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22239         the case when the member is an EventExpr.
22240
22241         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22242         static has an associated instance expression.
22243
22244         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22245
22246         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22247
22248         * class.cs (Event.Define): Register event and perform appropriate checks
22249         for error #111.
22250
22251         We define the Add and Remove methods even if the use provides none because
22252         in that case, we provide default implementations ourselves.
22253
22254         Define a private field of the type of the event. This is done by the CSC compiler
22255         and we should be doing it too ;-)
22256
22257         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22258         More methods we use in code we generate.
22259
22260         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22261         is important.
22262
22263         (InitCoreTypes): Update accordingly for the above.
22264
22265         * class.cs (Event.Emit): Generate code for default accessors that we provide
22266
22267         (EmitDefaultMethod): Do the job in the above.
22268
22269         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22270         appropriate place.
22271
22272 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22273
22274         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22275         builders even if we were missing one.
22276
22277         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22278         pass the Basename as our class name instead of the Name.  The
22279         basename will be correctly composed for us.
22280
22281         * parameter.cs (Paramters): Now takes a Location argument.
22282
22283         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22284         make all the code call directly LookupType in RootContext and take
22285         this chance to pass the Location information everywhere.
22286
22287         * Everywhere: pass Location information.
22288
22289 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22290
22291         * class.cs (Constructor.Define): Updated way of detecting the
22292         length of the parameters.
22293
22294         (TypeContainer.DefineType): Use basename as the type name for
22295         nested types.
22296
22297         (TypeContainer.Define): Do not recursively define types here, as
22298         definition is taken care in order by the RootContext.
22299
22300         * tree.cs: Keep track of namespaces in a per-file basis.
22301
22302         * parameter.cs (Parameter.ComputeSignature): Update to use
22303         DeclSpace. 
22304
22305         (Parameters.GetSignature): ditto.
22306
22307         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22308         instead of a TypeContainer.
22309
22310         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22311         resolve names.  Because we need to be resolve in our context, not
22312         our parents.
22313
22314         * driver.cs: Implement response files.
22315
22316         * class.cs (TypeContainer.DefineType): If we are defined, do not
22317         redefine ourselves.
22318
22319         (Event.Emit): Emit the code for add/remove handlers.
22320         (Event.Define): Save the MethodBuilders for add/remove.
22321
22322         * typemanager.cs: Use pair here too.
22323
22324         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22325         DictionaryEntry requires the first argument to be non-null.  
22326
22327         (enum_declaration): Compute full name for registering the
22328         enumeration.
22329
22330         (delegate_declaration): Instead of using
22331         formal_parameter_list, use opt_formal_parameter_list as the list
22332         can be empty.
22333
22334         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22335         (EventParsing): New property that controls whether `add' and
22336         `remove' are returned as tokens or identifiers (for events);
22337
22338 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22339
22340         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22341         use MyEventBuilder only and let it wrap the real builder for us.
22342
22343         (MyEventBuilder): Revamp constructor etc.
22344
22345         Implement all operations that we perform on EventBuilder in precisely the same
22346         way here too.
22347
22348         (FindMembers): Update to use the EventBuilder member.
22349
22350         (Event.Emit): Update accordingly.
22351
22352 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22353
22354         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22355         by calling the appropriate methods.
22356
22357         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22358         useful.
22359
22360         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22361
22362 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22363
22364         * delegate.cs (Delegate.Populate): Check that the return type
22365         and various parameters types are indeed accessible.
22366
22367         * class.cs (Constructor.Define): Same here.
22368
22369         (Field.Define): Ditto.
22370
22371         (Event.Define): Ditto.
22372
22373         (Operator.Define): Check that the underlying Method defined itself
22374         correctly - so it's MethodBuilder should not be null.
22375
22376         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22377         expression happens to be null.
22378
22379         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22380         members but as of now we don't seem to be able to do anything really useful with it.
22381
22382         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22383         not the EventBuilder.
22384
22385 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22386
22387         * cs-tokenizer.cs: Add support for defines.
22388         Add support for #if, #elif, #else, #endif
22389
22390         (eval_var): evaluates a variable.
22391         (eval): stubbed for evaluating functions.
22392
22393         * cs-parser.jay: Pass the defines information
22394
22395         * driver.cs: Add --define command line option.
22396
22397         * decl.cs: Move MemberCore here.
22398
22399         Make it the base class for DeclSpace.  This allows us to catch and
22400         report 108 and 109 for everything now.
22401
22402         * class.cs (TypeContainer.Define): Extract all the members
22403         before populating and emit the warning 108 (new keyword required
22404         to override) instead of having each member implement this.
22405
22406         (MemberCore.Define): New abstract method, we will be using this in
22407         the warning reporting engine in Populate.
22408
22409         (Operator.Define): Adjust to new MemberCore protocol. 
22410
22411         * const.cs (Const): This does not derive from Expression, it is a
22412         temporary object we use to create fields, it is a MemberCore. 
22413
22414         * class.cs (Method.Define): Allow the entry point to be in a
22415         specific class.
22416
22417         * driver.cs: Rewrite the argument handler to clean it up a bit.
22418
22419         * rootcontext.cs: Made it just an auxiliary namespace feature by
22420         making everything static.
22421
22422         * driver.cs: Adapt code to use RootContext type name instead of
22423         instance variable.
22424
22425         * delegate.cs: Remove RootContext argument.
22426
22427         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22428         argument. 
22429
22430         * class.cs (Event.Define): The lookup can fail.
22431
22432         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22433
22434         * expression.cs: Resolve the this instance before invoking the code.
22435
22436 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22437
22438         * cs-parser.jay: Add a production in element_access that allows
22439         the thing to become a "type" reference.  This way we can parse
22440         things like "(string [])" as a type.
22441
22442         Note that this still does not handle the more complex rules of
22443         casts. 
22444
22445
22446         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22447
22448         * ecore.cs: (CopyNewMethods): new utility function used to
22449         assemble the list of methods from running FindMembers.
22450
22451         (MemberLookup): Rework FindMembers so that 
22452
22453 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22454
22455         * class.cs (TypeContainer): Remove Delegates who fail to be
22456         defined.
22457
22458         * delegate.cs (Populate): Verify that we dont get null return
22459         values.   TODO: Check for AsAccessible.
22460
22461         * cs-parser.jay: Use basename to emit error 574 (destructor should
22462         have the same name as container class), not the full name.
22463
22464         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22465         possible representation.  
22466
22467         Also implements integer type suffixes U and L.
22468
22469 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22470
22471         * expression.cs (ArrayCreation.DoResolve): We need to do the
22472         argument resolution *always*.
22473
22474         * decl.cs: Make this hold the namespace.  Hold the root context as
22475         well.
22476         (LookupType): Move here.
22477
22478         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22479
22480         * location.cs (Row, Name): Fixed the code, it was always returning
22481         references to the first file.
22482
22483         * interface.cs: Register properties defined through interfaces.
22484
22485         * driver.cs: Add support for globbing on the command line
22486
22487         * class.cs (Field): Make it derive from MemberCore as well.
22488         (Event): ditto.
22489
22490 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22491
22492         * class.cs (Event::Define): Check that the type of the event is a delegate
22493         type else flag error #66.
22494
22495         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22496         same.
22497
22498         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22499         values of EntryPoint, CharSet etc etc.
22500
22501         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22502
22503         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22504         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22505         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22506         which needs this to do its work.
22507
22508         * ../errors/cs0066.cs : Add.
22509
22510 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22511
22512         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22513         helper functions.
22514
22515         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22516         clears out the parameters field.
22517         (MemberSignatureCompare): Cleanup
22518
22519         (MemberCore): New base class used to share code between MethodCore
22520         and Property.
22521
22522         (RegisterRequiredImplementations) BindingFlags.Public requires
22523         either BindingFlags.Instace or Static.  Use instance here.
22524
22525         (Property): Refactored code to cope better with the full spec.
22526
22527         * parameter.cs (GetParameterInfo): Return an empty array instead
22528         of null on error.
22529
22530         * class.cs (Property): Abstract or extern properties have no bodies.
22531
22532         * parameter.cs (GetParameterInfo): return a zero-sized array.
22533
22534         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22535         method modifier validation to the typecontainer so we can reuse
22536         this on properties.
22537
22538         (MethodCore.ParameterTypes): return an empty sized array of types.
22539
22540         (Property.Define): Test property modifier validity.
22541
22542         Add tests for sealed/override too.
22543
22544         (Method.Emit): abstract or extern methods have no bodies.
22545
22546 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22547
22548         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22549         thing.
22550
22551         (Method::Define, ::Emit): Modify accordingly.
22552
22553         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22554
22555         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22556
22557         * makefile: Pass in /unsafe.
22558
22559 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22560
22561         * class.cs (MakeKey): Kill routine.
22562
22563         * class.cs (TypeContainer.Define): Correctly define explicit
22564         method implementations (they require the full interface name plus
22565         the method name).
22566
22567         * typemanager.cs: Deply the PtrHashtable here and stop using the
22568         lame keys.  Things work so much better.
22569
22570         This of course broke everyone who depended on `RegisterMethod' to
22571         do the `test for existance' test.  This has to be done elsewhere.
22572
22573         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22574         the object stupid Equals method (because, that like fails all over
22575         the place).  We still do not use it.
22576
22577         * class.cs (TypeContainer.SetRequiredInterface,
22578         TypeContainer.RequireMethods): Killed these two routines and moved
22579         all the functionality to RegisterRequiredImplementations.
22580
22581         (TypeContainer.RegisterRequiredImplementations): This routine now
22582         registers all the implementations required in an array for the
22583         interfaces and abstract methods.  We use an array of structures
22584         which can be computed ahead of time to reduce memory usage and we
22585         also assume that lookups are cheap as most classes will not
22586         implement too many interfaces.
22587
22588         We also avoid creating too many MethodSignatures.
22589
22590         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22591         clear the "pending" bit if we find that there are problems with
22592         the declaration.
22593
22594         (TypeContainer.VerifyPendingMethods): Update to report errors of
22595         methods that look like implementations but are not.
22596
22597         (TypeContainer.Define): Add support for explicit interface method
22598         implementation. 
22599
22600 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22601
22602         * typemanager.cs: Keep track of the parameters here instead of
22603         being a feature of the TypeContainer.
22604
22605         * class.cs: Drop the registration of parameters here, as
22606         InterfaceMethods are also interface declarations.
22607
22608         * delegate.cs: Register methods with the TypeManager not only with
22609         the TypeContainer.  This code was buggy.
22610
22611         * interface.cs: Full registation here.
22612
22613 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22614
22615         * expression.cs: Remove reducer for binary expressions, it can not
22616         be done this way.
22617
22618         * const.cs: Put here the code that used to go into constant.cs
22619
22620         * constant.cs: Put here the code for constants, this is a new base
22621         class for Literals.
22622
22623         * literal.cs: Make Literal derive from Constant.
22624
22625 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22626
22627         * statement.cs (Return.Emit): Report error 157 if the user
22628         attempts to return from a finally block.
22629
22630         (Return.Emit): Instead of emitting a return, jump to the end of
22631         the function.
22632
22633         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22634         LocalBuilder to store the result of the function.  ReturnLabel is
22635         the target where we jump.
22636
22637
22638 2001-12-09  Radek Doulik  <rodo@ximian.com>
22639
22640         * cs-parser.jay: remember alias in current namespace
22641
22642         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22643         namespaces
22644
22645         * class.cs (LookupAlias): lookup alias in my_namespace
22646
22647         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22648         aliases hashtable
22649         (LookupAlias): lookup alias in this and if needed in parent
22650         namespaces
22651
22652 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22653
22654         * support.cs: 
22655
22656         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22657         making things static.  I need this to avoid passing the
22658         TypeContainer when calling ParameterType.
22659
22660         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22661         that did string manipulation to compute the type and then call
22662         GetType.  Use Parameter.ParameterType instead.
22663
22664         * cs-tokenizer.cs: Consume the suffix for floating values.
22665
22666         * expression.cs (ParameterReference): figure out whether this is a
22667         reference parameter or not.  Kill an extra variable by computing
22668         the arg_idx during emission.
22669
22670         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22671         function that returns whether a parameter is an out/ref value or not.
22672
22673         (Parameter.ParameterType): The type of the parameter (base,
22674         without ref/out applied).
22675
22676         (Parameter.Resolve): Perform resolution here.
22677         (Parameter.ExternalType): The full type (with ref/out applied).
22678
22679         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22680         support for expressions on the using statement.
22681
22682 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22683
22684         * statement.cs (Using.EmitLocalVariableDecls): Split the
22685         localvariable handling of the using statement.
22686
22687         (Block.EmitMeta): Keep track of variable count across blocks.  We
22688         were reusing slots on separate branches of blocks.
22689
22690         (Try.Emit): Emit the general code block, we were not emitting it. 
22691
22692         Check the type of the declaration to be an IDisposable or
22693         something that can be implicity converted to it. 
22694
22695         Emit conversions if required.
22696
22697         * ecore.cs (EmptyExpression): New utility class.
22698         (Expression.ImplicitConversionExists): New utility function.
22699
22700 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22701
22702         * statement.cs (Using): Implement.
22703
22704         * expression.cs (LocalVariableReference): Support read only variables.
22705
22706         * statement.cs: Remove the explicit emit for the Leave opcode.
22707         (VariableInfo): Add a readonly field.
22708
22709 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22710
22711         * ecore.cs (ConvCast): new class used to encapsulate the various
22712         explicit integer conversions that works in both checked and
22713         unchecked contexts.
22714
22715         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22716         properly generate the overflow opcodes.
22717
22718 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22719
22720         * statement.cs: The correct type for the EmptyExpression is the
22721         element_type, not the variable type.  Ravi pointed this out.
22722
22723 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22724
22725         * class.cs (Method::Define): Handle PInvoke methods specially
22726         by using DefinePInvokeMethod instead of the usual one.
22727
22728         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22729         above to do the task of extracting information and defining the method.
22730
22731 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22732
22733         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22734         of the condition for string type.
22735
22736         (Emit): Move that here. 
22737
22738         (ArrayCreation::CheckIndices): Keep string literals in their expression
22739         form.
22740
22741         (EmitDynamicInitializers): Handle strings appropriately.
22742
22743 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22744
22745         * codegen.cs (EmitContext): Replace multiple variables with a
22746         single pointer to the current Switch statement.
22747
22748         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22749         EmitContext.
22750
22751 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22752
22753         * statement.cs 
22754
22755         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22756         default'.
22757
22758         (Foreach.Emit): Foreach on arrays was not setting
22759         up the loop variables (for break/continue).
22760
22761         (GotoCase): Semi-implented.
22762
22763 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22764
22765         * attribute.cs (CheckAttribute): Handle system attributes by using
22766         Attribute.GetAttributes to examine information we need.
22767
22768         (GetValidPlaces): Same here.
22769
22770         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22771
22772         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22773
22774         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22775
22776         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22777
22778         (Method::Emit): Handle the case when we are a PInvoke method.
22779
22780 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22781
22782         * expression.cs: Use ResolveWithSimpleName on compound names.
22783
22784 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22785
22786         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22787         before trying to reduce it.
22788
22789         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22790
22791         * constant.cs (LookupConstantValue): Implement.
22792
22793         (EmitConstant): Use the above in emitting the constant.
22794
22795         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22796         that are user-defined by doing a LookupConstantValue on them.
22797
22798         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22799         too, like above.
22800
22801 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22802
22803         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22804
22805         (BaseAccess.DoResolve): Implement.
22806
22807         (MemberAccess.DoResolve): Split this routine into a
22808         ResolveMemberAccess routine that can be used independently
22809
22810 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22811
22812         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22813         As that share bits of the implementation.  Is returns a boolean,
22814         while As returns the Type that is being probed.
22815
22816 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22817
22818         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22819         instead of a Literal - much easier.
22820
22821         (EnumInTransit): Remove - utterly useless :-)
22822
22823         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22824
22825         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22826
22827         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22828         chain when we have no associated expression.
22829
22830 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22831
22832         * constant.cs (Define): Use Location while reporting the errror.
22833
22834         Also emit a warning when 'new' is used and there is no inherited
22835         member to hide.
22836
22837         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22838         populated.
22839
22840         (LookupEnumValue): Implement to lookup an enum member's value and define it
22841         if necessary.
22842
22843         (Populate): Re-write accordingly to use the above routine.
22844
22845 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22846
22847         * expression.cs (This): Fix prototype for DoResolveLValue to
22848         override the base class DoResolveLValue.
22849
22850         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22851         declarations) 
22852
22853         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22854         (we need to load the address of the field here).  This fixes
22855         test-22. 
22856
22857         (FieldExpr.DoResolveLValue): Call the DoResolve
22858         function to initialize the Instance expression.
22859
22860         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22861         correctly the GetEnumerator operation on a value type.
22862
22863         * cs-parser.jay: Add more simple parsing error catches.
22864
22865         * statement.cs (Switch): Add support for string switches.
22866         Handle null specially.
22867
22868         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22869
22870 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22871
22872         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22873
22874         (declare_local_constant): New helper function.
22875
22876         * statement.cs (AddConstant): Keep a separate record of constants
22877
22878         (IsConstant): Implement to determine if a variable is a constant.
22879
22880         (GetConstantExpression): Implement.
22881
22882         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22883
22884         * statement.cs (IsVariableDefined): Re-write.
22885
22886 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22887
22888         * class.cs (TypeContainer::FindMembers): Look for constants
22889         in the case when we are looking for MemberTypes.Field
22890
22891         * expression.cs (MemberAccess::DoResolve): Check that in the
22892         case we are a FieldExpr and a Literal, we are not being accessed
22893         by an instance reference.
22894
22895         * cs-parser.jay (local_constant_declaration): Implement.
22896
22897         (declaration_statement): Implement for constant declarations.
22898
22899 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22900
22901         * statement.cs (Switch): Catch double defaults.
22902
22903         (Switch): More work on the switch() statement
22904         implementation.  It works for integral values now, need to finish
22905         string support.
22906
22907
22908 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22909
22910         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22911         integer literals into other integer literals.  To be used by
22912         switch. 
22913
22914 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22915
22916         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22917         some memory.
22918
22919         (EmitDynamicInitializers): Cope with the above since we extract data
22920         directly from ArrayData now.
22921
22922         (ExpectInitializers): Keep track of whether initializers are mandatory
22923         or not.
22924
22925         (Bounds): Make it a hashtable to prevent the same dimension being 
22926         recorded for every element in that dimension.
22927
22928         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22929         from being found.
22930
22931         Also fix bug which was causing the indices to be emitted in the reverse
22932         order.
22933
22934 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22935
22936         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22937         unfinished.  They do not work, because the underlying code is
22938         sloppy.
22939
22940 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22941
22942         * cs-parser.jay: Remove bogus fixme.
22943
22944         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22945         on Switch statement.
22946
22947 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22948
22949         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22950         the same. 
22951
22952         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22953         parameter. Apparently, any expression is allowed. 
22954
22955         (ValidateInitializers): Update accordingly.
22956
22957         (CheckIndices): Fix some tricky bugs thanks to recursion.
22958
22959         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
22960         I was being completely brain-dead.
22961
22962         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
22963         and re-write acordingly.
22964
22965         (DelegateInvocation): Re-write accordingly.
22966
22967         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
22968
22969         (MakeByteBlob): Handle types more correctly.
22970
22971         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
22972         initialization from expressions but it is incomplete because I am a complete
22973         Dodo :-|
22974
22975 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22976
22977         * statement.cs (If.Emit): Fix a bug that generated incorrect code
22978         on If.  Basically, we have to return `true' (ie, we do return to
22979         our caller) only if both branches of the if return.
22980
22981         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
22982         short-circuit operators, handle them as short circuit operators. 
22983
22984         (Cast.DoResolve): Resolve type.
22985         (Cast.Cast): Take an expression as the target type.
22986
22987         * cs-parser.jay (cast_expression): Remove old hack that only
22988         allowed a limited set of types to be handled.  Now we take a
22989         unary_expression and we resolve to a type during semantic
22990         analysis.
22991
22992         Use the grammar productions from Rhys to handle casts (this is
22993         not complete like Rhys syntax yet, we fail to handle that corner
22994         case that C# has regarding (-x), but we will get there.
22995
22996 2001-11-22  Ravi Pratap  <ravi@ximian.com>
22997
22998         * class.cs (EmitFieldInitializer): Take care of the case when we have a
22999         field which is an array type.
23000
23001         * cs-parser.jay (declare_local_variables): Support array initialization too.
23002
23003         * typemanager.cs (MakeKey): Implement.
23004
23005         (everywhere): Use the above appropriately.
23006
23007         * cs-parser.jay (for_statement): Update for array initialization while
23008         declaring variables.
23009
23010         * ecore.cs : The error message was correct, it's the variable's names that
23011         were misleading ;-) Make the code more readable.
23012
23013         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23014         the correct type etc.
23015
23016         (ConvertExplicit): Handle Enum types by examining the underlying type.
23017
23018 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23019
23020         * parameter.cs (GetCallingConvention): Always return
23021         CallingConventions.Standard for now.
23022
23023 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23024
23025         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23026         and `r' after calling DoNumericPromotions.
23027
23028         * ecore.cs: Fix error message (the types were in the wrong order).
23029
23030         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23031         BindingFlags.Instance as well 
23032
23033         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23034         implicit int literal conversion in an empty cast so that we
23035         propagate the right type upstream.
23036
23037         (UnboxCast): new class used to unbox value types.
23038         (Expression.ConvertExplicit): Add explicit type conversions done
23039         by unboxing.
23040
23041         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23042         the target type before applying the implicit LongLiterals to ULong
23043         literal cast.
23044
23045 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23046
23047         * cs-parser.jay (for_statement): Reworked the way For works: now
23048         we declare manually any variables that are introduced in
23049         for_initializer to solve the problem of having out-of-band code
23050         emition (that is what got for broken).
23051
23052         (declaration_statement): Perform the actual variable declaration
23053         that used to be done in local_variable_declaration here.
23054
23055         (local_variable_declaration): Do not declare anything, just pass
23056         the information on a DictionaryEntry
23057
23058 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23059
23060         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23061         re-write of the logic to now make it recursive.
23062
23063         (UpdateIndices): Re-write accordingly.
23064
23065         Store element data in a separate ArrayData list in the above methods.
23066
23067         (MakeByteBlob): Implement to dump the array data into a byte array.
23068
23069 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23070
23071         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23072         into CheckIndices.
23073
23074         * constant.cs (Define): Implement.
23075
23076         (EmitConstant): Re-write fully.
23077
23078         Pass in location info.
23079
23080         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23081         respectively.
23082
23083         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23084         DictionaryEntry since we need location info too.
23085
23086         (constant_declaration): Update accordingly.
23087
23088         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23089         code into another method : UpdateIndices.
23090
23091 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23092
23093         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23094         some type checking etc.
23095
23096 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23097
23098         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23099         bits to provide dimension info if the user skips doing that.
23100
23101         Update second constructor to store the rank correctly.
23102
23103 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23104
23105         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23106         and try to implement.
23107
23108         * ../errors/cs0150.cs : Add.
23109
23110         * ../errors/cs0178.cs : Add.
23111
23112 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23113
23114         * statement.cs: Implement foreach on multi-dimensional arrays. 
23115
23116         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23117         name of the params argument.
23118
23119         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23120         initializing the array.
23121
23122         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23123         we can use this elsewhere.
23124
23125         * statement.cs: Finish implementation of foreach for single
23126         dimension arrays.
23127
23128         * cs-parser.jay: Use an out-of-band stack to pass information
23129         around, I wonder why I need this.
23130
23131         foreach_block: Make the new foreach_block the current_block.
23132
23133         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23134         function used to return a static Parameters structure.  Used for
23135         empty parameters, as those are created very frequently.
23136
23137         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23138
23139 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23140
23141         * interface.cs : Default modifier is private, not public. The
23142         make verify test passes again.
23143
23144 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23145
23146         * support.cs (ReflectionParameters): Fix logic to determine
23147         whether the last parameter is a params one. Test 9 passes again.
23148
23149         * delegate.cs (Populate): Register the builders we define with
23150         RegisterParameterForBuilder. Test 19 passes again.
23151
23152         * cs-parser.jay (property_declaration): Reference $6 instead
23153         of $$ to get at the location.
23154
23155         (indexer_declaration): Similar stuff.
23156
23157         (attribute): Ditto.
23158
23159         * class.cs (Property): Register parameters for the Get and Set methods
23160         if they exist. Test 23 passes again.
23161
23162         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23163         call to EmitArguments as we are sure there aren't any params arguments. 
23164         Test 32 passes again.
23165
23166         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23167         IndexOutOfRangeException. 
23168
23169         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23170         Test 33 now passes again.
23171
23172 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23173
23174         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23175         broke a bunch of things.  Will have to come up with a better way
23176         of tracking locations.
23177
23178         * statement.cs: Implemented foreach for single dimension arrays.
23179
23180 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23181
23182         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23183         an error.  This removes the lookup from the critical path.
23184
23185         * cs-parser.jay: Removed use of temporary_loc, which is completely
23186         broken. 
23187
23188 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23189
23190         * support.cs (ReflectionParameters.ParameterModifier): Report
23191         whether the argument is a PARAMS argument or not.
23192
23193         * class.cs: Set the attribute `ParamArrayAttribute' on the
23194         parameter argument.
23195
23196         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23197         and cons_param_array_attribute (ConstructorInfo for
23198         ParamArrayAttribute)., 
23199
23200         * codegen.cs: Emit the return using the `Return' statement, that
23201         way we can report the error correctly for missing return values. 
23202
23203         * class.cs (Method.Emit): Clean up.
23204
23205         * expression.cs (Argument.Resolve): Take another argument: the
23206         location where this argument is used.  Notice that this is not
23207         part of the "Argument" class as to reduce the size of the
23208         structure (we know the approximate location anyways).
23209
23210         Test if the argument is a variable-reference, if not, then
23211         complain with a 206.
23212
23213         (Argument.Emit): Emit addresses of variables.
23214
23215         (Argument.FullDesc): Simplify.
23216
23217         (Invocation.DoResolve): Update for Argument.Resolve.
23218
23219         (ElementAccess.DoResolve): ditto.
23220
23221         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23222         method should be virtual, as this method is always virtual.
23223
23224         (NewDelegate.DoResolve): Update for Argument.Resolve.
23225
23226         * class.cs (ConstructorInitializer.DoResolve): ditto.
23227
23228         * attribute.cs (Attribute.Resolve): ditto.
23229
23230 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23231
23232         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23233
23234         * expression.cs (ParameterReference): Drop IStackStorage and implement
23235         IAssignMethod instead. 
23236
23237         (LocalVariableReference): ditto.
23238
23239         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23240         IAssignMethod instead. 
23241
23242 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23243
23244         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23245         enumerations that are used in heavily used structures derive from
23246         byte in a laughable and pathetic attempt to reduce memory usage.
23247         This is the kind of pre-optimzations that you should not do at
23248         home without adult supervision.
23249
23250         * expression.cs (UnaryMutator): New class, used to handle ++ and
23251         -- separatedly from the other unary operators.  Cleans up the
23252         code, and kills the ExpressionStatement dependency in Unary.
23253
23254         (Unary): Removed `method' and `Arguments' from this class, making
23255         it smaller, and moving it all to SimpleCall, so I can reuse this
23256         code in other locations and avoid creating a lot of transient data
23257         strucutres when not required.
23258
23259         * cs-parser.jay: Adjust for new changes.
23260
23261 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23262
23263         * enum.cs (Enum.Populate): If there is a failure during
23264         definition, return
23265
23266         * cs-parser.jay (opt_enum_base): we used to catch type errors
23267         here, but this is really incorrect.  The type error should be
23268         catched during semantic analysis.
23269
23270 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23271
23272         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23273         current_local_parameters as expected since I, in my stupidity, had forgotten
23274         to do this :-)
23275
23276         * attribute.cs (GetValidPlaces): Fix stupid bug.
23277
23278         * class.cs (Method::Emit): Perform check on applicability of attributes.
23279
23280         (Constructor::Emit): Ditto.
23281
23282         (Field::Emit): Ditto.
23283
23284         (Field.Location): Store location information.
23285
23286         (Property, Event, Indexer, Operator): Ditto.
23287
23288         * cs-parser.jay (field_declaration): Pass in location for each field.
23289
23290         * ../errors/cs0592.cs : Add.
23291
23292 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23293
23294         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23295
23296         (InitCoreTypes): Update accordingly.
23297
23298         (RegisterAttrType, LookupAttr): Implement.
23299
23300         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23301         info about the same.
23302
23303         (Resolve): Update to populate the above as necessary.
23304
23305         (Error592): Helper.
23306
23307         (GetValidPlaces): Helper to the above.
23308
23309         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23310
23311         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23312
23313 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23314
23315         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23316
23317         * ../errors/cs0617.cs : Add.
23318
23319 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23320
23321         * enum.cs (Emit): Rename to Populate to be more consistent with what
23322         we expect it to do and when exactly it is called.
23323
23324         * class.cs, rootcontext.cs : Update accordingly.
23325
23326         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23327         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23328
23329         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23330
23331         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23332         of a fieldinfo using the above, when dealing with a FieldBuilder.
23333
23334 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23335
23336         * ../errors/cs0031.cs : Add.
23337
23338         * ../errors/cs1008.cs : Add.
23339
23340         * ../errrors/cs0543.cs : Add.
23341
23342         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23343         enum type.
23344
23345         (FindMembers): Implement.
23346
23347         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23348         enums and delegates too.
23349
23350         (enum_types): Rename to builder_to_enum.
23351
23352         (delegate_types): Rename to builder_to_delegate.
23353
23354         * delegate.cs (FindMembers): Implement.
23355
23356 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23357
23358         * typemanager.cs (IsEnumType): Implement.
23359
23360         * enum.cs (Emit): Re-write parts to account for the underlying type
23361         better and perform checking etc.
23362
23363         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23364         of the underlying type.
23365
23366         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23367         value
23368
23369         * enum.cs (error31): Helper to report error #31.
23370
23371         * cs-parser.jay (enum_declaration): Store location of each member too.
23372
23373         * enum.cs (member_to_location): New hashtable. 
23374
23375         (AddEnumMember): Update location hashtable.
23376
23377         (Emit): Use the location of each member while reporting errors.
23378
23379 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23380
23381         * cs-parser.jay: A for_initializer if is a
23382         local_variable_declaration really ammount to have an implicit
23383         block with the variable declaration and no initializer for for.
23384
23385         * statement.cs (For.Emit): Cope with null initializers.
23386
23387         This fixes the infinite loop on for initializers.
23388
23389 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23390
23391         * enum.cs: More cleanup.
23392
23393         * ecore.cs: Remove dead code.
23394
23395         * class.cs (Property.Emit): More simplification.
23396         (Event.Emit): ditto.
23397
23398         Reworked to have less levels of indentation.
23399
23400 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23401
23402         * class.cs (Property): Emit attributes.
23403
23404         (Field): Ditto.
23405
23406         (Event): Ditto.
23407
23408         (Indexer): Ditto.
23409
23410         (Operator): Ditto.
23411
23412         * enum.cs (Emit): Ditto.
23413
23414         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23415         Enums too.
23416
23417         * class.cs (Field, Event, etc.): Move attribute generation into the
23418         Emit method everywhere.
23419
23420         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23421         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23422         as we had no way of defining nested enums !
23423
23424         * rootcontext.cs : Adjust code accordingly.
23425
23426         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23427
23428 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23429
23430         * expression.cs (EvalConstantExpression): Move into ecore.cs
23431
23432         * enum.cs (Enum): Rename some members and make them public and readonly
23433         according to our convention.
23434
23435         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23436         nothing else.
23437
23438         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23439
23440         (Enum::Emit): Write a simple version for now which doesn't try to compute
23441         expressions. I shall modify this to be more robust in just a while.
23442
23443         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23444
23445         (TypeContainer::CloseType): Create the Enum types too.
23446
23447         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23448
23449         * expression.cs (EvalConstantExpression): Get rid of completely.
23450
23451         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23452         user-defined values and other cases.
23453
23454         (IsValidEnumLiteral): Helper function.
23455
23456         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23457         out there in the case we had a literal FieldExpr.
23458
23459         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23460
23461         (Literalize): Revamp a bit to take two arguments.
23462
23463         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23464
23465 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23466
23467         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23468
23469         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23470
23471         (Resolve): Use the above to ensure we have proper initializers.
23472
23473 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23474
23475         * expression.cs (Expression::EvalConstantExpression): New method to 
23476         evaluate constant expressions.
23477
23478         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23479
23480 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23481
23482         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23483         in an array.
23484
23485         (Binary.ResolveOperator): Handle operator != (object a, object b)
23486         and operator == (object a, object b);
23487
23488         (Binary.DoNumericPromotions): Indicate whether the numeric
23489         promotion was possible.
23490
23491         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23492         Implement.  
23493
23494         Made the ArrayAccess implement interface IAssignMethod instead of
23495         IStackStore as the order in which arguments are passed reflects
23496         this.
23497
23498         * assign.cs: Instead of using expr.ExprClass to select the way of
23499         assinging, probe for the IStackStore/IAssignMethod interfaces.
23500
23501         * typemanager.cs: Load InitializeArray definition.
23502
23503         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23504         static data that can be used to initialize arrays. 
23505
23506 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23507
23508         * expression.cs: Handle operator== and operator!= for booleans.
23509
23510         (Conditioal.Reduce): Implement reducer for the ?: operator.
23511
23512         (Conditional.Resolve): Implement dead code elimination.
23513
23514         (Binary.Resolve): Catch string literals and return a new
23515         concatenated string.
23516
23517         (Unary.Reduce): Implement reduction of unary expressions.
23518
23519         * ecore.cs: Split out the expression core handling here.
23520
23521         (Expression.Reduce): New method used to perform constant folding
23522         and CSE.  This is needed to support constant-expressions. 
23523
23524         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23525         targets, and optimize for !x.
23526
23527 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23528
23529         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23530         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23531         set custom atttributes.
23532
23533         * literal.cs (Literal::GetValue): New abstract method to return the actual
23534         value of the literal, cast as an object.
23535
23536         (*Literal): Implement GetValue method.
23537
23538         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23539         expressions to the arraylist but objects of type Argument.
23540
23541         * class.cs (TypeContainer::Emit): Emit our attributes too.
23542
23543         (Method::Emit, Constructor::Emit): Ditto.
23544
23545         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23546         to be ignoring earlier.
23547
23548 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23549
23550         * attribute.cs (AttributeSection::Define): Implement to do the business
23551         of constructing a CustomAttributeBuilder.
23552
23553         (Attribute): New trivial class. Increases readability of code.  
23554
23555         * cs-parser.jay : Update accordingly.
23556
23557         (positional_argument_list, named_argument_list, named_argument): New rules
23558
23559         (attribute_arguments): Use the above so that we are more correct.
23560
23561 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23562
23563         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23564         to perform all checks for a method with a params parameter.
23565
23566         (Invocation::OverloadResolve): Update to use the above method and therefore
23567         cope correctly with params method invocations.
23568
23569         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23570         params too.
23571
23572         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23573         constructors in our parent too because we can't afford to miss out on 
23574         protected ones ;-)
23575
23576         * attribute.cs (AttributeSection): New name for the class Attribute
23577
23578         Other trivial changes to improve readability.
23579
23580         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23581         use the new class names.
23582
23583 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23584
23585         * class.cs (Method::Define): Complete definition for params types too
23586
23587         (Indexer::Define): Ditto.
23588
23589         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23590         Cope everywhere with a request for info about the array parameter.
23591
23592 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23593
23594         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23595
23596         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23597         local_variable_type to extract the string corresponding to the type.
23598
23599         (local_variable_type): Fixup the action to use the new helper method.
23600
23601         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23602         go.
23603
23604         * expression.cs : Clean out code which uses the above.
23605
23606 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23607
23608         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23609         and bale out if necessary by returning a false.
23610
23611         (RegisterProperty): Ditto.
23612
23613         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23614         and print out appropriate error messages.
23615
23616         * interface.cs (everywhere): Ditto.
23617
23618         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23619         location to constructor.
23620
23621         * class.cs (Property, Event, Indexer): Update accordingly.
23622
23623         * ../errors/cs111.cs : Added.
23624
23625         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23626         of a method, as laid down by the spec.
23627
23628         (Invocation::OverloadResolve): Use the above method.
23629
23630 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23631
23632         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23633         now take a TypeContainer and a Parameters object.
23634
23635         (ParameterData): Modify return type of ParameterModifier method to be 
23636         Parameter.Modifier and not a string.
23637
23638         (ReflectionParameters, InternalParameters): Update accordingly.
23639
23640         * expression.cs (Argument::GetParameterModifier): Same here.
23641
23642         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23643         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23644         symbol in it at all so maybe this is only for now.
23645
23646 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23647
23648         * support.cs (InternalParameters): Constructor now takes an extra argument 
23649         which is the actual Parameters class.
23650
23651         (ParameterDesc): Update to provide info on ref/out modifiers.
23652
23653         * class.cs (everywhere): Update call to InternalParameters to pass in
23654         the second argument too.
23655
23656         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23657         to return the modifier info [ref/out etc]
23658
23659         (InternalParameters, ReflectionParameters): Implement the above.
23660
23661         * expression.cs (Argument::ParameterModifier): Similar function to return
23662         info about the argument's modifiers.
23663
23664         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23665         too.
23666
23667         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23668         a new SetFormalParameters object which we pass to InternalParameters.
23669
23670 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23671
23672         * expression.cs (NewArray): Merge into the ArrayCreation class.
23673
23674 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23675
23676         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23677         NewUserdefinedArray into one as there wasn't much of a use in having
23678         two separate ones.
23679
23680         * expression.cs (Argument): Change field's name to ArgType from Type.
23681
23682         (Type): New readonly property which returns the proper type, taking into 
23683         account ref/out modifiers.
23684
23685         (everywhere): Adjust code accordingly for the above.
23686
23687         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23688         whether we are emitting for a ref or out parameter.
23689
23690         * expression.cs (Argument::Emit): Use the above field to set the state.
23691
23692         (LocalVariableReference::Emit): Update to honour the flag and emit the
23693         right stuff.
23694
23695         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23696
23697         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23698
23699         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23700
23701         (ReflectionParameters, InternalParameters): Implement the above method.
23702
23703         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23704         reporting errors.
23705
23706         (Invocation::FullMethodDesc): Ditto. 
23707
23708 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23709
23710         * cs-parser.jay: Add extra production for the second form of array
23711         creation. 
23712
23713         * expression.cs (ArrayCreation): Update to reflect the above
23714         change. 
23715
23716         * Small changes to prepare for Array initialization.
23717
23718 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23719
23720         * typemanager.cs (ImplementsInterface): interface might be null;
23721         Deal with this problem;
23722
23723         Also, we do store negative hits on the cache (null values), so use
23724         this instead of calling t.GetInterfaces on the type everytime.
23725
23726 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23727
23728         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23729
23730         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23731         split functionality out into different classes.
23732
23733         (New::FormArrayType): Move into NewBuiltinArray.
23734
23735         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23736         quite useless.
23737
23738         (NewBuiltinArray): New class to handle creation of built-in arrays.
23739
23740         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23741         account creation of one-dimensional arrays.
23742
23743         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23744
23745         (NewUserdefinedArray::DoResolve): Implement.
23746
23747         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23748
23749         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23750         we maintain inside the TypeManager. This is necessary to perform lookups on the
23751         module builder.
23752
23753         (LookupType): Update to perform GetType on the module builders too.     
23754
23755         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23756
23757         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23758
23759 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23760
23761         * expression.cs (New::DoResolve): Implement guts of array creation.
23762
23763         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23764
23765 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23766
23767         * expression.cs: Fix bug I introduced lsat night that broke
23768         Delegates. 
23769
23770         (Expression.Resolve): Report a 246 error (can not resolve name)
23771         if we find a SimpleName in the stream.
23772
23773         (Expression.ResolveLValue): Ditto.
23774
23775         (Expression.ResolveWithSimpleName): This function is a variant of
23776         ResolveName, this one allows SimpleNames to be returned without a
23777         warning.  The only consumer of SimpleNames is MemberAccess
23778
23779 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23780
23781         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23782         might arrive here.  I have my doubts that this is correct.
23783
23784         * statement.cs (Lock): Implement lock statement.
23785
23786         * cs-parser.jay: Small fixes to support `lock' and `using'
23787
23788         * cs-tokenizer.cs: Remove extra space
23789
23790         * driver.cs: New flag --checked, allows to turn on integer math
23791         checking. 
23792
23793         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23794         Threading.Monitor.Exit 
23795
23796 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23797
23798         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23799         Expression Class to be IndexerAccess.
23800
23801         Notice that Indexer::DoResolve sets the eclass to Value.
23802
23803 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23804
23805         * class.cs (TypeContainer::Emit): Emit code for indexers.
23806
23807         * assign.cs (IAssignMethod): New interface implemented by Indexers
23808         and Properties for handling assignment.
23809
23810         (Assign::Emit): Simplify and reuse code. 
23811
23812         * expression.cs (IndexerAccess, PropertyExpr): Implement
23813         IAssignMethod, clean up old code. 
23814
23815 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23816
23817         * typemanager.cs (ImplementsInterface): New method to determine if a type
23818         implements a given interface. Provides a nice cache too.
23819
23820         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23821         method.
23822
23823         (ConvertReferenceExplicit): Ditto.
23824
23825         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23826         various methods, with correct names etc.
23827
23828         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23829         Operator.UnaryNegation.
23830
23831         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23832         we have a unary plus or minus operator.
23833
23834         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23835         UnaryMinus.
23836
23837         * everywhere : update accordingly.
23838
23839         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23840         respectively.
23841
23842         * class.cs (Method::Define): For the case where we are implementing a method
23843         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23844         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23845
23846 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23847
23848         * interface.cs (FindMembers): Implement to work around S.R.E
23849         lameness.
23850
23851         * typemanager.cs (IsInterfaceType): Implement.
23852
23853         (FindMembers): Update to handle interface types too.
23854
23855         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23856         use IsAssignableFrom as that is not correct - it doesn't work.
23857
23858         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23859         and accordingly override EmitStatement.
23860
23861         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23862         using the correct logic :-)
23863
23864 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23865
23866         * ../errors/cs-11.cs : Add to demonstrate error -11 
23867
23868 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23869
23870         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23871         then pass this as a hint to ResolveLValue.
23872
23873         * expression.cs (FieldExpr): Add Location information
23874
23875         (FieldExpr::LValueResolve): Report assignment to readonly
23876         variable. 
23877
23878         (Expression::ExprClassFromMemberInfo): Pass location information.
23879
23880         (Expression::ResolveLValue): Add new method that resolves an
23881         LValue. 
23882
23883         (Expression::DoResolveLValue): Default invocation calls
23884         DoResolve. 
23885
23886         (Indexers): New class used to keep track of indexers in a given
23887         Type. 
23888
23889         (IStackStore): Renamed from LValue, as it did not really describe
23890         what this did.  Also ResolveLValue is gone from this interface and
23891         now is part of Expression.
23892
23893         (ElementAccess): Depending on the element access type
23894
23895         * typemanager.cs: Add `indexer_name_type' as a Core type
23896         (System.Runtime.CompilerServices.IndexerNameAttribute)
23897
23898         * statement.cs (Goto): Take a location.
23899
23900 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23901
23902         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23903         if two delegates are compatible.
23904
23905         (NewDelegate::DoResolve): Update to take care of the case when
23906         we instantiate a delegate from another delegate.
23907
23908         * typemanager.cs (FindMembers): Don't even try to look up members
23909         of Delegate types for now.
23910
23911 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23912
23913         * delegate.cs (NewDelegate): New class to take care of delegate
23914         instantiation.
23915
23916         * expression.cs (New): Split the delegate related code out into 
23917         the NewDelegate class.
23918
23919         * delegate.cs (DelegateInvocation): New class to handle delegate 
23920         invocation.
23921
23922         * expression.cs (Invocation): Split out delegate related code into
23923         the DelegateInvocation class.
23924
23925 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23926
23927         * expression.cs (New::DoResolve): Implement delegate creation fully
23928         and according to the spec.
23929
23930         (New::DoEmit): Update to handle delegates differently.
23931
23932         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23933         because of which we were printing out arguments in reverse order !
23934
23935         * delegate.cs (VerifyMethod): Implement to check if the given method
23936         matches the delegate.
23937
23938         (FullDelegateDesc): Implement.
23939
23940         (VerifyApplicability): Implement.
23941
23942         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23943         delegate invocations too.
23944
23945         (Invocation::Emit): Ditto.
23946
23947         * ../errors/cs1593.cs : Added.
23948
23949         * ../errors/cs1594.cs : Added.
23950
23951         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23952
23953 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23954
23955         * typemanager.cs (intptr_type): Core type for System.IntPtr
23956
23957         (InitCoreTypes): Update for the same.
23958
23959         (iasyncresult_type, asynccallback_type): Ditto.
23960
23961         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
23962         correct.
23963
23964         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
23965         too.
23966
23967         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
23968         the builders for the 4 members of a delegate type :-)
23969
23970         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
23971         type.
23972
23973         * expression.cs (New::DoResolve): Implement guts for delegate creation.
23974
23975         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
23976
23977 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
23978
23979         * statement.cs (Break::Emit): Implement.   
23980         (Continue::Emit): Implement.
23981
23982         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23983         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23984         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
23985         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
23986         end loop
23987
23988         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
23989         properties that track the label for the current loop (begin of the
23990         loop and end of the loop).
23991
23992 2001-10-15  Ravi Pratap  <ravi@ximian.com>
23993
23994         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
23995         use of emitting anything at all.
23996
23997         * class.cs, rootcontext.cs : Get rid of calls to the same.
23998
23999         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24000
24001         (Populate): Define the constructor correctly and set the implementation
24002         attributes.
24003
24004         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24005         have been defined.
24006
24007         (AddDelegateType): Implement.
24008
24009         (IsDelegateType): Implement helper method.
24010
24011         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24012
24013         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24014         and accordingly handle it.
24015
24016         * delegate.cs (Populate): Take TypeContainer argument.
24017         Implement bits to define the Invoke method. However, I still haven't figured out
24018         how to take care of the native int bit :-(
24019
24020         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24021         Qualify the name of the delegate, not its return type !
24022
24023         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24024         conversion.
24025
24026         (StandardConversionExists): Checking for array types turns out to be recursive.
24027
24028         (ConvertReferenceExplicit): Implement array conversion.
24029
24030         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24031
24032 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24033
24034         * cs-parser.jay (delegate_declaration): Store the fully qualified
24035         name as it is a type declaration.
24036
24037         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24038         readonly.
24039
24040         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24041         as TypeContainer::DefineType.
24042
24043         (Populate): Method in which all the definition of the various methods (Invoke)
24044         etc is done.
24045
24046         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24047         see.
24048
24049         (CloseDelegate): Finally creates the delegate.
24050
24051         * class.cs (TypeContainer::DefineType): Update to define delegates.
24052         (Populate, Emit and CloseType): Do the same thing here too.
24053
24054         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24055         delegates in all these operations.
24056
24057 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24058
24059         * expression.cs: LocalTemporary: a new expression used to
24060         reference a temporary that has been created.
24061
24062         * assign.cs: Handle PropertyAccess back here, so that we can
24063         provide the proper semantic access to properties.
24064
24065         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24066         a few more explicit conversions. 
24067
24068         * modifiers.cs: `NEW' modifier maps to HideBySig.
24069
24070         * expression.cs (PropertyExpr): Make this into an
24071         ExpressionStatement, and support the EmitStatement code path. 
24072
24073         Perform get/set error checking, clean up the interface.
24074
24075         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24076         them into toplevel access objects.
24077
24078 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24079
24080         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24081         SRE.
24082
24083         * typemanager.cs: Keep track here of our PropertyBuilders again to
24084         work around lameness in SRE.
24085
24086 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24087
24088         * expression.cs (LValue::LValueResolve): New method in the
24089         interface, used to perform a second resolution pass for LValues. 
24090
24091         (This::DoResolve): Catch the use of this in static methods.
24092
24093         (This::LValueResolve): Implement.
24094
24095         (This::Store): Remove warning, assigning to `this' in structures
24096         is 
24097
24098         (Invocation::Emit): Deal with invocation of
24099         methods on value types.  We need to pass the address to structure
24100         methods rather than the object itself.  (The equivalent code to
24101         emit "this" for structures leaves the entire structure on the
24102         stack instead of a pointer to it). 
24103
24104         (ParameterReference::DoResolve): Compute the real index for the
24105         argument based on whether the method takes or not a `this' pointer
24106         (ie, the method is static).
24107
24108         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24109         value types returned from functions when we need to invoke a
24110         method on the sturcture.
24111
24112
24113 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24114
24115         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24116         defining the type in the Modulebuilder or Typebuilder. This is to take
24117         care of nested types which need to be defined on the TypeBuilder using
24118         DefineNestedMethod.
24119
24120         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24121         methods in RootContext, only ported to be part of TypeContainer.
24122
24123         (TypeContainer::GetInterfaceOrClass): Ditto.
24124
24125         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24126
24127         * interface.cs (Interface::DefineInterface): New method. Does exactly
24128         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24129         too.
24130
24131         (Interface::GetInterfaces): Move from RootContext here and port.
24132
24133         (Interface::GetInterfaceByName): Same here.
24134
24135         * rootcontext.cs (ResolveTree): Re-write.
24136
24137         (PopulateTypes): Re-write.
24138
24139         * class.cs (TypeContainer::Populate): Populate nested types too.
24140         (TypeContainer::Emit): Emit nested members too.
24141
24142         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24143         instead just use the name argument passed in as it is already fully
24144         qualified.
24145
24146         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24147         to TypeContainer mapping to see if a type is user-defined.
24148
24149         * class.cs (TypeContainer::CloseType): Implement. 
24150
24151         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24152         the default constructor.
24153
24154         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24155         twice.
24156
24157         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24158
24159         * interface.cs (CloseType): Create the type here.
24160
24161         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24162         the hierarchy.
24163
24164         Remove all the methods which are now in TypeContainer.
24165
24166 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24167
24168         * delegate.cs (Define): Re-write bits to define the delegate
24169         correctly.
24170
24171 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24172
24173         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24174
24175         * expression.cs (ImplicitReferenceConversion): handle null as well
24176         as a source to convert to any reference type.
24177
24178         * statement.cs (Return): Perform any implicit conversions to
24179         expected return type.  
24180
24181         Validate use of return statement.  
24182
24183         * codegen.cs (EmitContext): Pass the expected return type here.
24184
24185         * class.cs (Method, Constructor, Property): Pass expected return
24186         type to EmitContext.
24187
24188 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24189
24190         * expression.cs: Make DoResolve take an EmitContext instead of a
24191         TypeContainer.
24192
24193         Replaced `l' and `location' for `loc', for consistency.
24194
24195         (Error, Warning): Remove unneeded Tc argument.
24196
24197         * assign.cs, literal.cs, constant.cs: Update to new calling
24198         convention. 
24199
24200         * codegen.cs: EmitContext now contains a flag indicating whether
24201         code is being generated in a static method or not.
24202
24203         * cs-parser.jay: DecomposeQI, new function that replaces the old
24204         QualifiedIdentifier.  Now we always decompose the assembled
24205         strings from qualified_identifier productions into a group of
24206         memberaccesses.
24207
24208 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24209
24210         * rootcontext.cs: Deal with field-less struct types correctly now
24211         by passing the size option to Define Type.
24212
24213         * class.cs: Removed hack that created one static field. 
24214
24215 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24216
24217         * statement.cs: Moved most of the code generation here. 
24218
24219 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24220
24221         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24222         seem very right.
24223
24224         (ElementAccess): Remove useless bits for now - keep checks as the spec
24225         says.
24226
24227 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24228
24229         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24230         and start performing checks according to the spec.
24231
24232 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24233
24234         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24235         rank_specifiers instead.
24236
24237         (rank_specifiers): Change the order in which the rank specifiers are stored
24238
24239         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24240
24241         * expression.cs (ElementAccess): Implement the LValue interface too.
24242
24243 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24244
24245         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24246         except that user defined conversions are not included.
24247
24248         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24249         perform the conversion of the return type, if necessary.
24250
24251         (New::DoResolve): Check whether we are creating an array or an object
24252         and accordingly do the needful.
24253
24254         (New::Emit): Same here.
24255
24256         (New::DoResolve): Implement guts of array creation.
24257
24258         (New::FormLookupType): Helper function.
24259
24260 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24261
24262         * codegen.cs: Removed most of the code generation here, and move the
24263         corresponding code generation bits to the statement classes. 
24264
24265         Added support for try/catch/finalize and throw.
24266
24267         * cs-parser.jay: Added support for try/catch/finalize.
24268
24269         * class.cs: Catch static methods having the flags override,
24270         virtual or abstract.
24271
24272         * expression.cs (UserCast): This user cast was not really doing
24273         what it was supposed to do.  Which is to be born in fully resolved
24274         state.  Parts of the resolution were being performed at Emit time! 
24275
24276         Fixed this code.
24277
24278 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24279
24280         * expression.cs: Implicity convert the result from UserCast.
24281
24282 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24283
24284         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24285         prevented it from working correctly. 
24286
24287         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24288         merely ConvertImplicit.
24289
24290 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24291
24292         * typemanager.cs: Make the LookupTypeContainer function static,
24293         and not per-instance.  
24294
24295         * class.cs: Make static FindMembers (the one that takes a Type
24296         argument). 
24297
24298         * codegen.cs: Add EmitForeach here.
24299
24300         * cs-parser.jay: Make foreach a toplevel object instead of the
24301         inline expansion, as we need to perform semantic analysis on it. 
24302
24303 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24304
24305         * expression.cs (Expression::ImplicitUserConversion): Rename to
24306         UserDefinedConversion.
24307
24308         (Expression::UserDefinedConversion): Take an extra argument specifying 
24309         whether we look for explicit user conversions too.
24310
24311         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24312
24313         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24314
24315         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24316         with the appropriate arguments.
24317
24318         * cs-parser.jay (cast_expression): Record location too.
24319
24320         * expression.cs (Cast): Record location info.
24321
24322         (Expression::ConvertExplicit): Take location argument.
24323
24324         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24325         to determine if we are doing explicit conversions.
24326
24327         (UserCast::Emit): Update accordingly.
24328
24329         (Expression::ConvertExplicit): Report an error if everything fails.
24330
24331         * ../errors/cs0030.cs : Add.
24332
24333 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24334
24335         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24336         virtual and newslot bits. 
24337
24338         * class.cs (TypeContainer::RegisterRequiredImplementations):
24339         Record methods we need.
24340
24341         (TypeContainer::MakeKey): Helper function to make keys for
24342         MethodBases, since the Methodbase key is useless.
24343
24344         (TypeContainer::Populate): Call RegisterRequiredImplementations
24345         before defining the methods.   
24346
24347         Create a mapping for method_builders_to_methods ahead of time
24348         instead of inside a tight loop.
24349
24350         (::RequireMethods):  Accept an object as the data to set into the
24351         hashtable so we can report interface vs abstract method mismatch.
24352
24353 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24354
24355         * report.cs: Make all of it static.
24356
24357         * rootcontext.cs: Drop object_type and value_type computations, as
24358         we have those in the TypeManager anyways.
24359
24360         Drop report instance variable too, now it is a global.
24361
24362         * driver.cs: Use try/catch on command line handling.
24363
24364         Add --probe option to debug the error reporting system with a test
24365         suite. 
24366
24367         * report.cs: Add support for exiting program when a probe
24368         condition is reached.
24369
24370 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24371
24372         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24373         we do a forcible conversion regardless of type, to check if 
24374         ForceConversion returns a null.
24375
24376         (Binary::error19): Use location to report error.
24377
24378         (Unary::error23): Use location here too.
24379
24380         * ../errors/cs0019.cs : Check in.
24381
24382         * ../errors/cs0023.cs : Check in.
24383
24384         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24385         case of a non-null MethodInfo object with a length of 0 !
24386
24387         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24388         an applicable member - according to the spec :-)
24389         Also fix logic to find members in base types.
24390
24391         (Unary::ResolveOperator): Same here.
24392
24393         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24394         as I was getting thoroughly confused between this and error19 :-)
24395
24396         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24397         (::FindMostEncompassedType): Implement.
24398         (::FindMostEncompassingType): Implement.
24399         (::StandardConversionExists): Implement.
24400
24401         (UserImplicitCast): Re-vamp. We now need info about most specific
24402         source and target types so that we can do the necessary conversions.
24403
24404         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24405         mathematical union with no duplicates.
24406
24407 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24408
24409         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24410         in order from base classes to child classes, so that we can in
24411         child classes look up in our parent for method names and
24412         attributes (required for handling abstract, virtual, new, override
24413         constructs: we need to instrospect our base class, and if we dont
24414         populate the classes in order, the introspection might be
24415         incorrect.  For example, a method could query its parent before
24416         the parent has any methods and would determine that the parent has
24417         no abstract methods (while it could have had them)).
24418
24419         (RootContext::CreateType): Record the order in which we define the
24420         classes.
24421
24422 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24423
24424         * class.cs (TypeContainer::Populate): Also method definitions can
24425         fail now, keep track of this.
24426
24427         (TypeContainer::FindMembers): Implement support for
24428         DeclaredOnly/noDeclaredOnly flag.
24429
24430         (Constructor::Emit) Return the ConstructorBuilder.
24431
24432         (Method::Emit) Return the MethodBuilder. 
24433         Check for abstract or virtual methods to be public.
24434
24435         * rootcontext.cs (RootContext::CreateType): Register all the
24436         abstract methods required for the class to be complete and the
24437         interface methods that must be implemented. 
24438
24439         * cs-parser.jay: Report error 501 (method requires body if it is
24440         not marked abstract or extern).
24441
24442         * expression.cs (TypeOf::Emit): Implement.
24443
24444         * typemanager.cs: runtime_handle_type, new global type.
24445
24446         * class.cs (Property::Emit): Generate code for properties.
24447
24448 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24449
24450         * expression.cs (Unary::ResolveOperator): Find operators on base type
24451         too - we now conform exactly to the spec.
24452
24453         (Binary::ResolveOperator): Same here.
24454
24455         * class.cs (Operator::Define): Fix minor quirk in the tests.
24456
24457         * ../errors/cs0215.cs : Added.
24458
24459         * ../errors/cs0556.cs : Added.
24460
24461         * ../errors/cs0555.cs : Added.
24462
24463 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24464
24465         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24466         single integer which is really efficient
24467
24468 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24469
24470         *  expression.cs (Expression::ImplicitUserConversion): Use location
24471         even in the case when we are examining True operators.
24472  
24473         * class.cs (Operator::Define): Perform extensive checks to conform
24474         with the rules for operator overloading in the spec.
24475
24476         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24477         some of the other conversions mentioned in the spec.
24478
24479         * typemanager.cs (array_type): New static member for the System.Array built-in
24480         type.
24481
24482         (cloneable_interface): For System.ICloneable interface.
24483
24484         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24485         we start resolving the tree and populating types.
24486
24487         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24488  
24489 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24490
24491         * expression.cs (Expression::ExprClassFromMemberInfo,
24492         Expression::Literalize): Create literal expressions from
24493         FieldInfos which are literals.
24494
24495         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24496         type casts, because they were wrong.  The test suite in tests
24497         caught these ones.
24498
24499         (ImplicitNumericConversion): ushort to ulong requires a widening
24500         cast. 
24501
24502         Int32 constant to long requires widening cast as well.
24503
24504         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24505         for integers because the type on the stack is not i4.
24506
24507 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24508
24509         * expression.cs (report118): require location argument. 
24510
24511         * parameter.cs: Do not dereference potential null value.
24512
24513         * class.cs: Catch methods that lack the `new' keyword when
24514         overriding a name.  Report warnings when `new' is used without
24515         anything being there to override.
24516
24517         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24518
24519         * class.cs: Only add constructor to hashtable if it is non-null
24520         (as now constructors can fail on define).
24521
24522         (TypeManager, Class, Struct): Take location arguments.
24523
24524         Catch field instance initialization in structs as errors.
24525
24526         accepting_filter: a new filter for FindMembers that is static so
24527         that we dont create an instance per invocation.
24528
24529         (Constructor::Define): Catch errors where a struct constructor is
24530         parameterless 
24531
24532         * cs-parser.jay: Pass location information for various new
24533         constructs. 
24534
24535         * delegate.cs (Delegate): take a location argument.
24536
24537         * driver.cs: Do not call EmitCode if there were problesm in the
24538         Definition of the types, as many Builders wont be there. 
24539
24540         * decl.cs (Decl::Decl): Require a location argument.
24541
24542         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24543         into integers, and find the most appropiate integer for it.
24544
24545         * literal.cs: Implement ULongLiteral.
24546
24547         * rootcontext.cs: Provide better information about the location of
24548         failure when CreateType fails.
24549
24550 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24551
24552         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24553         as well.
24554
24555         * expression.cs (Binary::CheckShiftArguments): Add missing type
24556         computation.
24557         (Binary::ResolveOperator): Add type to the logical and and logical
24558         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24559         before.
24560
24561         (Binary::DoNumericPromotions): In the case where either argument
24562         is ulong (and most signed types combined with ulong cause an
24563         error) perform implicit integer constant conversions as well.
24564
24565 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24566
24567         * expression.cs (UserImplicitCast): Method should always be
24568         non-null. 
24569         (Invocation::BetterConversion): Simplified test for IntLiteral.
24570
24571         (Expression::ImplicitNumericConversion): Split this routine out.
24572         Put the code that performs implicit constant integer conversions
24573         here. 
24574
24575         (Expression::Resolve): Become a wrapper around DoResolve so we can
24576         check eclass and type being set after resolve.
24577
24578         (Invocation::Badness): Remove this dead function
24579
24580         (Binary::ResolveOperator): Do not compute the expensive argumnets
24581         unless we have a union for it.
24582
24583         (Probe::Emit): Is needs to do an isinst and then
24584         compare against null.
24585
24586         (::CanConvert): Added Location argument.  If the Location argument
24587         is null (Location.Null), then we do not report errors.  This is
24588         used by the `probe' mechanism of the Explicit conversion.  We do
24589         not want to generate an error for something that the user
24590         explicitly requested to be casted.  But the pipeline for an
24591         explicit cast first tests for potential implicit casts.
24592
24593         So for now, if the Location is null, it means `Probe only' to
24594         avoid adding another argument.   Might have to revise this
24595         strategy later.
24596
24597         (ClassCast): New class used to type cast objects into arbitrary
24598         classes (used in Explicit Reference Conversions).
24599
24600         Implement `as' as well.
24601
24602         Reverted all the patches from Ravi below: they were broken:
24603
24604                 * The use of `level' as a mechanism to stop recursive
24605                   invocations is wrong.  That was there just to catch the
24606                   bug with a strack trace but not as a way of addressing
24607                   the problem.
24608
24609                   To fix the problem we have to *understand* what is going
24610                   on and the interactions and come up with a plan, not
24611                   just get things going.
24612
24613                 * The use of the type conversion cache that I proposed
24614                   last night had an open topic: How does this work across
24615                   protection domains.  A user defined conversion might not
24616                   be public in the location where we are applying the
24617                   conversion, a different conversion might be selected
24618                   (ie, private A->B (better) but public B->A (worse),
24619                   inside A, A->B applies, but outside it, B->A will
24620                   apply).
24621
24622                 * On top of that (ie, even if the above is solved),
24623                   conversions in a cache need to be abstract.  Ie, `To
24624                   convert from an Int to a Short use an OpcodeCast', not
24625                   `To convert from an Int to a Short use the OpcodeCast on
24626                   the variable 5' (which is what this patch was doing).
24627
24628 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24629
24630         * expression.cs (Invocation::ConversionExists): Re-write to use
24631         the conversion cache
24632
24633         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24634         cache all conversions done, not just user-defined ones.
24635
24636         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24637         to determine if a conversion exists instead of acutually trying to 
24638         perform the conversion. It's faster too.
24639
24640         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24641         and only then attempt the implicit conversion.
24642
24643 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24644
24645         * expression.cs (ConvertImplicit): Use a cache for conversions
24646         already found. Check level of recursion and bail out if necessary.
24647
24648 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24649
24650         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24651         Export standard methods that we expect for string operations.
24652
24653         * statement.cs (Block::UsageWarning): Track usage of variables and
24654         report the errors for not used variables.
24655
24656         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24657         operator. 
24658
24659 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24660
24661         * codegen.cs: remove unnneded code 
24662
24663         * expression.cs: Removed BuiltinTypeAccess class
24664
24665         Fix the order in which implicit conversions are
24666         done.  
24667
24668         The previous fixed dropped support for boxed conversions (adding a
24669         test to the test suite now)
24670
24671         (UserImplicitCast::CanConvert): Remove test for source being null,
24672         that code is broken.  We should not feed a null to begin with, if
24673         we do, then we should track the bug where the problem originates
24674         and not try to cover it up here.
24675
24676         Return a resolved expression of type UserImplicitCast on success
24677         rather than true/false.  Ravi: this is what I was talking about,
24678         the pattern is to use a static method as a "constructor" for
24679         objects. 
24680
24681         Also, do not create arguments until the very last minute,
24682         otherwise we always create the arguments even for lookups that
24683         will never be performed. 
24684
24685         (UserImplicitCast::Resolve): Eliminate, objects of type
24686         UserImplicitCast are born in a fully resolved state. 
24687
24688         * typemanager.cs (InitCoreTypes): Init also value_type
24689         (System.ValueType). 
24690
24691         * expression.cs (Cast::Resolve): First resolve the child expression.
24692
24693         (LValue): Add new method AddressOf to be used by
24694         the `&' operator.  
24695
24696         Change the argument of Store to take an EmitContext instead of an
24697         ILGenerator, because things like FieldExpr need to be able to call
24698         their children expression to generate the instance code. 
24699
24700         (Expression::Error, Expression::Warning): Sugar functions for
24701         reporting errors.
24702
24703         (Expression::MemberLookup): Accept a TypeContainer instead of a
24704         Report as the first argument.
24705
24706         (Expression::ResolvePrimary): Killed.  I still want to improve
24707         this as currently the code is just not right.
24708
24709         (Expression::ResolveMemberAccess): Simplify, but it is still
24710         wrong. 
24711
24712         (Unary::Resolve): Catch errors in AddressOf operators.
24713
24714         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24715         index to a byte for the short-version, or the compiler will choose
24716         the wrong Emit call, which generates the wrong data.
24717
24718         (ParameterReference::Emit, ::Store): same.
24719
24720         (FieldExpr::AddressOf): Implement.
24721
24722         * typemanager.cs: TypeManager: made public variable instead of
24723         property.
24724
24725         * driver.cs: document --fatal.
24726
24727         * report.cs (ErrorMessage, WarningMessage): new names for the old
24728         Error and Warning classes.
24729
24730         * cs-parser.jay (member_access): Turn built-in access to types
24731         into a normal simplename
24732
24733 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24734
24735         * expression.cs (Invocation::BetterConversion): Fix to cope
24736         with q being null, since this was introducing a bug.
24737
24738         * expression.cs (ConvertImplicit): Do built-in conversions first.
24739
24740 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24741
24742         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24743
24744 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24745
24746         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24747         I had introduced long ago (what's new ?).
24748
24749         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24750         the work of all the checking. 
24751         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24752         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24753
24754         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24755         that is the right way. 
24756
24757         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24758         overloading resolution. Use everywhere instead of cutting and pasting code.
24759
24760         (Binary::ResolveOperator): Use MakeUnionSet.
24761
24762         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24763         we have to convert to bool types. Not complete yet.
24764
24765 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24766
24767         * typemanager.cs (TypeManager::CSharpName): support ushort.
24768
24769         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24770         to provide an expression that performsn an implicit constant int
24771         conversion (section 6.1.6).
24772         (Expression::ConvertImplicitRequired): Reworked to include
24773         implicit constant expression conversions.
24774
24775         (Expression::ConvertNumericExplicit): Finished.
24776
24777         (Invocation::Emit): If InstanceExpression is null, then it means
24778         that we perform a call on this.
24779
24780 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24781
24782         * expression.cs (Unary::Emit): Remove some dead code.
24783         (Probe): Implement Resolve and Emit for `is'.
24784         (Expression::ConvertImplicitRequired): Attempt to do constant
24785         expression conversions here.  Maybe should be moved to
24786         ConvertImplicit, but I am not sure.
24787         (Expression::ImplicitLongConstantConversionPossible,
24788         Expression::ImplicitIntConstantConversionPossible): New functions
24789         that tell whether is it possible to apply an implicit constant
24790         expression conversion.
24791
24792         (ConvertNumericExplicit): Started work on explicit numeric
24793         conversions.
24794
24795         * cs-parser.jay: Update operator constants.
24796
24797         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24798         (Parameters::GetSignature): Hook up VerifyArgs here.
24799         (Parameters::VerifyArgs): Verifies that no two arguments have the
24800         same name. 
24801
24802         * class.cs (Operator): Update the operator names to reflect the
24803         ones that the spec expects (as we are just stringizing the
24804         operator names).
24805
24806         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24807         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24808         previous usage did only work for our methods.
24809         (Expression::ConvertImplicit): Handle decimal implicit numeric
24810         conversions as well.
24811         (Expression::InternalTypeConstructor): Used to invoke constructors
24812         on internal types for default promotions.
24813
24814         (Unary::Emit): Implement special handling for the pre/post
24815         increment/decrement for overloaded operators, as they need to have
24816         the same semantics as the other operators.
24817
24818         (Binary::ResolveOperator): ditto.
24819         (Invocation::ConversionExists): ditto.
24820         (UserImplicitCast::Resolve): ditto.
24821
24822 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24823
24824         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24825         operator, return after emitting body. Regression tests pass again !
24826
24827         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24828         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24829         (Invocation::OverloadResolve): Ditto.
24830         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24831
24832         * everywhere : update calls to the above methods accordingly.
24833
24834 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24835
24836         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24837
24838         * expression.cs (ExpressionStatement): New base class used for
24839         expressions that can appear in statements, so that we can provide
24840         an alternate path to generate expression that do not leave a value
24841         on the stack.
24842
24843         (Expression::Emit, and all the derivatives): We no longer return
24844         whether a value is left on the stack or not.  Every expression
24845         after being emitted leaves a single value on the stack.
24846
24847         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24848         facilties of ExpressionStatement if possible.
24849
24850         * cs-parser.jay: Update statement_expression.
24851
24852 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24853
24854         * driver.cs: Change the wording of message
24855
24856 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24857
24858         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24859         the type of the expression to the return type of the method if
24860         we have an overloaded operator match ! The regression tests pass again !
24861         (Unary::ResolveOperator): Ditto.
24862
24863         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24864         to find "op_Implicit", not "implicit" ;-)
24865         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24866         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24867
24868         * everywhere : Correct calls to the above accordingly.
24869
24870         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24871         (ConvertImplicit): Do user-defined conversion if it exists.
24872
24873 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24874
24875         * assign.cs: track location.
24876         (Resolve): Use implicit conversions on assignment.
24877
24878         * literal.cs: Oops.  Not good, Emit of short access values should
24879         pass (Bytes) or the wrong argument will be selected.
24880
24881         * expression.cs (Unary::Emit): Emit code for -expr.
24882
24883         (Unary::ResolveOperator): Handle `Substract' for non-constants
24884         (substract from zero from the non-constants).
24885         Deal with Doubles as well. 
24886
24887         (Expression::ConvertImplicitRequired): New routine that reports an
24888         error if no implicit conversion exists. 
24889
24890         (Invocation::OverloadResolve): Store the converted implicit
24891         expressions if we make them
24892
24893 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24894
24895         * class.cs (ConstructorInitializer): Take a Location argument.
24896         (ConstructorBaseInitializer): Same here.
24897         (ConstructorThisInitializer): Same here.
24898
24899         * cs-parser.jay : Update all calls accordingly.
24900
24901         * expression.cs (Unary, Binary, New): Take location argument.
24902         Update accordingly everywhere.
24903
24904         * cs-parser.jay : Update all calls to the above to take a location
24905         argument.
24906
24907         * class.cs : Ditto.
24908
24909 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24910
24911         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24912         (Invocation::BetterConversion): Same here
24913         (Invocation::ConversionExists): Ditto.
24914
24915         (Invocation::ConversionExists): Implement.
24916
24917 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24918
24919         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24920         Also take an additional TypeContainer argument.
24921
24922         * All over : Pass in TypeContainer as argument to OverloadResolve.
24923
24924         * typemanager.cs (CSharpName): Update to check for the string type and return
24925         that too.
24926
24927         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24928         a given method.
24929
24930 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24931
24932         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24933         (Invocation::BetterFunction): Implement.
24934         (Invocation::BetterConversion): Implement.
24935         (Invocation::ConversionExists): Skeleton, no implementation yet.
24936
24937         Okay, things work fine !
24938
24939 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24940
24941         * typemanager.cs: declare and load enum_type, delegate_type and
24942         void_type. 
24943
24944         * expression.cs (Expression::Emit): Now emit returns a value that
24945         tells whether a value is left on the stack or not.  This strategy
24946         might be reveted tomorrow with a mechanism that would address
24947         multiple assignments.
24948         (Expression::report118): Utility routine to report mismatches on
24949         the ExprClass.
24950
24951         (Unary::Report23): Report impossible type/operator combination
24952         utility function.
24953
24954         (Unary::IsIncrementableNumber): Whether the type can be
24955         incremented or decremented with add.
24956         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24957         complemented. 
24958         (Unary::ResolveOperator): Implement ++, !, ~,
24959
24960         (Invocation::Emit): Deal with new Emit convetion.
24961
24962         * All Expression derivatives: Updated their Emit method to return
24963         whether they leave values on the stack or not.
24964
24965         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
24966         stack for expressions that are statements. 
24967
24968 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24969
24970         * expression.cs (LValue): New interface.  Must be implemented by
24971         LValue objects.
24972         (LocalVariableReference, ParameterReference, FieldExpr): Implement
24973         LValue interface.
24974
24975         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
24976         interface for generating code, simplifies the code.
24977
24978 2001-09-20  Ravi Pratap  <ravi@ximian.com>
24979
24980         * expression.cs (everywhere): Comment out return statements in ::Resolve
24981         methods to avoid the warnings.
24982
24983 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
24984
24985         * driver.cs (parse): Report error 2001 if we can not open the
24986         source file.
24987
24988         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
24989         not resolve it.
24990
24991         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
24992         object. 
24993
24994         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
24995         otherwise nested blocks end up with the same index.
24996
24997         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
24998
24999         * expression.cs:  Instead of having FIXMEs in the Resolve
25000         functions, throw exceptions so it is obvious that we are facing a
25001         bug. 
25002
25003         * cs-parser.jay (invocation_expression): Pass Location information.
25004
25005         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25006         Use a basename for those routines because .NET does not like paths
25007         on them. 
25008
25009         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25010         already defined.
25011
25012 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25013
25014         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25015         are loading the correct data types (throws an exception if not).
25016         (TypeManager::InitCoreTypes): Use CoreLookupType
25017
25018         * expression.cs (Unary::ResolveOperator): return the child
25019         expression for expressions which are just +expr.
25020         (Unary::ResolveOperator): Return negative literals for -LITERAL
25021         expressions (otherwise they are Unary {Literal}).
25022         (Invocation::Badness): Take into account `Implicit constant
25023         expression conversions'.
25024
25025         * literal.cs (LongLiteral): Implement long literal class.
25026         (IntLiteral): export the `Value' of the intliteral. 
25027
25028 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25029
25030         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25031
25032         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25033         instead of 'Operator'
25034
25035         * expression.cs (Binary::ResolveOperator): Update accordingly.
25036         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25037         and 'Minus'
25038
25039         * cs-parser.jay (unary_expression): Update to use the new names.
25040
25041         * gen-treedump.cs (GetUnary): Same here.
25042
25043         * expression.cs (Unary::Resolve): Implement.
25044         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25045         operators are found instead of making noise ;-)
25046         (Unary::ResolveOperator): New method to do precisely the same thing which
25047         Binary::ResolveOperator does for Binary expressions.
25048         (Unary.method, .Arguments): Add.
25049         (Unary::OperName): Implement.   
25050         (Unary::ForceConversion): Copy and Paste !
25051
25052         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25053         a unary operator.
25054
25055         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25056         for the inbuilt operators. Only overloading works for now ;-)
25057
25058 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25059
25060         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25061         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25062
25063         * expression.cs (This::Emit): Implement. 
25064         (This::Resolve): Implement.
25065         (TypeOf:Resolve): Implement.
25066         (Expression::ResolveSimpleName): Add an implicit this to instance
25067         field references. 
25068         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25069         Bind instance variable to Field expressions.
25070         (FieldExpr::Instance): New field used to track the expression that
25071         represents the object instance.
25072         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25073         binding 
25074         (FieldExpr::Emit): Implement.
25075
25076         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25077         the last instruction contains a return opcode to avoid generating
25078         the last `ret' instruction (this generates correct code, and it is
25079         nice to pass the peverify output).
25080
25081         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25082         initializer for static and instance variables.
25083         (Constructor::Emit): Allow initializer to be null in the case of
25084         static constructors.  Only emit initializer for instance
25085         constructors. 
25086
25087         (TypeContainer::FindMembers): Return a null array if there are no
25088         matches.
25089
25090         Also fix the code for the MemberTypes.Method branch, as it was not
25091         scanning that for operators (or tried to access null variables before).
25092
25093         * assign.cs (Assign::Emit): Handle instance and static fields. 
25094
25095         * TODO: Updated.
25096
25097         * driver.cs: Stop compilation if there are parse errors.
25098
25099         * cs-parser.jay (constructor_declaration): Provide default base
25100         initializer for non-static constructors.
25101         (constructor_declarator): Do not provide a default base
25102         initializers if none was specified.
25103         Catch the fact that constructors should not have parameters.
25104
25105         * class.cs: Do not emit parent class initializers for static
25106         constructors, that should be flagged as an error.
25107
25108 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25109
25110         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25111         Move back code into TypeContainer::Populate.
25112
25113 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25114
25115         * class.cs (TypeContainer::AddConstructor): Fix the check to
25116         compare against Name, not Basename. 
25117         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25118
25119         * cs-parser.jay : Update accordingly.
25120
25121         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25122         for methods, don't forget to look into the operators too.
25123         (RegisterMethodBuilder): Helper method to take care of this for
25124         methods, constructors and operators.
25125         (Operator::Define): Completely revamp.
25126         (Operator.OperatorMethod, MethodName): New fields.
25127         (TypeContainer::Populate): Move the registering of builders into
25128         RegisterMethodBuilder.
25129         (Operator::Emit): Re-write.
25130
25131         * expression.cs (Binary::Emit): Comment out code path to emit method
25132         invocation stuff for the case when we have a user defined operator. I am
25133         just not able to get it right !
25134
25135 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25136
25137         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25138         argument. 
25139
25140         (Expression::MemberLookup): Provide a version that allows to
25141         specify the MemberTypes and BindingFlags. 
25142
25143         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25144         so it was not fetching variable information from outer blocks.
25145
25146         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25147         Beforefieldinit as it was buggy.
25148
25149         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25150         that Ravi put here.  
25151
25152         * class.cs (Constructor::Emit): Only emit if block is not null.
25153         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25154         deal with this by semantically definining it as if the user had
25155         done it.
25156
25157         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25158         constructors as we now "emit" them at a higher level.
25159
25160         (TypeContainer::DefineDefaultConstructor): Used to define the
25161         default constructors if none was provided.
25162
25163         (ConstructorInitializer): Add methods Resolve and Emit. 
25164
25165         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25166
25167 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25168
25169         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25170         the default constructor builder with our hashtable for methodbuilders
25171         to methodcores.
25172
25173         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25174         and argument_count is 0 in which case we have a match.
25175         (Binary::ResolveOperator): More null checking and miscellaneous coding
25176         style cleanup.
25177
25178 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25179
25180         * rootcontext.cs (IsNameSpace): Compare against null.
25181
25182         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25183
25184         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25185         and Unary::Operator.
25186
25187         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25188         accordingly.
25189
25190         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25191         we have overloaded operators.
25192         (Binary::ResolveOperator): Implement the part which does the operator overload
25193         resolution.
25194
25195         * class.cs (Operator::Emit): Implement.
25196         (TypeContainer::Emit): Emit the operators we have too.
25197
25198         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25199         the case when we have a user-defined operator.
25200
25201 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25202
25203         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25204
25205 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25206
25207         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25208         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25209         (Constructor::Emit): Implement.
25210         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25211         if we have no work to do. 
25212         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25213         Emit method.
25214
25215         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25216         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25217
25218         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25219         of parent.parent.
25220
25221 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25222
25223         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25224         in the source.
25225         (Tree::RecordNamespace): Method to do what the name says ;-)
25226         (Tree::Namespaces): Property to get at the namespaces hashtable.
25227
25228         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25229         keep track.
25230
25231         * rootcontext.cs (IsNamespace): Fixed it :-)
25232
25233 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25234
25235         * class.cs (TypeContainer::FindMembers): Add support for
25236         constructors. 
25237         (MethodCore): New class that encapsulates both the shared aspects
25238         of a Constructor and a Method.  
25239         (Method, Constructor): Factored pieces into MethodCore.
25240
25241         * driver.cs: Added --fatal which makes errors throw exceptions.
25242         Load System assembly as well as part of the standard library.
25243
25244         * report.cs: Allow throwing exceptions on errors for debugging.
25245
25246         * modifiers.cs: Do not use `parent', instead use the real type
25247         container to evaluate permission settings.
25248
25249         * class.cs: Put Ravi's patch back in.  He is right, and we will
25250         have to cope with the
25251
25252 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25253
25254         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25255         FamORAssem, not FamANDAssem.
25256
25257 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25258
25259         * driver.cs: Added --parse option that only parses its input files
25260         and terminates.
25261
25262         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25263         incorrect.  IsTopLevel is not used to tell whether an object is
25264         root_types or not (that can be achieved by testing this ==
25265         root_types).  But to see if this is a top-level *class* (not
25266         necessarly our "toplevel" container). 
25267
25268 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25269
25270         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25271         parent instead of a direct call to GetType.
25272
25273 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25274
25275         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25276         Modifiers.TypeAttr. This should just be a call to that method.
25277
25278         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25279         object so that we can determine if we are top-level or not.
25280
25281         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25282         TypeContainer too.
25283
25284         * enum.cs (Enum::Define): Ditto.
25285
25286         * modifiers.cs (FieldAttr): Re-write.
25287
25288         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25289         (TypeContainer::HaveStaticConstructor): New property to provide access
25290         to precisely that info.
25291
25292         * modifiers.cs (MethodAttr): Re-write.
25293         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25294
25295         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25296         of top-level types as claimed.
25297
25298 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25299
25300         * expression.cs (MemberLookup): Fruitless attempt to lookup
25301         constructors.  Maybe I need to emit default constructors?  That
25302         might be it (currently .NET emits this for me automatically).
25303         (Invocation::OverloadResolve): Cope with Arguments == null.
25304         (Invocation::EmitArguments): new function, shared by the new
25305         constructor and us.
25306         (Invocation::Emit): Handle static and instance methods.  Emit
25307         proper call instruction for virtual or non-virtual invocations.
25308         (New::Emit): Implement.
25309         (New::Resolve): Implement.
25310         (MemberAccess:Resolve): Implement.
25311         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25312         to track instances.
25313         (FieldExpr::Resolve): Set type.
25314
25315         * support.cs: Handle empty arguments.
25316                 
25317         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25318         SimpleLookup): Auxiliary routines to help parse a qualifier
25319         identifier.  
25320
25321         Update qualifier_identifier rule.
25322
25323         * codegen.cs: Removed debugging messages.
25324
25325         * class.cs: Make this a global thing, this acts just as a "key" to
25326         objects that we might have around.
25327
25328         (Populate): Only initialize method_builders_to_methods once.
25329
25330         * expression.cs (PropertyExpr): Initialize type from the
25331         PropertyType. 
25332
25333         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25334         Resolve pattern.  Attempt to implicitly convert value to boolean.
25335         Emit code.
25336
25337         * expression.cs: Set the type for the int32/int32 argument case.
25338         (Binary::ResolveOperator): Set the return type to boolean for
25339         comparission operators
25340
25341         * typemanager.cs: Remove debugging print code.
25342
25343         (Invocation::Resolve): resolve type.
25344
25345         * class.cs: Allocate a MemberInfo of the correct size, as the code
25346         elsewhere depends on the test to reflect the correct contents.
25347
25348         (Method::) Keep track of parameters, due to System.Reflection holes
25349
25350         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25351         mapping here.
25352
25353         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25354         of the exact size and return that.
25355
25356         (Class::LookupMethodByBuilder): New function that maps
25357         MethodBuilders to its methods.  Required to locate the information
25358         on methods because System.Reflection bit us again.
25359
25360         * support.cs: New file, contains an interface ParameterData and
25361         two implementations: ReflectionParameters and InternalParameters
25362         used to access Parameter information.  We will need to grow this
25363         as required.
25364
25365         * expression.cs (Invocation::GetParameterData): implement a cache
25366         and a wrapper around the ParameterData creation for methods. 
25367         (Invocation::OverloadResolve): Use new code.
25368
25369 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25370
25371         * class.cs (TypeContainer::EmitField): Remove and move into 
25372         (Field::Define): here and modify accordingly.
25373         (Field.FieldBuilder): New member.
25374         (TypeContainer::Populate): Update accordingly.
25375         (TypeContainer::FindMembers): Implement.
25376
25377 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25378
25379         * statement.cs: (VariableInfo::VariableType): New field to be
25380         initialized with the full type once it is resolved. 
25381
25382 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25383
25384         * parameter.cs (GetParameterInfo): Use a type cache to compute
25385         things only once, and to reuse this information
25386
25387         * expression.cs (LocalVariableReference::Emit): Implement.
25388         (OpcodeCast::Emit): fix.
25389
25390         (ParameterReference::Resolve): Implement.
25391         (ParameterReference::Emit): Implement.
25392
25393         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25394         that are expressions need to stay as Expressions.
25395
25396         * typemanager.cs (CSharpName): Returns the C# name of a type if
25397         possible. 
25398
25399         * expression.cs (Expression::ConvertImplicit): New function that
25400         implements implicit type conversions.
25401
25402         (Expression::ImplicitReferenceConversion): Implements implicit
25403         reference conversions.
25404
25405         (EmptyCast): New type for transparent casts.
25406
25407         (OpcodeCast): New type for casts of types that are performed with
25408         a sequence of bytecodes.
25409
25410         (BoxedCast): New type used for casting value types into reference
25411         types.  Emits a box opcode.
25412
25413         (Binary::DoNumericPromotions): Implements numeric promotions of
25414         and computation of the Binary::Type.
25415
25416         (Binary::EmitBranchable): Optimization.
25417
25418         (Binary::Emit): Implement code emission for expressions.
25419
25420         * typemanager.cs (TypeManager): Added two new core types: sbyte
25421         and byte.
25422
25423 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25424
25425         * class.cs (TypeContainer::FindMembers): Method which does exactly
25426         what Type.FindMembers does, only we don't have to use reflection. No
25427         implementation yet.
25428
25429         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25430         typecontainer objects as we need to get at them.
25431         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25432
25433         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25434         typecontainer object.
25435
25436         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25437         of just a Report object.
25438
25439 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25440
25441         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25442         "remove_"
25443         (TypeContainer::Populate): Now define the delegates of the type too.
25444         (TypeContainer.Delegates): Property to access the list of delegates defined
25445         in the type.
25446
25447         * delegates.cs (Delegate::Define): Implement partially.
25448
25449         * modifiers.cs (TypeAttr): Handle more flags.
25450
25451 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25452
25453         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25454         and not <=
25455         (Operator::Define): Re-write logic to get types by using the LookupType method
25456         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25457         (Indexer::Define): Ditto.
25458         (Event::Define): Ditto.
25459         (Property::Define): Ditto.
25460
25461 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25462
25463         * class.cs (TypeContainer::Populate): Now define operators too. 
25464         (TypeContainer.Operators): New property to access the list of operators
25465         in a type.
25466         (Operator.OperatorMethodBuilder): New member to hold the method builder
25467         for the operator we are defining.
25468         (Operator::Define): Implement.
25469
25470 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25471
25472         * class.cs (Event::Define): Make the prefixes of the accessor methods
25473         addOn_ and removeOn_ 
25474
25475         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25476         of the location being passed in too. Ideally, this should go later since all
25477         error reporting should be done through the Report object.
25478
25479         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25480         (Populate): Iterate thru the indexers we have and define them too.
25481         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25482         for the get and set accessors.
25483         (Indexer::Define): Implement.
25484
25485 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25486
25487         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25488         my previous implementation, did not work.
25489
25490         * typemanager.cs: Add a couple of missing types (the longs).
25491
25492         * literal.cs: Use TypeManager.bool_type instead of getting it.
25493
25494         * expression.cs (EventExpr): New kind of expressions.
25495         (Expressio::ExprClassFromMemberInfo): finish
25496
25497 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25498
25499         * assign.cs: Emit stores to static fields differently.
25500
25501 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25502
25503         * Merge in changes and adjust code to tackle conflicts. Backed out my
25504         code in Assign::Resolve ;-) 
25505
25506 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25507
25508         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25509         instead Report.Error and also pass in the location.
25510         (CSharpParser::Lexer): New readonly property to return the reference
25511         to the Tokenizer object.
25512         (declare_local_variables): Use Report.Error with location instead of plain 
25513         old error.
25514         (CheckDef): Ditto.
25515
25516         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25517         (Operator.CheckBinaryOperator): Ditto.
25518
25519         * cs-parser.jay (operator_declarator): Update accordingly.
25520
25521         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25522         (CheckBinaryOperator): Same here.
25523
25524         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25525         on the name without any prefixes of namespace names etc. This is because we
25526         already might have something already fully qualified like 
25527         'System.Console.WriteLine'
25528
25529         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25530
25531 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25532
25533         * cs-tokenizer.cs (location): Return a string which also contains
25534         the file name.
25535
25536         * expression.cs (ElementAccess): New class for expressions of the
25537         type 'element access.'
25538         (BaseAccess): New class for expressions of the type 'base access.'
25539         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25540         respectively.
25541
25542         * cs-parser.jay (element_access): Implement action.
25543         (base_access): Implement actions.
25544         (checked_expression, unchecked_expression): Implement.
25545
25546         * cs-parser.jay (local_variable_type): Correct and implement.
25547         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25548
25549         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25550
25551         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25552         name and the specifiers.
25553
25554         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25555
25556         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25557         making them all public ;-)
25558
25559         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25560         class anyways.
25561
25562 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25563
25564         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25565         PropertyExprs.
25566         (FieldExpr, PropertyExprs): New resolved expressions.
25567         (SimpleName::MemberStaticCheck): Perform static checks for access
25568         to non-static fields on static methods. Maybe this should be
25569         generalized for MemberAccesses. 
25570         (SimpleName::ResolveSimpleName): More work on simple name
25571         resolution. 
25572
25573         * cs-parser.jay (primary_expression/qualified_identifier): track
25574         the parameter index.
25575
25576         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25577         (EmitContext::EmitBoolExpression): Chain to expression generation
25578         instead of temporary hack.
25579         (::EmitStatementExpression): Put generic expression code generation.
25580
25581         * assign.cs (Assign::Emit): Implement variable assignments to
25582         local variables, parameters and fields.
25583
25584 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25585
25586         * statement.cs (Block::GetVariableInfo): New method, returns the
25587         VariableInfo for a variable name in a block.
25588         (Block::GetVariableType): Implement in terms of GetVariableInfo
25589
25590         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25591         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25592
25593 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25594
25595         * cs-parser.jay (operator_declaration): Continue on my quest : update
25596         to take attributes argument.
25597         (event_declaration): Ditto.
25598         (enum_declaration): Ditto.
25599         (indexer_declaration): Ditto.
25600
25601         * class.cs (Operator::Operator): Update constructor accordingly.
25602         (Event::Event): Ditto.
25603
25604         * delegate.cs (Delegate::Delegate): Same here.
25605
25606         * enum.cs (Enum::Enum): Same here.
25607
25608 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25609
25610         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25611
25612         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25613
25614         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25615         being passed around as an arraylist.
25616         (Attributes::AddAttribute): Method to add attribute sections.
25617
25618         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25619         (struct_declaration): Update accordingly.
25620         (constant_declaration): Update.
25621         (field_declaration): Update.
25622         (method_header): Update.
25623         (fixed_parameter): Update.
25624         (parameter_array): Ditto.
25625         (property_declaration): Ditto.
25626         (destructor_declaration): Ditto.
25627
25628         * class.cs (Struct::Struct): Update constructors accordingly.
25629         (Class::Class): Ditto.
25630         (Field::Field): Ditto.
25631         (Method::Method): Ditto.
25632         (Property::Property): Ditto.
25633         (TypeContainer::OptAttribute): update property's return type.
25634
25635         * interface.cs (Interface.opt_attributes): New member.
25636         (Interface::Interface): Update to take the extra Attributes argument.
25637
25638         * parameter.cs (Parameter::Parameter): Ditto.
25639
25640         * constant.cs (Constant::Constant): Ditto.
25641
25642         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25643         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25644         the attributes as a parameter.
25645         (InterfaceProperty): Update constructor call.
25646         (InterfaceEvent): Ditto.
25647         (InterfaceMethod): Ditto.
25648         (InterfaceIndexer): Ditto.
25649
25650         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25651         pass the attributes too.
25652         (interface_event_declaration): Ditto.
25653         (interface_property_declaration): Ditto.
25654         (interface_method_declaration): Ditto.
25655         (interface_declaration): Ditto.
25656
25657 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25658
25659         * class.cs (Method::Define): Track the "static Main" definition to
25660         create an entry point. 
25661
25662         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25663         EntryPoint if we find it. 
25664
25665         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25666         (EmitContext::ig): Make this variable public.
25667
25668         * driver.cs: Make the default output file be the first file name
25669         with the .exe extension.  
25670
25671         Detect empty compilations
25672
25673         Handle various kinds of output targets.  Handle --target and
25674         rename -t to --dumper.
25675
25676         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25677         methods inherited from Expression return now an Expression.  This
25678         will is used during the tree rewriting as we resolve them during
25679         semantic analysis.
25680
25681         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25682         the spec.  Missing entirely is the information about
25683         accessability of elements of it.
25684
25685         (Expression::ExprClassFromMemberInfo): New constructor for
25686         Expressions that creates a fully initialized Expression based on
25687         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25688         a Type.
25689
25690         (Invocation::Resolve): Begin implementing resolution of invocations.
25691
25692         * literal.cs (StringLiteral):  Implement Emit.
25693
25694 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25695
25696         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25697         member.
25698
25699 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25700
25701         * cs-parser.jay (attribute_arguments): Implement actions.
25702         (attribute): Fix bug in production. Implement action.
25703         (attribute_list): Implement.
25704         (attribute_target): Implement.
25705         (attribute_target_specifier, opt_target_specifier): Implement
25706         (CheckAttributeTarget): New method to check if the attribute target
25707         is valid.
25708         (attribute_section): Implement.
25709         (opt_attributes): Implement.
25710
25711         * attribute.cs : New file to handle attributes.
25712         (Attribute): Class to hold attribute info.
25713
25714         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25715         (attribute_section): Modify production to use 2 different rules to 
25716         achieve the same thing. 1 s/r conflict down !
25717         Clean out commented, useless, non-reducing dimension_separator rules.
25718
25719         * class.cs (TypeContainer.attributes): New member to hold list
25720         of attributes for a type.
25721         (Struct::Struct): Modify to take one more argument, the attribute list.
25722         (Class::Class): Ditto.
25723         (Field::Field): Ditto.
25724         (Method::Method): Ditto.
25725         (Property::Property): Ditto.
25726
25727         * cs-parser.jay (struct_declaration): Update constructor call to
25728         pass in the attributes too.
25729         (class_declaration): Ditto.
25730         (constant_declaration): Ditto.
25731         (field_declaration): Ditto.
25732         (method_header): Ditto.
25733         (fixed_parameter): Ditto.
25734         (parameter_array): Ditto.
25735         (property_declaration): Ditto.
25736
25737         * constant.cs (Constant::Constant): Update constructor similarly.
25738         Use System.Collections.
25739
25740         * parameter.cs (Parameter::Parameter): Update as above.
25741
25742 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25743
25744         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25745         (TypeContainer.delegates): New member to hold list of delegates.
25746
25747         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25748         this time as I seem to be on crack ;-)
25749
25750 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25751
25752         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25753         tell whether an identifier represents a namespace.
25754
25755         * expression.cs (NamespaceExpr): A namespace expression, used only
25756         temporarly during expression resolution.
25757         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25758         utility functions to resolve names on expressions.
25759
25760 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25761
25762         * codegen.cs: Add hook for StatementExpressions. 
25763
25764         * class.cs: Fix inverted test for static flag in methods.
25765
25766 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25767
25768         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25769         to make it coincide with MS' number.
25770         (Operator::CheckBinaryOperator): Ditto.
25771
25772         * ../errors/errors.txt : Remove error numbers added earlier.
25773
25774         * ../errors/cs1019.cs : Test case for error # 1019
25775
25776         * ../errros/cs1020.cs : Test case for error # 1020
25777
25778         * cs-parser.jay : Clean out commented cruft.
25779         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25780         used anywhere - non-reducing rule.
25781         (namespace_declarations): Non-reducing rule - comment out.
25782
25783         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25784         with TypeContainer::AddEnum.
25785
25786         * delegate.cs : New file for delegate handling classes.
25787         (Delegate): Class for declaring delegates.
25788
25789         * makefile : Update.
25790
25791         * cs-parser.jay (delegate_declaration): Implement.
25792
25793 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25794
25795         * class.cs (Event::Define): Implement.
25796         (Event.EventBuilder): New member.
25797
25798         * class.cs (TypeContainer::Populate): Update to define all enums and events
25799         we have.
25800         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25801         readonly fields for all these cases ?
25802
25803 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25804
25805         * class.cs (Property): Revamp to use the convention of making fields readonly.
25806         Accordingly modify code elsewhere.
25807
25808         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25809         the Define method of the Property class.
25810
25811         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25812         trivial bug.
25813         (TypeContainer::Populate): Update to define all the properties we have. Also
25814         define all enumerations.
25815
25816         * enum.cs (Define): Implement.
25817
25818 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25819
25820         * cs-parser.jay (overloadable_operator): The semantic value is an
25821         enum of the Operator class.
25822         (operator_declarator): Implement actions.
25823         (operator_declaration): Implement.
25824
25825         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25826         validity of definitions.
25827         (Operator::CheckBinaryOperator): Static method to check for binary operators
25828         (TypeContainer::AddOperator): New method to add an operator to a type.
25829
25830         * cs-parser.jay (indexer_declaration): Added line to actually call the
25831         AddIndexer method so it gets added ;-)
25832
25833         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25834         already taken care of by the MS compiler ?  
25835
25836 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25837
25838         * class.cs (Operator): New class for operator declarations.
25839         (Operator::OpType): Enum for the various operators.
25840
25841 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25842
25843         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25844         ostensibly handle this in semantic analysis.
25845
25846         * cs-parser.jay (general_catch_clause): Comment out
25847         (specific_catch_clauses, specific_catch_clause): Ditto.
25848         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25849         (catch_args, opt_catch_args): New productions.
25850         (catch_clause): Rewrite to use the new productions above
25851         (catch_clauses): Modify accordingly.
25852         (opt_catch_clauses): New production to use in try_statement
25853         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25854         and re-write the code in the actions to extract the specific and
25855         general catch clauses by being a little smart ;-)
25856
25857         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25858         Hooray, try and catch statements parse fine !
25859
25860 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25861
25862         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25863         string from the hashtable of variables.
25864
25865         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25866         I end up making that mistake ;-)
25867         (catch_clauses): Fixed gross error which made Key and Value of the 
25868         DictionaryEntry the same : $1 !!
25869
25870 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25871
25872         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25873
25874         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25875         when the add and remove accessors are specified. 
25876
25877 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25878
25879         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25880         information about indexer_declarator.
25881         (indexer_declarator): Implement actions.
25882         (parsing_indexer): New local boolean used to keep track of whether
25883         we are parsing indexers or properties. This is necessary because 
25884         implicit_parameters come into picture even for the get accessor in the 
25885         case of an indexer.
25886         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25887
25888         * class.cs (Indexer): New class for indexer declarations.
25889         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25890         (TypeContainer::indexers): New member to hold list of indexers for the
25891         type.
25892
25893 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25894
25895         * cs-parser.jay (add_accessor_declaration): Implement action.
25896         (remove_accessor_declaration): Implement action.
25897         (event_accessors_declaration): Implement
25898         (variable_declarators): swap statements for first rule - trivial.
25899
25900         * class.cs (Event): New class to hold information about event
25901         declarations.
25902         (TypeContainer::AddEvent): New method to add an event to a type
25903         (TypeContainer::events): New member to hold list of events.
25904
25905         * cs-parser.jay (event_declaration): Implement actions.
25906
25907 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25908
25909         * cs-parser.jay (dim_separators): Implement. Make it a string
25910         concatenating all the commas together, just as they appear.
25911         (opt_dim_separators): Modify accordingly
25912         (rank_specifiers): Update accordingly. Basically do the same
25913         thing - instead, collect the brackets here.
25914         (opt_rank_sepcifiers): Modify accordingly.
25915         (array_type): Modify to actually return the complete type string
25916         instead of ignoring the rank_specifiers.
25917         (expression_list): Implement to collect the expressions
25918         (variable_initializer): Implement. We make it a list of expressions
25919         essentially so that we can handle the array_initializer case neatly too.
25920         (variable_initializer_list): Implement.
25921         (array_initializer): Make it a list of variable_initializers
25922         (opt_array_initializer): Modify accordingly.
25923
25924         * expression.cs (New::NType): Add enumeration to help us
25925         keep track of whether we have an object/delegate creation
25926         or an array creation.
25927         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25928         members to hold data about array creation.
25929         (New:New): Modify to update NewType
25930         (New:New): New Overloaded contructor for the array creation
25931         case.
25932
25933         * cs-parser.jay (array_creation_expression): Implement to call
25934         the overloaded New constructor.
25935
25936 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25937
25938         * class.cs (TypeContainer::Constructors): Return member
25939         constructors instead of returning null.
25940
25941 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25942
25943         * typemanager.cs (InitCoreTypes): Initialize the various core
25944         types after we have populated the type manager with the user
25945         defined types (this distinction will be important later while
25946         compiling corlib.dll)
25947
25948         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25949         on Expression Classification.  Now all expressions have a method
25950         `Resolve' and a method `Emit'.
25951
25952         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25953         generation from working.     Also add some temporary debugging
25954         code. 
25955
25956 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25957
25958         * codegen.cs: Lots of code generation pieces.  This is only the
25959         beginning, will continue tomorrow with more touches of polish.  We
25960         handle the fundamentals of if, while, do, for, return.  Others are
25961         trickier and I need to start working on invocations soon.
25962
25963         * gen-treedump.cs: Bug fix, use s.Increment here instead of
25964         s.InitStatement. 
25965
25966         * codegen.cs (EmitContext): New struct, used during code
25967         emission to keep a context.   Most of the code generation will be
25968         here. 
25969
25970         * cs-parser.jay: Add embedded blocks to the list of statements of
25971         this block.  So code generation proceeds in a top down fashion.
25972
25973 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
25974
25975         * statement.cs: Add support for multiple child blocks.
25976
25977 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
25978
25979         * codegen.cs (EmitCode): New function, will emit the code for a
25980         Block of code given a TypeContainer and its ILGenerator. 
25981
25982         * statement.cs (Block): Standard public readonly optimization.
25983         (Block::Block constructors): Link children. 
25984         (Block::Child): Child Linker.
25985         (Block::EmitVariables): Emits IL variable declarations.
25986
25987         * class.cs: Drop support for MethodGroups here, delay until
25988         Semantic Analysis.
25989         (Method::): Applied the same simplification that I did before, and
25990         move from Properties to public readonly fields.
25991         (Method::ParameterTypes): Returns the parameter types for the
25992         function, and implements a cache that will be useful later when I
25993         do error checking and the semantic analysis on the methods is
25994         performed.
25995         (Constructor::GetCallingConvention): Renamed from CallingConvetion
25996         and made a method, optional argument tells whether this is a class
25997         or a structure to apply the `has-this' bit.
25998         (Method::GetCallingConvention): Implement, returns the calling
25999         convention. 
26000         (Method::Define): Defines the type, a second pass is performed
26001         later to populate the methods.
26002
26003         (Constructor::ParameterTypes): implement a cache similar to the
26004         one on Method::ParameterTypes, useful later when we do semantic
26005         analysis. 
26006
26007         (TypeContainer::EmitMethod):  New method.  Emits methods.
26008
26009         * expression.cs: Removed MethodGroup class from here.
26010
26011         * parameter.cs (Parameters::GetCallingConvention): new method.
26012
26013 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26014
26015         * class.cs (TypeContainer::Populate): Drop RootContext from the
26016         argument. 
26017
26018         (Constructor::CallingConvention): Returns the calling convention.
26019         (Constructor::ParameterTypes): Returns the constructor parameter
26020         types. 
26021
26022         (TypeContainer::AddConstructor): Keep track of default constructor
26023         and the default static constructor.
26024
26025         (Constructor::) Another class that starts using `public readonly'
26026         instead of properties. 
26027
26028         (Constructor::IsDefault): Whether this is a default constructor. 
26029
26030         (Field::) use readonly public fields instead of properties also.
26031
26032         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26033         track of static constructors;  If none is used, turn on
26034         BeforeFieldInit in the TypeAttributes. 
26035
26036         * cs-parser.jay (opt_argument_list): now the return can be null
26037         for the cases where there are no arguments. 
26038
26039         (constructor_declarator): If there is no implicit `base' or
26040         `this', then invoke the default parent constructor. 
26041
26042         * modifiers.cs (MethodAttr): New static function maps a set of
26043         modifiers flags into a MethodAttributes enum
26044         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26045         MethodAttr, TypeAttr to represent the various mappings where the
26046         modifiers are used.
26047         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26048
26049 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26050
26051         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26052         method arguments.
26053
26054         * interface.cs (PopulateIndexer): Implemented the code generator
26055         for interface indexers.
26056
26057 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26058
26059         * interface.cs (InterfaceMemberBase): Now we track the new status
26060         here.  
26061
26062         (PopulateProperty): Implement property population.  Woohoo!  Got
26063         Methods and Properties going today. 
26064
26065         Removed all the properties for interfaces, and replaced them with
26066         `public readonly' fields. 
26067
26068 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26069
26070         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26071         initialize their hashtables/arraylists only when they are needed
26072         instead of doing this always.
26073
26074         * parameter.cs: Handle refs and out parameters.
26075
26076         * cs-parser.jay: Use an ArrayList to construct the arguments
26077         instead of the ParameterCollection, and then cast that to a
26078         Parameter[] array.
26079
26080         * parameter.cs: Drop the use of ParameterCollection and use
26081         instead arrays of Parameters.
26082
26083         (GetParameterInfo): Use the Type, not the Name when resolving
26084         types. 
26085
26086 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26087
26088         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26089         and instead use public readonly fields.
26090
26091         * class.cs: Put back walking code for type containers.
26092
26093 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26094
26095         * class.cs (MakeConstant): Code to define constants.
26096
26097         * rootcontext.cs (LookupType): New function.  Used to locate types 
26098
26099
26100 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26101
26102         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26103         this System.Reflection code is.  Kudos to Microsoft
26104
26105         * typemanager.cs: Implement a type cache and avoid loading all
26106         types at boot time.  Wrap in LookupType the internals.  This made
26107         the compiler so much faster.  Wow.  I rule!
26108
26109         * driver.cs: Make sure we always load mscorlib first (for
26110         debugging purposes, nothing really important).
26111
26112         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26113         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26114
26115         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26116         on namespaces that have been imported using the `using' keyword.
26117
26118         * class.cs (TypeContainer::TypeAttr): Virtualize.
26119         (Class::TypeAttr): Return attributes suitable for this bad boy.
26120         (Struct::TypeAttr): ditto.
26121         Handle nested classes.
26122         (TypeContainer::) Remove all the type visiting code, it is now
26123         replaced with the rootcontext.cs code
26124
26125         * rootcontext.cs (GetClassBases): Added support for structs. 
26126
26127 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26128
26129         * interface.cs, statement.cs, class.cs, parameter.cs,
26130         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26131         Drop use of TypeRefs, and use strings instead.
26132
26133 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26134
26135         * rootcontext.cs: 
26136
26137         * class.cs (Struct::Struct): set the SEALED flags after
26138         checking the modifiers.
26139         (TypeContainer::TypeAttr): new property, returns the
26140         TypeAttributes for a class.  
26141
26142         * cs-parser.jay (type_list): Oops, list production was creating a
26143         new list of base types.
26144
26145         * rootcontext.cs (StdLib): New property.
26146         (GetInterfaceTypeByName): returns an interface by type name, and
26147         encapsulates error handling here.
26148         (GetInterfaces): simplified.
26149         (ResolveTree): Encapsulated all the tree resolution here.
26150         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26151         types. 
26152
26153         * driver.cs: Add support for --nostdlib, to avoid loading the
26154         default assemblies.
26155         (Main): Do not put tree resolution here. 
26156
26157         * rootcontext.cs: Beginning of the class resolution.
26158
26159 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26160
26161         * rootcontext.cs: Provide better error reporting. 
26162
26163         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26164
26165         * rootcontext.cs (CreateInterface): Handle the case where there
26166         are no parent interfaces.
26167
26168         (CloseTypes): Routine to flush types at the end.
26169         (CreateInterface): Track types.
26170         (GetInterfaces): Returns an array of Types from the list of
26171         defined interfaces.
26172
26173         * typemanager.c (AddUserType): Mechanism to track user types (puts
26174         the type on the global type hash, and allows us to close it at the
26175         end). 
26176
26177 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26178
26179         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26180         RecordInterface instead.
26181
26182         * cs-parser.jay: Updated to reflect changes above.
26183
26184         * decl.cs (Definition): Keep track of the TypeBuilder type that
26185         represents this type here.  Not sure we will use it in the long
26186         run, but wont hurt for now.
26187
26188         * driver.cs: Smaller changes to accomodate the new code.
26189
26190         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26191         when done. 
26192
26193         * rootcontext.cs (CreateInterface):  New method, used to create
26194         the System.TypeBuilder type for interfaces.
26195         (ResolveInterfaces): new entry point to resolve the interface
26196         hierarchy. 
26197         (CodeGen): Property, used to keep track of the code generator.
26198
26199 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26200
26201         * cs-parser.jay: Add a second production for delegate_declaration
26202         with `VOID'.
26203
26204         (enum_body): Put an opt_comma here instead of putting it on
26205         enum_body or enum_member_declarations so we can handle trailing
26206         commas on enumeration members.  Gets rid of a shift/reduce.
26207
26208         (type_list): Need a COMMA in the middle.
26209
26210         (indexer_declaration): Tell tokenizer to recognize get/set
26211
26212         * Remove old targets.
26213
26214         * Re-add the parser target.
26215
26216 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26217
26218         * cs-parser.jay: Add precendence rules for a number of operators
26219         ot reduce the number of shift/reduce conflicts in the grammar.
26220
26221 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26222
26223         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26224         and put it here.
26225
26226         Get rid of old crufty code.
26227
26228         * rootcontext.cs: Use this to keep track of the parsed
26229         representation and the defined types available to the program. 
26230
26231         * gen-treedump.cs: adjust for new convention.
26232
26233         * type.cs: Split out the type manager, and the assembly builder
26234         from here. 
26235
26236         * typemanager.cs: the type manager will live here now.
26237
26238         * cil-codegen.cs: And the code generator here. 
26239
26240 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26241
26242         * makefile: Fixed up for easy making.
26243
26244 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26245
26246         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26247         the 
26248
26249         (unary_expression): Expand pre_increment_expression and
26250         post_decrement_expression to reduce a shift/reduce.
26251
26252 2001-07-11  Simon Cozens
26253
26254         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26255
26256         Improve allow_keyword_as_indent name.
26257
26258 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26259
26260         * Adjustments for Beta2. 
26261
26262 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26263
26264         * decl.cs: Added `Define' abstract method.
26265         (InTransit): new property, used to catch recursive definitions. 
26266
26267         * interface.cs: Implement `Define'. 
26268
26269         * modifiers.cs: Map Modifiers.constants to
26270         System.Reflection.TypeAttribute flags.
26271
26272         * class.cs: Keep track of types and user-defined types.
26273         (BuilderInit): New method for creating an assembly
26274         (ResolveType): New function to launch the resolution process, only
26275         used by interfaces for now.
26276
26277         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26278         that are inserted into the name space. 
26279
26280 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26281
26282         * ARGH.  I have screwed up my tree so many times due to the use of
26283         rsync rather than using CVS.  Going to fix this at once. 
26284
26285         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26286         load types.
26287
26288 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26289
26290         * Experiment successful: Use System.Type rather that our own
26291         version of Type.  
26292
26293 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26294
26295         * cs-parser.jay: Removed nsAliases from here.
26296
26297         Use new namespaces, handle `using XXX;' 
26298
26299         * namespace.cs: Reimplemented namespace handling, use a recursive
26300         definition of the class.  Now we can keep track of using clauses
26301         and catch invalid using clauses.
26302
26303 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26304
26305         * gen-treedump.cs: Adapted for all the renaming.
26306
26307         * expression.cs (Expression): this class now has a Type property
26308         which returns an expression Type.
26309
26310         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26311         `Type', as this has a different meaning now in the base
26312
26313 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26314
26315         * interface.cs, class.cs: Removed from all the sources the
26316         references to signature computation, as we can not do method
26317         signature computation during the parsing time, as we are not
26318         trying to solve at that point distinguishing:
26319
26320         class X {
26321                 void a (Blah x) {}
26322                 void a (NS.Blah x) {}
26323         }
26324
26325         Which depending on the context might be valid or not, as we do not
26326         know if Blah is the same thing as NS.Blah at that point.
26327
26328         * Redid everything so the code uses TypeRefs now instead of
26329         Types.  TypeRefs are just temporary type placeholders, that need
26330         to be resolved.  They initially have a pointer to a string and the
26331         current scope in which they are used.  This is used later by the
26332         compiler to resolve the reference to an actual Type. 
26333
26334         * DeclSpace is no longer a CIR.Type, and neither are
26335         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26336         are all DeclSpaces, but no Types. 
26337
26338         * type.cs (TypeRefManager): This implements the TypeRef manager,
26339         which keeps track of all the types that need to be resolved after
26340         the parsing has finished. 
26341
26342 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26343
26344         * ARGH.  We are going to have to store `foreach' as a class rather
26345         than resolving it, as we need to verify error 1579 after name
26346         resolution.   *OR* we could keep a flag that says `This request to
26347         IEnumerator comes from a foreach statement' which we can then use
26348         to generate the error.
26349
26350 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26351
26352         * class.cs (TypeContainer.AddMethod): we now add methods to the
26353         MethodGroup instead of the method hashtable.  
26354
26355         * expression.cs: Add MethodGroup abstraction, which gets us one
26356         step closer to the specification in the way we handle method
26357         declarations.  
26358
26359         * cs-parser.jay (primary_expression): qualified_identifier now
26360         tried to match up an identifier to a local variable reference or
26361         to a parameter reference.
26362
26363         current_local_parameters is now a parser global variable that
26364         points to the current parameters for the block, used during name
26365         lookup.
26366
26367         (property_declaration): Now creates an implicit `value' argument to
26368         the set accessor.
26369
26370 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26371
26372         * parameter.cs: Do not use `param' arguments as part of the
26373         signature, per the spec.
26374
26375 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26376
26377         * decl.cs: Base class for classes, structs and interfaces.  This
26378         is the "Declaration Space" 
26379
26380         * cs-parser.jay: Use CheckDef for checking declaration errors
26381         instead of having one on each function.
26382
26383         * class.cs: Factor out some code for handling error handling in
26384         accordance to the "Declarations" section in the "Basic Concepts"
26385         chapter in the ECMA C# spec.
26386
26387         * interface.cs: Make all interface member classes derive from
26388         InterfaceMemberBase.
26389
26390 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26391
26392         * Many things: all interfaces are parsed and generated in
26393         gen-treedump.  Support for member variables, constructors,
26394         destructors, properties, constants is there.
26395
26396         Beginning of the IL backend, but very little done, just there for
26397         testing purposes. 
26398
26399 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26400
26401         * cs-parser.jay: Fix labeled statement.
26402
26403         * cs-tokenizer.cs (escape): Escape " and ' always.
26404         ref_line, ref_name: keep track of the line/filename as instructed
26405         by #line by the compiler.
26406         Parse #line.
26407
26408 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26409
26410         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26411         to match the values in System.CodeDOM.
26412
26413         Divid renamed to Divide.
26414
26415         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26416         statements. 
26417         (Statements.set): remove.
26418
26419         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26420         statements. 
26421
26422         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26423         falseStatements always have valid values. 
26424
26425         * cs-parser.jay: Use System.CodeDOM now.
26426