In mcs and gmcs:
[mono.git] / mcs / gmcs / ChangeLog
1 2006-08-02  Raja R Harinath  <rharinath@novell.com>
2
3         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
4         declspaces for doppelgangers too.
5         (UsingEntry): Implement IResolveContext.
6         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
7         'this' as the resolve context.
8         (LocalAliasEntry): Likewise.
9
10         Implement parts of #77403
11         * roottypes.cs (RootDeclSpace): New.  Used to represent the
12         toplevel declaration space.  Each namespace declaration introduces
13         a "partial" root declaretion space.
14         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
15         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
16         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
17         from 'current_namespace.SlaveDeclSpace'.
18         (namespace_declaration): Likewise.
19         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
20         check.  It can't happen now.
21         * decl.cs (DeclSpace.LookupType): Likewise.
22         * driver.cs (MainDriver): Sanity check.
23
24 2006-08-01  Raja R Harinath  <rharinath@novell.com>
25
26         * decl.cs (DeclSpace.FindNestedType): Remove.
27         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
28         LookupTypeContainer to get the container of the nested type.
29         * class.cs (TypeContainer.FindNestedType): Make non-override.
30
31 2006-07-31  Raja R Harinath  <rharinath@novell.com>
32
33         * decl.cs (DeclSpace.PartialContainer): Move field from ...
34         * class.cs (TypeContainer.PartialContainer): ... here.
35         (TypeContainer.AddBasesForPart): New helper.
36         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
37         instead.
38         * cs-parser.jay (current_class): Convert to DeclSpace.
39         (struct_declaration, interface_declaration, class_declaration):
40         Use AddBasesForPart instead of .Bases directly.
41         * const.cs, iterators.cs: Update to changes.
42
43 2006-07-28  Raja R Harinath  <rharinath@novell.com>
44
45         * class.cs (TypeContainer.AddMemberType): Rename from
46         AddToTypeContainer.
47         (TypeContainer.AddMember): Rename from AddToMemberContainer.
48         (AddTypeContainer): New.  Combine AddClassOrStruct and
49         AddInterface.
50         (AddPartial): Update.  Add 'is_partial' argument.
51         * roottypes.cs: Update to changes.
52         * cs-parser.jay (push_current_class): New helper for handling
53         current_container and current_class.
54         (struct_declaration, interface_declaration, class_declaration):
55         Use it.
56
57 2006-07-26  Raja R Harinath  <rharinath@novell.com>
58
59         * roottypes.cs: Rename from tree.cs.
60
61         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
62         * tree.cs (Tree, ITreeDump): Remove types.
63         * rootcontext.cs (tree, Tree): Remove fields.
64         (root, ToplevelTypes): New.
65         * *.cs: Update to rename.
66
67         * tree.cs (Tree.RecordDecl): Remove.
68         (RootTypes.AddToTypeContainer): Record the toplevel type in its
69         namespace here.
70         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
71
72 2006-07-23  Raja R Harinath  <harinath@gmail.com>
73
74         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
75         DoFlowAnalysis and OmitStructFlowAnalysis here.
76         (ec.With): Rename from WithUnsafe and generalize.
77         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
78         (ec.WithFlowAnalyis): New.
79         * ecore.cs, expression.cs, statement.cs: Update.
80
81 2006-07-22  Raja R Harinath  <harinath@gmail.com>
82
83         * statement.cs (Block.ResolveMeta): Simplify slightly.
84
85         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
86         multiple boolean fields.  Convert InUnsafe, constant_check_state,
87         check_state to flags.
88         (CheckState, ConstantCheckState): Update.
89         (InUnsafe): New read-only property.
90         (FlagsHandle): Rename from CheckStateHandle and convert to handle
91         arbitrary flags.
92         (WithUnsafe): New helper similar to WithCheckState.
93         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
94         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
95
96 2006-07-21  Raja R Harinath  <rharinath@novell.com>
97
98         Make comparisons use the same IL irrespective of whether they're
99         in a 'checked' or 'unchecked' context: one of the issues in #78899
100         * codegen.cs (EmitContext.CheckState): Make read-only property.
101         (EmitContext.ConstantCheckState): Likewise.
102         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
103         helper that implement a save/restore stack for CheckState
104         values.  This is the only way to change check-state.
105         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
106         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
107         (CheckedExpr.EmitBranchable): New forwarding method.
108         (UnCheckedExpr): Likewise.
109         * statement.cs (Block.ResolveMeta): Use WithCheckState.
110         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
111         (Checked.Resolve, checked.DoEmit): Likewise.
112
113 2006-07-21  Martin Baulig  <martin@ximian.com>
114
115         * generic.cs (TypeManager.InferType): When inferring an array
116         type, also allow IList<T> and ICollection<T>.  Fixes #78900.
117
118 2006-07-21  Martin Baulig  <martin@ximian.com>
119
120         * generic.cs (TypeManager.IsIEnumerable): Renamed into IsIList()
121         and allow IList`1 and all its base interfaces.
122
123         * convert.cs (Convert.ImplicitReferenceConversion): Allow
124         converting from an array-type of T to IList<T>.
125
126 2006-07-21  Martin Baulig  <martin@ximian.com>
127
128         * ecore.cs (SimpleName.DoSimpleNameResolve): Added CS0307 check.
129
130 2006-07-20  Miguel de Icaza  <miguel@novell.com>
131
132         * anonymous.cs: Cache the resolved anonymous delegate, and return
133         this so that the ResolveTopBlock is only triggered once, not
134         twice.
135
136         Currently we trigger ResolvetopBlock twice due to a first pass of
137         argument check compatibility, and a second pass that does the
138         actual resolution.   
139
140 2006-07-16  Marek Safar  <marek.safar@seznam.cz>
141
142         A fix for #70506
143         * driver.cs (MainDriver): When a file extension is missing,
144         use a default one.
145
146 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
147
148         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
149         modifiers.
150         * rootcontext.cs (Reset): Add helper_classes.
151
152 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
153
154         A fix for #78860
155         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
156         correctly.
157
158 2006-07-13  Miguel de Icaza  <miguel@novell.com>
159
160         * statement.cs (Lock): Handle expressions of type
161         TypeManager.null_type specially.  Fixes #78770
162
163 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
164
165         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
166         to an event.
167
168 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
169
170         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
171         for accessors as well.
172         * ecore.cs (EventExpr): Add AccessorTable.
173
174 2006-07-03  Martin Baulig  <martin@ximian.com>
175
176         * ecore.cs (UnboxCast.Emit): Also use `Unbox_Any' for generic
177         instances of value types.
178
179         * convert.cs (Convert.ExplicitConversion): Correctly handle
180         object->nullable conversions.   
181
182 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
183
184         A fix for #78738
185         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
186         for CS0122 where appropriate.
187         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
188         level attributes.
189         (Filter): Assembly can be null in the case of top level attributes.
190
191 2006-06-28  Raja R Harinath  <rharinath@novell.com>
192
193         Fix #78716
194         * generic.cs (TypeManager.InferParamsTypeArguments): If there are
195         no arguments, return 'false': nothing can be inferred.
196
197 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
198
199         A fix for #78690
200
201         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
202         is done at global level.
203
204 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
205
206         A fix for #77002, Implemented TypeForwarder support.
207
208         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
209         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Add TypeForwarder
210         attribute handling.
211         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
212         * typemanager.cs (): Add type_forwarder_attr_type.
213
214 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
215
216         * report.cs: Add CS0469 warning.
217
218 2006-06-22  Martin Baulig  <martin@ximian.com>
219
220         * class.cs
221         (TypeContainer.GetNormalBases): Also use ResolveAsBaseTerminal()
222         for interfaces; fixes #78686, which is a modification of #78380
223         with interfaces instead of classes.
224
225 2006-06-21  Martin Baulig  <martin@ximian.com>
226
227         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
228         the `try'-block, so we also report CS0016 etc. there.
229
230 2006-06-21  Martin Baulig  <martin@ximian.com>
231
232         * ecore.cs (FieldExpr.EmitAssign, FieldExpr.AddressOf): Correctly
233         handle SetAssigned() and SetMemberIsUsed() for generic types;
234         fixes #77545.
235
236 2006-06-21  Martin Baulig  <martin@ximian.com>
237
238         * delegate.cs
239         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
240
241 2006-06-21  Martin Baulig  <martin@ximian.com>
242
243         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
244         also report CS1686 for parameters.
245
246 2006-06-21  Martin Baulig  <martin@ximian.com>
247
248         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
249         instead of an error if the value is not implicitly convertible to
250         the switch types; fixes #77964.
251
252 2006-06-21  Raja R Harinath  <rharinath@novell.com>
253
254         Fix #78673
255         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
256         FieldBuilder is null.
257
258         Fix #78662
259         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
260         'left' and 'right' before error-checking.
261
262 2006-06-19  Martin Baulig  <martin@ximian.com>
263
264         * convert.cs
265         (Convert.ImplicitConversionStandard): Cleanup and correctly
266         implement nullable conversions.
267         (Convert.ImplicitStandardConversionExists): Likewise.
268         (Convert.ExplicitConversion): Likewise.
269
270 2006-06-19  Martin Baulig  <martin@ximian.com>
271
272         * generic.cs
273         (Nullable.Wrap.Create, Nullable.Unwrap.Create): New public static
274         methods; make the ctors protected.
275
276 2006-06-19  Martin Baulig  <martin@ximian.com>
277
278         Fixed #78380; added gtest-273.cs.
279
280         * ecore.cs
281         (Expression.ResolveAsBaseTerminal): Move the constraint checking
282         into ResolveAsTypeTerminal().
283
284         * generic.cs
285         (ConstraintChecker.HasDefaultConstructor): Use the non-cache based
286         TypeManager.FindMembers() to check for the default ctor.
287
288 2006-06-18  Marek Safar  <marek.safar@seznam.cz>
289
290         * generic.cs: Fixed NullableInfo accessibility.
291
292 2006-06-16  Martin Baulig  <martin@ximian.com>
293
294         * generic.cs
295         (Constraints.InflatedConstraints.inflate): Correctly inflate
296         generic types; fixes #78400.
297
298 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
299
300         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
301         Fixed bug #78601.
302         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
303         (FieldExpr.DoResolve): likewise.
304         (PropertyExpr.InstanceResolve): likewise.
305         (EventExpr.InstanceResolve): likewise. 
306
307 2006-06-15  Martin Baulig  <martin@ximian.com>
308
309         * statement.cs
310         (SwitchLabel.ResolveAndReduce): Added `bool allow_nullable'
311         argument; always allow a `null' label if true.
312         (Switch.SwitchGoverningType): Take an `Expression expr' argument.
313         (Switch.TableSwitchEmit, Switch.SimpleSwitchEmit): Check whether
314         we have a `null' label and mark the new `null_target' label;
315         default to the `default' label.
316         (Switch.Resolve): Add support for nullable types.  Fixes #78630.
317
318 2006-06-15  Martin Baulig  <martin@ximian.com>
319
320         * class.cs (Operator.Define): Allow an implicit/explicit operator
321         to convert to/from a nullable value of the enclosing type.
322
323         * generic.cs (TypeManager.IsNullableTypeOf): New public method.
324         (Nullable.Unwrap, Nullable.Wrap): Make these classes public.
325
326         * convert.cs
327         (Convert.ImplicitStandardConversionExists): Add support for lifted
328         implicit/explicit conversions.
329         (Convert.ImplicitConversionStandard): Likewise.
330
331 2006-06-13  Martin Baulig  <martin@ximian.com>
332
333         * ecore.cs (SimpleName.DoSimpleNameResolve): Check whether we have
334         type arguments and create a ConstructedType if necessary.  Fixes #78400.
335
336 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
337
338         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
339         attribute applicable tests for attribute argument.
340
341 2006-06-02  Raja R Harinath  <rharinath@novell.com>
342
343         Fix #78079
344         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
345         (Binary.OverloadResolve_PredefinedIntegral): New.
346         (Binary.OverloadResolve_PredefinedFloating): New.
347         (Binary.OverloadResolve_PredefinedString): New.
348         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
349         Follow the standard more closely, and treat numeric promotions in
350         terms of overload resolution.
351         (Binary.CheckShiftArguments): Simplify.
352
353 2006-06-01  Raja R Harinath  <rharinath@novell.com>
354
355         * flowanalysis.cs (MyBitVector): Simplify representation.
356         (MyBitVector.Clone): Avoid allocating BitArray.
357         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
358         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
359         (*): Update.  Change all references to MyBitVector.And and
360         MyBitVector.Or to &= and |=.
361
362 2006-05-31  Raja R Harinath  <rharinath@novell.com>
363
364         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
365         Use bne.un instead of ceq+brfalse.
366
367         Fix cs0208-[23].cs
368         * typemanager.cs (IsUnmanagedType): Disallow generic types and
369         generic parameters.
370
371 2006-05-29  Raja R Harinath  <rharinath@novell.com>
372
373         Fix cs0231-[34].cs.
374         * cs-parser.jay (formal_parameter_list): Extend the pattern below
375         to param arguments too.
376
377 2006-05-26  Miguel de Icaza  <miguel@novell.com>
378
379         * cs-parser.jay: Catch another parsing form for arglist being
380         followed by other arguments.  Fixes #78313.
381
382 2006-05-25  Raja R Harinath  <rharinath@novell.com>
383
384         Fix #78324
385         * expression.cs (Binary.DoResolve): Use Nullable.LiftedBinaryOperator
386         also when one of the operands is a null literal.
387         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality): Rewrite
388         to improve clarity, and generate slightly better code.
389
390 2006-05-24  Raja R Harinath  <rharinath@novell.com>
391
392         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
393         checking of out parameters to ...
394         (FlowBranchingToplevel.Merge): ... here.
395         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
396         set, propagate the origin upward, and only complain if there was
397         no other error.
398         (FlowBranchingException.AddContinueOrigin): Likewise.
399         (FlowBranchingException.AddReturnOrigin): Likewise.
400         (FlowBranchingException.AddGotoOrigin): Likewise.       
401
402 2006-05-23  Raja R Harinath  <rharinath@novell.com>
403
404         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
405         unreachable, skip it.
406         (FlowBranchingException.Merge): Always propagate jumps, even if
407         the finally block renders subsequent code unreachable.
408
409 2006-05-18  Raja R Harinath  <rharinath@novell.com>
410
411         Fix #77601
412         * statement.cs (Goto.Resolve): Move responsibility for resolving
413         'goto' to FlowBranching.AddGotoOrigin.
414         (Goto.SetResolvedTarget): New.  Callback to set the
415         LabeledStatement that's the target of the goto.
416         (Goto.DoEmit): Use Leave instead of Br when crossing an
417         unwind-protect boundary.
418         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
419         LookupLabel and adjust to new semantics.
420         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
421         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
422         Goto.SetResolvedTarget to update target.
423         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
424         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
425         AddBreakOrigin & co.  Delay propagation until ...
426         (FlowBranchingException.Merge): ... this.
427
428         * statement.cs (Block.Resolve): Always depend on flow-branching to
429         determine unreachability.  Kill workaround that originally emitted
430         only one statement after an "unreachable" label (see infloop in
431         test-515.cs).
432
433         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
434         This is still "wrong", but anything better would probably need a
435         multi-pass algorithm.
436         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
437         usage vector.  Force current usage vector to be reachable, to
438         optimistically signify backward jumps.
439         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
440         detected.
441         (FlowBranchingLabeled.Merge): New.  If no backward jump was
442         detected, return the original salted-away usage vector instead,
443         updated with appropriate changes.  Print unreachable warning if
444         necessary.
445         * statement.cs (Block.Resolve): Don't print unreachable warning on
446         a labeled statement.
447
448 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
449
450         * driver.cs: Pass filename without path to AssemblyBuilder's
451         AddResourceFile. Fixes bug #78407.
452
453 2006-05-17  Raja R Harinath  <rharinath@novell.com>
454
455         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
456         * flowanalysis.cs (FlowBranchingLabeled): ... here.
457         (FlowBranching.MergeChild): Overwrite
458         reachability information from Labeled branchings too.
459
460 2006-05-16  Raja R Harinath  <rharinath@novell.com>
461
462         * statement.cs (Goto.Resolve): Merge jump origins here ...
463         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
464
465         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
466         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
467         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
468         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
469         here, ...
470         * statement.cs (Goto.Resolve): ... not here.
471         (Goto.Emit): Remove CS1632 check.
472
473 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
474
475         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
476         error message.
477
478 2006-05-11  Raja R Harinath  <rharinath@novell.com>
479
480         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
481         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
482         (FlowBranchingException.Label): Likewise.
483
484         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
485         given value.
486         (MyBitVector.Or): Use it to avoid losing information (Count).
487         (FlowBranching.MergeOrigins): Likewise.
488
489         * flowanalysis.cs (UsageVector.IsDirty): Remove.
490         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
491         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
492         (UsageVector.ToString): Simplify.
493         (UsageVector.MergeSiblings): Move here from ...
494         (FlowBranching.Merge): ... here.
495         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
496         not a MyBitVector.
497
498 2006-05-10  Raja R Harinath  <rharinath@novell.com>
499
500         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
501         null bitvector is treated as all-true.
502
503         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
504         (MyBitVector): Rationalize invariants.  'vector != null' implies
505         that we have our own copy of the bitvector.  Otherwise,
506         'InheritsFrom == null' implies all inherited bits are true.
507
508 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
509
510         * statement.cs (LocalInfo): Add IsConstant.
511         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
512         local variable for constants.
513
514 2006-05-09  Raja R Harinath  <rharinath@novell.com>
515
516         * flowanalysis.cs (MyBitVector.Empty): New.
517         (MyBitVector): Don't allow InheritedFrom to be null.
518         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
519         (UsageVector, FlowBranching): Update to changes.
520
521         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
522         recursion.  The 'Parent == null' condition isn't sufficient for
523         anonymous methods.
524         (FlowBranching.AddBreakOrigin): Likewise.
525         (FlowBranching.AddContinueOrigin): Likewise.
526         (FlowBranching.AddReturnOrigin): Likewise.
527         (FlowBranching.StealFinallyClauses): Likewise.
528         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
529         (FlowBranching.CheckOutParameters): Likewise.
530         (FlowBranchingToplevel): Terminate all the above recursions here.
531         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
532         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
533
534         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
535         toplevel block.
536         (FlowBranchingToplevel): New.  Empty for now.
537         (FlowBranching.MergeTopBlock): Update.
538         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
539         branching for the anonymous delegate.
540         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
541
542         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
543         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
544         information at the start of the merge.  Reorganize.
545
546 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
547
548         * class.cs (MethodData.Define): Method cannot implement interface accessor.
549
550 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
551
552         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
553         to newly introduced ctor.
554
555         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
556         message to one place.
557         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
558         global namespace.
559
560 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
561
562         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
563
564         * ecore.cs (Expression.ResolveAsConstant): Updated.
565
566         * statement.cs (ResolveMeta): Updated.
567
568 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
569
570         * cs-parser.jay: __arglist cannot be used in initializer.
571
572 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
573
574         A fix for #77879
575         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
576         private types.
577
578 2006-05-05  Raja R Harinath  <rharinath@novell.com>
579
580         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
581         (LabeledStatement): Add 'name' parameter.
582         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
583         (Block.AddLabel): Update to changes.
584         * cs-parser.jay (labeled_statement): Likewise.
585
586         * flowanalysis.cs (BranchingType.Labeled): New.
587         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
588         (FlowBranchingLabeled): New.  Does nothing for now, but will
589         eventually handle 'goto' flows.
590         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
591         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
592         that's terminated ...
593         (Block.Resolve): ... here.
594
595         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
596         (UsageVector.MergeFinallyOrigins): Likewise.
597         (FlowBranching.InTryOrCatch): Likewise.
598         (FlowBranching.AddFinallyVector): Likewise.
599         (FlowBranchingException): Update to changes.
600
601         Fix #78290
602         * statement.cs (Return.Resolve): Move error checking to ...
603         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
604         (FlowBranchingException): Handle return origins like break and
605         continue origins.
606         (FlowBranching.UsageVector.CheckOutParameters): Remove.
607
608 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
609
610         A fix for #76122
611         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
612         filter.
613
614 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
615
616         A fix for #77543
617         * class.cs (MethodData.Define): Do public accessor check only when method
618         implements an interface.
619
620 2006-05-04  Raja R Harinath  <rharinath@novell.com>
621
622         Remove special handling of 'break'
623         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
624         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
625         (UsageVector.Break): Remove.
626         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
627         reachability.
628         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
629
630         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
631         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
632
633 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
634
635         A fix for #75726
636         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
637         be the interface member.
638
639 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
640
641         A fix for #60069
642         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
643         for emitting small (int) values.
644
645 2006-05-03  Raja R Harinath  <rharinath@novell.com>
646
647         Fix #59427
648         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
649         control-flow passes through the 'finally' after merging-in all the
650         control-flows from 'try' and the 'catch' clauses.
651
652         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
653         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
654         always true at the only non-recursive entry point.
655         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
656         FlowBranchingBreakable.
657         (FlowBranchingLoop): Remove.
658         * statement.cs (Return.DoResolve): Update to changes.
659
660         Fix #76471, #76665
661         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
662         (FlowBranching.CreateBranching): Handle it: create a
663         FlowBranchingContinuable.
664         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
665         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
666         except that it handles the 'continue' command.
667         (FlowBranching.UsageVector.MergeOrigins): Rename from
668         MergeBreakOrigins.
669         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
670         except that it overrides AddContinueOrigin.
671         (FlowBranchingException): Override AddContinueOrigin, similar to
672         AddBreakOrigin.
673         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
674         Create a new branching around the embedded statement.
675         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
676         control flow after the embedded statement.
677         (Continue.Resolve): Move all error checking to AddContinueOrigin.
678
679         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
680         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
681         FlowBranchingBreakable.
682         (FlowBranchingSwitch): Remove.
683
684         Fix test-503.cs
685         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
686         error reporting to ...
687         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
688         Rename from 'AddBreakVector'.  Add new location argument.  Return
689         a bool indicating whether the 'break' crosses an unwind-protect.
690         (FlowBranchingException.AddBreakOrigin): Add.
691         (FlowBranchingException.Merge): Propagate 'break's to surrounding
692         flowbranching after updating with the effects of the 'finally'
693         clause.
694         (FlowBranchingBreakable): New common base class for
695         FlowBranchingLoop and FlowBranchingSwitch.
696
697         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
698         embedded statement.
699         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
700
701 2006-05-02  Raja R Harinath  <rharinath@novell.com>
702
703         * statement.cs (Do.Resolve): If the loop is infinite, set the
704         barrier.
705         (While.Resolve, For.Resolve): Set a barrier after the embedded
706         statement.  There's no direct control flow that goes from the end
707         of the embedded statement to the end of the loop.
708         * flowanalysis.cs (FlowBranching.Infinite): Remove.
709         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
710         above ensure that the reachability is correctly computed.
711
712         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
713         (UsageVector.MergeBreakOrigins): If the current path is
714         unreachable, treat it as if all parameters/locals are initialized.
715         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
716         infinite loops before merging-in break origins.
717
718         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
719         (Reachability.Reachable): Split part into ...
720         (Reachability.Unreachable): ... this.  Simplify.
721         (Reachability.IsUnreachable): Use 'Unreachable' instead.
722
723         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
724         (Reachability.SetThrowsSometimes): Likewise.
725         (FlowBranchingBlock.MergeTopBlock): Don't compare against
726         TriState.Always, use corresponding property.
727         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
728         (Block.Resolve): Likewise.  Remove some redundant checks.
729
730 2006-05-02  Raja R Harinath  <harinath@gmail.com>
731
732         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
733         (Reachability.Meet): Don't bother checking AlwaysThrows --
734         barrier is always set.
735         (FlowBranchingBlock.Merge): Likewise.
736
737 2006-05-01  Rafael Teixeira <rafaelteixeirabr@hotmail.com>
738
739         * attribute.cs: fixed_buffer_cache is declared only if NET_2_0 is
740         defined, so it's references should also compile only for NET_2_0
741         (as occurs in mcs version)
742
743 2006-05-01  Raja R Harinath  <harinath@gmail.com>
744
745         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
746         checks for unreachable.
747
748 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
749
750         A fix for #77980
751         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
752
753         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
754         whether field is really assigned.
755
756 2006-04-30  Raja R Harinath  <harinath@gmail.com>
757
758         * flowanalysis.cs (Reachability): Make 4-argument constructor
759         private.
760         (Reachability.Meet): Rename from 'And'.  Remove static variant.
761         (Reachability.Always): Rename from the highly misleading
762         'Reachability.Never'.
763         (FlowBranching.Merge): Update to changes.  Mark an impossible
764         situation with a 'throw'.
765         (*): Update to changes.
766
767 2006-04-29  Raja R Harinath  <harinath@gmail.com>
768
769         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
770         Remove 'Undefined'.
771         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
772         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
773         (*): Update to changes.
774         * statement.cs: Update to changes.
775
776 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
777
778         A fix for #78049
779         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
780
781 2006-04-28  Raja R Harinath  <harinath@gmail.com>
782
783         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
784         dummy UsageVector.
785
786         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
787         argument to two arguments: an usage-vector and a bool.  Move call
788         to FlowBranching.Merge () ...
789         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
790
791         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
792         handling of loop and switch reachability to ...
793         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
794
795 2006-04-27  Raja R Harinath  <harinath@gmail.com>
796
797         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
798         handling to FlowBranchingLoop.InLoop.
799         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
800
801 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
802
803         A fix for #78115
804         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
805         anonymous method is allowed from AnonymousContainer here.
806
807         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
808
809 2006-04-24  Raja R Harinath  <rharinath@novell.com>
810
811         Fix #78156
812         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
813
814 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
815
816         A fix for #49011.
817         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
818         (DoubleConstant.Reduce): Ditto.
819
820 2006-04-23  Raja R Harinath  <rharinath@novell.com>
821
822         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
823         Remove 'lvalue_right_side' argument.  Move parts to ...
824         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
825         (LocalVariable.DoResolveLValue): ... these.
826
827 2006-04-21  Raja R Harinath  <rharinath@novell.com>
828
829         Fix cs1655.cs
830         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
831         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
832         (LocalVariableReference.DoResolveBase): Use it to implement new
833         CS1655 check.
834         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
835         (Argument.Resolve): Simplify.  Move CS1510 check ...
836         * ecore.cs (Expression.ResolveLValue): ... here.
837         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
838         (PropertyExpr.DoResolveLValue): Likewise.
839         (FieldExpr.Report_AssignToReadonly): Likewise.
840         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
841         LValueMemberAccess or LValueMemberOutAccess on instance depending
842         on it.
843         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
844         DoResolve as appropriate.
845
846 2006-04-20  Raja R Harinath  <rharinath@novell.com>
847
848         Fix #75800
849         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
850         implicit conversions on 'out' and 'ref' arguments.
851
852         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
853         improve clarity.  Remove dead code.
854
855         Fix #66031
856         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
857         (Catch.Resolve): Resolve VarBlock if it exists.
858
859 2006-04-19  Miguel de Icaza  <miguel@novell.com>
860
861         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
862         twice, this was some residual code, the enumerator was emitted
863         properly in the two branche of if later.
864
865         Fixes #78031
866         
867         Thanks to Martin for finding the source of the problem
868         
869 2006-04-19  Raja R Harinath  <rharinath@novell.com>
870
871         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
872         cast is never an lvalue.
873         (Cast.DoResolve, Cast.ResolveRest): Combine.
874         (Argument.Emit): Simplify slightly.  Move 'Expr is
875         IMemoryLocation' check ...
876         (Argument.Resolve): ... here.
877         (Argument.Error_LValueRequired): Remove.  Inline into only user.
878
879         Simplifications.  Fix cs0191-2.cs
880         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
881         CS1649 and CS1651 to ...
882         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
883         the actual selection of the error code and message to a lookup
884         table.  Add a dummy return value to simplify callsites.
885         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
886         readonly fields of other instances of the same type.  Move CS0197
887         warning from ...
888         * expression.cs (Argument.Resolve): ... here.  Simplify code.
889         Ensure that ec.InRefOutArgumentResolving is only set during LValue
890         resolution of an out or ref argument.  The code simplification
891         above uses this invariant.
892
893 2006-04-18  Raja R Harinath  <rharinath@novell.com>
894
895         Possibly fix #77752.  Fix cs1690-[4-7].cs.
896         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
897         CheckMarshallByRefAccess.  Drop parameter.
898         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
899         warning.
900         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
901         InstanceExpression.
902         * report.cs (AllWarnings): Add CS1690.
903         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
904         for ref access too.
905         (LocalVariableReference.DoResolveBase): Update.
906
907 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
908
909         * class.cs (MethodOrOperator): Moved common parts from method class.
910         detect obsolete attributes.
911         (Method.Define): Simplified as it reuses code from base.
912         (Constructor.ValidAttributeTargets): Fixed issue found during
913         refactoring.
914         (Destructor.ValidAttributeTargets): Fixed issue found during
915         refactoring.
916         (Operator): Finished refactoring set off by #78020. Operator class is now
917         ordinary method class.
918
919         * anonymous.cs: Updated.
920
921 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
922
923         * class.cs (Constructor.Emit): Don't emit the attributes twice.
924
925 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
926
927         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
928         detect obsolete attributes.
929         (Method.CreateEmitContext): Moved to MethodOrOperator.
930
931 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
932
933         A fix for #78048.
934         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
935         customized exception to make crash detection easier.
936         (MethodOrOperator): Started to work on new base class for methods and
937         operators.
938         (Method): Derives from MethodOrOperator.
939         (Constructor.Emit): Emits its own attributes.
940         (AbstractPropertyEventMethod.Emit): Ditto.
941         (Operator): Derives from MethodOrOperator, will refactor fully in extra
942         patch.
943         (Operator.Emit): It's temporary more tricky than should be.
944         
945         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
946
947         * report.cs (InternalErrorException): Add ctor with inner exception.
948
949 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
950
951         A fix for #76744.
952         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
953         only not visible.
954
955 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
956
957         A fix for #77916.
958         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
959         array.
960
961 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
962
963         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
964         attribute is present and Guid not.
965         (Interface.ApplyAttributeBuilder): Ditto.
966
967         * attribute.cs: Add error message.
968
969 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
970
971         A fix for #78020.
972
973         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
974         sources (it's composite) so hold them in extra array as they are used in
975         Emit phase only. It worked in the previous versions by mistake.
976         (Attribute.Emit): Emit attribute for more owners when exist.
977
978         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
979         it has now different behaviour.
980
981 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
982
983         * constant.cs (Constant.IsDefaultInitializer): New method.
984
985         * class.cs: Updated.
986
987         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
988         re-initialize default values. It saves KBs almost for every assembly.
989         Thanks Zoltan for the idea.
990         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
991         (ArrayCreation.DoResolve): Resolve only once.
992         (ArrayCreation.Emit): Emit static initializer only when it is faster.
993         (ArrayCreation.GetAttributableValue): Cope with optimized values.
994
995 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
996
997         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
998         From #77961.
999
1000 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1001
1002         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
1003         in an embedded statement too.
1004
1005 2006-04-01  Raja R Harinath  <rharinath@novell.com>
1006
1007         Fix #77929
1008         * typemanager.cs (IsNestedChildOf): Drop generic arguments before
1009         testing.
1010
1011         Fix #77958
1012         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
1013
1014         Fix #77962
1015         * report.cs (SymbolRelatedToPreviousError): Drop generic type
1016         arguments before checking whether a type is reflected or not.
1017
1018         Fix #77954
1019         * expression.cs (Invocation.IsApplicable): Ensure a generic method
1020         definition doesn't take part in overload resolution.
1021         (Invocation.IsParamsMethodApplicable): Likewise.
1022         (Invocation.OverloadResolve): When replacing a reflected override
1023         method with its base definition, ensure that type arguments are
1024         applied.
1025
1026 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
1027
1028         A fix for #77966.
1029
1030         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
1031         was not specified.
1032
1033         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
1034
1035 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
1036
1037         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
1038         phase.
1039
1040         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
1041         LocalTemporary change.
1042
1043         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
1044         TypeContainer.
1045         (ClassOrStruct.DefineFieldInitializers): Implemented static field
1046         initializers optimization.
1047         (ClassOrStruct.TypeAttr): Moved from modifiers.
1048         (Constructor.CheckBase): Don't crash when static ctor has parameters.
1049         (FieldBase.ResolveInitializer): Resolves initializer.
1050         (FieldBase.HasDefaultInitializer): New property.
1051
1052         * cs-parser.jay: Removed message.
1053
1054         * expression.cs (CompilerGeneratedThis): New specialization.
1055
1056         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
1057
1058 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
1059
1060         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
1061
1062 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1063
1064         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1065         be now EnumConstants only.
1066
1067 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1068
1069         * attribute.cs, driver.cs: Reset more caches.
1070
1071 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1072
1073         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1074
1075 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1076
1077         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1078         for easier reuse. Updated all overrides.
1079         (IntegralConstant): New base class for all integral constants.
1080         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1081         of the constant range, report custom error.
1082         (UIntConstant.Reduce): Fixed uint conversion.
1083
1084         * ecore.cs, literal.cs: Reduce updates.
1085
1086 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1087
1088         A fix for #75813.
1089
1090         * class.cs (Constructor.Define): Removed extra if for default ctors.
1091         A patch from Atsushi Enomoto.
1092
1093 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1094
1095         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1096         GetAttributableValue.
1097
1098         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1099         when required.
1100
1101         * convert.cs (ImplicitConversionRequired): Error message moved to
1102         DoubleLiteral.
1103
1104         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1105         automatic implicit conversion of an output value.
1106         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1107
1108         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1109         conversion.
1110         (TypeOf.GetAttributableValue): Add extra handling for object type.
1111
1112         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1113         special error message.
1114
1115 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1116
1117         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1118         InternalCall.
1119         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1120         compatible with MS runtime.
1121
1122 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1123
1124         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1125         attribute arguments here.
1126
1127         * class.cs (Indexer.Define): The check was moved to attribute class.
1128
1129 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1130
1131         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1132
1133 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1134
1135         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1136
1137         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1138         the blocks too.
1139
1140 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1141
1142         * doc-bootstrap.cs : fix build.
1143
1144 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1145
1146         * expression.cs (StringConcat.Append): Issue a warning when empty string
1147         is going to append.
1148
1149 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1150
1151         * assign.cs (CompoundAssign.ResolveSource): Removed.
1152
1153         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1154         clean up.
1155
1156         * class.cs (TypeContainer.FindMethods): Removed.
1157         (TypeContainer.CheckMemberUsage): Made static.
1158
1159         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1160
1161         * constant.cs (CheckRange): Removed unused type argument.
1162         (CheckUnsigned): Removed unused type argument.
1163
1164         * cs-parser.jay: Updated after MemberAccess clean up.
1165         Uses Length for empty string test.
1166
1167         * cs-tokenizer.cs: Uses Length for empty string test.
1168         (IsCastToken): Made static.
1169         (is_hex): Made static.
1170         (real_type_suffix): Made static.
1171
1172         * decl.cs (SetupCache): Made static.
1173         (OnGenerateDocComment): Removed unused ds argument.
1174
1175         * delegate.cs (VerifyDelegate): Removed unused argument.
1176
1177         * doc.cs: Uses Length for empty string test.
1178
1179         * driver.cs: Uses Length for empty string test.
1180
1181         * enum.cs (IsValidEnumType): Made static
1182
1183         * expression.cs (EnumLiftUp): Removed unused argument.
1184         (ResolveMethodGroup): Ditto.
1185         (BetterConversion): Ditto.
1186         (GetVarargsTypes): Ditto.
1187         (UpdateIndices): Ditto.
1188         (ValidateInitializers): Ditto.
1189         (MemberAccess.ctor): Ditto.
1190         (GetIndexersForType): Ditto.
1191
1192         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1193
1194         * iterators.cs: Updated after MemberAccess clean up.
1195
1196         * location.cs: Uses Length for empty string test.
1197
1198         * namespace.cs: Uses Length for empty string test.
1199
1200          * report.cs (CheckWarningCode): Made static.
1201
1202         * statement.cs (LabeledStatement): Removed unused argument.
1203
1204         * typemanager.cs (FilterNone): Removed.
1205
1206 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1207
1208         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1209         obsolete.
1210
1211         * class.cs: Updated.
1212
1213 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1214
1215         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1216
1217 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1218
1219         A fix for #77816.
1220
1221         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1222         host container.
1223         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1224         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1225         Add more error reporting; Fixed issue with params.
1226
1227         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1228
1229         * cs-parser.jay: AnonymousMethod requires host container.
1230
1231         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1232
1233 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1234
1235         * class.cs: Change 'TypeContainer ds' constructor argument to
1236         'DeclSpace parent'.  Some classes were missed below due to
1237         different naming convention.
1238
1239         * class.cs (MemberCore.Parent): Delete.  This makes the
1240         ParentContainer changes below enforceable by the compiler.
1241
1242         Treat pointers to enclosing declaration space as 'DeclSpace', not
1243         'TypeContainer'.
1244         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1245         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1246
1247         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1248         of TypeContainer.
1249         (Block.AddThisVariable): Likewise.
1250         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1251         (AbstractPropertyEventMethod.Emit): Likewise.
1252         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1253         (GetMethod.Define, SetMethod.Define): Likewise.
1254         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1255         (DelegateMethod.EmitMethod): Likewise.
1256
1257         Fix regression test-partial-13.cs.
1258         Rationalize use of PartialContainer.  Ensure that the partial
1259         class semantics can be tied to type-correctness, i.e., any
1260         violation will cause a compile error.
1261         * class.cs, const.cs: Access all fields that belong to class
1262         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1263         Resolve()-like functions still use 'Parent'.
1264
1265         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1266         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1267         (PropertyMethod.CheckModifiers): Remove unused argument.
1268         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1269         DeclSpace.
1270
1271 2006-03-28  Raja R Harinath  <rharinath@novell.com>
1272
1273         * decl.cs (DeclSpace.LookupGeneric): Update to changes.
1274
1275 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1276
1277         Make semantics of PartialContainer simpler.
1278         * decl.cs (DeclSpace.IsPartial): Remove.
1279         * class.cs (TypeContainer.IsPartial): Likewise.
1280         (TypeContainer..ctor): Set PartialContainer to point to self.
1281         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1282         (TypeContainer.FindNestedType): Likewise.
1283         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1284
1285 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1286
1287         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1288
1289 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1290
1291         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1292         classes.
1293
1294 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1295
1296         * class.cs (Operator.Define): An error for base conversion was not
1297         reported correctly.
1298
1299 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1300
1301         A fix for #77593, #77574.
1302
1303         * class.cs (MethodCore.CheckBase): Another if for operator.
1304
1305 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1306
1307         A fix for #77822.
1308
1309         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1310         reporting, it's more tricky than I thought.
1311
1312 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1313
1314         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1315         were not resolved
1316
1317         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1318         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1319         conversion test.
1320         
1321         * ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1322         not needed.
1323
1324 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1325
1326         A fix for #77353.
1327
1328         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1329         (Event.Define): ditto
1330         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1331
1332         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1333         Removed redundant code and set NewSlot for Invoke method too.
1334
1335         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1336         (Parameters.MergeGenerated): New method. Use this method when you merge
1337         compiler generated argument with user arguments.
1338
1339 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1340
1341         * attribute.cs (ResolveAsTypeTerminal): Removed.
1342
1343         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1344         specialization for predefined types; 30% speed up.
1345         Finally placed obsolete check to right place.
1346         (Expression.ResolveType): Removed.
1347
1348         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1349         Updated after ResolveType was removed.
1350
1351         * expression.cs (Cast.ctor): Check void cast.
1352         (Binary.ResolveAsTypeTerminal): Is never type.
1353         (Conditional.ResolveAsTypeTerminal): Is never type.
1354
1355         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1356
1357 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1358
1359         * rootcontext.cs (ResolveCore): Removed System.INullableValue.
1360
1361 2006-03-23  Martin Baulig  <martin@ximian.com>
1362
1363         * expression.cs (Is.DoResolve, As.DoResolve): Perform a dynamic
1364         type check if either of the types is an open generic type.
1365
1366 2006-03-23  Martin Baulig  <martin@ximian.com>
1367
1368         * convert.cs
1369         (Convert.ExplicitTypeParameterConversion): New method; implement
1370         explicit type parameter conversions.
1371
1372 2006-03-23  Martin Baulig  <martin@ximian.com>
1373
1374         * convert.cs (Convert.ImplicitTypeParameterConversion): Do not
1375         blindly allow all conversions if we do not have any constraints.
1376
1377 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1378
1379         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1380         these two separated members to simplify the code.
1381         (Attribute.Resolve): Refactored to use new fields and methods.
1382         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1383         implemented obsolete attribute checking.
1384         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1385         implemented obsolete checking again. It look line never ending quest ;-)
1386         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1387
1388         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1389
1390         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1391
1392         *class.cs (Property.Define): Add RegisterProperty call.
1393
1394         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1395         argument groups (only 2).
1396
1397         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1398         encoding expression to arguments.
1399         (Expression.ExprClassToResolveFlags): Just turned to property.
1400
1401         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1402         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1403         optimized as well as implemented support for zero-length attributes.
1404
1405         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1406         Add caching of PropertyInfo's.
1407
1408 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1409
1410         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1411         error multiple times.
1412
1413 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1414
1415         New partial class implementation.
1416         A fix for #77027, #77029, #77403
1417
1418         * attribute.cs (Attributable): Made attributes protected.
1419
1420         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1421         the replacements of ClassPart and PartialContainer.
1422         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1423         (TypeContainer.AddInterface): Ditto.
1424         (TypeContainer.AddPartial): The main method for partial classes. It checks
1425         for errors and merges ModFlags and attributes. At the end class is added to
1426         partial_parts list.
1427         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1428         required here.
1429         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1430         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1431         from the rest of partial classes.
1432         (TypeContainer.GetClassBases): Simplified.
1433         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1434         DefineType.
1435         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1436         (TypeContainer.HasExplicitLayout): Uses Flags now.
1437         (PartialContainer): Removed.
1438         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1439         (StaticClass): Was merged with Class.
1440         (Class.GetClassBases): class and static class bases are verified here.
1441         (Class.TypeAttr): Added static attributes when class is static.
1442         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1443         (MemberBase): In some cases we need to call parent container for partial
1444         class. It should be eliminated but it's not easy now.
1445
1446         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1447
1448         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1449         partial classed to accumulate class comments.
1450         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1451
1452         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1453
1454         * driver.cs (MainDriver): Tree.GetDecl was removed.
1455
1456         * modifiers.cs (Modifiers): Add partial modifier.
1457
1458         * tree.cs (Tree.decl): Removed.
1459         (RootTypes): Started to use this class more often for root types
1460         specializations.
1461
1462 2006-03-23  Raja R Harinath  <rharinath@novell.com>
1463
1464         * generic.cs (TypeParameter.UpdateConstraints): Update
1465         'constraints' if null.
1466
1467 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1468
1469         A fix for #77615
1470
1471         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1472         external interface does not have an attribute.
1473
1474 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1475
1476         Another prerequisites for new partial classs implementation.
1477         
1478         * attribute.cs (Attribute.Equal): Implemented.
1479         (Attribute.Emit): Changed as attributes can be applied more than twice.
1480         (Attributes.Emit): Check for duplicate attributes here.
1481
1482         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1483         as a parameter, clean-up.
1484
1485 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1486
1487         A fix for #77485
1488
1489         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1490         contains obsolete attribute check which can in some cases look for base
1491         type of current class which is not initialized yet.
1492         (TypeContainer.BaseType): Replacement of ptype.
1493
1494         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1495
1496 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1497
1498         First of prerequisites for new partial classs implemention.
1499         
1500         * attribute.cs (Attributable): Extended by ResolveContext;
1501         Attributes finally have correct context for resolving in all cases.
1502         (AttachTo): Attribute owner is assigned here.
1503
1504         * codegen.cs (IResolveContext): Introduce new interface to hold
1505         all information needed in resolving phase.
1506         (EmitContext): Implements IResolveContext; more clean-up needed here.
1507         
1508         * decl.cs (MemberCore): Implemented IResolveContext.
1509
1510         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1511         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1512         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1513         Refactored to use new IResolveContext instead of EmitContext; cleanup
1514
1515 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1516
1517         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1518         mcs to keep code differences small.
1519         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1520         * typemanager.cs (parameter_default_value_attribute_type): New.
1521         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1522         CS1908 check.
1523
1524 2006-03-22  Martin Baulig  <martin@ximian.com>
1525
1526         * generic.cs
1527         (Nullable.NullableLiteral): Derive from `NullLiteral'.
1528
1529         * convert.cs
1530         (Convert.TypeParameter_to_Null): Create a `Nullable.NullableLiteral'
1531         instead of the normal `NullLiteral'.
1532
1533 2006-03-21  Martin Baulig  <martin@ximian.com>
1534
1535         Fix #77583.
1536         * generic.cs (TypeManager.InferType): If `pt' is a generic
1537         parameter, don't check whether `pt == at'.
1538
1539 2006-03-20  Raja R Harinath  <rharinath@novell.com>
1540
1541         Fix #77852
1542         * generic.cs (Constraints.Resolve): Change argument to IResolveContext.
1543         (TypeParameter.Resolve): Update to change.
1544         (ConstraintChecker.CheckConstraints): Resolve type-argument
1545         constraints before use.
1546
1547 2006-03-16  Martin Baulig  <martin@ximian.com>
1548
1549         * generic.cs
1550         (ConstraintChecker.HasDefaultConstructor): If we're a TypeBuilder
1551         and don't have any instance constructors, also lookup in the base class.
1552         (TypeManager.IsNullableValueType): New public method.
1553
1554         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Clear the
1555         `BindingFlags.DeclaredOnly' flag and set `used_cache'.
1556         (TypeManager.TryGetBaseDefinition): Use DropGenericMethodArguments().
1557
1558         * expression.cs (Unary.DoResolve): Use TypeManager.IsNullableValueType()
1559         instead of just TypeManager.IsNullableType() to determine whether
1560         a lifted operator exists.
1561         (UnaryMutator.DoResolve): Likewise.
1562         (Conditional.DoResolve): Likewise.
1563         (Binary.DoResolve): A lifted operator only exists if both operands
1564         are valuetypes and at least one of them is a nullable type.
1565
1566 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1567
1568         * iterator.cs : yield break is allowed in try statement which has
1569           catch clauses. Fixed bug #77767.
1570
1571 2006-03-12  Martin Baulig  <martin@ximian.com>
1572
1573         * typemanager.cs (TypeManager.ArrayContainsMethod): Use a new
1574         private IsSignatureEqual() to compare types; see the comment in
1575         that method; fixes #77674.
1576
1577 2006-03-10  Raja R Harinath  <rharinath@novell.com>
1578
1579         * ecore.cs (Expression.ResolveAsTypeStep): Remove 1-argument wrapper.
1580         (Expression.ResolveAsTypeTerminal): Likewise.
1581         * class.cs, decl.cs, delegate.cs, ecore.cs: Update to changes.
1582         * expression.cs, generic.cs, iterators.cs: Likewise.
1583         * parameter.cs, statement.cs, typemanager.cs: Likewise.
1584
1585 2006-03-09  Martin Baulig  <martin@ximian.com>
1586
1587         * generic.cs (ConstraintChecker.HasDefaultConstructor): Call
1588         TypeManager.DropGenericTypeArguments() on the `atype'; fixes #77548.
1589
1590 2006-03-09  Martin Baulig  <martin@ximian.com>
1591
1592         * ecore.cs (FieldExpr.AddressOf): Don't emit the instance if the
1593         `prepared' flag is set.
1594
1595         * generic.cs (LiftedBinaryOperator): Don't allow `||' or `&&' anymore.
1596         (LiftedBinaryOperator, LiftedUnaryMutator): Fix a few nullable
1597         issues; see gtest-254.cs.
1598
1599 2006-03-07  Martin Baulig  <martin@ximian.com>
1600
1601         * generic.cs (TypeManager.InferType): Allow infering
1602         `IEnumerable<T>' with an array of T; see gtest-251.cs.
1603
1604 2006-03-06  Martin Baulig  <martin@ximian.com>
1605
1606         * generic.cs
1607         (TypeManager.InferType): Fix gtest-250.cs.
1608
1609         * typemanager.cs
1610         (TypeManager.IsSubclassOf): Also check the base class.
1611
1612         * expression.cs
1613         (Invocation.IsAncestralType): Use TypeManager.IsSubclassOf();
1614         fixes gtest-249.cs.
1615
1616 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1617
1618         Fix #77679.
1619         * expression.cs (ParameterReference.DoResolveBase): Change return
1620         type to bool.
1621         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1622         Update.
1623
1624         Fix #77628.
1625         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1626
1627         Fix #77642.
1628         * typemanager.cs (GetFullNameSignature): Don't nullref on
1629         protected accessors.
1630
1631 2006-02-16  Martin Baulig  <martin@ximian.com>
1632
1633         * generic.cs
1634         (TypeManager.GetGenericFieldDefinition): New public method; use it
1635         instead of the `FieldInfo.Mono_GetGenericFieldDefinition()' icall.
1636
1637 2006-02-14  Martin Baulig  <martin@ximian.com>
1638
1639         * *.cs: Use `Type.IsGenericType' instead of `Type.IsGenericInstance'.
1640
1641 2006-02-14  Martin Baulig  <martin@ximian.com>
1642
1643         * generic.cs
1644         (TypeManager.DropGenericMethodArguments): New public method; don't
1645         use GetGenericMethodDefinition() on something which is not a
1646         generic method.
1647
1648 2006-02-14  Martin Baulig  <martin@ximian.com>
1649
1650         * generic.cs
1651         (ConstraintChecker.CheckConstraints): If a type parameter has the
1652         `struct' constraint, the type must be a non-nullable valuetype.
1653
1654 2006-02-10  Martin Baulig  <martin@ximian.com>
1655
1656         * typemanager.cs
1657         (TypeManager.IsOverride): Make this work for instantiated methods
1658         in a generic class; fixes #77509.
1659         (TypeManager.ExpandInterfaces): Use TypeManager.GetInterfaces()
1660         rather than calling it directly; fixes #77488.  
1661
1662 2006-02-08  Martin Baulig  <martin@ximian.com>
1663
1664         * generic.cs (ConstraintChecker.CheckConstraints): Move the error
1665         reporting into CheckConstraint() so we can use the correctly
1666         instantiated type.
1667
1668 2006-02-08  Martin Baulig  <martin@ximian.com>
1669
1670         * expression.cs (BaseAccess): Add support for generic methods.
1671
1672         * ecore.cs (MethodGroupExpr.ResolveGeneric): Propagate `IsBase' to
1673         the new MethodGroupExpr.
1674
1675 2006-02-07  Martin Baulig  <martin@ximian.com>
1676
1677         * generic.cs (ConstraintChecker.CheckConstraints): Interfaces are
1678         also reference types; fixes #77483.
1679
1680 2006-02-07  Martin Baulig  <martin@ximian.com>
1681
1682         * generic.cs
1683         (TypeManager.IsGenericMethod): We now return whether something is
1684         an instantiated generic method (and not a generic method def).
1685         (TypeManager.IsGenericMethodDefinition): New public method.
1686
1687         * typemanager.cs
1688         (TypeManager.CSharpSignature): Only include type arguments for
1689         "real" generic methods, not for any instantiated method.
1690         (TypeManager.GetMethodName): Likewise, but also allow generic
1691         method definitions here.
1692
1693 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1694
1695         * codegen.cs (EmitScopeInitFromBlock): check here the
1696         capture_context, there is no need to make two calls to the
1697         EmitContext. 
1698
1699         * anonymous.cs: Add some debugging messages that might help me
1700         track other instances of this problem in the future (the
1701         regression of test 467).
1702
1703         * cs-parser.jay: track the variable block, as we need to initalize
1704         any captured variables declared in this block for the "catch"
1705         portion of the "Try" statement.
1706
1707         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1708         scope initialization for captured variables. 
1709
1710         Also, move the emit for the variables after the block location has
1711         been marked.
1712
1713 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1714
1715        * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1716         
1717 2006-02-06  Martin Baulig  <martin@ximian.com>
1718
1719         * class.cs (TypeContainer.DefineType): If we're a struct, pass
1720         `TypeManager.value_type' as parent type to
1721         ModuleBuilder.DefineType().  Fixes #77358.      
1722
1723 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1724
1725         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1726         commit yesterday, the initialization for the roots is necessary.
1727         What is not necessary is the scope activation.
1728
1729 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1730
1731         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1732         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1733         CS0206 checks.
1734         (Argument.Resolve): Remove CS0206 checks.
1735
1736 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1737
1738         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1739         scopes for all the roots, the scopes will now be emitted when the
1740         Blocks are entered. [This change was wrong, fixed on 2006-02-02]
1741
1742         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1743         code.  This reduces a lot of existing cruft.
1744         
1745         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1746         that the ScopeInfo is generated as we enter the scope, not at the
1747         time of use, which is what we used to do before.
1748
1749         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1750         every time a Block is about to be emitted if we have a
1751         CaptureContext. 
1752
1753 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1754
1755         * codegen.cs (AssemblyClass.Emit): Emit RuntimeCompatibility
1756         attribute for mscorlib too.
1757
1758         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1759         (Reset): Update.
1760         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1761
1762         * typemanager.cs (cons_param_array_attribute): Make private.
1763         (Reset): Set it to null.
1764         (InitCoreHelpers): Don't initialize it.
1765         (ConsParamArrayAttribute): New.  Initialize it as needed.
1766         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1767
1768 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1769
1770         * expression.cs: There might be errors reported during the
1771         selection of applicable methods.  If there are errors, do not
1772         continue execution as it will lead the compiler to crash.
1773
1774 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1775
1776         * expression.cs: Member access is not allowed on anonymous
1777         methods.  Fixes #77402.
1778
1779 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1780
1781         Fix #77401
1782         * cs-parser.jay (VariableDeclaration): Don't set
1783         current_array_type to null.
1784         (field_declaration, event_declaration, declaration_statement):
1785         Set it to null here.
1786
1787 2006-01-29  Raja R Harinath  <harinath@gmail.com>
1788
1789         Fix part of #77397
1790         * generic.cs (TypeManager.IsEqual): Handle pass-by-ref types.
1791
1792 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1793
1794         * typemanager.cs (GenericParameterPosition): New.
1795         * doc.cs: Use it.
1796
1797 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1798
1799         * doc.cs : To process "include" elements, first we should create
1800           another list than XmlNodeList, because it could result in node
1801           removal, which could result in that the XmlNodeList gives up
1802           yielding next node.
1803
1804 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1805
1806         * expression.cs: Introduce an error report that we were not
1807         catching before.   Gonzalo ran into it.
1808
1809 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1810
1811         A fix for bug: #76957
1812         
1813         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1814         ComputeMethodHost before creating the method, this is a new
1815         requirement. 
1816
1817         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1818         that this method references (RegisterScope).  The actual scope
1819         where the method is hosted is computed with the ComputeMethodHost
1820         before we create the method.
1821
1822         Moved the Deepest routine here.
1823
1824         (AnonymousContainer.ComputeMethodHost): New routine used to
1825         compute the proper ScopeInfo that will host the anonymous method.
1826
1827         (ScopeInfo): Deal with multiple roots.  The problem was that we
1828         did not have a unique root where all ScopeInfos could be hanged
1829         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1830         of roots.  
1831
1832         Remove AdjustMethodScope which is now computed at the end.  Remove
1833         LinkScope which did a partial link, instead link all ScopeInfos
1834         before code generation from the new "LinkScopes" routine. 
1835
1836         Simplify all the Add* routines as they no longer need to maintain
1837         the tree, they just need to record that they are using variables
1838         from a ScopeInfo.
1839
1840         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1841         routines to produce the forest of ScopeInfo trees.
1842
1843         * class.cs (TypeContainer.AppendMethod): This is just like
1844         AddMethod, but ensures that an interface implementation method
1845         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1846         methods, but at the end.
1847
1848         We use this functionality to ensure that the generated MoveNext
1849         method in the iterator class is resolved/emitted before the
1850         enumerator methods created.   
1851
1852         This is required because the MoveNext method computes the right
1853         ScopeInfo for the method.  And the other methods will eventually
1854         need to resolve and fetch information computed from the anonymous
1855         method. 
1856
1857         
1858 2006-01-23  Raja R Harinath  <rharinath@novell.com>
1859
1860         Improve implementation of section 14.4.2.2 (Better function member).
1861         * expression.cs (Invocation.MoreSpecific): Compare all type
1862         arguments before deciding if one type is more specific than
1863         another.  Handle array types too.  Return the more specific type.
1864         (Invocation.BetterFunction): Add more tie-breaking rules from
1865         section 14.4.2.2.  Perform "more specific" check after
1866         other tie-breaking rules.  Compare all parameter types before
1867         choosing the "more specific" method.
1868
1869 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1870             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1871
1872         Fix rest of #76995.
1873         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1874         the 'aliases' hash.
1875         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1876         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1877
1878 2006-01-18  Martin Baulig  <martin@ximian.com>
1879
1880         * class.cs (TypeContainer.AddToMemberContainer): Use
1881         `symbol.MemberName.MethodName' instead of just `symbol.Name';
1882         fixes #77124.
1883
1884 2006-01-18  Martin Baulig  <martin@ximian.com>
1885
1886         Fix #76417: a generic class may now have methods which may unify
1887         for some type parameter substitutions.
1888
1889         * class.cs (Method.IsDuplicateImplementation): Don't report CS0408
1890         for methods which may unify anymore.
1891
1892         * expression.cs (Invocation.MoreSpecific): New private static
1893         method; checks whether one method is more specific than another
1894         according to 14.4.2.2 of the spec.
1895         (Invocation.BetterFunction): Implement the tie-breaking rules from
1896         14.4.2.2 of the spec: if two methods unify for some type parameter
1897         substitution, we need to pick the more specific one.
1898
1899 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1900
1901         Fix #76656, cs0231-2.cs.
1902         * cs-parser.jay (formal_parameter_list): Make error case catch
1903         more issues.
1904         (parenthesized_expression_0): Add CS1026 check.
1905         (invocation_expression): Remove unused { $$ = lexer.Location }.
1906
1907 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1908
1909         Fix #76824.
1910         * cs-parser.jay (statement_expression): Don't list out the
1911         individual statement-expressions.  Convert syntax error into
1912         CS0201 check.
1913
1914 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1915
1916         Fix #76874.
1917         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1918         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1919         CheckIntermediateModification.
1920         (FieldExpr.DoResolve): Add new two-argument version that
1921         allows us to resolve the InstanceExpression as an lvalue.
1922         The one-argument variant is now just a wrapper.
1923         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1924         Resolve the lhs as an lvalue if the it has a value type.
1925         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1926         from Assign.DoResolve.
1927         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1928         resolved as an lvalue.
1929         (PropertyExpr.DoResolve): Update.
1930         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1931         has a value type.  Move CS1612 check here from
1932         CheckIntermediateModification.
1933         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1934         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1935         'right_side' of a ResolveLValue on an 'out' argument.
1936         (EmptyExpression.LValueMemberAccess): New.  Used as the
1937         'right_side' of a propagated ResolveLValue on a value type.
1938         (LocalVariableReference.DoResolveBase): Recognize
1939         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1940         Add CS1654 check.
1941         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1942         EmptyExpression.Null.
1943
1944 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1945
1946         * typemanager.cs : added IsGenericParameter(). In gmcs it returns
1947           Type.IsGenericParameter(). Fixed bug #77183.
1948         * doc.cs : it is now identical to doc.cs in mcs.
1949
1950 2006-01-16  Martin Baulig  <martin@ximian.com>
1951
1952         * generic.cs (ConstraintChecker.CheckConstraint): Fix #77167.
1953
1954 2006-01-16  Martin Baulig  <martin@ximian.com>
1955
1956         * typemanager.cs (TypeManager.CSharpSignature): Make this work for
1957         ctors; fixes #77250.
1958
1959 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1960
1961         This fixes the problem where we used ldfld instead of ldflda to
1962         load the "THIS" pointer on captured parameters, when THIS is a
1963         value type.  See bug #77205.
1964         
1965         * iterators.cs (CapturedThisReference.Emit): Pass false to
1966         EmitThis (we do not need the address).
1967
1968         * codegen.cs (EmitThis): it needs to know whether we need the
1969         address of `this' or not.  This is used by value types.  
1970
1971         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1972         every other call passes false.
1973
1974 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1975
1976         Fix #77221.
1977         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1978         GetOverride.
1979         * expression.cs (Invocation.OverloadResolve): Update.
1980         (Invocation.DoResolve): Avoid double resolution of invocation.
1981
1982 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1983
1984         Fix #77180.
1985         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1986         unary negation of floating point types as 0-expr; negation cannot
1987         overflow in floating point types.
1988
1989         Fix #77204.
1990         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1991         on operands of 'void' type.
1992
1993         Fix #77200.
1994         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1995         and ExclusiveOr for boolean constants too.
1996
1997 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1998
1999         * expression.cs: Fix Console.WriteLine ((this = x).foo);
2000
2001 2006-01-12  Miguel de Icaza  <miguel@novell.com>
2002
2003         * cs-tokenizer.cs (Position): New class used to save and restore
2004         the position state in the tokenizer.  Before this patch the save
2005         and restore was not complete enough so the line and columns would
2006         start to drift and the debugger and stack traces will get the
2007         wrong data.
2008
2009 2006-01-10  Martin Baulig  <martin@ximian.com>
2010
2011         * generic.cs
2012         (TypeParameter.InflateConstraints): New public method.
2013
2014         * iterators.cs (Iterator.DefineNestedTypes): Also inflate the
2015         constraints; fixes #77042.
2016
2017 2006-01-10  Martin Baulig  <martin@ximian.com>
2018
2019         * anonymous.cs (ScopeInfo.EmitScopeType): Use the `CurrentType'
2020         instead of the `TypeBuilder' for this "<>THIS" variable; fixes
2021         #77061. 
2022
2023 2006-01-09  Raja R Harinath  <rharinath@novell.com>
2024
2025         Fix #75636.
2026         * expression.cs (Invocation.OverloadResolve): Replace reflected
2027         override methods with their base virtual methods, rather than
2028         skipping over them.
2029         * typemanager.cs (TypeManager.GetOverride): New.
2030
2031 2005-12-21  Miguel de Icaza  <miguel@novell.com>
2032
2033         * driver.cs: Report the case of no source files and no -out:
2034         argument provided.
2035
2036 2005-12-20  Raja R Harinath  <rharinath@novell.com>
2037
2038         Fix #77035.
2039         * expression.cs (ComposedCast.GetSignatureForError): Define.
2040
2041 2006-01-05  Jb Evain  <jbevain@gmail.com>
2042
2043         * class.cs (Property.Define, Indexer.Define): do not tag the
2044         properties as SpecialName | RTSpecialName.
2045
2046 2006-01-04  Miguel de Icaza  <miguel@novell.com>
2047
2048         * class.cs (MethodCore.IsDuplicateImplementation): This method was
2049         doing a low-level comparission of parameter types.  It was lacking
2050         a check for __argslist. 
2051
2052 2005-12-30  Miguel de Icaza  <miguel@novell.com>
2053
2054         * expression.cs (ParameterReference.DoResolveBase): Allow
2055         reference parameters if they are local to this block. 
2056
2057         This allows the ref and out parameters of a delegate to be used in
2058         an anonymous method, for example:
2059
2060         delegate void set (out int x);
2061
2062         set s = delegate (out int x){
2063                 x = 0;
2064         };
2065
2066         This is used by functionality introduced late in the C# language.
2067         
2068         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
2069         method that take ref and out parameters. 
2070
2071         Fixes #77119 which was a late change in the spec.
2072
2073 2005-12-23  Miguel de Icaza  <miguel@novell.com>
2074
2075         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
2076         parent if its the same scope.  Fixes #77060.
2077
2078 2005-12-22  Marek Safar  <marek.safar@seznam.cz>
2079
2080         * expression.cs (ComposedCast.DoResolveAsTypeStep): Fixed wrong merge.
2081
2082 2005-12-21  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2083
2084         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): Generate
2085         errors 1726 for strong named assemblies with InternalsVisibleToAttribute 
2086         that doesn't contain the full public key. This is a update of the
2087         friend assemblies in .Net 2.0 release.
2088         
2089 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
2090
2091         Fix #76995
2092
2093         * namespace.cs (NamespaceEntry): Add extern_aliases as a
2094         ListDictionary, to contain the ExternAliasEntry entries (in
2095         addition to the NamespaceEntry.aliases hashtable). This field is
2096         shared between the original entry and its doppelganger (bodyless 
2097         copy of it).
2098         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
2099         extern_aliases field.
2100         (NamespaceEntry.Lookup): Move the IsImplicit check after the
2101         lookup in extern_aliases.
2102
2103 2005-12-16  Raja R Harinath  <rharinath@novell.com>
2104
2105         Fix #77006.
2106         * class.cs (TypeContainer.Mark_HasEquals): New.
2107         (TypeContainer.Mark_HasGetHashCode): New.
2108         (ClassPart): Override them.
2109         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
2110
2111         * generic.cs (GenericMethod.DefineMembers): Update to changes.
2112         (TypeParameter.TypeParameter): Change type of 'parent' argument to
2113         DeclSpace.
2114
2115         Fix #77008.
2116         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
2117         'parent' argument to the base constructor.
2118
2119         Remove all mention of TypeContainer from decl.cs.
2120         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
2121         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
2122         (DeclSpace.DeclSpace): Likewise.
2123         (DeclSpace.DefineMembers): Remove unused argument.
2124         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
2125         debugging check -- we don't care if the debug code throws an
2126         InvalidCastException instead of an InternalErrorException.
2127         * class.cs (TypeContainer.DefineMembers): Update to changes.
2128         (TypeContainer.DoDefineMembers): Likewise.
2129         (TypeContainer.GetMethods): Likewise.
2130         (PropertyMember.Define): Likewise.
2131         (MemberBase.Parent): New property that forwards to
2132         MemberCore.Parent, but ensures that we get a TypeContainer.
2133         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
2134         (RootContext.PopulateTypes): Likewise.  Remove special case code
2135         for !RootContext.StdLib: DefineMembers is idempotent.
2136
2137 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
2138
2139         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
2140
2141 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
2142
2143         * doc.cs : The search for referenced namespace was insufficient to
2144           get global one as it used to do. Fixed bug #76965.
2145
2146 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
2147
2148         * doc.cs : check name in cref in the last phase that whether it is
2149           namespace or not.
2150
2151 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2152
2153         * cs-tokenizer.cs : reverted the latest change: it somehow broke
2154           Mono.C5.
2155
2156 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2157
2158         * doc.cs : so it turned out that we cannot skip override check for 
2159           interface members. Fixed bug #76954.
2160
2161 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
2162
2163         * cs-tokenizer.cs : fixed bug #75984:
2164           - #warning and #error should not be handled when the source line
2165             is disabled.
2166           - #line is not checked strictly when the source line is disabled.
2167           - #define and #undef is on the other hand checked strictly at any
2168             state.
2169
2170 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
2171
2172         * cs-tokenizer.cs : missing Location (actually, filename) in one of
2173           CS1027 report.
2174
2175 2005-12-15  Raja R Harinath  <rharinath@novell.com>
2176
2177         * generic.cs (TypeManager.IsGeneric): Remove unused method.
2178
2179         * typemanager.cs (TypeManager.GetFullName): Rewrite to handle
2180         nested types.
2181
2182 2005-12-14  Martin Baulig  <martin@ximian.com>
2183
2184         * typemanager.cs (TypeManager.GetFullName): Make this public;
2185         `Type.Fullname' now never returns null.
2186
2187         * class.cs (Method.Define): Use TypeManager.GetFullName() for
2188         explicit interface implementations; we're now using the same
2189         naming convention than csc does.
2190
2191 2005-12-14  Miguel de Icaza  <miguel@novell.com>
2192
2193         * convert.cs (ExplicitConversionCore): Check the return value from
2194         ExplicitConversionCore which can return null on failure.  Fixes #76914
2195
2196 2005-12-09  Raja R Harinath  <rharinath@novell.com>
2197
2198         * anonymous.cs (AnonymousMethod.Compatible): Use IsGenericType
2199         instead of IsGenericInstance.
2200         * generic.cs (TypeManager.IsEqual): Likewise.  Delete redundant
2201         code that's now covered by the more general test.
2202         * typemanager.cs (TypeManager.IsPrivateAccessible): Likewise.
2203
2204         * generic.cs (DropGenericTypeArguments): New.  Captures the common
2205         pattern: if (t.IsGenericInstance) t = t.GetGenericTypeDefinition ();
2206         * attribute.cs, class.cs, decl.cs, ecore.cs: Use it.
2207         * generic.cs, report.cs, typemanager.cs: Likewise.
2208
2209 2005-12-08  Martin Baulig  <martin@ximian.com>
2210
2211         * generic.cs (TypeArguments.Resolve): Added CS1547 check.
2212
2213         * typemanager.cs (TypeManager.CSharpSignature): Include type
2214         arguments in the signature of a generic method.
2215
2216 2005-12-07  Martin Baulig  <martin@ximian.com>
2217
2218         Add support for custom attributes on type parameters.
2219
2220         * cs-parser.jay (type_arguments): Added `opt_attributes'.
2221
2222         * generic.cs (TypeParameterName): New public class; we use this
2223         instead of a `string' to store the name of a type parameter, so we
2224         can also have `Attributes'.
2225         (TypeArguments.GetDeclarations): Return a `TypeParameterName[]'
2226         array instead of a `string[]' array.
2227         (TypeParameter.ctor): We now also take an `Attributes' argument.
2228         (TypeParameter.EmitAttributes): New public method; emit our
2229         `OptAttributes' here.
2230         (GenericMethod.EmitAttributes): New public method; emit the custom
2231         attributes on all our type parameters.
2232
2233         * class.cs (TypeContainer.EmitType): Call EmitAttributes() on all
2234         our type parameters.
2235         (MethodData.Define): If we're a generic method, call
2236         EmitAttributes() on it.
2237
2238 2005-12-07  Martin Baulig  <martin@ximian.com>
2239
2240         * generic.cs
2241         (ConstraintChecker): New public abstract class; move the
2242         constraint checking here from `ConstructedType' and also do
2243         constraint checking for generic methods here.
2244
2245         * expression.cs (Invocation.OverloadResolve): Use
2246         ConstraintChecker.CheckConstraints() if we resolved to a generic
2247         method.  Fix #76806.
2248
2249 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2250
2251         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
2252
2253         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
2254         event initializers.
2255         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
2256         (FieldBase.Initializer): Initializer is now optional.
2257         (EventField.Define): Only event field can have initializer.
2258
2259         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
2260
2261         * const.cs (Const): Reuse initializer.
2262
2263         * cs-parser.jay: Updated after FieldBase changes.
2264         Added current_array_type to simplify array initializers.
2265
2266         * ecore.cs (NullCast.IsDefaultValue): Implemented.
2267
2268         * expression.cs, iterators.cs: Updated.
2269
2270         * namespace.cs (NamespaceEntry): Made UsingFound private.
2271
2272 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2273
2274         * parameterCollection.cs: Obsolete, removed.
2275         * parser.cs: Obsolete, removed.
2276
2277 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
2278
2279         Fix #76849.
2280         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
2281
2282         * enum.cs (Enum.Define): Set obsolete context here.
2283
2284 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2285
2286         * doc.cs :
2287           - FindDocumentedMember() now expects 1) paramList as null
2288             when "we don't have to check the number of parameters" and
2289             2) Type.EmptyTypes when "there is no arguments".
2290           - Introduced FoundMember struct to hold the exact type which was
2291             used to find the documented member (the above change broke
2292             test-xml-044; it might be better just to use DeclaringType than
2293             what MS does, like this change does, but it depends on usage.)
2294
2295 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
2296
2297         * doc.cs : documented member might be from DeclaringType for nested
2298           types. Fixed bug #76782.
2299
2300 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
2301
2302         * anonymous.cs: Have the param code handle leaving copies on the
2303         stack etc. Allows anonymous params to take part in the assignment
2304         code (++, +=, etc). Fixes bug #76550
2305
2306         * expression.cs: Handle the prepare_for_load/leave_copy by passing
2307         it down to the anon code.
2308
2309         * iterators.cs: Use dummy var here
2310
2311         * codegen.cs: Handle new vars
2312
2313 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2314
2315         Fix #76849.
2316         * class.cs (MethodData.Define): Set proper Obsolete context.
2317
2318         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
2319         obsolete context.
2320         (FieldExpr.DoResolve): Ditto.
2321
2322 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
2323
2324         Fix #76849.
2325         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
2326         parent is not obsolete.
2327
2328 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
2329
2330         * doc.cs : (FindDocumentedMember) find parameterless members first
2331           and get CS0419 in the early stage. Fixed first case of bug #76727.
2332
2333 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
2334
2335         Fix #76859.
2336         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
2337         no error was reported.
2338
2339         *expression.cs (Binary.DoResolve): left can be null.
2340
2341 2005-12-06  Raja R Harinath  <rharinath@novell.com>
2342
2343         * class.cs (MethodCore.CheckGenericOverride): Delete unused
2344         abstract method and all overrides.
2345         * support.cs (ParameterData.GenericConstraints): Delete.
2346         (ReflectionParameters.type_params): Delete.
2347         (ReflectionParameters.ReflectionParameters): Make private.
2348         (ReflectionParameters.GetConstaints): New factory method.
2349         * generic.cs (TypeParameterDefineType): Use it.
2350         (TypeManager.GetTypeParameterConstraints): Likewise.
2351
2352 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
2353
2354         Fix #76783.
2355         * class.cs (MethodData.Emit): Parameters should be labeled first.
2356
2357 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
2358
2359         Fix #76761.
2360         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
2361
2362 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
2363
2364         * attribute.cs (AreParametersCompliant): Moved to Parameter.
2365
2366         * class.cs (MethodCore): Parameter clean up.
2367         (IMethodData): Added ParameterInfo.
2368         (MethodData): Parameter clean up.
2369         (Indexer.Define): Parameter clean up.
2370
2371         * anonymous.cs,
2372         * codegen.cs,
2373         * cs-parser.jay,
2374         * decl.cs,
2375         * doc.cs,
2376         * ecore.cs,
2377         * flowanalysis.cs,
2378         * iterators.cs,
2379         * pending.cs,
2380         * statement.cs,
2381         * typemanager.cs: Parameter clean up.
2382
2383         * delegate.cs (Define): Get rid of duplicated code.
2384
2385         * expression.cs (ParameterReference): Removed useless parameters
2386         and simplified.
2387         (Invocation): Ditto.
2388
2389         * parameter.cs (ParamsParameter): New class, params specialization.
2390         (ArglistParameter): Attemp to separate arglist.
2391         (Parameter): Refactored to be reusable and faster.
2392         (Parameter.Modifier): Made understandable.
2393         (Parameters): Changed to be used as a class for `this' assembly
2394         parameters. Refactored to use new specialized classes.
2395
2396         * support.cs (ParameterData): Added Types property.
2397         (InternalParameters): Deleted.
2398
2399 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2400
2401         * doc.cs : the previous patch does not actually fix the bug.
2402           PropertyInfo override check is now implemented and really fixed it.
2403         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2404
2405 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2406
2407         * doc.cs : apply "override filter" also to properties.
2408           Fixed bug #76730.
2409
2410 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2411
2412         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2413           no need to check overrides. For classes, omit those results from 
2414           interfaces since they must exist in the class. Fixed bug #76726.
2415
2416 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2417
2418         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2419           with different parameters. Fixed the second problem in #76685.
2420
2421 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2422
2423         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2424           get expected 'protected' access in CheckValidFamilyAccess()).
2425           Fixed bug #76692.
2426
2427 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2428
2429         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2430           Fixed bug #76705.  CS1569 was incorrectly commented out.
2431
2432 2005-11-23  Martin Baulig  <martin@ximian.com>
2433
2434         * generic.cs (Constraints.Define): Removed.
2435         (TypeParameter.DefineConstraints): Removed.
2436         (TypeParameter.DefineType): Call SetGenericParameterAttributes()
2437         on the GenericTypeParameterBuilder here.
2438
2439 2005-11-23  Martin Baulig  <martin@ximian.com>
2440
2441         * typemanager.cs (TypeManager.GetProperty): Make this public.
2442
2443         * generic.cs (Nullable.NullableInfo.ctor): Use
2444         TypeManager.GetProperty() rather than using reflection directly.
2445
2446 2005-11-17  Martin Baulig  <martin@ximian.com>
2447
2448         * expression.cs (Indexers.GetIndexersForType): Added support for
2449         generic parameters; fixes #76587.
2450
2451 2005-11-17  Martin Baulig  <martin@ximian.com>
2452
2453         * anonymous.cs
2454         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2455         inherit the scope from our parent.  Fixes #76653.
2456
2457 2005-11-15  Martin Baulig  <martin@ximian.com>
2458
2459         * anonymous.cs (ScopeInfo.ScopeType): New public field; use this
2460         instead of `ScopeTypeBuilder' to refer to the "current" type.
2461         (AnonymousMethod.CreateScopeType): Correctly create the helper
2462         class if we're inside a generic type definition.
2463
2464 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2465
2466         * doc.cs : use Invocation.IsOverride() to do real override check.
2467         * expression.cs : made Invocation.IsOverride() internal.
2468
2469 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2470
2471         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2472           TypeBuilder.FindMembers() and filter overriden base members out.
2473           Fixed bug #76990.
2474
2475 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2476
2477         * doc.cs : ref/out parameters are represented as '@' (instead of
2478           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2479
2480 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2481
2482         * doc.cs : when there was no '.' in cref to methods in doc comment,
2483           then parameters were missing in the output. Fixed bug #76691.
2484
2485 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2486
2487         * driver.cs : don't output docs when there is an error.
2488           Fixed bug #76693.
2489
2490 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2491
2492         * doc.cs :
2493           Now it should detect indexers. Fixed primary concern in bug #76685.
2494           Fixed CS0419 message to not show the identical member signature in
2495           the message.
2496
2497 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2498
2499         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2500           instead of Type.FindMembers() since it does not handle events.
2501           Fixed bug #71604.
2502
2503 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2504
2505         * codegen.cs: Fixed typo (speficied -> specified).
2506
2507 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2508
2509         Fix #76369.
2510         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2511
2512 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2513
2514         * attribute.cs: Changed error message.
2515
2516         * cs-tokenizer.cs: One more check.
2517
2518 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2519
2520         * statement.cs (Block.Resolve): Ignore empty statement.
2521
2522 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2523
2524         * report.cs: Made error/warning methods more strict to avoid
2525         their misuse.
2526
2527         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2528         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2529         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2530         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2531
2532 2005-11-11  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2533
2534         * codegen.cs (AssemblyClass.CheckInternalsVisibleAttribute): 
2535         Use the more explicit AssemblyName.FullName instead of 
2536         AssemblyName.Name to report errors.
2537         
2538 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2539
2540         * attribute.cs, class.cs, cs-tokenizer.cs, parameter.cs: Sync
2541         with mcs.
2542
2543 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2544
2545         * class.cs,
2546         * convert.cs,
2547         * cs-parser.jay,
2548         * decl.cs,
2549         * enum.cs,
2550         * expression.cs,
2551         * generic.cs,
2552         * pending.cs,
2553         * report.cs: Fixed error reporting and typos.
2554
2555         * generic.cs (TypeParameter.GetSignatureForError): New method.
2556         (ConstructedType.GetSignatureForError): Instead of DeclarationName.
2557
2558         * typemanager.cs (GetFullName): Refactored.
2559
2560 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2561
2562         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2563         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2564
2565         * class.cs (TypeContainer.IsComImport): New property.
2566         (Constructor.Define): Create proper ctor for ComImport types.
2567
2568         * expression.cs (New.CheckComImport): Fixed.
2569
2570 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2571
2572         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2573         that a parameter has been captured does not mean that we do not
2574         have to do the rest of the processing.  This fixes the second part
2575         of #76592.  If there was another anonymous method capturing
2576         values in the past, the Scope would never be set for the second
2577         method that captured the same parameter.
2578
2579         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2580         properly manipulate the stack.   Second part of fix for #76592.
2581
2582         * expression.cs (New): Add support for invoking "new" on
2583         interfaces that have been flagged with the ComImport attribute and
2584         the CoClass.  Fixes #76637 
2585
2586         * statement.cs (Try.DoEmit): When a variable is captured, do not
2587         try to emit the vi.LocalBuilder variable as it has been captured.
2588         Create a temporary variable and store the results on the
2589         FieldBuilder.  Fixes #76642
2590
2591 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2592
2593         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2594
2595         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2596
2597         * expression.cs (Binary.DoResolve): Added && optimalization.
2598     
2599         * typemanager.cs (AddUserType): Removed useless argument.
2600
2601 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2602
2603         * statement.cs (Block.variables): Uses ListDictionary.
2604
2605 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2606
2607         Fix #75969.
2608         * class.cs (PartialContainer.EmitType): Customized to emit
2609         security attributes.
2610         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2611         for partial classes.
2612
2613 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2614
2615         Fix #76599.
2616         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2617         access has to be fixed.
2618         
2619         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2620
2621 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2622
2623         Fix #76590.
2624         * ecore.cs (NullCast.Reduce): Implemented.
2625
2626         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2627         constant type.
2628         
2629         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2630         properly.
2631         (Foreach.Resolve): Catch null properly.
2632
2633 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2634  
2635         * cs-tokenizer.cs: Warning text fix.
2636
2637         * driver.cs: AllWarningNumbers exposed on public interface.
2638
2639         * report.cs (): Reviewed warning numbers.
2640         (IsValidWarning): Use binary search.
2641
2642 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2643  
2644         * driver.cs: Implemeted resource visibility.
2645         (Resources): New class for code sharing between /res: and
2646         /linkres:
2647  
2648 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2649
2650         decl.cs (CurrentTypeParameters): Fixed to be public.
2651
2652 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2653
2654         generic.cs, rootcontext.cs: Removed NewConstraintAttribute.
2655
2656 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2657
2658         gmcs.exe.sources: Use CryptoConvert.cs from corlib.
2659
2660 2005-11-05  Kornél Pál  <kornelpal@hotmail.com>
2661
2662         * gmcs.exe.config: Updated runtime version to v2.0.50727 (2.0 RTM).
2663
2664 2005-11-04  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2665
2666         Add friend assembly access support.
2667         * typemanager.cs: assembly_internals_vis_attrs
2668         cache for friend assembly access. 
2669         (TypeManager.IsFriendAssembly): New method for
2670         checking friend assembly access.
2671         (TypeManager.Error_FriendAccessNameNotMatching): New
2672         helper method.
2673         (TypeManager.CompareKeyTokens): Likewise.
2674         (TypeManager.Filter): Handle friend accessible
2675         members.
2676
2677         * namespace.cs (RootNamespace.GetTypeInAssembly): Return
2678         friend accessible types.
2679
2680         * ecore.cs (Expression.IsAccessorAccessible): Handle
2681         friend accessible properties.
2682
2683         * decl.cs (DeclSpace.CheckAccessLevel): Handle friend
2684         accessible types.
2685         
2686 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2687
2688         Fix #76568.
2689         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2690         folding.
2691         
2692         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2693         contants only.
2694         
2695         * ecore.cs (NullCast): Child is contant only.
2696         
2697         * literal.cs (NullLiteral.Reduce): null can be converted to any
2698         reference type.
2699
2700 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2701
2702         * driver.cs: Use Encoding.Default as default code page instead
2703           of ISO-28591.
2704
2705 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2706
2707         Fix #76085.
2708         * expression.cs (Invocation.Error_InvalidArguments): Handle
2709         __arglist parameters.
2710         (Invocation.VerifyArgumentsCompat): Likewise.
2711         * support.cs (ReflectionParameters.GetSignatureForError): Print
2712         __arglist parameters.
2713         (InternalParamters.GetSignatureForError): Likewise.
2714         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2715
2716 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2717
2718         * attribute.cs (GetPropertyValue): Made public.
2719
2720         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2721         Resolve.
2722         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2723         attribute.
2724         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2725         is not defined.
2726         
2727         * driver.cs: Reflect method name change.
2728         
2729         * statement.cs (Try.Resolve): Warn when try has both general
2730         exception handlers.
2731         
2732         * typemanager.cs: runtime_compatibility_attr_type new predefined
2733         type.
2734
2735 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2736
2737         Fix #76419.
2738         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2739         treat it as an empty parameter list.
2740
2741 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2742
2743         Fix #76271.     
2744         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2745         ResolveAsTypeStep silent.
2746         * statement.cs (Block.AddConstant): Mark block as used.
2747         (Block.ResolveMeta): Avoid piling on error messages
2748         if a constant initializer resolution fails.
2749
2750 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2751
2752         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2753         Remove.
2754         (NamespaceEntry.VerifyAllUsing): New.
2755         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2756         behaviour.  Delegates actual resolution of alias to ...
2757         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2758         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2759         Update.
2760         * driver.cs (Driver.MainDriver): Update.
2761         
2762         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2763         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2764         property.
2765         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2766         Remove.
2767         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2768         RootNamespace.DefineNamespacesForAll.
2769
2770 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2771
2772         * typemanager.cs (assemblies, external_aliases, modules)
2773         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2774         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2775         overhead.  Move resposibility ...
2776         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2777         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2778
2779 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2780
2781         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2782         cached_namespaces.  Improve usage.
2783         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2784         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2785         Move from GlobalRootNamespace and simplify.
2786         (RootNamespace.Global): Make instance variable.
2787         (RootNamespace.RootNamespace): Add "alias name" parameter.
2788         (GlobalRootNamespace): Simplify drastically.
2789         (Namespace.Lookup): Don't use GetNamespace.
2790         * typemanager.cs (GetRootNamespace): Rename from
2791         ComputeNamespaceForAlias.
2792         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2793
2794 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2795
2796         * anonymous.cs (AnonymousContainer): Don't crash when container
2797         doesn't exist.
2798
2799 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2800
2801         * expression.cs (Binary.DoResolve): Warn when comparing same
2802         values.
2803
2804 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2805
2806         Fix #76486.
2807         * expression.cs (Binary.DoResolve): It looks like there are no
2808         convetsion rules in enum context.
2809
2810 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2811
2812         Add support for extern alias qualifiers.
2813         * typemanager.cs: Move some LookupTypeReflection code
2814         to namespace.cs, to have cleaner code. Added some methods
2815         to help us keep track of the extern aliased references.
2816         * driver.cs: Add suport for extern alias assemblies on command
2817         line and check for their warnings/errors. Also keep track of the
2818         extern aliased assemblies.
2819         * namespace.cs: Move the global functionality of Namespace
2820         to GlobalRootNamespace/RootNamespace. Now the global namespace
2821         is GlobalRootNamespace.Globa. Also the code moved from 
2822         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2823         Finally added LocalAliasEntry (AliasEntry before) and
2824         ExternAliasEntry, to handle alias statements.
2825         * cs-parser.jay: Add support in the grammar for extern alias
2826         statement.
2827         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2828         Update callings to Namespace (now in GlobalRootNamespace).
2829
2830 2005-10-25  Martin Baulig  <martin@ximian.com>
2831
2832         * convert.cs (ImplicitTypeParameterConversion): Make base
2833         interfaces actually work; fixes #76557.
2834
2835 2005-10-25  Martin Baulig  <martin@ximian.com>
2836
2837         * generic.cs
2838         (GenericMethod.Define): Call TypeParameter.DefineConstraints() on
2839         all the type parameters; fixes #76551.
2840
2841 2005-10-25  Martin Baulig  <martin@ximian.com>
2842
2843         Fix #76472.
2844
2845         * generic.cs
2846         (GenericMethod.ctor): Added `Expression return_type' and
2847         `Parameters parameters' arguments.
2848         (GenericMethod.DefineType): Call ResolveAsTypeTerminal() on the
2849         parameter and return types to check their constraints if they're
2850         generic types.
2851
2852         * codegen.cs (EmitContext.ResolvingGenericMethod): New public
2853         boolean field.
2854
2855         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
2856         constraints of a generic type if `ec.ResolvingGenericMethod'.
2857
2858         * class.cs (MethodCore.DoDefineParameters): Set
2859         `ec.ResolvingGenericMethod' if we're a generic method.
2860         (MemberBase.MemberType): Likewise.
2861
2862 2005-10-25  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2863
2864         * typemanager.cs (TypeManager): Added 
2865         TypeManager.internals_visible_attr_type to cache
2866         S.R.CompilerServices.InternalsVisibleToAttribute.
2867
2868         * codegen.cs (AssemblyClass): Added checks for 
2869         InternalsVisibleToAttribute in new method 
2870         CheckInternalsVisibleAttribute () and also cache the
2871         AssemblyName in AssemblyClass.Name.
2872         
2873 2005-10-24  Martin Baulig  <martin@ximian.com>
2874
2875         * typemanager.cs
2876         (TypeManager.ExpandInterfaces): Added overloaded version which
2877         just takes a `Type[]' array.
2878
2879         * generic.cs
2880         (Constraints.Resolve): Don't expand the interfaces here; ie. we
2881         just use the interfaces which were explicitly specified and not
2882         the interfaces they inherit.  Fixes #76482.
2883         (TypeParameter.FindMembers): Expand the interfaces here.
2884
2885 2005-10-21  Martin Baulig  <martin@ximian.com>
2886
2887         * generic.cs
2888         (Constraints.Resolve): Also resolve the actual types here.
2889         (Constraints.ResolveTypes): Just check the constraints here.
2890         Fixes #76363; see gtest-218.cs.
2891
2892 2005-10-21  Martin Baulig  <martin@ximian.com>
2893
2894         * convert.cs
2895         (Convert.ImplicitTypeParameterConversion): Use a `ClassCast'
2896         instead of a `BoxedCast'; fixes gtest-217.cs.
2897
2898 2005-10-20  Atsushi Enomoto  <atsushi@ximian.com>
2899
2900         * generic.cs : (ConstructedType.CheckConstraints) warn CS0310 when
2901           1) "new()" is specified as generic parameter constraint and 2) the
2902           type is TypeBuilder and 3) the type is abstract even if it has a
2903           default .ctor(). Now errors/gcs0310-3.cs is correctly rejected.
2904
2905 2005-10-20  Martin Baulig  <martin@ximian.com>
2906
2907         * generic.cs
2908         (GenericConstraints.TypeParameter): New public property.
2909         (TypeParameter.ctor): Also take a `DeclSpace' argument.
2910         (TypeParameter.DeclSpace): New public property.
2911         (TypeParameter.DefineType): Inflate the constraints if our
2912         `DeclSpace' is an `Iterator'.   
2913
2914 2005-10-19  Atsushi Enomoto  <atsushi@ximian.com>
2915
2916         * class.cs, decl.cs : (MemberCache.FindMemberToOverride) added 
2917           GenericMethod argument to compare methods' generic type arguments.
2918           Fixed bug #76382.
2919
2920 2005-10-19  Martin Baulig  <martin@ximian.com>
2921
2922         * class.cs (TypeContainer.DefineType): Only use ResolveAsTypeStep(),
2923         not ResolveType() when resolving the base type, so we're not
2924         checking the constraints here.
2925         (TypeContainer.ResolveType): Call ResolveType() on our base_type
2926         if we have any.
2927
2928 2005-10-19  Martin Baulig  <martin@ximian.com>
2929
2930         * generic.cs (ConstructedType.CheckConstraints): Committing
2931         untested fix for #76441.
2932
2933 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2934
2935         Fix #76371.
2936         * class.cs (TypeContainer.DefineType): Move updating of
2937         topological sort earlier in the code.
2938         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2939
2940 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2941
2942         Fix #76273.
2943         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2944         
2945         * constant.cs (Constant.TryReduce): Moved from Cast class.
2946         (Reduce): Made little bit more OO and fixed missing conversions.
2947         
2948         * ecore.cs (Reduce): Implemented.
2949         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2950         
2951         * literal.cs (Reduce): Implemented.
2952         
2953         * class.cs: Reverted Miguel's wrong commit.
2954
2955 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2956
2957         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2958
2959 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2960
2961         * cs-parser.jay, expression.cs : CS0214 was missing error location
2962           for constants. Fixed bug #76404.
2963
2964 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2965
2966         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2967         InstanceExpression.
2968         (PropertyExpr.EmitCall): Likewise.
2969         * expression.cs (Invocation.EmitArguments): Handle case where
2970         arguments == null.
2971         (Invocation.EmitCall): Avoid allocating temporary variable if
2972         there are no arguments.
2973
2974 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2975
2976         Fix #76370.
2977         * convert.cs (ExplicitConversionCore): Fixed object->enum
2978         conversion.
2979
2980 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2981
2982         Fix #76323.
2983         * convert.cs (ImplicitConversionStandard): Move conversion of
2984         void* to arbitrary pointer types ...
2985         (ExplicitConversionStandard): .. here.
2986         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2987         error to always print typenames.
2988
2989 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2990
2991         * convert.cs (GetConversionOperator): Rename from
2992         GetConversionOperators.  Move operator selection code from ...
2993         (UserDefinedConversion): ... here.
2994
2995 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2996
2997         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2998         conversion.
2999
3000 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
3001
3002         * assign.cs (Assign.DoResolve): Error method changed.
3003
3004         * cfold.cs (DoConstantNumericPromotions): Error method changed.
3005         
3006         * const.cs (ResolveValue): Reset in_transit immediately.
3007         
3008         * constant.cs: Error method changed.
3009         
3010         * convert.cs: Removed useless location parameter.
3011         (ExplicitNumericConversion): Don't do double enum check.
3012         (ExplicitConversionCore): Renamed from ExplicitConversion.
3013         (ExplicitUnsafe): Extracted from ExplicitConversion.
3014         (ExplicitConversion): Uses for error reporting.
3015         
3016         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
3017         error messages.
3018         (ResolveBoolean): Uses common error method.
3019         (CastToDecimal): Get rid of ec.
3020         (CastFromDecimal): Optimized.
3021         (ConvCast): Get rid of ec.
3022         
3023         * enum.cs (ResolveValue): Reset in_transit immediately.
3024         (Emit): Return after first error.
3025         
3026         * expression.cs: Convert changes.
3027         
3028         * literal.cs: Error method changed.
3029         
3030         * statement.cs: Error method changed.
3031
3032 2005-10-06  Raja R Harinath  <rharinath@novell.com>
3033
3034         Fix gtest-131.cs and gtest-211.cs.
3035         * generic.cs (Nullable.LiftedBinaryOperator.EmitEquality):
3036         Only emit code for a label if it is used.  Unreachable code can
3037         violate ECMA evaluation stack invariants.
3038
3039 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3040
3041         * anonymous.cs: Implemented ExprClassName.
3042         
3043         * assign.cs (Assign.DoResolve): Don't chrash when type is not
3044         delegate.
3045         
3046         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
3047         check.
3048         
3049         * class.cs (StaticClass.DefineContainerMembers): Report protected
3050         members as error.
3051         
3052         * codegen.cs: if(ed) PRODUCTION.
3053         
3054         * convert.cs (Error_CannotImplicitConversion): Better error
3055         distinction.
3056         
3057         * cs-parser.jay: More error checks.
3058         
3059         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
3060         
3061         * driver.cs (CSCParseOption): Enabled wrong option check.
3062         
3063         * ecore.cs (Expression.ExprClassName): Turned to property.
3064         (MemberExpr.CheckIntermediateModification): For checking boxed
3065         value types     modification.
3066         
3067         * statement.cs (Fixed.Resolve): Expression type must be
3068         convertible to fixed type.
3069         (CollectionForeach.GetEnumeratorFilter,TryType):
3070         Small refactoring for easier error checking.
3071
3072 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
3073
3074         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
3075         attributes.
3076         
3077         * class.cs (GeneratedBaseInitializer): New class for customization
3078         compiler generated initializers.
3079         (MemberBase.DoDefine): Check Obsolete attribute here.
3080         (FieldMember.DoDefine): Ditto.
3081         
3082         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
3083         constants.
3084         
3085         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
3086         (MemberCore.GetObsoleteAttribute): Removed argument.
3087         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
3088         (MemberCore.CheckObsoleteType): New helper.
3089         
3090         * delegate.cs,
3091         * enum.cs,
3092         * statement.cs: Updates after MemberCore changes.
3093         
3094         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
3095         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
3096         
3097         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
3098         obsolete attribute for compiler construct.
3099         (As.DoResolve): Cache result.
3100         
3101         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
3102
3103 2005-10-01  Miguel de Icaza  <miguel@novell.com>
3104
3105         * expression.cs (Probe): instead of having a "Type probe_type"
3106         keep the extra information as a TypeExpr probe_type_expr since the
3107         "As" operator needs to perform some type checks.
3108
3109         * (As.DoResolve): If the type is a type parameter, ensure that it
3110         is constrained by a class.
3111
3112 2005-09-22  Miguel de Icaza  <miguel@novell.com>
3113
3114         * statement.cs (Lock): Use the TemporaryVariable class instead of
3115         manually using local variables as those do not work when variables
3116         are captured.
3117
3118         * ecore.cs: Moved the TemporaryVariable class from being a nested
3119         class inside Foreach to be a public class that can be employed in
3120         other places. 
3121
3122 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
3123
3124         * cs-parser.jay: interface_accessors replaced by
3125         accessor_declarations.
3126
3127         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
3128         location.
3129         
3130         * statement.cs (GotoCase.Resolve): Convert null constant to
3131         null case.
3132         (SwitchLabel.ResolveAndReduce): Ditto.
3133         (SwitchLabel.NullStringCase): Custom null stamp.
3134         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
3135         
3136         typemanager.cs (CSharpSignature): Don't skip first argument
3137         for full names.
3138
3139 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
3140
3141         * cfold.cs, constant.cs, convert.cs, ecore.cs,
3142         expression.cs, iterators.cs, literal.cs: Store constants and
3143         literals location.
3144         
3145         * class.cs (MemberBase.ShortName): Pass location.
3146         
3147         * cs-parser.jay: Some location fixes.
3148         
3149         * ecore.cs (Expression.Location): Made virtual.
3150
3151 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
3152
3153         Fix #72930.
3154         * const.cs (Const.ResolveValue): Check for assigning non-null
3155         value to reference type.
3156
3157 2005-09-26  Raja R Harinath  <rharinath@novell.com>
3158
3159         Fix #76133.
3160         * expression.cs (This.VerifyFixed): In a value type T, the type of
3161         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
3162         value type R, 'this' is treated as a value parameter.
3163
3164 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3165
3166         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3167         if the underlying types are the same, otherwise we need to produce
3168         code that will do the proper cast.
3169
3170         This was exposed by Marek's constant rewrite which produced
3171         invalid code for the call site:
3172
3173         enum X : long { a }
3174         void Method (X v) {}
3175
3176         Method ((X) 5)
3177
3178         This fixes test-49.cs
3179
3180 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3181
3182         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
3183           Type/Object should be allowed as well. Fixed bug #75968.
3184
3185 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3186
3187         * expression.cs : (Binary.DoResolve): when one is enum constant and
3188           another is constant 0, then return enum one *as enum type*.
3189           Fixed bug 74846.
3190
3191 2005-10-04  Martin Baulig  <martin@ximian.com>
3192
3193         * ecore.cs (PropertyExpr.ResolveAccessors): Cosmetic fix; make the
3194         `SetMemberIsUsed()' work for generics, too.
3195
3196 2005-10-04  Martin Baulig  <martin@ximian.com>
3197
3198         * expression.cs (DelegateInvocation.EmitStatement): Make this work
3199         for corlib.  Fixes #75691.
3200
3201 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
3202
3203         Fix #76255.
3204         * driver.cs: Fix compilation files with full root path.
3205
3206 2005-09-25  Miguel de Icaza  <miguel@novell.com>
3207
3208         * report.cs (SymbolRelatedToPreviousError): Format the output so
3209         it does not use an open parenthesis that is never closed. 
3210
3211         * driver.cs: Follow coding guidelines
3212
3213 2005-09-18  Miguel de Icaza  <miguel@novell.com>
3214
3215         * driver.cs: Set InEmacs based on the environment variable EMACS. 
3216
3217         * location.cs (InEmacs): in this mode, do not report column
3218         location as it confuses Emacs.
3219
3220 2005-10-03  Raja R Harinath  <rharinath@novell.com>
3221
3222         * support.cs (SeekableStreamReader.Position): Don't error out when
3223         the requested position is just beyond the end of the current
3224         buffered data.
3225
3226 2005-09-28  Raja R Harinath  <rharinath@novell.com>
3227
3228         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
3229         try to keep in sync with the byte count of the underlying Stream.
3230         However, this limits us to a window size of 2048 characters: i.e.,
3231         the maximum lookahead of our lexer/parser can be 2048 characters.
3232
3233 2005-09-22  Martin Baulig  <martin@ximian.com>
3234
3235         * driver.cs: Removed a debugging FIXME.
3236
3237 2005-09-21  Raja R Harinath  <rharinath@novell.com>
3238
3239         * cs-parser.jay (type_arguments): Add CS1644 check.
3240         * decl.cs (DeclSpace.AddToContainer): Restore CS0694 check.
3241
3242 2005-09-15  Raja R Harinath  <rharinath@novell.com>
3243
3244         * Makefile (PROGRAM): Make profile specific.
3245         (gmcs.exe) [PROFILE=net_2_0]: Add utility rule to copy gmcs.exe to
3246         the current directory.
3247
3248         Fix test-455.cs.
3249         * expression.cs (Invocation.EmitCall): Remove optimization on
3250         this_call since it doesn't handle 'this' being a value type.
3251
3252 2005-09-05  Geoff Norton  <gnorton@customerdna.com>
3253
3254         * driver.cs: Ensure file handles are closed after parsing
3255
3256 2005-09-05  Miguel de Icaza  <miguel@novell.com>
3257
3258         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
3259         if the underlying types are the same, otherwise we need to produce
3260         code that will do the proper cast.
3261
3262         This was exposed by Marek's constant rewrite which produced
3263         invalid code for the call site:
3264
3265         enum X : long { a }
3266         void Method (X v) {}
3267
3268         Method ((X) 5)
3269
3270         This fixes test-49.cs
3271
3272 2005-09-05  Martin Baulig  <martin@ximian.com>
3273
3274         * expression.cs (As.DoResolve): Use `probe_type.IsValueType'
3275         instead of `TypeManager.IsValueType (probe_type)'; fixes #75668.
3276
3277         * cs-parser.jay (delegate_declaration): Small fix for #75852.
3278
3279 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3280
3281         * typemanager.cs: (IsUnmanagedType) : generic parameter is not allowed
3282           to be a pointer type due to the spec 25.2, so check if declaring
3283           type is generic type definition. Fixed bug #75772.
3284
3285 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
3286
3287         Fixed bug #75957.
3288         * generic.cs : (TypeManager.IsEqual(Type,Type)): it should work when
3289           both types are not defined by methods.
3290         * expression.cs : (Invocation.IsApplicable): it should work when
3291           the argument type is equal to the parameter type, not only when
3292           ImplicitConversionExists() returns true.
3293
3294 2005-09-02  Raja R Harinath  <rharinath@novell.com>
3295
3296         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
3297         internal.
3298
3299         Fix #75941.
3300         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
3301         flow-branching for LocalVariableReferences in case we were invoked
3302         from a MemberAccess.
3303         * expression.cs (LocalVariableReference.VerifyAssigned): New.
3304         Carved out of ...
3305         (LocalVariableReference.DoResolveBase): ... this.
3306         (MemberAccess.Resolve): Do the check that was disabled during
3307         SimpleNameResolve.
3308
3309 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3310
3311         * class.cs :
3312           (PartialContainer.Create): check abstract/sealed/static strictly
3313           but abstract/sealed can exist only at one side. Fixed bug #75883.
3314
3315 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
3316
3317         Fix #75945.
3318         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
3319         specified, don't default to UnmanagedType.I4.
3320
3321 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
3322
3323         * expression.cs : conditional operator should check possibly
3324           incorrect assign expression. Fixed bug #75946.
3325
3326 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3327
3328         Fix #75934.
3329         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
3330         (ScopeInfo.EmitScopeType): Use it to construct field names from
3331         names of captured locals.
3332
3333         Fix #75929.
3334         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
3335         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
3336         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
3337         (ExplicitConversion): Remove enum cases already handled by
3338         implicit conversion.  Move implicit conversion check to the beginning.
3339         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
3340         * expression.cs (ArrayCreation.EmitDynamicInitializers):
3341         Don't treat System.Enum as a struct.
3342
3343 2005-08-30  Jb Evain  <jbevain@gmail.com>
3344
3345         * attribute.cs: handles as expression in parameters.
3346
3347 2005-08-30  Raja R Harinath  <rharinath@novell.com>
3348
3349         Fix #75802.
3350         * class.cs (TypeContainer.VerifyClsName): Don't use a
3351         PartialContainer when verifying CLS compliance.
3352         (AbstractPropertyEventMethod): Set Parent here, ...
3353         (PropertyMethod): ... not here.
3354
3355 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
3356
3357         * attribute.cs : escaped attribute name should not be allowed to be
3358           resolved (e.g. @class as classAttribute). Fixed bug #75930.
3359
3360 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3361
3362         Fix #75927.
3363         * convert.cs (ImplicitStandardConversionExists): Allow zero also
3364         when converting a long constant to unsigned long.
3365         * expression.cs (Invocation.OverloadResolve): Add sanity check to
3366         detect where IsApplicable and VerifyArgumentsCompat disagree.
3367
3368 2005-08-29  Raja R Harinath  <rharinath@novell.com>
3369         and Carlos Alberto Cortez  <carlos@unixmexico.org>
3370
3371         Fix #75848.
3372         * class.cs (TypeContainer.CanElideInitializer): New helper.
3373         (TypeContainer.EmitFieldInitializers): Use it to determine if we
3374         can safely emitting the initializer of a field.
3375
3376 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3377
3378         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
3379           allowed inside a switch (without loop). Fixed bug #75433.
3380
3381 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3382
3383         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3384         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3385
3386 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3387
3388         * driver.cs : kinda reverting the default encoding changes (not exact 
3389           revert since I noticed that "codepage:reset" might not work fine).
3390
3391 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3392
3393         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
3394           Location. Now getter and setter store location correctly.
3395           (errors/cs0111-12.cs now reports the expected location.)
3396
3397 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3398
3399         * driver.cs : Use default encoding on the environment.
3400           Removed (now that) extra parameter for SeekableStreamReader.
3401         * support.cs : (SeekableStreamReader) third .ctor() argument for
3402           StreamReader is not required (always true). preamble size could
3403           be acquired in simpler and safe way.
3404
3405 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
3406
3407         * cs-parser.jay: report CS0642 at warning level 3
3408           and report CS0642 for an if else statement also
3409           fixes bug #74745. Patch by John Luke (and a bit
3410           modified by me).
3411           Removed extra CS0642 warning check for "while",
3412           "for" and "fixed".
3413         * statement.cs: In Block.Resolve(), CS0642 check
3414           is reimplemented to check a sequence of an empty
3415           statement and a block.
3416
3417           Both fix bug #66777.
3418
3419 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
3420
3421         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
3422         detection until I fix it.
3423         
3424         * cs-tokenizer.cs: Changed error message.
3425         
3426         * cs-parser.jay: Fixed 2 error locations.
3427         
3428         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
3429         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
3430         properties.
3431         
3432         * enum.cs (GetSignatureForError): Fixed.
3433         
3434         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
3435         method detection.
3436         
3437         * class.cs,
3438         * typemanager.cs (RegisterProperty): Removed.
3439         
3440         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
3441
3442 2005-08-24  Raja R Harinath  <rharinath@novell.com>
3443
3444         Fix #75874.
3445         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
3446         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
3447
3448 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3449
3450         * expression.cs : tiny fix is required for not warning positive ulong.
3451           See test-441.cs.
3452
3453 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3454
3455         * expression.cs : add CS0652 check for constant and integral
3456           expression. Fixed bug #53974.
3457
3458 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3459
3460         * expression.cs : in DoNumericPromotions(), check if there is implicit
3461           conversion overload for string (to check CS0034). Fixed bug #52492.
3462
3463 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3464
3465         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
3466
3467 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3468
3469         * ecore.cs : report location when it is *not* Null.
3470
3471 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
3472
3473         * codegen.cs,
3474           ecore.cs,
3475           flowanalysis.cs,
3476           expression.cs:
3477           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
3478           correctly. Fixed bug #75721.
3479
3480 2005-08-23  Raja R Harinath  <rharinath@novell.com>
3481
3482         * support.cs (SeekableStreamReader.Position): Avoid an expensive
3483         loop that performs 'min (pos, char_count)'.
3484
3485         Fix #75862.
3486         * expression.cs (Unary.ResolveOperator): Don't discard implicit
3487         converted value in Operator.OnesComplement.
3488
3489 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
3490
3491         * anonymous.cs: If the anon method is pulled into a helper class,
3492         it needs to be `internal' not `private'. Fixes runtime behavior on
3493         msft. bug #75704
3494
3495 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
3496
3497         Fix #75803
3498         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
3499         is a partial class.
3500
3501 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
3502
3503         The big constants rewrite
3504         Fix #75746, #75685 and more
3505         As a side effect saved 1MB for MWF ;-)
3506         
3507         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
3508         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
3509         enum based for corlib compilation.
3510         
3511         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
3512         subtractions.
3513         
3514         * class.cs (FixedField.Define): Use ResolveAsConstant.
3515         
3516         * const.cs (IConstant): Interface constants and enums.
3517         (Const.ResolveValue): New method for constant resolvning.
3518         (ExternalConstant): Constants from imported assemblies.
3519         
3520         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
3521         conversion; like enums.
3522         (Constant.ToType): Converts this constant to different type.
3523         (Constant.Increment): Adds 1.
3524         
3525         * convert.cs (ImplicitConversionRequired): Simplified.
3526         
3527         * cs-parser.jay: Create EnumMember directly.
3528         
3529         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
3530         
3531         * doc.cs (GenerateEnumDocComment): Removed.
3532         
3533         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
3534         (ConvertIntLiteral): Removed.
3535         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
3536         
3537         * enum.cs (EnumMember): Implement IConstant.
3538         (Enum.IsValidEnumConstant): Removed.
3539         (Enum.GetNextDefaultValue): Removed.
3540         (Enum.FindMembers): Updated.
3541         (Enum.GenerateDocComment): Iterate enum members.
3542         
3543         * expression.cs (Cast.TryReduce): Handle enums correctly.
3544         (New.Constantify): Made public.
3545         (MemberAccess.DoResolve): Removed contant specific if(s).
3546         
3547         * literal.cs (NullLiteral): Implement new abstract methods.
3548         
3549         * statement.cs (GotoCase.Resolve): Use new constant methods.
3550         (SwitchLabel.ResolveAndReduce): Use new constant methods.
3551         
3552         * typemanager.cs (LookupEnum): Removed.
3553         (IsEnumType): Fixed to work with corlib.
3554         (RegisterConstant): Removed.
3555         (LookupConstant): Removed.
3556         (GetConstant): Changed to work with IConstant.
3557
3558 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
3559
3560         * location.cs : Fixed overflown (>255) column number.
3561
3562 2005-08-03  Raja R Harinath  <rharinath@novell.com>
3563
3564         First cut of the qualified-alias-member feature.
3565         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
3566         token.
3567         * cs-parser.jay (DOUBLE_COLON): New token.
3568         (namespace_or_type_name): Add rule for recognizing
3569         qualified-alias-members.
3570         (primary_expression): Likewise.
3571         (element_access): Allow QualifiedAliasMember as a possible
3572         type-bearing expression.
3573         (local_variable_type, local_variable_pointer_type): Likewise.
3574         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
3575         aliases in the current and enclosing namespace declarations.
3576         (NamespaceEntry.UsingAlias): Add CS0440 warning.
3577         * decl.cs (MemberName.is_double_colon): New.
3578         (MemberName.MemberName): Add new constructor for alias-member.
3579         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
3580         * expression.cs (QualifiedAliasMember): New expression type.
3581
3582 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3583
3584         * location.cs : it borked when no argument was specified.
3585
3586 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3587
3588         * location.cs : tiny ToString() format fix.
3589
3590 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3591
3592         * statement.cs : oops, it was missing.
3593
3594 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
3595
3596         A set of fixes for precise line/column location.
3597
3598         * location.cs :
3599           "token" field now holds a file/line "delta", a line number offset 
3600           from the segment, and a column number. See also:
3601           http://lists.ximian.com/pipermail/mono-devel-list/2004-
3602           December/009508.html
3603           Removed static IsNull. Use instance IsNull property instead.
3604         * cs-tokenizer.cs :
3605           For some tokens it stores Location. For Identifier it stores
3606           LocatedToken which is a pair of string name and location.
3607           Column numbers are adjusted only at getChar().
3608         * report.cs :
3609           Use Location.ToString() for reporting (it now contains column).
3610         * cs-parser.jay :
3611           Largely modified to use LocatedToken instead of
3612           string (IDENTIFIER), and to acquire Location from some tokens.
3613         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
3614           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
3615           codegen.cs :
3616           Now MemberName holds Location. DeclSpace.ctor() receives Location
3617           as a parameter. Removed extra parameters to all derived classes.
3618           Replaced Location.IsNull() with instance property.
3619         * assign.cs, expression.cs :
3620           Added .ctor() overload that omits Location.
3621         * attribute.cs :
3622           Added "nameEscaped" flag that indicates the identifier was escaped
3623           in the source file. This fixes bug #57047.
3624
3625 2005-09-02  Martin Baulig  <martin@ximian.com>
3626
3627         * class.cs: Make CS3005 a warning, not an error.
3628
3629 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
3630
3631         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
3632         New method, looking for lo-case imported cls type.
3633
3634         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
3635         here.
3636
3637         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
3638
3639         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
3640
3641         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
3642         all_imported_types.
3643         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
3644
3645         Optimized to save 3.5 MB for SWF compilation.
3646
3647 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3648
3649         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
3650         (PartialContainer.Create): Moved logic AddToContainer.
3651         (PartialContainer.MarkForDuplicationCheck): Shares name.
3652         
3653         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
3654         place.
3655         
3656         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3657         initialization.
3658         (Namespace.GetSignatureForError): New method.
3659         
3660         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3661         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3662
3663 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3664
3665         Fix #75669.
3666         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3667         member lookup rather than qualifier_type, since qualifier_type can
3668         be null.
3669
3670 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3671
3672         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3673         enum member.
3674
3675 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3676
3677         * statement.cs: Copy the local exception into the exception
3678         captured local.  Fixes 75674
3679
3680 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3681
3682         Fix #75658.
3683         * expression.cs (Invocation.OverloadResolve): Don't report error
3684         CS1501 if error CS1502 has been reported.
3685         (New.DoResolve): Delegate CS1501 reporting to
3686         Invocation.OverloadResolve.
3687
3688         Fix #75656.
3689         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3690         invariant-meaning-in-block property in an enclosing block if
3691         necessary.
3692
3693 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3694
3695         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3696         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3697         (Switch.CheckSwitch): Just save 50kb for SWF.
3698
3699 2005-07-27  Martin Baulig  <martin@ximian.com>
3700
3701         * anonymous.cs (CaptureContext.AddField): Added
3702         `AnonymousContainer am' argument; compute its toplevel scope if
3703         it's not already computed.  Fixes #75649.
3704
3705 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3706
3707         Fix #75628.
3708         * class.cs (Constructor.Emit): Reset block to null if the block
3709         resolve fails.
3710
3711 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3712
3713         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3714
3715 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3716
3717         * class.cs (MethodData.Define): Check whether accessor implementing
3718         interface is public.
3719
3720         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3721
3722 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3723
3724         Fix #57245
3725         * namespace.cs (LookupType): Moved same type check to...
3726         
3727         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3728         with the same name.
3729
3730 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3731
3732         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3733         already found a typebuilder.
3734         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3735         MemberNames, not strings.
3736
3737         * const.cs (Error_ExpressionMustBeConst): 
3738         Rename from Error_EpressionMustBeConst.
3739         * const.cs, class.cs, statement.cd: Update.
3740
3741 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3742
3743         Fix #65573
3744
3745         * const.cs (Const.LookupConstantValue): Report missing contant expression
3746         everytime.
3747         (Error_EpressionMustBeConstant): Only one error method.
3748
3749         * class.cs, statement.c: Updated.
3750
3751 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3752
3753         * statement.cs (Block.Flags): Add back HasVarargs.
3754         (Block.flags): Make protected.
3755         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3756
3757         * typemanager.cs (types, typecontainers, user_types): Remove.
3758         (UserTypes, TypeContainers): Likewise.
3759         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3760         (CleanUp, Reset): Update.
3761         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3762         (GetNestedType): Use Type.GetNestedType.
3763         (CoreLookupType): Take two arguments, the namespace and the
3764         basename of the type.  Update to use the Namespace.Lookup
3765         mechanism.
3766         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3767         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3768         string concatenation and substring matches.
3769         * class.cs, enum.cs, delegate.cs: Update to changes.
3770
3771 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3772
3773         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3774         Expression and made virtual.
3775
3776         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3777         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3778
3779         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3780
3781         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3782         error message.
3783
3784         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3785         change.
3786
3787 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3788
3789         Fix #57707
3790         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3791         AssemblyCultureAttribute is not used on executable.
3792
3793         * rootcontext.cs,
3794         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3795
3796 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3797
3798         Fix #60638.
3799         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3800         New.  Reports CS0252/CS0253.
3801         Mostly taken from preliminary patch by Duncak Mak.
3802         (Binary.DoResolveOperator): Store results of operator lookup.
3803         Use them to detect if we need to warn about unintended reference
3804         comparisons.
3805
3806 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3807
3808         Fix #72969.
3809         * namespace.cs (Namespace.Lookup): Add back location parameter.
3810         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3811         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3812
3813         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3814         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3815         (Namespace.LookupType): ... this.
3816         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3817         of namespaces.
3818         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3819         purported to handle pointers.
3820         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3821         CoreLookupType.
3822
3823 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3824
3825         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3826         type as namespace.
3827
3828 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3829
3830         * namespace.cs (Namespace.Lookup): Drop location parameter.
3831         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3832         (NamespaceEntry.Lookup): ... this.
3833         (NamespaceEntry.Error_AmbiguousTypeReference):
3834         Move here from DeclSpace.
3835         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3836         names ...
3837         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3838         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3839         Move to NamespaceEntry.
3840         * delegate.cs, expression.cs: Update to changes.
3841
3842 2005-08-31  Martin Baulig  <martin@ximian.com>
3843
3844         Committing a patch from Atsushi Enomoto for #75850.
3845
3846         * statement.cs (Foreach.CollectionForeach.GetEnumeratorFilter):
3847         Prefer a generic enumerator over a non-generic one.
3848
3849 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
3850
3851         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
3852         * gmcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
3853
3854 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3855
3856         * driver.cs : reverting default encoding change as well as mcs.
3857
3858 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
3859
3860         * driver.cs, support.cs : merged r48826.
3861           Marek Safer wrote:
3862           > could you integrate your mcs changes to gmcs otherwise
3863           > gmcs cannot compile some files.
3864
3865 2005-08-20  Martin Baulig  <martin@ximian.com>
3866
3867         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
3868         scope if we don't already have it.
3869
3870         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
3871         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
3872         fixes #75867.
3873
3874 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3875
3876         * statement.cs: Copy the local exception into the exception
3877         captured local.  Fixes 75674
3878
3879 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3880
3881         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3882         type as namespace.
3883
3884 2005-08-12  Martin Baulig  <martin@ximian.com>
3885
3886         * expression.cs (MemberAccess.ResolveNamespaceOrType): Only search
3887         for nested types here to avoid hitting the cache too early.
3888
3889 2005-08-09  Miguel de Icaza  <miguel@novell.com>
3890
3891         * enum.cs: On the new compiler CLS error 3005 is now a warning not
3892         an error. 
3893
3894 2005-08-03  Martin Baulig  <martin@ximian.com>
3895
3896         Make iterators in generic methods work; see gtest-191.cs.
3897
3898         * generic.cs
3899         (Constraints.Resolve): Protect against being called twice.
3900
3901         * class.cs
3902         (TypeContainer.GetClassBases): Make this `protected virtual'.
3903
3904         * iterator.cs (Iterator.ctor): Added `GenericMethod' argument.
3905         (Iterator.GetClassBases): Override this and compute the base
3906         classes here.
3907         (Iterator.DefineNestedTypes): If we're a generic method, all our
3908         method type parameters become class type parameters on the proxy
3909         class.
3910
3911         * statement.cs
3912         (ToplevelBlock.Parameters): Make this a property, not a field.
3913         (ToplevelBlock.ResolveMeta): Update the `parameters' from the `ip'.
3914
3915 2005-08-03  Martin Baulig  <martin@ximian.com>
3916
3917         * typemanager.cs (TypeManager.IsSubclassOf): Use
3918         `TypeManager.IsEqual' instead of `Type.Equals'; fixes gtest-190.cs.
3919         (TypeManager.GetFullName_recursed): Improved.
3920
3921 2005-07-27  Carlos Alberto Cortez <calberto.cortez@gmail.com>
3922
3923         Fix #75417
3924         * ecore.cs (Expression.IsAccessorAccessible): Change the check for
3925         Private accessor case, using TypeManager.IsPrivateAccessible instead of
3926         invocation_type == mi.DeclaringType, since the first one also checks
3927         other condition used by generic instances.
3928         
3929 2005-07-27  Martin Baulig  <martin@ximian.com>
3930
3931         * anonymous.cs (CaptureContext.AddField): Added
3932         `AnonymousContainer am' argument; compute its toplevel scope if
3933         it's not already computed.  Fixes #75649.
3934
3935 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3936
3937         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3938         CheckAttributeType and refactored.
3939         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3940         ResolveAsTypeTerminal error handling.
3941         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3942         handling.
3943         (GetSignatureForError): Print errors in same way.
3944
3945         * class.cs,
3946         * codegen.cs: Reflect attribute GetSignatureForError change.
3947
3948         * ecore.cs,
3949         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3950
3951         * namespace.cs (UsingEntry): Refactored to make fields private.
3952
3953         * assign.cs,
3954         statement.cs: Error_UnexpectedKind has extra parameter.
3955
3956 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3957
3958         * ecore.cs (IAlias): Remove.
3959         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3960         that implement the interface.
3961         * namespace.cs (Namespace): Likewise.
3962         (Namespace.declspaces): Renamed from 'defined_names'.
3963         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3964         DeclSpace instead of an IAlias.
3965         * tree.cs (Tree.AddDecl): Update.
3966
3967 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3968
3969         * statement.cs (Block.Flags); Remove HasVarargs.
3970         (Block.HasVarargs): Move to ToplevelBlock.
3971         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3972         (Block.Variables): Make protected.  Initialize variable hashtable
3973         if necessary.
3974         (Block.AddVariable): Update.
3975         (Block.Resolve): Update to changes.
3976         (ToplevelBlock.HasVarargs): New boolean.
3977         (ToplevelBlock.ThisVariable): Move here from Block.
3978         (ToplevelBlock.AddThisVariable): Likewise.
3979         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3980         * expression.cs (This.ResolveBase): Update to changes.
3981         (ArglistAccess.DoResolve): Likewise.
3982
3983 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3984
3985         Fix #75321
3986         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3987
3988         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3989         not used and not used & assigned.
3990         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3991
3992 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3993
3994         Fix #75053
3995         * expression.cs (Is.DoResolve): null is never provided type.
3996
3997 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3998
3999         Fix #52496
4000         * cs-parser.jay: Less strict event error rule to catch more errors.
4001
4002 2005-07-11  Martin Baulig  <martin@ximian.com>
4003
4004         * generic.cs (ConstructedType.CheckConstraints): Improve the check
4005         for the constructor constraint: we do not only have to check
4006         whether the class has a public constructor, but also ensure that
4007         it's parameterless.  Fixes #75492.
4008
4009 2005-07-11  Martin Baulig  <martin@ximian.com>
4010
4011         * expression.cs (Binary.ResolveOperator): Only allow `==' and `!='
4012         between type parameters if they either have the reference type
4013         constraint or the class constraint.
4014
4015 2005-07-10  Kamil Skalski <nazgul@nemerle.org>
4016
4017         * generic.cs: Use MakeGenericType instead of BindGenericParameters.
4018
4019 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
4020
4021         Fix #74975
4022         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
4023         (ExtractSecurityPermissionSet): Cope with self referencing security
4024         attributes properly.
4025
4026         * driver.cs (SetOutputFile): Made public property OutputFile.
4027
4028 2005-07-07  Raja R Harinath  <rharinath@novell.com>
4029
4030         Fix #75486.
4031         * class.cs (TypeContainer.first_nonstatic_field): Rename from
4032         has_nonstatic_fields.  Make into a FieldBase pointer.
4033         (TypeContainer.AddField): Add CS0282 check.
4034         (TypeContainer.EmitType): Update.
4035
4036 2005-07-06  Miguel de Icaza  <miguel@novell.com>
4037
4038         * cs-tokenizer.cs (consume_identifier): Do not create strings to
4039         compare if they start with __.
4040
4041 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4042
4043         * statement.cs (Switch.SwitchGoverningType): Only look at
4044         UserCasts that don't need implicit standard conversions to one of
4045         the allowed switch types (Fixes test-322.cs).
4046         (LocalInfo.Resolve): Re-enable sanity-test.
4047
4048 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
4049
4050         * cs-tokenizer.cs (consume_identifier): Detect double undescores
4051         
4052         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
4053         
4054         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
4055
4056 2005-07-06  Raja R Harinath  <rharinath@novell.com>
4057
4058         Fix #75472.
4059         * ecore.cs (SimpleName.GetSignatureForError): Add.
4060         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
4061         (MemberAccess.GetSignatureForError): Add.
4062
4063 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
4064  
4065         The big error and warning messages review.
4066         
4067         * anonymous.cs,
4068         * assign.cs,
4069         * attribute.cs,
4070         * class.cs,
4071         * codegen.cs,
4072         * convert.cs,
4073         * cs-parser.jay,
4074         * cs-tokenizer.cs,
4075         * decl.cs,
4076         * delegate.cs,
4077         * doc.cs,
4078         * driver.cs,
4079         * ecore.cs,
4080         * enum.cs,
4081         * expression.cs,
4082         * flowanalysis.cs,
4083         * iterators.cs,
4084         * literal.cs,
4085         * location.cs,
4086         * modifiers.cs,
4087         * namespace.cs,
4088         * parameter.cs,
4089         * pending.cs,
4090         * report.cs,
4091         * rootcontext.cs,
4092         * statement.cs,
4093         * support.cs,
4094         * tree.cs,
4095         * typemanager.cs: Updated.
4096         
4097         * class.cs: (MethodCore.SetYields): Moved here to share.
4098         (PropertyMethod.Define): Moved iterator setup here.
4099         
4100         * iterators.cs: Add orig_method to have full access to parent
4101         container.
4102
4103 2005-07-05  Raja R Harinath  <rharinath@novell.com>
4104
4105         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
4106         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
4107         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
4108         variable of struct type.
4109         * expression.cs (Unary.ResolveOperator): Update to change.
4110         (Indirection.VerifyFixed): Likewise.
4111         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
4112         (ParameterReference.VerifyFixed): Value parameters are fixed.
4113         (This.VerifyFixed): Treat 'this' as a value parameter.
4114         * statement.cs (LocalInfo.IsFixed): Remove.
4115
4116 2005-07-01  Martin Baulig  <martin@ximian.com>
4117
4118         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4119         `ec.EmitThis ()' to get the correct scope.
4120
4121 2005-07-01  Martin Baulig  <martin@ximian.com>
4122
4123         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
4124         instance is a ParameterReference; fixes #75299.
4125
4126 2005-06-30  Raja R Harinath  <rharinath@novell.com>
4127
4128         Fix #75412.
4129         * expression.cs (Indexers.map): Remove.
4130         (Indexers.Append): Filter out inaccessible setters and getters.
4131         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
4132
4133         Fix #75283.
4134         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
4135         Refactored from ...
4136         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
4137         (FieldExpr.Emit, PropertyExpr.Emit): Update.
4138         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
4139         * expression.cs (Invocation.EmitCall): Add CS0120 check.
4140
4141 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
4142
4143         Fix #75322
4144         * class.cs (FieldBase.GetInitializerExpression): One more field
4145         for backup.
4146
4147 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4148
4149         * pending.cs: Do not define a proxy if the base method is virtual,
4150         it will be picked up by the runtime (bug 75270).
4151
4152 2005-07-08  Martin Baulig  <martin@ximian.com>
4153
4154         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
4155         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
4156
4157 2005-07-07  Martin Baulig  <martin@ximian.com>
4158
4159         * generic.cs (ConstructedType.CheckConstraint): Use
4160         ResolveAsTypeStep(), not ResolveAsTypeTerminal() so we're not
4161         called recursively; fixes #75329.
4162
4163 2005-07-06  Martin Baulig  <martin@ximian.com>
4164
4165         * generic.cs (TypeManager.InferTypeArguments): Added support for
4166         anonymous methods; fixes #75461.
4167
4168 2005-07-01  Martin Baulig  <martin@ximian.com>
4169
4170         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
4171         `ec.EmitThis ()' to get the correct scope.
4172
4173 2005-07-01  Martin Baulig  <martin@ximian.com>
4174
4175         * ecore.cs (FieldExpr.DoResolve): Only capture the field if it's
4176         instance is `This'; fixes #75299.
4177
4178 2005-06-30  Martin Baulig  <martin@ximian.com>
4179
4180         * class.cs (Indexer): Implement IIteratorContainer; added support
4181         for iterators in indexers.
4182
4183         * codegen.cs
4184         (EmitContext.CurrentIterator): Make this a property, not a field.
4185
4186         * anonymous.cs (AnonymousContainer.Iterator): New public property.
4187
4188 2005-06-28  Miguel de Icaza  <miguel@novell.com>
4189
4190         * pending.cs: Do not define a proxy if the base method is virtual,
4191         it will be picked up by the runtime (bug 75270).
4192
4193 2005-06-28  Martin Baulig  <martin@ximian.com>
4194
4195         * cs-parser.jay (interface_method_declaration): Avoid a
4196         reduce/reduce conflict by moving some of the code into a separate
4197         `interface_method_declaration_body' rule; fixes #75368.
4198
4199 2005-06-28  Martin Baulig  <martin@ximian.com>
4200
4201         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Move the
4202         array check after the check for TypeBuilder's.
4203
4204 2005-06-21  Raja R Harinath  <rharinath@novell.com>
4205
4206         * convert.cs (FindMostEncompassedType): Add two trivial special
4207         cases (number_of_types == 0 || number_of_types == 1).
4208         (FindMostEncompasingType): Likewise.
4209
4210 2005-06-17  Raja R Harinath  <rharinath@novell.com>
4211
4212         Some cleanups preparing for the fix of #75283.
4213         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
4214         error testing.
4215         (EventExpr.InstanceResolve): Likewise.
4216         (EventExpr.DoResolve): Remove redundant checks.
4217
4218 2005-06-08  Miguel de Icaza  <miguel@novell.com>
4219
4220         * class.cs: Small fix.
4221
4222 2005-06-08  Raja R Harinath  <rharinath@novell.com>
4223
4224         Fix #75160.
4225         * class.cs (GetPartialBases): Fix return value check of
4226         part.GetClassBases.
4227
4228 2005-06-07  Raja R Harinath  <rharinath@novell.com>
4229
4230         Ensure that partial classes are registered in their enclosing
4231         namespace.  Initial part of fix of #75160.
4232         * tree.cs (Tree.RecordDecl): Add new namespace argument.
4233         Register declspace with namespace here, not in
4234         DeclSpace.RecordDecl.
4235         * cs-parser.jay: Pass namespace to RecordDecl.
4236         * class.cs (PartialContainer.Create): Likewise.
4237         (ClassPart.DefineType): New sanity-check.  Throws an exception if
4238         called.
4239         * decl.cs (Declspace.RecordDecl): Remove.
4240         * namespace.cs (NamespaceEntry.DefineName): Remove.
4241
4242 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4243
4244         * rootcontext.cs: Reset TargetExt as well.
4245
4246 2005-06-03  Raja R Harinath  <rharinath@novell.com>
4247
4248         * ecore.cs (Expression.Resolve): Emit CS0654 error when
4249         -langversion:ISO-1.
4250
4251 2005-06-02  Raja R Harinath  <rharinath@novell.com>
4252
4253         Fix #75080, cs0119.cs.
4254         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
4255         of ...
4256         (Expression.Resolve): ... this.  Use it.  Remove bogus code
4257         allowing ExprClass.Type and ExprClass.Namespace for
4258         ResolveFlags.VariableOrValue.
4259         (Expression.Resolve) [1-argument variant]: Change default resolve
4260         flags based on language version.
4261         (Expression.Error_UnexpectedKind): Use a simple string array
4262         rather than an ArrayList.
4263         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
4264         not ExprClass.Type.
4265         (TypeOfVoid.DoResolve): Likewise.
4266         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
4267         flags argument -- it always has the same value.
4268
4269 2005-05-31  Raja R Harinath  <rharinath@novell.com>
4270
4271         Fix #75081.
4272         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
4273         Use it in the error message.
4274         * assign.cs, expression.cs, statement.cs: Update.
4275
4276 2005-05-30  Raja R Harinath  <rharinath@novell.com>
4277
4278         Fix #75088.
4279         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
4280         the "almostMatchedMember" case too.
4281         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
4282         that failed the accessibility checks to 'almost_match'.
4283
4284 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
4285
4286         * attribute.cs: Use internal MethodBuilder methods to set
4287         ExactSpelling and SetLastError on PInvoke methods, instead
4288         of passing them via charset.  Fixes #75060.
4289
4290 2005-05-27  Raja R Harinath  <rharinath@novell.com>
4291
4292         * parameter.cs (Parameter): Remove TODO comment.
4293         (Parameter.DefineParameter): Remove Location parameter.
4294         (Parameters.LabelParameters): Likewise.
4295         * class.cs (Constructor.Emit): Update to change.
4296         (MethodData.Emit): Likewise.
4297         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
4298         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
4299
4300 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
4301
4302         * parameter.cs,
4303           Removed Parameters.Location and added Parameter.Location instead.
4304           Removed Location parameter from Emit() and GetSignature().
4305         * anonymous.cs,
4306           class.cs,
4307           cs-parser.jay,
4308           delegate.cs,
4309           iterators.cs,
4310           statement.cs :
4311           Modified all related calls.
4312
4313 2005-06-21  Martin Baulig  <martin@ximian.com>
4314
4315         * generic.cs (NullCoalescingOperator.Emit): Make this work if the
4316         left-hand side is not a nullable type; fixes #75328.
4317
4318 2005-06-21  Martin Baulig  <martin@ximian.com>
4319
4320         * typemanager.cs
4321         (TypeManager.CSharpName): Use GetFullName() instead of `t.FullName'.
4322         (TypeManager.GetFullNameSignature): Likewise.
4323
4324         * convert.cs (Convert.Error_CannotImplicitConversion): Compare
4325         `source.FullName' and `target.FullName' to check whether there are
4326         two conflicting definitions.
4327
4328 2005-06-21  Martin Baulig  <martin@ximian.com>
4329
4330         * convert.cs (Convert.ImplicitTypeParameterConversion): Always use
4331         a BoxedCast - also for reference types - to be compatible with csc.
4332
4333 2005-06-21  Martin Baulig  <martin@ximian.com>
4334
4335         * expression.cs (MemberAccess.DoResolve): Add support for nested
4336         types in a generic instance; fixes #75320.
4337
4338 2005-06-20  Martin Baulig  <martin@ximian.com>
4339
4340         * generic.cs (TypeManager.InferType): Also walk the class
4341         hierarchy for generic instances; fixes #75261.
4342
4343 2005-06-17  Martin Baulig  <martin@ximian.com>
4344
4345         * typemanager.cs (TypeManager.IsBuiltinType): Use TypeToCoreType()
4346         to make things work for corlib.
4347
4348 2005-06-15  Martin Baulig  <martin@ximian.com>
4349
4350         * attribute.cs (Attribute.CheckSecurityActionValidity): Remove the
4351         obsolete `SecurityAction' values.
4352
4353 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
4354
4355         * rootcontext.cs: Reset TargetExt as well.
4356         
4357 2005-06-09  Martin Baulig  <martin@ximian.com>
4358
4359         * delegate.cs (Delegate.VerifyMethod): Added
4360         `MethodGroupExpr old_mg' argument; inherit its
4361         `HasTypeParameters'; fix #75085.
4362
4363 2005-06-09  Martin Baulig  <martin@ximian.com>
4364
4365         * expression.cs (Invocation.OverloadResolve): Correctly handle
4366         generic methods for the SetMemberIsUsed(); fix #75064.
4367
4368 2005-06-09  Martin Baulig  <martin@ximian.com>
4369
4370         * statement.cs (Throw.Resolve): Use TypeManager.IsSubclassOf();
4371         fixes #75062.
4372
4373 2005-06-08  Martin Baulig  <martin@ximian.com>
4374
4375         * cs-parser.jay (nullable_type_or_conditional): If we put the
4376         nullable back and our `type' is a `ComposedCast', remove the
4377         nullable from it.  Fixes #75156.
4378
4379         * expression.cs (ComposedCast.RemoveNullable): New public method.
4380
4381 2005-06-08  Martin Baulig  <martin@ximian.com>
4382
4383         The big Iterators rewrite :-)
4384
4385         * iterators.cs: Rewrite this to use the anonymous methods framework.
4386
4387         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
4388         before the TypeContainers; see 2test-21.cs.
4389
4390         * class.cs
4391         (TypeContainer.DefineType): Don't create a new EmitContext if we
4392         already have one (this only happens if we're an Iterator).
4393         (TypeContainer.Define): Also call Define() on all our iterators.
4394         (Method.CreateEmitContext): Added support for iterators.
4395
4396         * anonymous.cs
4397         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
4398         (AnonymousContainer.CreateMethodHost): Moved here from
4399         AnonymousMethod and made abstract.
4400         (AnonymousContainer.CreateScopeType): New abstract method.
4401         (AnonymousContainer.IsIterator): New public property.
4402         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
4403         get the ScopeTypeBuilder rather than manually defining it here. 
4404         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
4405         iterators here.
4406
4407         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
4408         before RootContext.DefineTypes().
4409
4410         * codegen.cs (EmitContext.RemapToProxy): Removed.
4411         (EmitContext.CurrentAnonymousMethod): Changed type from
4412         AnonymousMethod -> AnonymousContainer.
4413         (EmitContext.ResolveTopBlock): Protect from being called twice.
4414         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
4415         (EmitContext.EmitThis): Removed the iterators hacks; use the
4416         anonymous methods framework for that.
4417
4418         * statement.cs
4419         (ToplevelBlock.Container): Make this a property, not a field.
4420         (ToplevelBlock.ReParent): New public method; move the
4421         ToplevelBlock into a new container.
4422         (Foreach.TemporaryVariable): Simplify.
4423
4424 2005-06-05  Martin Baulig  <martin@ximian.com>
4425
4426         * statement.cs (LocalInfo.CompilerGenerated): New flag.
4427         (Block.AddTemporaryVariable): New public method; creates a new
4428         `LocalInfo' for a temporary variable.
4429         (Block.EmitMeta): Create the LocalBuilders for all the temporary
4430         variables here.
4431         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
4432         non-iterator variables.
4433
4434 2005-06-05  Martin Baulig  <martin@ximian.com>
4435
4436         * statement.cs (Foreach.TemporaryVariable): Create the
4437         LocalBuilder in the Emit phase and not in Resolve since in some
4438         situations, we don't have an ILGenerator during Resolve; see
4439         2test-19.cs for an example.
4440
4441 2005-06-04  Martin Baulig  <martin@ximian.com>
4442
4443         The big Foreach rewrite - Part II.
4444
4445         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
4446         with `PropertyInfo ienumerator_getcurrent'.
4447
4448         * codegen.cs (VariableStorage): Removed.
4449
4450         * statement.cs
4451         (Foreach): Derive from Statement, not ExceptionStatement.
4452         (Foreach.CollectionForeach): New nested class.  Moved all the code
4453         dealing with collection foreach here.
4454         (Foreach.ForeachHelperMethods): Removed.
4455         (Foreach.TemporaryVariable): Implement IMemoryLocation.
4456
4457 2005-05-23  Martin Baulig  <martin@ximian.com>
4458
4459         * statement.cs (Try.DoResolve): Don't create a `finally' if we
4460         don't need to.  Fix #75014.
4461
4462 2005-05-26  Raja R Harinath  <rharinath@novell.com>
4463
4464         Improve user-defined conversion handling.
4465         * convert.cs (GetConversionOperators): Rewrite.  Return only the
4466         applicable operators.
4467         (AddConversionOperators): New.  Helper for GetConversionOperators.
4468         (FindMostEncompassedType, FindMostEncompassingType): Verify that
4469         there is only one most encompassed/encompassing type.
4470         (FindMostSpecificSource, FindMostSpecificTarget): Remove
4471         "applicable operator" handling.
4472         (UserConversion): Move cache here from GetConversionOperators.
4473         Directly cache the chosen operator, rather than the whole
4474         MethodGroup.
4475         (ExplicitNumericConversion): Fix buggy implementation of Decimal
4476         case.  Allow conversion of decimal to sbyte and byte too.
4477         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
4478         New static methods.  Used to avoid allocating EmptyExpressions in
4479         convert.cs.
4480
4481 2005-05-24  Duncan Mak  <duncan@novell.com>
4482
4483         * ecore.cs (CastFromDecimal): New class for casting a decimal to
4484         another class, used in Convert.ExplicitNumericConversion.
4485         (CastToDecimal): New class, similar to above, but casts to
4486         System.Decimal, used in Convert.ImplicitNumericConversion and also
4487         in explicit convesion from double/float to decimal.
4488
4489         * convert.cs (ImplicitNumericConversion): Handle implicit
4490         conversions to System.Decimal.
4491         (ExplicitNumericConversion): handle explicit conversions to
4492         System.Decimal.
4493
4494         This fixes #68711.
4495         
4496 2005-05-20  Miguel de Icaza  <miguel@novell.com>
4497
4498         * typemanager.cs: Do not throw an exception in the TypeBuilder
4499         case, we take care of it on the TypeCode.
4500
4501 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
4502         
4503         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
4504         is back.
4505         
4506         * cs-parser.jay: Catch more lexical errors.
4507         
4508         * report.cs: Add one more Error method.
4509         
4510         * rootcontext.cs,
4511         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
4512
4513 2005-05-20  Martin Baulig  <martin@ximian.com>
4514
4515         * class.cs (TypeContainer.CircularDepException): Removed.
4516         (TypeContainer.DefineType): Removed the `InTransit' stuff.
4517         (TypeContainer.CheckRecursiveDefinition): Check for circular class
4518         (CS0146) and interface (CS0529) dependencies here.
4519
4520 2005-05-20  Martin Baulig  <martin@ximian.com>
4521
4522         * expression.cs (New.DoResolve): Move the CS0712 check above the
4523         CS0144 check; otherwise it can never be reached.
4524
4525 2005-05-20  Martin Baulig  <martin@ximian.com>
4526
4527         * cs-parser.jay: Fix CS0080 check; add CS0231 and CS0257 from MCS.
4528
4529 2005-05-20  Martin Baulig  <martin@ximian.com>
4530
4531         * class.cs (TypeContainer.DefineType): Fix CS0698 check.
4532
4533         * typemanager.cs (TypeManager.IsAttributeType): New public method.
4534
4535 2005-05-19  Martin Baulig  <martin@ximian.com>
4536
4537         * delegate.cs
4538         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
4539         to disable error reporting.
4540
4541         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
4542         here since we don't want to report an error; see the new test-336.cs.
4543
4544 2005-05-19  Raja R Harinath  <rharinath@novell.com>
4545
4546         * statement.cs (ToplevelBlock.GetParameterReference)
4547         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
4548         Move here from class Block.
4549         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
4550         * expression.cs (ParameterReference.DoResolveBase): Likewise.
4551
4552 2005-05-18  Martin Baulig  <martin@ximian.com>
4553
4554         Fix #74978.
4555
4556         * flowanalysis.cs
4557         (FlowBranching.Reachability): Add non-static public And() and Or()
4558         methods.
4559         (FlowBranchingSwitch): New class; do the `break_origins' thing
4560         like in FlowBranchingLoop.
4561         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
4562         reachability, not just locals and parameters.
4563         (FlowBranching.MergeChild): Remove some of the hacks for loop and
4564         switch; MergeBreakOrigins() now takes care of that.
4565
4566 2005-05-18  Martin Baulig  <martin@ximian.com>
4567
4568         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
4569         a loop and may leave it, reset the barrier; fixes #74974.
4570
4571 2005-05-16  Raja R Harinath  <rharinath@novell.com>
4572
4573         Fix test-382.cs.  Emit values of decimal constants.
4574         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
4575         Carved out of ...
4576         (TypeContainer.AddField): ... this.
4577         (TypeContainer.EmitFieldInitializers): Allow the list of fields
4578         with initializers to include 'Const's.
4579         (ClassPart.RegisterFieldForInitialization): Forward to
4580         PartialContainer.
4581         * const.cs (Const.Const): Pass initializer to base class.
4582         (Const.Define): In case of decimal constants, register them for
4583         initialization in a static constructor.
4584
4585 2005-05-14  Martin Baulig  <martin@ximian.com>
4586
4587         * statement.cs (Block.Resolve): Correctly handle unreachable code;
4588         do not call ResolveUnreachable() on unreachable statements in
4589         here, see the comment in the source code.
4590
4591 2005-05-13  Raja R Harinath  <rharinath@novell.com>
4592
4593         Fix #74934.
4594         * expression.cs (BinaryResolveOperator): If one of the operands of
4595         an equality comparison is 'null' and the other is a pointer type,
4596         convert the null to a NullPointer.
4597         * convert.cs (ImplicitReferenceConversion): If the expression is a
4598         NullLiteral and the target type is a pointer type, return a
4599         NullPointer instead.
4600         (ImplicitConversionStandard): Likewise.
4601
4602 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
4603         
4604         * cs-parser.jay: Set readonly context based on special constructs.
4605         
4606         * expression.cs (LocalVariableReference.DoResolveBase): Improved
4607         readonly variable error handling.
4608         
4609         * rootcontext.cs (EmitCode): Don't verify members when error
4610         occurred.
4611         
4612         * statement.cs (LocalInfo): Add reaodnly context information.
4613         (SetReadOnlyContext, GetReadOnlyContext): New methods.
4614
4615 2005-05-17  Martin Baulig  <martin@ximian.com>
4616
4617         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
4618         #70970. 
4619
4620 2005-05-13  Martin Baulig  <martin@ximian.com>
4621
4622         * statement.cs (Block.Resolve, ResolveUnreachable): Correctly
4623         handle unreachable blocks.
4624
4625 2005-05-13  Martin Baulig  <martin@ximian.com>
4626
4627         * class.cs
4628         (ConstructorInitializer.GetOverloadedConstructor): Don't crash.
4629         (MethodCore.CheckCore): Use TypeManager.IsEqual(); fix #74904 and
4630         #74905. 
4631
4632 2005-05-13  Martin Baulig  <martin@ximian.com>
4633
4634         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
4635         instance variable, not a local.  Fix #74873.
4636         (Block.ResolveUnreachable): Set it to true here.
4637
4638 2005-05-12  Martin Baulig  <martin@ximian.com>
4639
4640         * cs-parser.jay (property_declaration): Pass the `current_class',
4641         not the `current_container' to Property's .ctor.  Fixes #74912.
4642
4643 2005-05-11  Martin Baulig  <martin@ximian.com>
4644
4645         * typemanager.cs (Closure): Copy this from MCS and merge all the
4646         GMCS-specific changes into it.
4647
4648 2005-05-12  Raja R Harinath  <harinath@gmail.com>
4649
4650         Fix #74920.
4651         * typemanager.cs (unmanaged_enclosing_types): New.
4652         (IsUnmanagedType): Avoid infloops by using
4653         'unmanaged_enclosing_types' to talk with recursive invocations.
4654
4655 2005-05-11  Duncan Mak  <duncan@novell.com>
4656
4657         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
4658         continuing to process for 'arg'.
4659         (handle_preprocessing_directive): Check the argument of the #endif
4660         directive and report error CS1025 if there are any trailing
4661         characters.
4662
4663         According to the C# spec, having even whitespace after the #endif
4664         directive is illegal; however, because we call arg.TrimEnd ()
4665         beforehand, we have the same behavior as csc, allowing whitespace
4666         after the directive.
4667
4668         Fixes #74892.
4669
4670 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
4671
4672         Fix #74863.
4673         
4674         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
4675         (Constructor.GetObsoleteAttribute): Implemented correctly.
4676
4677 2005-05-10  Martin Baulig  <martin@ximian.com>
4678
4679         * generic.cs (Constraints.Resolve): Report CS0246 if we cannot
4680         resolve the type; fixes #74864.
4681         (DefaultValueExpression): Create the LocalTemporary in Emit(), not
4682         in DoResolve(); fixes #74862.
4683
4684 2005-05-10  Martin Baulig  <martin@ximian.com>
4685
4686         * support.cs (ReflectionParameters.ParameterModifier): Use
4687         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
4688         and `ParameterAttributes.In'.  Fixes #74884.
4689
4690 2005-05-10  Martin Baulig  <martin@ximian.com>
4691
4692         * typemanager.cs (TypeManager.MemberLookup_FindMembers): Don't use
4693         the cache if we're just looking for `MemberTypes.NestedType' in a
4694         generic instance.
4695
4696         * ecore.cs (Expression.ResolveAsTypeTerminal): Don't check the
4697         constraints if we're still resolving the type tree.
4698         (Expression.MemberLookup): If we're resolving the type tree, only
4699         look for `MemberTypes.NestedType' since we're only interested in
4700         getting types.
4701
4702         * class.cs (TypeContainer.DefineType): Don't resolve the type
4703         parameters here; do this later in ResolveType() after the type
4704         tree has been resolved.
4705         (TypeContainer.ResolveType): New public method; this is called
4706         after the type tree is resolved and before the types are being
4707         populated.  We resolve the generic constraints here.
4708         (TypeContainer.DoDefineMember): Check the constraints on our base
4709         class and interfaces.
4710
4711         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Make this protected;
4712         set the `ResolvingTypeTree' flag on the EmitContext.
4713
4714         * codegen.cs (EmitContext.ResolvingTypeTree): New public field.
4715
4716 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
4717
4718         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
4719         
4720         * expression.cs (Argument.GetParameterModifier): Turned to property.
4721         (Invocation.Error_InvalidArguments): Add more descriptive errors.
4722         
4723         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
4724         its C# equivalent.
4725         
4726 2005-05-09  Raja R Harinath  <rharinath@novell.com>
4727
4728         Fix #74852.
4729         * decl.cs (MemberCache.AddMethods): Register override methods,
4730         rather than non-override methods.
4731         * typemanager.cs (RegisterOverride): New.
4732         (IsOverride): Update.
4733
4734 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4735
4736         * typemanager.cs (TypeManager): Moved InitGenerics to Reset method.
4737
4738 2005-05-06  Martin Baulig  <martin@ximian.com>
4739
4740         * attribute.cs
4741         (Attributable.IsClsComplianceRequired): Fix typo in the method name.
4742         (AttributeTester.AnalyzeTypeCompliance): Add generics support.
4743
4744 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
4745
4746         Fix #73105.
4747         
4748         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
4749         recursive declaration.
4750         
4751         * statement.cs (Block.ResolveMeta): Report any error in resolving.
4752         
4753 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
4754
4755         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
4756         
4757         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
4758
4759 2005-05-05  Raja R Harinath  <rharinath@novell.com>
4760
4761         Fix #74797.
4762         * decl.cs (DeclSpace.FamilyAccessible): 
4763         Use TypeManager.IsNestedFamilyAccessible.
4764
4765         Fix reopened #64812.
4766         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
4767         internal'.
4768
4769 2005-05-04  Raja R Harinath  <rharinath@novell.com>
4770             Abin Thomas  <projectmonokochi@rediffmail.com>
4771             Anoob V E  <projectmonokochi@rediffmail.com>
4772             Harilal P R  <projectmonokochi@rediffmail.com>
4773
4774         Fix #64812.
4775         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
4776         allow access to all static members.
4777
4778 2005-05-04  Martin Baulig  <martin@ximian.com>
4779
4780         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
4781
4782 2005-05-04  Martin Baulig  <martin@ximian.com>
4783
4784         Fix #74655.
4785
4786         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
4787         section at the end; make things work if `default' is not the last
4788         section.        
4789
4790 2005-05-04  Martin Baulig  <martin@ximian.com>
4791
4792         Fix #70400.
4793
4794         * statement.cs (Switch): Replaced the `got_default' field with a
4795         `default_section' one.
4796         (Switch.CheckSwitch): Set `default_section' here.
4797         (Switch.Resolve): If we're a constant switch and the constant is
4798         not found, use the default section.
4799
4800 2005-05-03  Martin Baulig  <martin@ximian.com>
4801
4802         * expression.cs (ArrayAccess.EmitGetLength): New public method.
4803
4804         * statement.cs (Foreach.ArrayForeach): New nested class.
4805         (Foreach.TemporaryVariable): New nested class.
4806         (Foreach.EmitArrayForeach): Removed; this is now in the new
4807         ArrayForeach class.
4808
4809 2005-05-03  Raja R Harinath  <rharinath@novell.com>
4810
4811         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
4812         more conservative.
4813         (VerifyPendingMethods): Revert change below.
4814
4815         * typemanager.cs (IsOverride, RegisterNonOverride): New.
4816         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
4817         that used to trigger warning -28.  Remove warning -28.
4818         * expression.cs (Invocation.OverloadResolve): Use
4819         TypeManager.IsOverride to distinguish override methods.
4820
4821         Fix #74773.
4822         * pending.cs (VerifyPendingMethods): If a base type implements the
4823         requested interface, don't bother checking individual methods of
4824         the base type.  As a side-effect, this prevents the creation of
4825         unnecessary proxies.
4826
4827 2005-05-02  Martin Baulig  <martin@ximian.com>
4828
4829         Fix #70182.
4830
4831         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
4832         Also `And' the locals if the old vector is null.
4833         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
4834         null; in this case we basically reset all the variables.        
4835
4836 2005-05-02  Martin Baulig  <martin@ximian.com>
4837
4838         Fix #74529.
4839
4840         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
4841         Added `FlowBranching branching' argument; always `and' the
4842         variables instead of `or'ing them unless we're an infinite loop.
4843
4844         * statement.cs (While.Resolve): Create a new sibling unless we're
4845         infinite.       
4846
4847 2005-05-02  Martin Baulig  <martin@ximian.com>
4848
4849         Fix #70140.
4850
4851         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
4852         arguments; use it instead of creating a new TopLevelBlock.
4853         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
4854         our ConstructorInitializer.
4855
4856         * statement.cs
4857         (TopLevelBlock.TopLevelBranching): New public property.
4858         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
4859         and create our `TopLevelBranching'.
4860
4861         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
4862         anonymous method host, use `block.TopLevelBranching' rather than
4863         creating a new branching.
4864
4865 2005-04-20  Miguel de Icaza  <miguel@novell.com>
4866
4867         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
4868         a ScopeInfo, if any of the current children is a child of the new
4869         entry, move those children there.
4870
4871 2005-04-30  Martin Baulig  <martin@ximian.com>
4872
4873         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
4874         at the beginning of a SwitchSection.  Fix #73335.
4875
4876 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
4877
4878         Fix #74378
4879         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
4880         
4881         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
4882         (FieldExpr.DoResolve): Obsolete members are ignored for field
4883         initializers.
4884         
4885 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
4886
4887         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
4888         of arrays detection.
4889
4890         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
4891         verification.
4892         (Field.VerifyClsCompliance): Volatile fields are not compliant.
4893
4894         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
4895         arrays report.
4896
4897 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
4898
4899         * cs-parser.jay: Use the prefered version of -unsafe in error
4900         message.
4901
4902 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4903
4904         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4905         circumstances.
4906
4907 2005-04-20  John Luke  <john.luke@gmail.com>
4908
4909         * driver.cs: fix typo in error message, --outout to --output
4910
4911 2005-04-30  Martin Baulig  <martin@ximian.com>
4912
4913         * attribute.cs (Attribute.CheckSecurityActionValidity): Correctly
4914         handle the .NET 2.x security attributes.
4915
4916 2005-04-30  Martin Baulig  <martin@ximian.com>
4917
4918         * typemanager.cs
4919         (TypeManager.ExpandInterfaces): Don't add things twice.
4920
4921         * class.cs
4922         (TypeContainer.VerifyClsCompliance): Allow generic instances.
4923
4924 2005-04-29  Martin Baulig  <martin@ximian.com>
4925
4926         * generic.cs (Constraints.ResolveTypes): Expand interfaces.
4927
4928         * anonymous.cs: Added support for anonymous generic methods.
4929
4930 2005-04-29  Martin Baulig  <martin@ximian.com>
4931
4932         * typemanager.cs (TypeManager.GetInterfaces): Correctly handle
4933         generic instances.
4934
4935 2005-04-29  Martin Baulig  <martin@ximian.com>
4936
4937         * generic.cs (TypeManager.HasConstructorConstraint): Removed.
4938
4939         * expression.cs (New.DoResolve): Fix the CS0304 check.
4940
4941 2005-04-29  Martin Baulig  <martin@ximian.com>
4942
4943         * typemanager.cs (TypeManager.GetFullName): Updated to the new
4944         naming schema.
4945
4946         * class.cs (MethodCore.IsDuplicateImplementation): If we're an
4947         explicit interface implementation, compare the interface types.
4948         (MethodData.Define): Use the new naming scheme from the latest
4949         .NET 2.x beta2.
4950         (MemberBase.DoDefineBase): Resolve `InterfaceType' here.
4951
4952         * decl.cs (MemberName.GetMemberName): Removed.
4953         (MemberName.MethodName, FullName): New properties.
4954
4955 2005-04-25  Raja R Harinath  <rharinath@novell.com>
4956
4957         * gmcs.exe.config: Update v2.0.40607 -> v2.0.50215.
4958
4959 2005-04-22  Martin Baulig  <martin@ximian.com>
4960
4961         * generic.cs (GenericMethod): Create the EmitContext in the
4962         `Define()'; in `Define(MethodBuilder)', create the type parameters
4963         before calling `Define()'.  Fixes #73933.
4964
4965 2005-04-22  Martin Baulig  <martin@ximian.com>
4966
4967         * generic.cs
4968         (Constraints.Resolve): Make things work wrt. the new type lookup system.
4969         (ConstructedType.ResolveAsTypeTerminal): Don't override this.
4970
4971         * ecore.cs (Expression.ResolveAsTypeTerminal): If `te' is a
4972         ConstructedType, check its constraints.
4973
4974 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4975
4976         * codegen.cs (InRefOutArgumentResolving): New field.
4977         
4978         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4979         fields outside contructor.
4980         
4981         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4982         
4983 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4984
4985         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4986         parameter code was not completed ever, so it was not as up-to-date
4987         as local variables.  Must finish it.
4988
4989         The bug fix was to compare the Toplevel of the block, not the
4990         current block.  Thanks for Ben for pointing this out. 
4991
4992 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4993
4994         * decl.cs (AddMethods): Use the declaring type of the problem
4995         method to determine if we want to squash a warning.
4996
4997 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4998
4999         * attribute.cs: Removed debug output.
5000
5001         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
5002         
5003         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
5004         Report.Stderr.
5005         
5006 2005-04-18  Raja R Harinath  <rharinath@novell.com>
5007
5008         Fix #74481.
5009         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
5010         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
5011         all null comparisons against reference types.
5012
5013 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
5014
5015         Fix# 74565
5016         * class.cs (TypeContainer.CircularDepException) New nested
5017         exception class.
5018         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
5019         (TypeContainer.DefineType): Removed error, reset InTransit before
5020         exit.
5021         (Class.DefineType): Throw exception when is in Transit.
5022         Catch exception and report error.
5023         (Struct.DefineType): Throw exception when is in Transit.
5024         Catch exception and report error.
5025         (Interface.DefineType): Throw exception when is in Transit.
5026         Catch exception and report error.
5027
5028         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
5029         handle nested exception handlers.
5030
5031         * flowanalysis.cs (InTryWithCatch): New method, search for try with
5032         a catch.
5033
5034         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
5035         InFinally and InCatch storage.
5036
5037         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
5038         (Catch.Resolve): Set and Restore ec.InCatch.
5039         (Try.Resolve): Set and Restore ec.InFinally.
5040         (Try.HasCatch): True when try has catch.
5041
5042 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
5043
5044         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
5045           for the same event member, so exclude such cases from warning 419.
5046           Fixed bug #74633.
5047
5048 2005-04-16  Miguel de Icaza  <miguel@novell.com>
5049
5050         * expression.cs (Binary.ResolveOperator): Apply patch from John
5051         Luke to fix bug 59864: operators &, | and ^ on enumerations
5052         require that the same enum type on both sides.
5053
5054         * driver.cs: Add warnings to old flag usage, this is to assist
5055         people who produce Makefiles and hope that the Makefiles will be
5056         used on Windows.
5057
5058         * class.cs (TypeContainer.EmitType): Moved the definition of the
5059         special $PRIVATE$ field from the resolve phase to the Emit phase.
5060         During resolve we do not know if we are a struct with
5061         HasExplicitLayout, we know this only after the attributes for the
5062         type are emitted.
5063
5064         Set the FieldOffset to zero on the dummy field that we create for
5065         the class.   Fixes 74590.
5066
5067 2005-04-16  Raja R Harinath  <rharinath@novell.com>
5068
5069         Fix #73834.
5070         * ecore.cs (PropertyExpr.resolved): New.
5071         (DoResolve): Use it to handle a case of double resolution here.
5072         Handle a case of identical-name-and-type-name.
5073         * expression.cs (ArrayCreation.CheckIndices): Avoid double
5074         resolution by storing the results of expression resolution back
5075         into the "probes" array.
5076
5077 2005-04-15  Raja R Harinath  <rharinath@novell.com>
5078
5079         Fix cs0208-7.cs and cs0208-8.cs.
5080         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
5081         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
5082         error reporting to point out the reason a struct is not unmanaged.
5083
5084 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5085
5086         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
5087           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
5088
5089 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5090
5091         Fix #74528.
5092         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
5093         IdenticalNameAndTypeName here.
5094         (EventExpr.InstanceResolve): Likewise.
5095
5096 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
5097
5098         C# 2.0 DefaultCharSetAttribute implementation
5099         
5100         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
5101         which allows us to set GlobalNamespace for every resolve.
5102         (Attribute.ResolveArguments): Cut from Resolve.
5103         (Attribute.GetCharSetValue): Returns CharSet named argument.
5104         (Attribute.DefinePInvokeMethod): Gets default charset from
5105         module settings.
5106         (GlobalAttribute.ResolveAsTypeStep): Override.
5107         (GlobalAttribute.ResolveArguments): Override.
5108         
5109         * class.cs (TypeAttr): Is protected.
5110         
5111         * codegen.cs (ModuleClass.DefaultCharSet): New member.
5112         (ModuleClass.DefaultCharSetType): New memeber.
5113         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
5114         
5115         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
5116         charset from module.
5117         
5118         * delegate.cs (TypeAttr): Override.
5119         (Delegate.DefineType): Use this TypeAttr.
5120         
5121         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
5122         at very early stage (before types are defined) to resolve model
5123         module attributes. It will probably not work with corlib but it
5124         should be ok.
5125         
5126         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
5127         charset from module.
5128         
5129         * typemanager.cs (default_charset_type): New type.
5130
5131 2005-04-13  Raja R Harinath  <rharinath@novell.com>
5132
5133         * decl.cs (MemberCache.AddMethods): Don't warn if
5134         System.Object.Finalize has buggy MethodAttributes.
5135
5136         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
5137         removed below.
5138
5139 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5140
5141         * doc.cs : detect ambiguous reference to overloaded members.
5142           Fixed bug #71603. MS 1.1 csc does not detect it.
5143
5144 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
5145
5146         * doc.cs : delegates must not be referenced with parameters.
5147           Fixed bug #71605.
5148
5149 2005-04-12  Miguel de Icaza  <miguel@novell.com>
5150
5151         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
5152
5153 2005-04-10  Miguel de Icaza  <miguel@novell.com>
5154
5155         * driver.cs (MainDriver): Stop processing if the CLS stage found
5156         errors. 
5157
5158         (CompilerCallableEntryPoint.InvokeCompiler): Always
5159         reset after execution;   Take a TextWriter argument for the
5160         output.
5161
5162         * report.cs: Use the error stream instead of hardcoding stderr. 
5163
5164 2005-04-09  Miguel de Icaza  <miguel@novell.com>
5165
5166         * class.cs: Reduce code paths to test, too small of an
5167         optimization to make it worth the extra testing.  Always perform
5168         it. 
5169
5170 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5171
5172         Fix #74510.
5173         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
5174         operators that had errors reported on them.
5175
5176 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
5177
5178         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
5179         argument types.
5180         (Attribute.Resolve): Add named argument type checking.
5181         
5182         * class.cs (FixedField.Define): Use IsPrimitiveType
5183         
5184         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
5185         
5186         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
5187         unsafe parameter types.
5188         
5189         * statement.cs (Using.ResolveExpression): Add better error description.
5190         
5191         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
5192         
5193 2005-04-08  Raja R Harinath  <rharinath@novell.com>
5194
5195         Fix #74484.
5196         * attribute.cs (Attribute.GetAttributeUsage): Resolve
5197         AttributeUsageAttribute in the emitcontext of the attribute class,
5198         not in the emitcontext of the attributable entity it was attached to.
5199         * cs-parser.jay: Use 'current_class', not 'current_container',
5200         when creating a GlobalAttribute.
5201
5202 2005-04-08  Alp Toker  <alp@atoker.com>
5203
5204         * pending.cs: The fix to #58413 failed to compile methods implementing
5205         interfaces with/without params modifiers and vice versa, even though
5206         params modifiers aren't part of the signature. Make the modifier check
5207         less strict as in csc.
5208
5209 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
5210             Anoob V E  <projectmonokochi@rediffmail.com>
5211             Harilal P R  <projectmonokochi@rediffmail.com>
5212
5213         Fix #58413.
5214         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
5215         modifiers of pending methods.
5216         (PendingImplementation.PendingImplementation): Initialize it.
5217         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
5218         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
5219         with ParameterData.  Add check for modifiers.
5220         * class.cs (MethodData.Define): Update to changes.
5221
5222 2005-04-07  Raja R Harinath  <rharinath@novell.com>
5223
5224         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
5225
5226 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
5227
5228         * class.cs (PropertyMethod.Define): Check private accessor in abstract
5229         property.
5230         
5231         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
5232         
5233         * rootcontext.cs,
5234         * typemanager.cs: Registered RequiredAttributeAttribute.
5235         
5236 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
5237
5238         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
5239         Warning CS0169 is back at level 3.
5240         (IMethodData.SetMemberIsUsed): New method.
5241         
5242         * decl.cs (IsUsed): New value; moved from FieldBase.Status
5243         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
5244         
5245         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
5246
5247         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
5248         contants.
5249         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
5250         is used.
5251         
5252         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
5253         is used.
5254         
5255         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
5256         to avoid the problems with nested types.
5257
5258 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
5259             Anoob V.E  <projectmonokochi@rediffmail.com>
5260             Harilal P.R  <projectmonokochi@rediffmail.com>
5261             Raja R Harinath  <rharinath@novell.com>
5262
5263         Fix #73820.
5264         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
5265         attribute.
5266         * typemanager (GetConstructor): Make public.
5267
5268 2005-04-05  John Luke  <john.luke@gmail.com>
5269             Raja R Harinath  <rharinath@novell.com>
5270
5271         Fix #62232.
5272         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
5273         struct too.  Return false quicker in a few cases.
5274         (VerifyUnManaged): Use it.
5275
5276 2005-04-05  Raja R Harinath  <rharinath@novell.com>
5277
5278         Fix #74041.
5279         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
5280         not 'unreachable_seen'.
5281
5282 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
5283
5284         * attribute.cs (Attribute.GetValue): Removed unused.
5285         
5286         * codegen.cs (CodeGen.TrimExt): Removed unused.
5287         
5288         * cs-parser.jay (output): Removed unused.
5289         
5290         * cs-tokenizer.cs (hex_digits): Removed unused.
5291         
5292         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
5293         
5294         * expression.cs (Indirection.LoadExprValue): Removed unused.
5295         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
5296         
5297         * iterators.cs (Iterator.param_types): Removed unused.
5298         
5299         * statement.cs (Goto.block): Removed unused.
5300         (ToplevelBlock.did): Removed unused.
5301         (Switch.ResolveConstantSwitch): Removed unused.
5302
5303 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
5304
5305         * rootcontext.cs: Allow mcs to bootstrap with the compilation
5306         resetting thingy.
5307
5308 2005-04-19  Martin Baulig  <martin@ximian.com>
5309
5310         Merged r42462 from MCS and made it work for GMCS.
5311
5312         * class.cs (MethodCore.ds): Moved this field to `MemberBase'.
5313
5314         * generic.cs (GenericMethod.Define): Removed `return_type' argument.
5315
5316 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5317
5318         Fix #74232 and cs0208-3.cs.
5319         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
5320         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
5321         unmanaged type.  Don't use FieldBuilders when 't' is a
5322         TypeBuilder.  Use ModFlags and MemberType fields.
5323         * class.cs (MemberBase.member_type): Rename from MemberType.
5324         (MemberBase.MemberType): New property.  Determines member_type on
5325         demand.
5326         (MemberBase.DoDefine): Don't initialize MemberType here.
5327         (FieldMember.Define): Likewise.
5328
5329 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
5330
5331         Fix #74241
5332         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
5333         Attributes are emitted there.
5334         
5335 2005-04-01  Raja R Harinath  <rharinath@novell.com>
5336
5337         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
5338         keyword in 'partial enum' too.
5339         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
5340         is not allowed).
5341         Report from Kamil Skalski <nazgul@omega.pl>.
5342
5343         Fix #74309.
5344         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
5345         have partial containers too.
5346
5347         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
5348         in block' checks to Block.CheckInvariantMeaningInBlock.
5349         * statement.cs (Block.GetKnownVariableInfo): Make private.
5350         (Block.IsVariableUsedInChildBlock): Remove.
5351         (Block.IsVariableUsedInBlock): Likewise.
5352         (Block.CheckInvariantMeaningInBlock): New.  Show location of
5353         conflicting declaration.
5354         (Block.AddVariable): Make error messages less long-winded and more
5355         specific.  Show location of conflicting declaration.
5356         * parameter.cs (Parameters.Location): New readonly property.
5357
5358 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5359
5360         Clean up semantics of invoking ResolveMemberAccess.
5361         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
5362         can have an instance, ensure that we pass in a non-TypeExpression
5363         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
5364         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
5365         argument.  Update to changes and simplify.
5366         (FieldExpr.Emitinstance): Remove CS0120 check.
5367         (PropertyExpr.EmitInstance): Likewise.
5368         * expression.cs (Argument.Resolve): Likewise.
5369         (Invocation.DoResolve): Update to changes in semantics of
5370         InstanceExpression.
5371
5372 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
5373
5374         Fix #74241
5375         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
5376         customization.
5377         
5378         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
5379
5380 2005-03-31  Raja R Harinath  <rharinath@novell.com>
5381
5382         Fix difference in behaviour with commandline invocation.
5383         * driver.cs (Driver.Reset): New.
5384         (CompilerCallableEntryPoint): Call it.
5385
5386         * statement.cs (If.Resolve): Avoid spurious "uninitialized
5387         variable" warnings if the boolean expression failed to resolve.
5388
5389 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
5390
5391         * attribute.cs: Fix the union of several permissions when some of them
5392         are unrestricted (so the result isn't an unrestricted permission set).
5393         Fix #74036.
5394
5395 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5396
5397         * ecore.cs (MemberExpr): New class.  Convert from interface
5398         IMemberExpr.
5399         (MemberExpr.ResolveMemberAccess): Refactor and move here from
5400         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
5401         error checks.
5402         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
5403         (MethodGroupExpr.IsExplicitImpl): Remove.
5404         (Expression.GetFieldFromEvent): Remove.
5405         (SimpleName.MemberStaticCheck): Remove.
5406         (SimpleName.DoSimpleNameResolve): Update to changes.
5407         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
5408         (MemberAccess.IdenticalNameAndTypeName): Remove.
5409         (MemberAccess.error176): Move to MemberExpr.
5410         (MemberAccess.DoResolve): Update to changes.
5411         (BaseAccess.DoResolve): Likewise.
5412
5413 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
5414
5415         C# 2.0 Conditional attribute class implementation
5416         
5417         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
5418         Analyzes class whether it has attribute which has ConditionalAttribute
5419         and its condition is not defined.
5420         
5421         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
5422         (Class.IsExcluded): New method. Search for at least one defined
5423         condition in ConditionalAttribute of attribute class.
5424
5425 2005-03-30  Raja R Harinath  <rharinath@novell.com>
5426
5427         * ecore.cs (PropertyExpr): Derive from Expression, not
5428         ExpressionStatement.
5429         (PropertyExpr.EmitStatement): Remove.
5430
5431 2005-03-29  Raja R Harinath  <rharinath@novell.com>
5432
5433         Fix #74060.
5434         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
5435         internal field "value__" of an enum be private.  The examples for
5436         "value__" that I found on MSDN all used FieldAttributes.Private.
5437
5438         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
5439         Don't mention IL method attribute names.
5440
5441         Fix #47991.  Remove a TODO.
5442         * statement.cs (Block.Toplevel): Make into a field.
5443         (Block.Parameters): Move into ToplevelBlock.
5444         (Block.known_variables): Rename from child_variable_names.
5445         (Block.Block): Remove variants that take Parameters.  Initialize
5446         'Toplevel' with the immediately surrounding toplevel block.
5447         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
5448         LocalInfo parameter.
5449         (Block.GetKnownVariableInfo): New.
5450         (Block.IsVariableNameUsedInChildBlock): Update.
5451         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
5452         the block, even though it may not be in scope.
5453         (Block.AddVariable): Remove Parameters parameter.  Use
5454         Toplevel.Parameters instead.
5455         (Block.AddConstant): Remove Parameters parameter.
5456         (Block.GetParameterReference): Update to use Toplevel.Parameters.
5457         (Block.IsParamaterReference): Likewise.
5458         (Block.IsLocalParameter): Likewise.  Simplify a lot.
5459         (ToplevelBlock.Parameters): New.  Moved from Block.
5460         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
5461         initialize Parameters to a non-null value.
5462         * cs-parser.jay: Update to changes.
5463         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
5464         simple names that mean different things in the same block.  Use
5465         Block.IsVariableNameUsedInBlock.
5466
5467 2005-03-28  Raja R Harinath  <rharinath@novell.com>
5468
5469         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
5470
5471 2005-03-26  Raja R Harinath  <harinath@acm.org>
5472
5473         Fix #73038.
5474         * assign.cs (Assign.DoResolve): When the RHS of an assignment
5475         fails to resolve, ensure that the LHS is still resolved as an
5476         lvalue.
5477
5478 2005-03-25  Raja R Harinath  <harinath@acm.org>
5479
5480         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
5481         ec.ContainerType.
5482         (Enum.current_ec): Remove.
5483         (Enum.LookupEnumValue): Remove EmitContext argument.
5484         Just uses the one created during DefineType.
5485         (Enum.FindMembers): Update.
5486         * expression.cs (MemberAccess.DoResolve): Update.
5487
5488 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
5489
5490         * assign.cs (Assign.DoResolve): Check for CS1717 when
5491         source and target are same (uses Equals).
5492
5493         * expression.cs (LocalVariableReference, ParameterReference,
5494         This): Implemented Equals, GetHashCode.
5495
5496         * statement.cs (Block.GetParameterReference): Removed useless
5497         local variable.
5498
5499 2005-03-22  Raja R Harinath  <rharinath@novell.com>
5500
5501         Fix cs0128.cs
5502         * statement.cs (Block.AddVariable): Ensure that we skip implicit
5503         blocks before deciding whether the error is cs0136 or cs0128.
5504
5505         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
5506         (using_alias_directive, using_namespace_directive): Pass
5507         MemberName, not an expression to Namespace.UsingAlias and
5508         Namespace.Using.
5509         (MakeName): Use the MemberName of the namespace.
5510         * namespace.cs (Namespace.MemberName): New.
5511         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
5512         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
5513         Likewise.
5514         * decl.cs (MemberName.Name): Make readonly.
5515         (MemberName.FromDotted): New "constructor".
5516         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
5517         (MemberCore.Name): Compute from MemberName on demand.
5518         (MemberCore.SetMemberName): Provide a way to change the
5519         MemberName.
5520         (MemberCore.AddToContainer): Don't take a fullname parameter.
5521         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
5522         fully qualified name of the container to the member name.
5523         (TypeContainer.AddToTypeContainer): Use a fully qualified name
5524         only if the type is a member of the root container.
5525         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
5526         MemberName.Left rather than searching for an embedded ".".
5527         (PartialContainer.CreatePart): Update to changes in RootContext.
5528         (MemberBase.ShortName): Turn into a property.  Use
5529         MemberCore.SetMemberName.
5530         (MemberBase.ExplicitInterfaceName): Remove.
5531         (MemberBase.UpdateMemberName): Remove.
5532         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
5533         (PropertyBase.SetMemberName): New override.
5534         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
5535         (Tree.GetDecl): New.
5536         (Tree.AllDecls): Rename from Decls.
5537         * attribute.cs, enum.cs, report.cs: Update to changes.
5538         * driver.cs (MainDriver): Use MemberName.FromDotted on
5539         RootContext.MainClass.
5540
5541 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
5542
5543         * class.cs (FixedField.Define): Check for CS1664 and more sanity
5544         checks.
5545
5546         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
5547
5548 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
5549
5550         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
5551         property accessor modifiers.
5552
5553         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
5554         fixed buffer attribute (CS1716).
5555         (PropertyMethod.HasCustomAccessModifier): When property accessor
5556         has custom modifier.
5557
5558         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
5559         modifiers.
5560         (PropertyExpr.DoResolveLValue): Add CS0272.
5561
5562 2005-03-17  Miguel de Icaza  <miguel@novell.com>
5563
5564         * convert.cs: When converting to a pointer, use the proper Conv.U
5565         or Conv.I depending on the source data type.
5566
5567         * cs-tokenizer.cs: Make the size for large decimal constants,
5568         fixes #72957.
5569
5570 2005-03-17  Martin Baulig  <martin@ximian.com>
5571
5572         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
5573         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
5574
5575 2005-03-17  Martin Baulig  <martin@ximian.com>
5576
5577         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
5578         to bool so we can return an error condition.
5579         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
5580         returned an error.
5581
5582 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
5583
5584         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
5585         attributes.
5586
5587 2005-03-16  Raja R Harinath  <rharinath@novell.com>
5588
5589         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
5590         Refactor to avoid traversing the list of assemblies, and to avoid
5591         string concatenation.
5592         * typemanager.cs (guid_attr_type): Remove.
5593         (negative_hits, pointers, references): Remove hashes.
5594         (type_hash): New.
5595         (GetConstructedType): New.  Uses type_hash to handle constructed
5596         types (arrays, references, pointers).
5597         (GetReferenceType, GetPointerType): Use it.
5598         (GetNestedType): New.  Uses type_hash to handle nested types of
5599         reflected types.
5600         (LookupType, LookupTypeDirect): Remove.
5601         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
5602         'types' hash and LookupTypeReflection directly.
5603         (params_string, params_object): Use GetConstructedType.
5604         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
5605         top-level types.
5606         (Namespace.Lookup): Use cached_types.
5607         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
5608         provided by old TypeManager.LookupType.
5609         * rootcontext.cs (MakeFQN): Remove.
5610         * decl.cs (DeclSpace.MakeFQN): Likewise.
5611         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
5612         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
5613         TypeManager.GetConstructedType.
5614         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
5615
5616 2005-04-16  Zoltan Varga  <vargaz@freemail.hu>
5617
5618         * cs-parser.jay: Fix build.
5619
5620 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
5621
5622         * class.cs (TypeContainer.CircularDepException) New nested
5623         (MethodCore.CheckBase): Report CS1715 for properties and indexers.
5624
5625         * cs-parser.jay: Reports CS1527 for any namespace element.
5626
5627         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
5628         Added CS0407.
5629
5630         * expression.cs (ParameterReference.IsAssigned): Changed error to
5631         CS0269.
5632         (Error_WrongNumArguments): Moved CS0245 detection here.
5633
5634         * statement.cs (Return.Resolve): Add CS1622 report.
5635
5636 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
5637
5638         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
5639
5640 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
5641
5642         * attribute.cs expression.cs: Get rid of some allocations.
5643
5644 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
5645
5646         * doc.cs : just eliminate the latest change.
5647
5648 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5649
5650         * doc.cs : commented out the latest change. It breaks xml-030.cs
5651
5652 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5653
5654         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
5655           fail. So invoke CreateType() in FindDocumentedType().
5656
5657 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
5658
5659         * cs-tokenizer.cs : added IsKeyword().
5660         * doc.cs : Detect keyword incorrectly used as identifier.
5661           Allow identifiers prefixed by @.
5662
5663 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
5664
5665         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
5666         It caused exception in namespace resolving (again!).
5667         
5668         * class.cs (Class.ctor): Removed exit.
5669         (PropertyMethod.ctor): ditto.
5670         
5671         * codegen.cs (Codegen.Reset): Reset static data.
5672         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
5673         
5674         * cs-tokenizer.cs (Cleanup): Removed.
5675         
5676         * driver.cs (GetSystemDir): Rewrote to one line command.
5677         It caused problem with unloaded dynamic modules.
5678         (UnixParseOption): Removed Exit.
5679         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
5680         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
5681         Now can be mcs used as library.
5682         
5683         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
5684         empty location.
5685         
5686         * location.cs (Reset): Reset static data.
5687         
5688         * namespace.cs (Reset): Reset static data.
5689         
5690         * report.cs (Report.Reset): Reset static data.
5691         
5692         * rootcontext.cs (RootContext.Reset): Reset static data.
5693         
5694         * tree.cs (RootTypes.ctor): Use Location.Null
5695         
5696         * typemanager.cs (TypeManager.Reset): Reset static data.
5697         (CoreLookupType): Removed Exit.
5698         (TypeHandle.Reset): Reset static data.
5699         
5700 2005-03-10  Raja R Harinath  <rharinath@novell.com>
5701
5702         Fix #73516.
5703         * typemanager.cs (ComputeNamespaces): Import namespaces from
5704         referenced modules too.
5705
5706 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5707
5708         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
5709         than '.'.
5710
5711 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5712
5713         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
5714         enclosing DeclSpace.  This ensures that a name-lookup populates
5715         more caches and there are fewer 'TypeExpression's.  Carve out
5716         nested type lookup into ...
5717         (LookupNestedTypeInHierarchy): ... this.
5718
5719 2005-04-15  Martin Baulig  <martin@ximian.com>
5720
5721         Merged r41590 from MCS and make it work in the generics land.
5722
5723         * generic.cs (TypeParameter.UpdateConstraints): Removed the
5724         `check' argument.
5725
5726         * class.cs (PartialContainer.UpdateConstraints): Removed.
5727         (PartialContainer.CheckConstraints): Removed.
5728         (PartialContainer.SetParameterInfo): Store the constraints here.
5729         (PartialContainer.DefineTypeParameters): New public method;
5730         resolve the type parameter's constraints here.  Note that the
5731         PartialContainer doesn't have an EmitContext anymore, so we must
5732         do this in the ClassPart.
5733
5734 2005-03-09  Raja R Harinath  <rharinath@novell.com>
5735
5736         Clean up a few partial-class semantics.  
5737         Fixes test-357.cs and cs1618-2.cs.
5738         * cs-parser.jay (struct_declaration): Use 'current_class' as
5739         parent of newly-created struct.  Remove call to Register ().
5740         Use 'pop_current_class' to complete handing the current struct.
5741         (interface_declaration): Likewise.
5742         (class_declaration): Likewise.
5743         (enum_declaration): Use 'current_class' as parent of newly created
5744         enum.
5745         (delegate_declaration): Likewise.
5746         (pop_current_class): New function.  This is used to handle closing
5747         up the 'current_class' and 'current_container', and pointing them
5748         to the enclosing class/container.
5749         (CSharpParser): Initialize 'current_class' too.
5750         * decl.cs (MemberCore): Add check for invariant: a partial
5751         container is not a parsed entity, and thus does not enclose any
5752         parsed members.
5753         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
5754         (DeclSpace.BaseTypeExpr): Use it.
5755         (DeclSpace.LookupType): Add check for invariant.
5756         * class.cs (TypeContainer): Add check for invariant: a nested
5757         class should have the same NamespaceEntry as its enclosing class.
5758         (TypeContainer.EmitFieldInitializers): Make virtual.
5759         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
5760         MemberCore.
5761         (TypeContainer.Register): Remove.
5762         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
5763         null.  Use TypeResolveEmitContext for resolving base types and
5764         interfaces.  Move initialization of Parts.TypeBuilder here from
5765         ...
5766         (TypeContainer.DefineNestedTypes): ... here.
5767         (PartialContainer): Take a Namespace not a NamespaceEntry.
5768         (PartialContainer.Create): Don't use Register.  Call the
5769         appropriate Add... function directly.
5770         (ClassPart): Take both the PartialContainer and the enclosing
5771         class as constructor arguments.
5772         (ClassPart.EmitFieldInitializers): Override.
5773         (ClassPart.PartFindNestedTypes): Remove.
5774         (FieldBase.GetInitializerExpression): Resolve the initializer
5775         expression in the emit context of the enclosing class.
5776         * tree.cs (RootTypes): Remove Register ().
5777         
5778 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
5779
5780         * cs-parser.jay: Removed CS0134.
5781         
5782         * driver.cs: Removed CS1901.
5783         
5784         * expression.cs (SizeOf.DoResolve): Don't report CS0233
5785         for predefined types.
5786
5787 2005-03-07  Duncan Mak  <duncan@novell.com>
5788
5789         * codegen.cs (Save):  Catch UnauthorizedAccessException as
5790         well. Fixes bug #73454.
5791
5792 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
5793
5794         * cs-tokenizer.cs (xtoken): Add CS1035.
5795         
5796         * class.cs (MethodData.Define): Add CS0683.
5797         (FieldMember.ctor): Add CS0681.
5798
5799 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5800
5801         * ecore.cs (SimpleName.DoResolve): Rename from
5802         SimpleName.DoResolveAllowStatic.
5803         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
5804         Pass 'intermediate' flag to MemberStaticCheck.
5805         (SimpleName.MemberStaticCheck): Skip "static check" only in case
5806         of "intermediate" lookups via MemberAccess.
5807         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
5808         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
5809
5810 2005-03-07  Raja R Harinath  <rharinath@novell.com>
5811
5812         Fix #73394.
5813         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
5814         slipped in because of variable names that are identical to a
5815         builtin type's BCL equivalent ('string String;', 'int Int32;').
5816         (PropertyExpr.EmitInstance): Likewise.
5817
5818 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
5819
5820         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
5821         
5822         * report.cs (warning_ignore_table): Made public.
5823
5824 2005-03-04  Raja R Harinath  <rharinath@novell.com>
5825
5826         Fix #73282.
5827         * class.cs (MethodData.Emit): Pass 'container' to
5828         container.GetObsoleteAttribute instead of 'container.Parent'.
5829
5830 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
5831
5832         * cs-parser.jay: Add 1534 error test.
5833
5834         * iterators.cs (Yield.CheckContext): Add error 1629.
5835         (Iterator.ctor): Save unsafe modifier.
5836         (MoveNextMethod.DoEmit): Restore unsafe context.
5837
5838         * namespace.cs (UsingAlias): Better error message.
5839
5840 2005-03-03  Dan Winship  <danw@novell.com>
5841
5842         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
5843         the warning message [#73219]
5844
5845 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5846
5847         Fix compile with MCS 1.0.0.0.
5848         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
5849         w_restore to not depend on string constant folding.
5850
5851 2005-03-03  Raja R Harinath  <rharinath@novell.com>
5852
5853         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
5854         CS0246 check to users who passed 'silent = false'.
5855         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
5856         check.
5857         (SimpleName.SimpleNameResolve): Update.
5858         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
5859         (MemberAccess.IdenticalNameAndTypeName): Update.
5860         * doc.cs (FindDocumentedTypeNonArray): Update.
5861
5862 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
5863
5864         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
5865         * parameters.cs (ComputeAndDefineParameters): Remove.
5866         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
5867         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
5868         Use GetParameterInfo.
5869
5870 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
5871
5872         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
5873
5874 2005-03-02  Raja R Harinath  <rharinath@novell.com>
5875
5876         Unify DeclSpace.LookupType and DeclSpace.FindType.
5877         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
5878         is in charge of defining nested types on demand.
5879         (DeclSpace.LookupType): Use it when the current_type is a
5880         TypeBuilder.  Use LookupTypeDirect for reflected types.
5881         (DeclSpace.FindType): Remove.
5882         (DeclSpace.LookupInterfaceOrClass): Likewise.
5883         (DeclSpace.DefineTypeAndParents): Likewise.
5884         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
5885         DeclSpace.LookupType.
5886         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
5887         * typemanager.cs (LookupType): Simplify.
5888         (AddUserType): Remove type from negative_hits.
5889         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
5890         * class.cs (TypeContainer.FindMembers): Move handling of nested
5891         types ...
5892         (TypeContainer.FindMembers_NestedTypes): ... here.
5893         (TypeContainer.FindNestedType): Implement override.
5894         (ClassPart.FindNestedType): Delegate to PartialContainer.
5895         (ClassPart.PartFindNestedType): Looks up the nested types of the
5896         part alone.
5897
5898 2005-04-14  Martin Baulig  <martin@ximian.com>
5899
5900         * generic.cs (ConstructedType): Moved all the type lookup and
5901         nested class logic into SimpleName.
5902         (ConstructedType.ResolveConstructedType): Our underlying type is
5903         already fully resolved; all the type lookup stuff is in
5904         SimpleName.
5905
5906         * ecore.cs (SimpleName.ResolveAsTypeStep): Resolve nested
5907         constructed types here instead of in ConstructedType.
5908
5909         * decl.cs (MemberName.GetTypeExpression): Always create a
5910         SimpleName, not a ConstructedType.
5911         (DeclSpace.ResolveNestedType): Removed; this is now in SimpleName.
5912
5913 2005-03-02  Martin Baulig  <martin@ximian.com>
5914
5915         * class.cs (TypeContainer.DoDefineMembers): We also need a default
5916         static constructor in static classes.
5917
5918 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
5919
5920         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
5921         sizeParamIndex is not specified.
5922
5923 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
5924
5925         Fix #73117
5926         * report.cs (WarningMessage.IsEnabled): Missing null check.
5927
5928 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5929
5930         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
5931         in the fields and not in the properties.
5932
5933 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
5934
5935         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
5936         fields as well.
5937
5938 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5939
5940         * attribute.cs: Small refactoring (improved robustness).
5941         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
5942         (ValidateGuid): Removed.
5943         (Resolve): Removed referenced to above mentioned.
5944         (GetAttributeUsage): Made private and changed to work without
5945         class assistance.
5946         (GetIndexerAttributeValue): Don't crash.
5947         (GetConditionalAttributeValue): Ditto.
5948         (GetClsCompliantAttributeValue): Ditto.
5949         (ExtractSecurityPermissionSet): All attributes exceptions are
5950         error 648.
5951         (GetPropertyValue): New helper.
5952         (GetMethodImplOptions): New method.
5953         (DefinePInvokeMethod): Reuse common code. Implemented handling of
5954         some missing properties.
5955         
5956         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
5957         (Method.ApplyAttributeBuilder): Updated.
5958         
5959         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
5960         exception.
5961
5962 2005-02-28  Raja R Harinath  <rharinath@novell.com>
5963
5964         Fix #73052.
5965         * report.cs (Report.SymbolRelatedToPreviousError): Handle
5966         non-simple types (array, pointer, reference).
5967
5968 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
5969
5970         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
5971
5972         * class.cs (MethodCore.IsDuplicateImplementation): Special error
5973         for operators.
5974         (Method.CheckBase): Catch wrong destructor here.
5975         (MethodData.Define): Add errors 550, 668.
5976
5977         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
5978
5979         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
5980
5981         * pending.cs (VerifyPendingMethods): Add error 551.
5982
5983         * typemanager.cs (CSharpName): Next error report helper.
5984
5985 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
5986
5987         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
5988         attributes. Removed useless attribute double check.
5989         It saves almost 2MBs for corlib.
5990
5991 2005-02-25  Raja R Harinath  <rharinath@novell.com>
5992
5993         Fix #72924.
5994         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5995         called twice in case of error.
5996
5997 2005-02-23  Chris Toshok  <toshok@ximian.com>
5998
5999         Fix compiler portions of #72827.
6000         * statement.cs (Block.Emit): call Begin/EndScope on the
6001         EmitContext instead of the ILGenerator.
6002
6003         * codegen.cs (EmitContext.BeginScope): new method, call
6004         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
6005         we have one.)
6006         (EmitContext.BeginScope): same, but EndScope and CloseScope
6007
6008         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
6009         offset and call the superclass's OpenScope(int) with it.
6010         (SymbolWriter.CloseScope): get the current il
6011         offset and call superclass's CloseScope(int) with it.
6012
6013 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
6014
6015         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
6016         CS1677 for out and ref as well.
6017
6018         * class.cs (Method.Define): Add error CS1599 detection.
6019         
6020         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
6021         
6022         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
6023         
6024         * delegate.cs (Delegate.Define): Add error CS1599 detection.
6025         
6026         * support.cs.cs (ModifierDesc): New helper method.
6027
6028 2005-02-23  Raja R Harinath  <rharinath@novell.com>
6029             Abin Thomas  <projectmonokochi@rediffmail.com>
6030             Anoob V E  <projectmonokochi@rediffmail.com>
6031             Harilal P R  <projectmonokochi@rediffmail.com>
6032
6033         Fix #57851, #72718.
6034         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
6035         MemberLookup (used for error reporting) actually returns a result.
6036         Fix error report number (122, not 112).
6037
6038 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
6039             Anoob V E  <projectmonokochi@rediffmail.com>
6040             Harilal P R  <projectmonokochi@rediffmail.com>
6041
6042         Fix #71134.
6043         * pending.cs (PendingImplementation.GetAbstractMethods):
6044         Find NonPublic members too.
6045
6046 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
6047
6048         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
6049         Fixed error 217.
6050         
6051         * class.cs (MethodCore.CheckMethodAgainstBase):
6052         Add error 239 report.
6053
6054 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6055
6056         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6057         
6058         * class.cs (Operator.Define): Add error 217 report.
6059         
6060 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6061
6062         Fix #68955.
6063         * expression.cs (Invocation.IsApplicable): Make public.
6064         (Invocation.IsParamsMethodApplicable): Likewise.
6065         * delegate.cs (Delegate.VerifyApplicability): Don't use
6066         Invocation.VerifyArgumentCompat for parameter applicability
6067         testing.  Use Invocation.IsApplicable and
6068         Invocation.IsParamsMethodApplicable.
6069
6070 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6071
6072         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
6073         
6074         * class.cs (Operator.Define): Add error 217 report.
6075         
6076 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6077
6078         * namespace.cs (UsingEntry.Resolve): Undo change below.
6079
6080 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6081
6082         Fix #72756.
6083         * ecore.cs (Expression.MemberLookupFailed): Add argument to
6084         disable the error message when the extended MemberLookup also
6085         fails.
6086         (Expression.MemberLookupFinal): Update.
6087         (SimpleName.DoSimpleNameResolve): Update.
6088         * expression.cs (MemberAccess.ResolveNamespaceOrType):
6089         Don't use MemberLookupFinal.
6090         (New.DoResolve): Update.
6091         (BaseAccess.CommonResolve): Update.
6092
6093 2005-02-21  Raja R Harinath  <rharinath@novell.com>
6094
6095         Fix #72732.
6096         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
6097         occured previously, don't resolve again.
6098
6099 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
6100
6101         Fix #69949
6102         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
6103         argument. Call ResolveAttributeUsage for unresolved.
6104         when types doesn't match ctor arguments.
6105         
6106         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
6107         for nested attribute classes.
6108         (Class.attribute_usage): Removed.
6109         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
6110         for attribute class.
6111         
6112         * ecore.cs (IsAttribute): Removed.
6113         
6114         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
6115         
6116         * rootcontext.cs (RegisterAttribute): Removed, attributes are
6117         now normal types.
6118         (attribute_types): Removed.
6119         (EmitCode): Global attributes are emited as the latest.
6120
6121 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
6122
6123         * class.cs (EmitFieldInitializers): Don't emit field initializer
6124         for default values when optimilization is on.
6125         
6126         * constant.cs (Constant.IsDefaultValue): New property.
6127         
6128         * driver.cs: Add /optimize handling.
6129         
6130         * constant.cs,
6131         * ecore.cs,
6132         * literal.cs: Implement new IsDefaultValue property.
6133         
6134         * rootcontext.cs (Optimize): New field, holds /optimize option.
6135
6136 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6137
6138         Fix crasher in re-opened #72347.
6139         * namespace.cs (Namespace.Lookup): Return null if
6140         DeclSpace.DefineType returns null.
6141
6142         Fix #72678.
6143         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
6144
6145 2005-02-18  Raja R Harinath  <rharinath@novell.com>
6146
6147         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
6148         now returns null if it cannot resolve to an lvalue.
6149         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
6150         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
6151         returned null.  Remove check for SimpleName.
6152         (EventExpr.DoResolveLValue): New.
6153         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
6154         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
6155         error from ...
6156         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
6157         avoid CS0131 error.
6158         (Unary.ResolveOperator): Move CS0211 check ...
6159         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
6160         CS0131 error.
6161         (Unary.DoResolveLValue): Simplify.
6162         (AddressOf.DoResolveLValue): New.
6163         (ArrayAccess.DoResolveLValue): New.
6164
6165 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
6166
6167         * attribute.cs (Attribute.Resolve): Add arguments casting for
6168         when types doesn't match ctor arguments.
6169
6170 2005-02-16  Raja R Harinath  <rharinath@novell.com>
6171
6172         Fix parts of #63202.
6173         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
6174         lookup of operator in base type.  Ensure that all checks happen
6175         when the operator resolves to an "op_..." method.
6176
6177 2005-02-15  Raja R Harinath  <rharinath@novell.com>
6178
6179         Fix #71992.
6180         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
6181         'ignore_cs0104' parameter.  Pass it to ...
6182         (NamespaceEntry.Lookup): ... this.
6183         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
6184         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
6185         (TypeLookupExpression.DoResolveAsTypeStep): Update.
6186         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
6187         Update.  Request that cs0104 errors be ignored.
6188         (ComposedCast.ResolveAsTypeStep): Update.
6189
6190 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6191
6192         Fix #59209.
6193         * expression.cs (Invocation.BetterFunction): Remove support for
6194         comparing virtual functions and their overrides.
6195         (Invocation.IsOverride): New.
6196         (Invocation.OverloadResolve): Don't consider 'override' functions
6197         during candidate selection.  Store them in a lookaside list.
6198         If the selected method is a 'virtual' function, use the list to
6199         find any overrides that are closer to the LHS type.
6200
6201 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
6202
6203         * expression.cs (New.DoResolve): Add complex core type reduction.
6204         (New.Constantify): Converts complex core type syntax like 'new int ()'
6205         to simple constant.
6206         
6207 2005-02-14  Raja R Harinath  <rharinath@novell.com>
6208
6209         * decl.cs (EntryType.EntryType): New constructor to create an
6210         updated copy of a cache entry.
6211         (MemberCache.AddMethods): Use it.
6212         (MemberCache.ClearDeclaredOnly): Remove.
6213         (MemberCache.MemberCache): Update.
6214
6215 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6216
6217         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
6218         variable.  This one is represents the actual low-level declaration
6219         of the method, as opposed to the semantic level `IsStatic'.   
6220
6221         An anonymous method which is hosted into a static method might be
6222         actually an instance method.  IsStatic would reflect the
6223         container, while MethodIsStatic represents the actual code
6224         generated.
6225
6226         * expression.cs (ParameterReference): Use the new MethodIsStatic
6227         instead of IsStatic.
6228
6229         * anonymous.cs (AnonymousMethod.Compatible): Pass the
6230         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
6231         set on the current EmitContext. 
6232
6233         * expression.cs (Cast): Overload DoResolveLValue so we can pass
6234         resolve our casted expression as an LValue.  This triggers the
6235         proper LValue processing that is later required by Assign.
6236
6237         This fixes 72347.
6238
6239         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
6240
6241 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
6242
6243         C# 2.0 Fixed buffer implementation
6244
6245         * anonymous.cs: Update after RegisterHelperClass renaming.
6246
6247         * attribute.cs (AttributeTester.fixed_buffer_cache):
6248         Cache of external fixed buffers.
6249         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
6250         implementation if field is fixed buffer else null.
6251
6252         * class.cs
6253         (TypeContainer.AddField): Accept FieldMember instead of Field.
6254         (FieldBase.IsFieldClsCompliant): Extracted code from
6255         VerifyClsCompliance descendant customization.
6256         (FixedField): New class handles fixed buffer fields.
6257         (FixedFieldExternal): Keeps information about imported fixed
6258         buffer.
6259         (IFixedField): Make access to internal or external fixed buffer
6260         same.
6261
6262         * cs-parser.jay: Add fixed buffer parsing.
6263
6264         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
6265         buffer.
6266
6267         * expression.cs (Indirection): Extended implementation to accept
6268         fixed buffer field.
6269         (PointerArithmetic.Emit): Get element from fixed buffer as well.
6270         (ElementAccess.MakePointerAccess): Get type as parameter.
6271         (DoResolve): Add fixed buffer field expression conversion.
6272         (DoResolveLValue): Ditto.
6273         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
6274         (ArrayPtr): Derives from FixedBufferPtr.
6275         (ArrayPtr.Emit): Add extra emit for array elements.
6276
6277         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
6278
6279         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
6280         for compiler generated types.
6281         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
6282
6283         * statement.cs (Fixed): Refactored to be easier add fixed buffer
6284         and consume less memory.
6285         (Fixed.Resolve): Add fixed buffer case.
6286
6287         * typemanager.cs (compiler_generated_attr_ctor,
6288         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
6289         (HasElementType): Add our own implementation to work on every
6290         runtime.
6291
6292 2005-02-11  Miguel de Icaza  <miguel@novell.com>
6293
6294         * anonymous.cs (CaptureContext): Track whether `this' has been
6295         referenced.   
6296
6297         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
6298         only captured `this' if it was implicitly done (instance
6299         methods/variables were used). 
6300
6301         * codegen.cs (EmitContext.CaptureThis): New method to flag that
6302         `this' must be captured.
6303
6304 2005-01-30  Miguel de Icaza  <miguel@novell.com>
6305  
6306         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
6307         is null it means that there has been no need to capture anything,
6308         so we just create a sibling.
6309
6310         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
6311
6312         Just a partial fix.  The other half is fairly elusive.
6313         
6314 2005-02-10  Raja R Harinath  <rharinath@novell.com>
6315
6316         Fix #52586, cs0121-4.cs.
6317         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
6318         and return a hashtable.
6319         (MemberCache.ClearDeclaredOnly): New.
6320         (MemberCache.MemberCache): Update to change.  Make a deep copy of
6321         the method_hash of a base type too.
6322         (MemberCache.AddMethods): Adapt to having a deep copy of the base
6323         type methods.  Overwrite entries with the same MethodHandle so
6324         that the ReflectedType is correct.  The process leaves in base
6325         virtual functions and their overrides as distinct entries.
6326         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
6327         matters since it was boxed in a ArrayList before.
6328         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
6329         modifier.
6330         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
6331         case of a virtual function and its override (choose the overload
6332         as better).
6333         (Invocation.OverloadResolve): Avoid 'override' members during
6334         'applicable_type' calculation.
6335
6336 2005-03-28  Raja R Harinath  <rharinath@novell.com>
6337
6338         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
6339         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
6340         GetTypeHandle.  It is possible for a reflected type to derive from
6341         a TypeBuilder (e.g., int[] derives from the TypeBuilder
6342         System.Array during mscorlib compilation).
6343         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
6344         contain a method_hash, don't create one either.  Don't create a
6345         deep copy of the base cache's method_hash.
6346         (MemberCache.SetupCache): Rename back from DeepCopy.
6347         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
6348         already initialized.  If we see an override function, add its
6349         underlying base virtual function to the member_hash too.
6350
6351 2005-02-09  Raja R Harinath  <rharinath@novell.com>
6352
6353         Combine two near-redundant caches.
6354         * typemanager.cs (method_params): Rename from method_internal_params.
6355         (TypeManager.GetParameterData): New.  Replace
6356         Invocation.GetParameterData.
6357         (TypeManager.LookupParametersByBuilder): Remove.
6358         * expression.cs (Invocation.method_parameter_cache): Remove.
6359         (Invocation.GetParameterData): Remove.
6360         Update to changes.
6361         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
6362         Update to changes.
6363
6364 2005-02-08  Raja R Harinath  <rharinath@novell.com>
6365
6366         Fix #72015.
6367         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
6368         TypeManager.multicast_delegate_type is null, resolve it by looking
6369         up "System.MulticastDelegate".
6370         * rootcontext.cs (RootContext.ResolveCore): Simplify.
6371
6372 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
6373             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
6374             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
6375
6376         Fix cs0164.cs.
6377         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
6378         (LabeledStatement.AddReference): New.  Set 'referenced'.
6379         (Goto.Resolve): Use it.
6380
6381 2005-02-05  John Luke  <john.luke@gmail.com>
6382
6383         * driver.cs: remove duplicate -doc line in Usage ()
6384
6385 2005-02-04  Raja R Harinath  <rharinath@novell.com>
6386
6387         * location.cs (Location.AddFile): Fix CS2002 error report.
6388
6389 2005-02-02  Martin Baulig  <martin@ximian.com>
6390
6391         * delegate.cs (Delegate.DefineType): Report an internal error if
6392         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6393         details.        
6394
6395 2005-02-02  Raja R Harinath  <rharinath@novell.com>
6396
6397         Fix a crasher in a variant of #31984.
6398         * const.cs (Constant.CheckBase): New override that defers the
6399         new-or-override check in case the base type hasn't been populated
6400         yet.
6401         (Constant.Define): Ensure the new-or-override check is performed.
6402
6403 2005-02-01  Duncan Mak  <duncan@ximian.com>
6404
6405         * const.cs (LookupConstantValue): Check that `ce' is not null
6406         before calling GetValue ().
6407
6408 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6409
6410         Fix test-334.cs (#69519).
6411         * cs-parser.jay (using_alias_directive): Pass in an expression to
6412         NamespaceEntry.UsingAlias.
6413         (using_namespace_directive): Pass in an expression to
6414         NamespaceEntry.Using.
6415         (namespace_name): Don't flatten to a string.
6416         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
6417         (NamespaceEntry.AliasEntry.Resolve): Lookup using
6418         ResolveAsTypeStep.
6419         (NamespaceEntry.UsingEntry): Likewise.
6420         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
6421         changes.
6422         (NamespaceEntry.LookupForUsing): Remove.
6423         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
6424         names.
6425         (NamespaceEntry.Lookup): Remove support for dotted names.
6426
6427 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6428
6429         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
6430         split into two.
6431         (NamespaceEntry.ImplicitParent): Compute on demand.
6432         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
6433         parallels the current.
6434         (NamespaceEntry.LookupForUsing): Use it.
6435         (NamespaceEntry.Lookup): If the current namespace-entry is
6436         implicit, don't search aliases and using tables.
6437
6438 2005-02-01  Raja R Harinath  <rharinath@novell.com>
6439
6440         Fix #31984.
6441         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
6442         BaseCache here.
6443         (TypeContainer.BaseCache): Compute on demand.
6444         (TypeContainer.FindMembers): Define constants and types if they're
6445         not already created.
6446         (FieldMember.Define): Move resetting of ec.InUnsafe before error
6447         check.
6448         * const.cs (Constant.Define): Make idempotent.
6449
6450 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6451
6452         * pending.cs: Produce better code (no nops produced by using Ldarg
6453         + value).
6454         
6455         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6456         i - 1' it should be arg + 1.
6457
6458         Fixes bug #71819.
6459
6460 2005-01-28  Raja R Harinath  <rharinath@novell.com>
6461
6462         * attribute.cs (Attribute.CheckAttributeType): Make private
6463         non-virtual.
6464         (Attribute.ResolveType): Make virtual.
6465         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
6466         handling of RootContext.Tree.Types.
6467
6468 2005-01-27  Raja R Harinath  <rharinath@novell.com>
6469
6470         Update attribute-handling to use the SimpleName/MemberAccess
6471         mechanisms.
6472         * cs-parser.jay (attribute): Pass in an expression to the
6473         constructors of Attribute and GlobalAttribute.
6474         * attribute.cs (Attribute): Take an expression for the name.
6475         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
6476         passed in attribute name expression.
6477         (Attribute.CheckAttributeType): Use it.
6478         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
6479         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
6480         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
6481         argument to prevent error messages if the lookup fails.
6482
6483 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
6484
6485         * expression.cs (Indirection): Implemented IVariable interface
6486         to support indirection in AddressOf operator.
6487         (PointerArithmetic.Emit): Add optimalization for case where
6488         result can be precomputed.
6489
6490 2005-01-26  Martin Baulig  <martin@ximian.com>
6491
6492         * class.cs (TypeContainer.AttributeTargets): Return the correct
6493         AttributeTargets depending on our `Kind' instead of throwing an
6494         exception; fixes #71632.
6495
6496 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
6497
6498         Fix #71257
6499         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
6500         constant members.
6501
6502 2005-03-17  Martin Baulig  <martin@ximian.com>
6503
6504         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
6505         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
6506
6507 2005-03-17  Martin Baulig  <martin@ximian.com>
6508
6509         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
6510         to bool so we can return an error condition.
6511         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
6512         returned an error.
6513
6514 2005-03-17  Martin Baulig  <martin@ximian.com>
6515
6516         * generic.cs (TypeMananager.IsIEnumerable): New public method.
6517
6518         * convert.cs (Convert.ImplicitReferenceConversion(Exists)): Allow
6519         converting from an array-type of T to `IEnumerable<T>'.
6520
6521 2005-03-16  Martin Baulig  <martin@ximian.com>
6522
6523         * generic.cs (Nullable.Unwrap): Implement IAssignMethod.
6524         (Nullable.LiftedUnaryMutator): New public class.
6525
6526         * expression.cs (UnaryMutator.DoResolve): Added support for
6527         Nullable Types.
6528
6529 2005-03-14  Martin Baulig  <martin@ximian.com>
6530
6531         * generic.cs (Nullable.NullCoalescingOperator): Implemented.
6532
6533 2005-03-14  Martin Baulig  <martin@ximian.com>
6534
6535         * generic.cs (Nullable.LiftedBinaryOperator): Added support for
6536         the comparision operators `<', `>', `<=' and `>='.
6537
6538 2005-03-13  Martin Baulig  <martin@ximian.com>
6539
6540         * generic.cs
6541         (Nullable.NullLiteral): Renamed to `Nullable.NullableLiteral' to
6542         avoid confusion with the `NullLiteral'.
6543         (Nullable.LiftedBinaryOperator): Correctly implement `==' and '!='.
6544
6545 2005-03-13  Martin Baulig  <martin@ximian.com>
6546
6547         * expression.cs (Binary.ResolveOperator): For `==' and `!=', allow
6548         comparing arbitrary types with the null literal.
6549
6550 2005-03-13  Martin Baulig  <martin@ximian.com>
6551
6552         * generic.cs (Nullable.LiftedBinaryOperator): Add support for the
6553         boolean operators '&&', '||', '&' and '|'.
6554         (Nullable.OperatorTrueOrFalse): New public class.
6555
6556         * ecore.cs (Expression.GetOperatorTrue/False): Return an `Expression'
6557         instead of a `StaticCallExpr'; added support for nullables.
6558
6559 2005-03-10  Martin Baulig  <martin@ximian.com>
6560
6561         * expression.cs
6562         (ArrayAccess.EmitDynamicInitializers): Use `etype.IsValueType'
6563         rather than `etype.IsSubclassOf (TypeManager.value_type)'.      
6564
6565 2005-03-07  Martin Baulig  <martin@ximian.com>
6566
6567         * generic.cs (Nullable.Unwrap): Implement IMemoryLocation and make
6568         it work if `expr' is not an IMemoryLocation.
6569         (Nullable.Lifted): Implement IMemoryLocation.
6570         (Nullable.LiftedConversion.ResolveUnderlying): Use the correct
6571         target type.
6572
6573 2005-03-05  Martin Baulig  <martin@ximian.com>
6574
6575         * generic.cs (Nullable.Unwrap, Wrap): New protected classes.
6576         (Nullable.Lifted): New abstract class; rewrote the lifted conversions.
6577         (Nullable): Added support for lifted unary and binary operators.
6578
6579         * expression.cs (Unary.DoResolve): Added support for nullable types.
6580         (Binary.DoResolve): Likewise.
6581         (Conditional.DoResolve): Likewise.
6582
6583 2005-03-02  Martin Baulig  <martin@ximian.com>
6584
6585         * decl.cs (DeclSpace.SetParameterInfo): Make this virtual.
6586
6587         * class.cs (ClassPart.SetParameterInfo): Override this.
6588         (PartialContainer.SetParameterInfo): Override this.
6589         (TypeContainer.CheckConstraints): New protected method.
6590         (PartialContainer.CheckConstraints): Override this and check
6591         whether the same contraints were specified in all parts of a
6592         partial generic type definition.
6593         (PartialContainer.UpdateConstraints): New public method.
6594
6595         * generic.cs (TypeParameter.UpdateConstraints): New public method.
6596
6597 2005-03-02  Martin Baulig  <martin@ximian.com>
6598
6599         Committing a patch from Carlos Alberto Cortez to fix #72887.
6600
6601         * convert.cs (Convert.ExplicitReferenceConversionExists): Allow
6602         casts from `T []' to `int []'.
6603
6604 2005-03-02  Martin Baulig  <martin@ximian.com>
6605
6606         * generic.cs (TypeManager.IsEqual): Make this symmetric.
6607
6608         * expression.cs (Binary.ResolveOperator): When resolving a
6609         BinaryDelegate, use `TypeManager.IsEqual (l, r)' rather than just
6610         `=='.  Fixes #71866.  See gen-127.cs.
6611
6612 2005-03-02  Martin Baulig  <martin@ximian.com>
6613
6614         * class.cs (TypeContainer.DoDefineMembers): We also need a default
6615         static constructor in static classes.
6616
6617 2005-03-02  Martin Baulig  <martin@ximian.com>
6618
6619         * generic.cs
6620         (NullableType.Name, NullableType.FullName): Add a "?" to the name.
6621         (Nullable.LiftedConversion): Added support for user-defined
6622         conversions.
6623
6624         * cs-tokenizer.cs (Tokenizer.PutbackCloseParens): New public method.
6625
6626         * cs-parser.jay: Use ComposedCast everywhere instead of
6627         NullableType, so we don't need to check for NullableType
6628         everywhere.
6629         (conditional_expression): Added `INTERR CLOSE_PARENS' rule for the
6630         case where we'll be resolved into a `parenthesized_expression_0'
6631         afterwards.
6632
6633         * convert.cs
6634         (Convert.UserDefinedConversion): Added nullable conversions.
6635
6636 2005-02-28  Martin Baulig  <martin@ximian.com>
6637
6638         * generic.cs (TypeManager.IsNullableType): New static method.
6639         (Nullable): New abstract class.
6640         (Nullable.NullLiteral): New public class.
6641         (Nullable.LiftedConversion): New public class.
6642
6643         * cs-parser.jay (non_expression_type): Changed `builtin_types' to
6644         `builtin_types opt_nullable'.
6645
6646         * convert.cs
6647         (Convert.ImplicitConversionStandard): Added nullable conversions.
6648         (Convert.ExplicitConversionStandard): Likewise.
6649         (Convert.ExplicitConversion): Likewise.
6650
6651 2005-02-26  Martin Baulig  <martin@ximian.com>
6652
6653         * expression.cs (ComposedCast.DoResolveAsTypeStep): Allow `dim' to
6654         begin with a "?", for instance "?[]".  Don't do a type lookup if
6655         `dim' is empty.
6656
6657 2005-02-25  Martin Baulig  <martin@ximian.com>
6658
6659         The first part of Nullable Types :-)
6660
6661         * generic.cs (NullableType): New public class.
6662         (NullCoalescingOperator): New public class.
6663         (TypeArguments.Resolve): Add a CS0306 check.
6664
6665         * cs-parser.jay (opt_error_modifier): Removed, this was unused.
6666         (opt_nullable): New rule.
6667         (type): Added `opt_nullable' to `namespace_or_type_name',
6668         `builtin_types' and `pointer_type'.
6669         (array_type): Added `opt_nullable'.
6670         (opt_rank_specifier_or_nullable): New rule; this is the
6671         combination of `opt_rank_specifier' and `opt_nullable'.
6672         (opt_error): New rule; catch errors here.
6673         (nullable_type_or_conditional): New rule; we use this to check for
6674         nullable and still detect the conditional operator.
6675         (local_variable_type): Use `opt_rank_specifier_or_nullable'
6676         instead `opt_rank_specifier'.
6677
6678         * expression.cs (ComposedCast.DoResolveAsTypeStep): Added support
6679         for nullables.
6680
6681 2005-02-24  Martin Baulig  <martin@ximian.com>
6682
6683         * README, README.Changes: Removed; they're old and obsolete.
6684
6685 2005-02-22  Martin Baulig  <martin@ximian.com>
6686
6687         * generic.cs (TypeParameter.Resolve): If resolving the constraints
6688         returned an error, set `constraints' to null to avoid a crash
6689         later on.
6690         (TypeParameter.ResolveType): Likewise.
6691
6692 2005-02-22  Martin Baulig  <martin@ximian.com>
6693
6694         * generic.cs
6695         (Constraints.ResolveTypes): Protect against being called twice.
6696         (Constraints.CheckInterfaceMethod): Don't call ResolveTypes().
6697         (TypeParameter.ResolveType): New public method; calls
6698         constraints.ResolveTypes().
6699         (TypeParameter.DefineType): Moved constraints.ResolveType() out
6700         into the new ResolveType().
6701         (GenericMethod.Define): Call ResolveType() on all our
6702         TypeParameter's.        
6703
6704 2005-02-21  Martin Baulig  <martin@ximian.com>
6705
6706         * generic.cs
6707         (TypeManager.generic_nullable_type): New static public field.
6708         (TypeManager.InitGenericCoreType): Lookup "System.Nullable`1".
6709
6710         * rootcontext.cs
6711         (RootContext.ResolveCore): Resolve "System.Nullable`1".
6712
6713 2005-02-15  Martin Baulig  <martin@ximian.com>
6714
6715         * generic.cs (ConstructedType.Constraints): Correctly check
6716         constraints if the argument type is a type parameter; fixes
6717         #72326. 
6718
6719 2005-02-02  Martin Baulig  <martin@ximian.com>
6720
6721         * delegate.cs (Delegate.DefineType): Report an internal error if
6722         TypeManager.multicast_delegate_type is null.  See bug #72015 for
6723         details.        
6724
6725 2005-01-29  Miguel de Icaza  <miguel@novell.com>
6726
6727         * pending.cs: Produce better code (no nops produced by using Ldarg
6728         + value).
6729         
6730         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
6731         i - 1' it should be arg + 1.
6732
6733         Fixes bug #71819.
6734         
6735 2005-01-26  Martin Baulig  <martin@ximian.com>
6736
6737         * cs-parser.jay (indexer_declarator): Don't report an error if we
6738         have type parameters since we can be an explicit interface
6739         implementation; fixes #71449.
6740
6741 2005-01-26  Martin Baulig  <martin@ximian.com>
6742
6743         * class.cs (TypeContainer.AttributeTargets): Return the correct
6744         AttributeTargets depending on our `Kind' instead of throwing an
6745         exception; fixes #71632.
6746
6747 2005-01-26  Martin Baulig  <martin@ximian.com>
6748
6749         * delegate.cs (Delegate.DefineType): Correctly define our type
6750         parameters.  Fixes #71483.
6751
6752 2005-01-25  Raja R Harinath  <rharinath@novell.com>
6753
6754         Fix #71602.
6755         * expression.cs (MemberAccess.DoResolve): Don't complain with
6756         cs0572 when the LHS of a member access has identical name and type
6757         name.
6758
6759 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
6760
6761         Fix #71651, #71675
6762         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
6763         CreatePermission.
6764         Create custom PermissionSet only for PermissionSetAttribute.
6765
6766 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
6767
6768         Fix #71649
6769         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
6770         delegates in static class.
6771
6772 2005-01-24  Martin Baulig  <martin@ximian.com>
6773
6774         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
6775         merging an implicit block, just use its reachability.
6776
6777         * statement.cs (Block.Resolve): Make the unreachable code check
6778         work wrt. implicit blocks; see test-337 from #63842.
6779
6780 2005-01-21  Alp Toker  <alp@atoker.com>
6781  
6782         * cs-parser.jay: destructor_declaration's container is PartialContainer
6783         not Class when partial types are used, so use Kind prop instead of
6784         'is'.
6785         
6786 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
6787
6788         * cs-parser.jay: Improve error reporting when an interface
6789         declares new types.
6790
6791 2005-01-20  Dick Porter  <dick@ximian.com>
6792
6793         * support.cs: SeekableStreamReader fix from Sandor Dobos
6794         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
6795         chars are read.  Fixes bug 70369.
6796
6797 2005-01-20  Raja R Harinath  <rharinath@novell.com>
6798
6799         * cs-parser.jay (catch_clause): Simplify current_block handling
6800         somewhat.
6801
6802 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
6803
6804         * convert.cs (ImplicitStandardConversionExists): Synchronize the
6805         code with ImplicitStandardConversion to handle the implicit
6806         conversion of method groups into valid delegate invocations. 
6807
6808         The problem is that in parameter handling we were using this code
6809         path.  Fixes bug #64698
6810
6811 2005-01-19  Raja R Harinath  <rharinath@novell.com>
6812
6813         * cs-parser.jay: Fix several infelicities.
6814         - Avoid assigning to the parser value stack.  Code like 
6815           '$3 = null' is unclean.  Synthesize a value for the code block
6816           instead. 
6817         - Avoid using oob_stack for storing location information.  Use ...
6818         (_mark_): ... this.  New (empty) rule.  Saves the current location
6819         in $$.
6820         (foreach_statement): Avoid using oob_stack for current_block
6821         handling.  Use technique used in for_statement and
6822         using_statement.  Synthesize a value for the code block to store
6823         additional intermediate information.
6824
6825 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
6826
6827         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
6828         of a different type is only allowed to private fields of a
6829         containing type, not on fields of a base class.
6830
6831         See test-174.cs and error cs0122-9.cs
6832
6833 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6834
6835         Fix test-335.cs (bug #58126).
6836         * cs-parser.jay (argument): Split out non-expression parts of the
6837         rule into 'non_simple_argument'.
6838         (invocation_expression): Support parenthesized invocations with
6839         multiple arguments, and with single non-simple arguments.
6840
6841 2005-01-13  Raja R Harinath  <rharinath@novell.com>
6842
6843         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
6844         places.
6845
6846 2005-01-12  Raja R Harinath  <rharinath@novell.com>
6847
6848         Fix cs0038-1.cs, cs1640-6.cs.
6849         * ecore.cs (Expression.Resolve): Remove special-case for
6850         SimpleName in error-handling.
6851         (Expression.almostMatchedMembers): Relax access permission to
6852         protected.
6853         (Expression.MemberLookupFailed): Handle duplicates in
6854         almostMatchedMembers list.
6855         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
6856         * expression.cs (New.DoResolve): Report CS1540 for more cases.
6857         * typemanager.cs (GetFullNameSignature): Use the MethodBase
6858         overload if the passed in MemberInfo is a MethodBase.
6859
6860 2005-01-25  Martin Baulig  <martin@ximian.com>
6861
6862         * doc.cs
6863         (DocUtil.emptyParamList): Removed; use `Type.EmptyTypes' instead.
6864
6865 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
6866
6867         Fix #70749
6868         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
6869         for non-CAS & merge permission sets properly.
6870
6871 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6872
6873         Improve standard-compliance of simple name and member access 
6874         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
6875         * ecore.cs (FullNamedExpression): New abstract base class 
6876         for Namespaces and TypeExpressions.
6877         (ResolveFlags.SimpleName): Remove.
6878         (SimpleName): Remove support for dotted names.
6879         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
6880         DeclSpace.FindType and DeclSpace.LookupType.
6881         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
6882         (Expression.ExprClassName): Make member function.
6883         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
6884         a namespace.  Remove creation of dotted "SimpleName"s.
6885         (MemberAccess.DoResolve): Likewise.
6886         * decl.cs (DeclSpace.Cache): Make private.
6887         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
6888         (DeclSpace.FindType): Update.
6889         (DeclSpace.LookupType): Move here from RootContext.  Return a 
6890         FullNamedExpression.
6891         * namespace.cs (Namespace): Derive from FullNamedExpression
6892         so that it can be part of expression resolution.
6893         (Namespace.Lookup): Return an FullNamedExpression.
6894         (NamespaceEntry.LookupAlias): Lookup aliases only in current
6895         namespace.
6896         * rootcontext.cs (NamespaceLookup): Remove.
6897         (LookupType): Move to DeclSpace.
6898         * attribute.cs (CheckAttributeType): Update.
6899         * doc.cs (FindDocumentedType): Remove allowAlias argument.
6900         (FindDocumentedTypeNonArray): Likewise.
6901
6902 2005-01-11  Raja R Harinath  <rharinath@novell.com>
6903
6904         Fix cs0509.cs, cs1632.cs.
6905         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
6906         is the same as IsInterface.
6907         (TypeContainer.GetClassBases): Likewise.
6908         * statement.cs (LabeledStatement.ig): New field.
6909         (LabeledStatement.LabelTarget): Save ILGenerator which created the
6910         label.
6911         (LabeledStatement.DoEmit): Check that the label was created with
6912         the same ILGenerator.
6913
6914 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6915
6916         Fix #71058
6917         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
6918         accessors to its properties.
6919
6920         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
6921         from accessors to property.
6922         
6923 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
6924
6925         Fix #70722
6926         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
6927         only for overrides.
6928         
6929 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
6930
6931         * attribute.cs: Check for null and empty strings.  
6932
6933         I have lost another battle to Paolo.
6934
6935 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
6936
6937         Fix #70942
6938         * class.cs (PropertyMethod): Set Parent field in ctors.
6939         (SetMethod.InternalParameters): Add unsafe switch hack.
6940         Override MarkForDuplicationCheck where it is appropriate.
6941
6942         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
6943         It says whether container allows members with the same name.
6944         Base default is no.
6945         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
6946         Removed is_method parameter.
6947
6948 2005-01-06  Duncan Mak  <duncan@ximian.com>
6949
6950         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
6951         because the previous change led to incorrect reporting of CS1032
6952         ("Cannot define/undefine preprocessor symbols after first token in
6953         file"). Instead of using `tokens_seen' as the only flag that
6954         triggers CS1040, introduce `comments_seen'. This new flag is used
6955         to signify having seen comments on the current line, so it is
6956         unset after a newline.
6957
6958 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6959
6960         * doc.cs : When searching for a type, find nested type too.
6961           This fixes bug #71040.
6962
6963 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
6964
6965         * doc.cs :
6966           - Warn missing member comment on those classes which also does not
6967             have doc comments. Fixed bug #71041.
6968           - Don't warn missing doc comment on default constructor.
6969             Fixed bug #71042.
6970
6971 2005-01-06  Duncan Mak  <duncan@ximian.com>
6972
6973         * cs-tokenizer.cs (xtoken): After handling traditional C-style
6974         comments, set `tokens_seen' to true. This allows us to detect
6975         misplaced preprocessor directives (i.e. not at the beginning of
6976         the a line, nor after whitespaces). In that case, report error
6977         CS1040. This fixes bug #56460.
6978
6979         * cs-parser.jay (interface_member_declaration): Add checks for
6980         IsExplicitImpl, and report CS0541 error if an interface member is
6981         defined as an explicit interface declaration.
6982
6983 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
6984
6985         Fix #70817
6986         * class.cs (PropertyMethod): Set Parent field in ctors.
6987         (SetMethod.InternalParameters): Add unsafe switch hack.
6988         
6989         * decl.cs (MemberCore.Parent): Cannot be readonly.
6990
6991 2005-01-06  Raja R Harinath  <rharinath@novell.com>
6992
6993         * decl.cs (DeclSpace.ResolveType): Remove.
6994         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
6995         Merge in code from ...
6996         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
6997         * class.cs, enum.cs: Update to changes.
6998
6999 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
7000
7001         * anonymous.cs: Ensure that we init the scope of our parent if it
7002         has not been initialized yet.
7003
7004 2004-12-30  Duncan Mak  <duncan@ximian.com>
7005
7006         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
7007         if field.FieldBuilder is null. Fixes #70758.
7008
7009         * convert.cs: Fixed some typos and updated some of the comments.
7010         (ImplicitStandardConversionExists):
7011         (TryImplicitIntConversion): If `target_type' is an interface and
7012         the type of `ic' implements this interface, return true or a new
7013         BoxedCast instead of null. This fixes #70468.
7014
7015 2004-12-29  Duncan Mak  <duncan@ximian.com>
7016
7017         * expression.cs (Argument.Emit): Check that Expr is
7018         IMemoryLocation before casting to it, and report CS1510 otherwise.
7019
7020         This fixes #70402.
7021
7022 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
7023
7024         * statement.cs (Block.ThisVariable): remove the recursion here, to
7025         make the --profile more sane.
7026
7027 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
7028
7029         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
7030         assembly, by JB Evain.
7031
7032 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7033
7034         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
7035           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
7036         "parent" refers to enclosing type/class.  "base" refers to superclass.
7037
7038 2004-12-17  Raja R Harinath  <rharinath@novell.com>
7039
7040         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7041         Ensure that we only have GlobalAttributes.
7042         * attribute.cs (Attribute.Emit): Make non-virtual.
7043         (GlobalAttribute.Emit): Remove.
7044         (Attribute.Resolve): Make virtual.
7045         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
7046         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
7047         the argument. Don't create one.
7048         (Attribute.GetObsoleteAttribute): Likewise.
7049         (Attribute.GetClsCompliantAttributeValue): Likewise.
7050         * class.cs, decl.cs: Update to changes.
7051
7052 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
7053
7054         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
7055         
7056         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
7057         
7058         * statement.cs (Foreach.Resolve): Add error 186 report.
7059
7060 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
7061
7062         * expression.cs (Conditional.DoResolve): Add warning 429.
7063         
7064         * statement.cs (If.Resolve): Add warning 665.
7065
7066 2004-12-16  Raja R Harinath  <rharinath@novell.com>
7067
7068         New invariant: RootContext.Tree.Types.NamespaceEntry == null
7069         except when in the parser, and in GlobalAttribute.
7070         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
7071         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
7072         RootContext.Tree.Types.NamespaceEntry once work is done.
7073         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
7074         and resets RootContext.Tree.Types.NamespaceEntry.
7075
7076 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
7077
7078         * cs-parser.jay: Don't create a block for every variable.
7079
7080 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
7081
7082         * location.cs: Provide extra information.
7083
7084         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
7085         variables from the captured environment, it is the ldarg_0.
7086
7087 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7088
7089         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
7090         find a conclusion.
7091         
7092         * class.cs: Changed warning level for 169 to avoid developer
7093         displeasure from warning flooding. It will be changed back when they
7094         fix most of current BCL warnings.
7095         
7096         * RootContext.cs: Pushed default WarningLevel to 3.
7097         
7098         * statement.cs: Removed unused variable.
7099
7100 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
7101
7102         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
7103         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
7104         Add error 502 report.
7105         (StaticClass.DefineType): Add error 441 report.
7106         (Class.AllowedModifiersProp): New virtual property as temporary
7107         extension to AllowedModifiers.
7108         (Class.DefineType): Add error 418 report. Moved ModFlags check here
7109         to share implementation with StaticClass and don't call virtual
7110         methods from ctor.
7111         
7112         * driver.cs (MainDriver): Add error 1558 test.
7113
7114         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
7115         report. Moved error 36 test here.
7116
7117         * statement.cs (Throw.Resolve): Add error 724 report.
7118
7119         * typemanager.cs: Add out_attribute_type core type.
7120         
7121 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
7122
7123         * class.cs (TypeContainer.VerifyClsCompliance): Add error
7124         3018 report.
7125         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
7126
7127         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
7128         3017 report.
7129         
7130         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
7131
7132         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
7133         Add error 3023 report.
7134         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
7135
7136         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
7137         implementation.
7138
7139 2004-12-12  John Luke  <john.luke@gmail.com>
7140
7141         * driver.cs (AddArgs): take -- into account when
7142         adding arguments, fixes bug 65710 
7143
7144 2004-12-12  Martin Baulig  <martin@ximian.com>
7145
7146         * expression.cs (Unary.TryReduceNegative): Added support for
7147         SByteConstant and ByteConstant.
7148         (Unary.Reduce): Check error values from TryReduceNegative().
7149
7150 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
7151
7152         * attributes.cs (Attribute.Resolve): Avoid multiple error report
7153         and report exception as error 182.
7154
7155 2004-12-10  Raja R Harinath  <rharinath@novell.com>
7156
7157         * driver.cs (Main): Fix message when there are warnings.
7158
7159 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
7160
7161         * delegate.cs: Fixed my fix from yesterday, sorry about that.
7162
7163 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
7164
7165         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
7166         Reduced number of warnings.
7167         
7168         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
7169
7170 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
7171
7172         * driver.cs: Removed message.
7173
7174         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
7175
7176 2004-12-08    <vargaz@freemail.hu>
7177
7178         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
7179
7180 2004-12-08  Martin Baulig  <martin@ximian.com>
7181
7182         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7183         instead of a CS3002 for properties and indexer.
7184
7185 2004-12-08  Martin Baulig  <martin@ximian.com>
7186
7187         * decl.cs (MemberName.ToString): Make this work again.
7188
7189 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
7190
7191         * attribute.cs (Resolve): Add error 591 detection.
7192
7193         * class.cs (FieldMember.Define): Add error 1547 detection.
7194         (Indexer.Define): Add error 620 detection.
7195         (Operator.Define): Add error 590 detection.
7196
7197         * ecore.cs: Missing argument for error 79.
7198
7199         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
7200         detection.
7201
7202 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
7203
7204         Fix #70106
7205         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
7206         only.
7207
7208 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7209
7210         * cs-parser.jay : handle doc comments on implicit/explicit operators.
7211           Some operator comments were suppressed.
7212         * doc.cs : Implicit/explicit operator name in doc comments are like
7213           "op_Explicit(type)~returnType", so added suffix handling.
7214
7215 2005-01-21  Alp Toker  <alp@atoker.com>
7216
7217         * cs-parser.jay: destructor_declaration's container is PartialContainer
7218         not Class when partial types are used, so use Kind prop instead of 'is'.
7219
7220 2004-12-12  Martin Baulig  <martin@ximian.com>
7221
7222         * expression.cs (Unary.TryReduceNegative): Added support for
7223         SByteConstant and ByteConstant.
7224         (Unary.Reduce): Check error values from TryReduceNegative().
7225
7226 2004-12-11  Martin Baulig  <martin@ximian.com>
7227
7228         * support.cs (ReflectionParameters.ParameterName): If we have a
7229         `gpd', call `ParameterName' on it.
7230
7231         * parameter.cs (Parameter.GetParameterAttributes): New static method.
7232
7233         * pending.cs (PendingImplementation.DefineProxy): Call
7234         DefineParameter() for all of the MethodBuilder's arguments.
7235
7236 2004-12-09  Martin Baulig  <martin@ximian.com>
7237
7238         * doc.cs (DocUtil): Make this a static class.
7239
7240 2004-12-09  Martin Baulig  <martin@ximian.com>
7241
7242         * expression.cs (Invocation.InferType): Moved the type inference
7243         implementation into TypeManager.
7244
7245         * generics.cs (TypeManager): Moved the type inference
7246         implementation here.
7247
7248 2004-12-09  Martin Baulig  <martin@ximian.com>
7249
7250         * typemanager.cs (TypeManager): Make this a partial class.
7251
7252         * generics.cs
7253         (TypeManager): Move the generics part of `TypeManager' here.
7254
7255 2004-12-08  Martin Baulig  <martin@ximian.com>
7256
7257         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
7258         instead of a CS3002 for properties and indexer.  Added CS3024
7259         check for generic interfaces.
7260
7261         * attributes.cs (AttributeTester.AnalyzeTypeCompliance): Generic
7262         instances are not CLS-compliant.
7263
7264 2004-12-08  Martin Baulig  <martin@ximian.com>
7265
7266         * cs-parser.jay
7267         (void_pointer_expression): New rule for `void*', `void**' etc.
7268         (typeof_expression): Add `void_pointer_expression'; fixes #66846.       
7269
7270 2004-12-08  Martin Baulig  <martin@ximian.com>
7271
7272         * expression.cs (Invocation.InferType): Removed the hack for
7273         MethodCore.MayUnify().  
7274
7275         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Make
7276         this actually work.
7277
7278         * class.cs (MethodCore.MayUnify): Use
7279         TypeManager.MayBecomeEqualGenericTypes().       
7280
7281 2004-12-08  Martin Baulig  <martin@ximian.com>
7282
7283         * expression.cs (Is.DoResolve, As.DoResolve): If we're a type
7284         parameter, box it.  Fixes #69233.
7285
7286 2004-12-08  Martin Baulig  <martin@ximian.com>
7287
7288         * generic.cs (ConstructedType.CheckConstraints): Valuetypes always
7289         have the ctor constraint.  Fixes #68326.
7290
7291 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
7292
7293         * cs-parser.jay : interface comment was not consumed because of
7294           extra opt_semicolon before doc handling.
7295
7296 2004-12-03  Raja R Harinath  <rharinath@novell.com>
7297
7298         Fix test-327.cs, test-328.cs, and put in early infrastructure
7299         for eventually fixing #52697.
7300         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
7301         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
7302         from other methods.
7303         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
7304         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
7305         (VerifyUsing, error246): Update.
7306         * rootcontext.cs (RootContext.NamespaceLookup): Just use
7307         'NamespaceEntry.LookupNamespaceOrType'.
7308
7309 2004-12-07  Martin Baulig  <martin@ximian.com>
7310
7311         * driver.cs: Call it "BETA SOFTWARE" :-)
7312
7313 2004-12-06  Raja R Harinath  <rharinath@novell.com>
7314
7315         Fix crash on cs0657-17.cs.
7316         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
7317         Use RootContext.Tree.Types, not 'new RootTypes ()'.
7318         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
7319         the case where the NamespaceEntry gets overwritten.
7320
7321 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
7322
7323         Fixed #69195, #56821
7324         * ecore.cs (ResolveBoolean): Tiny refactoring.
7325
7326         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
7327         of right expression resolving when left is false constant and
7328         operator is LogicalAnd OR true constant and operator is LogicalOr.
7329
7330         * statement.cs (ResolveUnreachable): Always reports warning.
7331
7332 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
7333
7334         * class.cs: Distinguish between 1721 and 1722 (just a little help
7335         for the programmer).
7336
7337 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
7338
7339         * delegate.cs: Only allow this on new versions of the language. 
7340
7341 2004-12-02  Duncan Mak  <duncan@ximian.com>
7342
7343         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
7344         Expression class.
7345         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
7346         here as a static method. Take an additional bool out parameter
7347         `must_do_cs1540_check' for signaling to InstanceResolve.
7348         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
7349         member field from PropertyExpr class and made it an argument of
7350         the method instead.
7351         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
7352         check for MarshalByRefObject, and report CS0122 instead of CS1540.
7353         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
7354         and `remove_accessor' as well as InstanceResolve: report CS0122
7355         where applicable.
7356
7357         Fixes #70129.
7358
7359 2004-12-07  Martin Baulig  <martin@ximian.com>
7360
7361         * decl.cs (DeclSpace.AddToContainer): Report correct errors CS0694
7362         and CS0692 where appropriate.
7363
7364 2004-12-06  Martin Baulig  <martin@ximian.com>
7365
7366         * class.cs (MethodCore.MayUnify): Moved the CS0408 check here from
7367         IsDuplicateImplementation() and improved it.
7368
7369         * expression.cs (Invocation.InferTypeArguments): Added
7370         `Type[] inferred_class_types' argument (for MethodCore.MayUnify)
7371         and removed the "ref" modifier from `infered_types'.
7372
7373         * decl.cs (MemberName.ToString): Removed the exception.
7374
7375 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
7376
7377         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
7378           comments are allowed.
7379
7380 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7381
7382         * delegate.cs: Add checks for subtypes in paramaters and return values
7383         in VerifyMethod () to add support for Covariance/Contravariance
7384         in delegates.
7385         
7386 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7387
7388         * report.cs: Remove extra closing parenthesis.
7389
7390         * convert.cs (Error_CannotImplicitConversion): If the name of the
7391         types are the same, provide some extra information.
7392
7393 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
7394
7395         Fix bug #70102
7396         * attribute.cs (Resolve): Improved implementation of params
7397         attribute arguments.
7398
7399         * support.cs (ParameterData): Add HasParams to be faster.
7400
7401 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
7402
7403         all things are for /doc support:
7404
7405         * doc.cs: new file that supports XML documentation generation.
7406         * mcs.exe.sources: added doc.cs.
7407         * driver.cs:
7408           Handle /doc command line option.
7409           Report error 2006 instead of 5 for missing file name for /doc.
7410           Generate XML documentation when required, after type resolution.
7411         * cs-tokenizer.cs:
7412           Added support for picking up documentation (/// and /** ... */),
7413           including a new XmlCommentState enumeration.
7414         * cs-parser.jay:
7415           Added lines to fill Documentation element for field, constant,
7416           property, indexer, method, constructor, destructor, operator, event
7417           and class, struct, interface, delegate, enum.
7418           Added lines to warn incorrect comment.
7419         * rootcontext.cs :
7420           Added Documentation field (passed only when /doc was specified).
7421         * decl.cs:
7422           Added DocComment, DocCommentHeader, GenerateDocComment() and
7423           OnGenerateDocComment() and some supporting private members for
7424           /doc feature to MemberCore.
7425         * class.cs:
7426           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
7427         * delegate.cs:
7428           Added overriden DocCommentHeader.
7429         * enum.cs:
7430           Added overriden DocCommentHeader and GenerateDocComment().
7431
7432 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
7433
7434         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
7435         unwrapping the enumeration values, chain to
7436         DoConstantNumericPromotions again, so we can promote things to the
7437         fundamental types (takes care of enums that are bytes, sbytes).
7438
7439         Fixes bug #62054.
7440
7441 2004-12-01  Raja R Harinath  <rharinath@novell.com>
7442
7443         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
7444         Fix long-standing bug in type-lookup.  Use FindType instead of
7445         LookupType when ec.ResolvingTypeTree.
7446         (Attribute.ResolveType, Attribute.Resolve)
7447         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
7448         Update to changes.
7449         (Attributes.Search): Remove internal version.  Update.
7450         (Attributes.SearchMulti): Update.
7451         (Attributes.GetClsCompliantAttribute): Remove.
7452         (Attributes.GetIndexerNameAttribute): Remove.
7453         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
7454         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
7455         * class.cs (Indexer.Define): Likewise.
7456
7457 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
7458
7459         Fix bug #68790
7460         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
7461         MarshallByReference members access.
7462
7463         * expression.cs: Use CheckMarshallByRefAccess;
7464         Better error CS0197 message.
7465
7466         * report.cs: Print whole related error message.
7467
7468 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7469
7470         * class (GetClassBases): Better error 60 report.
7471         (EventProperty): Disabled warning 67 detection.
7472
7473 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7474
7475         Fix bug #60324
7476         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
7477
7478         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
7479         precise values.
7480
7481 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
7482
7483         Fix bug #49488
7484         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
7485
7486         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
7487
7488 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
7489
7490         * attribute.cs (Attribute.Resolve): Refine error reporting and
7491         report a cs0117 if the identifier does not exist, to distinguish
7492         from 0617 which is a miss-use of the actual identifier.
7493
7494         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
7495         between cs0070 and cs0079.
7496
7497         * class.cs (MemberBase.DoDefine): When reporting a wrong
7498         accessibility level, we use MethodCore to compare instead of
7499         Method (this was a regression in some refactoring effort).
7500
7501         So now we correctly report cs0056 again.
7502
7503         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
7504         testing the target_type (which was known to be object_type) and
7505         not the source type (which is anonymous_method).
7506
7507         Fixed reporting of error cs1660.
7508
7509         * expression.cs (UserCast.Source): Expose the underlying cast.
7510
7511         * statement.cs (Switch.SwitchGoverningType): Sort the list of
7512         allowed types to find a match to int32 first (most common).
7513
7514         In addition, it ignores any ImplicitUserConversions that did an
7515         internal implicit conversion (as the switch statement allows only
7516         one integral conversion to exist).
7517
7518         * class.cs (PartialContainer.Create): rename `name' to
7519         `member_name' for clarity.  Then replace the string calls with a
7520         call to MemberName.GetPartialName, as now using
7521         MemberName.ToString is an error (this is due to the side effects
7522         it had, that were fixed in the past).
7523
7524         This will restore the error reporting on a number of partial class
7525         errors that were missusing this (and getting an exception as a
7526         results, which is now just a plain textual warning, because
7527         yyparse debug output would crash otherwise).
7528
7529 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7530
7531         * Makefile (PROGRAM_INSTALL_DIR): Remove.
7532
7533 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7534
7535         * rootcontext.cs (LookupType): Make sure to cache lookups that
7536         don't give us a negative result. This saves about 5% of corlib
7537         compilation time.
7538
7539 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7540
7541         * report.cs (AbstractMessage.Print): messages are sent to stderr
7542
7543         * class.cs (TypeContainer.GetClassBases): It is an error to have a
7544         non-interface in the list of interfaces (at this point, either
7545         parent was properly set, or a base class is being listed in the
7546         interfaces section).
7547
7548         This flags error 1722, and resolves the crash from bug 69259.
7549
7550 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
7551
7552         * statement.cs (Using.EmitExpressionFinally): make this work right
7553         for valuetypes. Fixes 69926.
7554
7555 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7556
7557         * const.cs (Const.ChangeType): Cope with the "0 literal can be
7558         converted to an enum" here, before we try to change the underlying
7559         type.  This code exists, but it is a different code path than the
7560         one used while encoding constants.
7561
7562         (ImplicitReferenceConversionExists): In addition, resynchronized
7563         the code here, so it matches the same code in
7564         ImplicitReferenceConversionExists for the `from any class-type S
7565         to any interface-type T'.       
7566
7567 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
7568
7569         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
7570
7571 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
7572
7573         * cs-parser.jay: Use verbosity accordingly. 
7574
7575 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7576
7577         * expression.cs (Unary.ResolveOperator): Do not report warning;
7578         AddressOf reads from variable.
7579         
7580         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
7581
7582 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
7583
7584         Fix bug #69462
7585
7586         * attribute.cs (Attributable): Removed CheckTargets.
7587         (Attributes.Emit): Explicit attribute targets are tested here.
7588
7589         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
7590         not enabled for interfaces.
7591
7592         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
7593         (GetAssemblyName): Ouch next bug there.
7594
7595 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
7596
7597         * expression.cs: Error 275 added.
7598         
7599 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
7600
7601         Fix bug #69177 (Implemented decimal constant support)
7602
7603         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
7604         (BinaryFold): Add DecimalConstant.
7605
7606         * const.cs (Define): Decimal constant 
7607         (is not constant.
7608         (ChangeType): Add decimal type handling.
7609         (LookupConstantValue): Don't set value for decimal type but
7610         emit DecimalConstantAttribute. Needed for constant optimization.
7611
7612         * constant.cs (ToDecimal): New method.
7613         (ConvertToDecimal): New method.
7614         (IntConstant): Implemented ConvertToDecimal.
7615         (DecimalConstant.Emit): Emit optimized version for decimals in
7616         int range.
7617
7618         * expression.cs (ResolveOperator): Changed order of constant
7619         reduction to work correctly with native types which have
7620         overloaded operators.
7621         (ResolveMemberAccess): Extract constant value from attribute
7622         for decimal type.
7623
7624         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
7625
7626         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
7627         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
7628         (ChangeType): Decimal is special.
7629         (TypeToCoreType): Add decimal type.
7630
7631 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7632
7633         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
7634         decimal types.
7635
7636 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
7637
7638         * class.cs (EventField.ApplyAttributeBuilder): Fix error
7639         test cs1667-5.cs.
7640
7641 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7642
7643         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
7644
7645         * pending.cs (PendingImplementation): Grab only interfaces.
7646
7647 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
7648
7649         * statement.cs (ForeachHelperMethods): Add location member and
7650         error 202 detection.
7651
7652 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
7653
7654         * expression.cs (DoResolveBase): Fixed wrong warning for out
7655         variables.
7656
7657 2004-12-04  Martin Baulig  <martin@ximian.com>
7658
7659         * convert.cs (Convert.TypeParameter_to_Null): Use the constraints
7660         to check whether the conversion is ok.
7661
7662         * typemanager.cs (TypeManager.GetTypeArguments): Just return
7663         `Type.EmptyTypes' if we're not a generic TypeContainer.
7664
7665 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
7666
7667         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
7668         old bug: when converting from the null literal to a pointer,
7669         return an EmptyCast, not the NullLiteral.
7670
7671         This fixes #69921, the recent null_type changes probably made this
7672         bug more prominent.
7673
7674 2004-12-03  Martin Baulig  <martin@ximian.com>
7675
7676         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7677         method as our child, call AnonymousMethod.Compatible() on it.
7678
7679 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
7680
7681         * class.cs (FieldBase): Use an unused bit field from the field to
7682         encode the `has_offset' property from the FieldMember.  This saves
7683         a couple of Ks on bootstrap compilation.
7684
7685         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
7686         method as our child, return the AnonymousMethod resolved
7687         expression.
7688
7689         * expression.cs (New.DoResolve): Allow return values from
7690         NewDelegate to also include AnonymousMethods.
7691
7692         Fixes #70150.
7693
7694 2004-11-29  Raja R Harinath  <rharinath@novell.com>
7695
7696         * decl.cs (MemberCore.MemberName): Remove readonly to fix an error
7697         cs1648 report.
7698         * rootcontext.cs (ResolveCore::interfaces_first_stage): Add
7699         System.Runtime.InteropServices._Exception, since it's a base
7700         interface of the core type System.Exception in the net_2_0 profile.
7701
7702 2004-11-27  Martin Baulig  <martin@ximian.com>
7703
7704         * ecore.cs (Expression.StoreFromPtr): Use `stobj' for generic parameters.
7705
7706 2004-11-26  Raja R Harinath  <rharinath@novell.com>
7707
7708         * Makefile: Convert to use executable.make.
7709         * gmcs.exe.sources: New.
7710
7711 2004-11-25  Martin Baulig  <martin@ximian.com>
7712
7713         * expression.cs (Invocation.InferType): Added support for byref types.
7714
7715 2004-11-25  Martin Baulig  <martin@ximian.com>
7716
7717         * statement.cs (Foreach.FetchMethodMoveNext): Wrap `mi.ReturnType'
7718         in TypeManager.TypeToCoreType().
7719
7720 2004-11-25  Martin Baulig  <martin@ximian.com>
7721
7722         * iterators.cs (Iterator.DoDefineMembers): Override and lookup the
7723         "Dispose" method from the `current_type'.
7724         (Iterator.EmitMoveNext): Use the `dispose_method' we looked up in
7725         DoDefineMembers() instead of using the MethodBuilder; this is
7726         required for generic iterators.
7727
7728         * class.cs (TypeContainer.DoDefineMembers): Make this virtual.
7729
7730 2004-11-24  Martin Baulig  <martin@ximian.com>
7731
7732         * ecore.cs (Expression.LoadFromPtr): Use `ldobj' for generic parameters.
7733
7734 2004-11-20  Martin Baulig  <martin@ximian.com>
7735
7736         * expression.cs (Invocation.InferType): Correctly infer generic
7737         instances; see gen-103.cs.
7738         (Invocation.InferTypeArguments): If a generic method doesn't have
7739         any unbound type parameters, we don't need to infer anything.
7740
7741 2004-11-19  Raja R Harinath  <rharinath@novell.com>
7742
7743         * Makefile (gmcs.exe): Update to new location of bootstrap mcs.exe.
7744
7745 2004-11-17  Raja R Harinath  <rharinath@novell.com>
7746
7747         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
7748         (TypeHandle.GetMemberCache): New.
7749         (TypeHandle.TypeHandle): Update.
7750         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
7751         (TypeManager.LookupParentInterfacesCache):
7752         Rename from LookupInterfaceCache.  Optimize slightly.
7753         (TypeManager.MemberLookup_FindMembers): Update.
7754         * decl.cs (MemberCache.MemberCache): Set Container to null in the
7755         multi-type variant.
7756         (AddCacheContents): Rename from AddHashtable.
7757         * class.cs (TypeContainer.parent_container): Remove.
7758         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
7759         (TypeContainer.DoDefineMembers): Don't initialize it.
7760         Update to name changes.
7761         
7762 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
7763
7764         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
7765         that factors the code to check access modifiers on override.  
7766
7767         (PropertyBase): Use the code here.
7768
7769         Patch from Lluis S'anchez, fixes bug #69361.
7770
7771 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
7772
7773         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
7774         routine that is used to report the use of a captured variable
7775         whose address has been taken.
7776
7777         There are two checks: one when variables are being captured and
7778         the other check is when the address of a variable is taken. 
7779         
7780         (because an anonymous methods might be resolved before *or* after
7781         the address has been taken) and 
7782
7783         * expression.cs (Conditional.DoResolve): Remove the special
7784         casing that Martin added to trueExpr and falseExpr being both
7785         NullLiteral.  We get the right behavior now just by introducing
7786         the null_type into the compiler. 
7787
7788         * convert.cs (ExplicitConversion): Change the code to use
7789         null_type instead of testing `expr is NullLiteral'.
7790         (ImplicitConversionStandard): use null_type too.
7791         (ImplicitReferenceConversionExists): use null_type too.
7792         (ImplicitReferenceConversion): use null_type too.
7793
7794         * literal.cs: The type of `NullLiteral' is now null_type instead
7795         of object_type. 
7796         (Resolve): Set the type here.
7797
7798         * typemanager.cs: Introduce null_type.
7799
7800 2004-11-18  Martin Baulig  <martin@ximian.com>
7801
7802         * rootcontext.cs
7803         (RootContext.LookupType): Return a `Type', not a `TypeExpr'.
7804
7805 2004-11-18  Martin Baulig  <martin@ximian.com>
7806
7807         * ecore.cs (TypeExpr.DoResolveAsTypeStep): Make this protected.
7808
7809 2004-11-18  Martin Baulig  <martin@ximian.com>
7810
7811         * generic.cs (Constraints.Resolve): Take an `EmitContext' instead
7812         of a `DeclSpace'.  If one of our constraints is a `ConstructedType',
7813         call ResolveConstructedType() on it to resolve it without checking
7814         constraints.
7815         (Constraints.ResolveTypes): Check them here.
7816         (ConstructedType.DoResolveAsTypeStep): Fully resolve ourselves,
7817         but don't check constraints.
7818         (ConstructedType.ResolveAsTypeTerminal): Override this and also
7819         check constraints here.
7820         (ConstructedType.ResolveConstructedType): New public method.  This
7821         is called from DoResolveAsTypeStep() and Constraints.Resolve() to
7822         resolve ourselves without checking constraints.
7823
7824         * ecore.cs (Expression.ResolveAsTypeTerminal): Make this virtual.
7825
7826 2004-11-18  Martin Baulig  <martin@ximian.com>
7827
7828         * decl.cs
7829         (DeclSpace.CurrentType): Changed type from `TypeExpr' to `Type'.
7830
7831         * delegate.cs (Delegate.DefineType): Always create the EmitContext.
7832
7833 2004-11-18  Martin Baulig  <martin@ximian.com>
7834
7835         * ecore.cs (TypeExpr.ResolveType): Removed.
7836         (Expression.ResolveAsTypeTerminal): We always return a fully
7837         resolved `TypeExpr', so we can just access its `Type'.
7838
7839         * class.cs (TypeContainer.DefineType): Resolve `CurrentType' here.
7840
7841 2004-11-17  Martin Baulig  <martin@ximian.com>
7842
7843         * ecore.cs (IAlias.Type): Replaced with ResolveAsType() to make
7844         sure we don't return any unresolved TypeExpr's.
7845         (TypeAliasExpression): The .ctor now takes an `IAlias' instead of
7846         a `TypeExpr'.
7847         (Expression.ResolveAsTypeTerminal): Make sure `te.Type != null'.
7848
7849         * expression.cs (MemberAccess.ResolveAsTypeStep): Don't return any
7850         unresolved `ConstructedType's.
7851
7852 2004-11-17  Martin Baulig  <martin@ximian.com>
7853
7854         * ecore.cs (TypeExpr.ResolveType): Don't make this virtual.
7855
7856 2004-11-17  Martin Baulig  <martin@ximian.com>
7857
7858         * ecore.cs
7859         (Expression.ResolveAsTypeTerminal): Removed the `bool silent' argument.
7860
7861         * decl.cs (DeclSpace.ResolveType): Removed.
7862         (DeclSpace.ResolveTypeExpr): Removed the `bool silent' argument.
7863
7864 2004-11-17  Martin Baulig  <martin@ximian.com>
7865
7866         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
7867         direction, like FindMembers() does.  Fixes #69546, testcase is in
7868         test-315.cs.    
7869
7870 2004-11-16  Martin Baulig  <martin@ximian.com>
7871
7872         This is based on a patch from Marek Safar, see bug #69082.
7873         Fixes bugs #63705 and #67130.
7874
7875         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
7876         method; create a MemberCache for an interface type and cache the
7877         result.
7878
7879         * decl.cs (IMemberContainer.ParentContainer): Removed.
7880         (IMemberContainer.ParentCache): New property.
7881         (MemberCache.SetupCacheForInterface): Removed.
7882         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
7883         to create a cache for an interface's "parent".
7884
7885         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
7886         interfaces too.
7887
7888 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
7889
7890         * statement.cs: Avoid adding bools to a hashtable.
7891
7892 2004-11-15  Martin Baulig  <martin@ximian.com>
7893
7894         * decl.cs (MemberName.GetPartialName): Removed, use GetTypeName() instead.
7895
7896 2004-11-11  Martin Baulig  <martin@ximian.com>
7897
7898         * typemanager.cs (TypeManager.GetMethodName): New method.
7899
7900         * class.cs (MethodData.Define): Include the generic arity in the
7901         name of an explicit interface; also add it to the method name.
7902
7903         * pending.cs (PendingImplementation.InterfaceMethod): The method
7904         name now includes the generic arity.
7905
7906 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
7907
7908         * expression.cs (Invocation.OverloadResolve): Flag error if we are
7909         calling an unsafe method from a safe location.
7910
7911 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
7912
7913         Fix #69167
7914         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
7915
7916 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
7917
7918         * namespace.cs (VerifyUsing): use GetPartialName instead of
7919         ToString. 
7920
7921 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
7922
7923         * statement.cs (Return.Resolve): Fix regression in typo: if
7924         `in_exc', we have to request a NeedReturnLabel, this was a typo
7925         introduced in the anonymous method check-in.  Fixes #69131.
7926
7927         * Indexers were using the ShortName when defining themselves,
7928         causing a regression in the compiler bootstrap when applying the
7929         patch from 2004-11-02 (first part), now they use their full name
7930         and the bug is gone.
7931
7932 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
7933
7934         * driver.cs: Strip the path from the names of embedded resources. Fixes
7935         #68519.
7936
7937 2004-11-04  Raja R Harinath  <rharinath@novell.com>
7938
7939         Fix error message regression: cs0104-2.cs.
7940         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
7941         (AliasEntry.Resolve): Update.
7942         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
7943         'silent' flag.
7944         (RootContext.LookupType): Update.
7945
7946 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
7947
7948         * cs-parser.jay: Add support for handling accessor modifiers
7949         * class: Add support port accessor modifiers and error checking,
7950         define PropertyMethod.Define as virtual (not abstract anymore)
7951         * ecore.cs: Add checking for proeprties access with access modifiers
7952         * iterators.cs: Modify Accessor constructor call based in the modified
7953         constructor
7954 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
7955
7956         * expression.cs (StringConcat): Handle being called twice,
7957         as when we have a concat in a field init with more than two
7958         ctors in the class
7959
7960 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
7961
7962         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
7963         special case explicit implementations, we should always produce
7964         the .property or .event declaration.
7965         
7966         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
7967         since it will not return correct data if people use this
7968         unresolved in the presence of using statements (see test-313).
7969
7970         * class.cs (MethodData.Define): If we are an explicit interface
7971         implementation, set the method name to the full name of the
7972         interface plus the name of the method.  
7973
7974         Notice that using the method.MethodName.GetFullName() does not
7975         work, as it will only contain the name as declared on the source
7976         file (it can be a shorthand in the presence of using statements)
7977         and not the fully qualifed type name, for example:
7978
7979         using System;
7980
7981         class D : ICloneable {
7982                 object ICloneable.Clone ()  {
7983                 }
7984         }
7985
7986         Would produce a method called `ICloneable.Clone' instead of
7987         `System.ICloneable.Clone'.
7988
7989         * namespace.cs (Alias.Resolve): Use GetPartialName.
7990         
7991 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
7992
7993         * cs-parser.jay: Add error 1055 report.
7994
7995 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
7996
7997         * assign.cs (Assign.DoResolve): Only do the transform of
7998         assignment into a New if the types are compatible, if not, fall
7999         through and let the implicit code deal with the errors and with
8000         the necessary conversions. 
8001
8002 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
8003
8004         * cs-parser.jay: Add error 1031 report.
8005
8006         * cs-tokenizer.cs: Add location for error 1038.
8007
8008 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8009
8010         * cs-parser.jay: Add error 1016 report.
8011
8012 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8013
8014         * cs-parser.jay: Add errors 1575,1611 report.
8015
8016 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8017
8018         * cs-parser.jay: Add error 1001 report.
8019
8020 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8021
8022         Fix #68850
8023         * attribute.cs (GetMarshal): Add method argument for
8024         caller identification.
8025
8026         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
8027         agument for GetMarshal and RuntimeMissingSupport.
8028
8029 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
8030
8031         * attribute.cs (ExtractSecurityPermissionSet): Removed
8032         TypeManager.code_access_permission_type.
8033
8034         * typemanager.cs: Removed TypeManager.code_access_permission_type.
8035
8036 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
8037
8038         * expression.cs (LocalVariableReference.DoResolveLValue): Check
8039         for obsolete use of a variable here.   Fixes regression on errors
8040         cs0619-25 and cs0619-26.
8041
8042 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
8043
8044         Fix #62358, implemented security attribute encoding.
8045
8046         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
8047         Tests permitted SecurityAction for assembly or other types.
8048         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
8049         data from SecurityPermissionAttribute to PermisionSet class.
8050
8051         * class.cs (ApplyAttributeBuilder): Added special handling
8052         for System.Security.Permissions.SecurityAttribute based types.
8053
8054         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
8055         special handling for System.Security.Permissions.SecurityAttribute
8056         based types.
8057
8058         * enum.cs (ApplyAttributeBuilder): Added special handling
8059         for System.Security.Permissions.SecurityAttribute based types.
8060
8061         * parameter.cs (ApplyAttributeBuilder): Added special handling
8062         for System.Security.Permissions.SecurityAttribute based types.
8063
8064         * rootcontext.cs: Next 2 core types.
8065
8066         * typemanager.cs (TypeManager.security_permission_attr_type):
8067         Built in type for the SecurityPermission Attribute.
8068         (code_access_permission_type): Build in type.
8069
8070 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
8071
8072         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
8073         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
8074         all of this information into
8075         EmitContext.EmitCapturedVariableInstance.
8076         
8077         * codegen.cs (EmitCapturedVariableInstance): move here the
8078         funcionality of emitting an ldarg.0 in the presence of a
8079         remapping.   This centralizes the instance emit code.
8080
8081         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
8082         then emit a load of this: it means that we have reached the
8083         topmost ScopeInfo: the one that contains the pointer to the
8084         instance of the class hosting the anonymous method.
8085
8086         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
8087         captures to the topmost CaptureContext.
8088
8089 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
8090
8091         * expression.cs (LocalVariableReference): Move the knowledge about
8092         the iterators into codegen's EmitCapturedVariableInstance.
8093
8094 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
8095
8096         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
8097         all code paths return a value from an anonymous method (it is the
8098         same as the 161 error, but for anonymous methods).
8099
8100 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
8101
8102         The introduction of anonymous methods in the compiler changed
8103         various ways of doing things in the compiler.  The most
8104         significant one is the hard split between the resolution phase
8105         and the emission phases of the compiler.
8106
8107         For instance, routines that referenced local variables no
8108         longer can safely create temporary variables during the
8109         resolution phase: they must do so from the emission phase,
8110         since the variable might have been "captured", hence access to
8111         it can not be done with the local-variable operations from the runtime.
8112         
8113         * statement.cs 
8114
8115         (Block.Flags): New flag `IsTopLevel' to indicate that this block
8116         is a toplevel block.
8117
8118         (ToplevelBlock): A new kind of Block, these are the blocks that
8119         are created by the parser for all toplevel method bodies.  These
8120         include methods, accessors and anonymous methods.
8121
8122         These contain some extra information not found in regular blocks:
8123         A pointer to an optional CaptureContext (for tracking captured
8124         local variables and parameters).  A pointer to the parent
8125         ToplevelBlock.
8126         
8127         (Return.Resolve): Catch missmatches when returning a value from an
8128         anonymous method (error 1662).
8129         Invoke NeedReturnLabel from the Resolve phase instead of the emit
8130         phase.
8131
8132         (Break.Resolve): ditto.
8133
8134         (SwitchLabel): instead of defining the labels during the
8135         resolution phase, we now turned the public ILLabel and ILLabelCode
8136         labels into methods called GetILLabelCode() and GetILLabel() that
8137         only define the label during the Emit phase.
8138
8139         (GotoCase): Track the SwitchLabel instead of the computed label
8140         (its contained therein).  Emit the code by using
8141         SwitchLabel.GetILLabelCode ().
8142
8143         (LocalInfo.Flags.Captured): A new flag has been introduce to track
8144         whether the Local has been captured or not.
8145
8146         (LocalInfo.IsCaptured): New property, used to tell whether the
8147         local has been captured.
8148         
8149         * anonymous.cs: Vastly updated to contain the anonymous method
8150         support.
8151
8152         The main classes here are: CaptureContext which tracks any
8153         captured information for a toplevel block and ScopeInfo used to
8154         track the activation frames for various local variables.   
8155
8156         Each toplevel block has an optional capture context associated
8157         with it.  When a method contains an anonymous method both the
8158         toplevel method and the anonymous method will create a capture
8159         context.   When variables or parameters are captured, they are
8160         recorded on the CaptureContext that owns them, for example:
8161
8162         void Demo () {
8163              int a;
8164              MyDelegate d = delegate {
8165                  a = 1;
8166              }
8167         }
8168
8169         Here `a' will be recorded as captured on the toplevel
8170         CapturedContext, the inner captured context will not have anything
8171         (it will only have data if local variables or parameters from it
8172         are captured in a nested anonymous method.
8173
8174         The ScopeInfo is used to track the activation frames for local
8175         variables, for example:
8176
8177         for (int i = 0; i < 10; i++)
8178                 for (int j = 0; j < 10; j++){
8179                    MyDelegate d = delegate {
8180                         call (i, j);
8181                    }
8182                 }
8183
8184         At runtime this captures a single captured variable `i', but it
8185         captures 10 different versions of the variable `j'.  The variable
8186         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
8187         recorded on a child.  
8188
8189         The toplevel ScopeInfo will also track information like the `this'
8190         pointer if instance variables were referenced (this is necessary
8191         as the anonymous method lives inside a nested class in the host
8192         type of the method). 
8193
8194         (AnonymousMethod): Expanded to track the Toplevel, implement
8195         `AnonymousMethod.Compatible' to tell whether an anonymous method
8196         can be converted to a target delegate type. 
8197
8198         The routine now also produces the anonymous method content
8199
8200         (AnonymousDelegate): A helper class that derives from
8201         DelegateCreation, this is used to generate the code necessary to
8202         produce the delegate for the anonymous method that was created. 
8203
8204         * assign.cs: API adjustments for new changes in
8205         Convert.ImplicitStandardConversionExists.
8206
8207         * class.cs: Adjustments to cope with the fact that now toplevel
8208         blocks are of type `ToplevelBlock'. 
8209
8210         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
8211         insteda of standard blocks.
8212
8213         Flag errors if params arguments are passed to anonymous methods.
8214
8215         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
8216         `CurrentAnonymousMethod' which points to the current Anonymous
8217         Method.  The variable points to the AnonymousMethod class that
8218         holds the code being compiled.  It is set in the new EmitContext
8219         created for the anonymous method.
8220
8221         (EmitContext.Phase): Introduce a variable and an enumeration to
8222         assist in enforcing some rules about when and where we are allowed
8223         to invoke certain methods (EmitContext.NeedsReturnLabel is the
8224         only one that enfonces this right now).
8225
8226         (EmitContext.HaveCaptureInfo): new helper method that returns
8227         whether we have a CapturedContext initialized.
8228
8229         (EmitContext.CaptureVariable): New method used to register that a
8230         LocalInfo must be flagged for capturing. 
8231
8232         (EmitContext.CapturedParameter): New method used to register that a
8233         parameters must be flagged for capturing. 
8234         
8235         (EmitContext.CapturedField): New method used to register that a
8236         field must be flagged for capturing. 
8237
8238         (EmitContext.HaveCapturedVariables,
8239         EmitContext.HaveCapturedFields): Return whether there are captured
8240         variables or fields. 
8241
8242         (EmitContext.EmitMethodHostInstance): This is used to emit the
8243         instance for the anonymous method.  The instance might be null
8244         (static methods), this (for anonymous methods that capture nothing
8245         and happen to live side-by-side with the current method body) or a
8246         more complicated expression if the method has a CaptureContext.
8247
8248         (EmitContext.EmitTopBlock): Routine that drives the emission of
8249         code: it will first resolve the top block, then emit any metadata
8250         and then emit the code.  The split is done so that we can extract
8251         any anonymous methods and flag any captured variables/parameters.
8252         
8253         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
8254         during this phase, the ILGenerator should not be used as labels
8255         and local variables declared here might not be accessible to any
8256         code that is part of an anonymous method.  
8257
8258         Exceptions to this include the temporary variables that are
8259         created by some statements internally for holding temporary
8260         variables. 
8261         
8262         (EmitContext.EmitMeta): New routine, in charge of emitting all the
8263         metadata for a cb
8264
8265         (EmitContext.TemporaryReturn): This method is typically called
8266         from the Emit phase, and its the only place where we allow the
8267         ReturnLabel to be defined other than the EmitMeta.  The reason is
8268         that otherwise we would have to duplicate a lot of logic in the
8269         Resolve phases of various methods that today is on the Emit
8270         phase. 
8271
8272         (EmitContext.NeedReturnLabel): This no longer creates the label,
8273         as the ILGenerator is not valid during the resolve phase.
8274
8275         (EmitContext.EmitThis): Extended the knowledge in this class to
8276         work in anonymous methods in addition to iterators. 
8277
8278         (EmitContext.EmitCapturedVariableInstance): This emits whatever
8279         code is necessary on the stack to access the instance to a local
8280         variable (the variable will be accessed as a field).
8281
8282         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
8283         EmitContext.EmitAddressOfParameter): Routines to support
8284         parameters (not completed at this point). 
8285         
8286         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
8287         will also remove the parameters.
8288
8289         * convert.cs (Convert): Define a `ConstantEC' which points to a
8290         null.  This is just to prefity some code that uses
8291         ImplicitStandardConversion code and do not have an EmitContext
8292         handy.
8293
8294         The idea is to flag explicitly that at that point in time, it is
8295         known that the conversion will not trigger the delegate checking
8296         code in implicit conversions (which requires a valid
8297         EmitContext). 
8298
8299         Everywhere: pass new EmitContext parameter since
8300         ImplicitStandardConversionExists now requires it to check for
8301         anonymous method conversions. 
8302
8303         (Convert.ImplicitStandardConversionExists): If the type of an
8304         expression is the anonymous_method_type, and the type is a
8305         delegate, we invoke the AnonymousMethod.Compatible method to check
8306         whether an implicit conversion is possible. 
8307
8308         (Convert.ImplicitConversionStandard): Only do implicit method
8309         group conversions if the language level is not ISO_1.
8310
8311         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
8312         MethodInfo for the Invoke method.  used by Delegate and
8313         AnonymousDelegate.
8314
8315         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
8316         method conversions if the target type is a delegate.
8317
8318         Removed extra debugging nops.
8319
8320         (LocalVariableReference): Turn the `local_info' into a public
8321         field. 
8322
8323         Add `prepared' field, the same hack used for FieldExprs to cope
8324         with composed assignments, as Local variables do not necessarily
8325         operate purely on the stack as they used to: they can be captured
8326         fields. 
8327
8328         Add `temp' for a temporary result, like fields.
8329
8330         Refactor DoResolve and DoResolveLValue into DoResolveBase.
8331
8332         It now copes with Local variables that are captured and emits the
8333         proper instance variable to load it from a field in the captured
8334         case. 
8335
8336         (ParameterReference.DoResolveBase): During the resolve phase,
8337         capture parameters if we are in an anonymous method.
8338
8339         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
8340         anonymous method, use the EmitContext helper routines to emit the
8341         parameter reference.
8342
8343         * iterators.cs: Set RemapToProxy to true/false during the
8344         EmitDispose class.
8345
8346         * parameters.cs (GetParameterByName): New helper method. 
8347
8348         * typemanager.cs (anonymous_method_type) a new type that
8349         represents an anonyous method.  This is always an internal type,
8350         used as a fencepost to test against the anonymous-methodness of an
8351         expression. 
8352         
8353 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
8354
8355         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
8356         561 report.
8357         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
8358
8359 2004-11-10  Martin Baulig  <martin@ximian.com>
8360
8361         * expression.cs (Invocation.BetterFunction): If two methods have
8362         equal parameter types, but only one of them is generic, the
8363         non-generic one wins.
8364         (New.DoResolve): Don't set `is_struct' to false if we're a generic
8365         instance; just use `Type.IsValueType' to determine whether
8366         something is a struct or not.
8367         (MemberAccess.DoResolveAsTypeStep): Don't modify the `args' field,
8368         so we can be called multiple times.
8369
8370 2004-11-10  Martin Baulig  <martin@ximian.com>
8371
8372         * generic.cs (TypeParameter.DefineConstraints): New public method.
8373         (TypeParameter.CheckAccessLevel): Override this and return true.
8374         (ConstructedType.ResolveType): Renamed to DoResolveType(), don't
8375         override ResolveType() anymore.
8376         (ConstructedType.DoResolveAsTypeStep): Call DoResolveType() here.
8377
8378 2004-11-10  Martin Baulig  <martin@ximian.com>
8379
8380         * rootcontext.cs (RootContext.LookupType): If we're a nested type,
8381         call DeclSpace.ResolveNestedType() on it.
8382
8383 2004-11-10  Martin Baulig  <martin@ximian.com>
8384
8385         * support.cs (ReflectionParameters.ParameterModifier): If `gpd' is
8386         non-null, call ParameterModifier() on it.
8387
8388 2004-11-10  Martin Baulig  <martin@ximian.com>
8389
8390         * iterators.cs
8391         (Iterators): Added `current_type' and `this_type' fields.
8392         (Iterators.DefineIterator): Create a new EmitContext and store it
8393         in `ec'; compute `this_type'.
8394
8395 2004-11-10  Martin Baulig  <martin@ximian.com>
8396
8397         * typemanager.cs
8398         (TypeManager.IsPrivateAccessible): New public method.
8399         (Closure.Filter): Use IsPrivateAccessible() instead of IsEqual().
8400
8401 2004-11-10  Martin Baulig  <martin@ximian.com>
8402
8403         * class.cs (TypeContainer.DefineType): Call
8404         TypeBuilder.DefineGenericParameters() before resolving the type
8405         parameters.
8406         (MethodData.parent_method): New protected field.
8407         (MethodData..ctor): Added `MethodInfo parent_method' argument.
8408         (MethodData.Define): Compute `parent_method'.
8409
8410         * decl.cs
8411         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
8412         (MemberCore.GetClsCompliantAttributeValue): Likewise.
8413         (DeclSpace.ec): New protected field; store the EmitContext here.
8414         (DeclSpace.EmitContext): New public property.
8415         (DeclSpace.ResolveType): Un-comment from the [Obsolte] attribute.
8416         (DeclSpace.ResolveNestedType): New public method.
8417         (DeclSpace.ResolveTypeExpr): Just call ResolveAsTypeTerminal() here.
8418         (DeclSpace.NestedAccessible): Added `Type tb' argument.
8419         (DeclSpace.FamilyAccessible): Likewise.
8420         (DeclSpace.FindType): Call ResolveNestedType() for nested types.
8421         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
8422         EmitContext.
8423
8424         * delegate.cs (Delegate.Define): Store the EmitContext in the `ec'
8425         field.
8426
8427         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
8428         (Enum.Emit): Don't create a new EmitContext.
8429
8430 2004-10-18  Martin Baulig  <martin@ximian.com>
8431
8432         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
8433         `Type' directly, but call ResolveType() on it.
8434         (Catch.Resolve): Likewise.
8435         (Foreach.Resolve): Likewise.
8436
8437 2004-10-18  Martin Baulig  <martin@ximian.com>
8438
8439         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
8440         `Type' directly, but call ResolveType() on it.
8441         (Probe.DoResolve): Likewise.
8442         (ArrayCreation.LookupType): Likewise.
8443         (TypeOf.DoResolve): Likewise.
8444         (SizeOf.DoResolve): Likewise.
8445
8446 2004-10-18  Raja R Harinath  <rharinath@novell.com>
8447
8448         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
8449         the ResolveType.
8450
8451 2004-10-17  John Luke  <john.luke@gmail.com>
8452
8453         * class.cs (Operator.GetSignatureForError): use CSharpName
8454
8455         * parameter.cs (Parameter.GetSignatureForError): Returns
8456         correct name even if was not defined.
8457
8458 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8459
8460         Fix #65816.
8461         * class.cs (TypeContainer.EmitContext): New property.
8462         (DefineNestedTypes): Create an emitcontext for each part.
8463         (MethodCore.DoDefineParameters): Use container's emitcontext.
8464         Pass type array to InternalParameters.
8465         (MemberBase.DoDefine): Use container's emitcontext.
8466         (FieldMember.Define): Likewise.
8467         (Event.Define): Likewise.
8468         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8469         Pass type array to InternalParameters.
8470         (SetIndexerMethod.GetParameterInfo): Likewise.
8471         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8472         * delegate.cs (Define): Pass emitcontext to
8473         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8474         array to InternalParameters.
8475         * expression.cs (ParameterReference.DoResolveBase): Pass
8476         emitcontext to GetParameterInfo.
8477         (ComposedCast.DoResolveAsTypeStep): Remove check on
8478         ec.ResolvingTypeTree.
8479         * parameter.cs (Parameter.Resolve): Change argument to
8480         EmitContext.  Use ResolveAsTypeTerminal.
8481         (Parameter.GetSignature): Change argument to EmitContext.
8482         (Parameters.ComputeSignature): Likewise.
8483         (Parameters.ComputeParameterTypes): Likewise.
8484         (Parameters.GetParameterInfo): Likewise.
8485         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8486         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8487         * support.cs (InternalParameters..ctor): Remove variant that takes
8488         a DeclSpace.
8489         * typemanager.cs (system_intptr_expr): New.
8490         (InitExpressionTypes): Initialize it.
8491
8492 2004-10-12  Chris Toshok  <toshok@ximian.com>
8493
8494         * cs-parser.jay: fix location for try_statement and catch_clause.
8495
8496 2004-10-18  Martin Baulig  <martin@ximian.com>
8497
8498         * class.cs (FieldMember.Define): Don't access the TypeExpr's
8499         `Type' directly, but call ResolveType() on it.
8500         (MemberBase.DoDefine): Likewise.
8501
8502         * expression.cs (New.DoResolve): Don't access the TypeExpr's
8503         `Type' directly, but call ResolveType() on it.
8504         (ComposedCast.DoResolveAsTypeStep): Likewise.
8505
8506         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
8507         `Type' directly, but call ResolveType() on it.
8508
8509 2004-10-17  John Luke  <john.luke@gmail.com>
8510
8511         * class.cs (Operator.GetSignatureForError): use CSharpName
8512
8513         * parameter.cs (Parameter.GetSignatureForError): Returns
8514         correct name even if was not defined.
8515
8516 2004-10-13  Raja R Harinath  <rharinath@novell.com>
8517
8518         Fix #65816.
8519         * class.cs (TypeContainer.EmitContext): New property.
8520         (DefineNestedTypes): Create an emitcontext for each part.
8521         (MethodCore.DoDefineParameters): Use container's emitcontext.
8522         Pass type array to InternalParameters.
8523         (MemberBase.DoDefine): Use container's emitcontext.
8524         (FieldMember.Define): Likewise.
8525         (Event.Define): Likewise.
8526         (SetMethod.GetParameterInfo): Change argument to EmitContext.
8527         Pass type array to InternalParameters.
8528         (SetIndexerMethod.GetParameterInfo): Likewise.
8529         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
8530         * delegate.cs (Define): Pass emitcontext to
8531         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
8532         array to InternalParameters.
8533         * expression.cs (ParameterReference.DoResolveBase): Pass
8534         emitcontext to GetParameterInfo.
8535         (ComposedCast.DoResolveAsTypeStep): Remove check on
8536         ec.ResolvingTypeTree.
8537         * parameter.cs (Parameter.Resolve): Change argument to
8538         EmitContext.  Use ResolveAsTypeTerminal.
8539         (Parameter.GetSignature): Change argument to EmitContext.
8540         (Parameters.ComputeSignature): Likewise.
8541         (Parameters.ComputeParameterTypes): Likewise.
8542         (Parameters.GetParameterInfo): Likewise.
8543         (Parameters.ComputeAndDefineParameterTypes): Likewise.
8544         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
8545         * support.cs (InternalParameters..ctor): Remove variant that takes
8546         a DeclSpace.
8547         * typemanager.cs (system_intptr_expr): New.
8548         (InitExpressionTypes): Initialize it.
8549
8550 2004-10-12  Chris Toshok  <toshok@ximian.com>
8551
8552         * cs-parser.jay: fix location for try_statement and catch_clause.
8553
8554 2004-10-07  Raja R Harinath  <rharinath@novell.com>
8555
8556         More DeclSpace.ResolveType avoidance.
8557         * decl.cs (MemberCore.InUnsafe): New property.
8558         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
8559         with newly created EmitContext.
8560         (FieldMember.Define): Likewise.
8561         * delegate.cs (Delegate.Define): Likewise.
8562         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
8563         only if normal name-lookup fails.
8564         (TypeExpr.DoResolve): Enable error-checking.
8565         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
8566         (SizeOf.DoResolve): Likewise.
8567         (ComposedCast.DoResolveAsTypeStep): Likewise.
8568         (StackAlloc.DoResolve): Likewise.
8569         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
8570         (Block.Unsafe): New property.
8571         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
8572         (Unsafe): Set 'unsafe' flag of contained block.
8573         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
8574         (Fixed.Resolve): Likewise.
8575         (Catch.Resolve): Likewise.
8576         (Using.ResolveLocalVariableDecls): Likewise.
8577         (Foreach.Resolve): Likewise.
8578
8579 2004-10-05  John Luke <john.luke@gmail.com>
8580
8581         * cs-parser.jay: add location to error CS0175
8582
8583 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
8584
8585         * ecore.cs (Expression.Constantity): Add support for turning null
8586         into a constant.
8587
8588         * const.cs (Const.Define): Allow constants to be reference types
8589         as long as the value is Null.
8590
8591 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
8592
8593         * namespace.cs (NamespaceEntry.Using): No matter which warning
8594         level is set, check if this namespace name has already been added.
8595
8596 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
8597
8598         * expression.cs: reftype [!=]= null should always use br[true,false].
8599         # 67410
8600
8601 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
8602
8603         Fix #67108
8604         * attribute.cs: Enum conversion moved to 
8605         GetAttributeArgumentExpression to be applied to the all
8606         expressions.
8607
8608 2004-10-01  Raja R Harinath  <rharinath@novell.com>
8609
8610         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
8611         * class.c (TypeContainer.DefineType): Flag error if
8612         base types aren't accessible due to access permissions.
8613         * decl.cs (DeclSpace.ResolveType): Move logic to
8614         Expression.ResolveAsTypeTerminal.
8615         (DeclSpace.ResolveTypeExpr): Thin layer over
8616         Expression.ResolveAsTypeTerminal.
8617         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
8618         Refactor code into NestedAccess.  Use it.
8619         (DeclSpace.NestedAccess): New.
8620         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
8621         argument to silence errors.  Check access permissions.
8622         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
8623         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
8624         (Cast.DoResolve): Likewise.
8625         (New.DoResolve): Likewise.
8626         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
8627         (TypeOf.DoResolve): Likewise.
8628
8629         * expression.cs (Invocation.BetterConversion): Return the Type of
8630         the better conversion.  Implement section 14.4.2.3 more faithfully.
8631         (Invocation.BetterFunction): Make boolean.  Make correspondence to
8632         section 14.4.2.2 explicit.
8633         (Invocation.OverloadResolve): Update.
8634         (Invocation): Remove is_base field.
8635         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
8636         (Invocation.Emit): Likewise.
8637
8638 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
8639
8640         * cs-parser.jay: Reverted 642 warning fix.
8641
8642 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8643
8644         Fix bug #66615
8645         * decl.cs (FindMemberWithSameName): Indexer can have more than
8646         1 argument.
8647
8648 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8649
8650         * expression.cs (LocalVariableReference.DoResolveLValue):
8651         Do not report warning 219 for out values.
8652         (EmptyExpression.Null): New member to avoid extra allocations.
8653
8654 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8655
8656         * cs-parser.jay: Fix wrong warning 642 report.
8657
8658         * cs-tokenizer.cs (CheckNextToken): New helper;
8659         Inspect next character if is same as expected.
8660
8661 2004-09-23  Martin Baulig  <martin@ximian.com>
8662
8663         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8664         (Convert.ImplicitReferenceConversionExists): Likewise.
8665
8666 2004-11-09  Raja R Harinath  <rharinath@novell.com>
8667
8668         * Makefile (DISTFILES): Comment out a few missing files.
8669
8670 2004-10-29  Raja R Harinath  <rharinath@novell.com>
8671
8672         * Makefile (bootstrap_libs,bootstrap_libfiles): New.
8673         (bootstrap-libs): New target.  Invokes the net_2_0_bootstrap profile.
8674         (gmcs.exe): Invoke bootstrap-libs.
8675         (clean-local): Clean the net_2_0_bootstrap profile too.
8676         (PROGRAM_INSTALL_DIR): New.
8677         (install-local): Use it.
8678
8679 2004-10-13  Martin Baulig  <martin@ximian.com>
8680
8681         * generic.cs (TypeManager.InflatedConstraints): New nested class.
8682         (TypeParameter.DefineType): If we're a method type parameter and
8683         that method is overriding something, "inflate" its constraints.
8684
8685 2004-10-12  Martin Baulig  <martin@ximian.com>
8686
8687         * expression.cs (MemberAccess.DoResolve): If we're a SimpleName
8688         and have type arguments, create and resolve a ConstructedType.
8689
8690 2004-10-12  Martin Baulig  <martin@ximian.com>
8691
8692         * decl.cs (MemberCache.FindMemberToOverride): Use
8693         TypeManager.IsEqual() to compare the parameters and Type.Equals()
8694         to compare the invocationType.
8695
8696         * typemanager.cs (TypeManager.IsEqual): Added support for arrays.
8697         When comparing two type parameters, only do the signature-only
8698         comparision for method type parameters.
8699
8700 2004-10-11  Martin Baulig  <martin@ximian.com>
8701
8702         * report.cs: Don't make --fatal abort on warnings, we have
8703         -warnaserror for that.
8704
8705 2004-10-11  Martin Baulig  <martin@ximian.com>
8706
8707         * typemanager.cs
8708         (TypeManager.IsEqualGenericType): Removed, use IsEqual() instead.
8709         (TypeManager.IsEqual): Call ourself recursively instead of using
8710         Type.IsEqual(). 
8711
8712 2004-10-11  Martin Baulig  <martin@ximian.com>
8713
8714         * class.cs (TypeContainer.DefineType): Only call TypeParameter.Define()
8715         on our own type parameters, not on the ones we inherit from a containing
8716         class.
8717
8718         * expression.cs (Invocation.InferType): Use `==', not `Equals()' for
8719         the comparision.
8720
8721         * generic.cs (TypeParameter.Define): We may only be called once.
8722
8723         * pending.cs (Pending.InterfaceMethod): Call TypeManager.Real_IsEqual()
8724         instead of TypeManager.IsEqual().
8725
8726 2004-09-28  Martin Baulig  <martin@ximian.com>
8727
8728         * generic.cs
8729         (GenericConstraints.EffectiveBaseClass): New public property.
8730         (TypeParameter.GenericConstraints): New public property.
8731         (ConstructedType.CheckConstraints): Improved.
8732
8733         * convert.cs (Convert.TypeParam_EffectiveBaseType): New private method.
8734         (Convert.TypeParameterConversion): New private method; use this in
8735         ImplicitReferenceConversion() and ImplicitReferenceConversionExists()
8736         for all conversions related to type parameters.
8737
8738 2004-09-24  Martin Baulig  <martin@ximian.com>
8739
8740         * convert.cs (Convert.ImplicitReferenceConversion): Added implicit
8741         type parameter conversions for type parameters which are known to
8742         be reference types.
8743
8744 2004-09-24  Martin Baulig  <martin@ximian.com>
8745
8746         * generic.cs (GenericConstraints): Added `IsReferenceType' and
8747         `IsValueType' properties.
8748
8749         * support.cs (ReflectionConstraints): Use
8750         Type.GetGenericParameterConstraints() instead of the old hack.
8751
8752 2004-09-24  Martin Baulig  <martin@ximian.com>
8753
8754         * generic.cs (GenericConstraints): Moved here and made it an
8755         abstract class.
8756
8757         * support.cs (GenericConstraints): Moved to generic.cs.
8758
8759 2004-09-24  Martin Baulig  <martin@ximian.com>
8760
8761         * support.cs
8762         (ReflectionConstraints): Un-nested this class and made it public.
8763
8764         * typemanager.cs
8765         (TypeManager.GetTypeParameterConstraints): New public method.
8766         (TypeManager.HasConstructorConstraint): Use the attributes.
8767
8768 2004-09-24  Martin Baulig  <martin@ximian.com>
8769
8770         * support.cs (GenericConstraints): Replaced `HasConstructor',
8771         `IsReferenceType' and `IsValueType' with `Attributes'.
8772         (ReflectionParameters.ReflectionConstraints): Removed the Create()
8773         method and made the .ctor public.
8774
8775         * generic.cs (Constraints.Attributes): New public property.
8776         (Constraints): Renamed `HasConstructor' -> `HasConstructorConstraint',
8777         `IsReferenceType' -> `HasReferenceTypeConstraint' and
8778         `IsValueType' -> `HasValueTypeConstraint'.
8779
8780 2004-09-23  Martin Baulig  <martin@ximian.com>
8781
8782         * generic.cs (Constraints): Reflect latest runtime changes.
8783
8784 2004-09-23  Martin Baulig  <martin@ximian.com>
8785
8786         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
8787         (Convert.ImplicitReferenceConversionExists): Likewise.
8788
8789 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
8790
8791         * class.cs (Operator.Define): Add error 448 and 559 report.
8792         
8793 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8794
8795         * class.cs (MemberBase.IsTypePermitted): New protected
8796         method for checking error CS0610.
8797
8798 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8799
8800         * class.cs (TypeContainer.HasExplicitLayout): New property
8801         Returns whether container has StructLayout attribute set Explicit.
8802         (FieldMember): New abstract class for consts and fields.
8803         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
8804         (Field): Reuse FieldMember.
8805
8806         * const.cs (Const): Reuse FieldMember.
8807
8808         * rootcontext.cs: EmitConstants call moved to class.
8809
8810 2004-09-22  Martin Baulig  <martin@ximian.com>
8811
8812         Marek and me just fixed one of our oldest bugs: #28562 :-)
8813
8814         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
8815
8816         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
8817         we're an EnumConstant, just return that.
8818         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
8819         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
8820         to get the value which'll actually be written into the attribute.
8821         However, we have to use GetValue() to access the attribute's value
8822         in the compiler.        
8823
8824 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
8825
8826         * constant.cs (Constant.IsNegative): New abstract property
8827         IsNegative.
8828
8829         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
8830         (StackAlloc.DoResolve): Reused IsNegative.
8831
8832 2004-09-22  Martin Baulig  <martin@ximian.com>
8833
8834         * typemanager.cs (TypeManager.LookupGenericTypeContainer): New
8835         public method; like LookupTypeContainer, but also works for
8836         generic instances.
8837
8838         * report.cs (Report.SymbolRelatedToPreviousError): Use
8839         TypeManager.LookupGenericTypeContainer().       
8840
8841 2004-09-22  Martin Baulig  <martin@ximian.com>
8842
8843         Thanks to Peter Sestoft for this bug report.
8844
8845         * expression.cs (Conditional): If both the `trueExpr' and the
8846         `falseExpr' is a NullLiteral, return a NullLiteral.
8847
8848 2004-09-22  Martin Baulig  <martin@ximian.com>
8849
8850         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
8851         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
8852         for the "get_Current" call.
8853
8854 2004-09-21  Martin Baulig  <martin@ximian.com>
8855
8856         * convert.cs (Convert.ImplicitReferenceConversion): When
8857         converting to an interface type, first check whether we're
8858         converting from a reference type.
8859
8860 2004-09-14  Martin Baulig  <martin@ximian.com>
8861
8862         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
8863
8864 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
8865
8866         Fixed bug #61902
8867         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
8868         called and is obsolete then this member suppress message
8869         when call is inside next [Obsolete] method or type.
8870
8871         * expression.cs: Use TestObsoleteMethodUsage member.
8872
8873 2004-09-14  Martin Baulig  <martin@ximian.com>
8874
8875         * genericparser.cs: Removed.
8876
8877 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
8878
8879         * class.cs (MethodCore.CheckBase): Fix bug #65757.
8880
8881 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
8882
8883         * attribute.cs (Attribute.Resolve): Add error 653 report.
8884
8885         * class.cs (Class.ApplyAttributeBuilder): Add error 641
8886         report.
8887         (Method.ApplyAttributeBuilder): Add error 685 report.
8888         (Operator.Define): Add error 564 report.
8889
8890         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
8891
8892         * expression.cs (Invocation.DoResolve): Add error
8893         245 and 250 report.
8894
8895         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
8896         error 674 report.
8897
8898 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8899
8900         * class.cs (ConstructorInitializer.Resolve):
8901         Wrong error number (515->516).
8902
8903 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8904
8905         * class.cs (Indexer.Define): Add error 631 report.
8906
8907 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8908
8909         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
8910
8911 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
8912
8913         * expression.cs (Probe.DoResolve): Add error CS0241 report.
8914
8915 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
8916
8917         * cs-parser.jay: Added error CS0241 report.
8918
8919 2004-09-10  Raja R Harinath  <rharinath@novell.com>
8920
8921         * cs-parser.jay (fixed_statement): Introduce a scope for the
8922         declaration in the 'fixed' statement.
8923
8924 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8925
8926         * cs-parser.jay: Added CS0230 error report.
8927
8928 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8929
8930         * cs-parser.jay: Added errors CS0231 and CS0257 report.
8931
8932 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8933
8934         * expression.cs (Argument.Resolve): Added error CS0192 and
8935         CS0199 report.
8936
8937 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
8938
8939         C# 2.0 #pragma warning feature
8940
8941         * cs-tokenizer.cs (PreProcessPragma): New method; 
8942         Handles #pragma directive.
8943
8944         * report.cs (WarningRegions): New class; Support
8945         class for #pragma warning directive. It tests whether
8946         warning is enabled for a given line.
8947
8948 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
8949
8950         * const.cs: Add more descriptive error report, tahnks to
8951         Sebastien. 
8952
8953 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
8954
8955         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
8956
8957 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
8958
8959         * expression.cs: Apply patch from Ben: Remove dead code from
8960         ArrayCreation, and remove the TurnintoConstant call in const.cs,
8961         as that code just threw an exception anwyays.
8962
8963         * const.cs: Remove the call to the turnintoconstant, for details
8964         see bug: #63144
8965         
8966         * literal.cs: The type of the null-literal is the null type;  So
8967         we use a placeholder type (literal.cs:System.Null, defined here)
8968         for it.
8969
8970         * expression.cs (Conditional.DoResolve): Remove some old code that
8971         is no longer needed, conversions have been fixed.
8972
8973         (ArrayCreationExpression.DoResolve): Return false if we fail to
8974         resolve the inner expression.
8975
8976 2004-09-07  Raja R Harinath  <rharinath@novell.com>
8977
8978         Fix test-290.cs.
8979         * cs-parser.jay (delegate_declaration): Record a delegate
8980         declaration as a type declaration.
8981         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
8982
8983 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
8984
8985         * parameter.cs: Do not crash if the type can not be resolved. 
8986
8987         * expression.cs: Report errors with unsafe pointers, fixes #64896
8988
8989 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
8990
8991         * expression.cs: Pointer arith always needs to do a conv.i
8992         if the operand is a long. fix 65320
8993
8994 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
8995
8996         Fixed cs0619-37.cs, cs0619-38.cs
8997
8998         * enum.cs (GetObsoleteAttribute): Removed.
8999
9000         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
9001         on Enum member is double staged. The first is tested member
9002         and then enum.
9003
9004 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
9005
9006         Fixed #56986, #63631, #65231
9007
9008         * class.cs: (TypeContainer.AddToMemberContainer): New method,
9009         adds member to name container.
9010         (TypeContainer.AddToTypeContainer): New method, adds type to
9011         name container.
9012         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
9013         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
9014         AddOperator): Simplified by reusing AddToMemberContainer.
9015         (TypeContainer.UserDefinedStaticConstructor): Changed to property
9016         instead of field.
9017         (Method.CheckForDuplications): Fixed implementation to test all
9018         possibilities.
9019         (MemberBase): Detection whether member is explicit interface
9020         implementation is now in constructor.
9021         (MemberBase.UpdateMemberName): Handles IndexerName.
9022         (Accessor): Changed to keep also location information.
9023         (AbstractPropertyEventMethod): Is derived from MemberCore.
9024         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
9025         will be emited or not.
9026         (PropertyBase.AreAccessorsDuplicateImplementation):
9027         Tests whether accessors are not in collision with some method.
9028         (Operator): Is derived from MethodCore to simplify common
9029         operations.
9030
9031         * decl.cs (Flags.TestMethodDuplication): Test for duplication
9032         must be performed.
9033         (DeclSpace.AddToContainer): Adds the member to defined_names
9034         table. It tests for duplications and enclosing name conflicts.
9035
9036         * enum.cs (EnumMember): Clean up to reuse the base structures
9037
9038 2004-09-03  Martin Baulig  <martin@ximian.com>
9039
9040         Merged latest changes into gmcs.  Please keep this comment in
9041         here, it makes it easier for me to see what changed in MCS since
9042         the last time I merged.
9043
9044 2004-09-03  Martin Baulig  <martin@ximian.com>
9045
9046         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9047         into TypeContainer, to make partial classes work again.
9048
9049 2004-09-03  Martin Baulig  <martin@ximian.com>
9050
9051         * rootcontext.cs (RootContext.V2): Removed.
9052
9053 2004-03-23  Martin Baulig  <martin@ximian.com>
9054
9055         * expression.cs (Invocation.OverloadResolve): Added `bool
9056         may_fail' argument and use it instead of the Location.IsNull() hack.
9057
9058 2004-09-09  Martin Baulig  <martin@ximian.com>
9059
9060         * cs-parser.jay (namespace_declaration): Fixed CS0134 reporting.
9061
9062 2004-09-09  Martin Baulig  <martin@ximian.com>
9063
9064         * generic.cs (TypeParameter.DefineType): Added support for
9065         explicit interface methods.
9066
9067 2004-09-09  Martin Baulig  <martin@ximian.com>
9068
9069         * README.Changes: New document.  Started to list important changes
9070         between MCS and GMCS here.
9071
9072 2004-09-08  Martin Baulig  <martin@ximian.com>
9073
9074         * class.cs
9075         (TypeContainer.CheckRecursiveDefinition): New protected method.
9076         (TypeContainer.DefineType): Move the CS0146 check into
9077         CheckRecursiveDefinition().     
9078
9079 2004-09-06  Martin Baulig  <martin@ximian.com>
9080
9081         * generic.cs (ConstructedType.CheckConstraints): Allow builtin
9082         types for the constructor constraint.
9083
9084 2004-09-03  Martin Baulig  <martin@ximian.com>
9085
9086         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
9087         into TypeContainer, to make partial classes work again.
9088
9089 2004-09-03  Martin Baulig  <martin@ximian.com>
9090
9091         * rootcontext.cs (RootContext.V2): Removed.
9092
9093 2004-03-23  Martin Baulig  <martin@ximian.com>
9094
9095         * expression.cs (Invocation.OverloadResolve): Added `bool
9096         may_fail' argument and use it instead of the Location.IsNull() hack.
9097
9098 2004-09-03  Martin Baulig  <martin@ximian.com>
9099
9100         Merged latest changes into gmcs.  Please keep this comment in
9101         here, it makes it easier for me to see what changed in MCS since
9102         the last time I merged.
9103
9104 2004-09-03  Raja R Harinath  <rharinath@novell.com>
9105
9106         Fix #61128.
9107         * expression.cs (BetterConversion): Don't allow either conversion 
9108         to be null.  Remove redundant implicit conversion test when 'q ==
9109         null' -- when this function is invoked, we already know that the
9110         implicit conversion exists.
9111         (BetterFunction): Assume that 'best' is non-null.  Remove
9112         redundant reimplementation of IsApplicable when 'best' is null.
9113         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
9114         number of arguments.
9115         (IsAncestralType): Extract from OverloadResolve.
9116         (OverloadResolve): Make robust to the MethodGroupExpr being
9117         unsorted.  Implement all the logic of Section 14.5.5.1, and
9118         support overloading of methods from multiple applicable types.
9119         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
9120
9121         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
9122         (RealError, Warning): Append type of report to related symbol.
9123
9124 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
9125
9126         * enum.cs: Fixed CLS-Compliance checks for enum members.
9127         Error tests cs3008-8.cs, cs3014-8.cs
9128
9129 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9130
9131         Fixed bug #62342, #63102
9132         * class.cs: ImplementIndexer uses member.IsExplicitImpl
9133         like ImplementMethod.
9134
9135 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
9136
9137         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9138         Fixed bug #65170.
9139
9140 2004-09-02  Martin Baulig  <martin@ximian.com>
9141
9142         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9143         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9144         on the MethodBase.
9145
9146 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
9147
9148         C# 2.0 Static classes implemented
9149
9150         * class.cs (TypeContainer): instance_constructors,
9151         initialized_fields, initialized_static_fields,
9152         default_constructor, base_inteface_types are protected to be
9153         accessible from StaticClass.
9154         (TypeContainer.DefineDefaultConstructor): New virtual method
9155         for custom default constructor generating
9156         (StaticClass): New class to handle "Static classes" feature.
9157
9158         * cs-parser.jay: Handle static keyword on class like instance
9159         of StaticClass.
9160
9161         * driver.cs: Added "/langversion" command line switch with two
9162         options (iso-1, default).
9163
9164 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
9165
9166         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
9167
9168 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
9169
9170         * delegate.cs: Style.
9171
9172 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
9173
9174         * delegate.cs: Add seperate instance expr field for miguel.
9175
9176 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9177
9178         * PointerArithmetic (Resolve): make sure we are not doing
9179         pointer arith on void*. Also, make sure we are resolved
9180         by not setting eclass until resolve.
9181
9182         All callers: Make sure that PointerArithmetic gets resolved.
9183
9184 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9185
9186         * ArrayCreation (LookupType): If the type does not resolve 
9187         to an array, give an error.
9188
9189 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
9190
9191         * statement.cs (Try.Resolve): Fixed bug #64222
9192
9193 2004-08-27  Martin Baulig  <martin@ximian.com>
9194
9195         * class.cs
9196         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9197         crash here.     
9198
9199 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9200
9201         * ecore.cs (Constantify): Get underlying type via
9202         System.Enum.GetUnderlyingType to avoid StackOverflow on the
9203         Windows in special cases.
9204
9205 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
9206
9207         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
9208         for obtaining also private methods.
9209         (GetRemoveMethod): Used GetRemoveMethod (true)
9210         for obtaining also private methods.
9211
9212 2004-09-02  Martin Baulig  <martin@ximian.com>
9213
9214         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
9215         TypeManager.GetArgumentTypes() rather than calling GetParameters()
9216         on the MethodBase.
9217
9218 2004-08-27  Martin Baulig  <martin@ximian.com>
9219
9220         * class.cs
9221         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
9222         crash here.     
9223
9224 2004-08-25  Martin Baulig  <martin@ximian.com>
9225
9226         * support.cs (ReflectionParameters..ctor): If this is a generic
9227         method, retrieve and store its type parameters.
9228         (InternalParameters..ctor): Added `TypeParameter[]' argument.
9229         (ReflectionParameters.GenericConstraints): The argument specifies
9230         the type parameter, not the method parameter.
9231         (InternalParameters.GenericConstraints): Likewise.
9232
9233         * generic.cs (TypeParameter.DefineType): Correctly handle
9234         constraints wrt. generic methods in interfaces and their
9235         implementations.        
9236
9237 2004-08-24  Martin Baulig  <martin@ximian.com>
9238
9239         * generic.cs (TypeParameter.IsSubclassOf): New public method.
9240         (Constraints.IsSubclassOf): New internal method.
9241
9242         * typemanager.cs (TypeManager.FindMembers): Added special support
9243         for GenericTypeParameterBuilder's.      
9244         (TypeManager.IsSubclassOf, IsFamilyAccessible): Added support for
9245         type parameters.
9246
9247 2004-08-24  Martin Baulig  <martin@ximian.com>
9248
9249         * typemanager.cs
9250         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
9251         this for accessibility checks.
9252         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
9253         IsNestedFamilyAccessible.
9254         (TypeManager.IsSubclassOf): New method, do what the name actually
9255         says.   
9256
9257 2004-08-24  Martin Baulig  <martin@ximian.com>
9258
9259         * expression.cs (MemberAccess.DoResolve): When resolving ourselves
9260         as a SimpleName, include the generic arity.
9261
9262 2004-08-24  Martin Baulig  <martin@ximian.com>
9263
9264         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
9265         MethodAttributes.HideBySig for operators.
9266
9267 2004-08-23  Martin Baulig  <martin@ximian.com>
9268
9269         Back to the old error reporting system :-)
9270
9271         * report.cs (Message): Removed.
9272         (Report.MessageData, ErrorData, WarningData): Removed.
9273         (Report.Error, Warning): Back to the old system.
9274
9275 2004-08-23  Martin Baulig  <martin@ximian.com>
9276
9277         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
9278
9279         * class.cs (TypeContainer.ParentContainer): New public virtual
9280         method; replaces the explicit interface implementation.
9281         (ClassPart.ParentContainer): Override.
9282
9283 2004-08-23  Martin Baulig  <martin@ximian.com>
9284
9285         * statement.cs (Switch): Added support for constant switches; see
9286         #59428 or test-285.cs.
9287
9288 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9289
9290         Fixed bug #62740.
9291         * statement.cs (GetEnumeratorFilter): Removed useless
9292         logic because C# specs is strict. GetEnumerator must be
9293         public.
9294
9295 2004-08-22  Martin Baulig  <martin@ximian.com>
9296
9297         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9298         a switch and may break, reset the barrier.  Fixes #59867.
9299
9300 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
9301
9302         CLS-Compliance speed up (~5% for corlib)
9303
9304         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
9305         New method. Tests container for CLS-Compliant names
9306
9307         * class.cs (TypeContainer.VerifyClsName): New method.
9308         Checks whether container name is CLS Compliant.
9309         (Constructor): Implements IMethodData.
9310
9311         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
9312         low-case table for CLS Compliance test.
9313         (MemberCache.VerifyClsParameterConflict): New method.
9314         Checks method parameters for CS3006 error.
9315
9316         * enum.cs (EnumMember): Is derived from MemberCore.
9317         (Enum.VerifyClsName): Optimized for better performance.
9318
9319 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9320
9321         * report.cs: Renamed Error_T to Error and changed all
9322         references.
9323
9324 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
9325
9326         * class.cs (TypeContainer.IndexerArrayList): New inner class
9327         container for indexers.
9328         (TypeContainer.DefaultIndexerName): New constant for default
9329         indexer name. Replaced all "Item" with this constant.
9330         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
9331
9332         * typemanager.cs (TypeManager.default_member_ctor): Cache here
9333         DefaultMemberAttribute constructor.
9334
9335 2004-08-05  Martin Baulig  <martin@ximian.com>
9336
9337         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
9338         Fix bug #59429.
9339
9340 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
9341
9342         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
9343         multi platforms problem.
9344
9345         * compiler.csproj: Included shared files.
9346
9347 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9348
9349         Fix bug 60333, 55971 in the more general way
9350         * attribute.cs (Attribute.GetAttributeArgumentExpression):
9351         Added arg_type argument for constant conversion.
9352         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
9353
9354 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9355
9356         Fix bug #59760
9357         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
9358         OperatorArrayList, MethodCoreArrayList for typecontainer
9359         containers. Changed class member types to these new types.
9360         (MethodArrayList.DefineMembers): Added test for CS0659.
9361
9362 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
9363
9364         * cfold.cs: Synchronize the folding with the code in expression.cs
9365         Binary.DoNumericPromotions for uint operands.
9366
9367         * attribute.cs: Revert patch from Raja, it introduced a regression
9368         while building Blam-1.2.1 (hard to isolate a test case).
9369
9370 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
9371
9372         Fix for #55382
9373         * class.cs:
9374         (TypeContainer.Define): Renamed to DefineContainerMembers because of
9375         name collision.
9376         (MethodCore.parent_method): New member. The method we're overriding
9377         if this is an override method.
9378         (MethodCore.CheckBase): Moved from Method class and made common.
9379         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
9380         private.
9381         (MethodCore.CheckForDuplications): New abstract method. For custom
9382         member duplication search in a container
9383         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
9384         method and its return type.
9385         (Event.conflict_symbol): New member. Symbol with same name in the
9386         parent class.
9387
9388         * decl.cs:
9389         (MemberCache.FindMemberWithSameName): New method. The method
9390         is looking for conflict with inherited symbols.
9391
9392 2004-08-04  Martin Baulig  <martin@ximian.com>
9393
9394         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9395
9396         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9397
9398 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9399
9400         * report.cs (Message): New enum for better error, warning reference in
9401         the code.
9402         (MessageData): New inner abstract class. It generally handles printing of
9403         error and warning messages.
9404         Removed unused Error, Warning, Message methods.
9405
9406 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9407
9408         Fix for cs0592-8.cs test
9409         * attribute.cs
9410         (Attributable.ValidAttributeTargets): Made public.
9411         (Attribute.ExplicitTarget): New member for explicit target value.
9412         (Attribute.CheckTargets): Now we translate explicit attribute
9413         target to Target here.
9414
9415 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
9416
9417         * ecore.cs (MethodGroupExpr): new IsBase property.
9418
9419         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
9420
9421         * delegate.cs (DelegateCreation): store a MethodGroupExpr
9422         rather than an instance expr.
9423
9424         (DelegateCreation.Emit): Use the method group rather than
9425         the instance expression. Also, if you have base.Foo as the
9426         method for a delegate, make sure to emit ldftn, not ldftnvirt.
9427
9428         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
9429
9430         (NewDelegate.DoResolve): Only check for the existance of Invoke
9431         if the method is going to be needed. Use MethodGroupExpr.
9432
9433         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
9434
9435         * expression.cs: For pointer arith., make sure to use
9436         the size of the type, not the size of the pointer to
9437         the type.
9438
9439 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
9440
9441         Fix for #60722
9442         * class.cs (Class): Added error CS0502 test.
9443
9444 2004-08-03  John Luke  <jluke@cfl.rr.com>
9445             Raja R Harinath  <rharinath@novell.com>
9446
9447         Fix for #60997.
9448         * attribute.cs (Attribute.complained_before): New flag.
9449         (Attribute.ResolveType, Attribute.Resolve),
9450         (Attribute.DefinePInvokeMethod): Set it.
9451         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
9452         
9453 2004-08-03  Martin Baulig  <martin@ximian.com>
9454
9455         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9456         use a user-defined operator; we still need to do numeric
9457         promotions in case one argument is a builtin type and the other
9458         one has an implicit conversion to that type.  Fixes #62322.
9459
9460 2004-08-18  Martin Baulig  <martin@ximian.com>
9461
9462         * class.cs (Method.Define): Use the correct method name when
9463         creating the MethodBuilder for a generic method.
9464
9465 2004-08-17  Martin Baulig  <martin@ximian.com>
9466
9467         * generic.cs (Constraints): Support type parameter constraints.
9468
9469 2004-08-16  Martin Baulig  <martin@ximian.com>
9470
9471         * cs-tokenizer.cs (Tokenizer.TypeOfParsing): New public property.
9472         (Token.GENERIC_DIMENSION): New token; this is returned if we
9473         encounter an unbound generic type in a typeof() expression.
9474
9475         * cs-parser.jay (opt_type_argument_list): Added GENERIC_DIMENSION;
9476         this token is only generated while parsing a typeof() expression.
9477         (typeof_expression): Removed the old unbound_type hack.
9478
9479         * generic.cs (TypeArguments.IsUnbound): New public property.
9480
9481         * decl.cs (MemberName): Added support for unbound types.
9482
9483 2004-08-14  Martin Baulig  <martin@ximian.com>
9484
9485         * typemanager.cs
9486         (TypeManager.IsEqualGenericInstance): New static method.
9487         (TypeManager.IsSubclassOrNestedChildOf, IsSubclassOf): This is
9488         just used to check accessibility, so follow the rules of 26.1.6.        
9489
9490         * expression.cs (MemberAccess.ResolveAsTypeStep): Return a
9491         ConstructedType instead of a TypeExpression if we have type arguments.
9492
9493         * cs-parser.jay (typeof_expression): Support unbound generic types.
9494
9495         * ecore.cs (UnboundTypeExpression): New public class.
9496
9497 2004-08-12  Martin Baulig  <martin@ximian.com>
9498
9499         * typemanager.cs (TypeManager.IsNestedChildOf): Use
9500         TypeManager.IsEqual() rather than `=='.
9501
9502         * decl.cs (DeclSpace.CheckAccessLevel): Use `tb.FullName' for
9503         generic instances as well.
9504
9505 2004-08-12  Martin Baulig  <martin@ximian.com>
9506
9507         * expression.cs (Invocation.InferType): We can only infer method
9508         type parameters.  Fixes #62647.
9509
9510 2004-08-11  Martin Baulig  <martin@ximian.com>
9511
9512         * class.cs (TypeContainer.DefineType): Create the TypeBuilder
9513         before resolving the base classes.
9514
9515 2004-08-06 Gonzalo Paniagua Javier <gonzalo@ximian.com>
9516
9517         * Makefile: install .mdb file too.
9518
9519 2004-08-05  Martin Baulig  <martin@ximian.com>
9520
9521         * ecore.cs (FieldExpr.DoResolveLValue): If we're resolving a field
9522         initializer, the current type is just the TypeBuilder, not the
9523         instantiated generic type.
9524         (FieldExpr.IsFieldInitializer): New public property.
9525
9526 2004-08-04  Martin Baulig  <martin@ximian.com>
9527
9528         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
9529
9530         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
9531
9532 2004-08-03  Martin Baulig  <martin@ximian.com>
9533
9534         * class.cs (MethodData.Define): If we're an explicit
9535         implementation, remove the generic arity from the type name.
9536
9537 2004-08-03  Martin Baulig  <martin@ximian.com>
9538
9539         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
9540         use a user-defined operator; we still need to do numeric
9541         promotions in case one argument is a builtin type and the other
9542         one has an implicit conversion to that type.  Fixes #62322.
9543
9544 2004-08-02  Martin Baulig  <martin@ximian.com>
9545
9546         * class.cs (TypeContainer.ifaces): Make this a `Type[]', not a
9547         `TypeExpr[]' array.
9548         (TypeContainer.GetClassBases): Return the unexpanded list of
9549         interfaces; we expand them later.
9550         (TypeContainer.DefineType): After creating the TypeBuilder, call
9551         TypeManager.ExpandInterfaces() to get an expanded and resolved
9552         list of interfaces.
9553
9554         * ecore.cs (TypeExpr.GetInterfaces): Removed
9555
9556         * generics.cs (Constraints.InterfaceConstraints): Remove.
9557         (TypeParameter.DefineType): Call TypeManager.RegisterBuilder() to
9558         register the interface constraints.
9559
9560         * typemanager.cs
9561         (TypeManager.AddUserType): Removed the `ifaces' argument.
9562         (TypeManager.AddTypeParameter): Likewise.
9563         (TypeManager.AddUserInterface): Removed, was unused.
9564         (TypeManager.RegisterBuilder): Take a `Type[]' instead of a
9565         `TypeExpr[]' array for the interfaces.
9566         (TypeManager.ExpandInterfaces): Call this after the TypeBuilder
9567         has been defined, returns a list of the resolved interfaces types.
9568         (TypeManager.GetInterfaces): Return a `Type[]', not a `TypeExpr[]'.
9569         (TypeManager.GetExplicitInterfaces): Likewise.  
9570
9571 2004-08-02  Martin Baulig  <martin@ximian.com>
9572
9573         * expression.cs (Invocation.EmitCall): If we're invoking a method
9574         on a type parameter, use the new `Constrained' prefix opcode.
9575
9576 2004-08-02  Martin Baulig  <martin@ximian.com>
9577
9578         * statement.cs (LocalInfo.Flags): Added `IsThis'.
9579         (LocalInfo.IsThis): New public property.
9580         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
9581
9582 2004-08-01  Martin Baulig  <martin@ximian.com>
9583
9584         * class.cs (TypeContainer.GetClassBases): Don't set the default
9585         here since we may get called from GetPartialBases().
9586         (TypeContainer.DefineType): If GetClassBases() didn't return a
9587         parent, use the default one.
9588
9589 2004-07-30  Martin Baulig  <martin@ximian.com>
9590
9591         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
9592
9593         * class.cs (SourceMethod): New public class, derive from the
9594         symbol writer's ISourceMethod.
9595         (Method): Use the new symbol writer API.
9596
9597         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
9598         as argument and use the new symbol writer.
9599
9600         * location.cs
9601         (SourceFile): Implement the symbol writer's ISourceFile.
9602         (Location.SymbolDocument): Removed.
9603         (Location.SourceFile): New public property.
9604
9605         * symbolwriter.cs: Use the new symbol writer API.
9606
9607 2004-07-30  Raja R Harinath  <rharinath@novell.com>
9608
9609         * Makefile (install-local): Remove.  Functionality moved to
9610         executable.make.
9611
9612 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
9613
9614         * Makefile: Install mcs.exe.config file together with mcs.exe.
9615         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
9616         correct runtime version.
9617         
9618 2004-07-25  Martin Baulig  <martin@ximian.com>
9619
9620         * class.cs
9621         (TypeContainer.RegisterOrder): Removed, this was unused.
9622         (TypeContainer, interface_order): Removed.
9623         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
9624         TypeContainer as argument since we can also be called with a
9625         `PartialContainer' for a partial class/struct/interface.
9626         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
9627         of checking whether we're an `Interface' - we could be a
9628         `PartialContainer'.
9629         (PartialContainer.Register): Override; call
9630         AddClass()/AddStruct()/AddInterface() on our parent.
9631
9632         * cs-parser.jay (interface_member_declaration): Add things to the
9633         `current_container', not the `current_class'.
9634
9635         * rootcontext.cs (RegisterOrder): The overloaded version which
9636         takes an `Interface' was unused, removed.
9637
9638         * typemanager.cs (TypeManager.LookupInterface): Return a
9639         `TypeContainer', not an `Interface'.
9640         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
9641         contain a `PartialContainer' for an interface, so check it's
9642         `Kind' to figure out what it is.
9643
9644 2004-07-25  Martin Baulig  <martin@ximian.com>
9645
9646         * class.cs (Class.DefaultTypeAttributes): New public constant.
9647         (Struct.DefaultTypeAttributes): Likewise.
9648         (Interface.DefaultTypeAttributes): Likewise.
9649         (PartialContainer.TypeAttr): Override this and add the
9650         DefaultTypeAttributes.
9651
9652 2004-07-25  Martin Baulig  <martin@ximian.com>
9653
9654         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
9655         we can just use the `Parent' field instead.
9656
9657 2004-07-25  Martin Baulig  <martin@ximian.com>
9658
9659         * class.cs (TypeContainer.Emit): Renamed to EmitType().
9660
9661 2004-07-25  Martin Baulig  <martin@ximian.com>
9662
9663         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
9664         our parts before defining any methods.
9665         (TypeContainer.VerifyImplements): Make this virtual.
9666         (ClassPart.VerifyImplements): Override and call VerifyImplements()
9667         on our PartialContainer.
9668
9669 2004-07-25  Martin Baulig  <martin@ximian.com>
9670
9671         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
9672
9673         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
9674         argument, we can just use the `Parent' field instead.
9675
9676         * class.cs
9677         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
9678         (MemberBase.DoDefine): Likewise.
9679
9680 2004-07-24  Martin Baulig  <martin@ximian.com>
9681
9682         * decl.cs (MemberCore.Parent): New public field.
9683         (DeclSpace.Parent): Moved to MemberCore.
9684
9685         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
9686         (MemberBase.ctor): Added TypeContainer argument, pass it to our
9687         parent's .ctor.
9688         (FieldBase, Field, Operator): Likewise.
9689         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
9690         (EventField, Event): Likewise.
9691
9692 2004-07-23  Martin Baulig  <martin@ximian.com>
9693
9694         * class.cs (PartialContainer): New public class.
9695         (ClassPart): New public class.
9696         (TypeContainer): Added support for partial classes.
9697         (TypeContainer.GetClassBases): Splitted some of the functionality
9698         out into GetNormalBases() and GetPartialBases().
9699
9700         * cs-tokenizer.cs (Token.PARTIAL): New token.
9701         (Tokenizer.consume_identifier): Added some hacks to recognize
9702         `partial', but only if it's immediately followed by `class',
9703         `struct' or `interface'.
9704
9705         * cs-parser.jay: Added support for partial clases.
9706
9707 2004-07-23  Martin Baulig  <martin@ximian.com>
9708
9709         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
9710         a `DeclSpace' and also made it readonly.
9711         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
9712         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
9713         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
9714
9715         * cs-parser.jay: Pass the `current_class', not the
9716         `current_container' (at the moment, this is still the same thing)
9717         to a new Method, Property, Event, Indexer or Constructor.
9718
9719 2004-07-23  Martin Baulig  <martin@ximian.com>
9720
9721         * cs-parser.jay (CSharpParser): Added a new `current_class' field
9722         and removed the `current_interface' one.
9723         (struct_declaration, class_declaration, interface_declaration):
9724         Set `current_class' to the newly created class/struct/interface;
9725         set their `Bases' and call Register() before parsing their body.
9726
9727 2004-07-23  Martin Baulig  <martin@ximian.com>
9728
9729         * class.cs (Kind): New public enum.
9730         (TypeContainer): Made this class abstract.
9731         (TypeContainer.Kind): New public readonly field.
9732         (TypeContainer.CheckDef): New public method; moved here from
9733         cs-parser.jay.
9734         (TypeContainer.Register): New public abstract method.
9735         (TypeContainer.GetPendingImplementations): New public abstract
9736         method.
9737         (TypeContainer.GetClassBases): Removed the `is_class' and
9738         `is_iface' parameters.
9739         (TypeContainer.DefineNestedTypes): Formerly known as
9740         DoDefineType().
9741         (ClassOrStruct): Made this class abstract.
9742
9743         * tree.cs (RootTypes): New public type. 
9744
9745 2004-07-20  Martin Baulig  <martin@ximian.com>
9746
9747         * tree.cs (Tree.RecordNamespace): Removed.
9748         (Tree.Namespaces): Removed.
9749
9750         * rootcontext.cs (RootContext.IsNamespace): Removed.
9751
9752         * cs-parser.jay (namespace_declaration): Just create a new
9753         NamespaceEntry here.
9754
9755 2004-07-21  Lluis Sanchez Gual  <lluis@novell.com>
9756
9757         * Makefile: Install gmcs.exe.config file together with gmcs.exe.
9758         * gmcs.exe.config: Renamed from mcs.exe.config. Added supportedRuntime
9759         entry to make sure it runs in the correct runtime version.
9760         
9761 2004-07-18  Martin Baulig  <martin@ximian.com>
9762
9763         * generic.cs (ConstructedType.CheckConstraints): Improved
9764         constraints checking.
9765
9766 2004-07-18  Martin Baulig  <martin@ximian.com>
9767
9768         * expression.cs (Invocation.BetterMethod): Call
9769         TypeManager.TypeToCoreType() on all types and removed my previous
9770         hack; we're already doig the right thing here.
9771
9772 2004-07-17  Martin Baulig  <martin@ximian.com>
9773
9774         * decl.cs (MemberName.MakeName): Create the "class`1" names here.
9775
9776 2004-07-16  Martin Baulig  <martin@ximian.com>
9777
9778         * iterators.cs: Added generics support.
9779
9780 2004-07-16  Martin Baulig  <martin@ximian.com>
9781
9782         * iterators.cs: Rewrote this.  We're now using one single Proxy
9783         class for both the IEnumerable and the IEnumerator interface and
9784         `Iterator' derives from Class so we can use the high-level API.
9785
9786         * class.cs (TypeContainer.AddIterator): New method.
9787         (TypeContainer.DoDefineType): New protected virtual method, which
9788         is called from DefineType().
9789         (TypeContainer.DoDefineMembers): Call DefineType() and
9790         DefineMembers() on all our iterators.
9791         (TypeContainer.Emit): Call Emit() on all our iterators.
9792         (TypeContainer.CloseType): Call CloseType() on all our iterators.
9793
9794         * codegen.cs (EmitContext.CurrentIterator): New public field.
9795
9796 2004-07-15  Martin Baulig  <martin@ximian.com>
9797
9798         * typemanager.cs
9799         (TypeManager.not_supported_exception_type): New type.   
9800
9801 2004-07-14  Martin Baulig  <martin@ximian.com>
9802
9803         * typemanager.cs
9804         (TypeManager.generic_ienumerable_type): New type.
9805         (TypeManager.generic_ienumerator_type): New type.
9806
9807         * rootcontext.cs
9808         (RootContext.interfaces_first_stage): Added
9809         "System.Collections.Generic.IEnumerator`1" and
9810         "System.Collections.Generic.IEnumerable`1".     
9811
9812 2004-07-14  Martin Baulig  <martin@ximian.com>
9813
9814         * iterators.cs: Use real error numbers.
9815
9816 2004-07-14  Martin Baulig  <martin@ximian.com>
9817
9818         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
9819         requires this to be a System.Collection.IEnumerable and not a
9820         class implementing that interface.
9821         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
9822
9823 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
9824
9825         * class.cs: Fixed previous fix, it broke some error tests.
9826
9827 2004-07-12  Martin Baulig  <martin@ximian.com>
9828
9829         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
9830         Fixes #61293.
9831
9832 2004-07-14  Martin Baulig  <martin@ximian.com>
9833
9834         * decl.cs, expression.cs, generic.cs: Use a backqoute (`) and not
9835         an exclamation mark (!) for the generic arity to reflect the
9836         latest spec changes; ie. use "System.Collections.Generic.IList`1".
9837
9838 2004-07-13  Martin Baulig  <martin@ximian.com>
9839
9840         * cs-tokenizer.cs (Tokenizer.parse_less_than): Allow array rank
9841         specifiers being part of a type argument.
9842
9843 2004-07-13  Martin Baulig  <martin@ximian.com>
9844
9845         * expression.cs (MemberAccess.ResolveAsTypeStep): Use the full `!'
9846         name for generic types.
9847
9848 2004-07-13  Martin Baulig  <martin@ximian.com>
9849
9850         * assign.cs (Assign.DoResolve): Moved the CS0131 check up a little
9851         bit to fix #60119.
9852
9853 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
9854
9855         * assign.cs (LocalTemporary): Add new argument: is_address,If
9856         `is_address' is true, then the value that we store is the address
9857         to the real value, and not the value itself.
9858         
9859         * ecore.cs (PropertyExpr): use the new local temporary
9860         stuff to allow us to handle X.Y += z (where X is a struct)
9861
9862 2004-07-08  Martin Baulig  <martin@ximian.com>
9863
9864         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
9865         not always return, just like we're doing in Using.Resolve().
9866
9867 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
9868
9869         * cs-parser.jay (fixed_statement): flag this as Pinned.
9870
9871 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
9872
9873         * typemanager.cs (TypeManager): Removed MakePinned method, this
9874         mechanism is replaced with the .NET 2.x compatible mechanism of
9875         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
9876
9877         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
9878         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
9879         `IsFixed' property which has a different meaning.
9880
9881 2004-07-02  Raja R Harinath  <rharinath@novell.com>
9882
9883         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
9884         visible from inside a nested class, not just the names of the
9885         immediately enclosing class.
9886         Fix for bug #60730.
9887
9888 2004-06-24  Raja R Harinath  <rharinath@novell.com>
9889
9890         * expression.cs (BetterConversion): Remove buggy special-case
9891         handling of "implicit constant expression conversions".  At this
9892         point, we already know that the conversion is possible -- we're
9893         only checking to see which is better.
9894
9895 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9896
9897         * cs-parser.jay: Added error CS0210 test.
9898
9899 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9900
9901         * cs-parser.jay: Added error CS0134 test.
9902
9903 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9904
9905         Fix bug #52507
9906         * cs-parser.jay: Added error CS0145 test.
9907
9908 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
9909
9910         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
9911
9912 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
9913         
9914         * expression.cs (StackAlloc.Resolve): The argument may not
9915         be a constant; deal with this case.
9916         
9917 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
9918
9919         * attribute.cs (IndexerName_GetIndexerName): Renamed to
9920         GetIndexerAttributeValue.
9921         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
9922
9923         * class.cs (Indexer.Define): Added error tests for CS0415,
9924         CS0609.
9925
9926 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
9927
9928         * attribute.cs (Attribute.Resolve): Keep field code in sync with
9929         property code.
9930
9931 2004-06-23  Martin Baulig  <martin@ximian.com>
9932
9933         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
9934         neither return nor throw, reset the barrier as well.  Fixes #60457.
9935
9936 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
9937
9938         * class.cs : EventAttributes is now set to None by default.
9939           This fixes bug #60459.
9940
9941 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9942
9943         Fix bug #60219
9944         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
9945         Don't throw exception but return null (it's sufficient now).
9946
9947 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
9948
9949         * typemanager.cs (GetArgumentTypes): Faster implementation.
9950
9951 2004-06-18  Martin Baulig  <martin@ximian.com>
9952
9953         * attribute.cs (Attribute.Resolve): Check whether we're an
9954         EmptyCast which a Constant child.  Fixes #60333.
9955
9956 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
9957
9958         * statement.cs (EmitCollectionForeach): Account for the fact that
9959         not all valuetypes are in areas which we can take the address of.
9960         For these variables, we store to a temporary variable. Also, make
9961         sure that we dont emit a `callvirt' on a valuetype method.
9962
9963 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9964
9965         * expression.cs (StackAlloc.DoReSolve): Added test for
9966         negative parameter (CS0247).
9967
9968 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9969
9970         Fix bug #59792
9971         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
9972
9973 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
9974
9975         Fix bug #59781
9976         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
9977         ulong.
9978
9979 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9980
9981         Fix bug #58254 & cs1555.cs, cs1556.cs
9982         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
9983
9984 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
9985
9986         * cs-parser.jay: Added error CS1669 test for indexers.
9987
9988 2004-06-18  Martin Baulig  <martin@ximian.com>
9989
9990         * generics.cs (GenericMethod.ctor): Don't take an Attributes
9991         argument.  Fixes #60441.
9992
9993 2004-06-16  Ben Maurer  <bmaurer@ximian.com>
9994         * ecore.cs (MethodGroupExpr.Name): Revert Martin's patch.
9995         The name needs to have the actual name of the method in order
9996         for other tests (such as the one in OverloadResolve for Invoke
9997         on a delegate) to work. As well, it does not really help
9998         error reporting because the method group had multiple methods.
9999         * Makefile: Remove MCS_DEBUG, you can enable with the DEBUG_FLAGS.
10000         Make profiling work.
10001         
10002 2004-06-13  Martin Baulig  <martin@ximian.com>
10003
10004         * cs-parser.jay: Don't allow generic attributes.
10005
10006 2004-06-13  Martin Baulig  <martin@ximian.com>
10007
10008         * class.cs (MemberBase.DoDefineBase): New protected method.
10009         (MemberBase.DoDefine): Compute the `flags' in the new
10010         DoDefineBase() which must be called first.
10011         (Method.Define): Call DoDefineBase() first so we have the flags
10012         when defining the generic method.
10013
10014         * cs-parser.jay (interface_method_declaration): Support generic methods.
10015
10016 2004-06-13  Martin Baulig  <martin@ximian.com>
10017
10018         * decl.cs (TypeName): Removed.
10019         (MemberName): Removed TypeName and MemberNow; now we just have
10020         MemberName.
10021
10022         * cs-parser.jay: Don't distinguish between type arguments and type
10023         parameters in the grammar and simplified the rules a bit.  The
10024         reduce/reduce conflicts are now gone (except the one we inherited
10025         from mcs).
10026
10027 2004-06-11  Martin Baulig  <martin@ximian.com>
10028
10029         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
10030         call this twice: for params and varargs methods.
10031
10032 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10033
10034         * class.cs:
10035         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
10036
10037 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
10038
10039         * attribute.cs (Attribute.GetValidTargets): Made public.
10040
10041         * class.cs: 
10042         (AbstractPropertyEventMethod): New class for better code sharing.
10043         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
10044         CS1667 report.
10045         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
10046
10047 2004-06-09  Martin Baulig  <martin@ximian.com>
10048
10049         * cs-parser.jay: Removed a reduce/reduce conflict.
10050
10051 2004-06-03  Martin Baulig  <martin@ximian.com>
10052
10053         * generic.cs (ConstructedType.GetMemberAccess): Renamed to
10054         GetSimpleName() and return a SimpleName.
10055
10056         * ecore.cs (SimpleName.Arguments): New public field.
10057         (SimpleName): Added overloaded ctor which takes an additional
10058         TypeArguments argument.
10059         (SimpleName.SimpleNameResolve): Added support for generic methods.
10060         (MethodGroupExpr.ResolveGeneric): New public method.  The code was
10061         formerly in MemberAccess.DoResolve(), but we also need it in
10062         SimpleNameResolve().
10063
10064         * expression.cs (MemberAccess.DoResolve): Use the new
10065         MethodGroupExpr.ResolveGeneric().       
10066
10067 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10068
10069         * decl.cs: If possible, use lookuptypedirect here. We can only do
10070         this if there is no `.' after the namespace. Avoids using
10071         LookupType, which does lots of slow processing.
10072         (FindNestedType) New method, does what it says :-).
10073         * namespace.cs: use LookupTypeDirect.
10074         * rootcontext.cs: use membercache, if possible.
10075         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10076
10077 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10078
10079         * expression.cs:
10080         According to the spec, 
10081
10082         In a member access of the form E.I, if E is a single identifier,
10083         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10084         field, property, localvariable, or parameter with the same type as
10085         the meaning of E as a type-name (§3.8), then both possible
10086         meanings of E are permitted.
10087
10088         We did not check that E as a simple-name had the same type as E as
10089         a type name.
10090
10091         This trivial check gives us 5-7% on bootstrap time.
10092
10093 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10094
10095         * expression.cs (Invocation.OverloadResolve): Avoid the
10096         use of hashtables and boxing here by allocating on demand.
10097
10098 2004-05-30  Martin Baulig  <martin@ximian.com>
10099
10100         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10101         we're doing a silent lookup.  Don't try to lookup nested types in
10102         TypeManager.object_type (thanks to Ben Maurer).
10103
10104 2004-05-30  Martin Baulig  <martin@ximian.com>
10105
10106         Committing a patch from Ben Maurer.
10107
10108         * rootcontext.cs (RootContext.LookupType): Cache negative results.
10109
10110 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10111
10112         * convert.cs: add a trivial cache for overload operator resolution.
10113
10114 2004-05-31  Marek Safar  <marek.safar@seznam.cz>
10115
10116         * attribute.cs
10117         (AttributeTester.GetObsoleteAttribute): Returns instance of
10118         ObsoleteAttribute when type is obsolete.
10119
10120         * class.cs
10121         (TypeContainer.VerifyObsoleteAttribute): Override.
10122         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
10123         (MethodCode.VerifyObsoleteAttribute): Override.
10124         (MemberBase.VerifyObsoleteAttribute): Override.
10125
10126         * decl.cs
10127         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
10128         and report proper error.
10129
10130         *delegate.cs
10131         (Delegate.VerifyObsoleteAttribute): Override.
10132
10133         * ecore.cs
10134         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
10135         and report proper error.
10136         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
10137
10138         * enum.cs
10139         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
10140         and enum member.
10141
10142         * expression.cs
10143         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
10144         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
10145         Added test for ObsoleteAttribute.
10146
10147         * statement.cs
10148         (Catch): Derived from Statement.
10149
10150 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10151
10152         * decl.cs: If possible, use lookuptypedirect here. We can only do
10153         this if there is no `.' after the namespace. Avoids using
10154         LookupType, which does lots of slow processing.
10155         (FindNestedType) New method, does what it says :-).
10156         * namespace.cs: use LookupTypeDirect.
10157         * rootcontext.cs: use membercache, if possible.
10158         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
10159
10160 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10161
10162         * expression.cs:
10163         According to the spec, 
10164
10165         In a member access of the form E.I, if E is a single identifier,
10166         and if the meaning of E as a simple-name (§7.5.2) is a constant,
10167         field, property, localvariable, or parameter with the same type as
10168         the meaning of E as a type-name (§3.8), then both possible
10169         meanings of E are permitted.
10170
10171         We did not check that E as a simple-name had the same type as E as
10172         a type name.
10173
10174         This trivial check gives us 5-7% on bootstrap time.
10175
10176 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10177
10178         Fixed bug #59071 & cs0160.cs
10179         * statement.cs (Try.Resolve): Check here whether order of catch
10180         clauses matches their dependencies.
10181
10182 2004-05-30  Marek Safar  <marek.safar@seznam.cz>
10183
10184         Fixed bug #58624
10185         * ecore.cs (SimpleName.SimpleNameResolve): Added test for
10186         unsafe type.
10187
10188 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10189
10190         * expression.cs (Invocation.OverloadResolve): Avoid the
10191         use of hashtables and boxing here by allocating on demand.
10192
10193 2004-05-30  Martin Baulig  <martin@ximian.com>
10194
10195         * rootcontext.cs (RootContext.LookupType): Don't cache things if
10196         we're doing a silent lookup.  Don't try to lookup nested types in
10197         TypeManager.object_type (thanks to Ben Maurer).
10198
10199 2004-05-30  Martin Baulig  <martin@ximian.com>
10200
10201         Committing a patch from Ben Maurer.
10202
10203         * rootcontext.cs (RootContext.LookupType): Cache negative results.      
10204
10205 2004-05-29  Martin Baulig  <martin@ximian.com>
10206
10207         * class.cs (IMethodData.ShouldIgnore): New method.
10208
10209         * typemanager.cs (TypeManager.MethodFlags): Don't take a
10210         `Location' argument, we don't need it anywhere.  Use
10211         `IMethodData.ShouldIgnore ()' instead of
10212         `MethodData.GetMethodFlags ()'.
10213         (TypeManager.AddMethod): Removed.
10214         (TypeManager.AddMethod2): Renamed to AddMethod.
10215
10216 2004-05-29  Martin Baulig  <martin@ximian.com>
10217
10218         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
10219
10220         * convert.cs (Convert.ImplicitReferenceConversion): If we're
10221         converting from a class type S to an interface type and we already
10222         have an object on the stack, don't box it again.  Fixes #52578.
10223
10224 2004-05-29  Martin Baulig  <martin@ximian.com>
10225
10226         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
10227         Added support for `params' parameters.  Fixes #59267.
10228
10229 2004-05-29  Martin Baulig  <martin@ximian.com>
10230
10231         * literal.cs (NullPointer): Provide a private .ctor which sets
10232         `type' to TypeManager.object_type.  Fixes #59048.
10233
10234 2004-05-29  Martin Baulig  <martin@ximian.com>
10235
10236         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
10237         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
10238
10239         * ecore.cs (EventExpr.instance_expr): Make the field private.
10240
10241 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
10242
10243         Fixed bug #50080 & cs0214-2.cs
10244         * expression.cs (Cast.DoResolve): Check unsafe context here.
10245         
10246         * statement.cs (Resolve.DoResolve): Likewise.
10247
10248 2004-05-26  Martin Baulig  <martin@ximian.com>
10249
10250         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
10251
10252         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
10253         (RootContext.LookupType): Pass down the `silent' flag.
10254
10255 2004-05-25  Martin Baulig  <martin@ximian.com>
10256
10257         * expression.cs
10258         (MethodGroupExpr.IdenticalTypeName): New public property.
10259         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
10260         expression actually refers to a type.
10261
10262 2004-05-25  Martin Baulig  <martin@ximian.com>
10263
10264         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
10265         for #56176 and made it actually work.
10266
10267 2004-05-25  Martin Baulig  <martin@ximian.com>
10268
10269         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
10270         (FieldExpr, PropertyExpr): Override and implement
10271         CacheTemporaries.  Fixes #52279.
10272
10273 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
10274
10275         * location.cs: In the new compiler listing a file twice is a
10276         warning, not an error.
10277
10278 2004-05-24  Martin Baulig  <martin@ximian.com>
10279
10280         * enum.cs (Enum.DefineType): For the `BaseType' to be a
10281         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
10282
10283 2004-05-24  Martin Baulig  <martin@ximian.com>
10284
10285         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
10286         walking the `using' list.  Fixes #53921.
10287
10288 2004-05-24  Martin Baulig  <martin@ximian.com>
10289
10290         * const.cs (Const.LookupConstantValue): Added support for
10291         EmptyCast's; fixes #55251.
10292
10293 2004-05-24  Martin Baulig  <martin@ximian.com>
10294
10295         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
10296         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
10297         which does the CS0135 check.  The reason is that we first need to
10298         check whether the variable actually exists.
10299
10300 2004-05-24  Martin Baulig  <martin@ximian.com>
10301
10302         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
10303         than RootContext.LookupType() to find the explicit interface
10304         type.  Fixes #58584.
10305
10306 2004-05-24  Raja R Harinath  <rharinath@novell.com>
10307
10308         * Makefile: Simplify.  Use executable.make.
10309         * mcs.exe.sources: New file.  List of sources of mcs.exe.
10310
10311 2004-05-24  Anders Carlsson  <andersca@gnome.org>
10312
10313         * decl.cs:
10314         * enum.cs:
10315         Use the invariant culture when doing String.Compare for CLS case
10316         sensitivity.
10317         
10318 2004-05-23  Martin Baulig  <martin@ximian.com>
10319
10320         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
10321         don't have any dots.  Fixes #52622, added cs0246-8.cs.
10322
10323         * namespace.cs (NamespaceEntry.Lookup): Likewise.
10324
10325 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10326
10327         * class.cs (MemberBase.Define): Reuse MemberType member for 
10328         resolved type. Other methods can use it too.
10329
10330 2004-05-23  Martin Baulig  <martin@ximian.com>
10331
10332         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
10333         the variable also exists in the current block (otherwise, we need
10334         to report a CS0103).  Fixes #58670.
10335
10336 2004-05-23  Martin Baulig  <martin@ximian.com>
10337
10338         * flowanalysis.cs (Reachability.Reachable): Compute this
10339         on-the-fly rather than storing it as a field.
10340
10341 2004-05-23  Martin Baulig  <martin@ximian.com>
10342
10343         * flowanalysis.cs (Reachability.And): Manually compute the
10344         resulting `barrier' from the reachability.      
10345        
10346 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
10347
10348         Fix bug #57835
10349         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
10350         instance of ObsoleteAttribute when symbol is obsolete.
10351
10352         * class.cs
10353         (IMethodData): Extended interface for ObsoleteAttribute support.
10354
10355 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10356
10357         * attribute.cs: Fix bug #55970
10358
10359 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
10360
10361         Fix bug #52705
10362         * attribute.cs
10363         (GetObsoleteAttribute): New method. Creates the instance of
10364         ObsoleteAttribute.
10365         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
10366         ObsoleteAttribute when member is obsolete.
10367         (AttributeTester.Report_ObsoleteMessage): Common method for
10368         Obsolete error/warning reporting.
10369
10370         * class.cs
10371         (TypeContainer.base_classs_type): New member for storing parent type.
10372
10373         * decl.cs
10374         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
10375         for this MemberCore.
10376
10377 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10378
10379         * attribute.cs, const.cs: Fix bug #58590
10380
10381 2004-05-21  Martin Baulig  <martin@ximian.com>
10382
10383         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
10384         out parameters if the end of the method is unreachable.  Fixes
10385         #58098. 
10386
10387 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10388
10389         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
10390         Hari was right, why extra method.
10391
10392 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
10393
10394         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
10395
10396 2004-05-20  Martin Baulig  <martin@ximian.com>
10397
10398         * delegate.cs: Convert this file to Unix mode - like the original
10399         version in mcs is.
10400
10401 2004-05-20  Martin Baulig  <martin@ximian.com>
10402
10403         * attribute.cs: Convert this file to Unix mode - like the original
10404         version in mcs is.
10405
10406 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
10407
10408        Fix bug #58688 (MCS does not report error when the same attribute
10409        is assigned twice)
10410
10411        * attribute.cs (Attribute.Emit): Distinction between null and default.
10412
10413 2004-05-19  Raja R Harinath  <rharinath@novell.com>
10414
10415        * cs-parser.jay (attribute): Create a GlobalAttribute for the case
10416        of a top-level attribute without an attribute target.
10417        * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
10418        Make non-static.
10419        (Attribute.Conditional_GetConditionName), 
10420        (Attribute.Obsolete_GetObsoleteMessage): Update.
10421        (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
10422        part of ScanForIndexerName.
10423        (Attribute.CanIgnoreInvalidAttribute): New function.
10424        (Attribute.ScanForIndexerName): Move to ...
10425        (Attributes.ScanForIndexerName): ... here.
10426        (Attributes.Attrs): Rename from now-misnamed AttributeSections.
10427        (Attributes.Search): New internal variant that can choose not to
10428        complain if types aren't resolved.  The original signature now
10429        complains.
10430        (Attributes.GetClsCompliantAttribute): Use internal variant, with
10431        complaints suppressed.
10432        (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
10433        only if it not useful.
10434        (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
10435        top-level for attributes that are shared between the assembly
10436        and a top-level class.
10437        * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
10438        * class.cs: Update to reflect changes.
10439        (DefineIndexers): Fuse loops.
10440        * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
10441        a couple more variants of attribute names.
10442
10443 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
10444
10445         Fix bug #52585 (Implemented explicit attribute declaration)
10446
10447         * attribute.cs:
10448         (Attributable.ValidAttributeTargets): New abstract method. It gets
10449         list of valid attribute targets for explicit target declaration.
10450         (Attribute.Target): It holds target itself.
10451         (AttributeSection): Removed.
10452         (Attribute.CheckTargets): New method. It checks whether attribute
10453         target is valid for the current element.
10454
10455         * class.cs:
10456         (EventProperty): New class. For events that are declared like
10457         property (with add and remove accessors).
10458         (EventField): New class. For events that are declared like field.
10459         class.cs
10460
10461         * cs-parser.jay: Implemented explicit attribute target declaration.
10462
10463         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
10464         Override ValidAttributeTargets.
10465
10466         * parameter.cs:
10467         (ReturnParameter): Class for applying custom attributes on 
10468         the return type.
10469         (ParameterAtribute): New class. Class for applying custom
10470         attributes on the parameter type.
10471
10472 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
10473
10474         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
10475         definitions. 
10476
10477         (Method): Allow UNSAFE here.
10478
10479         * modifiers.cs: Support unsafe reporting.
10480
10481 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
10482
10483         * decl.cs: Fix bug #58478.
10484
10485 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10486
10487         * statement.cs: When checking for unreachable code on an EmptyStatement,
10488         set the location. Fixes bug #58488.
10489
10490 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
10491
10492         * driver.cs: Add -pkg handling.
10493
10494         From Gonzalo: UseShelLExecute=false
10495
10496 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
10497
10498         * attribute.cs:
10499         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
10500         for attribute.
10501         (Attribute.IsClsCompliaceRequired): Moved to base for better
10502         accesibility.
10503         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
10504         when attribute is AttributeUsageAttribute.
10505         (Attribute.GetValidTargets): Simplified.
10506         (Attribute.GetAttributeUsage): New method returns AttributeUsage
10507         attribute for this type.
10508         (Attribute.ApplyAttributes): Method renamed to Emit and make
10509         non-static.
10510         (GlobalAttributeSection): New class for special handling of global
10511         attributes (assembly, module).
10512         (AttributeSection.Emit): New method.
10513
10514         * class.cs: Implemented Attributable abstract methods.
10515         (MethodCore.LabelParameters): Moved to Parameter class.
10516         (Accessor): Is back simple class.
10517         (PropertyMethod): Implemented Attributable abstract class.
10518         (DelegateMethod): Implemented Attributable abstract class.
10519         (Event): New constructor for disctintion between normal Event
10520         and Event with accessors.
10521
10522         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
10523
10524         * codegen.cs, const.cs, decl.cs, delegate.cs:
10525         (CommonAssemblyModulClass): Implemented Attributable abstract class
10526         and simplified.
10527
10528         * enum.cs: Implement IAttributeSupport interface.
10529         (EnumMember): New class for emum members. Implemented Attributable
10530         abstract class
10531
10532         * parameter.cs:
10533         (ParameterBase): Is abstract.
10534         (ReturnParameter): New class for easier [return:] attribute handling.
10535
10536         * typemanager.cs: Removed builder_to_attr.
10537
10538 2004-05-11  Raja R Harinath  <rharinath@novell.com>
10539
10540         Fix bug #57151.
10541         * attribute.cs (Attribute.GetPositionalValue): New function.
10542         * class.cs (TypeContainer.VerifyMembers): New function.
10543         (TypeContainer.Emit): Use it.
10544         (ClassOrStruct): New base class for Class and Struct.
10545         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
10546         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
10547         class.
10548         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
10549         then each non-static field should have a FieldOffset attribute.
10550         Otherwise, none of the fields should have a FieldOffset attribute.
10551         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
10552         and FieldOffset attributes.
10553         * typemanager.cs (TypeManager.struct_layout_attribute_type)
10554         (TypeManager.field_offset_attribute_type): New core types.
10555         (TypeManager.InitCoreTypes): Initialize them.
10556
10557 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
10558
10559         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
10560         Return correct type.
10561         From bug #58270.
10562
10563 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
10564
10565         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
10566         be implicitly converted to ulong.
10567         
10568         * expression.cs: The logic for allowing operator &, | and ^ worked
10569         was wrong, it worked before because we did not report an error in
10570         an else branch.  Fixes 57895.
10571
10572         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
10573         allow volatile fields to be reference types.
10574
10575 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
10576
10577         * driver.cs: Add support for /debug-
10578
10579 2004-05-07  Raja R Harinath  <rharinath@novell.com>
10580
10581         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
10582         Add a 'complain' parameter to silence errors.
10583         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
10584         silently overlooked type-resolutions.
10585         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
10586         to reflect changes.
10587         (Attributes.Search): New function.
10588         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
10589         (Attributes.GetAttributeFullName): Remove hack.
10590         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
10591         Update to reflect changes.
10592         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
10593         Use Attributes.Search instead of nested loops.
10594
10595 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
10596
10597         * decl.cs:
10598         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
10599         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
10600         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
10601
10602         * report.cs: (Report.Warning): Renamed to Warning_T because of
10603         parameter collision.
10604
10605 2004-05-05  Raja R Harinath  <rharinath@novell.com>
10606
10607         * expression.cs (MemberAccess.ResolveMemberAccess):
10608         Exit with non-zero status after Report.Error.
10609         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
10610         Likewise.
10611         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
10612
10613 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10614
10615         * support.cs: Don't hang when the file is empty.
10616
10617 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
10618
10619         * support.cs: In SeekableStreamReader, compute the preamble size of the
10620           underlying stream. Position changes should take into account that initial
10621           count of bytes.
10622
10623 2004-05-03  Todd Berman  <tberman@sevenl.net>
10624
10625         * driver.cs: remove unused GetSysVersion function.
10626
10627 2004-05-03  Todd Berman  <tberman@sevenl.net>
10628
10629         * driver.cs: Remove the hack from saturday, as well as the hack
10630         from jackson (LoadAssemblyFromGac), also adds the CWD to the
10631         link_paths to get that bit proper.
10632
10633 2004-05-01  Todd Berman  <tberman@sevenl.net>
10634
10635         * driver.cs: Try a LoadFrom before a Load, this checks the current
10636         path. This is currently a bug in mono that is be fixed, however, this
10637         provides a workaround for now. This will be removed when the bug
10638         is fixed.
10639
10640 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
10641
10642         * CryptoConvert.cs: Updated to latest version. Fix issue with 
10643         incomplete key pairs (#57941).
10644
10645 2004-05-01  Todd Berman  <tberman@sevenl.net>
10646
10647         * driver.cs: Remove '.' from path_chars, now System.* loads properly
10648         from the GAC
10649
10650 2004-04-30  Jackson Harper  <jackson@ximian.com>
10651
10652         * codegen.cs: Open keys readonly.
10653         
10654 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
10655
10656         * typemanager.cs: don't report cyclic struct layout when a struct
10657         contains 2 or more fields of the same type. Failed for Pango.AttrShape
10658         which has 2 Pango.Rectangle fields.
10659
10660 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
10661
10662         * expression.cs: Handle IntPtr comparisons with IL code
10663         rather than a method call.
10664
10665 2004-04-29  Martin Baulig  <martin@ximian.com>
10666
10667         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
10668         the list of PropertyInfo's in class hierarchy and find the
10669         accessor.  Fixes #56013.
10670
10671 2004-04-29  Martin Baulig  <martin@ximian.com>
10672
10673         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
10674
10675 2004-04-29  Martin Baulig  <martin@ximian.com>
10676
10677         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10678
10679         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
10680
10681 2004-04-29  Martin Baulig  <martin@ximian.com>
10682
10683         * class.cs (ConstructorInitializer.Resolve): Check whether the
10684         parent .ctor is accessible.  Fixes #52146.
10685
10686 2004-04-29  Martin Baulig  <martin@ximian.com>
10687
10688         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
10689
10690         * statement.cs (Using.EmitLocalVariableDecls): Use
10691         TypeManager.idisposable_type, not typeof (IDisposable).
10692         (Foreach.EmitCollectionForeach): Added support for valuetypes.
10693
10694 2004-04-29  Martin Baulig  <martin@ximian.com>
10695
10696         * class.cs (Event.Define): Don't emit the field and don't set
10697         RTSpecialName and SpecialName for events on interfaces.  Fixes
10698         #57703. 
10699
10700 2004-04-29  Raja R Harinath  <rharinath@novell.com>
10701
10702         Refactor Attribute.ApplyAttributes.
10703         * attribute.cs (Attributable): New base class for objects that can
10704         have Attributes applied on them.
10705         (Attribute): Make AttributeUsage fields public.
10706         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
10707         (Attribute.IsInternalCall): New property.
10708         (Attribute.UsageAttr): Convert to a public read-only property.
10709         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
10710         (Attribute.ResolveType, Attribute.Resolve)
10711         (Attribute.ScanForIndexerName): Update to reflect changes.
10712         (Attribute.CheckAttributeTarget): Re-format.
10713         (Attribute.ApplyAttributes): Refactor, to various
10714         Attributable.ApplyAttributeBuilder methods.
10715         * decl.cs (MemberCore): Make Attributable.
10716         * class.cs (Accessor): Make Attributable.
10717         (MethodData.ApplyAttributes): Use proper attribute types, not
10718         attribute names.
10719         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
10720         (TypeContainer.ApplyAttributeBuilder)
10721         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
10722         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
10723         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
10724         (Operator.ApplyAttributeBuilder): New factored-out methods.
10725         * const.cs (Const.ApplyAttributeBuilder): Likewise.
10726         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
10727         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
10728         * parameter.cs (ParameterBase): New Attributable base class
10729         that can also represent Return types.
10730         (Parameter): Update to the changes.
10731
10732 2004-04-29  Jackson Harper  <jackson@ximian.com>
10733
10734         * driver.cs: Prefer the corlib system version when looking for
10735         assemblies in the GAC. This is still a hack, but its a better hack
10736         now.
10737         
10738 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
10739
10740         * decl.cs, enum.cs: Improved error 3005 reporting.
10741   
10742         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
10743         (related_symbols): New private member for list of symbols
10744         related to reported error/warning.
10745         
10746         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
10747
10748 2004-04-29  Martin Baulig  <martin@ximian.com>
10749
10750         * ecore.cs (Expression.Constantify): If we're an enum and
10751         TypeManager.TypeToCoreType() doesn't give us another type, use
10752         t.UnderlyingSystemType.  Fixes #56178.  
10753
10754 2004-04-29  Martin Baulig  <martin@ximian.com>
10755
10756         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
10757         interfaces and for each interface, only add members directly
10758         declared in that interface.  Fixes #53255.
10759
10760 2004-04-28  Martin Baulig  <martin@ximian.com>
10761
10762         * expression.cs (ConditionalLogicalOperator): Use a temporary
10763         variable for `left' to avoid that we evaluate it more than once;
10764         bug #52588.
10765
10766 2004-04-28  Martin Baulig  <martin@ximian.com>
10767
10768         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
10769         `void[]' (CS1547).
10770
10771 2004-04-28  Martin Baulig  <martin@ximian.com>
10772
10773         * statement.cs (LocalInfo.Resolve): Check whether the type is not
10774         void (CS1547).
10775
10776         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
10777         whether the type is not void (CS1547).
10778
10779 2004-04-28  Martin Baulig  <martin@ximian.com>
10780
10781         * expression.cs (Unary.DoResolveLValue): Override this and report
10782         CS0131 for anything but Operator.Indirection.
10783
10784 2004-04-28  Martin Baulig  <martin@ximian.com>
10785
10786         Committing a patch from Ben Maurer; see bug #50820.
10787
10788         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10789         check for classes.
10790
10791         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10792         classes.        
10793
10794 2004-04-28  Martin Baulig  <martin@ximian.com>
10795
10796         Committing a patch from Ben Maurer; see bug #50820.
10797
10798         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
10799         check for classes.
10800
10801         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
10802         classes.        
10803
10804 2004-04-28  Martin Baulig  <martin@ximian.com>
10805
10806         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
10807         (Block.AddLabel): Call DoLookupLabel() to only search in the
10808         current block.
10809
10810 2004-04-28  Martin Baulig  <martin@ximian.com>
10811
10812         * cfold.cs (ConstantFold.BinaryFold): Added special support for
10813         comparing StringConstants and NullLiterals in Equality and Inequality.
10814
10815 2004-04-28  Jackson Harper  <jackson@ximian.com>
10816
10817         * driver.cs: Attempt to load referenced assemblies from the
10818         GAC. This is the quick and dirty version of this method that
10819         doesnt take into account versions and just takes the first
10820         canidate found. Will be good enough for now as we will not have more
10821         then one version installed into the GAC until I update this method.
10822
10823 2004-04-28  Martin Baulig  <martin@ximian.com>
10824
10825         * typemanager.cs (TypeManager.CheckStructCycles): New public
10826         static method to check for cycles in the struct layout.
10827
10828         * rootcontext.cs (RootContext.PopulateTypes): Call
10829         TypeManager.CheckStructCycles() for each TypeContainer.
10830         [Note: We only need to visit each type once.]
10831
10832 2004-04-28  Martin Baulig  <martin@ximian.com>
10833
10834         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
10835
10836         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
10837         success and added `out object value'.  Use a `bool resolved' field
10838         to check whether we've already been called rather than
10839         `ConstantValue != null' since this breaks for NullLiterals.
10840
10841 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10842
10843         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
10844         setting of this flag, since the 'set' method may be non-public.
10845
10846 2004-04-28  Raja R Harinath  <rharinath@novell.com>
10847
10848         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
10849         check on current_vector.Block.
10850
10851 2004-04-27  Martin Baulig  <martin@ximian.com>
10852
10853         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
10854         a field initializer.  Fixes #56459.
10855
10856 2004-04-27  Martin Baulig  <martin@ximian.com>
10857
10858         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
10859         we're not attempting to use an indexer.  Fixes #52154.
10860
10861 2004-04-27  Martin Baulig  <martin@ximian.com>
10862
10863         * statement.cs (Return): Don't create a return label if we don't
10864         need it; reverts my change from January 20th.  Thanks to Ben
10865         Maurer for this.
10866
10867 2004-04-27  Martin Baulig  <martin@ximian.com>
10868
10869         According to the spec, `goto' can only leave a nested scope, but
10870         never enter it.
10871
10872         * statement.cs (Block.LookupLabel): Only lookup in the current
10873         block, don't recurse into parent or child blocks.
10874         (Block.AddLabel): Check in parent and child blocks, report
10875         CS0140/CS0158 if we find a duplicate.
10876         (Block): Removed this indexer for label lookups.
10877         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
10878         this already does the error reporting for us.
10879
10880         * flowanalysis.cs
10881         (FlowBranching.UsageVector.Block): New public variable; may be null.
10882         (FlowBranching.CreateSibling): Added `Block' argument.
10883         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
10884         label for the target of a `goto' and check whether we're not
10885         leaving a `finally'.
10886
10887 2004-04-27  Martin Baulig  <martin@ximian.com>
10888
10889         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
10890         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
10891         just for returns).
10892
10893 2004-04-27  Martin Baulig  <martin@ximian.com>
10894
10895         * statement.cs (Block.AddLabel): Also check for implicit blocks
10896         and added a CS0158 check.
10897
10898 2004-04-27  Martin Baulig  <martin@ximian.com>
10899
10900         * flowanalysis.cs (FlowBranchingLoop): New class.
10901         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
10902         UsageVector's instead of an ArrayList.
10903         (FlowBranching.Label): Likewise.
10904         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
10905         (FlowBranching.AddBreakVector): New method.
10906
10907 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
10908
10909         * attribute.cs: Small regression fix: only convert the type if we
10910         the type is different, fixes System.Drawing build.
10911
10912 2004-04-27  Martin Baulig  <martin@ximian.com>
10913
10914         * attribute.cs (Attribute.Resolve): If we have a constant value
10915         for a named field or property, implicity convert it to the correct
10916         type.
10917
10918 2004-04-27  Raja R Harinath  <rharinath@novell.com>
10919
10920         * statement.cs (Block.Block): Implicit blocks share
10921         'child_variable_names' fields with parent blocks.
10922         (Block.AddChildVariableNames): Remove.
10923         (Block.AddVariable): Mark variable as "used by a child block" in
10924         every surrounding block.
10925         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
10926         been used in a child block, complain about violation of "Invariant
10927         meaning in blocks" rule.
10928         * cs-parser.jay (declare_local_variables): Don't use
10929         AddChildVariableNames.
10930         (foreach_statement): Don't create an implicit block: 'foreach'
10931         introduces a scope.
10932
10933 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
10934
10935         * convert.cs (ImplicitNumericConversion): 0 is also positive when
10936         converting from 0L to ulong.  Fixes 57522.
10937
10938 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10939
10940         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
10941         derived class hides via 'new' keyword field from base class (test-242.cs).
10942         TODO: Handle this in the more general way.
10943         
10944         * class.cs (CheckBase): Ditto.
10945
10946 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
10947
10948         * decl.cs (caching_flags): New member for storing cached values
10949         as bit flags.
10950         (MemberCore.Flags): New enum where bit flags for caching_flags
10951         are defined.
10952         (MemberCore.cls_compliance): Moved to caching_flags.
10953         (DeclSpace.Created): Moved to caching_flags.
10954
10955         * class.cs: Use caching_flags instead of DeclSpace.Created
10956         
10957 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
10958
10959         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
10960         if we are only a derived class, not a nested class.
10961
10962         * typemanager.cs: Same as above, but do this at the MemberLookup
10963         level (used by field and methods, properties are handled in
10964         PropertyExpr).   Allow for the qualified access if we are a nested
10965         method. 
10966
10967 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
10968
10969         * class.cs: Refactoring.
10970         (IMethodData): New inteface; Holds links to parent members
10971         to avoid member duplication (reduced memory allocation).
10972         (Method): Implemented IMethodData interface.
10973         (PropertyBase): New inner classes for get/set methods.
10974         (PropertyBase.PropertyMethod): Implemented IMethodData interface
10975         (Event): New inner classes for add/remove methods.
10976         (Event.DelegateMethod): Implemented IMethodData interface.
10977
10978         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
10979         EmitContext (related to class.cs refactoring).
10980
10981 2004-04-21  Raja R Harinath  <rharinath@novell.com>
10982
10983         * delegate.cs (Delegate.VerifyApplicability): If the number of
10984         arguments are the same as the number of parameters, first try to
10985         verify applicability ignoring  any 'params' modifier on the last
10986         parameter.
10987         Fixes #56442.
10988
10989 2004-04-08  Martin Baulig  <martin@ximian.com>
10990
10991         Merged latest changes into gmcs.  Please keep this comment in
10992         here, it makes it easier for me to see what changed in MCS since
10993         the last time I merged.
10994
10995 2004-04-16  Raja R Harinath  <rharinath@novell.com>
10996
10997         * class.cs (TypeContainer.AddIndexer): Use
10998         'ExplicitInterfaceName' to determine if interface name was
10999         explicitly specified.  'InterfaceType' is not initialized at this time.
11000         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
11001         Indexers array is already in the required order.  Initialize
11002         'IndexerName' only if there are normal indexers.
11003         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
11004         (TypeContainer.Emit): Emit DefaultMember attribute only if
11005         IndexerName is initialized.
11006         Fixes #56300.
11007
11008 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
11009
11010         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
11011         Fixes #57007
11012
11013 2004-04-15  Raja R Harinath  <rharinath@novell.com>
11014
11015         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
11016         attributes.
11017         Fix for #56456.
11018
11019         * attribute.cs (Attribute.Resolve): Check for duplicate named
11020         attributes.
11021         Fix for #56463.
11022
11023 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
11024
11025         * iterators.cs (MarkYield): track whether we are in an exception,
11026         and generate code accordingly.  Use a temporary value to store the
11027         result for our state.
11028
11029         I had ignored a bit the interaction of try/catch with iterators
11030         since their behavior was not entirely obvious, but now it is
11031         possible to verify that our behavior is the same as MS .NET 2.0
11032
11033         Fixes 54814
11034
11035 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
11036
11037         * iterators.cs: Avoid creating temporaries if there is no work to
11038         do. 
11039
11040         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
11041         Enumerations, use TypeManager.EnumToUnderlying and call
11042         recursively. 
11043
11044         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
11045         bug #57013
11046
11047         (This.Emit): Use EmitContext.EmitThis to emit our
11048         instance variable.
11049
11050         (This.EmitAssign): Ditto.
11051
11052         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
11053         codepaths, we will move all the functionality into
11054         Mono.CSharp.This 
11055
11056         (FieldExpr.EmitAssign): Ditto.
11057
11058         This fixes several hidden bugs that I uncovered while doing a code
11059         review of this today.
11060
11061         * codegen.cs (EmitThis): reworked so the semantics are more clear
11062         and also support value types "this" instances.
11063
11064         * iterators.cs: Changed so that for iterators in value types, we
11065         do not pass the value type as a parameter.  
11066
11067         Initialization of the enumerator helpers is now done in the caller
11068         instead of passing the parameters to the constructors and having
11069         the constructor set the fields.
11070
11071         The fields have now `assembly' visibility instead of private.
11072
11073 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
11074
11075         * expression.cs (Argument.Resolve): Check if fields passed as ref
11076         or out are contained in a MarshalByRefObject.
11077
11078         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
11079         another compiler type.
11080
11081 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
11082
11083         * class.cs (Indexer.Define): use the new name checking method.
11084         Also, return false on an error.
11085         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
11086         (is_identifier_[start/part]_character): make static.
11087
11088 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
11089
11090         * expression.cs (Binary.ResolveOperator): Do no append strings
11091         twice: since we can be invoked more than once (array evaluation)
11092         on the same concatenation, take care of this here.  Based on a fix
11093         from Ben (bug #56454)
11094
11095 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11096
11097         * codegen.cs: Fix another case where CS1548 must be reported (when 
11098         delay-sign isn't specified and no private is available #56564). Fix
11099         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11100         error when MCS is used on the MS runtime and we need to delay-sign 
11101         (which seems unsupported by AssemblyBuilder - see #56621).
11102
11103 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
11104
11105         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
11106         (TypeManager.ComputeNamespaces): Faster implementation for
11107         Microsoft runtime.
11108
11109         * compiler.csproj: Updated AssemblyName to mcs.
11110
11111 2004-05-11  Jackson Harper  <jackson@ximian.com>
11112
11113         * Makefile: Preserve MONO_PATH
11114         
11115 2004-05-11  Jackson Harper  <jackson@ximian.com>
11116
11117         * Makefile: Use mono and mcs to build gmcs
11118         
11119 2004-05-03  Miguel de Icaza  <miguel@ximian.com>
11120
11121         * codegen.cs: Add patch from Robert Shade
11122         <rshade@dvsconsulting.com>, use FileAccess.Read on the keyfile, to
11123         sync with mcs.
11124
11125 2004-05-02  Sebastien Pouliot  <sebastien@ximian.com>
11126
11127         * CryptoConvert.cs: Updated to latest version. Fix issue with 
11128         incomplete key pairs (#57941).
11129
11130 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
11131
11132         * codegen.cs: Fix another case where CS1548 must be reported (when 
11133         delay-sign isn't specified and no private is available #56564). Fix
11134         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
11135         error when MCS is used on the MS runtime and we need to delay-sign 
11136         (which seems unsupported by AssemblyBuilder - see #56621).
11137
11138 2004-04-29  Jackson Harper  <jackson@ximian.com>
11139
11140         * Makefile: Set MONO_PATH to use the bootstrap corlib
11141         * driver.cs: Check the GAC for referenced assemblies.
11142                 
11143 2004-04-29  Martin Baulig  <martin@ximian.com>
11144
11145         * Makefile (gmcs.exe): Set MONO_PATH to use `../class/lib/net_2_0'.
11146
11147 2004-04-07  Martin Baulig  <martin@ximian.com>
11148
11149         * expression.cs (Binary.ResolveOperator): Added special case for
11150         Equality/Inequality between a type parameter and a null literal.
11151
11152 2004-04-07  Martin Baulig  <martin@ximian.com>
11153
11154         * convert.cs: Check null literal -> type parameter conversions.
11155
11156 2004-04-07  Martin Baulig  <martin@ximian.com>
11157
11158         * generic.cs (ConstructedType.CheckConstraints): Enforce the
11159         `class' and `struct' constraints.
11160
11161 2004-04-07  Martin Baulig  <martin@ximian.com>
11162
11163         * generic.cs (SpecialConstraint): New public enum.
11164         (Constraints.Resolve): Added support for the `class' and `struct'
11165         constraints.
11166
11167         * cs-parser.jay (type_parameter_constraint): Added support for the
11168         `class' and `struct' constraints.
11169
11170 2004-04-07  Martin Baulig  <martin@ximian.com>
11171
11172         * support.cs (GenericConstraints): Replaced `Types' by
11173         `ClassConstraint' and `InterfaceConstraints'; added
11174         `HasClassConstraint'.   
11175
11176 2004-04-07  Martin Baulig  <martin@ximian.com>
11177
11178         * generic.cs
11179         (Constraints.InterfaceConstraints): New public property.
11180         (Constraints.Types): Make this property public
11181         (TypeParameter): Implement IMemberContainer.
11182         (TypeParameter.Define): Take a `GenericTypeParameterBuilder'
11183         instead of a TypeBuilder/MethodBuilder; pass the interface
11184         constraints to TypeManager.AddTypeParameter().
11185         (TypeParameter.DefineType): Just take an EmitContext and no
11186         TypeBuilder/MethodBuilder.  Use the new public API.
11187
11188         * typemanager.cs (TypeManager.AddTypeParameter): Added
11189         `TypeExpr[]' argument; add the interfaces to the
11190         `builder_to_ifaces' hash.
11191         (TypeManager.LookupMemberContainer): For
11192         GenericTypeParameterBuilders, get the TypeParameter from the
11193         `builder_to_type_param'.
11194         (TypeManager.FindMembers): For GenericTypeParameterBuilders, get
11195         the TypeParameter and call FindMembers on it.
11196
11197 2004-04-07  Martin Baulig  <martin@ximian.com>
11198
11199         * class.cs
11200         (MethodCore.GenericMethod): Moved this field here from Method.
11201         (MethodCore.IsDuplicateImplementation): Take the number of type
11202         parameters into account if we're a generic method.
11203
11204         * expression.cs (Invocation.InferTypeArguments): Don't return true
11205         if `arguments' is null; we still need to check whether we actually
11206         don't need to infer anything in this case.
11207         (MemberAccess): Merged the functionality from GenericMemberAccess
11208         into this class.
11209
11210         * generic.cs (GenericMemberAccess): Removed.
11211
11212 2004-04-05  Martin Baulig  <martin@ximian.com>
11213
11214         * decl.cs (MemberCore): For generic classes, interfaces and
11215         structs, `Name' now includes the number of type parameters
11216         ("Stack!1.Node!1").
11217         (DeclSpace.FindType): Removed the `num_type_args' argument; we now
11218         encode the number of type arguments in the type name.
11219
11220         * expression.cs (Expression.MemberLookup): Removed the
11221         `num_type_args' argument; we now encode the number of type
11222         arguments in the type name.
11223
11224         * ecore.cs (SimpleName): Encode the number of type arguments in
11225         the type name itself.
11226
11227         * generic.cs (ConstructedType): Likewise.
11228
11229         * tree.cs (Tree.RecordDecl): Take a `string' instead of a
11230         `MemberName'; we now include the number of type parameters in the
11231         type name.
11232
11233         * typemanager.cs (TypeManager.CheckGeneric): Removed.
11234         (TypeManager.MemberLookup): Removed the
11235         `num_type_args' argument; we now encode the number of type
11236         arguments in the type name.     
11237
11238 2004-04-03  Martin Baulig  <martin@ximian.com>
11239
11240         * decl.cs (MemberCore.ctor): Take a MemberName instead of a sting.
11241         (MemberCore.MemberName): Moved here from MemberBase.
11242         (DeclSpace.SetParameterInfo): Just take the constraints as an
11243         ArrayList; we already have the type parameters in our
11244         `MemberName'; also do the CS0080 reporting here.
11245
11246         * cs-parser.jay (struct_declaration): Use `member_name' instead of
11247         `IDENTIFIER opt_type_parameter_list'; when constructing our
11248         `MemberName', it'll already include our type parameters.
11249         (class_declaration, interface_declaration): Likewise.
11250         (delegate_declaration): Likewise.
11251         (MakeName): Take a MemberName and return a MemberName.
11252         The following two changes are required to avoid shift/reduce conflicts:
11253         (member_name): Don't include a TypeName anymore; ie. this is now
11254         just 'IDENTIFIER opt_type_parameter_list'.
11255         (property_declaration, event_declaration): Use a
11256         `namespace_or_type_name' instead of a `member_name'.            
11257
11258 2004-04-03  Martin Baulig  <martin@ximian.com>
11259
11260         * decl.cs (MemberName): Renamed to `TypeName' and created a new
11261         `MemberName' class.
11262         (TypeName): Formerly known as MemberName.
11263
11264         * namespace.cs (NamespaceEntry.UsingAlias): Take a `TypeName'
11265         instead of a `MemberName'.
11266
11267         * cs-parser.jay (namespace_or_type_name): Create a TypeName.
11268         (member_name): New rule; create a MemberName.
11269
11270 2004-04-02  Martin Baulig  <martin@ximian.com>
11271
11272         * namespace.cs (NamespaceEntry.VerifyUsing): Added error checking
11273         (CS0305 and CS0308).
11274
11275 2004-04-02  Martin Baulig  <martin@ximian.com>
11276
11277         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Added
11278         support for nested types.
11279
11280 2004-04-02  Martin Baulig  <martin@ximian.com>
11281
11282         * ecore.cs (IAlias): New public interface.
11283         (TypeExpr, TypeExpression): Implement IAlias.
11284         (TypeAliasExpression): New public class.
11285
11286         * namespace.cs (Namespace): Implement IAlias.
11287         (Namespace.Lookup): Return an IAlias instead on an object.
11288         (Namespace.DefineName): Take an IAlias instead of an object.
11289         (NamespaceEntry.AliasEntry.Resolve): Return an IAlias instead of
11290         an object.
11291         (NamespaceEntry.UsingAlias): Take a Membername instead of an
11292         Expression.
11293         (NamespaceEntry.LookupAlias): Return an IAlias instead on an
11294         object.
11295         (NamespaceEntry.Lookup): Likewise.
11296
11297         * rootcontext.cs (RootContext.LookupType): Return a TypeExpr
11298         instead of a Type.      
11299
11300         * decl.cs (DeclSpace): Implement IAlias.
11301         (DeclSpace.LookupAlias): Return an IAlias instead of a string.
11302
11303         * generic.cs (ConstructedType): Improved error checking.
11304
11305 2004-04-02  Martin Baulig  <martin@ximian.com>
11306
11307         * convert.cs: Added type parameter conversions.
11308
11309         * ecore.cs
11310         (UnboxCast.Emit): Emit an `unbox.any' for type params.
11311         (ClassCast.Emit): If the source type is a type parameter, box it.
11312         If the target type is a type parameter, emit an `unbox.any'
11313         instead of a `classcast'.1      
11314
11315 2004-04-01  Martin Baulig  <martin@ximian.com>
11316
11317         * cs-tokenizer.cs (parse_less_than): Allow Token.DOT.
11318
11319 2004-04-01  Martin Baulig  <martin@ximian.com>
11320
11321         * generic.cs (ConstructedType.CheckConstraints): Use
11322         Convert.ImplicitStandardConversionExists(); user-defined implicit
11323         conversions are not allowed according to the spec.
11324
11325 2004-03-30  Martin Baulig  <martin@ximian.com>
11326
11327         * expression.cs (New): Added support for type parameters.
11328
11329         * typemanager.cs
11330         (TypeManager.activator_type): New public static field.
11331         (TypeManager.activator_create_instance): Likewise.
11332
11333 2004-03-30  Martin Baulig  <martin@ximian.com>
11334
11335         * typemanager.cs (TypeManager.HasConstructorConstraint): New
11336         public method.
11337
11338 2004-03-30  Martin Baulig  <martin@ximian.com>
11339
11340         * generic.cs (ConstructedType.CheckConstraints): Actually follow
11341         the spec here: the argument type must be convertible to the
11342         constraints.
11343
11344 2004-03-30  Martin Baulig  <martin@ximian.com>
11345
11346         * generic.cs
11347         (TypeParameter.Define, TypeParameter.DefineMethod): Call
11348         TypeManager.AddTypeParameter().
11349         (ConstructedType.CheckConstraints): Re-enable this and actually
11350         check whether we have a constructor constraint.
11351
11352         * typemanager.cs
11353         (TypeManager.builder_to_type_param): New static field.
11354         (TypeManager.AddTypeParameter): New static method.
11355         (TypeManager.LookupTypeParameter): New public method.
11356
11357 2004-03-30  Martin Baulig  <martin@ximian.com>
11358
11359         * generic.cs (TypeParameter.DefineType): Return a boolean and use
11360         the new API to actually define the constructor constraint.
11361
11362         * typemanager.cs
11363         (TypeManager.new_constraint_attr_type): New static field.
11364         (TypeManager.InitCoreTypes): Initialize it.
11365
11366 2004-03-30  Martin Baulig  <martin@ximian.com>
11367
11368         * generic.cs (Constraints): Completed error checking, use correct
11369         error numbers.
11370
11371 2004-03-29  Martin Baulig  <martin@ximian.com>
11372
11373         * delegate.cs (Delegate.VerifyMethod): Infer type arguments.
11374
11375         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11376         public version which takes a `ParameterData pd' instead of an
11377         `ArrayList args'.
11378
11379 2004-03-29  Martin Baulig  <martin@ximian.com>
11380
11381         * typemanager.cs (TypeManager.IsGenericMethod): Take a MethodBase,
11382         not a MethodInfo.       
11383
11384 2004-03-29  Martin Baulig  <martin@ximian.com>
11385
11386         * expression.cs (Argument.ResolveMethodGroup): If we're a
11387         ConstructedType, call GetMemberAccess() on it.  
11388
11389 2004-03-29  Martin Baulig  <martin@ximian.com>
11390
11391         * class.cs (MethodBase.CheckGenericOverride): New abstract method.
11392         (MethodCore.CheckGenericOverride): When overriding a generic
11393         method, check whether the constraints match.
11394
11395         * support.cs (GenericConstraints): New public interface.
11396         (ParameterData.GenericConstraints): New public method.
11397
11398         * parameter.cs (Parameter.Resolve): Check whether we're a generic
11399         method parameter and compute our constraints if appropriate.
11400         (Parameter.GenericConstraints): New public property.
11401
11402         * generic.cs (Constraints): Implement GenericConstraints.
11403
11404 2004-03-29  Martin Baulig  <martin@ximian.com>
11405
11406         * decl.cs (MemberCache.FindMemberToOverride): Use
11407         `paramTypes [j].Equals (cmpAttrs [j])' instead of `=='.
11408
11409 2004-03-29  Martin Baulig  <martin@ximian.com>
11410
11411         * generic.cs (GenericMethod.Define): Resolve our type parameters.
11412
11413 2004-03-29  Martin Baulig  <martin@ximian.com>
11414
11415         * cs-parser.jay: Report CS0080 instead of -200 ("Constraints are
11416         not allowed on non-generic declarations").
11417
11418 2004-03-29  Martin Baulig  <martin@ximian.com>
11419
11420         * expression.cs (Invocation.InferTypeArguments): Added overloaded
11421         public version of this method.
11422
11423         * class.cs (MethodCore.IsDuplicateImplementation): Use
11424         Invocation.InferTypeArguments() to check this.
11425
11426 2004-03-29  Martin Baulig  <martin@ximian.com>
11427
11428         * convert.cs: Use TypeManager.IsDelegateType() instead of
11429         comparing types correctly.
11430
11431 2004-03-29  Martin Baulig  <martin@ximian.com>
11432
11433         * convert.cs: Use TypeManager.IsSubclassOf() instead of comparing
11434         types directly to make it work for generic instances.
11435
11436         * typemanager.cs (TypeManager.IsSubclassOf): New static method.
11437
11438 2004-03-29  Martin Baulig  <martin@ximian.com>
11439
11440         * typemanager.cs (TypeManager.MayBecomeEqualGenericTypes): Added
11441         support for arrays.     
11442
11443 2004-03-24  Martin Baulig  <martin@ximian.com>
11444
11445         * decl.cs (DeclSpace.FindType): Also use
11446         TypeManager.CheckGeneric() for types from the using clauses.
11447
11448 2004-03-23  Martin Baulig  <martin@ximian.com>
11449
11450         * expression.cs (Invocation.OverloadResolve): Added `bool
11451         may_fail' argument and use it instead of the Location.IsNull() hack.
11452
11453 2004-03-23  Martin Baulig  <martin@ximian.com>
11454
11455         * expression.cs (Invocation.InferType): Use correct type inference
11456         rules here.     
11457
11458 2004-03-23  Martin Baulig  <martin@ximian.com>
11459
11460         * ecore.cs (MethodGroupExpr.Name): Use
11461         TypeManager.CSharpSignature() instead of just the name.
11462
11463         * expression.cs (Invocation.OverloadResolve): Provide better error
11464         reporting.
11465         (Invocation.DoResolve): OverloadResolve() never returns null
11466         without reporting an error, so removed the error -6 reporting here.
11467
11468 2004-03-23  Martin Baulig  <martin@ximian.com>
11469
11470         * typemanager.cs (TypeManager.GetMethodFlags): Fixed the FIXME for
11471         generic methods.
11472
11473         * cs-parser.jay (delegate_declaration): Support generic delegates.
11474
11475         * delegate.cs: Support generic delegates.
11476
11477 2004-03-22  Martin Baulig  <martin@ximian.com>
11478
11479         * expression.cs (Invocation.InferParamsTypeArguments): New static
11480         method; does type inference for params arguments.
11481
11482 2004-03-21  Martin Baulig  <martin@ximian.com>
11483
11484         * typemanager.cs (TypeManager.IsGenericMethod): New public static
11485         method; checks whether a method is a generic method.    
11486
11487         * expression.cs (Invocation.InferTypeArguments): New static method;
11488         infer type arguments for generic method invocation.
11489
11490         * ecore.cs (MethodGroupExpr.HasTypeArguments): New public
11491         property; we set this to true if we're resolving a generic method
11492         invocation and the user specified type arguments, ie. we're not
11493         doing type inference.
11494
11495 2004-03-20  Martin Baulig  <martin@ximian.com>
11496
11497         * class.cs (MethodData.DeclaringType): New public property.
11498         (MethodData.Define): Set DeclaringType here.
11499         (Operator.Define): Use OperatorMethod.MethodData.DeclaringType
11500         instead of OperatorMethodBuilder.DeclaringType.
11501
11502 2004-03-20  Martin Baulig  <martin@ximian.com>
11503
11504         * cs-tokenizer.cs (xtoken): Return a special
11505         Token.DEFAULT_OPEN_PARENS for "`default' followed by open parens".
11506
11507         * cs-parser.jay (default_value_expression): Switch to the new
11508         syntax (14.5.13).
11509
11510 2004-03-19  Martin Baulig  <martin@ximian.com>
11511
11512         * decl.cs (MemberName): New class.  We use this to "construct"
11513         namespace_or_type_name's.
11514
11515         * generics.cs (TypeArguments.GetDeclarations): New public method;
11516         returns the type arguments as a string[] and reports a CS0081 if
11517         one of them is not an identifier.
11518
11519         * class.cs (MemberBase): The .ctor now takes the name as a
11520         MemberName instead of a string.
11521         (MemberBase.ExplicitInterfaceName): Changed type from string to
11522         Expression.
11523         (MemberBase.DoDefine): If we're an explicit implementation, the
11524         InterfaceType may be a generic instance.
11525
11526         * cs-parser.jay (namespace_or_type_name): Return a MemberName.
11527         (namespace_name): Call MemberName.GetName () to transform the
11528         MemberName into a string and ensure we don't have any type
11529         arguments.
11530         (type_name): Call MemberName.GetTypeExpression() to transfrom the
11531         MemberName into an expression.
11532         (method_header): Use namespace_or_type_name instead of member_name.     
11533
11534 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
11535
11536         * rootcontext.cs: Add new types to the boot resolution.
11537
11538         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
11539         MulticastDelegate is not allowed.
11540
11541         * typemanager.cs: Add new types to lookup: System.TypedReference
11542         and ArgIterator.
11543
11544         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
11545         check for TypedReference or ArgIterator, they are not allowed. 
11546
11547         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
11548         makes us properly catch 1510 in some conditions (see bug 56016 for
11549         details). 
11550
11551 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
11552
11553         * CryptoConvert.cs: update from corlib version
11554         with endian fixes.
11555
11556 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
11557
11558         * class.cs (Indexer.Define): Check indexername declaration
11559
11560 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
11561
11562         * attribute.cs (IsClsCompliant): Fixed problem with handling
11563         all three states (compliant, not-compliant, undetected).
11564
11565 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
11566
11567         * attribute.cs (Attribute): Location is now public.
11568         (Resolve): Store resolved arguments (pos_values) in attribute class.
11569         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
11570         (GetClsCompliantAttributeValue): New method that gets
11571         CLSCompliantAttribute value.
11572         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
11573         if exists else null.
11574         (AttributeTester): New class for CLS-Compliant verification routines.
11575
11576         * class.cs (Emit): Add CLS-Compliant verification.
11577         (Method.GetSignatureForError): Implemented.
11578         (Constructor.GetSignatureForError): Implemented
11579         (Constructor.HasCompliantArgs): Returns if constructor has
11580         CLS-Compliant arguments.
11581         (Constructor.Emit): Override.
11582         (Construcor.IsIdentifierClsCompliant): New method; For constructors
11583         is needed to test only parameters.
11584         (FieldBase.GetSignatureForError): Implemented.
11585         (TypeContainer): New member for storing base interfaces.
11586         (TypeContainer.FindMembers): Search in base interfaces too.
11587
11588         * codegen.cs (GetClsComplianceAttribute): New method that gets
11589         assembly or module CLSCompliantAttribute value.
11590         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
11591         for assembly.
11592         (ModuleClass.Emit): Add error 3012 test.
11593
11594         * const.cs (Emit): Override and call base for CLS-Compliant tests.
11595
11596         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
11597         state for all decl types.
11598         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
11599         if CLS-Compliant tests are required.
11600         (IsClsCompliaceRequired): New method. Analyze whether code
11601         must be CLS-Compliant.
11602         (IsExposedFromAssembly): New method. Returns true when MemberCore
11603         is exposed from assembly.
11604         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
11605         value or gets cached value.
11606         (HasClsCompliantAttribute): New method. Returns true if MemberCore
11607         is explicitly marked with CLSCompliantAttribute.
11608         (IsIdentifierClsCompliant): New abstract method. This method is
11609         used to testing error 3005.
11610         (IsIdentifierAndParamClsCompliant): New method. Common helper method
11611         for identifier and parameters CLS-Compliant testing.
11612         (VerifyClsCompliance): New method. The main virtual method for
11613         CLS-Compliant verifications.
11614         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
11615         null. I don't know why is null (too many public members !).
11616         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
11617         and get value of first CLSCompliantAttribute that found.
11618
11619         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
11620         (VerifyClsCompliance): Override and add extra tests.
11621
11622         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
11623         clscheck- disable CLS-Compliant verification event if assembly is has
11624         CLSCompliantAttribute(true).
11625
11626         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
11627         ApllyAttribute is now called in emit section as in the other cases.
11628         Possible future Emit integration.
11629         (IsIdentifierClsCompliant): New override.
11630         (VerifyClsCompliance): New override.
11631         (GetEnumeratorName): Returns full enum name.
11632
11633         * parameter.cs (GetSignatureForError): Implemented.
11634
11635         * report.cs (WarningData): New struct for Warning message information.
11636         (LocationOfPreviousError): New method.
11637         (Warning): New method. Reports warning based on the warning table.
11638         (Error_T): New method. Reports error based on the error table.
11639
11640         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
11641         verifications are done here.
11642
11643         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
11644
11645         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
11646         CLSCompliantAttribute.
11647         (all_imported_types): New member holds all imported types from other
11648         assemblies.
11649         (LoadAllImportedTypes): New method fills static table with exported types
11650         from all referenced assemblies.
11651         (Modules): New property returns all assembly modules.
11652
11653 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
11654
11655         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
11656         throwing a parser error.
11657
11658         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
11659         which removes the hardcoded get_/set_ prefixes for properties, as
11660         IL allows for the properties to be named something else.  
11661
11662         Bug #56013
11663
11664         * expression.cs: Do not override operand before we know if it is
11665         non-null.  Fix 56207
11666
11667 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11668
11669         * typemanager.cs: support for pinned variables.
11670
11671 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11672
11673         * decl.cs, typemanager.cs: Avoid using an arraylist
11674         as a buffer if there is only one result set.
11675
11676 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
11677
11678         * expression.cs: Make sure you cant call a static method
11679         with an instance expression, bug #56174.
11680
11681 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
11682
11683         * class.cs (IsDuplicateImplementation): Improve error reporting to
11684         flag 663 (method only differs in parameter modifier).
11685
11686         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
11687         in preprocessor directives.
11688
11689         * location.cs (LookupFile): Allow for the empty path.
11690
11691         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
11692         better approach for some of that patch, but its failing with the
11693         CharSet enumeration.  For now try/catch will do.
11694
11695         * typemanager.cs: Do not crash if a struct does not have fields.
11696         Fixes 56150.
11697
11698 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11699
11700         * expression.cs: cs0213, cant fix a fixed expression.
11701         fixes 50231.
11702
11703 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11704
11705         * cs-parser.jay: detect invalid embeded statements gracefully.
11706         bug #51113.
11707
11708 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
11709
11710         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
11711         As a regex:
11712         s/
11713         the invocation type may not be a subclass of the tye of the item/
11714         The type of the item must be a subclass of the invocation item.
11715         /g
11716
11717         Fixes bug #50820.
11718
11719 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
11720
11721         * attribute.cs: Added methods to get a string and a bool from an
11722         attribute. Required to information from AssemblyKeyFileAttribute,
11723         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
11724         * codegen.cs: Modified AssemblyName creation to include support for
11725         strongnames. Catch additional exceptions to report them as CS1548.
11726         * compiler.csproj: Updated include CryptoConvert.cs.
11727         * compiler.csproj.user: Removed file - user specific configuration.
11728         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
11729         Mono.Security assembly. The original class is maintained and tested in
11730         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
11731         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
11732         like CSC 8.0 (C# v2) supports.
11733         * Makefile: Added CryptoConvert.cs to mcs sources.
11734         * rootcontext.cs: Added new options for strongnames.
11735
11736 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
11737
11738         * driver.cs: For --expect-error, report error code `2'
11739         if the program compiled with no errors, error code `1' if
11740         it compiled with an error other than the one expected.
11741
11742 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
11743
11744         * compiler.csproj: Updated for Visual Studio .NET 2003.
11745         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
11746         * compiler.sln: Updated for Visual Studio .NET 2003.
11747
11748 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
11749
11750         * expression.cs: Fix bug #47234. We basically need to apply the
11751         rule that we prefer the conversion of null to a reference type
11752         when faced with a conversion to 'object' (csc behaviour).
11753
11754 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11755
11756         * statement.cs: Shorter form for foreach, eliminates
11757         a local variable. r=Martin.
11758
11759 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11760
11761         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
11762         checks if we can use brtrue/brfalse to test for 0.
11763         * expression.cs: use the above in the test for using brtrue/brfalse.
11764         cleanup code a bit.
11765
11766 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11767
11768         * expression.cs: Rewrite string concat stuff. Benefits:
11769
11770         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
11771         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
11772         rather than a concat chain.
11773
11774         * typemanager.cs: Add lookups for more concat overloads.
11775
11776 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
11777
11778         * expression.cs: Emit shorter il code for array init.
11779
11780         newarr
11781         dup
11782         // set 1
11783
11784         // set 2
11785
11786         newarr
11787         stloc.x
11788
11789         ldloc.x
11790         // set 1
11791
11792         ldloc.x
11793         // set 2
11794
11795 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
11796
11797         * statement.cs: Before, two switch blocks would be merged if the
11798         total size of the blocks (end_item - begin_item + 1) was less than
11799         two times the combined sizes of the blocks.
11800
11801         Now, it will only merge if after the merge at least half of the
11802         slots are filled.
11803
11804         fixes 55885.
11805
11806 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
11807
11808         * class.cs : csc build fix for GetMethods(). See bug #52503.
11809
11810 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
11811
11812         * expression.cs: Make sure fp comparisons work with NaN.
11813         This fixes bug #54303. Mig approved this patch a long
11814         time ago, but we were not able to test b/c the runtime
11815         had a related bug.
11816
11817 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
11818
11819         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
11820
11821 2004-03-19  Martin Baulig  <martin@ximian.com>
11822
11823         * class.cs (MemberCore.IsDuplicateImplementation): Check whether
11824         two overloads may unify for some type parameter substitutions and
11825         report a CS0408 if appropriate.
11826
11827 2004-03-19  Martin Baulig  <martin@ximian.com>
11828
11829         * class.cs (MemberCore.IsDuplicateImplementation): Report the
11830         error here and not in our caller.
11831
11832 2004-03-19  Martin Baulig  <martin@ximian.com>
11833
11834         * interface.cs: Completely killed this file.
11835         (Interface): We're now a TypeContainer and live in class.cs.
11836
11837         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
11838         argument; we're now also called for interfaces.
11839         (TypeContainer.DefineMembers): Allow this method being called
11840         multiple times.
11841         (TypeContainer.GetMethods): New public method; formerly known as
11842         Interface.GetMethod().  This is used by PendingImplementation.
11843         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
11844         it's now private and non-static.
11845         (Interface): Moved this here; it's now implemented similar to
11846         Class and Struct.
11847         (Method, Property, Event, Indexer): Added `bool is_interface'
11848         argument to their .ctor's.
11849         (MemberBase.IsInterface): New public field.
11850
11851         * cs-parser.jay: Create normal Method, Property, Event, Indexer
11852         instances instead of InterfaceMethod, InterfaceProperty, etc.
11853         (opt_interface_base): Removed; we now use `opt_class_base' instead.
11854         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
11855
11856 2004-03-19  Martin Baulig  <martin@ximian.com>
11857
11858         * class.cs (MethodCore.IsDuplicateImplementation): New private
11859         method which does the CS0111 checking.
11860         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
11861         Use IsDuplicateImplementation().
11862
11863 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
11864
11865         * decl.cs (FindMemberToOverride): New method to find the correct
11866         method or property to override in the base class.
11867         * class.cs
11868             - Make Method/Property use the above method to find the
11869               version in the base class.
11870             - Remove the InheritableMemberSignatureCompare as it is now
11871               dead code.
11872
11873         This patch makes large code bases much faster to compile, as it is
11874         O(n) rather than O(n^2) to do this validation.
11875
11876         Also, it fixes bug 52458 which is that nested classes are not
11877         taken into account when finding the base class member.
11878
11879         Reviewed/Approved by Martin.
11880
11881 2004-03-17  Martin Baulig  <martin@ximian.com>
11882
11883         * expression.cs (MemberAccess.DoResolve): Take the parent's number
11884         of type arguments into account; use the `real_num_type_args'
11885         approach like in DoResolveAsTypeStep().
11886
11887         * generic.cs (GenericMemberAccess.DoResolve): Make this work for
11888         nested types.
11889
11890 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
11891
11892         * interface.cs: In all interface classes removed redundant
11893         member initialization.
11894
11895 2004-03-16  Martin Baulig  <martin@ximian.com>
11896
11897         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
11898
11899 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
11900
11901         * decl.cs (DefineTypeAndParents): New helper method to define a
11902         type's containers before the type itself is defined;  This is a
11903         bug exposed by the recent changes to Windows.Forms when an
11904         implemented interface was defined inside a class that had not been
11905         built yet.   
11906
11907         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
11908
11909         (Check): Loop correctly to report errors modifiers
11910         (UNSAFE was not in the loop, since it was the same as TOP).
11911
11912         * interface.cs: Every interface member now takes a ModFlags,
11913         instead of a "is_new" bool, which we set on the base MemberCore. 
11914
11915         Every place where we called "UnsafeOk" in the interface, now we
11916         call the proper member (InterfaceMethod.UnsafeOK) instead to get
11917         the unsafe settings from the member declaration instead of the
11918         container interface. 
11919
11920         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
11921
11922         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
11923         `set_indexer_name' to the pending bits (one per type).
11924
11925         We fixed a bug today that was picking the wrong method to
11926         override, since for properties the existing InterfaceMethod code
11927         basically ignored the method name.  Now we make sure that the
11928         method name is one of the valid indexer names.
11929
11930 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
11931  
11932         * support.cs (SeekableStreamReader): Keep track of stream byte
11933         positions and don't mix them with character offsets to the buffer.
11934
11935         Patch from Gustavo Giráldez
11936
11937 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
11938
11939         * interface.cs (InterfaceSetGetBase): Removed double member
11940         initialization, base class does it as well.
11941
11942 2004-03-13  Martin Baulig  <martin@ximian.com>
11943
11944         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
11945         when compiling corlib.
11946
11947 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
11948
11949         * convert.cs (ExplicitConversion): We were reporting an error on
11950         certain conversions (object_type source to a value type, when the
11951         expression was `null') before we had a chance to pass it through
11952         the user defined conversions.
11953
11954         * driver.cs: Replace / and \ in resource specifications to dots.
11955         Fixes 50752
11956
11957         * class.cs: Add check for duplicate operators.  Fixes 52477
11958
11959 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
11960
11961         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
11962         that are in the middle of the statements, not only at the end.
11963         Fixes #54987
11964
11965         * class.cs (TypeContainer.AddField): No longer set the
11966         `HaveStaticConstructor' flag, now we call it
11967         `UserDefineStaticConstructor' to diferentiate the slightly
11968         semantic difference.
11969
11970         The situation is that we were not adding BeforeFieldInit (from
11971         Modifiers.TypeAttr) to classes that could have it.
11972         BeforeFieldInit should be set to classes that have no static
11973         constructor. 
11974
11975         See:
11976
11977         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
11978
11979         And most importantly Zoltan's comment:
11980
11981         http://bugzilla.ximian.com/show_bug.cgi?id=44229
11982
11983         "I think beforefieldinit means 'it's ok to initialize the type sometime 
11984          before its static fields are used', i.e. initialization does not need
11985          to be triggered by the first access to the type. Setting this flag
11986          helps the JIT to compile better code, since it can run the static
11987          constructor at JIT time, and does not need to generate code to call it
11988          (possibly lots of times) at runtime. Unfortunately, mcs does not set
11989          this flag for lots of classes like String. 
11990          
11991          csc sets this flag if the type does not have an explicit static 
11992          constructor. The reasoning seems to be that if there are only static
11993          initalizers for a type, and no static constructor, then the programmer
11994          does not care when this initialization happens, so beforefieldinit
11995          can be used.
11996          
11997          This bug prevents the AOT compiler from being usable, since it 
11998          generates so many calls to mono_runtime_class_init that the AOT code
11999          is much slower than the JITted code. The JITted code is faster, 
12000          because it does not generate these calls if the vtable is type is
12001          already initialized, which is true in the majority of cases. But the
12002          AOT compiler can't do this."
12003
12004 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
12005
12006         * class.cs (MethodData.Emit): Refactor the code so symbolic
12007         information is generated for destructors;  For some reasons we
12008         were taking a code path that did not generate symbolic information
12009         before. 
12010
12011 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
12012
12013         * class.cs: Create a Constructor.CheckBase method that
12014         takes care of all validation type code. The method
12015         contains some code that was moved from Define.
12016
12017         It also includes new code that checks for duplicate ctors.
12018         This fixes bug #55148.
12019
12020 2004-03-09  Joshua Tauberer <tauberer@for.net>
12021
12022         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
12023         a { ... }-style array creation invokes EmitStaticInitializers
12024         which is not good for reference-type arrays.  String, decimal
12025         and now null constants (NullCast) are not counted toward
12026         static initializers.
12027
12028 2004-03-05  Martin Baulig  <martin@ximian.com>
12029
12030         * location.cs (SourceFile.HasLineDirective): New public field;
12031         specifies whether the file contains or is referenced by a "#line"
12032         directive.
12033         (Location.DefineSymbolDocuments): Ignore source files which
12034         either contain or are referenced by a "#line" directive.        
12035
12036 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
12037
12038         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
12039         direct access to our parent, so check the method inline there.
12040
12041 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12042
12043         * expression.cs (Invocation.EmitCall): Miguel's last commit
12044         caused a regression. If you had:
12045
12046             T t = null;
12047             t.Foo ();
12048
12049         In Foo the implict this would be null.
12050
12051 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
12052
12053         * expression.cs (Invocation.EmitCall): If the method is not
12054         virtual, do not emit a CallVirt to it, use Call.
12055
12056         * typemanager.cs (GetFullNameSignature): Improve the method to
12057         cope with ".ctor" and replace it with the type name.
12058
12059         * class.cs (ConstructorInitializer.Resolve): Now the method takes
12060         as an argument the ConstructorBuilder where it is being defined,
12061         to catch the recursive constructor invocations.
12062
12063 2004-03-16  Martin Baulig  <martin@ximian.com>
12064
12065         * expression.cs (MemberAccess.DoResolve): If `expr' resolved to a
12066         ConstructedType, call ResolveType() on it to get the type rather
12067         than just using `expr.Type'.
12068
12069 2004-03-16  Martin Baulig  <martin@ximian.com>
12070
12071         * generics.cs (ConstructedType.GetMemberAccess): Take the
12072         EmitContext instead on the TypeExpr and use
12073         ec.TypeContainer.CurrentType/ec.ContainerType.
12074
12075 2004-03-16  Martin Baulig  <martin@ximian.com>
12076
12077         * ecore.cs (SimpleName.DoResolveAsTypeStep): Lookup type
12078         parameters before aliases.
12079
12080 2004-03-16  Martin Baulig  <martin@ximian.com>
12081
12082         * typemanager.cs (TypeManager.MayBecomeEqualGenericInstances):
12083         New oublic function; checks whether two generic instances may become
12084         equal under some instantiations (26.3.1).
12085
12086         * class.cs (TypeContainer.Define): Call
12087         TypeManager.MayBecomeEqualGenericInstances() and report CS0695 on
12088         error.
12089
12090 2004-03-16  Martin Baulig  <martin@ximian.com>
12091
12092         * class.cs (TypeContainer.GetClassBases): Moved
12093         Error_TypeParameterAsBase() here and also check whether the base
12094         class is not an attribute.
12095
12096 2004-03-16  Martin Baulig  <martin@ximian.com>
12097
12098         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
12099
12100 2004-03-16  Martin Baulig  <martin@ximian.com>
12101
12102         * class.cs (Error_TypeParameterAsBase): Use correct error number
12103         here (CS0689).  
12104
12105 2004-03-16  Martin Baulig  <martin@ximian.com>
12106
12107         * decl.cs (DeclSpace.ResolveTypeExpr): Added more error checking
12108         for generics.
12109
12110         * generics.cs (ConstructedType.DoResolveAsTypeStep): Added better
12111         error reporting.
12112
12113 2004-03-15  Martin Baulig  <martin@ximian.com>
12114
12115         * typemanager.cs (TypeManager.GetFullName): New public method.
12116         (TypeManager.MemberLookup): Added `int_num_type_arguments'
12117         argument; only return members with the correct number of type
12118         arguments.
12119         (TypeManager.CheckGeneric): Allow -1 to bypass the check.
12120         (TypeManager.FilterWithClosure): Call CheckGeneric() to check
12121         whether the number of type arguments matches.
12122
12123         * generic.cs (GenericMemberAccess.ResolveAsTypeStep): Allow `expr'
12124         not being a ConstructedType; we can now do "typeof (Foo.Bar<U>)".
12125
12126         * expression.cs (MemberAccess): Added public `NumTypeArguments'
12127         field; it's set by the protected .ctor when we're actually a
12128         GenericMemberAccess.
12129         (MemberAccess.ResolveAsTypeStep): Compute the total number of type
12130         arguments and pass it to MemberLookupFinal ().
12131
12132         * ecore.cs (Expression.MemberLookup): Added `int
12133         num_type_arguments' argument; only return members with the correct
12134         number of type arguments.
12135         (Expression.MemberLookupFailed): Check whether the MemberLookup
12136         failed because we did not have the correct number of type
12137         arguments; report CS0305 in this case.
12138
12139         * decl.cs (DeclSpace.ResolveTypeExpr): Don't report an error if
12140         `e.ResolveAsTypeTerminal()' already did so.
12141
12142 2004-03-15  Martin Baulig  <martin@ximian.com>
12143
12144         * ecore.cs (Expression.ResolveLValue): Allow e.type being null if
12145         we're a ConstructedType; in this case, the caller must report an
12146         error (for instance CS0131).
12147
12148         * generic.cs (TypeArguments): Added Location argument to the .ctor.
12149         (TypeArguments.Resolve): Actually report errors here.
12150
12151 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
12152
12153         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
12154         `set_indexer_name' to the pending bits (one per type).
12155
12156         We fixed a bug today that was picking the wrong method to
12157         override, since for properties the existing InterfaceMethod code
12158         basically ignored the method name.  Now we make sure that the
12159         method name is one of the valid indexer names.
12160
12161 2004-03-15  Martin Baulig  <martin@ximian.com>
12162
12163         * typemanager.cs (TypeManager.IndexerPropertyName): Added support
12164         for generic instances.
12165
12166 2004-03-13  Martin Baulig  <martin@ximian.com>
12167
12168         * class.cs (TypeContainer.DefineType): Call
12169         TypeManager.AddUserType() immediately after creating the
12170         TypeBuilder; pass all type parameters when creating the
12171         CurrentType.
12172
12173         * decl.cs (DeclSpace.FindNestedType): New public method.
12174         (DeclSpace.FindType): Added `int num_type_args' argument; only
12175         return types with the correct number of type parameters.
12176         (DeclSpace.CountTypeParams): New public property.
12177
12178         * ecore.cs (SimpleName.ctor): Added overloaded version which takes
12179         the number of type parameters; defaults to zero.
12180
12181         * generic.cs (TypeArguments.Count): New public property.
12182         (ConstructedType.DoResolveAsTypeStep): First call
12183         ds.FindNestedType() to find out whether we're nested in the
12184         current generic type; in this case, we inherit all type parameters
12185         from the current class.
12186
12187         * rootcontext.cs (RootContext.NamespaceLookup): Added `int
12188         num_type_args' argument.
12189         (RootContext.LookupType): Added overloaded version which takes the
12190         number of type arguments; only return types with the correct
12191         number of type arguments.
12192
12193         * typemanager.cs (TypeManager.CheckGeneric): New public function;
12194         checks whether `Type t' has `int num_type_args'.
12195
12196 2004-03-13  Martin Baulig  <martin@ximian.com>
12197
12198         * generic.cs (GenericMethod.DefineType): New method; calls
12199         DefineType() on all the type parameters.
12200
12201         * class.cs (MethodData.ctor): Added `GenericMethod generic' argument.
12202         (MethodData.Define): If we're a generic method, call
12203         GenericMethod.DefineType() to define the type parameters.       
12204
12205 2004-03-10  Martin Baulig  <martin@ximian.com>
12206
12207         * pending.cs (Pending.InterfaceMethod): Use TypeManager.IsEqual()
12208         instead of IsAssignableFrom.    
12209
12210 2004-03-10  Martin Baulig  <martin@ximian.com>
12211
12212         * ecore.cs (FieldExpr.ctor): Use TypeManager.TypeToCoreType().
12213
12214         * support.cs (ParameterData.HasArrayParameter): New property.
12215         (ReflectionParameters.ctor): Take a MethodBase instead of a
12216         ParameterInfo[].  If we have any type parameters, get the generic
12217         method definition and ask it whether we have variable arguments.
12218
12219 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
12220
12221         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
12222         routines to check if a type is an enumerable/enumerator allow
12223         classes that implement the IEnumerable or IEnumerator interfaces.
12224
12225         * class.cs (Property, Operator): Implement IIteratorContainer, and
12226         implement SetYields.
12227
12228         (Property.Define): Do the block swapping for get_methods in the
12229         context of iterators.   We need to check if Properties also
12230         include indexers or not.
12231
12232         (Operator): Assign the Block before invoking the
12233         OperatorMethod.Define, so we can trigger the Iterator code
12234         replacement. 
12235
12236         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
12237         Property and Operator classes are not created when we parse the
12238         declarator but until we have the block completed, so we use a
12239         singleton SimpleIteratorContainer.Simple to flag whether the
12240         SetYields has been invoked.
12241
12242         We propagate this setting then to the Property or the Operator to
12243         allow the `yield' to function.
12244
12245 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
12246
12247         * codegen.cs: Implemented attribute support for modules.
12248         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
12249         Assembly/Module functionality.
12250
12251         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
12252         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
12253         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
12254
12255 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
12256
12257         * interface.cs (FindMembers): The operation is performed on all base
12258         interfaces and not only on the first. It is required for future CLS Compliance patch.
12259
12260 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12261
12262         * statement.cs, codegen.cs:
12263         This patch deals with patterns such as:
12264
12265         public class List : IEnumerable {
12266
12267                 public MyEnumerator GetEnumerator () {
12268                         return new MyEnumerator(this);
12269                 }
12270
12271                 IEnumerator IEnumerable.GetEnumerator () {
12272                         ...
12273                 }
12274                 
12275                 public struct MyEnumerator : IEnumerator {
12276                         ...
12277                 }
12278         }
12279
12280         Before, there were a few things we did wrong:
12281         1) we would emit callvirt on a struct, which is illegal
12282         2) we emited ldarg when we needed to emit ldarga
12283         3) we would mistakenly call the interface methods on an enumerator
12284         type that derived from IEnumerator and was in another assembly. For example:
12285
12286         public class MyEnumerator : IEnumerator
12287
12288         Would have the interface methods called, even if there were public impls of the
12289         method. In a struct, this lead to invalid IL code.
12290
12291 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
12292
12293         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
12294           renamed to Emit.
12295
12296         * delegate.cs (Define): Fixed crash when delegate type is undefined.
12297
12298 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
12299
12300         * cs-parser.jay: Fix small regression: we were not testing V2
12301         compiler features correctly.
12302
12303         * interface.cs: If the emit context is null, then create one
12304
12305 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
12306
12307         * decl.cs (GetSignatureForError): New virtual method to get full name
12308           for error messages.
12309
12310         * attribute.cs (IAttributeSupport): New interface for attribute setting.
12311           Now it is possible to rewrite ApplyAttributes method to be less if/else.
12312
12313         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
12314           Duplicated members and code in these classes has been removed.
12315           Better encapsulation in these classes.
12316
12317 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
12318
12319         * assign.cs (Assign.DoResolve): When dealing with compound
12320         assignments, there is a new rule in ECMA C# 2.4 (might have been
12321         there before, but it is documented here) that states that in:
12322
12323         a op= b;
12324
12325         If b is of type int, and the `op' is a shift-operator, then the
12326         above is evaluated as:
12327
12328         a = (int) a op b 
12329
12330         * expression.cs (Binary.ResolveOperator): Instead of testing for
12331         int/uint/long/ulong, try to implicitly convert to any of those
12332         types and use that in pointer arithmetic.
12333
12334         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
12335         method to print information for from the type, not from the
12336         null-method we were given.
12337
12338 2004-02-01  Duncan Mak  <duncan@ximian.com>
12339
12340         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
12341         parsing for cmd, fixes bug #53694.
12342
12343 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
12344
12345         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
12346         in the member name duplication tests. Property and operator name duplication
12347         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
12348
12349 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
12350
12351         * interface.cs (PopulateMethod): Fixed crash when interface method
12352         returns not existing type (error test cs0246-3.cs).
12353
12354 2004-02-02  Ravi Pratap M <ravi@ximian.com>
12355
12356         * cs-parser.jay (interface_accessors): Re-write actions to also
12357         store attributes attached to get and set methods. Fix spelling
12358         while at it.
12359
12360         (inteface_property_declaration): Modify accordingly.
12361
12362         (InterfaceAccessorInfo): New helper class to store information to pass
12363         around between rules that use interface_accessors.
12364
12365         * interface.cs (Emit): Apply attributes on the get and set
12366         accessors of properties and indexers too.
12367
12368         * attribute.cs (ApplyAttributes): Modify accordingly to use the
12369         right MethodBuilder when applying attributes to the get and set accessors.
12370
12371 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
12372
12373         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
12374
12375 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
12376
12377         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
12378
12379 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
12380
12381         * cs-parser.jay: Remove YIELD token, instead use the new grammar
12382         changes that treat `yield' specially when present before `break'
12383         or `return' tokens.
12384
12385         * cs-tokenizer.cs: yield is no longer a keyword.
12386
12387 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
12388
12389         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
12390         setting for default constructors.
12391         For default constructors are almost every time set wrong Modifier. The
12392         generated IL code has been alright. But inside mcs this values was
12393         wrong and this was reason why several of my CLS Compliance tests
12394         failed.
12395
12396 2004-02-27  Martin Baulig  <martin@ximian.com>
12397
12398         * generics.cs (ConstructedType.ResolveType): Make the nested type
12399         stuff actually work.
12400
12401 2004-02-25  Martin Baulig  <martin@ximian.com>
12402
12403         * decl.cs (DeclSpace.CurrentTypeParameters): New protected
12404         property; returns the type parameters just from the current type,
12405         ie. with the ones from outer classes.
12406         (DeclSpace.LookupGeneric): First search in the current class, then
12407         in outer classes.
12408         (DeclSpace.initialize_type_params): When hiding a type parameter
12409         from an outer class, put it into the `type_param_list' anyways.
12410
12411         * expression.cs (MemberAccess.expr): Made this field protected.
12412
12413         * class.cs (TypeContainer.Define): The `CurrentType' just contains
12414         the type parameters from the current class.
12415
12416         * generic.cs (ConstructedType.ResolveType): Support nested generic
12417         types by taking the type parameters which we inherit from outer
12418         classes into account.
12419         (GenericMemberAccess.ResolveAsTypeStep): Override this and added
12420         support for nested generic types.
12421
12422 2004-02-23  Martin Baulig  <martin@ximian.com>
12423
12424         * decl.cs (DeclSpace.IsGeneric): Make this a property instead of a
12425         field and check whether we're nested inside a generic type.
12426         (DeclSpace.ResolveType): If we're resolving to a generic type
12427         definition, create a ConstructedType and return its resolved type.
12428         (DeclSpace.initialize_type_params): New private method;
12429         initializes the `type_param_list' field from the type parameters
12430         from this and all enclosing classes.
12431         (DeclSpace.TypeParameters): Call initialize_type_params() unless
12432         we're already initialized.
12433
12434 2004-02-23  Martin Baulig  <martin@ximian.com>
12435
12436         * class.cs (Method.Define): Create the generic method before
12437         calling DoDefine().
12438         (Memberbase.DoDefine): Added DeclSpace argument (in addition to
12439         the TypeContainer one); we use this for generic methods.
12440
12441         * decl.cs (CheckAccessLevel): If we're a GenericMethod, use our
12442         parent's TypeBuilder.
12443
12444 2004-02-18  Martin Baulig  <martin@ximian.com>
12445
12446         * ecore.cs (FieldExpr.DoResolveLValue): Use TypeManager.IsEqual()
12447         to check for equality.
12448
12449 2004-02-05  Martin Baulig  <martin@ximian.com>
12450
12451         * ecore.cs (FieldExpr.DoResolveLValue): If we have an
12452         `ec.TypeContainer.CurrentType', use it instead of
12453         `ec.ContainerType' to check whether we're in the type's ctor.
12454
12455 2004-01-29  Martin Baulig  <martin@ximian.com>
12456
12457         * expression.cs (Invocation.DoResolve): If we're a
12458         `ConstructedType', then we're actually a generic method, so
12459         rewrite the expr as a GenericMemberAccess.
12460
12461         * cs-parser.jay (member_name): Don't use `namespace_or_type_name'
12462         here; manually parse it into a string.
12463
12464 2004-01-28  Martin Baulig  <martin@ximian.com>
12465
12466         * typemanager.cs (TypeManager.IsEqual): New static method.
12467         (TypeManager.FilterWithClosure): Call TypeManager.IsEqual() to
12468         check for equality instead of using `=='.
12469
12470 2004-01-26  Martin Baulig  <martin@ximian.com>
12471
12472         * decl.cs (DeclSpace.CurrentType): New public field.
12473
12474         * expression.cs (This.ResolveBase): If we have an
12475         `ec.TypeContainer.CurrentType', use it instead of
12476         `ec.ContainerType'.
12477
12478         * class.cs (TypeContainer.DefineType): If we're a generic type,
12479         create the `CurrentType' (unresolved).
12480         (TypeContainer.GenericType): New private field.
12481         (TypeContainer.DefineMembers): If we have a `CurrentType', resolve
12482         it and store it in `GenericType' before creating the MemberCache.
12483         (TypeContainer.GetMembers): If we have a `GenericType', call
12484         TypeManager.FindMembers() on it.
12485
12486         * interface.cs (Interface.GenericType): New private field.
12487         (Interface.DefineType): If we're a generic type, create the
12488         `CurrentType' (unresolved).
12489         (Interface.DefineMembers): If we have a `CurrentType', resolve it
12490         and store it in `GenericType' before creating the MemberCache.
12491         (Interface.GetMembers): If we have a `GenericType', call
12492         TypeManager.FindMembers() on it.
12493
12494 2004-01-22  Martin Baulig  <martin@ximian.com>
12495
12496         * cs-parser.jay (namespace_or_type_name): Return an Expression,
12497         not a QualifiedIdentifier.  This is what `type_name_expression'
12498         was previously doing.
12499         (type_name_expression): Removed; the code is now in
12500         `namespace_or_type_name'.
12501         (qualified_identifier): Removed, use `namespace_or_type_name'
12502         instead.
12503         (QualifiedIdentifier): Removed this class.      
12504
12505 2004-01-22  Martin Baulig  <martin@ximian.com>
12506
12507         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
12508         not a string as alias name.
12509
12510 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
12511
12512         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
12513         #52730 bug, and instead compute correctly the need to use a
12514         temporary variable when requesting an address based on the
12515         static/instace modified of the field and the constructor.
12516  
12517 2004-01-21  Martin Baulig  <martin@ximian.com>
12518
12519         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
12520         class and namespace before looking up aliases.  Fixes #52517.
12521
12522 2004-01-21  Martin Baulig  <martin@ximian.com>
12523
12524         * flowanalysis.cs (UsageVector.Merge): Allow variables being
12525         assinged in a 'try'; fixes exception4.cs.
12526
12527 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12528         * class.cs : Implemented parameter-less constructor for TypeContainer
12529
12530         * decl.cs: Attributes are now stored here. New property OptAttributes
12531
12532         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
12533
12534         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
12535
12536 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12537
12538         * typemanager.cs (CSharpSignature): Now reports also inner class name.
12539           (CSharpSignature): New method for indexer and property signature.
12540
12541 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12542
12543         * pending.cs (IsVirtualFilter): Faster implementation.
12544
12545 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12546
12547         * typemanager.cs: Avoid inclusion of same assembly more than once.
12548
12549 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12550
12551         * cs-parser.jay: Fixed problem where the last assembly attribute
12552           has been applied also to following declaration (class, struct, etc.)
12553           
12554 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
12555
12556         * class.cs: Added error CS0538, CS0539 reporting.
12557         Fixed crash on Microsoft runtime when field type is void.
12558
12559         * cs-parser.jay: Added error CS0537 reporting.
12560
12561         * pending.cs: Added error CS0535 reporting.
12562         Improved error report for errors CS0536, CS0534.
12563
12564 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
12565
12566         Merge a few bits from the Anonymous Method MCS tree.
12567
12568         * statement.cs (ToplevelBlock): New class for toplevel methods,
12569         will hold anonymous methods, lifted variables.
12570
12571         * cs-parser.jay: Create toplevel blocks for delegates and for
12572         regular blocks of code. 
12573
12574 2004-01-20  Martin Baulig  <martin@ximian.com>
12575
12576         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
12577         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
12578         and `NeedExplicitReturn'; added `IsLastStatement'.
12579         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
12580         have a `ReturnLabel' or we're not unreachable.
12581
12582         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
12583         child's reachability; don't just override ours with it.  Fixes
12584         #58058 (lluis's example).
12585         (FlowBranching): Added public InTryOrCatch(), InCatch(),
12586         InFinally(), InLoop(), InSwitch() and
12587         BreakCrossesTryCatchBoundary() methods.
12588
12589         * statement.cs (Return): Do all error checking in Resolve().
12590         Unless we are the last statement in a top-level block, always
12591         create a return label and jump to it.
12592         (Break, Continue): Do all error checking in Resolve(); also make
12593         sure we aren't leaving a `finally'.
12594         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
12595         statement in a top-level block.
12596         (Block.Flags): Added `IsDestructor'.
12597         (Block.IsDestructor): New public property.
12598
12599 2004-01-20  Martin Baulig  <martin@ximian.com>
12600
12601         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
12602
12603 2004-01-20  Martin Baulig  <martin@ximian.com>
12604
12605         * statement.cs (Statement.ResolveUnreachable): New public method.
12606         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
12607         (Block.Resolve): Resolve unreachable statements.
12608
12609 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12610
12611         * expression.cs: We need to fix the case where we do
12612         not have a temp variable here.
12613
12614         * assign.cs: Only expression compound assignments need
12615         temporary variables.
12616
12617 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
12618
12619         * flowanalysis.cs: Reduce memory allocation in a few ways:
12620           - A block with no variables should not allocate a bit
12621             vector for itself.
12622           - A method with no out parameters does not need any tracking
12623             for assignment of the parameters, so we need not allocate
12624             any data for it.
12625           - The arrays:
12626                 public readonly Type[] VariableTypes;
12627                 public readonly string[] VariableNames;
12628             Are redundant. The data is already stored in the variable
12629             map, so we need not allocate another array for it.
12630           - We need to add alot of checks for if (params | locals) == null
12631             due to the first two changes.
12632
12633 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
12634
12635         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
12636         implement IMemoryLocation, we store a copy on a local variable and
12637         take the address of it.  Patch from Benjamin Jemlich
12638
12639         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
12640         to use a special "type_name_expression" rule which reduces the
12641         number of "QualifiedIdentifier" classes created, and instead
12642         directly creates MemberAccess expressions.
12643
12644 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
12645
12646         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
12647         that fixes #52853.  Null literal assignment to ValueType
12648
12649         * class.cs (MethodData.Emit): Instead of checking the name of the
12650         method to determine if its a destructor, create a new derived
12651         class from Method called Destructor, and test for that.  
12652
12653         * cs-parser.jay: Create a Destructor object instead of a Method.  
12654
12655         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
12656
12657         Fixes: 52933
12658
12659 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
12660
12661         * expression.cs (Binary.ResolveOperator): Perform an implicit
12662         conversion from MethodGroups to their delegate types on the
12663         Addition operation.
12664
12665         * delegate.cs: Introduce a new class DelegateCreation that is the
12666         base class for `NewDelegate' and `ImplicitDelegateCreation',
12667         factor some code in here.
12668
12669         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
12670         conversion from MethodGroups to compatible delegate types. 
12671
12672         * ecore.cs (Expression.Resolve): Do not flag error 654
12673         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
12674         we allow conversions from MethodGroups to delegate types now.
12675
12676         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
12677         assignments in v2 either.
12678
12679 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
12680
12681         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
12682         static read-only fields in ctors.
12683
12684         Applied patch from Benjamin Jemlich 
12685
12686         * expression.cs (UnaryMutator): Avoid leaking local variables. 
12687
12688 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
12689
12690         * cs-tokenizer.cs (IsCastToken): Allow the various native types
12691         here to return true, as they can be used like this:
12692
12693                 (XXX) int.MEMBER ()
12694
12695         Fixed 49836 and all the other dups
12696
12697 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
12698
12699         * driver.cs: Implement /win32res and /win32icon.
12700
12701 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
12702
12703         * cs-parser.jay: Add a rule to improve error handling for the
12704         common mistake of placing modifiers after the type.
12705
12706 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
12707
12708         * cs-parser.jay (interface_event_declaration): Catch
12709         initialization of events on interfaces, and report cs0068
12710
12711         * cs-parser.jay (interface_event_declaration): Catch
12712         initialization of events. 
12713
12714         * ecore.cs: Better report missing constructors.
12715
12716         * expression.cs (Binary.ResolveOperator): My previous bug fix had
12717         the error reporting done in the wrong place.  Fix.
12718
12719         * expression.cs (Binary.ResolveOperator): Catch the 
12720         operator + (E x, E y) error earlier, and later allow for implicit
12721         conversions in operator +/- (E e, U x) from U to the underlying
12722         type of E.
12723
12724         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
12725         52596, if the container class is abstract, the default constructor
12726         is protected otherwise its public (before, we were always public).
12727
12728         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
12729         fixed statement.
12730
12731         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
12732         Jemlich that fixes bug #52597, MCS was generating invalid code for
12733         idisposable structs.   Thanks to Ben for following up with this
12734         bug as well.
12735
12736 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
12737
12738         * driver.cs: Allow assemblies without code to be generated, fixes
12739         52230.
12740
12741 2004-01-07  Nick Drochak <ndrochak@gol.com>
12742
12743         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
12744
12745 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
12746
12747         * cs-parser.jay: Add rules to improve error reporting if fields or
12748         methods are declared at the namespace level (error 116)
12749
12750         * Add rules to catch event add/remove
12751
12752 2004-01-04  David Sheldon <dave-mono@earth.li>
12753
12754   * expression.cs: Added matching ")" to error message for 
12755   CS0077
12756
12757 2004-01-03 Todd Berman <tberman@gentoo.org>
12758
12759         * ecore.cs, attribute.cs:
12760         Applying fix from #52429.
12761
12762 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12763
12764         * ecore.cs, expression.cs, statement.cs:
12765         Total rewrite of how we handle branching. We
12766         now handle complex boolean expressions with fewer
12767         jumps. As well if (x == 0) no longer emits a ceq.
12768
12769         if (x is Foo) is much faster now, because we generate
12770         better code.
12771
12772         Overall, we get a pretty big improvement on our benchmark
12773         tests. The code we generate is smaller and more readable.
12774
12775         I did a full two-stage bootstrap. The patch was reviewed
12776         by Martin and Miguel.
12777
12778 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12779
12780         * cs-parser.jay: Make primary_expression not take a QI.
12781         we dont need this because the member_access rule covers
12782         us here. So we replace the rule with just IDENTIFIER.
12783
12784         This has two good effects. First, we remove a s/r conflict.
12785         Second, we allocate many fewer QualifiedIdentifier objects.
12786
12787 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12788
12789         * attribute.cs: Handle MarshalAs attributes as pseudo, and
12790         set the correct information via SRE. This prevents
12791         hanging on the MS runtime. Fixes #29374.
12792
12793 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
12794
12795         * convert.cs: correctly handle conversions to value types
12796         from Enum and ValueType as unboxing conversions.
12797
12798         Fixes bug #52569. Patch by Benjamin Jemlich.
12799
12800 2004-01-02  Ravi Pratap  <ravi@ximian.com>
12801
12802         * expression.cs (BetterConversion): Prefer int -> uint
12803         over int -> ulong (csc's behaviour). This fixed bug #52046.
12804
12805 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
12806
12807         * decl.cs (MemberCache.FindMembers): now returns a
12808         MemberInfo [].
12809
12810         * typemanager.cs: In general, go with with ^^.
12811         (CopyNewMethods): take an IList.
12812         (RealMemberLookup): Only allocate an arraylist
12813         if we copy from two sets of methods.
12814
12815         This change basically does two things:
12816         1) Fewer array lists allocated due to CopyNewMethods.
12817         2) the explicit cast in MemberList costed ALOT.
12818
12819 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
12820
12821         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
12822         a hashtable to avoid needless string allocations when an identifier is
12823         used more than once (the common case).
12824
12825 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12826
12827         * pending.cs: MS's TypeBuilder.GetInterfaces ()
12828         is broken, it will not return anything. So, we
12829         have to use the information we have in mcs to
12830         do the task.
12831
12832         * typemanager.cs: Add a cache for GetInterfaces,
12833         since this will now be used more often (due to ^^)
12834
12835         (GetExplicitInterfaces) New method that gets the
12836         declared, not effective, interfaces on a type
12837         builder (eg, if you have interface IFoo, interface
12838         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
12839         { IBar }.
12840
12841         This patch makes MCS able to bootstrap itself on
12842         Windows again.
12843
12844 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
12845
12846         * expression.cs: Remove the Nop's that Miguel put
12847         in by mistake.
12848
12849 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12850
12851         * report.cs, codegen.cs: Give the real stack trace to
12852         the error when an exception is thrown.
12853
12854 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12855
12856         * decl.cs: only allocate hashtables for ifaces if 
12857         it is an iface!
12858
12859 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
12860
12861         * expression.cs: fix the error from cs0121-2.cs
12862         (a parent interface has two child interfaces that
12863         have a function with the same name and 0 params
12864         and the function is called through the parent).
12865
12866 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
12867
12868         * class.cs, rootcontext.cs, typmanager.cs: do not
12869         leak pointers.
12870
12871 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
12872
12873         * codegen.cs: remove stack for the ec flow branching.
12874         It is already a linked list, so no need.
12875
12876 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
12877
12878         * Makefile: Allow custom profiler here.
12879
12880 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12881
12882         * typemanager.cs (LookupType):
12883           - Use a static char [], because split takes
12884             a param array for args, so it was allocating
12885             every time.
12886           - Do not store true in a hashtable, it boxes.
12887
12888 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
12889
12890         * flowanalysis.cs: bytify common enums.
12891
12892 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12893
12894         * modifiers.cs: Add a new set of flags for the
12895         flags allowed on explicit interface impls.
12896         * cs-parser.jay: catch the use of modifiers in
12897         interfaces correctly.
12898         * class.cs: catch private void IFoo.Blah ().
12899
12900         All related to bug #50572.
12901
12902 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12903
12904         * decl.cs: Rewrite the consistant accessability checking.
12905         Accessability is not linear, it must be implemented in
12906         a tableish way. Fixes #49704.
12907
12908 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
12909
12910         * expression.cs: Handle negation in a checked context.
12911         We must use subtraction from zero. Fixes #38674.
12912
12913 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12914
12915         * class.cs: Ignore static void main in DLLs.
12916         * rootcontext.cs: Handle the target type here,
12917         since we are have to access it from class.cs
12918         * driver.cs: account for the above.
12919
12920 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
12921
12922         * report.cs: Give line numbers and files if available.
12923
12924 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
12925
12926         * driver.cs: Implement /addmodule.
12927
12928         * typemanager.cs:  Change 'modules' field so it now contains Modules not
12929         ModuleBuilders.
12930
12931 2003-12-20  Martin Baulig  <martin@ximian.com>
12932
12933         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
12934         (FieldBase.IsAssigned): Removed this field.
12935         (FieldBase.SetAssigned): New public method.
12936         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
12937
12938 2003-12-20  Martin Baulig  <martin@ximian.com>
12939
12940         * expression.cs (LocalVariableReference.DoResolve): Don't set
12941         `vi.Used' if we're called from DoResolveLValue().
12942
12943         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
12944         returns the usage vector it just merged into the current one -
12945         pass this one to UsageWarning().
12946         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
12947         of the `EmitContext', don't call this recursively on our children.
12948
12949 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
12950
12951         * driver.cs: Implement /target:module.
12952
12953 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
12954
12955         * support.cs (CharArrayHashtable): New helper class.
12956
12957         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
12958         char arrays, not strings, so we can avoid creating a string in
12959         consume_identifier if the identifier is a keyword.
12960
12961 2003-12-16  Martin Baulig  <martin@ximian.com>
12962
12963         * statement.cs (LocalInfo.Assigned): Removed this property.
12964         (LocalInfo.Flags): Removed `Assigned'.
12965         (LocalInfo.IsAssigned): New public method; takes the EmitContext
12966         and uses flow analysis.
12967         (Block.UsageWarning): Made this method private.
12968         (Block.Resolve): Call UsageWarning() if appropriate.
12969
12970         * expression.cs (LocalVariableReference.DoResolve): Always set
12971         LocalInfo.Used here.
12972
12973 2003-12-13  Martin Baulig  <martin@ximian.com>
12974
12975         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
12976         any value here; we're now using flow analysis to figure out
12977         whether a statement/block returns a value.
12978
12979 2003-12-13  Martin Baulig  <martin@ximian.com>
12980
12981         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
12982         working again.
12983         (FlowBranching.MergeFinally): Don't call
12984         `branching.CheckOutParameters()' here, this is called in
12985         MergeTopBlock().
12986         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
12987         when adding the `finally' vector.       
12988
12989 2003-12-13  Martin Baulig  <martin@ximian.com>
12990
12991         * flowanalysis.cs
12992         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
12993         actually work and also fix #48962.
12994
12995 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
12996
12997         * decl.cs: Do not check System.Object for nested types,
12998         since we know it does not have any. Big bang for buck:
12999
13000         BEFORE:
13001            Run 1:   8.35 seconds
13002            Run 2:   8.32 seconds
13003            corlib:  17.99 seconds
13004         AFTER:
13005            Run 1:   8.17 seconds
13006            Run 2:   8.17 seconds
13007            corlib:  17.39 seconds
13008
13009 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
13010
13011         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
13012         time we are returning 0 members, so we save alot here.
13013
13014 2003-12-11  Martin Baulig  <martin@ximian.com>
13015
13016         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
13017         `MergeChild()', also just take the `FlowBranching' as argument;
13018         call Merge() on it and return the result.
13019         (FlowBranching.Merge): We don't need to do anything if we just
13020         have one sibling.
13021
13022 2003-12-11  Martin Baulig  <martin@ximian.com>
13023
13024         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
13025         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
13026         Maurer for this idea.
13027
13028 2003-12-11  Martin Baulig  <martin@ximian.com>
13029
13030         * flowanalysis.cs (MergeResult): This class is now gone; we now
13031         use the `UsageVector' for this.  The reason for this is that if a
13032         branching just has one sibling, we don't need to "merge" them at
13033         all - that's the next step to do.
13034         (FlowBranching.Merge): We now return a `UsageVector' instead of a
13035         `MergeResult'.
13036
13037 2003-12-11  Martin Baulig  <martin@ximian.com>
13038
13039         Reworked flow analyis and made it more precise and bug-free.  The
13040         most important change is that we're now using a special `Reachability'
13041         class instead of having "magic" meanings of `FlowReturns'.  I'll
13042         do some more cleanups and optimizations and also add some more
13043         documentation this week.
13044
13045         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
13046         largely reworked this class.
13047         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
13048         the new `Reachability' class instead of having "magic" values here.
13049         (FlowBranching): We're now using an instance of `Reachability'
13050         instead of having separate `Returns', `Breaks' etc. fields.
13051
13052         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
13053         based on flow analysis; ignore the return value of block.Emit ().
13054
13055 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
13056
13057         * driver.cs typemanager.cs: Find the mono extensions to corlib even
13058         if they are private.
13059
13060 2003-12-09  Martin Baulig  <martin@ximian.com>
13061
13062         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
13063         call them directly on the UsageVector.
13064
13065 2003-12-09  Martin Baulig  <martin@ximian.com>
13066
13067         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
13068         Changed return type from `FlowReturns' to `Reachability'.
13069
13070 2003-12-09  Martin Baulig  <martin@ximian.com>
13071
13072         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
13073         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
13074         `Reachable' fields with a single `Reachability' one.
13075
13076 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13077
13078         * class.cs (FindMembers): Remove foreach's.
13079
13080         Bootstrap times:
13081
13082         BEFORE
13083                 Run 1:   8.74 seconds
13084                 Run 2:   8.71 seconds
13085
13086         AFTER
13087                 Run 1:   8.64 seconds
13088                 Run 2:   8.58 seconds
13089
13090
13091 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13092
13093         * cs-parser.jay:
13094         * gen-treedump.cs:
13095         * statement.cs:
13096         This patch does a few things:
13097                 1. EmptyStatement is now a singleton, so it is never reallocated.
13098                 2. All blah is EmptyStatement constructs have been changed to
13099                    blah == EmptyStatement.Value, which is much faster and valid
13100                    now that EmptyStatement is a singleton.
13101                 3. When resolving a block, rather than allocating a new array for
13102                    the non-empty statements, empty statements are replaced with
13103                    EmptyStatement.Value
13104                 4. Some recursive functions have been made non-recursive.
13105         Mainly the performance impact is from (3), however (1) and (2) are needed for
13106         this to work. (4) does not make a big difference in normal situations, however
13107         it makes the profile look saner.
13108
13109         Bootstrap times:
13110
13111         BEFORE
13112         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13113         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
13114         Total memory allocated: 56397 KB
13115
13116         AFTER
13117         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
13118         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
13119         Total memory allocated: 55666 KB
13120
13121 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13122
13123         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
13124         than the hashtable in a hashtable version
13125
13126         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
13127         we always end up concating a string. This results in a huge perf
13128         loss, because many strings have to be tracked by the GC. In this
13129         patch, we first use a hashtable that works with two keys, so that
13130         the strings do not need to be concat'ed.
13131
13132         Bootstrap times:
13133         BEFORE
13134                 Run 1:   8.74 seconds
13135                 Run 2:   8.71 seconds
13136
13137         AFTER
13138                 Run 1:   8.65 seconds
13139                 Run 2:   8.56 seconds
13140
13141 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
13142
13143         * Makefile: Add a new target `do-time' that does a quick and simple
13144         profile, leaving easy to parse output.
13145
13146 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
13147
13148         * codegen.cs (Init): Create the dynamic assembly with 
13149         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
13150
13151 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
13152
13153         * support.cs: Make the PtrHashtable use only one
13154         instance of its comparer.
13155
13156 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
13157
13158         * typemanager.cs: Fix lookup of GetNamespaces.
13159
13160 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
13161
13162         * expression.cs: Removed redundant line.
13163
13164         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
13165         ArrayLists, use for loops with bounds.  
13166
13167         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
13168         arraylist.
13169
13170         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
13171         arraylists, use for loop with bounds.
13172
13173         The above three changes give us a 0.071 second performance
13174         improvement out of 3.294 seconds down to 3.223.  On my machine
13175         the above changes reduced the memory usage by 1,387 KB during
13176         compiler bootstrap.
13177
13178         * cs-parser.jay (QualifiedIdentifier): New class used to represent
13179         QualifiedIdentifiers.  Before we created a new string through
13180         concatenation, and mostly later on, the result would be
13181         manipulated by DecomposeQI through string manipulation.
13182
13183         This reduced the compiler memory usage for bootstrapping from
13184         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
13185         compile times in 0.05 seconds.
13186
13187 2003-11-28  Dick Porter  <dick@ximian.com>
13188
13189         * support.cs: Do string compares with the Invariant culture.
13190
13191         * rootcontext.cs: 
13192         * gen-treedump.cs: 
13193         * expression.cs: 
13194         * driver.cs: 
13195         * decl.cs: 
13196         * codegen.cs: 
13197         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
13198         the comparison is done with the Invariant culture.
13199
13200 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
13201
13202         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
13203         GetEnumerator method.
13204
13205         (ProbeCollectionType): Iterate starting at the most specific type
13206         upwards looking for a GetEnumerator
13207
13208         * expression.cs: Shift count can be up to 31 for int/uint and 63
13209         for long/ulong.
13210
13211 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
13212
13213         * statement.cs (Block.LookupLabel): Also look for the label on the
13214         children blocks.  Use a hash table to keep track of visited
13215         nodes. 
13216
13217         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
13218         we actually did transform the other operand, otherwise fall back
13219         to the common codepath that casts to long.
13220
13221         * cs-tokenizer.cs: Use the same code pattern as the int case.
13222         Maybe I should do the parsing myself, and avoid depending on the
13223         Parse routines to get this done.
13224
13225 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
13226
13227         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13228         which fixes bug 51347.  This time test it.
13229
13230         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
13231         attributes for example can not tell the difference between these.
13232         The difference was only a syntax feature of the language. 
13233
13234         * attribute.cs: Apply attributes to delegates.
13235
13236         * delegate.cs: Call the apply attributes method.
13237
13238 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
13239
13240         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
13241         comparing 0 vs Byte.MinValue, not the value
13242
13243         (ImplicitConversionRequired): When reporting a conversion error,
13244         use error 31 to print out the constant error instead of the
13245         simpler 29.
13246
13247         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
13248         which fixes bug 51347.
13249
13250 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
13251
13252         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
13253         which fixes the -warnaserror command line option.
13254
13255 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
13256
13257         * cfold.cs (DoNumericPromotions): During constant folding of
13258         additions on UIntConstant, special case intconstants with
13259         IntConstants like we do on the expression binary operator. 
13260
13261 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
13262
13263         * convert.cs (ImplicitReferenceConversion): We were missing a case
13264         (System.Enum are not value types or class types, so we need to
13265         classify them separatedly).
13266
13267         * driver.cs: We do not support error 2007.
13268
13269 2003-11-12 Jackson Harper <jackson@ximian.com>
13270
13271         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
13272         system directory. Also use the full file name so users can
13273         libraries names mscorlib-o-tron.dll in a non system dir.
13274         
13275 2004-01-04  David Sheldon <dave-mono@earth.li>
13276
13277         * expression.cs: Added matching ")" to error message for CS0077.
13278
13279 2003-12-19  Martin Baulig  <martin@ximian.com>
13280
13281         * typemanager.cs (TypeManager.IsEqualGenericType): New public
13282         static method; see documentation in the method.
13283         (TypeManager.IsSubclassOrNestedChild): Allow IsEqualGenericType().
13284
13285         * convert.cs (Convert.ImplicitReferenceConversion,
13286         Convert.ImplicitReferenceConversionExists): Add support for
13287         generic type declarations; see gen-36.cs.
13288
13289 2003-12-19  Martin Baulig  <martin@ximian.com>
13290
13291         * pending.cs (Pending.InterfaceMethod): Use
13292         `Type.IsAssignableFrom()' instead of `=='.
13293
13294 2003-12-18  Martin Baulig  <martin@ximian.com>
13295
13296         * decl.cs (DeclSpace.AsAccessible): Check for array, pointer and
13297         byref types first.
13298
13299         * convert.cs (Convert.ImplicitStandardConversionExists): Use
13300         `expr_type.Equals (target_type)' instead of `=='.
13301
13302 2003-12-08  Martin Baulig  <martin@ximian.com>
13303
13304         * generics.cs (Constraints.Types): Removed.
13305         (Constraints.Resolve): Just resolve everything to TypeExpr's, not
13306         to Type's.
13307         (Constraints.ResolveTypes): New public method; resolves the
13308         TypeExpr's to Type's.
13309         (TypeParameter.Define): TypeBuilder.DefineGenericParameter() no
13310         longer takes the constraints.
13311         (TypeParameter.DefineMethod): Likewise.
13312         (TypeParameter.DefineType): New public method.  Calls
13313         `TypeBuilder/MethodBuilder.SetGenericParameterConstraints()' to set
13314         the constraints.
13315
13316 2003-12-08  Martin Baulig  <martin@ximian.com>
13317
13318         * convert.cs (Convert.ImplicitConversionStandard): Use
13319         `expr_type.Equals (target_type)' instead of `=='.
13320
13321 2003-12-08  Martin Baulig  <martin@ximian.com>
13322
13323         * typemanager.cs (TypeManager.GetReferenceType): Call
13324         `Type.MakeByRefType ()'.
13325
13326 2003-12-08  Martin Baulig  <martin@ximian.com>
13327
13328         * cs-parser.jay, cs-tokenizer.cs: `where' is not a keyword, it
13329         just has some special meaning in some situations.  For instance,
13330         it is allowed to use `where' as the name of a variable etc.
13331
13332 2003-12-04  Martin Baulig  <martin@ximian.com>
13333
13334         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
13335         `Type.MakeArrayType()' for array types.
13336
13337 2003-11-18  Miguel de Icaza  <miguel@ximian.com>
13338
13339         * expression.cs (Invocation.VerifyArgumentsCompat): Remove
13340         debugging message.
13341
13342         (SizeOf.DoResolve): assign the `type_queried' field.  This gets
13343         corlib to compile.
13344
13345 2003-11-16  Martin Baulig  <martin@ximian.com>
13346
13347         * codegen.cs (EmitContext.IsGeneric): Removed.
13348
13349         * ecore.cs (SimpleName.ResolveAsTypeStep): Always call
13350         ResolveGeneric() on the DeclSpace.
13351
13352 2003-11-16  Martin Baulig  <martin@ximian.com>
13353
13354         * generic.cs (TypeArguments.Resolve):
13355         `Expression.ResolveAsTypeTerminal()' returns a TypeExpr; call
13356         `ResolveType()' on it to get the Type.
13357
13358 2003-11-15  Martin Baulig  <martin@ximian.com>
13359
13360         * generic.cs (ConstructedType.GetInterfaces): Override this.
13361
13362 2003-11-14  Martin Baulig  <martin@ximian.com>
13363
13364         * interface.cs (Interface.DefineType): Define all type parameters
13365         before adding the interfaces we inherit.
13366
13367 2003-11-11  Martin Baulig  <martin@ximian.com>
13368
13369         * generic.cs (ConstructedType.ResolveType): Always call
13370         `gt.BindGenericParameters (atypes)'; also if `args.HasTypeArguments'.
13371
13372 2003-11-10  Martin Baulig  <martin@ximian.com>
13373
13374         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
13375         (TypeManager.InitCoreTypes): Initialize them here, but instead of
13376         calling `ResolveType()' on them, directly assign their `Type'.
13377
13378 2003-11-08  Martin Baulig  <martin@ximian.com>
13379
13380         * generic.cs (ConstructedType): Override `IsClass' etc.
13381
13382 2003-11-08  Martin Baulig  <martin@ximian.com>
13383
13384         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
13385         return value and the `out parent' parameter.
13386         (TypeContainer.DefineType): Moved the CS0644 check into
13387         GetClassBases().  Don't pass the interface types to the
13388         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
13389         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
13390
13391         * ecore.cs (TypeExpr.IsAttribute): New property.
13392         (TypeExpr.GetInterfaces): New method.
13393
13394         * interface.cs (Interface.GetInterfaceTypeByName): Return a
13395         TypeExpr instead of a Type.
13396         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
13397         (Interface.DefineType): Don't pass the interface types to the
13398         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
13399         them later and then call `TypeBulider.AddInterfaceImplementation()'.
13400
13401         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
13402         instead of a `Type[]'.
13403         (TypeManager.RegisterBuilder): Likewise.
13404         (TypeManager.AddUserInterface): Likewise.
13405         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
13406         `Type[]' and also return a `TypeExpr[]'.
13407         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
13408
13409 2003-11-08  Martin Baulig  <martin@ximian.com>
13410
13411         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
13412         Expression.     
13413
13414 2003-11-08  Martin Baulig  <martin@ximian.com>
13415
13416         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
13417         TypeManager.ResolveExpressionTypes().
13418
13419         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
13420         instead of an Expression.
13421         (TypeExpr): This is now an abstract base class for `TypeExpression'.
13422         (TypeExpression): New public class; formerly known as `TypeExpr'.
13423
13424         * expression.cs (ComposedCast): Derive from TypeExpr.
13425
13426         * typemanager.cs (TypeManager.system_*_expr): These are now
13427         TypExpr's instead of Expression's.
13428         (TypeManager.ResolveExpressionTypes): New public static function;
13429         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
13430         of them.        
13431
13432 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
13433
13434         * expression.cs (New.DoResolve): Do not dereference value that
13435         might be a null return.
13436
13437         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
13438         sure that the constant value has the right type.  Fixes an
13439         unreported bug, similar to 50425.
13440
13441         * const.cs (Const.LookupConstantValue): Call
13442         ImplicitStandardConversionExists before doing a conversion to
13443         avoid havng the TypeManager.ChangeType do conversions.
13444
13445         Reduced the number of casts used
13446
13447         (Const.ChangeType): New routine to enable reuse of the constant
13448         type changing code from statement.
13449
13450         * typemanager.cs (ChangeType): Move common initialization to
13451         static global variables.
13452
13453         Fixes #50425.
13454
13455         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
13456         every value type to go through, even if it was void.  Fix that. 
13457
13458         * cs-tokenizer.cs: Use is_identifier_start_character on the start
13459         character of the define, and the is_identifier_part_character for
13460         the rest of the string.
13461
13462 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
13463
13464         * expression.cs (UnaryMutator.EmitCode): When I updated
13465         LocalVariableReference.DoResolve, I overdid it, and dropped an
13466         optimization done on local variable references.
13467
13468 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
13469
13470         * ecore.cs: Convert the return from Ldlen into an int.
13471
13472 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
13473
13474         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
13475         the accessibility, this is a special case for toplevel non-public
13476         classes (internal for instance).
13477
13478 2003-10-20  Nick Drochak <ndrochak@gol.com>
13479
13480         * ecore.cs: Fix typo and build.  Needed another right paren.
13481
13482 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
13483
13484         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
13485         `internal' case regular and protected, but not allowing protected
13486         to be evaluated later.  Bug 49840
13487
13488 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
13489
13490         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
13491         to kb.Nlast, and not the kb.nFirst to isolate the switch
13492         statement.
13493
13494         Extract the underlying type, so enumerations of long/ulong are
13495         treated like long/ulong.
13496
13497 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
13498
13499         * expression.cs (New): Overload the meaning of RequestedType to
13500         track the possible creation of the NewDelegate type, since
13501         DoResolve is invoked more than once for new constructors on field
13502         initialization.
13503
13504         See bugs: #48800 and #37014
13505
13506         * cs-parser.jay (declare_local_constants): Take an arraylist
13507         instead of a single constant.
13508
13509         (local_constant_declaration): It should take a
13510         constant_declarators, not a constant_declarator.  Fixes 49487
13511
13512         * convert.cs: Fix error report.
13513
13514 2003-10-13 Jackson Harper <jackson@ximian.com>
13515
13516         * typemanager.cs (TypeToCoreType): Add float and double this fixes
13517         bug #49611
13518         
13519 2003-11-03  Martin Baulig  <martin@ximian.com>
13520
13521         * expression.cs (ArrayAccess.GetStoreOpcode): Added
13522         `out bool has_type_arg'; if set, we need to pass the type to
13523         ig.Emit().
13524         (ArrayAccess.GetStoreOpcode, ArrayAccess.EmitLoadOpcode): Use
13525         Stelem_Any/Ldelem_Any for generic parameters.   
13526
13527 2003-11-02  Martin Baulig  <martin@ximian.com>
13528
13529         * expression.cs (Invocation.EmitCall): Use
13530         `TypeManager.IsValueType()' to check whether it's a value type.
13531         Don't set `struct_call' when calling a method on a type parameter.
13532
13533 2003-11-02  Martin Baulig  <martin@ximian.com>
13534
13535         * generics.cs (ConstructedType.Resolve): Renamed to ResolveType()
13536         and removed the TypeBuilder argument.
13537
13538         * typemanager.cs (TypeManager.IsValueType): Return
13539         `t.IsGenericParameter || t.IsValueType'.
13540
13541 2003-10-25  Martin Baulig  <martin@ximian.com>
13542
13543         * decl.cs (DeclSpace.ResolveType): If we're a ConstructedType,
13544         call ConstructedType.Resolve() on it.
13545
13546         * generic.cs (ConstructedType.Resolve): Set `type' on success.
13547
13548 2003-10-25  Martin Baulig  <martin@ximian.com>
13549
13550         * class.cs (TypeContainer.GetClassBases): Changed
13551         `out Type parent' into `out TypeExpr parent'.  Moved CS0644 and
13552         CS8214 reporting here.
13553         (TypeContainer.DefineType): GetClassBases() gives us a `TypeExpr'
13554         instead of a `Type' for our parent.  In case of a recursive
13555         declaration (see tests/gen-23.cs for an example), our parent is a
13556         ConstructedType and it doesn't have its type set.  So, first
13557         create our own TypeBuilder, then call constructed.Resolve() to get
13558         the parent's type and finally TypeBuilder.SetParent() it.
13559
13560         * ecore.cs (TypeExpr.Name): New public virtual property.
13561
13562         * generic.cs
13563         (ConstructedType): We're now a TypeExpr and not just an Expression.
13564         (ConstructedType.ResolveAsTypeStep): Don't resolve our type
13565         arguments here; this is done later.
13566         (ConstructedType.Resolve): New public method to resolve the type
13567         arguments and bind them.
13568
13569 2003-10-21  Martin Baulig  <martin@ximian.com>
13570
13571         * convert.cs: Use `TypeManager.IsValueType' instead of
13572         'type.IsValueType' everywhere.
13573
13574         * typemanager.cs (TypeManager.IsValueType): Return true for type
13575         parameters.  The reason for this is that we need to box a type
13576         parameter when converting it to a reference type.
13577
13578         * cs-parser.jay: Added support for default value expressions.
13579
13580         * generics.cs (DefaultValueExpression): New public class.       
13581
13582 2003-10-17  Martin Baulig  <martin@ximian.com>
13583
13584         * generic.cs (Constraints.Resolve): Take a DecpSpace instead of a
13585         TypeContainer so we can also use this for Interfaces.
13586         (TypeParameter.Resolve): Likewise.
13587
13588         * interface.cs (Interface.DefineType): Added support for generic
13589         interfaces.
13590
13591         * cs-parser.jay: Added support for generic structs and interfaces.
13592
13593 2003-10-17  Martin Baulig  <martin@ximian.com>
13594
13595         * generic.cs (GenericMemberAccess.DoResolve): We can now actually
13596         call generic methods :-)
13597
13598 2003-10-16  Martin Baulig  <martin@ximian.com>
13599
13600         * cs-parser.jay (namespace_or_type_name): Only create a
13601         GenericMemberAccess if we actually have type arguments.
13602
13603 2003-10-13  Martin Baulig  <martin@ximian.com>
13604
13605         * class.cs (Method.Define): If we're a generic method, call
13606         TypeBuilder.DefineGenericMethod () before resolving
13607         the parameters.
13608         (MethodData): Added .ctor which takes an additional MethodBuilder
13609         argument; this is used for generic methods.
13610         (MethodData.Define): Call `builder.SetGenericMethodSignature()' if
13611         we already have a MethodBuilder.
13612
13613 2003-10-10  Martin Baulig  <martin@ximian.com>
13614
13615         * class.cs (Method): Added .ctor which takes a `GenericMethod'
13616         instead of a `DeclSpace'.  This is used for generic methods.
13617
13618         * cs-parser.jay (method_header): Added support for generic
13619         methods; create a `GenericMethod' instance and pass it to the
13620         `Method's .ctor; it'll be used as the `DeclSpace' to lookup
13621         parameters and locals.
13622
13623         * decl.cs (DeclSpace.SetParameterInfo): Removed Location argument
13624         since we already have the location.  Check whether we're a generic
13625         type declaration or a generic method and create the correct type
13626         parameter.
13627
13628         * generic.cs (TypeParameter.DefineMethod): New public method.
13629         (GenericMethod): New public class; derives from DeclSpace and is
13630         used for generic methods.       
13631
13632 2003-10-09  Martin Baulig  <martin@ximian.com>
13633
13634         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
13635         to the .ctor.
13636         (MethodCore.DoDefineParameters): Removed the TypeContainer
13637         argument; use the DeclSpace which was passed to the .ctor instead.
13638         (MethodCore.CheckParameter): Take a DeclSpace instead of a
13639         TypeContainer; we only need a DeclSpace here.
13640
13641 2003-10-09  Martin Baulig  <martin@ximian.com>
13642
13643         * class.cs (MethodData): Added additional `DeclSpace ds' argument
13644         to the .ctor.
13645         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
13646         EmitContext's .ctor.    
13647
13648 2003-10-09  Martin Baulig  <martin@ximian.com>
13649
13650         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
13651         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
13652         AsAccessible(), moved them as well.
13653
13654         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
13655
13656 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
13657
13658         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
13659         generation for >=, as spotted by Paolo, bug 48679.  
13660         Patch from David Waite.
13661
13662         * cs-tokenizer.cs: Add handling for #pragma.
13663
13664         * cs-parser.jay: Allow for both yield and yield return in the
13665         syntax.  The anti-cobolization of C# fight will go on!
13666
13667         * class.cs (TypeBuilder.DefineType): Catch error condition here
13668         (Parent.DefineType erroring out and returning null).
13669
13670         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
13671         coping with enumerations variables, we were mistakenly processing
13672         them as a regular value type instead of built-in types.  Fixes the
13673         bug #48063
13674
13675         * typemanager.cs (IsBuiltinOrEnum): New method.
13676
13677 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
13678
13679         * cs-parser.jay: Upgrade: yield now needs the return clause.
13680
13681 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
13682
13683         * cs-parser.jay : Renamed yyName to yyNames related to jay.
13684
13685 2003-09-29  Martin Baulig  <martin@ximian.com>
13686
13687         * typemanager.cs (TypeManager.GetMethodFlags): Added support for
13688         inflated generic methods.
13689
13690         * generics.cs (ConstructedType): Distinguish between open and
13691         closed constructed types; correctly resolve the arguments.
13692
13693 2003-09-22  Martin Baulig  <martin@ximian.com>
13694
13695         * generic.cs (ConstructedType.ResolveAsTypeCheck): Check whether
13696         all type arguments meet their constraints.
13697
13698 2003-09-19  Martin Baulig  <martin@ximian.com>
13699
13700         * decl.cs (MemberCache.SetupCacheForInterface): Take a
13701         `MemberCache parent' argument.  Normally, an interface doesn't
13702         have a parent type except System.Object, but we use this in gmcs
13703         for generic type parameters.
13704
13705 2003-09-18  Martin Baulig  <martin@ximian.com>
13706
13707         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
13708         on `type.IsInterface'; don't check whether the type has a parent
13709         to determine whether it's an interface.
13710
13711 2003-09-17  Martin Baulig  <martin@ximian.com>
13712
13713         * generic.cs (ConstructedType.ToString): Always use `name' as the
13714         type name.
13715
13716 2003-09-15  Martin Baulig  <martin@ximian.com>
13717
13718         * cs-parser.jay: Fix grammar wrt. type_parameter_constraints.
13719
13720         * generic.cs (Constraints.Resolve): New public method; this is
13721         called to resolve the constraint types and to check whether all
13722         the constraints are correct.
13723         (Constraints.Types): New public property.
13724         (TypeParameter.Resolve): New public method; resolves all the
13725         type's constraints.
13726
13727         * class.cs (TypeContainer.DefineType): Call
13728         TypeParameter.Resolve() before actually defining the type.
13729
13730 2003-09-15  Martin Baulig  <martin@ximian.com>
13731
13732         * class.cs (TypeContainer.DefineType): Added an error flag to
13733         avoid reporting duplicate CS0146's ("class definition is
13734         circular.").
13735
13736         * driver.cs (Driver.MainDriver): Abort if
13737         RootContext.ResolveTree() reported any errors.
13738
13739 2003-09-07  Martin Baulig  <martin@ximian.com>
13740
13741         * report.cs (Error, Warning): Added overloaded versions which take
13742         a `params object[] args' and call String.Format().
13743
13744 2003-09-07  Martin Baulig  <martin@ximian.com>
13745
13746         * decl.cs (DeclSpace..ctor): Don't call
13747         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
13748         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
13749         (DeclSpace.RecordDecl): New method.
13750
13751         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
13752
13753 2003-09-02  Ravi Pratap  <ravi@ximian.com>
13754
13755         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
13756         value attributes to be applied to ParameterBuilders.
13757
13758         * class.cs (MethodCore.LabelParameters): Make static and more
13759         generic so that it can be used from other places - like interface
13760         methods, for instance.
13761
13762         * interface.cs (Interface.Emit): Call LabelParameters before
13763         emitting attributes on the InterfaceMethod.
13764
13765 2003-09-07  Martin Baulig  <martin@ximian.com>
13766
13767         * generic.cs (ConstructedType.ResolveAsTypeStep): Report a CS8217
13768         if the number of type parameters doesn't match.
13769
13770 2003-09-04  Martin Baulig  <martin@ximian.com>
13771
13772         * expression.cs (ComposedCast.ResolveAsTypeStep): Added support
13773         for arrays of generic type params (ie. `!0[]').
13774
13775 2003-09-04  Martin Baulig  <martin@ximian.com>
13776
13777         * class.cs (TypeContainer.AsAccessible): Ignore generic parameters
13778         for the moment.
13779
13780 2003-09-04  Martin Baulig  <martin@ximian.com>
13781
13782         * decl.cs (DeclSpace.LookupGeneric): New method.
13783         (DeclSpace.CheckAccessLevel): Ignore generic parameters for the
13784         moment.
13785
13786         * generic.cs (TypeParameterExpr): Take a TypeParameter as
13787         argument, not just a string.
13788         (TypeParameter.Define): New public method; this is called to
13789         actually define the generic parameter; after this, you can use the
13790         new `Type' property to get the type.
13791
13792 2003-09-04  Martin Baulig  <martin@ximian.com>
13793
13794         * decl.cs (DeclSpace.SetParameterInfo): The `constraints' argument
13795         is now an ArrayList; initialize the result of the `TypeParameters'
13796         property here.
13797         (DeclSpace.GetGenericData): Removed.
13798         (DeclSpace.LookupGeneric): Temporarily removed; we need to
13799         implement this in a different way.
13800         (DeclSpace.GetTypeParameters): Removed; there's now a
13801         `TypeParameters' property.
13802         (DeclSpace.TypeParameters): New public property.
13803
13804         * generic.cs (Constraints): Make this class public.
13805         (TypeParameter): New public class.
13806
13807 2003-09-04  Martin Baulig  <martin@ximian.com>
13808
13809         * decl.cs (DeclSpace.GetTypeParameters): New method to return the
13810         generic parameters.
13811
13812         * class.cs (TypeContainer.DefineType): Call
13813         TypeBuilder.DefineGenericParameter () on all generic parameters if
13814         this is a generic type.
13815
13816 2003-08-28  Martin Baulig  <martin@ximian.com>
13817
13818         * sample-stack.il: Compile this with ilasm: "ilasm /dll
13819         sample-stack.il".
13820
13821         * sample-hello.cs: Compile this with gmcs: "gmcs
13822         /r:sample-stack.dll sample-hello.cs".
13823
13824 2003-08-28  Martin Baulig  <martin@ximian.com>
13825
13826         * generic.cs (ConstructedType.ResolveAsTypeStep): Actually bind
13827         the parameters to the generic type.
13828
13829 2003-08-28  Martin Baulig  <martin@ximian.com>
13830
13831         * cs-tokenizer.cs (parse_less_than): Also allow all builtin types.
13832
13833 2003-08-28  Martin Baulig  <martin@ximian.com>
13834
13835         * cs-parser.jay (opt_type_argument_list): Use
13836         `OP_GENERICS_LT type_arguments OP_GENERICS_GT'.
13837         (primary_expression): Replace `qualified_identifier' with `type_name'.
13838         (type_parameter_list): Use `OP_GENERICS_LT type_parameters OP_GENERICS_GT'.
13839
13840         * cs-tokenizer.cs (is_punct): When reading a `<', invoke a custom
13841         parser to check whether it is syntactically a type parameter list;
13842         return OP_GENERICS_LT/OP_GENERICS_GT instead of OP_LT/OP_GT in
13843         this case.
13844
13845 2003-08-26  Martin Baulig  <martin@ximian.com>
13846
13847         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
13848         resolving aliases; fixes #47927.
13849
13850 2003-08-26  Martin Baulig  <martin@ximian.com>
13851
13852         * statement.cs (Using.DoResolve): This is internally emitting a
13853         try/finally clause, so we need to set ec.NeedExplicitReturn if we
13854         do not always return.  Fixes #47681.
13855
13856 2003-08-26  Martin Baulig  <martin@ximian.com>
13857
13858         * decl.cs (MemberCore): Moved WarningNotHiding(),
13859         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
13860         into MemberBase.
13861         (AdditionResult): Make this nested in DeclSpace.
13862         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
13863         argument; call NamespaceEntry.Define() unless we're nested in a
13864         class or struct.
13865
13866         * namespace.cs (Namespace.DefineName): New public function.  This
13867         is called from DeclSpace's .ctor to add 
13868         (Namespace.Lookup): Include DeclSpaces in the lookup.
13869
13870         * class.cs (Operator): Derive from MemberBase, not MemberCore.
13871
13872         * const.cs (Const): Derive from MemberBase, not MemberCore.     
13873
13874 2003-08-25  Martin Baulig  <martin@ximian.com>
13875
13876         * convert.cs (Convert.ExplicitReferenceConversion): When
13877         converting from an interface type to a class, unbox if the target
13878         type is a struct type.  Fixes #47822.
13879
13880 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13881
13882         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
13883         #47854.
13884
13885 2003-08-22  Martin Baulig  <martin@ximian.com>
13886
13887         * class.cs (TypeManager.DefineType): When defining a nested type,
13888         call DefineType() on our parent; fixes #47801.
13889
13890 2003-08-22  Martin Baulig  <martin@ximian.com>
13891
13892         * class.cs (MethodData.Define): While checking if a method is an
13893         interface implementation, improve the test a bit more to fix #47654.
13894
13895 2003-08-22  Martin Baulig  <martin@ximian.com>
13896
13897         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
13898         correctly; fixes #47722.
13899
13900 2003-08-22  Martin Baulig  <martin@ximian.com>
13901
13902         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
13903         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
13904
13905         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
13906
13907 2003-08-22  Martin Baulig  <martin@ximian.com>
13908
13909         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
13910         can only be assigned in static constructors.  Fixes #47161.
13911
13912 2003-08-22  Martin Baulig  <martin@ximian.com>
13913
13914         Rewrote and improved the flow analysis code.
13915
13916         * flowbranching.cs (FlowBranching): Make this class abstract.
13917         (FlowBranching.CreateBranching): New static function to create a
13918         new flow branching.
13919         (FlowBranchingBlock, FlowBranchingException): New classes.
13920         (FlowBranching.UsageVector.Type): New public readonly field.
13921         (FlowBranching.UsageVector.Breaks): Removed the setter.
13922         (FlowBranching.UsageVector.Returns): Removed the setter.
13923         (FlowBranching.UsageVector): Added Break(), Return(),
13924         NeverReachable() and Throw() methods to modify the reachability.
13925         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
13926         done by FlowBranching.Merge().
13927         (FlowBranching.UsageVector.MergeChild): New method; merges the
13928         merge result into the current vector.
13929         (FlowBranching.Merge): New abstract method to merge a branching.
13930
13931 2003-08-12  Martin Baulig  <martin@ximian.com>
13932
13933         * expression.cs (Indirection.CacheTemporaries): Create the
13934         LocalTemporary with the pointer type, not its element type.
13935
13936 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
13937
13938         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
13939         token was a keyword or not.
13940
13941         Add `error' options where an IDENTIFIER was expected;  Provide
13942         CheckToken and CheckIdentifierToken convenience error reporting
13943         functions. 
13944
13945         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
13946
13947         * decl.cs: Rename `NamespaceEntry Namespace' public field into
13948         NameSpaceEntry NameSpaceEntry.
13949
13950         (LookupInterfaceOrClass): Avoid creating a full qualified name
13951         from namespace and name: avoid doing lookups when we know the
13952         namespace is non-existant.   Use new Tree.LookupByNamespace which
13953         looks up DeclSpaces based on their namespace, name pair.
13954
13955         * driver.cs: Provide a new `parser verbose' to display the
13956         exception thrown during parsing.  This is turned off by default
13957         now, so the output of a failure from mcs is more graceful.
13958
13959         * namespace.cs: Track all the namespaces defined in a hashtable
13960         for quick lookup.
13961
13962         (IsNamespace): New method
13963
13964 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
13965
13966         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
13967         we know that we need to concatenate (full typename can never be
13968         null). 
13969
13970         * class.cs: ditto.
13971
13972         * statement.cs: Use a bitfield;  Do not initialize to null things
13973         which are done by the constructor by default.
13974
13975         * cs-parser.jay: bug fix, parameter was 4, not 3.
13976
13977         * expression.cs: Just use the property;
13978
13979         * statement.cs: No need for GetVariableInfo method.
13980
13981 2003-08-08  Martin Baulig  <martin@ximian.com>
13982
13983         * flowanalysis.cs (FlowReturns): This is now nested in the
13984         `FlowBranching' class.
13985         (MyBitVector): Moved this here from statement.cs.
13986         (FlowBranching.SiblingType): New enum type.
13987         (FlowBranching.CreateSibling): Added `SiblingType' argument.
13988
13989 2003-08-07  Martin Baulig  <martin@ximian.com>
13990
13991         * flowanalysis.cs (FlowBranchingType): This is now nested in the
13992         `FlowBranching' class and called `BranchingType'.
13993
13994 2003-08-07  Martin Baulig  <martin@ximian.com>
13995
13996         * flowanalysis.cs: Moved all the control flow analysis code into
13997         its own file.
13998
13999 2003-08-07  Martin Baulig  <martin@ximian.com>
14000
14001         * assign.cs (Assign.DoResolve): `target' must either be an
14002         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
14003         #37319.
14004
14005 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
14006
14007         * expression.cs (BinaryMethod): This kind of expression is created by the
14008         Binary class if it determines that the operator has to be handled
14009         by a method.
14010
14011         (BinaryDelegate): This kind of expression is created if we are
14012         dealing with a + or - operator on delegates.
14013
14014         (Binary): remove method, argumetns, and DelegateOperator: when
14015         dealing with methods, 
14016
14017         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
14018
14019         * statement.cs (Block): use bitfields for the three extra booleans
14020         we had in use.   Remove unused topblock parameter.
14021
14022         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
14023
14024         * assign.cs: Drop extra unneeded tests.
14025
14026 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
14027
14028         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
14029
14030         * statement.cs (Foreach): Use VariableStorage instead of
14031         LocalBuilders.   
14032
14033         * codegen.cs (VariableStorage): New class used by clients that
14034         require a variable stored: locals or fields for variables that
14035         need to live across yield.
14036
14037         Maybe provide a convenience api for EmitThis+EmitLoad?
14038
14039         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
14040         these bad boys.
14041
14042 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
14043
14044         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
14045         RemapParameterLValue): New methods that are used to turn a
14046         precomputed FieldInfo into an expression like this:
14047
14048                 instance.FieldInfo
14049
14050         The idea is to use this instead of making LocalVariableReference
14051         have more than one meaning.
14052
14053         * cs-parser.jay: Add error production to BASE.
14054
14055         * ecore.cs: Deal with TypeManager.GetField returning null, which
14056         is now a valid return value.
14057
14058         (FieldExprNoAddress): New expression for Fields whose address can
14059         not be taken.
14060
14061         * expression.cs (LocalVariableReference): During the resolve
14062         phases, create new expressions if we are in a remapping context.
14063         Remove code that dealt with remapping here.
14064
14065         (ParameterReference): same.
14066
14067         (ProxyInstance): New expression, like the `This' expression, but
14068         it is born fully resolved.  We know what we are doing, so remove
14069         the errors that are targeted to user-provided uses of `this'.
14070
14071         * statement.cs (Foreach): our variable is now stored as an
14072         Expression;  During resolution, follow the protocol, dont just
14073         assume it will return this.
14074
14075 2003-08-06  Martin Baulig  <martin@ximian.com>
14076
14077         * support.cs (SeekableStreamReader.cs): New public class.
14078
14079         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
14080         SeekableStreamReader instead of the normal StreamReader.
14081
14082 2003-08-04  Martin Baulig  <martin@ximian.com>
14083
14084         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
14085         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
14086         deambiguate casts and delegate invocations.
14087         (parenthesized_expression): Use the new tokens to ensure this is
14088         not a cast of method invocation.
14089
14090         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
14091         when reading a `)' and Deambiguate_CloseParens () was previously
14092         called.
14093
14094         * expression.cs (ParenthesizedExpression): New class.  This is
14095         just used for the CS0075 test.
14096         (Binary.DoResolve): Check for CS0075.   
14097
14098 2003-07-29  Ravi Pratap  <ravi@ximian.com>
14099
14100         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
14101         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
14102         reference comparison.
14103
14104         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
14105         examine the ReturnType for equality - this is necessary in the
14106         cases of implicit and explicit operators whose signature also
14107         includes the return type.
14108
14109 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
14110
14111         * namespace.cs: Cache the result of the namespace computation,
14112         instead of computing it every time.
14113
14114 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14115
14116         * decl.cs: Use a global arraylist that we reuse over invocations
14117         to avoid excesive memory consumption.  Reduces memory usage on an
14118         mcs compile by one meg (45 average).
14119
14120         * typemanager.cs (LookupTypeReflection): In .NET pointers are
14121         private, work around that.
14122
14123 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
14124
14125         * literal.cs (IntLiteral): Define Zero and One static literals. 
14126
14127         * cs-parser.jay (integer_literal): use static literals to reduce
14128         memory usage for the most used literals (0, 1 and -1).  211kb
14129         reduced in memory usage.
14130
14131         Replace all calls to `new ArrayList' with `new
14132         ArrayList(4)' which is a good average number for most allocations,
14133         and also requires only 16 bytes of memory for its buffer by
14134         default. 
14135
14136         This reduced MCS memory usage in seven megabytes for the RSS after
14137         bootstrapping.
14138
14139 2003-07-28  Ravi Pratap  <ravi@ximian.com>
14140
14141         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
14142         handle params methods the correct way by forming only one
14143         applicable set with params and normal methods in them. Earlier we
14144         were looking at params methods only if we found no normal methods
14145         which was not the correct thing to do.
14146
14147         (Invocation.BetterFunction): Take separate arguments indicating
14148         when candidate and the best method are params methods in their
14149         expanded form.
14150
14151         This fixes bugs #43367 and #46199.
14152
14153         * attribute.cs: Documentation updates.
14154
14155         (CheckAttribute): Rename to CheckAttributeTarget.
14156         (GetValidPlaces): Rename to GetValidTargets.
14157
14158         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
14159         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
14160
14161         Fixes bug #44468.
14162
14163 2003-07-28  Miguel de Icaza  <miguel@ximian.com>
14164
14165         * codegen.cs: Compute IsGeneric correctly.
14166
14167         * cs-parser.jay: Introduce OP_GENERIC_LT for the grammar ambiguity
14168         resolution. 
14169
14170         Bring back (temporarily) OP_LEFT_SHIFT, OP_RIGHT_SHIFT,
14171         OP_SHIFT_RIGHT_ASSIGN, OP_SHIFT_LEFT_ASSIGN.  There were too many
14172         regressions, and I was chasing more bugs than I required.
14173
14174         * interface.cs: Use expressions for base type names (like classes
14175         and structs have been doing for a while now), and resolve that.
14176         This patch should probably go into head as well.
14177
14178         This makes it one less user of FindType.
14179
14180 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
14181
14182         This compiler can not self host currently.  Need to fix that.
14183         
14184         * Makefile: compile to `gmcs.exe'
14185
14186         * driver.cs: Turn on v2 by default on gmcs.
14187
14188         * generic.cs (ConstructedType): Does no longer take a container
14189         type argument;  That will be taken care of later.
14190
14191         (ConstructedType.DoResolve, ConstructedType.ResolveAsTypeStep):
14192         Use SimpleName to resolve for now, so we can continue the work on
14193         the parser, until we get Type.GetType that understands generics.
14194
14195         (ConstructedType.ToString): Implement
14196
14197         (TypeArguments.Resolve): Resolve the child expressions as types. 
14198         
14199         * cs-parser.jay: Rename interface_constraints to
14200         type_parameter_constraints
14201
14202         (namespace_or_type_name): Only use constructed types for the basic
14203         construction, we will deal with identifier<...> later.
14204
14205         (type/type_name): No longer call DecomposeQI, as
14206         namespace_or_type_name is always decoded now.
14207         
14208 2003-07-22  Ravi Pratap  <ravi@ximian.com>
14209
14210         * expression.cs (Invocation.OverloadResolve): Follow the spec more
14211         closely: we eliminate methods in base types when we have an
14212         applicable method in a top-level type.
14213
14214         Please see section 14.5.5.1 for an exact description of what goes
14215         on. 
14216
14217         This fixes bug #45127 and a host of other related to corlib compilation.
14218
14219         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
14220         array is the method corresponding to the top-level type (this is
14221         because of the changes made to icall.c) so we change this
14222         accordingly.
14223
14224         (MethodGroupExpr.Name): This too.
14225
14226         * typemanager.cs (GetElementType): New method which does the right
14227         thing when compiling corlib. 
14228
14229         * everywhere: Make use of the above in the relevant places.
14230
14231 2003-07-22  Martin Baulig  <martin@ximian.com>
14232
14233         * cs-parser.jay (invocation_expression): Moved
14234         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
14235         `cast_expression', but create a InvocationOrCast which later
14236         resolves to either an Invocation or a Cast.
14237
14238         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
14239         method; call this before EmitStatement() to make sure that this
14240         expression can be used as a statement.
14241
14242         * expression.cs (InvocationOrCast): New class; resolves to either
14243         an Invocation or a Cast.
14244
14245         * statement.cs (StatementExpression): Call ResolveStatement() on
14246         the ExpressionStatement before emitting it.
14247
14248 2003-07-21  Martin Baulig  <martin@ximian.com>
14249
14250         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
14251         `ref' and `out' attributes match; fixes #46220.
14252         (MemberAccess.ResolveMemberAccess): You can't reference a type
14253         through an expression; fixes #33180.
14254         (Indexers.GetIndexersForType): Don't return the indexers from
14255         interfaces the class implements; fixes #46502.
14256
14257 2003-07-21  Martin Baulig  <martin@ximian.com>
14258
14259         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
14260         CS0661 checks; fixes bug #30442.
14261
14262 2003-07-21  Martin Baulig  <martin@ximian.com>
14263
14264         * decl.cs (AdditionResult): Added `Error'.
14265
14266         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
14267
14268         * typemanager.cs (TypeManager.ChangeType): Catch exceptions; makes
14269         cs0031.cs actually work.
14270
14271  2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14272  
14273         * cs-parser.jay (namespace_name): do not use
14274         namespace_or_type_name, use qualified_identifier, because
14275         namespace_or_type_name will soon return a composed expression
14276         instead of a string.
14277  
14278         (namespace_or_type_name): Instead of returning a string, now this
14279         production returns an expression.
14280  
14281         * codegen.cs (EmitContext): Setup IsGeneric property based on
14282         whether our DeclSpace is generic, our the method is generic.
14283  
14284         * modifier.cs (Modifiers.METHOD_GENERIC): New definition, use if
14285         the method is generic.
14286  
14287         * cs-parser.jay (type_arguments, opt_type_argument_list,
14288         type_parameters, type_parameter_list, opt_type_parameter_list,
14289         type_parameter,, opt_type_parameter_constraints_clauses,
14290         type_parameter_constraints_clauses,
14291         type_parameter_constraint_clause, type_parameter_constraint,
14292         interface_constraints): Add new production
14293  
14294         * decl.cs (DeclSpace): IsGeneric, flag to track whether this
14295         DeclSpace is generic or not.
14296  
14297         (DeclSpace.SetParameterInfo): New routine, used to set the
14298         parameter info for a type.
14299  
14300         (DeclSpace.LookupGeneric): Lookups a name, and if it is a generic,
14301         returns a GenericTypeExpr
14302  
14303         * ecore.cs (SimpleName.ResolveAsTypeStep): If our container is
14304         generic, lookup the generic argument.
14305  
14306         * attribute.cs: Do not allow TypeParameterExpressions in
14307         Attributes.
14308  
14309         * class.cs: Do not allow the Main method to be defined in a
14310         Generic container.
14311  
14312         * expression.cs (SizeOf): Do not allow generic types to be used as
14313         arguments to sizeof.
14314  
14315         * typemanager.cs (IsGeneric): Wrapper for Reflection when we have
14316         it: whether a type is generic or not.  Only works for types we are
14317         currently building for now.
14318         
14319 2003-07-20  Martin Baulig  <martin@ximian.com>
14320
14321         * namespace.cs: Fixed that bug which caused a crash when compiling
14322         the debugger's GUI.
14323
14324 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
14325
14326         * typemanager.cs (LookupTypeReflection): Never expose types which
14327         are NotPublic, NestedPrivate, NestedAssembly, or
14328         NestedFamANDAssem.  We used to return these, and later do a check
14329         that would report a meaningful error, but the problem is that we
14330         would not get the real match, if there was a name override.
14331
14332 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
14333
14334         * namespace.cs (Namespace, Name): Do not compute the namespace
14335         name dynamically, compute it in the constructor.  This reduced
14336         memory usage by 1697 KB.
14337
14338         * driver.cs: Use --pause to pause at the end.
14339
14340 2003-07-17  Peter Williams  <peter@newton.cx>
14341
14342         * Makefile: Change the name of the test target so that it doesn't
14343         conflict with the recursive test target.
14344
14345 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
14346
14347         * expression.cs (LocalVariableReference.Emit, EmitAssign,
14348         AddressOf): Do not use EmitThis, that was wrong, use the actual
14349         this pointer.
14350
14351 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
14352
14353         * class.cs (MethodData.Define): While checking if a method is an
14354         interface implementation, improve the test: If we are not public
14355         (use new test here: use the computed MethodAttributes directly,
14356         instead of the parsed modifier flags) check if the `implementing'
14357         method comes from an interface or not.
14358
14359         * pending.cs (VerifyPendingMethods): Slightly better error
14360         message.
14361
14362         * makefile: add test target that does the mcs bootstrap.
14363
14364 2003-07-16  Ravi Pratap  <ravi@ximian.com>
14365
14366         * interface.cs (Define): Do nothing here since there are no
14367         members to populate etc. Move the attribute emission out of here
14368         since this was just totally the wrong place to put it. Attribute
14369         application happens during the 'Emit' phase, not in the 'Define'
14370         phase.
14371
14372         (Emit): Add this method and move the attribute emission here
14373
14374         * rootcontext.cs (EmitCode): Call the Emit method on interface
14375         types too.
14376
14377 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14378
14379         * expression.cs (OverloadResolve): Report error only if Location
14380         is not 'Null' which means that there was a probe going on.
14381
14382 2003-07-14  Martin Baulig  <martin@ximian.com>
14383
14384         * expression.cs (ConditionalLogicalOperator): New public class to
14385         implement user defined conditional logical operators.
14386         This is section 14.11.2 in the spec and bug #40505.
14387
14388 2003-07-14  Martin Baulig  <martin@ximian.com>
14389
14390         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
14391
14392 2003-07-14  Martin Baulig  <martin@ximian.com>
14393
14394         * codegen.cs (EmitContext.InFixedInitializer): New public field.
14395
14396         * ecore.cs (IVariable.VerifyFixed): New interface method.
14397
14398         * expression.cs (Unary.ResolveOperator): When resolving the `&'
14399         operator, check whether the variable is actually fixed.  Fixes bug
14400         #36055.  Set a variable definitely assigned when taking its
14401         address as required by the spec.
14402
14403         * statement.cs (LocalInfo.IsFixed): New field.
14404         (LocalInfo.MakePinned): Set `IsFixed' to true.
14405
14406 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
14407
14408         * attribute.cs (Attribute.Resolve): While doing a Member lookup
14409         for .ctors, ensure that we only ask for members declared in the
14410         attribute type (BindingFlags.DeclaredOnly).
14411
14412         Fixes bug #43632.
14413
14414         * expression.cs (Error_WrongNumArguments): Report error 1501
14415         correctly the way CSC does.
14416
14417 2003-07-13  Martin Baulig  <martin@ximian.com>
14418
14419         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
14420         lookup on the fully qualified name, to make things like "X.X" work
14421         where "X.X" is a fully qualified type name, but we also have a
14422         namespace "X" in the using list.  Fixes #41975.
14423
14424 2003-07-13  Martin Baulig  <martin@ximian.com>
14425
14426         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
14427         function. If we're a CompoundAssign, we need to create an embedded
14428         CompoundAssign, not an embedded Assign.
14429         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
14430         Fixes #45854.
14431
14432 2003-07-13  Martin Baulig  <martin@ximian.com>
14433
14434         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
14435         work to fix bug #46088.
14436
14437 2003-07-13  Ravi Pratap <ravi@ximian.com>
14438
14439         * class.cs (Operator.Emit): Do not emit attributes here - it is
14440         taken care of by the Method class that we delegate too. This takes
14441         care of bug #45876.
14442
14443 2003-07-10  Martin Baulig  <martin@ximian.com>
14444
14445         * expression.cs (TypeOfVoid): New class.
14446         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
14447
14448 2003-07-10  Martin Baulig  <martin@ximian.com>
14449
14450         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
14451         bug #35957.
14452
14453 2003-07-10  Martin Baulig  <martin@ximian.com>
14454
14455         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
14456         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
14457
14458         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
14459
14460         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
14461
14462 2003-07-10  Martin Baulig  <martin@ximian.com>
14463
14464         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
14465         of decimal.  Fixes #42850.
14466
14467         NOTE: I also fixed the created byte blob, but this doesn't work on
14468         the MS runtime and csc never produces any byte blobs for decimal
14469         arrays.
14470
14471 2003-07-10  Martin Baulig  <martin@ximian.com>
14472
14473         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
14474         structs; fixes #32068.
14475         (Block.AddChildVariableNames): Fixed #44302.
14476
14477 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14478
14479         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
14480
14481 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14482
14483         * attribute.cs: And this test is onger needed.
14484
14485 2003-07-08  Martin Baulig  <martin@ximian.com>
14486
14487         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
14488         inaccessible types.  Fixes #36313.
14489
14490         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
14491
14492         * namespace.cs (NamespaceEntry): Create implicit entries for all
14493         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
14494         implicit entries for N1.N2 and N1.
14495
14496 2003-07-08  Martin Baulig  <martin@ximian.com>
14497
14498         Rewrote the handling of namespaces to fix a lot of the issues
14499         wrt. `using' aliases etc.
14500
14501         * namespace.cs (Namespace): Splitted this class into a
14502         per-assembly `Namespace' and a per-file `NamespaceEntry'.
14503
14504         * typemanager.cs (TypeManager.IsNamespace): Removed.
14505         (TypeManager.ComputeNamespaces): Only compute namespaces from
14506         loaded assemblies here, not the namespaces from the assembly we're
14507         currently compiling.
14508
14509 2003-07-08  Martin Baulig  <martin@ximian.com>
14510
14511         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
14512
14513 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14514
14515         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
14516         already fixed it.  
14517
14518         I thought about the memory savings here, but LookupTypeReflection
14519         is used under already very constrained scenarios.  Compiling
14520         corlib or mcs only exposes one hit, so it would not really reduce
14521         any memory consumption.
14522
14523 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14524
14525         * typemanager.cs: fixes bug #45889 by only adding public types from
14526         other assemblies to the list of known types.
14527
14528 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
14529
14530         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
14531         on the type we resolved.
14532
14533 2003-07-05  Martin Baulig  <martin@ximian.com>
14534
14535         * pending.cs (PendingImplementation.ParentImplements): Don't
14536         create the proxy if the parent is abstract.
14537
14538         * class.cs (TypeContainer.DefineIndexers): Process explicit
14539         interface implementations first.  Fixes #37714.
14540
14541 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
14542
14543         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
14544         defined recursively;  but since we modify the input parameters
14545         (left is set to `this' temporarily), we reset this value if the
14546         left_is_explicit is false, which gives the original semantics to
14547         the code.  
14548
14549         * literal.cs (NullPointer): new class used to represent a null
14550         literal in a pointer context.
14551
14552         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
14553         type is a pointer, use a NullPointer object instead of a
14554         NullLiteral.   Closes 43687
14555
14556         (ExplicitConversion): Convert pointer values using
14557         the conv opcode to the proper type.
14558
14559         * ecore.cs (New): change ValueTypeVariable property into a method,
14560         that returns whether the valuetype is suitable for being used.
14561
14562         * expression.cs (Binary.DoNumericPromotions): Only return if we
14563         the int constant was a valid uint, and we can return both left and
14564         right as uints.  If not, we continue processing, to trigger the
14565         type conversion.  This fixes 39018.
14566
14567         * statement.cs (Block.EmitMeta): During constant resolution, set
14568         the CurrentBlock property on the emitcontext, so that we resolve
14569         constants propertly.
14570
14571 2003-07-02  Martin Baulig  <martin@ximian.com>
14572
14573         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
14574         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
14575
14576         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
14577         than emitting it here.
14578
14579         * statement.cs: Fixed some more flow analysis bugs.
14580
14581 2003-07-02  Martin Baulig  <martin@ximian.com>
14582
14583         * class.cs (MethodData.Define): When implementing interface
14584         methods, set Final unless we're Virtual.
14585
14586         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
14587         check work for interface methods.
14588
14589 2003-07-01  Martin Baulig  <martin@ximian.com>
14590
14591         * ecore.cs (EmitContext.This): Replaced this property with a
14592         GetThis() method which takes a Location argument.  This ensures
14593         that we get the correct error location for a CS0188.
14594
14595 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
14596
14597         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
14598         ImplicitStandardConversion.
14599
14600         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
14601
14602 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
14603
14604         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
14605         optimization.
14606
14607 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
14608
14609         * class.cs (Constructor.Define): Turn off initlocals for unsafe
14610         constructors.
14611
14612         (MethodData.Define): Turn off initlocals for unsafe methods.
14613
14614 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
14615
14616         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
14617         complete;  Fixes #37521.
14618
14619         * delegate.cs: Use Modifiers.TypeAttr to compute the
14620         TypeAttributes, instead of rolling our own.  This makes the flags
14621         correct for the delegates.
14622
14623 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
14624
14625         * class.cs (Constructor.Define): Set the private flag for static
14626         constructors as well.
14627
14628         * cs-parser.jay (statement_expression): Set the return value to
14629         null, to avoid a crash when we catch an error.
14630
14631 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
14632
14633         * cs-parser.jay: Applied patch from Jackson that adds support for
14634         extern and unsafe modifiers to destructor declarations.
14635
14636         * expression.cs: Report error 21 if the user is trying to index a
14637         System.Array.
14638
14639         * driver.cs: Add an error message, suggested by the bug report.
14640
14641         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
14642         if we do not have a ": this ()" constructor initializer.  Fixes 45149
14643
14644 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
14645
14646         * namespace.cs: Add some information to reduce FAQs.
14647
14648 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
14649
14650         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
14651         underlying enumeration types.  Fixes #43915.
14652
14653         * expression.cs: Treat ushort/short as legal values to be used in
14654         bitwise operations.
14655
14656 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
14657
14658         * delegate.cs: transfer custom attributes for paramenters from
14659         the delegate declaration to Invoke and BeginInvoke.
14660
14661 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
14662
14663         * attribute.cs: handle custom marshalers and emit marshal info
14664         for fields, too.
14665
14666 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
14667
14668         * makefile.gnu: Added anonymous.cs to the compiler sources.
14669
14670 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
14671
14672         * iterators.cs: Change the name of the proxy class to include two
14673         underscores.
14674
14675         * cs-parser.jay: Update grammar to include anonymous methods.
14676
14677         * anonymous.cs: new file.
14678
14679 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
14680
14681         * class.cs (Field.Define): Add missing test for pointers and
14682         safety. 
14683
14684 2003-05-27  Ravi Pratap  <ravi@ximian.com>
14685
14686         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
14687         we use the stobj opcode.
14688
14689         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
14690         since it wasn't the correct fix. 
14691
14692         It still is puzzling that we are required to use stobj for IntPtr
14693         which seems to be a ValueType.
14694
14695 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
14696
14697         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
14698         during regular simple name resolution.   Now, the trick is that
14699         instead of returning for processing the simplename, we do a
14700         TypeManager.LookupType (ie, a rooted lookup as opposed to a
14701         contextual lookup type).   If a match is found, return that, if
14702         not, return for further composition.
14703
14704         This fixes long-standing 30485.
14705
14706         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
14707         using the address to initialize an object, do an Stobj instead of
14708         using the regular Stelem.
14709
14710         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
14711         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
14712         Because if we are a BaseIndexerAccess that value will be true.
14713         Fixes 43643.
14714
14715         * statement.cs (GotoCase.Resolve): Return after reporting an
14716         error, do not attempt to continue. 
14717
14718         * expression.cs (PointerArithmetic.Emit): If our operand is a
14719         long, convert our constants to match the operand before
14720         multiplying.  Convert to I type before adding.   Fixes 43670.
14721
14722 2003-05-14  Ravi Pratap  <ravi@ximian.com>
14723
14724         * enum.cs (ImplicitConversionExists) : Rename to
14725         ImplicitEnumConversionExists to remove ambiguity. 
14726
14727         * ecore.cs (NullCast): New type of cast expression class which
14728         basically is very similar to EmptyCast with the difference being
14729         it still is a constant since it is used only to cast a null to
14730         something else
14731         (eg. (string) null)
14732
14733         * convert.cs (ImplicitReferenceConversion): When casting a null
14734         literal, we return a NullCast.
14735
14736         * literal.cs (NullLiteralTyped): Remove - I don't see why this
14737         should be around anymore.
14738
14739         The renaming (reported was slightly wrong). Corrections:
14740
14741         ConvertImplicitStandard -> ImplicitConversionStandard
14742         ConvertExplicitStandard -> ExplicitConversionStandard
14743
14744         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
14745         before passing them in !
14746
14747         * convert.cs (ImplicitConversionStandard): When comparing for
14748         equal expr and target types, ensure that expr is not a
14749         NullLiteral.
14750
14751         In general, we must not be checking (expr_type ==
14752         target_type) in the top level conversion methods
14753         (ImplicitConversion, ExplicitConversion etc). This checking is
14754         done in the methods that they delegate to.
14755
14756 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
14757
14758         * convert.cs: Move Error_CannotConvertType,
14759         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
14760         ImplicitNumericConversion, ImplicitConversionExists,
14761         ImplicitUserConversionExists, StandardConversionExists,
14762         FindMostEncompassedType, FindMostSpecificSource,
14763         FindMostSpecificTarget, ImplicitUserConversion,
14764         ExplicitUserConversion, GetConversionOperators,
14765         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
14766         TryImplicitIntConversion, Error_CannotConvertImplicit,
14767         ConvertImplicitRequired, ConvertNumericExplicit,
14768         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
14769         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
14770         its own file.
14771
14772         Perform the following renames:
14773
14774         StandardConversionExists -> ImplicitStandardConversionExists
14775         ConvertImplicit -> ImplicitConversion
14776         ConvertImplicitStandard -> ImplicitStandardConversion
14777         TryImplicitIntConversion -> ImplicitIntConversion
14778         ConvertImplicitRequired -> ImplicitConversionRequired
14779         ConvertNumericExplicit -> ExplicitNumericConversion
14780         ConvertReferenceExplicit -> ExplicitReferenceConversion
14781         ConvertExplicit -> ExplicitConversion
14782         ConvertExplicitStandard -> ExplicitStandardConversion
14783
14784 2003-05-19  Martin Baulig  <martin@ximian.com>
14785
14786         * statement.cs (TypeInfo.StructInfo): Made this type protected.
14787         (TypeInfo): Added support for structs having structs as fields.
14788
14789         * ecore.cs (FieldExpr): Implement IVariable.
14790         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
14791         VariableInfo for the field.
14792
14793 2003-05-18  Martin Baulig  <martin@ximian.com>
14794
14795         * expression.cs (This.DoResolve): Report a CS0027 if we're
14796         emitting a field initializer.
14797
14798 2003-05-18  Martin Baulig  <martin@ximian.com>
14799
14800         * expression.cs (This.ResolveBase): New public function.
14801         (This.DoResolve): Check for CS0188.
14802
14803         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
14804         This.Resolve().
14805
14806         * ecore.cs (MethodGroupExpr.DoResolve): Set the
14807         `instance_expression' to null if we don't have any non-static
14808         methods.
14809
14810 2003-05-18  Martin Baulig  <martin@ximian.com>
14811
14812         Reworked the way how local variables and parameters are handled by
14813         the flow analysis code.
14814
14815         * statement.cs (TypeInfo, VariableMap): New public classes.
14816         (VariableInfo): New public class.  This is now responsible for
14817         checking whether a variable has been assigned.  It is used for
14818         parameters and local variables.
14819         (Block.EmitMeta): Take the InternalParameters as argument; compute
14820         the layout of the flow vectors here.
14821         (Block.LocalMap, Block.ParameterMap): New public properties.
14822         (FlowBranching): The .ctor doesn't get the InternalParameters
14823         anymore since Block.EmitMeta() now computes the layout of the flow
14824         vector.
14825         (MyStructInfo): This class is now known as `StructInfo' and nested
14826         in `TypeInfo'; we don't access this directly anymore.
14827
14828         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
14829         property and removed IsAssigned(), IsFieldAssigned(),
14830         SetAssigned() and SetFieldAssigned(); we now call them on the
14831         VariableInfo so we don't need to duplicate this code everywhere.
14832
14833         * expression.cs (ParameterReference): Added `Block block' argument
14834         to the .ctor.
14835         (LocalVariableReference, ParameterReference, This): The new
14836         VariableInfo class is now responsible for all the definite
14837         assignment stuff.
14838
14839         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
14840         IsParameterAssigned, SetParameterAssigned): Removed.
14841
14842 2003-05-18  Martin Baulig  <martin@ximian.com>
14843
14844         * typemanager.cs (InitCoreTypes): Try calling
14845         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
14846         the 3-args-version.  Corlib now also needs our `void_type'.
14847         (GetMethod): Added overloaded version which takes an optional
14848         `bool report_errors' to allow lookups of optional methods.
14849
14850 2003-05-12  Martin Baulig  <martin@ximian.com>
14851
14852         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
14853         only used for locals and not for parameters.
14854
14855 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
14856
14857         * support.cs (InternalParameters.ParameterType): Return the
14858         ExternalType of the parameter.
14859
14860         * parameter.cs (Parameter.ExternalType): drop the two arguments,
14861         they were unused.
14862
14863 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
14864
14865         * class.cs (MethodData.Define): Do not set the `newslot' on
14866         interface members, if they are also flagged as "override".
14867
14868         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
14869         better code for ++i and i++.  This only works for static fields
14870         and local variables.
14871
14872         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
14873         want to pull the DeclSpace out of the builder_to_declspace instead
14874         of the TypeBuilder (like in TypeContainer.FindMembers).
14875
14876         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
14877         instead of LookupTypeContainer.  Fixes the crash on .NET for
14878         looking up interface members.
14879
14880         * const.cs: Create our own emit context during the Definition
14881         stage, so that constants are evaluated in the proper context, when
14882         a recursive definition happens.
14883
14884 2003-05-11  Martin Baulig  <martin@ximian.com>
14885
14886         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
14887         new block for a switch section.
14888         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
14889         the adding/lookup in the switch block.  Fixes #39828.
14890
14891 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
14892
14893         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
14894         functionality: I needed to convert the data after I had performed
14895         the add/sub operation into the operands type size.
14896
14897         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
14898         pass the type for the box operation, otherwise the resulting
14899         object would have been of type object.
14900
14901         (BoxedCast): Add constructor to specify the type to box as.
14902
14903 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
14904
14905         * iterators.cs: I was reusing the `count' variable inadvertently,
14906         take steps to not allow this to happen.
14907
14908 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
14909
14910         * attribute.cs (Attribute.Resolve): Params attributes are encoded
14911         by creating an array at the point where the params starts and
14912         putting all those arguments there, then adjusting the size of the
14913         array.
14914
14915 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
14916
14917         * expression.cs (New.AddressOf): Implement interface
14918         IMemoryLocation.  This is used when the `new' operator is used in
14919         the context of an invocation to a method on a value type.
14920
14921         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
14922         example. 
14923
14924         * namespace.cs: Also check the using aliases here.
14925
14926         * driver.cs: Move the test for using validity after the types have
14927         been entered, so we do a single pass that also includes the using
14928         aliases. 
14929
14930         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
14931         in the regular case.   CreateSiblingForFinally is doing extra
14932         error checking.
14933
14934         * attribute.cs (GetAttributeArgumentExpression): Store the result
14935         on an out value, and use the return value to indicate failure
14936         instead of using null (which is a valid return for Constant.GetValue).
14937
14938         * statement.cs: Perform the analysis flow for the increment
14939         portion after the statement, because this will be the real flow of
14940         execution.  Fixes #42385
14941
14942         * codegen.cs (EmitContext.EmitArgument,
14943         EmitContext.EmitStoreArgument): New helper functions when the
14944         RemapToProxy flag is set.
14945
14946         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
14947         function.
14948
14949         Add support for remapping parameters. 
14950
14951         * iterators.cs: Propagate parameter values;  Store parameter
14952         values in the proxy classes.
14953
14954 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
14955
14956         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
14957         need a proxy reference;  I do not know what I was thinking
14958
14959         * cs-parser.jay (constructor_initializer): catch another error,
14960         and display nice message.
14961
14962         (field_declaration): catch void field declaration
14963         to flag a better error. 
14964
14965         * class.cs (MemberBase.CheckBase): Report an error instead of a
14966         warning if a new protected member is declared in a struct. 
14967         (Field.Define): catch the error of readonly/volatile.
14968
14969         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
14970
14971         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
14972         volatile variable is taken
14973
14974 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
14975
14976         * statement.cs (Fixed.Resolve): Report an error if we are not in
14977         an unsafe context.
14978
14979 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
14980
14981         * typemanager.cs: reuse the code that handles type clashes for
14982         delegates and enumerations.
14983
14984         * class.cs (Report28): Always report.
14985
14986         * expression.cs (EncodeAsAttribute): Allow nulls here.
14987
14988 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
14989
14990         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
14991         the functionality for testing whether an expression is valid for
14992         an attribute here.  Also handle the case of arrays of elements
14993         being stored. 
14994
14995         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
14996         encoding a linear array into an array of objects that are suitable
14997         to be passed to an CustomAttributeBuilder.
14998
14999         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
15000
15001         * ecore.cs: (FieldExpr): Handle field remapping here.
15002
15003         * iteratators.cs: Pass the instance variable (if the method is an
15004         instance method) to the constructors, so we can access the field
15005         variables on the class.
15006
15007         TODO: Test this with structs.  I think the THIS variable on
15008         structs might have to be a pointer, and not a refenrece
15009
15010 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
15011
15012         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
15013         local variables to fields in a proxy class.
15014
15015         * iterators.cs (PopulateProxy): Rename our internal fields to
15016         <XXX>.  
15017         Create a <THIS> field if we are an instance method, so we can
15018         reference our parent container variables.
15019         (MapVariable): Called back from the EmitContext code to enter a
15020         new variable to field mapping into the proxy class (we just create
15021         a FieldBuilder).
15022
15023         * expression.cs
15024         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
15025         for using the remapped locals to fields.
15026
15027         I placed the code here, because that gives the same semantics to
15028         local variables, and only changes the Emit code.
15029
15030         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
15031         statements inside iterators.
15032         (VariableInfo): Add a FieldBuilder for the cases when we are
15033         remapping local variables to fields in a proxy class
15034
15035         * ecore.cs (SimpleNameResolve): Avoid testing two times for
15036         current_block != null.
15037
15038         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
15039         not cope with strings, as it has been moved to the
15040         TableSwitchEmit.  Fixed bug in switch generation.
15041
15042         * expression.cs (New.DoResolve): Provide more context for the user
15043         when reporting an error.
15044
15045         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
15046         pointers. 
15047
15048         * expression.cs (MemberAccess.DoResolve): When we get a type back,
15049         check the permissions for it.  Note than in a type-resolution
15050         context the check was already present in DeclSpace.ResolveType,
15051         but was missing from the MemberAccess.
15052
15053         (ArrayCreation.CheckIndices): warn if the user has
15054         more nested levels of expressions, but there are no more
15055         dimensions specified.  Avoids crash on bug 41906.
15056
15057 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
15058
15059         * statement.cs (Block): replace Implicit bool, for a generic
15060         flags.   
15061         New flag: `Unchecked'.  This is used during the EmitMeta phase
15062         (which is out-of-line with the regular Resolve/Emit process for a
15063         statement, as this is done ahead of time, but still gets a chance
15064         to call constant resolve).
15065
15066         (Block.Flags): new enum for adding a new flag.
15067
15068         (Block.EmitMeta): track the state of unchecked.
15069
15070         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
15071         to enable constant resolution to work there as well.
15072
15073 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
15074
15075         * typemanager.cs (ienumerable_type): Also look up
15076         System.Collections.IEnumerable. 
15077
15078 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
15079
15080         TODO: Test more than one conditional per method.
15081
15082         * class.cs (Indexer.Define): Report the location where the user is
15083         referencing the unsupported feature.
15084
15085         (MethodData): Overload the use of `conditionals' to
15086         minimize the creation of needless ArrayLists.   This saves roughly
15087         212kb on my machine.
15088
15089         (Method): Implement the new IIteratorContainer interface.
15090         (Method.SetYields): Implement the method by setting the ModFlags
15091         to contain METHOD_YIELDS.
15092
15093         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
15094         which just got set to null.
15095
15096         * iterators.cs: New file.
15097
15098         (Yield, YieldBreak): New statements.
15099
15100         * statement.cs (Return.Resolve): Flag an error if we are used in
15101         an iterator method.
15102
15103         * codegen.cs (InIterator): New flag set if the code is being
15104         compiled in an iterator method.
15105
15106         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
15107         internal modifier, and we just use it to avoid adding extra
15108         fields, as this is seldom used.  
15109
15110         * cs-parser.jay: Add yield_statement (yield and yield break).
15111
15112         * driver.cs: New flag -v2 to turn on version 2 features. 
15113
15114         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
15115         hashtable when v2 is enabled.
15116
15117 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
15118
15119         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
15120         there is already a namespace defined with this name.
15121
15122         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
15123         people upgraded their corlibs.
15124
15125         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
15126         always use fully qualified types, no need to use the compiler
15127         front end.
15128
15129         (TypeManager.IsNamespace): Use binarysearch.
15130
15131         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
15132         AddDelegate): I did not quite use the new IsValid API properly: I
15133         have to pass the short-name and the fullname.  I was passing only
15134         the basename instead of the fullname sometimes. 
15135
15136         (TypeContainer.DefineType): call NamespaceClash.
15137
15138         * interface.cs (Interface.DefineType): use NamespaceClash before
15139         defining the type.
15140
15141         * delegate.cs (Delegate.DefineType): use NamespaceClash before
15142         defining the type.
15143
15144         * enum.cs: (Enum.DefineType): use NamespaceClash before
15145         defining the type.
15146
15147         * typemanager.cs (: 3-line patch that gives us some tasty 11%
15148         speed increase.  First, use the negative_hits cache when we get a
15149         negative.  Second, add the type with its full original name
15150         instead of the new . and + encoded name (reflection uses + to
15151         separate type from a nested type).  Use LookupTypeReflection
15152         directly which bypasses the type->name hashtable (that we already
15153         know does not contain the type.
15154
15155         * decl.cs (DeclSpace.ResolveTypeExpr): track the
15156         location/container type. 
15157
15158         * driver.cs: When passing utf8, use directly the UTF8Encoding.
15159
15160 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
15161
15162         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
15163
15164         * delegate.cs (NewDelegate.Resolve): Test whether an instance
15165         method is being referenced in the method group from a static
15166         context, and report error 120 if so.
15167
15168         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
15169         Error118. 
15170
15171         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
15172         is created, we create the A namespace).
15173
15174         * cs-parser.jay: A namespace also introduces a DeclarationFound.
15175         Fixes #41591
15176
15177 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
15178
15179         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
15180         invocation to ModuleBuilder.GetType with the same values will
15181         return a new type instance, so we need to cache its return
15182         values. 
15183
15184         * expression.cs (Binary.ResolveOperator): Only allow the compare
15185         operators on enums if they are of the same type.
15186
15187         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
15188         types of ValueType on their own case.  Before we were giving them
15189         the same treatment as objects.
15190
15191         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
15192         fullname.  Short name is used to compare against container name.
15193         Fullname is used to check against defined namespace names.
15194
15195         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
15196         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
15197
15198         (Method.CheckBase): Call parent.
15199         (MemberBase.CheckBase): Check for protected members on sealed
15200         classes.
15201         (PropertyBase.CheckBase): Call parent.
15202         (Field.Define): Call parent.
15203
15204         * report.cs: Negative error codes are now mapped to 8000 - code,
15205         so that the display is render more nicely.
15206
15207         * typemanager.cs: Do not use try/catch, instead report a regular
15208         error. 
15209
15210         (GetPointerType, GetReferenceType): These methods provide
15211         mechanisms to obtain the T* and T& from a T.  We had the code
15212         previously scattered around the code base, and it also used
15213         TypeManager.LookupType that would go through plenty of caches.
15214         This one goes directly to the type source.
15215
15216         In some places we did the Type.GetType followed by
15217         ModuleBuilder.GetType, but not in others, so this unifies the
15218         processing as well.
15219
15220         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
15221         statements now that we have namespace information.
15222
15223         * typemanager.cs (IsNamespace): New method, returns whether the
15224         string presented is a namespace or not.
15225
15226         (ComputeNamespaces): New public entry point, computes the list of
15227         available namespaces, using the GetNamespaces API call in Mono, or
15228         the slower version in MS.NET.   
15229
15230         Now before we start the semantic analysis phase, we have a
15231         complete list of namespaces including everything that the user has
15232         provided.
15233
15234         Deleted old code to cache namespaces in .nsc files.
15235
15236 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
15237
15238         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
15239         class/struct location definition Location for the implicit
15240         constructor location.
15241
15242         (Operator.Define): Use the location of the operator for the
15243         implicit Method definition.
15244
15245         (Constructor.Emit): use the constructor location for the implicit
15246         base initializer constructor.
15247
15248         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
15249         and the Expression class now contains two new methods:
15250
15251         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
15252         isolate type lookup from the rest of the resolution process.
15253
15254         Since we use Expressions to hold type definitions due to the way
15255         we parse the input we have historically overloaded Resolve to
15256         perform the Type lookups if a special flag is passed.  Now this is
15257         eliminated and two methods take their place. 
15258
15259         The differences in the two methods between xStep and xTerminal is
15260         that xStep is involved in our current lookup system that uses
15261         SimpleNames to compose a name, while xTerminal is used just to
15262         catch the case where the simplename lookup failed.
15263
15264 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
15265
15266         * expression.cs (ResolveMemberAccess): Remove redundant code.
15267         TypeExpr expressions are always born fully resolved.
15268
15269         * interface.cs (PopulateMethod): Do not lookup the types twice.
15270         We were doing it once during SemanticAnalysis and once during
15271         PopulateMethod.
15272
15273         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
15274         in local variable type definitions, were being returned as a
15275         SimpleName (we decomposed everything into a string), that is
15276         because primary_expression was being used instead of a type in the
15277         grammar (reduce/reduce conflicts).
15278
15279         The part that was wrong is that we converted the expression into a
15280         string (an oversimplification in one hand, compounded with primary
15281         expressions doing string concatenation).
15282
15283         So things like:
15284
15285         A.B.C [] x;
15286
15287         Would return "A.B.C[]" as a SimpleName.  This stopped things like
15288         using clauses from working on this particular context.  And a type
15289         was being matched directly against "A.B.C[]".
15290
15291         We now use the correct approach, and allow for ComposedCast to be
15292         part of the unary expression.  So the "A.B.C []" become a composed
15293         cast of "A.B.C" (as a nested group of MemberAccess with a
15294         SimpleName at the end) plus the rank composition "[]". 
15295
15296         Also fixes 35567
15297
15298 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
15299
15300         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
15301         for the access level checking.
15302
15303         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
15304         `TypeContainer container', because I kept getting confused when I
15305         was debugging this code.
15306
15307         * expression.cs (Indexers): Instead of tracking getters/setters,
15308         we now track them in parallel.  We create one arraylist less, but
15309         most importantly it is possible now for the LValue code to find a
15310         matching get for a set.
15311
15312         (IndexerAccess.DoResolveLValue): Update the code.
15313         GetIndexersForType has been modified already to extract all the
15314         indexers from a type.  The code assumed it did not.
15315
15316         Also make the code set the correct return type for the indexer.
15317         This was fixed a long time ago for properties, but was missing for
15318         indexers.  It used to be void_type.
15319
15320         (Binary.Emit): Test first for doubles instead of
15321         floats, as they are more common.
15322
15323         (Binary.EmitBranchable): Use the .un version of the branch opcodes
15324         when dealing with floats and the <=, >= operators.  This fixes bug
15325         #39314 
15326
15327         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
15328         to load the array value by emitting a load on the foreach variable
15329         type.  This was incorrect.  
15330
15331         We now emit the code to load an element using the the array
15332         variable type, and then we emit the conversion operator.
15333
15334         Fixed #40176
15335
15336 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
15337
15338         * attribute.cs: Avoid allocation of ArrayLists in the common case.
15339
15340 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
15341
15342         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
15343         test for protection before we test for signatures. 
15344
15345         (MethodSignature.ToString): implement.
15346
15347         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
15348         to the case where we reduced into a LongConstant.
15349
15350         * decl.cs (CheckAccessLevel): If the type is an array, we can not
15351         depend on whether the information is acurrate, because the
15352         Microsoft runtime will always claim that the array type is public,
15353         regardless of the real state.
15354
15355         If the type is a pointer, another problem happens: the type is
15356         reported as non-public in Microsoft.  
15357
15358         In both cases we have to call CheckAccessLevel recursively with
15359         the underlying type as the argument to be tested.
15360
15361 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
15362
15363         * assign.cs (Assign.Emit): If we are dealing with a compound
15364         assignment expression, we should use the code path that stores the
15365         intermediate result in a temporary value.  This fixes #40903.
15366
15367         *expression.cs (Indirection.ToString): Provide ToString method for
15368         debugging. 
15369
15370 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
15371
15372         * class.cs: Null out fields holding references to Block objects so
15373         they can be garbage collected.
15374
15375         * expression.cs (OverloadResolve): Remove unused local.
15376
15377 2003-04-07  Martin Baulig  <martin@ximian.com>
15378
15379         * codegen.cs (EmitContext.CurrentFile): New public field.
15380         (EmitContext.Mark): Use the CurrentFile to check whether the
15381         location is in the correct file.
15382         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
15383
15384 2003-04-07  Martin Baulig  <martin@ximian.com>
15385
15386         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
15387
15388         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
15389         location.  [FIXME: The location argument which gets passed to this
15390         method is sometimes wrong!]
15391
15392 2003-04-07  Nick Drochak <ndrochak@gol.com>
15393
15394         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
15395
15396 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
15397
15398         * expression.cs (Indirection.EmitAssign): We were using the
15399         temporary, but returning immediately instead of continuing the
15400         EmitAssing flow.
15401
15402 2003-04-06  Martin Baulig  <martin@ximian.com>
15403
15404         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
15405         if it's a nested child, but also deriving from the outer class.
15406         See test 190.cs.
15407
15408         * typemanager.cs (IsNestedChildOf): Make this work if it's a
15409         nested child, but also deriving from the outer class.  See
15410         test-190.cs.
15411         (FilterWithClosure): We may access private members of the outer
15412         class if we're a nested child and deriving from the outer class.
15413         (RealMemberLookup): Only set `closure_private_ok' if the
15414         `original_bf' contained BindingFlags.NonPublic.
15415
15416 2003-04-05  Martin Baulig  <martin@ximian.com>
15417
15418         * expression.cs (SizeOf.DoResolve): Use ResolveTypeExpr, so we can
15419         probe if its a type parameter, and if so, flag an error.
15420
15421         * decl.cs: Move here the SetParameterInfo code from class.cs.
15422         Handle IsGeneric here.
15423
15424         Handle a variety of errors in the parameter info definition.
15425
15426         * ecore.cs (SimpleName.DoResolveType): Handle look ups for generic
15427         type parameters here.
15428
15429         * cs-parser.jay (class_declaration): report errors for parameters
15430         here as well.
15431
15432 2003-01-21  Miguel de Icaza  <miguel@ximian.com>
15433
15434         * generic.cs: New file, contains support code for generics.
15435
15436         * cs-parser.jay: Remove OP_SHIFT_LEFT, OP_SHIFT_RIGHT,
15437         OP_SHIFT_LEFT_ASSIGN, OP_SHIFT_RIGHT_ASSIGN.
15438
15439         Update parser for the above removals.
15440
15441         * cs-tokenizer.cs: Do not handle <<= or >>= specially.  This is
15442         now taken care of in the parser.
15443
15444 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
15445
15446         * class.cs (Event.Define): Do not allow abstract events to have
15447         initializers. 
15448
15449 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
15450
15451         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
15452         block in event declarations.
15453
15454         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
15455         value type, get its address.
15456
15457         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
15458         leaving a class on the stack instead of a boolean value (int
15459         0/1).  Change the code so we compare against null, and then the
15460         result against zero.
15461
15462         * class.cs (TypeContainer.GetClassBases): We were checking for the
15463         parent class being sealed too late.
15464
15465         * expression.cs (Binary.Emit): For <= and >= when dealing with
15466         floating point values, use cgt.un and clt.un instead of cgt and
15467         clt alone.
15468
15469 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
15470
15471         * statement.cs: Apply the same optimization as MS: skip the 
15472         GetEnumerator returning an IEnumerator, and use the one returning a 
15473         CharEnumerator instead. This allows us to avoid the try-finally block 
15474         and the boxing.
15475
15476 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
15477
15478         * cs-parser.jay: Attributes cannot be applied to
15479                          namespaces. Fixes #40473
15480
15481 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15482
15483         * class.cs:
15484         (Add*): check if the name is valid using the full name for constants,
15485         fields, properties and events.
15486
15487 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
15488
15489         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
15490         char constants to be part of the enumeration.
15491
15492         * expression.cs (Conditional.DoResolve): Add support for operator
15493         true. Implements the missing functionality from 14.12
15494
15495         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
15496         operator true/false as required by the spec.
15497
15498         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
15499         implicit conversion to boolean.
15500
15501         * statement.cs (Statement.ResolveBoolean): A boolean expression is
15502         also one where the type implements `operator true'. 
15503
15504         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
15505         get an expression that will invoke operator true based on an
15506         expression.  
15507
15508         (GetConversionOperators): Removed the hack that called op_True
15509         here.  
15510
15511         (Expression.ResolveBoolean): Move this from Statement.
15512
15513 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
15514
15515         * ecore.cs (FieldExpr): do not allow initialization of initonly
15516         fields on derived classes
15517
15518 2003-03-13  Martin Baulig  <martin@ximian.com>
15519
15520         * statement.cs (Block.Emit): Call ig.BeginScope() and
15521         ig.EndScope() when compiling with debugging info; call
15522         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
15523
15524 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
15525
15526         * expression.cs (Indexers): Do not construct immediately, allow
15527         for new members to be appended as we go.  Fixes 38143
15528
15529 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15530
15531         * expression.cs: save/restore context when resolving an unchecked
15532         expression.
15533
15534 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
15535
15536         * cfold.cs: Catch division by zero in modulus operator during
15537         constant folding.
15538
15539 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
15540
15541         * interface.cs (Interface.DefineMembers): Avoid defining members
15542         twice. 
15543
15544 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
15545
15546         * driver.cs: handle the +/- options for -noconfig
15547
15548         * statement.cs (Unckeched.Resolve): Also track the state of
15549         unchecked in the Resolve phase.
15550
15551 2003-02-27  Martin Baulig  <martin@ximian.com>
15552
15553         * ecore.cs (Expression.MemberLookup): Don't create a
15554         MethodGroupExpr for something which is not a method.  Fixes #38291.
15555
15556 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
15557
15558         * class.cs (MemberBase.CheckParameters): Also check that the type
15559         is unmanaged if it is a pointer.
15560
15561         * expression.cs (SizeOf.Resolve): Add location information.
15562
15563         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
15564         a managed type is declared.
15565
15566         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
15567         parameter modifiers as well.  Fixes bug 38606
15568
15569         * class.cs: Very sad.  Am backing out the speed up changes
15570         introduced by the ArrayList -> Array in the TypeContainer, as they
15571         were not actually that much faster, and introduced a bug (no error
15572         reports on duplicated methods).
15573
15574         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
15575         source first, this will guarantee that we have a valid expression
15576         before calling in lower levels functions that will require a
15577         resolved object.  Then use this original_source in the
15578         target.ResolveLValue instead of the original source that was
15579         passed to us.
15580
15581         Another change.  Use target.Resolve instead of LValueResolve.
15582         Although we are resolving for LValues, we will let the Assign code
15583         take care of that (it will be called again from Resolve).  This
15584         basically allows code like this:
15585
15586         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
15587         class Y { void A (X x) { x [0] += o; }
15588
15589         The problem was that the indexer was trying to resolve for
15590         set_Item (idx, object o) and never finding one.  The real set_Item
15591         was set_Item (idx, X).  By delaying the process we get the right
15592         semantics. 
15593
15594         Fixes bug 36505
15595
15596 2003-02-23  Martin Baulig  <martin@ximian.com>
15597
15598         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
15599         while calling DoEmit ().
15600
15601         * codegen.cs (EmitContext.Mark): Don't mark locations in other
15602         source files; if you use the #line directive inside a method, the
15603         compiler stops emitting line numbers for the debugger until it
15604         reaches the end of the method or another #line directive which
15605         restores the original file.
15606
15607 2003-02-23  Martin Baulig  <martin@ximian.com>
15608
15609         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
15610
15611 2003-02-23  Martin Baulig  <martin@ximian.com>
15612
15613         * statement.cs (Block.AddChildVariableNames): We need to call this
15614         recursively, not just for our immediate children.
15615
15616 2003-02-23  Martin Baulig  <martin@ximian.com>
15617
15618         * class.cs (Event.Define): Always make the field private, like csc does.
15619
15620         * typemanager.cs (TypeManager.RealMemberLookup): Make events
15621         actually work, fixes bug #37521.
15622
15623 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
15624
15625         * delegate.cs: When creating the various temporary "Parameters"
15626         classes, make sure that we call the ComputeAndDefineParameterTypes
15627         on those new parameters (just like we do with the formal ones), to
15628         allow them to be resolved in the context of the DeclSpace.
15629
15630         This fixes the bug that Dick observed in Bugzilla #38530.
15631
15632 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
15633
15634         * expression.cs (ResolveMemberAccess): When resolving a constant,
15635         do not attempt to pull a constant if the value was not able to
15636         generate a valid constant.
15637
15638         * const.cs (LookupConstantValue): Do not report more errors than required.
15639
15640 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15641
15642         * expression.cs: fixes bug #38328.
15643
15644 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15645
15646         * class.cs: Changed all the various members that can be part of a
15647         class from being an ArrayList to be an Array of the right type.
15648         During the DefineType type_list, interface_list, delegate_list and
15649         enum_list are turned into types, interfaces, delegates and enums
15650         arrays.  
15651
15652         And during the member population, indexer_list, event_list,
15653         constant_list, field_list, instance_constructor_list, method_list,
15654         operator_list and property_list are turned into their real arrays.
15655
15656         Although we could probably perform this operation earlier, for
15657         good error reporting we need to keep the lists and remove the
15658         lists for longer than required.
15659
15660         This optimization was triggered by Paolo profiling the compiler
15661         speed on the output of `gen-sample-program.pl' perl script. 
15662
15663         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
15664         not crash in methods like MemberLookupFailed that use this field.  
15665
15666         This problem arises when the compiler fails to resolve a type
15667         during interface type definition for example.
15668
15669 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
15670
15671         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
15672         inherit from System.Object, so we have to stop at null, not only
15673         when reaching System.Object.
15674
15675 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
15676
15677         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
15678         DeclaredOnly because the parent indexer might have had a different
15679         name, but did not loop until the top of the hierarchy was reached.
15680
15681         The problem this one fixes is 35492: when a class implemented an
15682         indexer from an interface, we were getting the interface method
15683         (which was abstract) and we were flagging an error (can not invoke
15684         abstract method).
15685
15686         This also keeps bug 33089 functioning, and test-148 functioning.
15687
15688         * typemanager.cs (IsSpecialMethod): The correct way of figuring
15689         out if a method is special is to see if it is declared in a
15690         property or event, or whether it is one of the predefined operator
15691         names.   This should fix correctly #36804.
15692
15693 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
15694
15695         The goal here is to remove the dependency on EmptyCast.Peel ().
15696         Killing it completely.
15697
15698         The problem is that currently in a number of places where
15699         constants are expected, we have to "probe" for an EmptyCast, and
15700         Peel, which is not the correct thing to do, as this will be
15701         repetitive and will likely lead to errors. 
15702
15703         The idea is to remove any EmptyCasts that are used in casts that
15704         can be reduced to constants, so we only have to cope with
15705         constants. 
15706
15707         This bug hunt was triggered by Bug 37363 and the desire to remove
15708         the duplicate pattern where we were "peeling" emptycasts to check
15709         whether they were constants.  Now constants will always be
15710         constants.
15711
15712         * ecore.cs: Use an enumconstant here instead of wrapping with
15713         EmptyCast.  
15714
15715         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
15716         throwing me off.  By handling this we can get rid of a few hacks.
15717
15718         * statement.cs (Switch): Removed Peel() code.
15719
15720 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
15721
15722         * class.cs: Location information for error 508
15723
15724         * expression.cs (New.DoResolve): Add a guard against double
15725         resolution of an expression.  
15726
15727         The New DoResolve might be called twice when initializing field
15728         expressions (see EmitFieldInitializers, the call to
15729         GetInitializerExpression will perform a resolve on the expression,
15730         and later the assign will trigger another resolution
15731
15732         This leads to bugs (#37014)
15733
15734         * delegate.cs: The signature for EndInvoke should contain any ref
15735         or out parameters as well.  We were not doing this in the past. 
15736
15737         * class.cs (Field.Define): Do not overwrite the type definition
15738         inside the `volatile' group.  Turns out that volatile enumerations
15739         were changing the type here to perform a validity test, which
15740         broke conversions. 
15741
15742 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
15743
15744         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
15745         and structs, we do not want to load the instance variable
15746
15747         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
15748         enum_type has to be handled like an object reference (implicit
15749         conversions exists from this to object), but the regular IsClass
15750         and IsValueType tests will never return true for this one.
15751
15752         Also we use TypeManager.IsValueType instead of type.IsValueType,
15753         just for consistency with the rest of the code (this is only
15754         needed if we ever use the construct exposed by test-180.cs inside
15755         corlib, which we dont today).
15756
15757 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
15758
15759         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
15760         just InternalCall.
15761
15762 2003-02-09  Martin Baulig  <martin@ximian.com>
15763
15764         * namespace.cs (Namespace..ctor): Added SourceFile argument.
15765         (Namespace.DefineNamespaces): New static public method; this is
15766         called when we're compiling with debugging to add all namespaces
15767         to the symbol file.
15768
15769         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
15770         pass it to the Namespace's .ctor.
15771
15772         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
15773         and MethodBase arguments; pass the namespace ID to the symwriter;
15774         pass the MethodBase instead of the token to the symwriter.
15775         (SymbolWriter.DefineNamespace): New method to add a namespace to
15776         the symbol file.
15777
15778 2003-02-09  Martin Baulig  <martin@ximian.com>
15779
15780         * symbolwriter.cs: New file.  This is a wrapper around
15781         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
15782         methods here in near future.
15783
15784 2003-02-09  Martin Baulig  <martin@ximian.com>
15785
15786         * codegen.cs (EmitContext.Mark): Just pass the arguments to
15787         ILGenerator.MarkSequencePoint() which are actually used by the
15788         symbol writer.
15789
15790 2003-02-09  Martin Baulig  <martin@ximian.com>
15791
15792         * location.cs (SourceFile): New public sealed class.  This
15793         contains the name and an index which is used in the location's token.
15794         (Location): Reserve an appropriate number of bits in the token for
15795         the source file instead of walking over that list, this gives us a
15796         really huge performance improvement when compiling with debugging.
15797
15798         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
15799         `SourceFile' argument instead of a string.
15800         (Driver.ProcessFile): Add all the files via Location.AddFile(),
15801         but don't parse/tokenize here, we need to generate the list of all
15802         source files before we do that.
15803         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
15804         the files.
15805
15806         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
15807         instead of a string.
15808
15809         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
15810         of a string.
15811
15812 2003-02-09  Martin Baulig  <martin@ximian.com>
15813
15814         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
15815         filename on `#line default'.
15816
15817 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
15818
15819         * statement.cs: don't clear the pinned var when the fixed statement
15820         returns from the method (fixes bug#37752).
15821
15822 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
15823
15824         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
15825         to IsValueType.
15826
15827 2003-02-07  Martin Baulig  <martin@ximian.com>
15828
15829         * driver.cs: Removed the `--debug-args' command line argument.
15830
15831         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
15832         automatically by the AsssemblyBuilder.
15833         (CodeGen.InitializeSymbolWriter): We don't need to call any
15834         initialization function on the symbol writer anymore.  This method
15835         doesn't take any arguments.
15836
15837 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
15838
15839         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
15840         from referenced assemblies as well.
15841
15842 2003-02-02  Martin Baulig  <martin@ximian.com>
15843
15844         * class.cs (MethodData.Emit): Generate debugging info for external methods.
15845
15846 2003-02-02  Martin Baulig  <martin@ximian.com>
15847
15848         * class.cs (Constructor.Emit): Open the symbol writer before
15849         emitting the constructor initializer.
15850         (ConstructorInitializer.Emit): Call ec.Mark() to allow
15851         single-stepping through constructor initializers.
15852
15853 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
15854
15855         * class.cs: Handle error 549: do not allow virtual methods in
15856         sealed classes. 
15857
15858 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
15859
15860         * decl.cs: Check access levels when resolving types
15861
15862 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
15863
15864         * statement.cs: Add parameters and locals set in catch blocks that might 
15865         return to set vector
15866
15867 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
15868
15869         * class.cs (Operator): Set the SpecialName flags for operators.
15870
15871         * expression.cs (Invocation.DoResolve): Only block calls to
15872         accessors and operators on SpecialName methods.
15873
15874         (Cast.TryReduce): Handle conversions from char constants.
15875
15876
15877 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
15878
15879         * statement.cs: small memory and time optimization in FlowBranching.
15880
15881 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
15882
15883         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
15884         problem that the last fix but in the other sid (Set).
15885
15886         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
15887         access when there is no indexer in the hierarchy.
15888
15889 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
15890
15891         * class.cs: Combine some if statements.
15892
15893 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15894
15895         * driver.cs: fixed bug #37187.
15896
15897 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
15898
15899         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
15900         any indexer, it's needed to build a list with all the indexers in the
15901         hierarchy (AllGetters), else we have problems. Fixes #35653.
15902
15903 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
15904
15905         * class.cs (MethodData.Define): It is wrong for an interface
15906         implementation to be static in both cases: explicit and implicit.
15907         We were only handling this in one case.
15908
15909         Improve the if situation there to not have negations.
15910
15911         * class.cs (Field.Define): Turns out that we do not need to check
15912         the unsafe bit on field definition, only on usage.  Remove the test.
15913
15914 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15915
15916         * driver.cs: use assembly.Location instead of Codebase (the latest
15917         patch made mcs fail when using MS assemblies).
15918
15919 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
15920
15921         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
15922         get the path to *corlib.dll.
15923
15924 2003-01-21  Nick Drochak <ndrochak@gol.com>
15925
15926         * cs-tokenizer.cs:
15927         * pending.cs:
15928         * typemanager.cs: Remove compiler warnings
15929
15930 2003-01-20  Duncan Mak  <duncan@ximian.com>
15931
15932         * AssemblyInfo.cs: Bump the version number to 0.19.
15933
15934 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15935
15936         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
15937
15938 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
15939
15940         * class.cs (Constructor::Emit): Emit debugging info for constructors.
15941
15942 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
15943
15944         * cs-parser.jay: Small fix: we were not comparing the constructor
15945         name correctly.   Thanks to Zoltan for the initial pointer.
15946
15947 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
15948
15949         * cs-tokenizer.cs: Set file name when specified with #line
15950
15951 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
15952
15953         * cs-parser.jay: Only perform the constructor checks here if we
15954         are named like the class;  This will help provider a better
15955         error.  The constructor path is taken when a type definition is
15956         not found, but most likely the user forgot to add the type, so
15957         report that rather than the constructor error.
15958
15959 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
15960
15961         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
15962         allocations.
15963
15964 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15965
15966         * cs-parser.jay: Add cleanup call.
15967
15968 2003-01-13  Duncan Mak  <duncan@ximian.com>
15969
15970         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
15971         consistent with other methods.
15972
15973 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
15974
15975         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
15976
15977 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
15978
15979         * attribute.cs: only set GuidAttr to true when we have a
15980         GuidAttribute.
15981
15982 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15983
15984         * ecore.cs:
15985         * expression.cs:
15986         * typemanager.cs: fixes to allow mcs compile corlib with the new
15987         Type.IsSubclassOf fix.
15988
15989 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
15990
15991         * expression.cs (LocalVariableReference.DoResolve): Classify a
15992         constant as a value, not as a variable.   Also, set the type for
15993         the variable.
15994
15995         * cs-parser.jay (fixed_statement): take a type instead of a
15996         pointer_type, so we can produce a better error message later.
15997
15998         * statement.cs (Fixed.Resolve): Flag types that are not pointers
15999         as an error.  
16000
16001         (For.DoEmit): Make inifinite loops have a
16002         non-conditional branch back.
16003
16004         (Fixed.DoEmit): First populate the pinned variables, then emit the
16005         statement, then clear the variables.  Before I was emitting the
16006         code once for each fixed piece.
16007
16008
16009 2003-01-08  Martin Baulig  <martin@ximian.com>
16010
16011         * statement.cs (FlowBranching.MergeChild): A break in a
16012         SWITCH_SECTION does not leave a loop.  Fixes #36155.
16013
16014 2003-01-08  Martin Baulig  <martin@ximian.com>
16015
16016         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
16017         lives in the same number space than `param_map'.  Fixes #36154.
16018
16019 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
16020
16021         * cs-parser.jay (constructor_declaration): Set the
16022         Constructor.ModFlags before probing for it.  This makes the
16023         compiler report 514, 515 and 132 (the code was there, but got
16024         broken). 
16025
16026         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
16027         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
16028         (GotoCase.Resolve): Set `Returns' to ALWAYS.
16029
16030 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
16031
16032         * enum.cs: create the enum static fields using the enum type.
16033
16034 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
16035
16036         * class.cs: don't try to create the ParamBuilder for the return
16037         type if it's not needed (and handle it breaking for the ms runtime
16038         anyway).
16039
16040 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
16041
16042         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
16043
16044 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
16045
16046         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
16047         the command.   This showed up while compiling the JANET source
16048         code, which used \r as its only newline separator.
16049
16050 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
16051
16052         * class.cs (Method.Define): If we are an operator (because it
16053         reuses our code), then set the SpecialName and HideBySig.  #36128
16054
16055 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
16056
16057         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
16058         exception, report error 120 `object reference required'.
16059
16060         * driver.cs: Add --pause option, used during to measure the size
16061         of the process as it goes with --timestamp.
16062
16063         * expression.cs (Invocation.DoResolve): Do not allow methods with
16064         SpecialName to be invoked.
16065
16066 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
16067
16068         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
16069         number before adding it.
16070
16071 2002-12-21  Ravi Pratap  <ravi@ximian.com>
16072
16073         * ecore.cs (StandardImplicitConversion): When in an unsafe
16074         context, we allow conversion between void * to any other pointer
16075         type. This fixes bug #35973.
16076
16077 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
16078
16079         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
16080         is not thrown when extensionless outputs are used 
16081
16082 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16083
16084         * rootcontext.cs: fixed compilation of corlib.
16085
16086 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
16087
16088         * attribute.cs (Attributes.Contains): Add new method.
16089
16090         * class.cs (MethodCore.LabelParameters): if the parameter is an
16091         `out' parameter, check that no attribute `[In]' has been passed.
16092
16093         * enum.cs: Handle the `value__' name in an enumeration.
16094
16095 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
16096
16097         * decl.cs: Added special case to allow overrides on "protected
16098         internal" methods
16099
16100 2002-12-18  Ravi Pratap  <ravi@ximian.com>
16101
16102         * attribute.cs (Attributes.AddAttributeSection): Rename to this
16103         since it makes much more sense.
16104
16105         (Attributes.ctor): Don't require a Location parameter.
16106
16107         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
16108
16109         * attribute.cs (ApplyAttributes): Remove extra Location parameters
16110         since we already have that information per attribute.
16111
16112         * everywhere : make appropriate changes.
16113
16114         * class.cs (LabelParameters): Write the code which actually
16115         applies attributes to the return type. We can't do this on the MS
16116         .NET runtime so we flag a warning in the case an exception is
16117         thrown.
16118
16119 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
16120
16121         * const.cs: Handle implicit null conversions here too.
16122
16123 2002-12-17  Ravi Pratap  <ravi@ximian.com>
16124
16125         * class.cs (MethodCore.LabelParameters): Remove the extra
16126         Type [] parameter since it is completely unnecessary. Instead
16127         pass in the method's attributes so that we can extract
16128         the "return" attribute.
16129
16130 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
16131
16132         * cs-parser.jay (parse): Use Report.Error to flag errors instead
16133         of ignoring it and letting the compile continue.
16134
16135         * typemanager.cs (ChangeType): use an extra argument to return an
16136         error condition instead of throwing an exception.
16137
16138 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
16139
16140         * expression.cs (Unary.TryReduce): mimic the code for the regular
16141         code path.  Perform an implicit cast in the cases where we can
16142         implicitly convert to one of the integral types, and then reduce
16143         based on that constant.   This fixes bug #35483.
16144
16145 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16146
16147         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
16148
16149 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16150
16151         * namespace.cs: fixed bug #35489.
16152
16153 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
16154
16155         * class.cs: Remove some dead code.
16156
16157         * cs-parser.jay: Estimate the number of methods needed
16158         (RootContext.MethodCount);
16159
16160         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
16161         numbers instead of StringBuilders.
16162
16163         * support.cs (PtrHashtable): Add constructor with initial size;
16164         We can now reduce reallocations of the method table.
16165
16166 2002-12-10  Ravi Pratap  <ravi@ximian.com>
16167
16168         * attribute.cs (ApplyAttributes): Keep track of the emitted
16169         attributes on a per-target basis. This fixes bug #35413.
16170
16171 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
16172
16173         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
16174         default to the Windows 1252 encoding.
16175
16176         (UnixParseOption): Support version, thanks to Alp for the missing
16177         pointer. 
16178
16179         * AssemblyInfo.cs: Add nice assembly information.
16180
16181         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
16182         (bug 35169).
16183
16184         * cs-parser.jay: Allow a trailing comma before the close bracked
16185         in the attribute_section production.
16186
16187         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
16188         address of the instance was being taken, I will take this out,
16189         because we take the address of the object immediately here.
16190
16191 2002-12-09  Ravi Pratap  <ravi@ximian.com>
16192
16193         * typemanager.cs (AreMultipleAllowed): Take care of the most
16194         obvious case where attribute type is not in the current assembly -
16195         stupid me ;-)
16196
16197 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
16198
16199         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
16200         definitions, instead of doing that afterwards.  
16201
16202         Also we use a nice little hack, depending on the constructor, we
16203         know if we are a "composed" name or a simple name.  Hence, we
16204         avoid the IndexOf test, and we avoid 
16205
16206         * codegen.cs: Add code to assist in a bug reporter to track down
16207         the source of a compiler crash. 
16208
16209 2002-12-07  Ravi Pratap  <ravi@ximian.com>
16210
16211         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
16212         types have been emitted for a given element and flag an error
16213         if something which does not have AllowMultiple set is used more
16214         than once.
16215
16216         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
16217         attribute types and their corresponding AllowMultiple properties
16218
16219         (AreMultipleAllowed): Check the property for a given type.
16220
16221         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
16222         property in the case we have a TypeContainer.
16223
16224         (Attributes.AddAttribute): Detect duplicates and just skip on
16225         adding them. This trivial fix catches a pretty gross error in our
16226         attribute emission - global attributes were being emitted twice!
16227
16228         Bugzilla bug #33187 is now fixed.
16229
16230 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
16231
16232         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
16233         instead of pp_and).
16234
16235         * expression.cs (Binary.ResolveOperator): I can only use the
16236         Concat (string, string, string) and Concat (string, string,
16237         string, string) if the child is actually a concatenation of
16238         strings. 
16239
16240 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
16241
16242         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
16243         context where we need a 2-character lookahead.
16244
16245         * pending.cs (PendingImplementation): Rework so we can keep track
16246         of interface types all the time, and flag those which were
16247         implemented by parents as optional.
16248
16249 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
16250
16251         * expression.cs (Binary.ResolveOperator): Use
16252         String.Concat(string,string,string) or
16253         String.Concat(string,string,string,string) when possible. 
16254
16255         * typemanager: More helper methods.
16256
16257
16258 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
16259
16260         * pending.cs: remove the bogus return from GetMissingInterfaces()
16261         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
16262
16263 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16264
16265         * namespace.cs: avoid duplicated 'using xxx' being added to
16266         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
16267         when we get more than one 'using' statement for the same namespace.
16268         Report a CS0105 warning for it.
16269
16270 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
16271
16272         * cs-tokenizer.cs (consume_identifier): use read directly, instead
16273         of calling getChar/putback, uses internal knowledge of it.    
16274
16275         (xtoken): Reorder tokenizer so most common patterns are checked
16276         first.  This reduces the compilation time in another 5% (from 8.11s
16277         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
16278
16279         The parsing time is 22% of the compilation in mcs, and from that
16280         64% is spent on the tokenization process.  
16281
16282         I tried using a binary search for keywords, but this is slower
16283         than the hashtable.  Another option would be to do a couple of
16284         things:
16285
16286                 * Not use a StringBuilder, instead use an array of chars,
16287                   with a set value.  Notice that this way we could catch
16288                   the 645 error without having to do it *afterwards*.
16289
16290                 * We could write a hand-parser to avoid the hashtable
16291                   compares altogether.
16292
16293         The identifier consumption process takes 37% of the tokenization
16294         time.  Another 15% is spent on is_number.  56% of the time spent
16295         on is_number is spent on Int64.Parse:
16296
16297                 * We could probably choose based on the string length to
16298                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
16299                   computations. 
16300
16301         Another 3% is spend on wrapping `xtoken' in the `token' function.
16302
16303         Handle 0xa0 as whitespace (#34752)
16304
16305 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
16306
16307         * typemanager.cs (IsCLRType): New routine to tell whether a type
16308         is one of the builtin types.  
16309
16310         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
16311         typecode in more places instead of doing pointer comparissions.
16312         We could leverage some knowledge about the way the typecodes are
16313         laid out.
16314
16315         New code to cache namespaces in assemblies, it is currently not
16316         invoked, to be used soon.
16317
16318         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
16319
16320         * expression.cs (Binary.ResolveOperator): specially handle
16321         strings, and do not perform user-defined operator overloading for
16322         built-in types.
16323
16324 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
16325
16326         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
16327         internalcall as it is a pretty simple operation;  Avoid whenever
16328         possible to call Char.IsLetter.
16329
16330         (consume_identifier): Cut by half the number of
16331         hashtable calls by merging the is_keyword and GetKeyword behavior.
16332
16333         Do not short-circuit, because if we do, we
16334         report errors (ie, #if false && true would produce an invalid
16335         directive error);
16336
16337
16338 2002-11-24  Martin Baulig  <martin@ximian.com>
16339
16340         * expression.cs (Cast.TryReduce): If we're in checked syntax,
16341         check constant ranges and report a CS0221.  Fixes #33186.
16342
16343 2002-11-24  Martin Baulig  <martin@ximian.com>
16344
16345         * cs-parser.jay: Make this work for uninitialized variable
16346         declarations in the `for' initializer.  Fixes #32416.
16347
16348 2002-11-24  Martin Baulig  <martin@ximian.com>
16349
16350         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
16351         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
16352
16353 2002-11-24  Martin Baulig  <martin@ximian.com>
16354
16355         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
16356         argument; if true, we also check for user-defined conversions.
16357         This is only needed if both arguments are of a user-defined type.
16358         Fixes #30443, added test-175.cs.
16359         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
16360
16361         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
16362
16363 2002-11-24  Martin Baulig  <martin@ximian.com>
16364
16365         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
16366         function to get the store opcode.
16367         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
16368         only emit the Ldelema if the store opcode is Stobj.  You must run
16369         both test-34 and test-167 to test this.  Fixes #34529.
16370
16371 2002-11-23  Martin Baulig  <martin@ximian.com>
16372
16373         * ecore.cs (Expression.MemberLookup): Added additional
16374         `qualifier_type' argument which is used when we're being called
16375         from MemberAccess.DoResolve() and null if we're called from a
16376         SimpleName lookup.
16377         (Expression.MemberLookupFailed): New method to report errors; this
16378         does the CS1540 check and reports the correct error message.
16379
16380         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
16381         argument for the CS1540 check and redone the way how we're dealing
16382         with private members.  See the comment in the source code for details.
16383         (FilterWithClosure): Reverted this back to revision 1.197; renamed
16384         `closure_start_type' to `closure_qualifier_type' and check whether
16385         it's not null.  It was not this filter being broken, it was just
16386         being called with the wrong arguments.
16387
16388         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
16389         and pass it the correct `qualifier_type'; this also does the error
16390         handling for us.
16391
16392 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
16393
16394         * expression.cs (Invocation.EmitParams): If the we are dealing
16395         with a non-built-in value type, load its address as well.
16396
16397         (ArrayCreation): Use a a pretty constant instead
16398         of the hardcoded value 2.   Use 6 instead of 2 for the number of
16399         static initializers.  
16400
16401         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
16402         because they are not really value types, just glorified integers. 
16403
16404         * driver.cs: Do not append .exe, the CSC compiler does not do it.
16405
16406         * ecore.cs: Remove redundant code for enumerations, make them use
16407         the same code path as everything else, fixes the casting issue
16408         with enumerations in Windows.Forms.
16409
16410         * attribute.cs: Do only cast to string if it is a string, the
16411         validation happens later.
16412
16413         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
16414         people upgrade their corlibs.
16415
16416         * ecore.cs: Oops, enumerations were not following the entire code path
16417
16418 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
16419
16420         * typemanager.cs (FilterWithClosure): Commented out the test for
16421         1540 in typemanager.cs, as it has problems when accessing
16422         protected methods from a parent class (see test-174.cs). 
16423
16424         * attribute.cs (Attribute.ValidateGuid): new method.
16425         (Attribute.Resolve): Use above.
16426
16427 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
16428
16429         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
16430
16431         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
16432         handling for enumerations, as we only needed the TypeContainer
16433         functionality to begin with (this is required for the fix below to
16434         work for enums that reference constants in a container class for
16435         example). 
16436
16437         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
16438
16439         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
16440         a valid TypeBuilder to perform lookups on.o
16441
16442         * class.cs (InheritableMemberSignatureCompare): Use true in the
16443         call to GetGetMethod and GetSetMethod, because we are comparing
16444         the signature, and we need to get the methods *even* if they are
16445         private. 
16446
16447         (PropertyBase.CheckBase): ditto.
16448
16449         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
16450         GotoCase.Resolve): Use Peel on EmpytCasts.
16451
16452         * ecore.cs (EmptyCast): drop child, add Peel method.
16453
16454 2002-11-17  Martin Baulig  <martin@ximian.com>
16455
16456         * ecore.cs (EmptyCast.Child): New public property.
16457
16458         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
16459         label resolved to an EmptyCast.  Fixes #34162.
16460         (GotoCase.Resolve): Likewise.
16461         (Block.EmitMeta): Likewise.
16462
16463 2002-11-17  Martin Baulig  <martin@ximian.com>
16464
16465         * expression.cs (Invocation.BetterConversion): Prefer int over
16466         uint; short over ushort; long over ulong for integer literals.
16467         Use ImplicitConversionExists instead of StandardConversionExists
16468         since we also need to check for user-defined implicit conversions.
16469         Fixes #34165.  Added test-173.cs.
16470
16471 2002-11-16  Martin Baulig  <martin@ximian.com>
16472
16473         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
16474         with the `true' and `false' literals.  Fixes #33151.
16475
16476 2002-11-16  Martin Baulig  <martin@ximian.com>
16477
16478         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
16479         October 22nd; don't do the cs1540 check for static members.
16480
16481         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
16482         now using our own filter here and doing the cs1540 check again.
16483
16484 2002-11-16  Martin Baulig  <martin@ximian.com>
16485
16486         * support.cs (InternalParameters): Don't crash if we don't have
16487         any fixed parameters.  Fixes #33532.
16488
16489 2002-11-16  Martin Baulig  <martin@ximian.com>
16490
16491         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
16492         when looking up static methods to make this work on Windows.
16493         Fixes #33773.
16494
16495 2002-11-16  Martin Baulig  <martin@ximian.com>
16496
16497         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
16498         a setter rather than using PropertyInfo.CanWrite.
16499
16500 2002-11-15  Nick Drochak  <ndrochak@gol.com>
16501
16502         * class.cs: Allow acces to block member by subclasses. Fixes build
16503         breaker.
16504
16505 2002-11-14  Martin Baulig  <martin@ximian.com>
16506
16507         * class.cs (Constructor.Emit): Added the extern/block check.
16508         Fixes bug #33678.
16509
16510 2002-11-14  Martin Baulig  <martin@ximian.com>
16511
16512         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
16513         iteration while looking for indexers, this is needed because the
16514         indexer may have a different name in our base classes.  Fixed the
16515         error reporting (no indexers at all, not get accessor, no
16516         overloaded match).  Fixes bug #33089.
16517         (IndexerAccess.DoResolveLValue): Likewise.
16518
16519 2002-11-14  Martin Baulig  <martin@ximian.com>
16520
16521         * class.cs (PropertyBase.CheckBase): Make this work for multiple
16522         indexers.  Fixes the first part of bug #33089.
16523         (MethodSignature.InheritableMemberSignatureCompare): Added support
16524         for properties.
16525
16526 2002-11-13  Ravi Pratap  <ravi@ximian.com>
16527
16528         * attribute.cs (Attribute.Resolve): Catch the
16529         NullReferenceException and report it since it isn't supposed to
16530         happen. 
16531
16532 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
16533
16534         * expression.cs (Binary.EmitBranchable): Also handle the cases for
16535         LogicalOr and LogicalAnd that can benefit from recursively
16536         handling EmitBranchable.  The code now should be nice for Paolo.
16537
16538 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
16539
16540         * typemanager.cs (LookupType): Added a negative-hit hashtable for
16541         the Type lookups, as we perform quite a number of lookups on
16542         non-Types.  This can be removed once we can deterministically tell
16543         whether we have a type or a namespace in advance.
16544
16545         But this might require special hacks from our corlib.
16546
16547         * TODO: updated.
16548
16549         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
16550         and double which avoids a conversion from an integer to a double.
16551
16552         * expression.cs: tiny optimization, avoid calling IsConstant,
16553         because it effectively performs the lookup twice.
16554
16555 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
16556
16557         But a bogus return here to keep the semantics of the old code
16558         until the Mono runtime is fixed.
16559
16560         * pending.cs (GetMissingInterfaces): New method used to remove all
16561         the interfaces that are already implemented by our parent
16562         classes from the list of pending methods. 
16563
16564         * interface.cs: Add checks for calls after ResolveTypeExpr.
16565
16566 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
16567
16568         * class.cs (Class.Emit): Report warning 67: event not used if the
16569         warning level is beyond 3.
16570
16571         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
16572         being a NullLiteral.
16573
16574         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
16575         specifiers. 
16576
16577         * class.cs (TypeContainer.GetClassBases): Cover a missing code
16578         path that might fail if a type can not be resolved.
16579
16580         * expression.cs (Binary.Emit): Emit unsigned versions of the
16581         operators. 
16582
16583         * driver.cs: use error 5.
16584
16585 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
16586
16587         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
16588
16589 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
16590
16591         * cs-parser.jay (switch_section): A beautiful patch from Martin
16592         Baulig that fixed 33094.
16593
16594 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
16595
16596         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
16597         Check whether the base is abstract and report an error if so.
16598
16599         * expression.cs (IndexerAccess.DoResolveLValue,
16600         IndexerAccess.DoResolve): ditto. 
16601
16602         (Invocation.DoResolve): ditto.
16603
16604         (Invocation.FullMethodDesc): Improve the report string.
16605
16606         * statement.cs (Block): Eliminate IsVariableDefined as it is
16607         basically just a wrapper for GetVariableInfo.
16608
16609         * ecore.cs (SimpleName): Use new 
16610
16611         * support.cs (ReflectionParamter.ParameterType): We unwrap the
16612         type, as we return the actual parameter ref/unref state on a
16613         different call.
16614
16615 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
16616
16617         * support.cs: Return proper flags REF/OUT fixing the previous
16618         commit.  
16619
16620         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
16621         not used to mean `ref' but `ref or out' in ParameterReference
16622
16623         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
16624         full type signature instead of calling TypeManger.CSharpName
16625         ourselves. 
16626
16627         * support.cs (InternalParameters.ParameterDesc): Do not compare
16628         directly to the modflags, because REF/OUT will actually be bitsets
16629         if set. 
16630
16631         * delegate.cs (VerifyMethod): Check also the modifiers.
16632
16633         * cs-tokenizer.cs: Fix bug where floating point values with an
16634         exponent where a sign was missing was ignored.
16635
16636         * driver.cs: Allow multiple assemblies to be specified in a single
16637         /r: argument
16638
16639 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
16640
16641         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
16642         because identifiers after a parenthesis would end up in this kind
16643         of production, and we needed to desamiguate it for having casts
16644         like:
16645
16646                 (UserDefinedType *) xxx
16647
16648 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
16649
16650         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
16651         we should set on the Bindingflags.NonPublic, but not turn on
16652         private_ok.  private_ok controls whether a Private member is
16653         returned (this is chekced on the filter routine), while the
16654         BindingFlags.NonPublic just controls whether private/protected
16655         will be allowed.   This fixes the problem part of the problem of
16656         private properties being allowed to be used in derived classes.
16657
16658         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
16659         so we can call the children DoResolveLValue method (this will
16660         properly signal errors on lvalue assignments to base properties)
16661
16662         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
16663         getter are null, and we have a property info, we know that this
16664         happened because the lookup failed, so we report an error 122 for
16665         protection level violation.
16666
16667         We also silently return if setter and getter are null in the
16668         resolve functions, this condition only happens if we have flagged
16669         the error before.  This is the other half of the problem. 
16670
16671         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
16672         not have accessibility information, that is why we were returning
16673         true in the filter function in typemanager.cs.
16674
16675         To properly report 122 (property is inaccessible because of its
16676         protection level) correctly, we report this error in ResolveAccess
16677         by failing if both the setter and the getter are lacking (ie, the
16678         lookup failed). 
16679
16680         DoResolve and DoLResolve have been modified to check for both
16681         setter/getter being null and returning silently, the reason being
16682         that I did not want to put the knowledge about this error in upper
16683         layers, like:
16684
16685         int old = Report.Errors;
16686         x = new PropertyExpr (...);
16687         if (old != Report.Errors)
16688                 return null;
16689         else
16690                 return x;
16691
16692         So the property expr is returned, but it is invalid, so the error
16693         will be flagged during the resolve process. 
16694
16695         * class.cs: Remove InheritablePropertySignatureCompare from the
16696         class, as we no longer depend on the property signature to compute
16697         whether it is possible to implement a method or not.
16698
16699         The reason is that calling PropertyInfo.GetGetMethod will return
16700         null (in .NET, in Mono it works, and we should change this), in
16701         cases where the Get Method does not exist in that particular
16702         class.
16703
16704         So this code:
16705
16706         class X { public virtual int A { get { return 1; } } }
16707         class Y : X { }
16708         class Z : Y { public override int A { get { return 2; } } }
16709
16710         Would fail in Z because the parent (Y) would not have the property
16711         defined.  So we avoid this completely now (because the alternative
16712         fix was ugly and slow), and we now depend exclusively on the
16713         method names.
16714
16715         (PropertyBase.CheckBase): Use a method-base mechanism to find our
16716         reference method, instead of using the property.
16717
16718         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
16719         routines are gone now.
16720
16721         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
16722         names, they were incorrectly named.
16723
16724         * cs-tokenizer.cs: Return are more gentle token on failure. 
16725
16726         * pending.cs (PendingImplementation.InterfaceMethod): This routine
16727         had an out-of-sync index variable, which caused it to remove from
16728         the list of pending methods the wrong method sometimes.
16729
16730 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
16731
16732         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
16733         CanWrite, because those refer to this particular instance of the
16734         property, and do not take into account the fact that we can
16735         override single members of a property.
16736
16737         Constructor requires an EmitContext.  The resolution process does
16738         not happen here, but we need to compute the accessors before,
16739         because the resolution does not always happen for properties.
16740
16741         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
16742         subclass, before we did not update this flag, but we did update
16743         bindingflags. 
16744
16745         (GetAccessors): Drop this routine, as it did not work in the
16746         presence of partially overwritten set/get methods. 
16747
16748         Notice that this broke the cs1540 detection, but that will require
16749         more thinking. 
16750
16751 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16752
16753         * class.cs:
16754         * codegen.cs:
16755         * driver.cs: issue a warning instead of an error if we don't support
16756         debugging for the platform. Also ignore a couple of errors that may
16757         arise when trying to write the symbols. Undo my previous patch.
16758
16759 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16760
16761         * driver.cs: ignore /debug switch except for Unix platforms.
16762
16763 2002-10-23  Nick Drochak  <ndrochak@gol.com>
16764
16765         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
16766
16767 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
16768
16769         * driver.cs: Do not make mcs-debug conditional, so we do not break
16770         builds that use it.
16771
16772         * statement.cs (UsageVector.MergeChildren): I would like Martin to
16773         review this patch.  But basically after all the children variables
16774         have been merged, the value of "Breaks" was not being set to
16775         new_breaks for Switch blocks.  I think that it should be set after
16776         it has executed.  Currently I set this to the value of new_breaks,
16777         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
16778         conservative, but I do not understand this code very well.
16779
16780         I did not break anything in the build, so that is good ;-)
16781
16782         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
16783
16784 2002-10-20  Mark Crichton  <crichton@gimp.org>
16785
16786         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
16787
16788 2002-10-20  Nick Drochak  <ndrochak@gol.com>
16789
16790         * cfold.cs: Fixed compile blocker.
16791
16792 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
16793
16794         * driver.cs: I was chekcing the key, not the file.
16795
16796 2002-10-19  Ravi Pratap  <ravi@ximian.com>
16797
16798         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
16799         message that we were generating - we just need to silently return
16800         a null.
16801
16802 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
16803
16804         * class.cs (Event.Define): Change my previous commit, as this
16805         breaks the debugger.  This is a temporary hack, as it seems like
16806         the compiler is generating events incorrectly to begin with.
16807
16808         * expression.cs (Binary.ResolveOperator): Added support for 
16809         "U operator - (E x, E y)"
16810
16811         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
16812         y)".
16813
16814         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
16815         init-only variables, but this path did not take into account that
16816         there might be also instance readonly variables.  Correct this
16817         problem. 
16818
16819         This fixes bug 32253
16820
16821         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
16822         delegates as well.
16823
16824         * driver.cs: Change the extension for modules to `netmodule'
16825
16826         * cs-parser.jay: Improved slightly the location tracking for
16827         the debugger symbols.
16828
16829         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
16830         modifiers that were specified instead of the hardcoded value
16831         (FamAndAssem).  This was basically ignoring the static modifier,
16832         and others.  Fixes 32429.
16833
16834         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
16835         fixed a bug in the process (32476)
16836
16837         * expression.cs (ArrayAccess.EmitAssign): Patch from
16838         hwang_rob@yahoo.ca that fixes bug 31834.3
16839
16840 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
16841
16842         * driver.cs: Make the module extension .netmodule.
16843
16844 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
16845
16846         * driver.cs: Report an error if the resource file is not found
16847         instead of crashing.
16848
16849         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
16850         false, like Emit does.
16851
16852 2002-10-16  Nick Drochak  <ndrochak@gol.com>
16853
16854         * typemanager.cs: Remove unused private member.  Also reported mcs
16855         bug to report this as a warning like csc.
16856
16857 2002-10-15  Martin Baulig  <martin@gnome.org>
16858
16859         * statement.cs (Statement.Emit): Made this a virtual method; emits
16860         the line number info and calls DoEmit().
16861         (Statement.DoEmit): New protected abstract method, formerly knows
16862         as Statement.Emit().
16863
16864         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
16865
16866 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
16867
16868         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
16869         have fixed a remaining problem: not every AddXXXX was adding a
16870         fully qualified name.  
16871
16872         Now everyone registers a fully qualified name in the DeclSpace as
16873         being defined instead of the partial name.  
16874
16875         Downsides: we are slower than we need to be due to the excess
16876         copies and the names being registered this way.  
16877
16878         The reason for this is that we currently depend (on the corlib
16879         bootstrap for instance) that types are fully qualified, because
16880         we dump all the types in the namespace, and we should really have
16881         types inserted into the proper namespace, so we can only store the
16882         basenames in the defined_names array.
16883
16884 2002-10-10  Martin Baulig  <martin@gnome.org>
16885
16886         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
16887         from bug #31834, see the bug report for a testcase which is
16888         miscompiled.
16889
16890 2002-10-10  Martin Baulig  <martin@gnome.org>
16891
16892         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
16893         flow analysis code for this.
16894
16895         * statement.cs (Do, While, For): Tell the flow analysis code about
16896         infinite loops.
16897         (FlowBranching.UsageVector): Added support for infinite loops.
16898         (Block.Resolve): Moved the dead code elimination here and use flow
16899         analysis to do it.
16900
16901 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
16902
16903         * class.cs (Field.Define): Catch cycles on struct type
16904         definitions. 
16905
16906         * typemanager.cs (IsUnmanagedtype): Do not recursively check
16907         fields if the fields are static.  We only need to check instance
16908         fields. 
16909
16910         * expression.cs (As.DoResolve): Test for reference type.
16911
16912         * statement.cs (Using.ResolveExpression): Use
16913         ConvertImplicitRequired, not ConvertImplicit which reports an
16914         error on failture
16915         (Using.ResolveLocalVariableDecls): ditto.
16916
16917         * expression.cs (Binary.ResolveOperator): Report errors in a few
16918         places where we had to.
16919
16920         * typemanager.cs (IsUnmanagedtype): Finish implementation.
16921
16922 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
16923
16924         * expression.cs: Use StoreFromPtr instead of extracting the type
16925         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
16926
16927         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
16928         an enumeration value to a System.Enum, but System.Enum is not a
16929         value type, but an class type, so we need to box.
16930
16931         (Expression.ConvertExplicit): One codepath could return
16932         errors but not flag them.  Fix this.  Fixes #31853
16933
16934         * parameter.cs (Resolve): Do not allow void as a parameter type.
16935
16936 2002-10-06  Martin Baulig  <martin@gnome.org>
16937
16938         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
16939         if it's a class type and not a struct.  Fixes #31815.
16940
16941 2002-10-06  Martin Baulig  <martin@gnome.org>
16942
16943         * statement.cs: Reworked the flow analysis code a bit to make it
16944         usable for dead code elimination.
16945
16946 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16947
16948         * cs-parser.jay: allow empty source files. Fixes bug #31781.
16949
16950 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * expression.cs (ComposedCast.DoResolveType): A quick workaround
16953         to fix the test 165, will investigate deeper.
16954
16955 2002-10-04  Martin Baulig  <martin@gnome.org>
16956
16957         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
16958         finally blocks actually work.
16959         (Try.Resolve): We don't need to create a sibling for `finally' if
16960         there is no finally block.
16961
16962 2002-10-04  Martin Baulig  <martin@gnome.org>
16963
16964         * class.cs (Constructor.Define): The default accessibility for a
16965         non-default constructor is private, not public.
16966
16967 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
16968
16969         * class.cs (Constructor): Make AllowedModifiers public, add
16970         EXTERN.
16971
16972         * cs-parser.jay: Perform the modifiers test here, as the
16973         constructor for the Constructor class usually receives a zero
16974         because of the way we create it (first we create, later we
16975         customize, and we were never checking the modifiers).
16976
16977         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
16978         is a version of LookupTypeReflection that includes the type-name
16979         cache.  This can be used as a fast path for functions that know
16980         the fully qualified name and are only calling into *.GetType() to
16981         obtain a composed type.
16982
16983         This is also used by TypeManager.LookupType during its type
16984         composition.
16985
16986         (LookupType): We now also track the real type name, as sometimes
16987         we can get a quey for the real type name from things like
16988         ComposedCast.  This fixes bug 31422.
16989
16990         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
16991         complete type fullname, it does not have to go through the type
16992         resolution system to obtain the composed version of the type (for
16993         obtaining arrays or pointers).
16994
16995         (Conditional.Emit): Use the EmitBoolExpression to
16996         generate nicer code, as requested by Paolo.
16997
16998         (ArrayCreation.CheckIndices): Use the patch from
16999         hwang_rob@yahoo.ca to validate the array initializers. 
17000
17001 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
17002
17003         * class.cs (ConstructorInitializer.Emit): simplify code by using
17004         Invocation.EmitCall, and at the same time, fix the bugs in calling
17005         parent constructors that took variable arguments. 
17006
17007         * ecore.cs (Expression.ConvertNumericExplicit,
17008         Expression.ImplicitNumericConversion): Remove the code that
17009         manually wrapped decimal (InternalTypeConstructor call is now gone
17010         as well).
17011
17012         * expression.cs (Cast.TryReduce): Also handle decimal types when
17013         trying to perform a constant fold on the type.
17014
17015         * typemanager.cs (IsUnmanagedtype): Partially implemented.
17016
17017         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
17018         that only turned off an error report, and did nothing else. 
17019
17020 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
17021
17022         * driver.cs: Handle and ignore /fullpaths
17023
17024 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
17025
17026         * expression.cs (Binary.ResolveOperator): Catch the case where
17027         DoNumericPromotions returns true, 
17028
17029         (Binary.DoNumericPromotions): Simplify the code, and the tests.
17030
17031 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
17032
17033         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
17034         report error 70.
17035
17036 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
17037
17038         * ecore.cs (ConvertNumericExplicit): It is not enough that the
17039         conversion exists, but it is also required that the conversion be
17040         performed.  This manifested in "(Type64Enum) 2".  
17041
17042         * class.cs (TypeManager.AddMethod): The fix is not to change
17043         AddEnum, because that one was using a fully qualified name (every
17044         DeclSpace derivative does), but to change the AddMethod routine
17045         that was using an un-namespaced name.  This now correctly reports
17046         the duplicated name.
17047
17048         Revert patch until I can properly fix it.  The issue
17049         is that we have a shared Type space across all namespaces
17050         currently, which is wrong.
17051
17052         Options include making the Namespace a DeclSpace, and merge
17053         current_namespace/current_container in the parser.
17054
17055 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
17056
17057         * cs-parser.jay: Improve error reporting when we get a different
17058         kind of expression in local_variable_type and
17059         local_variable_pointer_type. 
17060
17061         Propagate this to avoid missleading errors being reported.
17062
17063         * ecore.cs (ImplicitReferenceConversion): treat
17064         TypeManager.value_type as a target just like object_type.   As
17065         code like this:
17066
17067         ValueType v = 1;
17068
17069         Is valid, and needs to result in the int 1 being boxed before it
17070         is assigned to the value type v.
17071
17072         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
17073         to validate the enumeration name.
17074
17075         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
17076         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
17077         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
17078
17079         * ecore.cs (TryImplicitIntConversion): When doing an
17080         implicit-enumeration-conversion, check if the type is 64-bits and
17081         perform a conversion before passing to EnumConstant.
17082
17083 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
17084
17085         * decl.cs (Error_AmbiguousTypeReference); New routine used to
17086         report ambiguous type references.  Unlike the MS version, we
17087         report what the ambiguity is.   Innovation at work ;-)
17088
17089         (DeclSpace.FindType): Require a location argument to
17090         display when we display an ambiguous error.
17091
17092         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
17093
17094         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
17095
17096         * expression.cs (EmitDynamicInitializers): Apply patch from
17097         hwang_rob@yahoo.ca that fixes the order in which we emit our
17098         initializers. 
17099
17100 2002-09-21  Martin Baulig  <martin@gnome.org>
17101
17102         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
17103         delegate takes no arguments.
17104
17105 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
17106
17107         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
17108         from integers.
17109
17110         * expression.cs: Extract the underlying type.
17111
17112         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
17113
17114         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
17115
17116 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
17117
17118         * class.cs (TypeContainer.DefineType): We can not use the nice
17119         PackingSize with the size set to 1 DefineType method, because it
17120         will not allow us to define the interfaces that the struct
17121         implements.
17122
17123         This completes the fixing of bug 27287
17124
17125         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
17126         means also structs.  This fixes part of the problem. 
17127         (Expresion.ImplicitReferenceConversionExists): ditto.
17128
17129         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
17130         error if there were no errors reported during the type lookup
17131         process, to avoid duplicates or redundant errors.  Without this
17132         you would get an ambiguous errors plus a type not found.  We have
17133         beaten the user enough with the first error.  
17134
17135         (DeclSparce.FindType): Emit a warning if we have an ambiguous
17136         reference. 
17137
17138         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
17139         during the resolution process, stop the lookup, this avoids
17140         repeated error reports (same error twice).
17141
17142         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
17143
17144         * typemanager.cs (LookupType): Redo the type lookup code to match
17145         the needs of System.Reflection.  
17146
17147         The issue is that System.Reflection requires references to nested
17148         types to begin with a "+" sign instead of a dot.  So toplevel
17149         types look like: "NameSpace.TopLevelClass", and nested ones look
17150         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
17151         levels. 
17152
17153 2002-09-19  Martin Baulig  <martin@gnome.org>
17154
17155         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
17156         says that a method always returns or always throws an exception,
17157         don't report the CS0161.
17158
17159         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
17160         set `Returns = new_returns'.
17161
17162 2002-09-19  Martin Baulig  <martin@gnome.org>
17163
17164         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
17165         to an enum constant, check for a CS0176.
17166
17167 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
17168
17169         * class.cs (TypeContainer.CheckPairedOperators): Now we check
17170         for operators that must be in pairs and report errors.
17171
17172         * ecore.cs (SimpleName.DoResolveType): During the initial type
17173         resolution process, when we define types recursively, we must
17174         check first for types in our current scope before we perform
17175         lookups in the enclosing scopes.
17176
17177         * expression.cs (MakeByteBlob): Handle Decimal blobs.
17178
17179         (Invocation.VerifyArgumentsCompat): Call
17180         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
17181         I thought we were supposed to always call this, but there are a
17182         few places in the code where we dont do it.
17183
17184 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
17185
17186         * driver.cs: Add support in -linkres and -resource to specify the
17187         name of the identifier.
17188
17189 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17190
17191         * ecore.cs (StandardConversionExists): Sync with the conversion
17192         code: allow anything-* to void* conversions.
17193
17194         (FindMostSpecificSource): Use an Expression argument
17195         instead of a Type, because we might be handed over a Literal which
17196         gets a few more implicit conversions that plain types do not.  So
17197         this information was being lost.
17198
17199         Also, we drop the temporary type-holder expression when not
17200         required.
17201
17202 2002-09-17  Martin Baulig  <martin@gnome.org>
17203
17204         * class.cs (PropertyBase.CheckBase): Don't check the base class if
17205         this is an explicit interface implementation.
17206
17207 2002-09-17  Martin Baulig  <martin@gnome.org>
17208
17209         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
17210         different `IndexerName' attributes.
17211
17212         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
17213         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
17214         virtual CommonResolve().
17215
17216 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
17217
17218         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
17219         and convert that to the UnderlyingType.
17220
17221         * statement.cs (Foreach.Resolve): Indexers are just like variables
17222         or PropertyAccesses.
17223
17224         * cs-tokenizer.cs (consume_string): Track line numbers and columns
17225         inside quoted strings, we were not doing this before.
17226
17227 2002-09-16  Martin Baulig  <martin@gnome.org>
17228
17229         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
17230         resolve it.  This is needed for the definite assignment check of the
17231         instance expression, fixes bug #29846.
17232         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
17233
17234 2002-09-16  Nick Drochak  <ndrochak@gol.com>
17235
17236         * parameter.cs: Fix compile error.  Cannot reference static member
17237         from an instance object.  Is this an mcs bug?
17238
17239 2002-09-14  Martin Baulig  <martin@gnome.org>
17240
17241         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
17242         multiple times.  Fixes bug #30295, added test-166.cs.
17243
17244 2002-09-14  Martin Baulig  <martin@gnome.org>
17245
17246         * statement.cs (Block.Emit): Don't emit unreachable code.
17247         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
17248         `break' statements.
17249         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
17250
17251 2002-09-14  Martin Baulig  <martin@gnome.org>
17252
17253         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
17254         is set.
17255
17256 2002-09-14  Martin Baulig  <martin@gnome.org>
17257
17258         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
17259         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
17260         be false on the ms runtime.
17261
17262 2002-09-13  Martin Baulig  <martin@gnome.org>
17263
17264         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
17265         the CS0038 error message.
17266
17267 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
17268
17269         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
17270         constant inside, return it.
17271
17272 2002-09-12  Martin Baulig  <martin@gnome.org>
17273
17274         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
17275         implicit conversion can be done between enum types.
17276
17277         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
17278         check whether an implicit conversion to the current enum's UnderlyingType
17279         exists and report an error if not.
17280
17281         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
17282         without debugging support.
17283
17284         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
17285         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
17286
17287 2002-09-12  Martin Baulig  <martin@gnome.org>
17288
17289         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
17290
17291         * ecore.cs (IMemberExpr.DeclaringType): New property.
17292         (SimpleName.SimpleNameResolve): Check whether we're accessing a
17293         nonstatic member of an outer type (CS0038).
17294
17295 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
17296
17297         * driver.cs: Activate the using-error detector at warning level
17298         4 (at least for MS-compatible APIs).
17299
17300         * namespace.cs (VerifyUsing): Small buglett fix.
17301
17302         * pending.cs (PendingImplementation): pass the container pointer. 
17303
17304         * interface.cs (GetMethods): Allow for recursive definition.  Long
17305         term, I would like to move every type to support recursive
17306         definitions, not the current ordering mechanism that we have right
17307         now.
17308
17309         The situation is this: Attributes are handled before interfaces,
17310         so we can apply attributes to interfaces.  But some attributes
17311         implement interfaces, we will now handle the simple cases
17312         (recursive definitions will just get an error).  
17313
17314         * parameter.cs: Only invalidate types at the end if we fail to
17315         lookup all types.  
17316
17317 2002-09-09  Martin Baulig  <martin@gnome.org>
17318
17319         * ecore.cs (PropertyExpr.Emit): Also check for
17320         TypeManager.system_int_array_get_length so this'll also work when
17321         compiling corlib.  Fixes #30003.
17322
17323 2002-09-09  Martin Baulig  <martin@gnome.org>
17324
17325         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
17326         and throw an exception if we can't get the type's size.  Fixed #30040,
17327         added test-165.cs.
17328
17329 2002-09-09  Martin Baulig  <martin@gnome.org>
17330
17331         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
17332
17333         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
17334         context.  Fixes bug #30027.
17335
17336         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
17337         virtual functions.  Fixes bug #30043, added test-164.cs.
17338
17339 2002-09-08  Ravi Pratap  <ravi@ximian.com>
17340
17341         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
17342
17343 2002-09-08  Nick Drochak  <ndrochak@gol.com>
17344
17345         * driver.cs: Use an object to get the windows codepage since it's not a
17346         static property.
17347
17348 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * statement.cs (For.Emit): for infinite loops (test == null)
17351         return whether there is a break inside, not always "true".
17352
17353         * namespace.cs (UsingEntry): New struct to hold the name of the
17354         using definition, the location where it is defined, and whether it
17355         has been used in a successful type lookup.
17356
17357         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
17358         strings.
17359
17360         * decl.cs: ditto.
17361
17362 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17363
17364         * attribute.cs : Fix incorrect code which relied on catching
17365         a NullReferenceException to detect a null being passed in
17366         where an object was expected.
17367
17368 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
17369
17370         * statement.cs (Try): flag the catch variable as assigned
17371
17372         * expression.cs (Cast): Simplified by using ResolveType instead of
17373         manually resolving.
17374
17375         * statement.cs (Catch): Fix bug by using ResolveType.
17376
17377 2002-09-06  Ravi Pratap  <ravi@ximian.com>
17378
17379         * expression.cs (BetterConversion): Special case for when we have
17380         a NullLiteral as the argument and we have to choose between string
17381         and object types - we choose string the way csc does.
17382
17383         * attribute.cs (Attribute.Resolve): Catch the
17384         NullReferenceException and report error #182 since the Mono
17385         runtime no more has the bug and having this exception raised means
17386         we tried to select a constructor which takes an object and is
17387         passed a null.
17388
17389 2002-09-05  Ravi Pratap  <ravi@ximian.com>
17390
17391         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
17392         message (1502, 1503) when we can't locate a method after overload
17393         resolution. This is much more informative and closes the bug
17394         Miguel reported.
17395
17396         * interface.cs (PopulateMethod): Return if there are no argument
17397         types. Fixes a NullReferenceException bug.
17398
17399         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
17400         expressions too. Previously we were checking only in one place for
17401         positional arguments leaving out named arguments.
17402
17403         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
17404         type to the enum type is not allowed. Remove code corresponding to
17405         that.
17406
17407         (ConvertNumericExplicit): Allow explicit conversions from
17408         the underlying type to enum type. This precisely follows the spec
17409         and closes a bug filed by Gonzalo.
17410
17411 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17412
17413         * compiler.csproj:
17414         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
17415
17416 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
17417
17418         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
17419         it was important that we stored the right value after the
17420         reduction in `converted'.
17421
17422 2002-09-04  Martin Baulig  <martin@gnome.org>
17423
17424         * location.cs (Location.SymbolDocument): Use full pathnames for the
17425         source files.
17426
17427 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
17428
17429         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
17430         of the expression resolve mechanism, because that will catch the
17431         SimpleName error failures.
17432
17433         (Conditional): If we can not resolve the
17434         expression, return, do not crash.
17435
17436 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17437
17438         * cs-tokenizer.cs:
17439         (location): display token name instead of its number.
17440
17441 2002-08-28  Martin Baulig  <martin@gnome.org>
17442
17443         * expression.cs (Binary.ResolveOperator): Don't silently return
17444         but return an error if an operator cannot be applied between two
17445         enum types.
17446
17447 2002-08-28  Martin Baulig  <martin@gnome.org>
17448
17449         * class.cs (Constructor.Define): Set the permission attributes
17450         correctly instead of making all constructors public.
17451
17452 2002-08-28  Martin Baulig  <martin@gnome.org>
17453
17454         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
17455         for private members before reporting a CS0103; if we find anything,
17456         it's a CS0122.
17457
17458 2002-08-28  Martin Baulig  <martin@gnome.org>
17459
17460         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
17461         to check whether `closure_start_type == closure_invocation_type',
17462         we also need to check whether `m.DeclaringType == closure_invocation_type'
17463         before bypassing the permission checks.  We might be accessing
17464         protected/private members from the base class.
17465         (TypeManager.RealMemberLookup): Only set private_ok if private
17466         members were requested via BindingFlags.NonPublic.
17467
17468         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
17469
17470         * expression.cs (MemberAccess.ResolveMemberAccess): Set
17471         MethodGroupExpr.IsExplicitImpl if appropriate.
17472         (Invocation.DoResolve): Don't report the CS0120 for explicit
17473         interface implementations.
17474
17475 2002-08-27  Martin Baulig  <martin@gnome.org>
17476
17477         * expression.cs (Invocation.DoResolve): If this is a static
17478         method and we don't have an InstanceExpression, we must report
17479         a CS0120.
17480
17481 2002-08-25  Martin Baulig  <martin@gnome.org>
17482
17483         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
17484         `==' between a valuetype and an object.
17485
17486 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
17487
17488         * ecore.cs (TypeExpr): Provide a ToString method.
17489
17490 2002-08-24  Martin Baulig  <martin@gnome.org>
17491
17492         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
17493         now called proggie.dbg and it's a binary file.
17494
17495 2002-08-23  Martin Baulig  <martin@gnome.org>
17496
17497         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
17498
17499 2002-08-23  Martin Baulig  <martin@gnome.org>
17500
17501         * struct.cs (MyStructInfo.ctor): Make this work with empty
17502         structs; it's not allowed to use foreach() on null.
17503
17504 2002-08-23  Martin Baulig  <martin@gnome.org>
17505
17506         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
17507         writer the full pathname of the generated assembly.
17508
17509 2002-08-23  Martin Baulig  <martin@gnome.org>
17510
17511         * statements.cs (FlowBranching.UsageVector.MergeChildren):
17512         A `finally' block never returns or breaks; improved handling of
17513         unreachable code.
17514
17515 2002-08-23  Martin Baulig  <martin@gnome.org>
17516
17517         * statement.cs (Throw.Resolve): Allow `throw null'.
17518
17519 2002-08-23  Martin Baulig  <martin@gnome.org>
17520
17521         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
17522         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
17523         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
17524         MemberLookup would return a wrong event if this is an explicit
17525         interface implementation and the class has an event with the same
17526         name.
17527
17528 2002-08-23  Martin Baulig  <martin@gnome.org>
17529
17530         * statement.cs (Block.AddChildVariableNames): New public method.
17531         (Block.AddChildVariableName): Likewise.
17532         (Block.IsVariableNameUsedInChildBlock): Likewise.
17533         (Block.AddVariable): Check whether a variable name has already
17534         been used in a child block.
17535
17536         * cs-parser.jay (declare_local_variables): Mark all variable names
17537         from the current block as being used in a child block in the
17538         implicit block.
17539
17540 2002-08-23  Martin Baulig  <martin@gnome.org>
17541
17542         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
17543         find the symbol writer.
17544
17545         * driver.cs: csc also allows the arguments to /define being
17546         separated by commas, not only by semicolons.
17547
17548 2002-08-23  Martin Baulig  <martin@gnome.org>
17549
17550         * interface.cs (Interface.GetMembers): Added static check for events.
17551
17552 2002-08-15  Martin Baulig  <martin@gnome.org>
17553
17554         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
17555         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
17556
17557         * ecore.cs (Expression.MemberLookup): Added documentation and explained
17558         why the MethodData.EmitDestructor() change was necessary.
17559
17560 2002-08-20  Martin Baulig  <martin@gnome.org>
17561
17562         * class.cs (TypeContainer.FindMembers): Added static check for events.
17563
17564         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
17565
17566         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
17567         use Type.GetEvents(), not Type.FindMembers().
17568
17569 2002-08-20  Martin Baulig  <martin@gnome.org>
17570
17571         * decl.cs (MemberCache): Added a special method cache which will
17572         be used for method-only searched.  This ensures that a method
17573         search will return a MethodInfo with the correct ReflectedType for
17574         inherited methods.      
17575
17576 2002-08-20  Martin Baulig  <martin@gnome.org>
17577
17578         * decl.cs (DeclSpace.FindMembers): Made this public.
17579
17580 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17581
17582         * delegate.cs: fixed build on windows.
17583         [FIXME:  Filed as bug #29150: MCS must report these errors.]
17584
17585 2002-08-19  Ravi Pratap  <ravi@ximian.com>
17586
17587         * ecore.cs (StandardConversionExists): Return a false
17588         if we are trying to convert the void type to anything else
17589         since that is not allowed.
17590
17591         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
17592         we flag error 70 in the event an event is trying to be accessed
17593         directly from outside the declaring type.
17594
17595 2002-08-20  Martin Baulig  <martin@gnome.org>
17596
17597         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
17598         MemberCache from typemanager.cs to decl.cs.
17599
17600 2002-08-19  Martin Baulig  <martin@gnome.org>
17601
17602         * class.cs (TypeContainer): Implement IMemberContainer.
17603         (TypeContainer.DefineMembers): Create the MemberCache.
17604         (TypeContainer.FindMembers): Do better BindingFlags checking; only
17605         return public members if BindingFlags.Public was given, check
17606         whether members are static.
17607
17608 2002-08-16  Martin Baulig  <martin@gnome.org>
17609
17610         * decl.cs (DeclSpace.Define): Splitted this in Define and
17611         DefineMembers.  DefineMembers is called first and initializes the
17612         MemberCache.
17613
17614         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
17615         DefineMembers() on all our DeclSpaces.
17616
17617         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
17618         but call DefineMembers() on all nested interfaces.  We call their
17619         Define() in our new Define() function.
17620
17621         * interface.cs (Interface): Implement IMemberContainer.
17622         (Interface.Define): Moved all code except the attribute stuf to
17623         DefineMembers().
17624         (Interface.DefineMembers): Initialize the member cache.
17625
17626         * typemanager.cs (IMemberFinder): Removed this interface, we don't
17627         need this anymore since we can use MemberCache.FindMembers directly.
17628
17629 2002-08-19  Martin Baulig  <martin@gnome.org>
17630
17631         * typemanager.cs (MemberCache): When creating the cache for an
17632         interface type, add all inherited members.
17633         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
17634         to `out bool used_cache' and documented it.
17635         (TypeManager.MemberLookup): If we already used the cache in the first
17636         iteration, we don't need to do the interfaces check.
17637
17638 2002-08-19  Martin Baulig  <martin@gnome.org>
17639
17640         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
17641         here from IMemberFinder and don't implement this interface anymore.
17642         (DeclSpace.MemberCache): Moved here from IMemberFinder.
17643
17644         * typemanager.cs (IMemberFinder): This interface is now only used by
17645         classes which actually support the member cache.
17646         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
17647         since we only put DeclSpaces into this Hashtable.
17648         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
17649         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
17650
17651 2002-08-16  Martin Baulig  <martin@gnome.org>
17652
17653         * typemanager.cs (ICachingMemberFinder): Removed.
17654         (IMemberFinder.MemberCache): New property.
17655         (TypeManager.FindMembers): Merged this with RealFindMembers().
17656         This function will never be called from TypeManager.MemberLookup()
17657         so we can't use the cache here, just the IMemberFinder.
17658         (TypeManager.MemberLookup_FindMembers): Check whether the
17659         IMemberFinder has a MemberCache and call the cache's FindMembers
17660         function.
17661         (MemberCache): Rewrote larger parts of this yet another time and
17662         cleaned it up a bit.
17663
17664 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
17665
17666         * driver.cs (LoadArgs): Support quoting.
17667
17668         (Usage): Show the CSC-like command line arguments.
17669
17670         Improved a few error messages.
17671
17672 2002-08-15  Martin Baulig  <martin@gnome.org>
17673
17674         * typemanager.cs (IMemberContainer.Type): New property.
17675         (IMemberContainer.IsInterface): New property.
17676
17677         The following changes are conditional to BROKEN_RUNTIME, which is
17678         defined at the top of the file.
17679
17680         * typemanager.cs (MemberCache.MemberCache): Don't add the base
17681         class'es members, but add all members from TypeHandle.ObjectType
17682         if we're an interface.
17683         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
17684         is the current type.
17685         (MemberCache.CacheEntry.Container): Removed this field.
17686         (TypeHandle.GetMembers): Include inherited members.
17687
17688 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17689
17690         * typemanager.cs: fixed compilation and added a comment on a field that
17691         is never used.
17692
17693 2002-08-15  Martin Baulig  <martin@gnome.org>
17694
17695         * class.cs (ConstructorInitializer.Resolve): In the
17696         Expression.MemberLookup call, use the queried_type as
17697         invocation_type.
17698
17699         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
17700         declared' attribute, it's always true.
17701         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
17702         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
17703         temporary wrapper for FindMembers which tells MemberLookup whether
17704         members from the base classes are included in the return value.
17705         This will go away soon.
17706         (TypeManager.MemberLookup): Use this temporary hack here; once the
17707         new MemberCache is completed, we don't need to do the DeclaredOnly
17708         looping here anymore since the MemberCache will take care of this.
17709         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
17710         (MemberCache): When creating the MemberCache for a class, get
17711         members from the current class and all its base classes.
17712         (MemberCache.CacheEntry.Container): New field.  This is a
17713         temporary hack until the Mono runtime is fixed to distinguish
17714         between ReflectedType and DeclaringType.  It allows us to use MCS
17715         with both the MS runtime and the unfixed Mono runtime without
17716         problems and without accecting performance.
17717         (MemberCache.SearchMembers): The DeclaredOnly looping from
17718         TypeManager.MemberLookup is now done here.      
17719
17720 2002-08-14  Martin Baulig  <martin@gnome.org>
17721
17722         * statement.cs (MyStructInfo.MyStructInfo): Don't call
17723         Type.GetFields on dynamic types but get the fields from the
17724         corresponding TypeContainer.
17725         (MyStructInfo.GetStructInfo): Added check for enum types.
17726
17727         * typemanager.cs (MemberList.IsSynchronized): Implemented.
17728         (MemberList.SyncRoot): Implemented.
17729         (TypeManager.FilterWithClosure): No need to check permissions if
17730         closure_start_type == closure_invocation_type, don't crash if
17731         closure_invocation_type is null.
17732
17733 2002-08-13  Martin Baulig  <martin@gnome.org>
17734
17735         Rewrote TypeContainer.FindMembers to use a member cache.  This
17736         gives us a speed increase of about 35% for the self-hosting MCS
17737         build and of about 15-20% for the class libs (both on GNU/Linux).
17738
17739         * report.cs (Timer): New class to get enhanced profiling.  This
17740         whole class is "TIMER" conditional since it remarkably slows down
17741         compilation speed.
17742
17743         * class.cs (MemberList): New class.  This is an IList wrapper
17744         which we're now using instead of passing MemberInfo[]'s around to
17745         avoid copying this array unnecessarily.
17746         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
17747         (ICachingMemberFinder, IMemberContainer): New interface.
17748         (TypeManager.FilterWithClosure): If `criteria' is null, the name
17749         has already been checked, otherwise use it for the name comparision.
17750         (TypeManager.FindMembers): Renamed to RealMemberFinder and
17751         provided wrapper which tries to use ICachingMemberFinder.FindMembers
17752         if possible.  Returns a MemberList, not a MemberInfo [].
17753         (TypeHandle): New class, implements IMemberContainer.  We create
17754         one instance of this class per type, it contains a MemberCache
17755         which is used to do the member lookups.
17756         (MemberCache): New class.  Each instance of this class contains
17757         all members of a type and a name-based hash table.
17758         (MemberCache.FindMembers): This is our new member lookup
17759         function.  First, it looks up all members of the requested name in
17760         the hash table.  Then, it walks this list and sorts out all
17761         applicable members and returns them.
17762
17763 2002-08-13  Martin Baulig  <martin@gnome.org>
17764
17765         In addition to a nice code cleanup, this gives us a performance
17766         increase of about 1.4% on GNU/Linux - not much, but it's already
17767         half a second for the self-hosting MCS compilation.
17768
17769         * typemanager.cs (IMemberFinder): New interface.  It is used by
17770         TypeManager.FindMembers to call FindMembers on a TypeContainer,
17771         Enum, Delegate or Interface.
17772         (TypeManager.finder_to_member_finder): New PtrHashtable.
17773         (TypeManager.finder_to_container): Removed.
17774         (TypeManager.finder_to_delegate): Removed.
17775         (TypeManager.finder_to_interface): Removed.
17776         (TypeManager.finder_to_enum): Removed.
17777
17778         * interface.cs (Interface): Implement IMemberFinder.
17779
17780         * delegate.cs (Delegate): Implement IMemberFinder.
17781
17782         * enum.cs (Enum): Implement IMemberFinder.
17783
17784         * class.cs (TypeContainer): Implement IMemberFinder.
17785
17786 2002-08-12  Martin Baulig  <martin@gnome.org>
17787
17788         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
17789
17790 2002-08-12  Martin Baulig  <martin@gnome.org>
17791
17792         * ecore.cs (ITypeExpression): New interface for expressions which
17793         resolve to a type.
17794         (TypeExpression): Renamed to TypeLookupExpression.
17795         (Expression.DoResolve): If we're doing a types-only lookup, the
17796         expression must implement the ITypeExpression interface and we
17797         call DoResolveType() on it.
17798         (SimpleName): Implement the new ITypeExpression interface.
17799         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
17800         hack, the situation that we're only looking up types can't happen
17801         anymore when this method is called.  Moved the type lookup code to
17802         DoResolveType() and call it.
17803         (SimpleName.DoResolveType): This ITypeExpression interface method
17804         is now doing the types-only lookup.
17805         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
17806         (ResolveFlags): Added MaskExprClass.
17807
17808         * expression.cs (MemberAccess): Implement the ITypeExpression
17809         interface.
17810         (MemberAccess.DoResolve): Added support for a types-only lookup
17811         when we're called via ITypeExpression.DoResolveType().
17812         (ComposedCast): Implement the ITypeExpression interface.
17813
17814         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
17815         Expression.Resolve() with ResolveFlags.Type instead.
17816
17817 2002-08-12  Martin Baulig  <martin@gnome.org>
17818
17819         * interface.cs (Interface.Define): Apply attributes.
17820
17821         * attribute.cs (Attribute.ApplyAttributes): Added support for
17822         interface attributes.
17823
17824 2002-08-11  Martin Baulig  <martin@gnome.org>
17825
17826         * statement.cs (Block.Emit): Only check the "this" variable if we
17827         do not always throw an exception.
17828
17829         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
17830         whether the property has a set accessor.
17831
17832 2002-08-11  Martin Baulig  <martin@gnome.org>
17833
17834         Added control flow analysis support for structs.
17835
17836         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
17837         with control flow analysis turned off.
17838         (IVariable): New interface.
17839         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
17840         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
17841         (FieldExpr.DoResolve): Resolve the instance expression with flow
17842         analysis turned off and do the definite assignment check after the
17843         resolving when we know what the expression will resolve to.
17844
17845         * expression.cs (LocalVariableReference, ParameterReference):
17846         Implement the new IVariable interface, only call the flow analysis
17847         code if ec.DoFlowAnalysis is true.
17848         (This): Added constructor which takes a Block argument.  Implement
17849         the new IVariable interface.
17850         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
17851         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
17852         This does the definite assignment checks for struct members.
17853
17854         * class.cs (Constructor.Emit): If this is a non-static `struct'
17855         constructor which doesn't have any initializer, call
17856         Block.AddThisVariable() to tell the flow analysis code that all
17857         struct elements must be initialized before control returns from
17858         the constructor.
17859
17860         * statement.cs (MyStructInfo): New public class.
17861         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
17862         argument to this indexer.  If non-zero, check an individual struct
17863         member, not the whole struct.
17864         (FlowBranching.CheckOutParameters): Check struct members.
17865         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
17866         overloaded versions of these methods which take an additional
17867         `int field_idx' argument to check struct members.
17868         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
17869         overloaded versions of these methods which take an additional
17870         `string field_name' argument to check struct member.s
17871         (VariableInfo): Implement the IVariable interface.
17872         (VariableInfo.StructInfo): New public property.  Returns the
17873         MyStructInfo instance of the variable if it's a struct or null.
17874         (Block.AddThisVariable): New public method.  This is called from
17875         Constructor.Emit() for non-static `struct' constructor which do
17876         not have any initializer.  It creates a special variable for the
17877         "this" instance variable which will be checked by the flow
17878         analysis code to ensure that all of the struct's fields are
17879         initialized before control returns from the constructor.
17880         (UsageVector): Added support for struct members.  If a
17881         variable/parameter is a struct with N members, we reserve a slot
17882         in the usage vector for each member.  A struct is considered fully
17883         initialized if either the struct itself (slot 0) or all its
17884         members are initialized.
17885
17886 2002-08-08  Martin Baulig  <martin@gnome.org>
17887
17888         * driver.cs (Driver.MainDriver): Only report an error CS5001
17889         if there were no compilation errors.
17890
17891         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
17892         `UnsafeContext' property to determine whether the parent is in
17893         unsafe context rather than checking the parent's ModFlags:
17894         classes nested in an unsafe class are unsafe as well.
17895
17896 2002-08-08  Martin Baulig  <martin@gnome.org>
17897
17898         * statement.cs (UsageVector.MergeChildren): Distinguish between
17899         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
17900         we return.  Added test17() and test18() to test-154.cs.
17901
17902 2002-08-08  Martin Baulig  <martin@gnome.org>
17903
17904         * typemanager.cs (TypeManager.FilterWithClosure): If we have
17905         Family access, make sure the invoking type isn't a subclass of the
17906         queried type (that'd be a CS1540).
17907
17908         * ecore.cs (Expression.MemberLookup): Added overloaded version of
17909         this method which takes an additional `Type invocation_type'.
17910
17911         * expression.cs (BaseAccess.DoResolve): Use the base type as
17912         invocation and query type.
17913         (MemberAccess.DoResolve): If the lookup failed and we're about to
17914         report a CS0122, try a lookup with the ec.ContainerType - if this
17915         succeeds, we must report a CS1540.
17916
17917 2002-08-08  Martin Baulig  <martin@gnome.org>
17918
17919         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
17920         (MethodGroupExpr): Implement the IMemberExpr interface.
17921
17922         * expression (MemberAccess.ResolveMemberAccess): No need to have
17923         any special code for MethodGroupExprs anymore, they're now
17924         IMemberExprs.   
17925
17926 2002-08-08  Martin Baulig  <martin@gnome.org>
17927
17928         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
17929         Family, FamANDAssem and FamORAssem permissions.
17930         (TypeManager.IsSubclassOrNestedChildOf): New public method.
17931
17932 2002-08-08  Martin Baulig  <martin@gnome.org>
17933
17934         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
17935         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
17936         or loop block.
17937
17938 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
17939
17940         * driver.cs: implemented /resource option to embed managed resources.
17941
17942 2002-08-07  Martin Baulig  <martin@gnome.org>
17943
17944         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
17945         (FieldBase.HasFieldInitializer): New public property.
17946         (FieldBase.GetInitializerExpression): New public method.  Resolves and
17947         returns the field initializer and makes sure it is only resolved once.
17948         (TypeContainer.EmitFieldInitializers): Call
17949         FieldBase.GetInitializerExpression to get the initializer, this ensures
17950         that it isn't resolved multiple times.
17951
17952         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
17953         the resolving process (SimpleName/MemberLookup) that we're currently
17954         emitting a field initializer (which must not access any instance members,
17955         this is an error CS0236).
17956
17957         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
17958         argument, if the `IsFieldInitializer' flag is set, we must report and
17959         error CS0236 and not an error CS0120.   
17960
17961 2002-08-07  Martin Baulig  <martin@gnome.org>
17962
17963         * ecore.cs (IMemberExpr): New public interface.
17964         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
17965         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
17966         if the expression is an IMemberExpr.
17967
17968         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
17969         to be null, implicitly default to `this' if we're non-static in
17970         this case.  Simplified the code a lot by using the new IMemberExpr
17971         interface.  Also fixed bug #28176 here.
17972
17973 2002-08-06  Martin Baulig  <martin@gnome.org>
17974
17975         * cs-parser.jay (SimpleLookup): Removed.  We need to create
17976         ParameterReferences during semantic analysis so that we can do a
17977         type-only search when resolving Cast, TypeOf and SizeOf.
17978         (block): Pass the `current_local_parameters' to the Block's
17979         constructor.
17980
17981         * class.cs (ConstructorInitializer): Added `Parameters parameters'
17982         argument to the constructor.
17983         (ConstructorInitializer.Resolve): Create a temporary implicit
17984         block with the parameters.
17985
17986         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
17987         references here if we aren't doing a type-only search.
17988
17989         * statement.cs (Block): Added constructor which takes a
17990         `Parameters parameters' argument.
17991         (Block.Parameters): New public property.
17992
17993         * support.cs (InternalParameters.Parameters): Renamed `parameters'
17994         to `Parameters' and made it public readonly.
17995
17996 2002-08-06  Martin Baulig  <martin@gnome.org>
17997
17998         * ecore.cs (Expression.Warning): Made this public as well.
17999
18000         * report.cs (Report.Debug): Print the contents of collections.
18001
18002 2002-08-06  Martin Baulig  <martin@gnome.org>
18003
18004         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
18005         used to tell Resolve() which kinds of expressions it may return.
18006         (Expression.Resolve): Added overloaded version of this method which
18007         takes a `ResolveFlags flags' argument.  This can be used to tell
18008         Resolve() which kinds of expressions it may return.  Reports a
18009         CS0118 on error.
18010         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
18011         ResolveFlags.SimpleName.
18012         (Expression.Error118): Added overloaded version of this method which
18013         takes a `ResolveFlags flags' argument.  It uses the flags to determine
18014         which kinds of expressions are allowed.
18015
18016         * expression.cs (Argument.ResolveMethodGroup): New public method.
18017         Resolves an argument, but allows a MethodGroup to be returned.
18018         This is used when invoking a delegate.
18019
18020         * TODO: Updated a bit.
18021
18022 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18023
18024         Fixed compilation with csc.
18025
18026         * ecore.cs: Expression.Error made public. Is this correct? Should
18027         Warning be made public too?
18028
18029         * expression.cs: use ea.Location instead of ea.loc.
18030         [FIXME:  Filed as bug #28607: MCS must report these errors.]
18031
18032 2002-08-06  Martin Baulig  <martin@gnome.org>
18033
18034         * ecore.cs (Expression.loc): Moved the location here instead of
18035         duplicating it in all derived classes.
18036         (Expression.Location): New public property.
18037         (Expression.Error, Expression.Warning): Made them non-static and
18038         removed the location argument.
18039         (Expression.Warning): Added overloaded version which takes an
18040         `int level' argument.
18041         (Expression.Error118): Make this non-static and removed the
18042         expression and location arguments.
18043         (TypeExpr): Added location argument to the constructor.
18044
18045         * expression.cs (StaticCallExpr): Added location argument to
18046         the constructor.
18047         (Indirection, PointerArithmetic): Likewise.
18048         (CheckedExpr, UnCheckedExpr): Likewise.
18049         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
18050         (StringPtr): Likewise.
18051
18052
18053 2002-08-05  Martin Baulig  <martin@gnome.org>
18054
18055         * expression.cs (BaseAccess.DoResolve): Actually report errors.
18056
18057         * assign.cs (Assign.DoResolve): Check whether the source
18058         expression is a value or variable.
18059
18060         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
18061         while resolving the corresponding blocks.
18062
18063         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
18064         an error, don't silently return null.
18065
18066         * statement.cs (Block.AddVariable): Do the error reporting here
18067         and distinguish between CS0128 and CS0136.
18068         (Block.DoResolve): Report all unused labels (warning CS0164).
18069         (LabeledStatement): Pass the location to the constructor.
18070         (LabeledStatement.HasBeenReferenced): New property.
18071         (LabeledStatement.Resolve): Set it to true here.
18072
18073         * statement.cs (Return.Emit): Return success even after reporting
18074         a type mismatch error (CS0126 or CS0127), this is what csc does and
18075         it avoids confusing the users with any consecutive errors.
18076
18077 2002-08-05  Martin Baulig  <martin@gnome.org>
18078
18079         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
18080
18081         * const.cs (Const.LookupConstantValue): Catch circular definitions.
18082
18083         * expression.cs (MemberAccess.DoResolve): Silently return if an
18084         error has already been reported.
18085
18086         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
18087         error has already been reported.
18088
18089 2002-08-05  Martin Baulig  <martin@gnome.org>
18090
18091         * statement.cs (UsageVector): Only initialize the `parameters'
18092         vector if we actually have any "out" parameters.
18093
18094 2002-08-05  Martin Baulig  <martin@gnome.org>
18095
18096         * expression.cs (Binary.ResolveOperator): When combining delegates,
18097         they must have the same type.
18098
18099 2002-08-05  Martin Baulig  <martin@gnome.org>
18100
18101         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
18102         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
18103         work with the ms runtime and we also don't need it: if we're a
18104         PropertyBuilder and not in the `indexer_arguments' hash, then we
18105         are a property and not an indexer.
18106
18107         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
18108         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
18109         since the latter one doesn't work with the ms runtime.
18110
18111 2002-08-03  Martin Baulig  <martin@gnome.org>
18112
18113         Fixed bugs #27998 and #22735.
18114
18115         * class.cs (Method.IsOperator): New public field.
18116         (Method.CheckBase): Report CS0111 if there's already a method
18117         with the same parameters in the current class.  Report CS0508 when
18118         attempting to change the return type of an inherited method.
18119         (MethodData.Emit): Report CS0179 if a method doesn't have a body
18120         and it's not marked abstract or extern.
18121         (PropertyBase): New abstract base class for Property and Indexer.
18122         (PropertyBase.CheckBase): Moved here from Property and made it work
18123         for indexers.
18124         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
18125         the same so we can reuse it there.
18126         (Property, Indexer): Derive from PropertyBase.
18127         (MethodSignature.inheritable_property_signature_filter): New delegate
18128         to find properties and indexers.
18129
18130         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
18131         argument and improved error reporting.
18132
18133         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
18134         EmptyReadOnlyParameters and made it a property.
18135
18136         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
18137         version of this method which takes a `PropertyInfo indexer'.
18138         (TypeManager.RegisterIndexer): New method.
18139
18140         * class.cs: Added myself as author of this file :-)
18141
18142 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18143
18144         * class.cs: fixed compilation on windoze.
18145
18146 2002-08-03  Martin Baulig  <martin@gnome.org>
18147
18148         * interface.cs (Interface.GetInterfaceBases): Check whether all
18149         base interfaces are at least as accessible than the current one.
18150
18151         * class.cs (TypeContainer.GetClassBases): Check whether base types
18152         are at least as accessible than the current type.
18153         (TypeContainer.AsAccessible): Implemented and made non-static.
18154         (MemberBase.CheckParameters): Report errors if the accessibility
18155         checks fail.
18156
18157         * delegate.cs (Delegate.Delegate): The default visibility is
18158         internal for top-level types and private for nested types.
18159         (Delegate.Define): Report errors if the accessibility checks fail.
18160
18161         * enum.cs (Enum.Enum): The default visibility is internal for
18162         top-level types and private for nested types.
18163         (Enum.DefineType): Compute the correct visibility.
18164
18165         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
18166         function which takes a `bool is_toplevel' instead of a TypeContainer.
18167
18168         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
18169         builtin type.
18170
18171 2002-08-02  Martin Baulig  <martin@gnome.org>
18172
18173         * expression.cs (LocalVariableReferenc): Added constructor which
18174         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
18175         (LocalVariableReference.IsReadOnly): New property.
18176         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
18177         variable is readonly, use our own readonly flag to do this; you can
18178         use the new constructor to get a writable reference to a read-only
18179         variable.
18180
18181         * cs-parser.jay (foreach_statement, using_statement): Get a writable
18182         reference to the local variable.
18183
18184 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
18185
18186         * rootcontext.cs (ResolveCore): Also include System.Exception
18187
18188         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
18189         we reach an EmptyStatement.
18190
18191         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
18192         is also fine.
18193
18194         * expression.cs (Binary.ResolveOperator): Check error result in
18195         two places.
18196
18197         use brtrue/brfalse directly and avoid compares to null.
18198
18199 2002-08-02  Martin Baulig  <martin@gnome.org>
18200
18201         * class.cs (TypeContainer.Define): Define all nested interfaces here.
18202         Fixes bug #28407, added test-155.cs.
18203
18204 2002-08-01  Martin Baulig  <martin@gnome.org>
18205
18206         * class.cs (Event.EmitDefaultMethod): Make this work with static
18207         events.  Fixes #28311, added verify-3.cs.
18208
18209 2002-08-01  Martin Baulig  <martin@gnome.org>
18210
18211         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
18212         `is_disposable' fields.
18213         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
18214         `hm.is_disposable' if we're using the collection pattern.
18215         (Foreach.EmitCollectionForeach): Use the correct type for the
18216         enumerator's local variable, only emit the try/finally block if
18217         necessary (fixes #27713).
18218
18219 2002-08-01  Martin Baulig  <martin@gnome.org>
18220
18221         * ecore.cs (Expression.report118): Renamed to Error118 and made
18222         it public static.
18223
18224         * statement.cs (Throw.Resolve): Check whether the expression is of
18225         the correct type (CS0118) and whether the type derives from
18226         System.Exception (CS0155).
18227         (Catch.Resolve): New method.  Do the type lookup here and check
18228         whether it derives from System.Exception (CS0155).
18229         (Catch.CatchType, Catch.IsGeneral): New public properties.
18230
18231         * typemanager.cs (TypeManager.exception_type): Added.
18232
18233 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
18234
18235         * driver.cs: Updated About function.
18236
18237 2002-07-31  Martin Baulig  <martin@gnome.org>
18238
18239         Implemented Control Flow Analysis.
18240
18241         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
18242         (EmitContext.CurrentBranching): Added.
18243         (EmitContext.StartFlowBranching): Added.
18244         (EmitContext.EndFlowBranching): Added.
18245         (EmitContext.KillFlowBranching): Added.
18246         (EmitContext.IsVariableAssigned): Added.
18247         (EmitContext.SetVariableAssigned): Added.
18248         (EmitContext.IsParameterAssigned): Added.
18249         (EmitContext.SetParameterAssigned): Added.
18250         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
18251         Added control flow analysis stuff here.
18252
18253         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
18254         resolve the expression as lvalue.
18255         (LocalVariableReference.DoResolve): Check whether the variable has
18256         already been assigned.
18257         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
18258         the parameter as assigned here.
18259         (ParameterReference.DoResolve): Check whether the parameter has already
18260         been assigned.
18261         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
18262         expression as lvalue.
18263
18264         * statement.cs (FlowBranching): New class for the flow analysis code.
18265         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
18266         (LabeledStatement.IsDefined): New public property.
18267         (LabeledStatement.AddUsageVector): New public method to tell flow
18268         analyis that the label may be reached via a forward jump.
18269         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
18270         flow analysis.
18271         (VariableInfo.Number): New public field.  This is used by flow analysis
18272         to number all locals of a block.
18273         (Block.CountVariables): New public property.  This is the number of
18274         local variables in this block (including the locals from all parent
18275         blocks).
18276         (Block.EmitMeta): Number all the variables.
18277
18278         * statement.cs: Added flow analysis support to all classes.
18279
18280 2002-07-31  Martin Baulig  <martin@gnome.org>
18281
18282         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
18283         To get debugging messages, compile mcs with /define:MCS_DEBUG and
18284         then use this argument.
18285
18286         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
18287
18288         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
18289         use this to specify /define options.
18290
18291 2002-07-29  Martin Baulig  <martin@gnome.org>
18292
18293         * statement.cs (Fixed): Moved all code that does variable lookups
18294         and resolvings from Emit to Resolve.
18295
18296         * statement.cs (For): Moved all code that does variable lookups
18297         and resolvings from Emit to Resolve.
18298
18299         * statement.cs (Using): Moved all code that does variable lookups
18300         and resolvings from Emit to Resolve.
18301
18302 2002-07-29  Martin Baulig  <martin@gnome.org>
18303
18304         * attribute.cs (Attribute.Resolve): Explicitly catch a
18305         System.NullReferenceException when creating the
18306         CustromAttributeBuilder and report a different warning message.
18307
18308 2002-07-29  Martin Baulig  <martin@gnome.org>
18309
18310         * support.cs (ParameterData.ParameterName): Added method to
18311         get the name of a parameter.
18312
18313         * typemanager.cs (TypeManager.IsValueType): New public method.
18314
18315 2002-07-29  Martin Baulig  <martin@gnome.org>
18316
18317         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
18318         is a flag which specifies that it's either ref or out.
18319         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
18320         the out parameter to `out Parameter.Modifier mod', also set the
18321         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
18322
18323         * support.cs (InternalParameters.ParameterModifier): Distinguish
18324         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18325         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18326
18327         * expression.cs (Argument.GetParameterModifier): Distinguish
18328         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
18329         Parameter.Modifier.ISBYREF flag if it's either ref or out.
18330
18331 2002-07-29  Martin Baulig  <martin@gnome.org>
18332
18333         * expression.cs (ParameterReference.ParameterReference): Added
18334         `Location loc' argument to the constructor.
18335
18336         * cs-parser.jay: Pass location to ParameterReference.
18337
18338 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
18339
18340         * statement.cs (Try): Initialize the location.
18341
18342         * cs-parser.jay: pass location to Try.
18343
18344         * expression.cs (Unary.Reduce): Change the prototype to return
18345         whether a constant fold could be performed or not.  The result is
18346         returned in an out parameters.  In the case of Indirection and
18347         AddressOf, we want to perform the full tests.
18348
18349 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
18350
18351         * statement.cs (Statement.Emit): Flag dead code.
18352
18353 2002-07-27  Andrew Birkett  <andy@nobugs.org>
18354
18355         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
18356
18357 2002-07-27  Martin Baulig  <martin@gnome.org>
18358
18359         * class.cs (MethodData.Define): Put back call to
18360         TypeManager.AddMethod(), accidentally commented this out.
18361
18362         * report.cs (Debug): New public method to print debugging information,
18363         this is `[Conditional ("DEBUG")]'.
18364
18365 2002-07-26  Martin Baulig  <martin@gnome.org>
18366
18367         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
18368         (switch_statement): Push the current_block to the switch_stack and
18369         pop it again when we're done with the switch.
18370         (switch_section): The new block is a child of the current_block.
18371         Fixes bug #24007, added test-152.cs.
18372
18373 2002-07-27  Martin Baulig  <martin@gnome.org>
18374
18375         * expression.cs (Invocation.EmitArguments): When calling a varargs
18376         function with only its fixed arguments, we need to pass an empty
18377         array.
18378
18379 2002-07-27  Martin Baulig  <martin@gnome.org>
18380
18381         Mono 0.13 has been released.
18382
18383 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
18384
18385         * driver.cs: Rename --resource to --linkres, because that is what
18386         we do currently, we dont support --resource yet.
18387
18388         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
18389
18390 2002-07-25  Martin Baulig  <martin@gnome.org>
18391
18392         * class.cs (MethodData): New public class.  This is a `method builder'
18393         class for a method or one accessor of a Property/Indexer/Event.
18394         (MethodData.GetMethodFlags): Moved here from MemberBase.
18395         (MethodData.ApplyAttributes): Likewise.
18396         (MethodData.ApplyObsoleteAttribute): Likewise.
18397         (MethodData.ApplyConditionalAttribute): Likewise.
18398         (MethodData.ApplyDllImportAttribute): Likewise.
18399         (MethodData.CheckAbstractAndExternal): Likewise.
18400         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
18401         (MethodData.Emit): Formerly known as Method.Emit().
18402         (MemberBase): Moved everything which was specific to a single
18403         accessor/method to MethodData.
18404         (Method): Create a new MethodData and call Define() and Emit() on it.
18405         (Property, Indexer, Event): Create a new MethodData objects for each
18406         accessor and call Define() and Emit() on them.
18407
18408 2002-07-25  Martin Baulig  <martin@gnome.org>
18409
18410         Made MethodCore derive from MemberBase to reuse the code from there.
18411         MemberBase now also checks for attributes.
18412
18413         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
18414         (MemberBase.GetMethodFlags): Moved here from class Method and marked
18415         as virtual.
18416         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
18417         `CallingConventions cc' and `Attributes opt_attrs' arguments.
18418         (MemberBase.ApplyAttributes): New virtual method; applies the
18419         attributes to a method or accessor.
18420         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
18421         (MemberBase.ApplyConditionalAttribute): Likewise.
18422         (MemberBase.ApplyDllImportAttribute): Likewise.
18423         (MemberBase.CheckAbstractAndExternal): Likewise.
18424         (MethodCore.ParameterTypes): This is now a property instead of a
18425         method, it's initialized from DoDefineParameters().
18426         (MethodCore.ParameterInfo): Removed the set accessor.
18427         (MethodCore.DoDefineParameters): New protected virtual method to
18428         initialize ParameterTypes and ParameterInfo.
18429         (Method.GetReturnType): We can now simply return the MemberType.
18430         (Method.GetMethodFlags): Override the MemberBase version and add
18431         the conditional flags.
18432         (Method.CheckBase): Moved some code from Define() here, call
18433         DoDefineParameters() here.
18434         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
18435         here to avoid some larger code duplication.
18436         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
18437         ensure that abstract and external accessors don't declare a body.
18438
18439         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
18440         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
18441         lookup in the attribute's parent classes, so we need to abort as soon
18442         as we found the first match.
18443         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
18444         the attribute has no arguments.
18445
18446         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
18447         of a Method.
18448
18449 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18450
18451         * cs-parser.jay: reverted previous patch.
18452
18453 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18454
18455         * cs-parser.jay: fixed bug #22119.
18456
18457 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18458
18459         * attribute.cs: fixed compilation. The error was:
18460         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
18461         be assigned to before control leaves the current method."
18462         [FIXME:  Filed as bug #28186: MCS must report this error.]
18463
18464 2002-07-25  Martin Baulig  <martin@gnome.org>
18465
18466         * attribute.cs (Attribute.Conditional_GetConditionName): New static
18467         method to pull the condition name ouf of a Conditional attribute.
18468         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
18469         the obsolete message and error flag out of an Obsolete attribute.
18470
18471         * class.cs (Method.GetMethodFlags): New public method to get the
18472         TypeManager.MethodFlags for this method.
18473         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
18474         private methods.
18475         (Method.Define): Get and apply the Obsolete and Conditional attributes;
18476         if we're overriding a virtual function, set the new private variable
18477         `parent_method'; call the new TypeManager.AddMethod().
18478
18479         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
18480         the MethodBuilder and the Method in a PtrHashtable.
18481         (TypeManager.builder_to_method): Added for this purpose.
18482         (TypeManager.MethodFlags): Added IsObsoleteError.
18483         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
18484         Obsolete and Conditional arguments in MethodBuilders.  If we discover
18485         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
18486         the message from the attribute.
18487
18488 2002-07-24  Martin Baulig  <martin@gnome.org>
18489
18490         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
18491         preprocessor directives, ensure that the argument to #define/#undef is
18492         exactly one identifier and that it's actually an identifier.
18493
18494         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
18495         did not work ....
18496
18497 2002-07-24  Martin Baulig  <martin@gnome.org>
18498
18499         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
18500         initialize it to TypeManager.object_type in the constructor.
18501         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
18502         of the `hm.get_current' method if we're using the collection pattern.
18503         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
18504         for the explicit conversion to make it work when we're using the collection
18505         pattern and the `Current' property has a different return type than `object'.
18506         Fixes #27713.
18507
18508 2002-07-24  Martin Baulig  <martin@gnome.org>
18509
18510         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
18511         does not match, but don't report any errors.  This method is called in
18512         order for all methods in a MethodGroupExpr until a matching method is
18513         found, so we don't want to bail out if the first method doesn't match.
18514         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
18515         matches, report the 123.  Fixes #28070.
18516
18517 2002-07-24  Martin Baulig  <martin@gnome.org>
18518
18519         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
18520         TypeManager.TypeToCoreType() to the top of the method so the
18521         following equality checks will work.  Fixes #28107.
18522
18523 2002-07-24  Martin Baulig  <martin@gnome.org>
18524
18525         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
18526         operand is of type uint, and the other operand is of type sbyte,
18527         short or int, the operands are converted to type long." -
18528         Actually do what this comment already told us.  Fixes bug #28106,
18529         added test-150.cs.
18530
18531 2002-07-24  Martin Baulig  <martin@gnome.org>
18532
18533         * class.cs (MethodBase): New abstract class.  This is now a base
18534         class for Property, Indexer and Event to avoid some code duplication
18535         in their Define() and DefineMethods() methods.
18536         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
18537         generic methods for Define() and DefineMethods().
18538         (FieldBase): Derive from MemberBase, not MemberCore.
18539         (Property): Derive from MemberBase, not MemberCore.
18540         (Property.DefineMethod): Moved all the code from this method to the
18541         new MethodBase.DefineAccessor(), just call it with appropriate
18542         argumetnts.
18543         (Property.Define): Call the new Property.DoDefine(), this does some
18544         sanity checks and we don't need to duplicate the code everywhere.
18545         (Event): Derive from MemberBase, not MemberCore.
18546         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
18547         accessors, this will also make them work with interface events.
18548         (Indexer): Derive from MemberBase, not MemberCore.
18549         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
18550         (Indexer.Define): Use the new MethodBase functions.
18551
18552         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
18553         argument to the constructor.
18554         (Interface.FindMembers): Added support for interface events.
18555         (Interface.PopluateEvent): Implemented.
18556
18557         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
18558
18559 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
18560
18561         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
18562         but this is required to check for a method name being the same as
18563         the containing class.  
18564
18565         Handle this now.
18566
18567 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18568
18569         * interface.cs: initialize variable.
18570
18571 2002-07-23  Martin Baulig  <martin@gnome.org>
18572
18573         Implemented the IndexerName attribute in interfaces.
18574
18575         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
18576         name if this is an explicit interface implementation.
18577         (Indexer.InterfaceIndexerName): New public variable.  If we're
18578         implementing an interface indexer, this is the IndexerName in that
18579         interface.  Otherwise, it's the IndexerName.
18580         (Indexer.DefineMethod): If we're implementing interface indexer,
18581         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
18582         and Pending.ImplementIndexer methods.
18583         (Indexer.Define): Also define the PropertyBuilder if we're
18584         implementing an interface indexer and this is neither an explicit
18585         interface implementation nor do the IndexerName match the one in
18586         the interface.
18587
18588         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
18589         If a method is defined here, then we always need to create a proxy
18590         for it.  This is used when implementing interface indexers.
18591         (Pending.IsInterfaceIndexer): New public method.
18592         (Pending.ImplementIndexer): New public method.
18593         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
18594         This is used when implementing interface indexers to define a proxy
18595         if necessary.
18596         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
18597         define a proxy if necessary.
18598
18599         * interface.cs (Interface.IndexerName): New public variable.
18600         (Interface.PopulateIndexer): Set the IndexerName.
18601         (Interface.DefineIndexers): New private method.  Populate all the
18602         indexers and make sure their IndexerNames match.
18603
18604         * typemanager.cs (IndexerPropertyName): Added support for interface
18605         indexers.
18606
18607 2002-07-22  Martin Baulig  <martin@gnome.org>
18608
18609         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
18610         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
18611         ret if HasReturnLabel.
18612         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
18613         variables.
18614
18615         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
18616         and set the ec.LoopBeginTryCatchLevel.
18617         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
18618         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
18619         the current ec.TryCatchLevel, the branch goes out of an exception
18620         block.  In this case, we need to use Leave and not Br.
18621
18622 2002-07-22  Martin Baulig  <martin@gnome.org>
18623
18624         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
18625         block unless the block does not always return or it is contained in
18626         another try { ... } catch { ... } block.  Fixes bug #26506.
18627         Added verify-1.cs to the test suite.
18628
18629 2002-07-22  Martin Baulig  <martin@gnome.org>
18630
18631         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
18632         then we do not always return.  Fixes bug #24985.
18633
18634 2002-07-22  Martin Baulig  <martin@gnome.org>
18635
18636         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
18637         lookup on a per-class level; ie. walk up the class hierarchy until we
18638         found at least one applicable method, then choose the best among them.
18639         Fixes bug #24463 and test-29.cs.
18640
18641 2002-07-22  Martin Baulig  <martin@gnome.org>
18642
18643         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
18644         return types of the methods.  The return type is not part of the
18645         signature and we must not check it to make the `new' modifier work.
18646         Fixes bug #27999, also added test-147.cs.
18647         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
18648
18649         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
18650         on the method's return type.
18651
18652 2002-07-21  Martin Baulig  <martin@gnome.org>
18653
18654         * assign.cs: Make this work if the rightmost source is a constant and
18655         we need to do an implicit type conversion.  Also adding a few more tests
18656         to test-38.cs which should have caught this.
18657
18658         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
18659         target in the makefile for this.  The makefile.gnu is primarily intended
18660         for end-users who don't want to debug the compiler.
18661
18662 2002-07-21  Martin Baulig  <martin@gnome.org>
18663
18664         * assign.cs: Improved the Assign class so it can now handle embedded
18665         assignments (X = Y = Z = something).  As a side-effect this'll now also
18666         consume less local variables.  test-38.cs now passes with MCS, added
18667         a few new test cases to that test.
18668
18669 2002-07-20  Martin Baulig  <martin@gnome.org>
18670
18671         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
18672         instructions.  Fixes bug #27977, also added test-146.cs.
18673
18674 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18675
18676         * cs-tokenizer.cs: fixed getHex ().
18677
18678 2002-07-19  Martin Baulig  <martin@gnome.org>
18679
18680         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
18681         not Type.GetType() to lookup the array type.  This is needed when
18682         we're constructing an array of a user-defined type.
18683         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
18684         single-dimensional arrays, but also for single-dimensial arrays of
18685         type decimal.
18686
18687 2002-07-19  Martin Baulig  <martin@gnome.org>
18688
18689         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
18690         this function is called, it's not allowed to share LocalBuilders
18691         among ILGenerators.
18692
18693 2002-07-19  Martin Baulig  <martin@gnome.org>
18694
18695         * expression.cs (Argument.Resolve): Report an error 118 when trying
18696         to pass a type as argument.
18697
18698 2002-07-18  Martin Baulig  <martin@gnome.org>
18699
18700         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
18701         Conv_R_Un for the signed `long' type.
18702
18703 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
18704
18705         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
18706         `expr' for the temporary result, as that will fail if we do
18707         multiple resolves on the same expression.
18708
18709 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
18710
18711         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
18712         ec.TypeContainer for looking up aliases. 
18713
18714         * class.cs (TypeContainer): Remove LookupAlias from here.
18715
18716         * decl.cs (DeclSpace); Move here.
18717
18718 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
18719
18720         * class.cs (FindMembers): Only call filter if the constructor
18721         bulider is not null.
18722
18723         Also handle delegates in `NestedTypes' now.  Now we will perform
18724         type lookups using the standard resolution process.  This also
18725         fixes a bug.
18726
18727         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
18728         This uses Expressions (the limited kind that can be parsed by the
18729         tree) instead of strings.
18730
18731         * expression.cs (ComposedCast.ToString): Implement, used to flag
18732         errors since now we have to render expressions.
18733
18734         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
18735         FormArrayType. 
18736
18737         * ecore.cs (SimpleName.ToString): ditto.
18738
18739         * cs-parser.jay: Instead of using strings to assemble types, use
18740         Expressions to assemble the type (using SimpleName, ComposedCast,
18741         MemberAccess).  This should fix the type lookups in declarations,
18742         because we were using a different code path for this.
18743
18744         * statement.cs (Block.Resolve): Continue processing statements
18745         even when there is an error.
18746
18747 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
18748
18749         * class.cs (Event.Define): Also remove the `remove' method from
18750         the list of pending items.
18751
18752         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
18753         generate more compact code. 
18754
18755 2002-07-17  Martin Baulig  <martin@gnome.org>
18756
18757         * const.cs (Const.LookupConstantValue): Add support for constant
18758         `unchecked' and `checked' expressions.
18759         Also adding test case test-140.cs for this.
18760
18761 2002-07-17  Martin Baulig  <martin@gnome.org>
18762
18763         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
18764         check whether mi.ReturnType implements the IEnumerator interface; the
18765         `==' and the IsAssignableFrom() will fail in this situation.
18766
18767 2002-07-16  Ravi Pratap  <ravi@ximian.com>
18768
18769         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
18770         here too.
18771
18772 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
18773
18774         * expression.cs: fixed bug #27811.
18775
18776 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
18777
18778         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
18779         Molaro: when we are a ref, the value already contains a pointer
18780         value, do not take the address of it.
18781
18782 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
18783         * removed mb-parser.jay and mb-tokenizer.cs
18784
18785 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
18786
18787         * expression.cs: check against the building corlib void type.
18788
18789 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
18790
18791         * ecore.cs: fix for valuetype static readonly fields: when 
18792         initializing them, we need their address, not the address of a copy.
18793
18794 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
18795
18796         * typemanager.cs: register also enum_type in corlib.
18797
18798 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
18799
18800         * class.cs: allow calling this (but not base) initializers in structs.
18801
18802 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
18803
18804         * ecore.cs: make sure we compare against the building base types
18805         in GetTypeSize ().
18806
18807 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
18808
18809         * typemanager.cs: fix TypeToCoreType() to handle void and object
18810         (corlib gets no more typerefs after this change).
18811
18812 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
18813
18814         * expression.cs (ArrayCreation.EmitArrayArguments): use
18815         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
18816
18817         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
18818         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
18819         array indexes, the runtime actually forbids them.
18820
18821         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
18822         for array arguments here.
18823
18824         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
18825         instead of the default for ValueTypes.
18826
18827         (New.DoEmit): Use IsValueType instead of
18828         IsSubclassOf (value_type)
18829         (New.DoResolve): ditto.
18830         (Invocation.EmitCall): ditto.
18831
18832         * assign.cs (Assign): ditto.
18833
18834         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
18835         Statements *are* currently doing part of their resolution during
18836         Emit.  
18837
18838         Expressions do always resolve during resolve, but statements are
18839         only required to propagate resolution to their children.
18840
18841 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
18842
18843         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
18844
18845         (LoadAssembly): Do not add the dll if it is already specified
18846
18847         (MainDriver): Add the System directory to the link path at the end,
18848         after all the other -L arguments. 
18849
18850         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
18851         wrong opcode for loading bytes and bools (ldelem.i1 instead of
18852         ldelem.u1) and using the opposite for sbytes.
18853
18854         This fixes Digger, and we can finally run it.
18855
18856         * driver.cs (UnixParseOption): Move the option parsing here.  
18857         (CSCParseOption): Implement CSC-like parsing of options.
18858
18859         We now support both modes of operation, the old Unix way, and the
18860         new CSC-like way.  This should help those who wanted to make cross
18861         platform makefiles.
18862
18863         The only thing broken is that /r:, /reference: and /lib: are not
18864         implemented, because I want to make those have the same semantics
18865         as the CSC compiler has, and kill once and for all the confussion
18866         around this.   Will be doing this tomorrow.
18867
18868         * statement.cs (Unsafe.Resolve): The state is checked during
18869         resolve, not emit, so we have to set the flags for IsUnsfe here.
18870
18871 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18872
18873         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
18874         not catch the Error_ObjectRefRequired in SimpleName (as it is
18875         possible to have a class/instance variable name that later gets
18876         deambiguated), we have to check this here.      
18877
18878 2002-07-10  Ravi Pratap  <ravi@ximian.com>
18879
18880         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
18881         make static and put into Expression.
18882
18883         (Event.Define): Register the private field of the event with the 
18884         TypeManager so that GetFieldFromEvent can get at it.
18885
18886         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
18887         keep track of the private field associated with an event which
18888         has no accessors.
18889
18890         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
18891         private field.
18892
18893         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
18894
18895 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
18896
18897         * expression.cs (Binary.EmitBranchable): this routine emits the
18898         Binary expression in a branchable context.  This basically means:
18899         we need to branch somewhere, not just get the value on the stack.
18900
18901         This works together with Statement.EmitBoolExpression.
18902
18903         * statement.cs (Statement.EmitBoolExpression): Use
18904         EmitBranchable. 
18905
18906 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
18907
18908         * statement.cs (For): Reduce the number of jumps in loops.
18909
18910         (For): Implement loop inversion for the For statement.
18911
18912         (Break): We can be breaking out of a Try/Catch controlled section
18913         (foreach might have an implicit try/catch clause), so we need to
18914         use Leave instead of Br.
18915
18916         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
18917         now).  If the instace expression supports IMemoryLocation, we use
18918         the AddressOf method from the IMemoryLocation to extract the
18919         address instead of emitting the instance.
18920
18921         This showed up with `This', as we were emitting the instance
18922         always (Emit) instead of the Address of This.  Particularly
18923         interesting when This is a value type, as we dont want the Emit
18924         effect (which was to load the object).
18925
18926 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
18927
18928         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
18929
18930         * statement.cs (Checked): Set the CheckedState during the resolve
18931         process too, as the ConvCast operations track the checked state on
18932         the resolve process, and not emit.
18933
18934         * cs-parser.jay (namespace_member_declaration): Flag that we have
18935         found a declaration when we do.  This is used to flag error 1529
18936
18937         * driver.cs: Report ok when we display the help only.
18938
18939 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
18940
18941         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
18942
18943 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
18944
18945         * cs-tokenizer.cs (define): We also have to track locally the
18946         defines.  AllDefines is just used for the Conditional Attribute,
18947         but we also need the local defines for the current source code. 
18948
18949 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
18950
18951         * statement.cs (While, For, Do): These loops can exit through a
18952         Break statement, use this information to tell whether the
18953         statement is the last piece of code.
18954
18955         (Break): Flag that we break.
18956
18957         * codegen.cs (EmitContexts): New `Breaks' state variable.
18958
18959 2002-07-03  Martin Baulig  <martin@gnome.org>
18960
18961         * class.cs (TypeContainer.MethodModifiersValid): Allow override
18962         modifiers in method declarations in structs.  Otherwise, you won't
18963         be able to override things like Object.Equals().
18964
18965 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18966
18967         * class.cs (Method, Property, Indexer): Do not allow the public
18968         modifier to be used in explicit interface implementations.
18969
18970         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
18971         override modifiers in method declarations in structs
18972
18973 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
18974
18975         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
18976         integer or real overflow, report an error
18977
18978 2002-07-02  Martin Baulig  <martin@gnome.org>
18979
18980         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
18981         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
18982         to tell the runtime about our newly created System.Object and
18983         System.ValueType types.
18984
18985 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
18986
18987         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
18988         struct instead of Ldarg/Starg.
18989
18990 2002-07-02  Martin Baulig  <martin@gnome.org>
18991
18992         * expression.cs (Indirection.Indirection): Call
18993         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
18994
18995 2002-07-02  Martin Baulig  <martin@gnome.org>
18996
18997         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
18998         ValueType, call TypeManager.TypeToCoreType() on it.
18999         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
19000         the OpCodes.Newarr argument.
19001
19002 2002-07-02  Martin Baulig  <martin@gnome.org>
19003
19004         * expression.cs (Invocation.EmitCall): When compiling corlib,
19005         replace all calls to the system's System.Array type to calls to
19006         the newly created one.
19007
19008         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
19009         System.Array methods.
19010         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
19011         from the system's System.Array type which must be replaced.
19012
19013 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
19014
19015         * typemanager.cs: load unverifiable_code_ctor so we can build
19016         corlib using the correct type. Avoid using GetTypeCode() with
19017         TypeBuilders.
19018         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
19019         TypeManager.object_type to allow building corlib.
19020
19021 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
19022
19023         * ecore.cs: handle System.Enum separately in LoadFromPtr().
19024
19025 2002-07-01  Martin Baulig  <martin@gnome.org>
19026
19027         * class.cs: Make the last change actually work, we need to check
19028         whether `ifaces != null' to avoid a crash.
19029
19030 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
19031
19032         * class.cs: when we build structs without fields that implement
19033         interfaces, we need to add the interfaces separately, since there is
19034         no API to both set the size and add the interfaces at type creation
19035         time.
19036
19037 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
19038
19039         * expression.cs: the dimension arguments to the array constructors
19040         need to be converted if they are a long.
19041
19042 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
19043
19044         * class.cs: don't emit ldarg.0 if there is no parent constructor
19045         (fixes showstopper for corlib).
19046
19047 2002-06-29  Martin Baulig  <martin@gnome.org>
19048
19049         MCS now compiles corlib on GNU/Linux :-)
19050
19051         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
19052         ie. check for MethodImplOptions.InternalCall.
19053
19054         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
19055         and TypeManager.attribute_type are null, so we must explicitly check
19056         whether parent is not null to find out whether it's an attribute type.
19057         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
19058         and SetBuilder, not only if the property is neither abstract nor external.
19059         This is necessary to set the MethodImplOptions on the accessor methods.
19060         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
19061         SetBuilder, see Property.Emit().
19062
19063         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
19064         populate "System.Object", "System.ValueType" and "System.Attribute" since
19065         they've already been populated from BootCorlib_PopulateCoreTypes().
19066
19067 2002-06-29  Martin Baulig  <martin@gnome.org>
19068
19069         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
19070         is the NullLiteral, we also need to make sure that target_type is not
19071         an enum type.   
19072
19073 2002-06-29  Martin Baulig  <martin@gnome.org>
19074
19075         * rootcontext.cs (RootContext.ResolveCore): We must initialize
19076         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
19077         before calling BootstrapCorlib_ResolveDelegate ().
19078
19079 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
19080
19081         * statement.cs: fixed build-breaker. All tests passed ok.
19082
19083 2002-06-27  Martin Baulig  <martin@gnome.org>
19084
19085         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
19086         for System.Decimal when compiling corlib.
19087
19088 2002-06-27  Martin Baulig  <martin@gnome.org>
19089
19090         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
19091         switch blocks which contain nothing but a default clause.
19092
19093 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
19094
19095        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
19096
19097 2002-06-27  Martin Baulig  <martin@gnome.org>
19098
19099         * ecore.cs (PropertyExpr.PropertyExpr): Call
19100         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
19101
19102         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
19103         is already a TypeBuilder.
19104
19105 2002-06-27  Martin Baulig  <martin@gnome.org>
19106
19107         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
19108         `target_type == TypeManager.array_type', not IsAssignableFrom() in
19109         the "from an array-type to System.Array" case.  This makes it work
19110         when compiling corlib.
19111
19112 2002-06-27  Martin Baulig  <martin@gnome.org>
19113
19114         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
19115         non-static PropertyExpr, set its InstanceExpression.  This makes
19116         the `ICollection.Count' property work in System/Array.cs.
19117
19118 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
19119
19120         * driver.cs: Made error handling more consistent.  Errors now
19121         tracked by Report class, so many methods which used to return int
19122         now return void.  Main() now prints success/failure and 
19123         errors/warnings message.
19124
19125         Renamed '--probe' compiler argument to '--expect-error'.  Removed
19126         the magic number return values (123 and 124).  Now, if the
19127         expected error occurs, the compiler exits with success (exit value
19128         0).  If the compilation completes without seeing that particular
19129         error, the compiler exits with failure (exit value 1).  The
19130         makefile in mcs/errors has been changed to handle the new behaviour.
19131
19132         * report.cs: Made 'expected error' number a property and renamed
19133         it from 'Probe' to 'ExpectedError'.
19134
19135         * genericparser.cs: Removed error handling support, since it is
19136         now all done by Report class.
19137
19138         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
19139         class, so parse() no longer returns an int.
19140
19141         * namespace.cs: Use Report.Error instead of GenericParser.error
19142
19143 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
19144
19145         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
19146         TypeContainer.AddOperator): At the front of the list put the
19147         explicit implementations, so they get resolved/defined first. 
19148
19149 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
19150
19151         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
19152         interface type is implemented by this TypeContainer.  Used during
19153         explicit interface implementation.
19154
19155         (Property.Define, Indexer.Define, Method.Define): Validate that
19156         the given interface in the explicit implementation is one of the
19157         base classes for the containing type.
19158
19159         Also if we are explicitly implementing an interface, but there is
19160         no match in the pending implementation table, report an error.
19161
19162         (Property.Define): Only define the property if we are
19163         not explicitly implementing a property from an interface.  Use the
19164         correct name also for those properties (the same CSC uses,
19165         although that is really not needed).
19166
19167         (Property.Emit): Do not emit attributes for explicitly implemented
19168         properties, as there is no TypeBuilder.
19169
19170         (Indexer.Emit): ditto.
19171
19172         Hiding then means that we do not really *implement* a pending
19173         implementation, which makes code fail.
19174
19175 2002-06-22  Martin Baulig  <martin@gnome.org>
19176
19177         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
19178         the return value of Object.GetType().  [FIXME: we need to do this whenever
19179         we get a type back from the reflection library].
19180
19181 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
19182
19183         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
19184
19185 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
19186
19187         * attribute.cs: Return null if we can not look up the type.
19188
19189         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
19190         the interface types found.
19191
19192         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
19193         interface types found.
19194
19195         * typemanager.cs (GetInterfaces): Make this routine returns alll
19196         the interfaces and work around the lame differences between
19197         System.Type and System.Reflection.Emit.TypeBuilder in the results
19198         result for GetInterfaces.
19199
19200         (ExpandInterfaces): Given an array of interface types, expand and
19201         eliminate repeated ocurrences of an interface.  This expands in
19202         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
19203         be IA, IB, IC.
19204
19205 2002-06-21  Martin Baulig  <martin@gnome.org>
19206
19207         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
19208         on System.Enum.
19209
19210 2002-06-21  Martin Baulig  <martin@gnome.org>
19211
19212         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
19213         and called with one of the core types, return the corresponding typebuilder for
19214         that type.
19215
19216         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
19217         element type.
19218
19219 2002-06-21  Martin Baulig  <martin@gnome.org>
19220
19221         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
19222         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
19223         (Expression.ConvertReferenceExplicit): Likewise.
19224
19225         * expression.cs (ElementAccess.DoResolve): Likewise.
19226         (ElementAccess.DoResolveLValue): Likewise.
19227
19228 2002-06-10  Martin Baulig  <martin@gnome.org>
19229
19230         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
19231         add the "value" parameter to the parameter list.
19232
19233         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
19234         to our caller.
19235
19236 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
19237
19238         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
19239         the argument to an int, uint, long or ulong, per the spec.  Also
19240         catch negative constants in array creation.
19241
19242 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
19243
19244         * class.cs: do not allow the same interface to appear twice in
19245         the definition list.
19246
19247 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
19248
19249         * ecore.cs: don't use ldlen with System.Array.
19250
19251 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
19252
19253         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
19254
19255 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
19256
19257         * modifiers.cs: produce correct field attributes for protected
19258         internal. Easy fix so miguel can work on ther harder stuff:-)
19259
19260 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
19261
19262         * pending.cs: New file.  Move the code from class.cs here.
19263         Support clearning the pending flag for all methods (when not doing
19264         explicit interface implementation).
19265
19266 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
19267
19268         * rootcontext.cs: added a couple more types needed to bootstrap.
19269
19270 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
19271
19272         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
19273         constructor in the type, instead of any constructor in the type
19274         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
19275         a bug in the Mono runtime when applying the params attribute). 
19276
19277 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
19278         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
19279
19280 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
19281
19282         * expression.cs (Unary.ResolveOperator): Use TypeManager
19283         to resolve the type.
19284
19285 2002-06-13  Ravi Pratap  <ravi@ximian.com>
19286
19287         * cs-parser.jay (enum_member_declaration): Pass in the attributes
19288         attached.
19289
19290         * enum.cs (AddEnumMember): Add support to store the attributes associated 
19291         with each member too.
19292
19293         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
19294         field builders too - this takes care of the enum member case.
19295
19296 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
19297
19298         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
19299         address-of operator on both value types and pointers.
19300
19301 2002-06-10  Martin Baulig  <martin@gnome.org>
19302
19303         * interface.cs (Interface.PopulateIndexer): Add the indexer's
19304         PropertyBuilder to the `property_builders' list.
19305
19306         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
19307         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
19308         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
19309         find any indexers which are inherited from an interface.
19310
19311 2002-06-09  Martin Baulig  <martin@gnome.org>
19312
19313         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
19314         the same type as the constant if necessary.  There's also a test-130.cs
19315         for this.
19316
19317         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
19318
19319         * typemanager.cs (TypeManager.ChangeType): Previously known as
19320         Enum.ChangeEnumType().
19321
19322 2002-06-09  Martin Baulig  <martin@gnome.org>
19323
19324         * expression.cs (Cast.TryReduce): Added support for consts.
19325
19326 2002-06-08  Ravi Pratap  <ravi@ximian.com>
19327
19328         * class.cs (Accessor): Hold attributes information so we can pass
19329         it along.
19330
19331         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
19332         Modify to pass in attributes attached to the methods.
19333
19334         (add_accessor_declaration, remove_accessor_declaration): Ditto.
19335
19336         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
19337         to handle the Accessor kind :-)
19338
19339         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
19340
19341 2002-06-08  Martin Baulig  <martin@gnome.org>
19342
19343         * expression.cs (Unary.TryReduceNegative): Added support for
19344         ULongConstants.
19345
19346 2002-06-08  Martin Baulig  <martin@gnome.org>
19347
19348         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
19349         name can't be found in the `defined_names' - the caller will do a
19350         MemberLookup in this case and thus find methods in System.Enum
19351         such as Enum.IsDefined().
19352
19353 2002-06-08  Martin Baulig  <martin@gnome.org>
19354
19355         * enum.cs (Enum.ChangeEnumType): This is a custom version of
19356         Convert.ChangeType() which works with TypeBuilder created types.
19357         (Enum.LookupEnumValue, Enum.Define): Use it here.
19358
19359         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
19360         `TypeBuilder.BaseType != null' check.
19361         (TypeContainer.FindMembers): Only lookup parent members if we
19362         actually have a parent.
19363         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
19364         (ConstructorInitializer.Resolve): Likewise.
19365
19366         * interface.cs (Interface.FindMembers): Added
19367         `TypeBuilder.BaseType != null' check.
19368
19369         * rootcontext.cs (RootContext.ResolveCore): Added
19370         "System.Runtime.CompilerServices.IndexerNameAttribute" to
19371         classes_second_stage.
19372
19373         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
19374         debug_type and trace_type when compiling with --nostdlib.       
19375
19376 2002-06-07  Martin Baulig  <martin@gnome.org>
19377
19378         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
19379         (AddField): Set it to true when adding a non-static field.
19380         (DefineType): Use `have_nonstatic_fields' to find out whether we
19381         have non-static fields, not `Fields != null'.
19382
19383 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
19384
19385         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
19386         dereferencing a null on the static-field code path)
19387
19388 2002-05-30  Martin Baulig  <martin@gnome.org>
19389
19390         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
19391         to take command line arguments.  Use reflection to call the new
19392         custom `Initialize' function on the symbol writer and pass it the
19393         command line arguments.
19394
19395         * driver.cs (--debug-args): New command line argument to pass command
19396         line arguments to the symbol writer.
19397
19398 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
19399
19400         * assign.cs (DoResolve): Forgot to do the implicit conversion to
19401         the target type for indexers and properties.  Thanks to Joe for
19402         catching this.
19403
19404 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
19405
19406         * typemanager.cs (MethodFlags): returns the method flags
19407         (Obsolete/ShouldIgnore) that control warning emission and whether
19408         the invocation should be made, or ignored. 
19409
19410         * expression.cs (Invocation.Emit): Remove previous hack, we should
19411         not do this on matching a base type, we should do this based on an attribute
19412
19413         Only emit calls to System.Diagnostics.Debug and
19414         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
19415         on the command line.
19416
19417         * rootcontext.cs: Global settings for tracing and debugging.
19418
19419         * cs-tokenizer.cs (define): New utility function to track
19420         defines.   Set the global settings for TRACE and DEBUG if found.
19421
19422 2002-05-25  Ravi Pratap  <ravi@ximian.com>
19423
19424         * interface.cs (Populate*): Pass in the TypeContainer as well as
19425         the DeclSpace as parameters so that we can create EmitContexts and
19426         then use that to apply attributes etc.
19427
19428         (PopulateMethod, PopulateEvent, PopulateProperty)
19429         (PopulateIndexer): Apply attributes everywhere.
19430
19431         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
19432         etc.
19433
19434         (ApplyAttributes): Update accordingly.
19435
19436         We now apply interface attributes for all members too.
19437
19438 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
19439
19440         * class.cs (Indexer.Define); Correctly check if we are explicit
19441         implementation (instead of checking the Name for a ".", we
19442         directly look up if the InterfaceType was specified).
19443
19444         Delay the creation of the PropertyBuilder.
19445
19446         Only create the PropertyBuilder if we are not an explicit
19447         interface implementation.   This means that explicit interface
19448         implementation members do not participate in regular function
19449         lookups, and hence fixes another major ambiguity problem in
19450         overload resolution (that was the visible effect).
19451
19452         (DefineMethod): Return whether we are doing an interface
19453         implementation. 
19454
19455         * typemanager.cs: Temporary hack until we get attributes in
19456         interfaces (Ravi is working on that) and we get IndexerName
19457         support in interfaces.
19458
19459         * interface.cs: Register the indexers as properties.
19460
19461         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
19462         warning, I have verified that this is a bug in the .NET runtime
19463         (JavaScript suffers of the same problem).
19464
19465         * typemanager.cs (MemberLookup): When looking up members for
19466         interfaces, the parent of an interface is the implicit
19467         System.Object (so we succeed in searches of Object methods in an
19468         interface method invocation.  Example:  IEnumerable x;  x.ToString
19469         ()) 
19470
19471 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
19472
19473         * class.cs (Event): Events should also register if they do
19474         implement the methods that an interface requires.
19475
19476         * typemanager.cs (MemberLookup); use the new GetInterfaces
19477         method. 
19478
19479         (GetInterfaces): The code used to lookup interfaces for a type is
19480         used in more than one place, factor it here. 
19481
19482         * driver.cs: Track the errors at the bottom of the file, we kept
19483         on going.
19484
19485         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
19486         instance if the method we are calling is static!
19487
19488 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
19489
19490         * attribute.cs (ApplyAttributes): Make this function filter out
19491         the IndexerName attribute (as that attribute in reality is never
19492         applied) and return the string constant for the IndexerName
19493         attribute. 
19494
19495         * class.cs (TypeContainer.Emit): Validate that all the indexers
19496         have the same IndexerName attribute, and if so, set the
19497         DefaultName attribute on the class. 
19498
19499         * typemanager.cs: The return value might contain other stuff (not
19500         only methods).  For instance, consider a method with an "Item"
19501         property and an Item method.
19502
19503         * class.cs: If there is a problem with the parameter types,
19504         return. 
19505
19506 2002-05-24  Ravi Pratap  <ravi@ximian.com>
19507
19508         * ecore.cs (ImplicitConversionExists): Wrapper function which also
19509         looks at user defined conversion after making a call to 
19510         StandardConversionExists - we need this for overload resolution.
19511
19512         * expression.cs : Update accordingly the various method calls.
19513
19514         This fixes 2 bugs filed against implicit user defined conversions 
19515
19516 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
19517
19518         * statement.cs: Track the result of the assignment.
19519
19520 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
19521
19522         * expression.cs (MemberAccess): Improved error reporting for
19523         inaccessible members.
19524
19525 2002-05-22  Martin Baulig  <martin@gnome.org>
19526
19527         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
19528         itself with debugging support.
19529
19530 2002-05-22  Martin Baulig  <martin@gnome.org>
19531
19532         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
19533         Removed, this isn't needed anymore.
19534
19535 2002-05-20  Martin Baulig  <martin@gnome.org>
19536
19537         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
19538         be underlying type for an enum.
19539
19540 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
19541
19542         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
19543         that splits out the loading of just the core types.
19544
19545         * rootcontext.cs (ResolveCore): Split the struct resolution in
19546         two, so we can load the enumeration underlying types before any
19547         enums are used.
19548
19549         * expression.cs (Is): Bandaid until we fix properly Switch (see
19550         bug #24985 for details).
19551
19552         * typemanager.cs (ImplementsInterface): The hashtable will contain
19553         a null if there are no interfaces implemented.
19554
19555 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
19556
19557         * cs-parser.jay (indexer_declarator): It is fine to have array
19558         parameters
19559
19560 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19561
19562         * typemanager.cs: (RegisterBuilder): New function used to register
19563         TypeBuilders that implement interfaces.  Since
19564         TypeBuilder.GetInterfaces (as usual) does not work with lame
19565         Reflection.Emit. 
19566         (AddUserType): register interfaces.
19567
19568         (ImplementsInterface): Use the builder_to_ifaces hash if we are
19569         dealing with TypeBuilder.  Also, arrays are showing up as
19570         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
19571         methods can not be invoked on them!
19572
19573         * ecore.cs (ExplicitReferenceConversionExists): Made public.
19574         (ImplicitReferenceConversionExists): Split out from
19575         StandardConversionExists. 
19576
19577         * expression.cs (As): We were only implementing one of the three
19578         cases for the as operator.  We now implement them all.
19579         (Is): Implement the various other cases for Is as well.
19580
19581         * typemanager.cs (CACHE): New define used to control if we want or
19582         not the FindMembers cache.  Seems to have a negative impact on
19583         performance currently
19584
19585         (MemberLookup): Nested types have full acess to
19586         enclosing type members
19587
19588         Remove code that coped with instance/static returns for events, we
19589         now catch this in RealFindMembers.
19590
19591         (RealFindMembers): only perform static lookup if the instance
19592         lookup did not return a type or an event.  
19593
19594 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
19595
19596         * assign.cs (CompoundAssign): We pass more semantic information
19597         now to Compound Assignments than we did before: now we have all
19598         the information at hand, and now we resolve the target *before* we
19599         do the expression expansion, which allows the "CacheValue" method
19600         to have the effect we intended (before, a [x] += 1 would generate
19601         two differen ArrayAccess expressions from the ElementAccess,
19602         during the resolution process).
19603
19604         (CompoundAssign.DoResolve): Resolve target and original_source here.
19605
19606 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
19607
19608         * expression.cs (ArrayAccess): dropped debugging information. 
19609
19610         * typemanager.cs: Small bug fix: I was always returning i_members,
19611         instead of one of i_members or s_members (depending on which had
19612         the content).
19613
19614         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
19615         method is invoked before any code generation takes place, and it
19616         is a mechanism to inform that the expression will be invoked more
19617         than once, and that the method should use temporary values to
19618         avoid having side effects
19619
19620         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
19621
19622         * ecore.cs (Expression.CacheTemporaries): Provide empty default
19623         implementation.
19624
19625         * expression.cs (Indirection, ArrayAccess): Add support for
19626         CacheTemporaries in these two bad boys. 
19627
19628         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
19629         ldobj or ldind_ref.  
19630         (StoreFromPtr): Handle stobj as well.
19631
19632         * expression.cs (UnaryMutator): Share more code.
19633
19634         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
19635         down: I was not tracking the Filter function as well, which
19636         was affecting the results of the cache.
19637
19638 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
19639
19640         * attribute.cs: Remove the hack to handle the CharSet property on
19641         StructLayouts. 
19642
19643 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
19644
19645         * attribute.cs (DoResolve): More uglyness, we now only try to
19646         resolve the attribute partially, to extract the CharSet
19647         information (only if we are a StructLayout attribute).  Otherwise 
19648
19649         (GetExtraTypeInfo): Add some code to conditionally kill in the
19650         future this.   I am more and more convinced that the .NET
19651         framework has special code to handle the attribute setting on
19652         certain elements.
19653
19654         * expression.cs (IsParamsMethodApplicable): Revert my previous
19655         foreach change here, it was wrong.
19656
19657 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
19658
19659         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
19660         (pp_expr): do not abort on unknown input, just return.
19661         (eval): abort if there are pending chars.
19662
19663         * attribute.cs (Attribute.Resolve): Positional parameters are
19664         optional.  Deal with that case.
19665
19666         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
19667         the Ansi/Unicode/Auto information for the type.
19668
19669         (TypeContainer.DefineType): instantiate the EmitContext here, as
19670         we will be using it during the type definition (to resolve
19671         attributes) and during the emit phase.
19672
19673         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
19674         to pull type information out of the attributes
19675
19676         (Attribute.Resolve): track the constructor builder, and allow for
19677         multiple invocations (structs and classes will use this).
19678
19679         * ecore.cs (MemberLookupFinal): new version with all the
19680         parameters customizable.
19681
19682         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
19683         constructors.  Return if the result value is null (as the error
19684         would have been flagged already by MemberLookupFinal)
19685
19686         Do not allow instances of abstract classes or interfaces to be
19687         created.
19688
19689         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
19690         We have to compare the assembly property here when dealing with
19691         FamANDAssem and Assembly access modifiers, because we might be
19692         creating an assembly from *modules* (that means that we are not
19693         getting TypeBuilders for types defined in other modules that are
19694         part of this assembly).
19695
19696         (Method.Emit): If the method is marked abstract and has a body,
19697         emit an error. 
19698
19699         (TypeContainer.DefineMembers): If both the defined member and the
19700         parent name match are methods, then do not emit any warnings: let
19701         the Method.Define routine take care of flagging warnings.  But if
19702         there is a mismatch (method overrides something else, or method is
19703         overriwritten by something, then emit warning).
19704
19705         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
19706         set to null, this means `do not check for the return type on the
19707         signature'. 
19708
19709         (Method.Define): set the return type for the method signature to
19710         null, so that we get methods with the same name and parameters and
19711         different return types.  This is used to flag warning 114 (you are
19712         hiding a method, and you probably want to use the new/override
19713         keywords instead).
19714
19715         * typemanager.cs (MemberLookup): Implemented proper access
19716         control, closing a long standing set of bug reports.  The problem
19717         was that the Framework only has two bits: Public and NonPublic,
19718         and NonPublic includes private and protected methods, but we need
19719         to enforce the FamANDAssem, FamOrAssem and Family. 
19720
19721 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
19722
19723         * statement.cs (GotoCase): Return true: Ammounts to giving up
19724         knowledge on whether we return or not, and letting the other case
19725         be responsible for it.
19726
19727 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
19728
19729         * driver.cs: Do not load directories for each file processed, only
19730         do it if there is a pattern.
19731
19732         * ecore.cs: Report readonly assigns here as well, as we might have
19733         been resolved only by MemberAccess.
19734
19735         (SimpleName.SimpleNameResolve): Also be useful for LValue
19736         resolution.   We need this to propagate assign to local readonly variables
19737
19738         * typemanager.cs: Use a ptrhashtable for the criteria, because we
19739         do not want to reuse potential criteria memory.
19740
19741         * class.cs (MyEventBuilder): Set reflected_type;
19742
19743         * ecore.cs (Constantify): Added support for constifying bools.
19744
19745         (RootContext.LookupType): Added a cache for values looked up in
19746         the declaration space.
19747
19748         * typemanager.cs (FindMembers): Now is a front-end to
19749         RealFindMembers, and provides a two-level hashtable-based cache to
19750         the request.  
19751
19752         15% performance improvement: from 22.5 to 19.2 seconds.
19753
19754         * expression.cs (IsParamsMethodApplicable): use foreach.
19755         (Invocation.DoResolve): ditto.
19756         (New.DoResolve): ditto.
19757         (ArrayCreation.DoResolve): ditto.
19758
19759         * ecore.cs (FindMostEncompassingType): use foreach.
19760
19761         * delegate.cs (NewDelegate.DoResolve): Use foreach
19762
19763         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
19764         (RemoveMethods): use foreach.
19765
19766         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
19767         nested foreach statements instead of for, and also break out of
19768         the inner loop once a match is found.
19769
19770         (Invocation.OverloadResolve): Use foreach, simplify the code. 
19771
19772 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
19773
19774         * cfold.cs (BinaryFold): During an enumeration evaluation context,
19775         we actually unwrap the expression to allow for extra information
19776         to be extracted. 
19777
19778         * expression.cs: Use Shr_Un on unsigned operations. 
19779
19780 2002-05-08  Ravi Pratap  <ravi@ximian.com>
19781
19782         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
19783         applicable operators was not being considered correctly. This closes
19784         the bug Miguel reported.
19785
19786 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
19787
19788         * attribute.cs: check that the type derives from System.Attribute
19789         and report the correct error in that case (moved the duplicate code to
19790         its own method, too).
19791
19792 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
19793
19794         * attribute.cs: lookup attribute type name as the spec says: first the
19795         bare attribute name and then name + "Attribute" (nant compiles with
19796         mcs after this fix).
19797
19798 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
19799
19800         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
19801         Because of the way we parse things, we should try to see if a
19802         UIntConstant can fit in an integer.
19803
19804 2002-05-07  Ravi Pratap  <ravi@ximian.com>
19805
19806         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
19807         when we are in an explicit context.
19808
19809         (ConvertReferenceExplicit): When converting from Iface type S to Class
19810         T make sure the rules are implemented as an OR.
19811
19812         * parameter.cs (ParameterType): Make it a property for now although the
19813         purpose really isn't anything immediate.
19814
19815         * expression.cs (Is*Applicable): Do better checking on the parameter type
19816         of a ref/out parameter. The ones from the system assemblies are already 
19817         marked with the correct type so we don't need to do any correction.
19818
19819         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
19820         the object type is standard too so include that.
19821
19822 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19823
19824         * ecore.cs (StandardConversionExists): Augment with missing code:
19825         deal with IntConstant, LongConstants and Enumerations.
19826
19827         * assign.cs: Report the error, instead of failing silently
19828
19829         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
19830         typecontainer that they are declared, because the
19831         typecontainer/namespace will have the list of using clauses that
19832         need to be applied.
19833
19834         Assembly Attributes were escaping the normal registration
19835         mechanism. 
19836
19837         (EmitCode): Apply attributes within an EmitContext that represents
19838         the container they were declared on.
19839
19840         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
19841
19842 2002-05-06  Ravi Pratap  <ravi@ximian.com>
19843
19844         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
19845         Revamp completely - make much cleaner as we now operate only
19846         on a set of Types.
19847
19848         (FindMostSpecificSource, FindMostSpecificTarget): New methods
19849         to implement the logic detailed in the spec more correctly.
19850
19851         (UserDefinedConversion): Update accordingly.
19852
19853 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19854
19855         * statement.cs: Return flow analysis information up.
19856
19857         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
19858         and the default.
19859
19860         (token): Do not consume an extra character before calling
19861         decimal_digits.
19862
19863 2002-05-06  Piers Haken <piersh@friskit.com>
19864
19865         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
19866
19867 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
19868
19869         * class.cs (Constructor.Emit): Set the IsStatic flag in the
19870         EmitContext during the instance constructor initializer
19871         resolution, to stop access to instance variables.
19872
19873         This is mandated by the spec, last paragraph of the `constructor
19874         initializers' section. 
19875
19876 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
19877
19878         * cs-parser.jay, class.cs (Accessor): new class used to represent
19879         an accessor (get or set).  In the past we used `null' to represent
19880         a missing accessor.  But this is ambiguous because there was no
19881         way to tell in abstract indexers/properties if one of them was
19882         specified.
19883
19884         Now there is a way of addressing that.
19885
19886         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
19887         instead of FindMembers.
19888
19889         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
19890         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
19891
19892         * attribute.cs: Treat indexers and properties as the same in terms
19893         of applying attributes
19894
19895         * ecore.cs (FindMostEncompassedType): Use statically initialized
19896         EmptyExpressions()s like we do elsewhere to avoid creating useless
19897         objects (and we take this out of the tight loop).
19898
19899         (GetConversionOperators): Move the code to extract the actual
19900         operators to a separate routine to clean things up.
19901
19902 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
19903
19904         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
19905         events are always registered FieldBuilders.
19906
19907         * class.cs (FieldBase): New class shared by Fields 
19908
19909         * delegate.cs: If we are a toplevel delegate, use our full name.
19910         If we are a nested delegate, then only use our tail name.
19911
19912 2002-05-02  Ravi Pratap  <ravi@ximian.com>
19913
19914         * expression.cs (IsApplicable): Ensure that we add the "&" to
19915         ref/out types before comparing it with the type of the argument.
19916
19917         (IsParamsMethodApplicable): Ditto.
19918
19919         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
19920         silly me ;-)
19921
19922         * delegate.cs : Handle the case when we have more than one applicable
19923         method. Flag an error only when we finish checking all.
19924
19925 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
19926
19927         * expression.cs: Add support for boolean static initializers.
19928
19929 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
19930
19931         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
19932
19933         * parameter.cs (ComputeParameterTypes,
19934         ComputeAndDefineParameterTypes): Better error handling: now we
19935         clear the `types' cache if we fail during any of the type lookups.
19936         We also return the status code correctly to our caller
19937
19938         * delegate.cs: If we fail to define a delegate, abort the extra
19939         steps. 
19940
19941         * expression.cs (Binary.ResolveOperator): for
19942         operator==(object,object) and operator !=(object, object) we also
19943         have to verify that there is an implicit conversion from one to
19944         the other.
19945
19946         (ArrayAccess.DoResolve): Array Access can operate on
19947         non-variables. 
19948
19949 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
19950
19951         * assign.cs (CompoundAssign): A new class used as a "flag" that
19952         the assignment actually is happening as part of a compound
19953         assignment operator.
19954
19955         During compound assignment, a few new rules exist to enable things
19956         like:
19957
19958         byte b |= 1 + 2
19959
19960         From the spec:
19961
19962         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
19963         to the type of x) if y is implicitly convertible to the type of x,
19964         and the operator is a builtin operator and the return type of the
19965         operator is explicitly convertible to the type of x. 
19966
19967         * rootcontext.cs: Reset warning level to 2.  4 catches various
19968         "interesting" features in mcs, we must clean this up at some
19969         point, but currently am trying to kill other bugs ;-)
19970
19971         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
19972         in container classes as well.  
19973
19974         * expression.cs (Binary.ResolveOperator): Handle string case
19975         before anything else (as operator overloading does emit an error
19976         before doing anything else).
19977
19978         This code could go away when we move to a table driven model, but
19979         i could not come up with a good plan last night.
19980
19981 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
19982
19983         * typemanager.cs (CSharpName): reimplementation using regex.
19984         * class.cs: added null check for fields in Emit
19985         * rootcontext.cs: set warninglevel to 4
19986
19987 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
19988
19989         * typemanager.cs (CSharpName): reimplemented with Lupus
19990         suggestion.
19991
19992 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
19993
19994         * statement.cs (If): correclty implement Resolve, because we were
19995         not catching sem errors in there.  The same process is needed
19996         everywhere else. 
19997         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
19998
19999
20000         (Statement.Warning_DeadCodeFound): Factorize code.
20001         (While): Report dead code here too.
20002
20003         (Statement): Added Resolve virtual method to allow
20004         for resolution split from the emit code.
20005
20006 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20007
20008         * statement.cs (EmitBoolExpression): No longer try to resolve the
20009         expression here.    
20010         (MakeBoolean): New utility function that resolve, implicitly
20011         converts to boolean and tags the expression. 
20012
20013
20014         (If, Do): Implement dead code elimination.
20015         (While): Implement loop inversion
20016
20017         (Do, While, For, If): Resolve the expression prior to calling our
20018         code generation.
20019
20020 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
20021
20022         * class.cs:
20023           - added method Report28 (warning: program has more than one entry point)
20024           - added method IsEntryPoint, implements paragraph 10.1 of the spec
20025           - modified method Method.Define, the part at the end of the method
20026
20027         * rootcontext.cs: added static public Location EntryPointLocation;
20028           
20029         * ../errors/cs0028.cs : Add test case for the above warning.              
20030
20031         * typemanager.cs:
20032           - modified method CSharpName to allow arrays of primitive type to
20033             be printed nicely (e.g. instead of System.Int32[][] it now prints
20034             int[][])
20035           - added method CSharpSignature: returns the signature of a method
20036             in string format to be used in reporting errors, warnings, etc.
20037
20038         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
20039         with String.Empty.
20040
20041 2002-04-26  Ravi Pratap  <ravi@ximian.com>
20042
20043         * delegate.cs (Define): Fix extremely silly bug where I was
20044         setting the type of the 'object' parameter of the BeginInvoke
20045         method to System.IAsyncResult instead of System.Object ;-)
20046
20047 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
20048
20049         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
20050         here. 
20051
20052         (Constructor.Emit): return if we fail to initialize the
20053         constructor.  Another door closed!  
20054
20055         * expression.cs (New.DoResolve): Improve error message (from -6 to
20056         1501).  Use DeclaredOnly lookup to find the exact constructor.
20057
20058         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
20059         loop.  This is useful.
20060
20061         * cs-parser.jay: Adjust the default parameters so that destructors
20062         have the proper signature.
20063
20064 2002-04-26  Martin Baulig  <martin@gnome.org>
20065
20066         * driver.cs (LoadAssembly): If `assembly' contains any characters
20067         which are only valid in path names and not in assembly names
20068         (currently slash, backslash and point), use Assembly.LoadFrom ()
20069         instead of Assembly.Load () on the `assembly' (before iteration
20070         over the link_paths).
20071
20072 2002-04-26  Martin Baulig  <martin@gnome.org>
20073
20074         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
20075
20076 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
20077
20078         * class.cs (Property): use the new typemanager.MemberLookup
20079
20080         (TypeContainer.MemberLookup): Implement using the
20081         TypeManager.MemberLookup now. 
20082
20083         * typemanager.cs: Make MemberLookup a function of the TypeManager,
20084         and return MemberInfos, so that these can be used without an
20085         EmitContext (what we had before).
20086
20087 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
20088
20089         * expression.cs: Fix the case where the argument to params if the
20090         type of the params.  I omitted handling this before.   Fixed
20091
20092 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20093
20094         * driver.cs: Call BootCorlib_PopulateCoreType
20095
20096         * class.cs (Property.CheckBase): Check for properties only, not
20097         for all members. 
20098
20099         * interface.cs: Temporary hack: try/catch around the
20100         CustomAttributeBuilder, because I am getting an exception that I
20101         do not understand.
20102
20103         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
20104         types whose definitions are required to be there (attributes are
20105         defined before standard types).
20106
20107         Compute definitions as we boot the various types, as they are used
20108         immediately (value_type class will need object_type, but if we do
20109         not initialize object_type, we will pass a null, which will let
20110         the runtime pick the System.Object from the existing corlib, which
20111         is not what we want).
20112
20113 2002-04-22  Patrik Torstensson <totte@labs2.com>
20114
20115         * cs-tokenizer.cs: fixed a number of trim() issues.
20116
20117 2002-04-22  Ravi Pratap  <ravi@ximian.com>
20118
20119         * expression.cs (Argument.Type): Ensure that we return the correct
20120         type when we have out or ref parameters [in which case we 
20121         append a "&"].
20122
20123 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
20124
20125         * class.cs (Property, Indexer): Allow extern modifier in there. 
20126
20127         * typemanager.cs (InitBaseTypes): Initializes object_type and
20128         value_type, since those will be used early on during the bootstrap
20129         process to compile corlib.
20130
20131         (InitCoreTypes): Move code from here to InitBaseTypes.
20132
20133 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
20134
20135         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
20136         single-dimension arrays as using the ldlen opcode.  
20137
20138         Daniel Lewis discovered this optimization.  
20139
20140         * typemanager.cs: Add signature for System.Array::get_Length
20141
20142 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20143
20144         * statement.cs: report the error when the foreach does not apply to an
20145         array nor a collection.
20146
20147 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
20148
20149         * expression.cs: Add implicit conversions to the operator ~.
20150
20151         * constant.cs (DecimalConstant.Emit): Emit decimal value.
20152
20153         * typemanager.cs: Locate the decimal constructor.
20154
20155 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20156
20157         * attribute.cs: use the new property of TypeOf.
20158         * expression.cs: added 'get' property around typearg.
20159
20160         These changes fix a build breaker reported by NickD. Is this the
20161         correct way to fix?  If not, please, revert my changes and make it
20162         work :-).
20163
20164 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
20165
20166         * attribute.cs: Add support for typeof in attribute invocations.
20167         I am not sure that this is right though.
20168
20169 2002-04-14  Duncan Mak  <duncan@ximian.com>
20170
20171         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
20172         Binary.Operator.Division case.
20173
20174 2002-04-13  Ravi Pratap  <ravi@ximian.com>
20175
20176         * class.cs (DefineType): Ensure that we do a proper check on
20177         attribute types and also register it with the TypeManager.
20178
20179         (TypeContainer.Targets): The default for attribute types is
20180         AttributeTargets.All.
20181
20182         * attribute.cs (ApplyAttributes): Registering the attribute type
20183         is done elsewhere, not when we discover we have a Usage attribute.
20184
20185 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20186
20187         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
20188         and get rid of is_delegate parameter.
20189
20190         * everywhere : update.
20191
20192 2002-04-12  Ravi Pratap  <ravi@ximian.com>
20193
20194         * cs-parser.jay (compilation_unit): Revamp completely to use
20195         some new ideas that I got from Rhys' grammar to solve the problems
20196         with assembly level attributes.
20197
20198         (outer_declaration): New grammar production.
20199
20200         (attribute_sections): Add.
20201
20202         (opt_attributes): Base on attribute_sections
20203
20204         (namespace_declaration): Allow opt_attributes to tackle the case
20205         when we have assembly level attributes - we are clever in this
20206         regard now ;-)
20207
20208         * attribute.cs (ApplyAttributes): Do not worry about assembly 
20209         attributes in the non-global context.
20210
20211         * rootcontext.cs (AddGlobalAttributes): Go back to using this
20212         instead of SetGlobalAttributes.
20213
20214         * class.cs, rootcontext.cs : Ensure we define and generate 
20215         attribute types before anything else.
20216
20217         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
20218         and flag the new error -20 for the case when the attribute type
20219         does not have valid targets specified. csc does not catch this.
20220
20221         * ../errors/errors.txt : update for error # -20
20222
20223 2002-04-11  Ravi Pratap  <ravi@ximian.com>
20224
20225         * support.cs (InternalParameters.ParameterModifier): Do some null
20226         checking and return sane values.
20227
20228         * class.cs (Method.Define): If we are a PInvoke method, ensure
20229         that we are static and extern. Report error # 601
20230
20231         * ../errors/cs0601.cs : Add test case for the above error.
20232
20233 2002-04-07  Ravi Pratap  <ravi@ximian.com>
20234
20235         * rootcontext.cs (attribute_types): We need to keep type of
20236         all attribute types separately and emit code for them first.
20237
20238         (RegisterAttribute) : Implement.
20239
20240         * class.cs (DefineType): Check if the current Type is a custom
20241         attribute type and register it accordingly.
20242
20243         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
20244         adding the first attribute twice and rename to
20245
20246         (SetGlobalAttributes): this.
20247
20248         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
20249         lookups.
20250
20251         * attribute.cs (ApplyAttributes): Take an additional argument telling us
20252         if we are processing global arguments. Hmm, I am unsure of this.
20253
20254 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
20255
20256         * expression.cs: added static array of strings to avoid calling
20257         Enum.ToString () for Operator in Binary. Significant recover of
20258         performance.
20259
20260 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
20261
20262         * class.cs (FindMembers): Allow the Builders of the various
20263         members to be null.  If they are skip them.  This only happens
20264         during the PInvoke declaration.
20265
20266 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
20267
20268         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
20269         failure, so we do not keep going afterwards.
20270
20271         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
20272         wanted to pass `false' as the `is_delegate' argument.  If this is
20273         the case, why not use delegate_type == null to mean `is_delegate =
20274         false' and anything else as is_delegate = true.
20275
20276 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
20277
20278         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
20279         code for the section, not the beginning of the tests.
20280
20281 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
20282
20283         * cfold.cs: Handle operator + (Enum x, Underlying x) 
20284
20285         * expression.cs (Binary): same.  Warn about errors where we have
20286         Enum/Enum in operator + as well.
20287
20288 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
20289
20290         * statement.cs:
20291                 - added support for switch(bool)
20292                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
20293                 - add TableSwitchEmit() to handle table-based switch statements
20294
20295 2002-04-05  Ravi Pratap  <ravi@ximian.com>
20296
20297         * expression.cs (Invocation.OverloadResolve): Factor out code which
20298         does parameter compatibility checking with arguments so that we can 
20299         re-use the code even from Delegate.VerifyApplicability
20300
20301         (VerifyArgumentsCompat): Move above code here.
20302
20303         * delegate.cs (VerifyApplicability): Get rid of duplicate code
20304         and instead make a call to the above method.
20305
20306 2002-03-31  Ravi Pratap  <ravi@ximian.com>
20307
20308         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
20309         We use it to keep track of classes which are attribute types.
20310
20311 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
20312
20313         * delegate.cs (Delegate.Define): Correctly define the types in the
20314         presence of fixed and array parameters.
20315
20316         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
20317         doing FindMembers.
20318
20319         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
20320         include NonPublic after the first iteration.
20321
20322         * class.cs (Indexer.CheckBase): Only check if both parents are
20323         non-null. 
20324
20325         * cs-parser.jay (accessor_body): If empty, set to null.
20326
20327         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
20328         same code path here to resolve constants names that we did have in
20329         MemberAccess.DoResolve.  There is too much code duplicated here.
20330
20331 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
20332
20333         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
20334
20335         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
20336         to MakeUnionSet.
20337
20338         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
20339         tokens, numbers and strings.
20340
20341         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
20342         parenthesis.
20343
20344         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
20345         asyncronous parameters and the regular parameters.  
20346
20347         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
20348         specify the target directory.
20349
20350         * expression.cs: (This.DoResolve): Simplify
20351         (As.Emit): Optimize, do not generate IsInst if the expression is
20352         always of the given type.
20353
20354         (Is.DoResolve): Bug fix, we were reporting both always/never for
20355         the is expression.
20356
20357         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
20358         creating too many unnecessary arrays.
20359
20360 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
20361
20362         * class.cs (EmitFieldInitializer): Use Assign expression to assign
20363         fields instead of rolling our own initializer.   Takes care of all
20364         implicit conversions, and drops unnecessary static checks/argument.
20365
20366 2002-03-31  Dick Porter  <dick@ximian.com>
20367
20368         * driver.cs: use the GetDirectories() return values properly, and
20369         use "/" as path separator.
20370
20371 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
20372
20373         * expression.cs (Unary): Optimize - - expr into expr.
20374         (Binary): Optimize a + (-b) into a -b.
20375
20376         * codegen.cs (CodeGen): Made all methods static.
20377
20378 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
20379
20380         * rootcontext.cs: 
20381
20382         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
20383         TypeBuilder property.
20384
20385         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
20386         instead. 
20387
20388         * tree.cs: Removed the various RecordXXXX, and replaced with a
20389         single RecordDecl.  Removed all the accessor methods, and just
20390         left a single access point Type 
20391
20392         * enum.cs: Rename DefineEnum to DefineType.
20393
20394         * decl.cs: New abstract method `DefineType' used to unify the
20395         Defines for Enumerations, Interfaces, TypeContainers and
20396         Delegates.
20397
20398         (FindType): Moved LookupInterfaceOrClass here.  Moved the
20399         LookupBaseClasses method that used to live in class.cs and
20400         interface.cs here, and renamed to FindType.
20401
20402         * delegate.cs: Implement DefineType.  Take advantage of the
20403         refactored pattern for locating the parent builder without taking
20404         the parent_builder argument (which we know does not work if we are
20405         nested, and triggering a toplevel definition).
20406
20407 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20408
20409         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
20410         accessibility of a member has changed during override and report
20411         an error if so.
20412
20413         * class.cs (Method.Define, Property.Define): Only complain on
20414         overrides if the method is private, any other accessibility is
20415         fine (and since we just checked the permission is the same, we are
20416         good to go).
20417
20418         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
20419         and elif are processed always.  The other pre-processing
20420         directives are only processed if we are "taking" the path
20421
20422 2002-03-29  Martin Baulig  <martin@gnome.org>
20423
20424         * class.cs (Method.Emit): Only emit symbolic debugging info if the
20425         current location is not Null.
20426
20427         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
20428         a separate method so we can profile it.
20429
20430         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
20431         `span.Seconds' are just seconds, but no minutes or hours.
20432         (MainDriver): Profile the CodeGen.SaveSymbols calls.
20433
20434 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20435
20436         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
20437         Remove the gratuitous set of Final:
20438
20439                                 // If an interface implementation, then we can set Final.
20440                                 if (((flags & MethodAttributes.Abstract) == 0) &&
20441                                     implementing.DeclaringType.IsInterface)
20442                                         flags |= MethodAttributes.Final;
20443
20444         I do not know what I was smoking when I used that.
20445
20446
20447         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
20448         step into fixing the name resolution issues for delegates and
20449         unifying the toplevel name resolution.
20450
20451 2002-03-28  Martin Baulig  <martin@gnome.org>
20452
20453         * class.cs (Method.Emit): If we have a symbol writer, call its
20454         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
20455         tell it about the current method.
20456
20457         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
20458         writer that we're going to emit the first byte of IL code for a new
20459         statement (a new source line).
20460         (EmitContext.EmitTopBlock): If we have a symbol writer, call
20461         EmitContext.Mark() before emitting any code.
20462
20463         * location.cs (SymbolDocument): Return null when we're Null.
20464
20465         * statement.cs (Statement): Moved the `Location loc' variable here.
20466         (Statement.EmitBoolExpression): If we have a symbol writer, call
20467         ec.Mark() before emitting any code to tell it that we're at the
20468         beginning of a new statement.
20469         (StatementExpression): Added `Location' argument to the constructor.
20470         (Block): Added public readonly variable `StartLocation' and public
20471         variable `EndLocation'.  The latter is to be set using SetEndLocation().
20472         (Block): Added constructor which takes a start and end location.
20473         (Block.SetEndLocation): New method. This sets the end location.
20474         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
20475         local variables we create.
20476         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
20477         each statement and do also mark the begin and end of the block.
20478
20479         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
20480         tell it the current lexer.Location, use Location.Null for the end of the
20481         block.
20482         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
20483         current block, set its end location using SetEndLocation().
20484         (statement_expression): StatementExpression constructor now takes the
20485         lexer.Location as additional argument.
20486         (for_statement, declare_local_variables): Likewise.
20487         (declare_local_variables): When creating a new implicit block, use the
20488         new Block constructor and pass it the lexer.Location.
20489
20490 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
20491
20492         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
20493         members also on the parent interfaces recursively.
20494
20495 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
20496
20497         * report.cs: Use new formats, since Gonzalo finished the missing
20498         bits. 
20499
20500         * expression.cs (Binary.ResolveOperator): added missing operator|
20501         operator& and operator^ for bool/bool.
20502
20503         * cs-parser.jay: CheckDef now takes a Location argument that is
20504         used to report errors more precisly (instead of reporting the end
20505         of a definition, we try to track something which is a lot closer
20506         to the source of the problem).
20507
20508         * cs-tokenizer.cs: Track global token use, so we can properly flag
20509         the use of #define/#undef after the first token has been seen.
20510
20511         Also, rename the reportXXXX to Error_DescriptiveName
20512
20513         * decl.cs (DeclSpace.IsTopLevel): Move property here from
20514         TypeContainer, so that Enum and Interface can use this too.
20515
20516         * class.cs (TypeContainer.LookupInterfaceOrClass,
20517         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
20518         `builder' argument.  Typically this was used to pass the parent
20519         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
20520         the definition).  
20521
20522         The problem is that a nested class could trigger the definition of
20523         a toplevel class, and the builder would be obviously wrong in that
20524         case. 
20525
20526         So we drop this argument, and we compute dynamically the
20527         TypeBuilder/ModuleBuilder (the correct information was available
20528         to us anyways from DeclSpace.Parent)
20529
20530         * interface.cs (Interface.DefineInterface): Drop builder
20531         parameter cleanup like class.cs
20532
20533         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
20534         like class.cs
20535
20536         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
20537         values. 
20538
20539         (Try.Emit): Propagate the returns value from the statement.
20540
20541         (Return.Emit): Even if we are leavning 
20542
20543         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
20544
20545         * modifiers.cs: Fix the computation of MethodAttributes flags.
20546
20547 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
20548
20549         * driver.cs: allow compilation of files that start with '/'.
20550         Add a default case when checking the argument of --target.
20551
20552 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
20553
20554         * interface.cs: Implement the same search algorithm for types in
20555         the interface code.
20556
20557         * delegate.cs: Do not allow multiple definition.
20558
20559         * Recovered ChangeLog that got accidentally amputated
20560
20561         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
20562
20563         * rootcontext.cs: Load manually enum to allow core classes to
20564         contain enumerations.
20565
20566         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
20567         Update to new static methods in TypeManager.
20568
20569         * typemanager.cs (GetMethod, GetConstructor): Use our
20570         implementation of FindMembers to find the members, since during
20571         corlib compilation, the types are TypeBuilders and GetMethod and
20572         GetConstructor do not work.
20573
20574         Make all methods in TypeManager static.
20575
20576         (InitCodeHelpers): Split the functionality from
20577         the InitCodeTypes function.
20578
20579         * driver.cs: Call InitCodeHelpers after we have populated the
20580         types. 
20581
20582         * cs-parser.jay (delegate_declaration): we did not used to compute
20583         the delegate name correctly for void delegates.
20584
20585 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
20586
20587         * rootcontext.cs (RootContext): Init the interface_resolve_order
20588         and type_container_resolve_order always.
20589
20590         (ResolveCore, BootstrapCorlib_ResolveClass,
20591         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
20592         compiler when compiling with --nostdlib
20593
20594         * class.cs (TypeContainer.DefineType): Check that our parent is
20595         not null.  This test is most important when we are bootstraping
20596         the core types.
20597
20598         * codegen.cs: Split out the symbol writing code.
20599
20600 2002-03-25  Martin Baulig  <martin@gnome.org>
20601
20602         * driver.cs (-g): Made -g an alias for --debug.
20603
20604 2002-03-24  Martin Baulig  <martin@gnome.org>
20605
20606         * codegen.cs (SymbolWriter): New public variable. Returns the
20607         current symbol writer.
20608         (CodeGen): Added `bool want_debugging_support' argument to the
20609          constructor. If true, tell the ModuleBuild that we want debugging
20610         support and ask it for the ISymbolWriter.
20611         (Save): If we have a symbol writer, call it's Close() method after
20612         saving the assembly.
20613
20614         * driver.c (--debug): New command line argument to create a
20615         debugger information file.
20616
20617         * location.cs (SymbolDocument): New public property. Returns an
20618         ISymbolDocumentWriter object for the current source file or null
20619         if we don't have a symbol writer.
20620
20621 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
20622
20623         * driver.cs (LoadAssembly): Correctly return when all the paths
20624         have been tried and not before.
20625
20626         * statement.cs (Switch.Emit): return the actual coverage for this
20627         statement (returns/not-returns)
20628
20629         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
20630         switch of the statement if we are the last switch section.  That
20631         kills two problems: try/catch problems (we used to emit an empty
20632         nop at the end) and switch statements where all branches would
20633         return. 
20634
20635 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
20636
20637         * driver.cs: Add default assemblies (the equivalent to the
20638         Microsoft CSC.RSP file)
20639
20640         * cs-tokenizer.cs: When updating `cols and setting it to zero,
20641         also update tokens_seen and set it to false.
20642
20643         * driver.cs: Implement --recurse for Mike.
20644
20645         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
20646         correctly splitting out the paths.
20647
20648 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
20649
20650         * interface.cs (Interface.PopulateProperty): Instead of using
20651         `parent' as the declaration space for the set parameters, use
20652         `this' 
20653
20654         * support.cs (InternalParameters): InternalParameters constructor
20655         takes a DeclSpace instead of a TypeContainer.
20656
20657         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
20658         types are being initialized, load the address of it before calling
20659         the function.  
20660
20661         (New): Provide a mechanism to disable the generation of local
20662         value type temporaries when the caller will be providing us with
20663         an address to store it.
20664
20665         (ArrayCreation.EmitDynamicInitializers): Use it.
20666
20667 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
20668
20669         * expression.cs (Invocation.EmitArguments): Only probe for array
20670         property if there is more than one argument.  Sorry about that.
20671
20672         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
20673         empty param arrays.
20674
20675         * class.cs (Method.LabelParameters): Fix incorrect code path that
20676         prevented the `ParamArrayAttribute' from being applied to the
20677         params attribute.
20678
20679 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
20680
20681         * support.cs (ReflectionParameters): Correctly compute whether the
20682         last argument is a params array.  Fixes the problem with
20683         string.Split ('a')
20684
20685         * typemanager.cs: Make the assemblies array always be non-null
20686         (empty, but non-null)
20687
20688         * tree.cs (RecordDecl): New function that abstracts the recording
20689         of names.  This reports error 101, and provides a pointer to the
20690         previous declaration.  Fixes a crash in the compiler.
20691
20692         * cs-parser.jay (constructor_declaration): Update to new grammar,
20693         and provide a constructor_body that can be empty.
20694
20695 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
20696
20697         * driver.cs: Add support for --resources.
20698
20699         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
20700         Make all types for the various array helper methods be integer.
20701
20702         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
20703         CheckState to ConvCast.
20704
20705         (ConvCast): Now it takes a `checked' state argument, to avoid
20706         depending on the emit context for the conversion, and just using
20707         the resolve time setting.
20708
20709         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
20710         instead of Invocation.EmitArguments.  We do not emit the original
20711         arguments, instead we emit those which have been converted to
20712         unsigned int expressions.
20713
20714         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
20715
20716         * codegen.cs: ditto.
20717
20718         * expression.cs (LocalVariableReference): Drop the use of the
20719         Store function that depended on the variable index.
20720
20721         * statement.cs (VariableInfo): Drop the `Idx' property from this
20722         class, as this is not taking into account the indexes for
20723         temporaries tat we generate during the execution, getting the
20724         indexes wrong.
20725
20726         * class.cs: First emit class initializers, then call the parent
20727         constructor. 
20728
20729         * expression.cs (Binary): Fix opcode emision.
20730         (UnaryMutator.EmitCode): Support checked code generation
20731
20732         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
20733         matches for events for both the Static and Instance scans,
20734         pointing to the same element.   Fix that.
20735
20736 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
20737
20738         * rootcontext.cs (ResolveTree): Always set the
20739         interface_resolve_order, because nested interfaces will be calling
20740         into us.
20741
20742         * class.cs (GetInterfaceOrClass): Track the same resolution
20743         process used by TypeManager.LookupType.  This fixes the nested
20744         type lookups in class declarations (separate path from
20745         LookupType). 
20746
20747         (TypeContainer.DefineType): Also define nested interfaces.
20748         (TypeContainer.RegisterOrder): New public function used to
20749         register the order in which child interfaces need to be closed.
20750
20751         Nested interfaces need to be closed after their parents have been
20752         created. 
20753
20754         * interface.cs (InterfaceAttr): Put all the logic for computing
20755         the interface attribute here. 
20756
20757         (DefineInterface): Register our interface order with the
20758         RootContext or with the TypeContainer depending on the case.
20759
20760 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20761
20762         * cs-parser.jay: rework foreach statement to work with the new
20763         changes to the policy on SimpleNames.
20764
20765         * report.cs: support Stacktrace on warnings as well.
20766
20767         * makefile: drop --unsafe and /unsafe from the compile.
20768
20769 2002-03-13  Ravi Pratap  <ravi@ximian.com>
20770
20771         * ecore.cs (StandardConversionExists): Modify to take an Expression
20772         as the first parameter. Ensure we do null -> reference type conversion
20773         checking.
20774
20775         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
20776         temporary Expression objects.
20777
20778 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
20779
20780         * interface.cs: workaround bug in method overloading resolution
20781         (there is already a bugzilla bug for it).
20782
20783 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
20784
20785         We could also solve this problem by having a separate path for
20786         performing type lookups, instead of DoResolve, we could have a
20787         ResolveType entry point, and only participating pieces of the
20788         production (simplename, deref, array) would implement this. 
20789
20790         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
20791         signal SimpleName to only resolve type names and not attempt to
20792         resolve anything else.
20793
20794         * expression.cs (Cast): Set the flag.
20795
20796         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
20797
20798         * class.cs: Only report 108 if there is no `new' modifier.
20799
20800         * cs-parser.jay: rework foreach statement to work with the new
20801         changes to the policy on SimpleNames.
20802         
20803         * report.cs: support Stacktrace on warnings as well.
20804
20805         * makefile: drop --unsafe and /unsafe from the compile.
20806
20807 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
20808
20809         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20810         lookups here, instead of doing that at parse time.  This means
20811         that our grammar will not introduce `LocalVariableReferences' as
20812         expressions at this point.  That solves the problem of code like
20813         this:
20814
20815         class X {
20816            static void Main ()
20817            { int X = 1;
20818             { X x = null }}}
20819
20820         This is only half the fix.  The full fix requires parameters to
20821         also be handled in this way.
20822
20823         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
20824         makes the use more obvious of the DeclSpace.  The
20825         ec.TypeContainer.TypeBuilder is now only used to pull the
20826         TypeBuilder for it.
20827
20828         My theory is that I can get rid of the TypeBuilder completely from
20829         the EmitContext, and have typecasts where it is used (from
20830         DeclSpace to where it matters).  
20831
20832         The only pending problem is that the code that implements Aliases
20833         is on TypeContainer, and probably should go in DeclSpace.
20834
20835         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
20836         lookups here, instead of doing that at parse time.  This means
20837         that our grammar will not introduce `LocalVariableReferences' as
20838         expressions at this point.  That solves the problem of code like
20839         this:
20840
20841         class X {
20842            static void Main ()
20843            { int X = 1;
20844             { X x = null }}}
20845
20846         This is only half the fix.  The full fix requires parameters to
20847         also be handled in this way.
20848
20849         * class.cs (Property.DefineMethod): When implementing an interface
20850         method, set newslot, when implementing an abstract method, do not
20851         set the flag (before we tried never setting it, or always setting
20852         it, which is the difference).
20853         (Indexer.DefineMethod): same.
20854         (Method.DefineMethod): same.
20855
20856         * ecore.cs: Only set the status used flag if we get back a Field.
20857
20858         * attribute.cs: Temporary hack, so Paolo can keep working.
20859
20860 2002-03-08  Ravi Pratap  <ravi@ximian.com>
20861
20862         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
20863         the unmanaged type in the case we have a MarshalAs attribute.
20864
20865         (Resolve): Handle the case when we are parsing the special MarshalAs
20866         attribute [we need to store the unmanaged type to use later]
20867
20868         * typemanager.cs (marshal_as_attr_type): Built in type for the 
20869         MarshalAs Attribute.
20870
20871         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
20872         on parameters and accordingly set the marshalling info.
20873
20874 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
20875
20876         * class.cs: Optimizing slightly by removing redundant code after
20877         we switched to the `NoTypes' return value.
20878         (Property.DefineMethod): use NoTypes here too.
20879
20880         This fixes the bug I introduced in my last batch of changes.
20881
20882 2002-03-05  Ravi Pratap  <ravi@ximian.com>
20883
20884         * tree.cs (RecordEnum): Add. We now keep track of enums too.
20885
20886         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
20887         Enums since those are types too. 
20888
20889         * cs-parser.jay (enum_declaration): Record enums as we parse them.
20890
20891         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
20892         thanks to a call during the lookup process.
20893
20894 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
20895
20896         * statement.cs (Foreach): Lots of work to accomodate a particular
20897         kind of foreach statement that I had not kept in mind.  It is
20898         possible to have foreachs on classes that provide a GetEnumerator
20899         method that return objects that implement the "pattern" for using
20900         a foreach, there is no need to support GetEnumerator
20901         specifically. 
20902
20903         This is needed to compile nant.
20904
20905         * decl.cs: Only report 114 if the member is not `Finalize' and if
20906         the warning level is at least 2.
20907
20908         * class.cs: Moved the compare function from Method to
20909         MethodSignature. 
20910
20911         (MethodSignature.InheritableMemberSignatureCompare): Add new
20912         filter function that is used to extract inheritable methods from a
20913         class. 
20914
20915         (Method.Define): Use the new `inheritable_method_signature_filter'
20916         delegate
20917
20918         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
20919         command. 
20920
20921 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
20922
20923         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
20924
20925         * cs-parser.jay: Add opt_semicolon to the interface declaration.
20926
20927         * expression.cs: Pass location information to
20928         ConvertImplicitStandard. 
20929
20930         * class.cs: Added debugging code to track return values from
20931         interfaces. 
20932
20933 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
20934
20935         * expression.cs (Is.DoResolve): If either side of the `is' is an
20936         interface, do not flag the warning.
20937
20938         * ecore.cs (ImplicitReferenceConversion): We need a separate test
20939         for interfaces
20940
20941         * report.cs: Allow for --fatal to be used with --probe.
20942
20943         * typemanager.cs (NoTypes): Move the definition for the empty Type
20944         array here. 
20945
20946         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
20947         properties. 
20948         (TypeContainer.DefineProxy): New function used to proxy to parent
20949         implementations when implementing interfaces.
20950         (TypeContainer.ParentImplements): used to lookup if our parent
20951         implements a public function that is required by an interface.
20952         (TypeContainer.VerifyPendingMethods): Hook this up.
20953
20954         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
20955         `modules' and `assemblies' arraylists into arrays.  We only grow
20956         these are the very early start up of the program, so this improves
20957         the speedof LookupType (nicely measured).
20958
20959         * expression.cs (MakeByteBlob): Replaced unsafe code with
20960         BitConverter, as suggested by Paolo.
20961
20962         * cfold.cs (ConstantFold.Binary): Special case: perform constant
20963         folding of string concatenation, but if either side is a string,
20964         and the other is not, then return null, and let the runtime use
20965         the concatenation on the string plus the object (using
20966         `Object.ToString'). 
20967
20968 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
20969
20970         Constant Folding has been implemented now.
20971
20972         * expression.cs (Unary.Reduce): Do not throw an exception, catch
20973         the error instead on types that are not supported in one's
20974         complement. 
20975
20976         * constant.cs (Constant and all children): New set of functions to
20977         perform implict and explicit conversions.
20978
20979         * ecore.cs (EnumConstant): Implement the new functions to perform
20980         conversion by proxying to the child expression.
20981
20982         * codegen.cs: (ConstantCheckState): Constant evaluation has its
20983         own separate setting that can not be turned off from the command
20984         line using --unchecked or --checked and is only controlled using
20985         the checked/unchecked statements and expressions.  This setting is
20986         used by the constant folder to flag errors.
20987
20988         * expression.cs (CheckedExpr, UncheckedExpr): Set the
20989         ConstantCheckState as well.   
20990
20991         During Resolve, they also have to flag the state, because the
20992         constant folder runs completely in the Resolve phase.
20993
20994         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
20995         well.
20996
20997 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
20998
20999         * cfold.cs: New file, this file contains the constant folder.
21000
21001         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
21002         argument to track whether we are using the resulting address to
21003         load or store a value and provide better error messages. 
21004
21005         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
21006         new AddressOf arguments.
21007
21008         * statement.cs (Foreach.EmitCollectionForeach): Update
21009
21010         * expression.cs (Argument.Emit): Call AddressOf with proper
21011         arguments to track usage.
21012
21013         (New.DoEmit): Call AddressOf with new arguments.
21014
21015         (Unary.Emit): Adjust AddressOf call.
21016
21017 2002-03-01  Ravi Pratap  <ravi@ximian.com>
21018
21019         * cs-parser.jay (member_access): Change the case for pre-defined types
21020         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
21021         this suggestion.
21022
21023         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
21024         a method body.
21025
21026         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
21027         essentially like methods and apply attributes like MethodImplOptions to them too.
21028
21029         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
21030         not being null.
21031
21032         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
21033         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
21034         is the DeclSpace.
21035
21036         * Update code everywhere accordingly.
21037
21038         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
21039
21040         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
21041
21042 2002-02-28  Ravi Pratap  <ravi@ximian.com>
21043
21044         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
21045         try performing lookups against those instead of jumping straight into using
21046         the 'using' clauses.
21047
21048         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
21049
21050         (LookupType): Perform lookups in implicit parents too.
21051
21052         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
21053         sequence as RootContext.LookupType. 
21054
21055         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
21056         the various cases of namespace lookups into this method.
21057
21058 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
21059
21060         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
21061         in positional arguments)
21062
21063         * class.cs (Operator): Update the AllowedModifiers to contain
21064         extern. 
21065
21066         * cs-parser.jay: Update operator declaration to allow for the
21067         operator body to be empty.
21068
21069         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
21070         values. 
21071
21072 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
21073
21074         * class.cs (Method.Emit): Label parameters.
21075
21076         * driver.cs: Return 1 or 0 as the program exit code.
21077
21078 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
21079
21080         * expression.cs: Special case the `null' object when trying to
21081         auto-compute the type, as anything can be explicitly converted to
21082         that. 
21083
21084         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
21085         spotting this Paolo.
21086
21087         (Expression.ImplicitNumericConversion): Perform comparissions of
21088         the type using the underlying type in the case of an enumeration
21089         rather than using the enumeration type for the compare.
21090
21091         Cope with the underlying == type case, which is not possible to
21092         catch before. 
21093
21094         (Expression.ConvertNumericExplicit): Perform comparissions of
21095         the type using the underlying type in the case of an enumeration
21096         rather than using the enumeration type for the compare.
21097
21098         * driver.cs: If the user does not supply an extension, assume .exe
21099
21100         * cs-parser.jay (if_statement): Rewrote so that we can track the
21101         location for the if statement.
21102
21103         * expression.cs (Binary.ConstantFold): Only concat strings when
21104         the operation is "+", not everything ;-)
21105
21106         * statement.cs (Statement.EmitBoolExpression): Take a location
21107         argument. 
21108         (If, While, Do): Track location.
21109
21110         * expression.cs (Binary.ResolveOperator): In the object + string
21111         case, I was missing a call to ConvertImplicit
21112
21113 2002-02-25  Ravi Pratap  <ravi@ximian.com>
21114
21115         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
21116         Location arguments. Ensure we use RootContext.LookupType to do our work
21117         and not try to do a direct Type.GetType and ModuleBuilder.GetType
21118
21119         * interface.cs (PopulateMethod): Handle the type of the parameter being
21120         null gracefully.
21121
21122         * expression.cs (Invocation.BetterFunction): Handle the case when we 
21123         have a params method with no fixed arguments and a call is made with no
21124         arguments.
21125
21126 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
21127
21128         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
21129         the verbatim-string-literal
21130
21131         * support.cs (InternalParameters.ParameterModifier): handle null
21132         fixed parameters.
21133         (InternalParameters.ParameterType): ditto.
21134
21135         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
21136         duplicating the name of the variable parameter.
21137         (GetParameterByName): Fix bug where we were not looking up array
21138         paramters if they were the only present (thanks Paolo!).
21139         (GetParameterInfo): We only have an empty set of types if both
21140         fixed and array are set to null.
21141         (GetParameterInfo-idx): Handle FixedParameter == null
21142
21143         * cs-parser.jay: Handle the case where there is no catch
21144         statements (missing null test).
21145
21146 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
21147
21148         * driver.cs (MainDriver): Be conservative on our command line
21149         handling.
21150
21151         Catch DirectoryNotFoundException when calling GetFiles.
21152
21153         (SplitPathAndPattern): Used to split the input specification into
21154         a path and a pattern that we can feed to Directory.GetFiles.
21155
21156 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
21157
21158         * statement.cs (Fixed): Implement the last case of the Fixed
21159         statement (string handling).
21160
21161         * expression.cs (StringPtr): New class used to return a char * to
21162         a string;  Used by the Fixed statement.
21163
21164         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
21165
21166         * expression.cs (Binary.ResolveOperator): Remove redundant
21167         MemberLookup pn parent type.
21168         Optimize union call, we do not need a union if the types are the same.
21169         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
21170         type.
21171
21172         Specialize the use of MemberLookup everywhere, instead of using
21173         the default settings. 
21174
21175         (StackAlloc): Implement stackalloc keyword.
21176
21177         * cs-parser.jay: Add rule to parse stackalloc.
21178
21179         * driver.cs: Handle /h, /help, /?
21180
21181         * expression.cs (MakeByteBlob): Removed the hacks we had in place
21182         before we supported unsafe code.
21183
21184         * makefile: add --unsafe to the self compilation of mcs.
21185
21186 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
21187
21188         * expression.cs (PointerArithmetic): New class that is used to
21189         perform pointer arithmetic.
21190         (Binary.Resolve): Handle pointer arithmetic
21191         Handle pointer comparission.
21192         (ArrayPtr): Utility expression class that is used to take the
21193         address of an array.
21194
21195         (ElementAccess): Implement array access for pointers
21196
21197         * statement.cs (Fixed): Implement fixed statement for arrays, we
21198         are missing one more case before we are done.
21199
21200         * expression.cs (Indirection): Implement EmitAssign and set the
21201         ExprClass to Variable.  This allows pointer dereferences to be
21202         treated as variables, and to have values assigned to them.
21203
21204         * ecore.cs (Expression.StoreFromPtr): New utility function to
21205         store values dereferencing.
21206
21207 2002-02-20  Ravi Pratap  <ravi@ximian.com>
21208
21209         * expression.cs (Binary.ResolveOperator): Ensure that we are
21210         not trying to operate on a void type - this fixes the reported
21211         bug.
21212
21213         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
21214         the parent implementation is sealed.
21215
21216         * ../errors/cs0239.cs : Add.
21217
21218         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
21219
21220         * typemanager.cs (unverifiable_code_type): Corresponds to 
21221         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
21222         which have unsafe code in them.
21223
21224         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
21225         unsafe context.
21226
21227 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
21228
21229         * cs-tokenizer.cs: Add support for @"litreal strings"
21230
21231         Make tokenizer accept pre-processor directives
21232         on any column (remove the old C-like limitation). 
21233
21234         * rootcontext.cs (EmitCode): Emit any global attributes.
21235         (AddGlobalAttributes): Used to keep track of assembly attributes. 
21236
21237         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
21238
21239         * cs-parser.jay: Add support for global attributes.  
21240
21241 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
21242
21243         * expression.cs (Indirection): New helper class.  Unary will
21244         create Indirection classes to be able to implement the
21245         IMemoryLocation interface on it.
21246
21247 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
21248
21249         * cs-parser.jay (fixed_statement): reference the right statement.
21250
21251         * statement.cs (Fixed.Emit): Finish implementing the fixed
21252         statement for the &x case.
21253
21254 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
21255
21256         * class.cs (Property.Define, Method.Define): Remove newslot when
21257         `implementing'.  
21258
21259         * modifiers.cs: My use of NewSlot when `Abstract' was set was
21260         wrong.  NewSlot should only be used if the `new' keyword is present.
21261
21262         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
21263         locating our system dir.  Sorry about this.
21264
21265 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21266
21267         * driver.cs (GetSystemDir): Compute correctly the location of our
21268         system assemblies.  I was using the compiler directory instead of
21269         the library directory.
21270
21271 2002-02-13  Ravi Pratap  <ravi@ximian.com>
21272
21273         * expression.cs (BetterFunction): Put back in what Miguel commented out
21274         since it is the correct fix. The problem is elsewhere ;-)
21275
21276         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
21277         parameters of the parms method are themselves compatible or not !
21278
21279         (StandardConversionExists): Fix very dangerous bug where we were forgetting
21280         to check that a class implements an interface before saying that an implicit
21281         conversion was allowed. Use ImplementsInterface to do the checking.
21282
21283 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
21284
21285         * class.cs (Method.Define): Track whether we are an explicit
21286         implementation or not.  And only call DefineMethodOverride if we
21287         are an explicit implementation.
21288
21289         (Property.DefineMethod): Ditto.
21290
21291 2002-02-11  Ravi Pratap  <ravi@ximian.com>
21292
21293         * expression.cs (BetterFunction): Catch hideous bug which was
21294          preventing us from detecting ambiguous calls due to implicit casts i.e
21295         cs0121.
21296
21297 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
21298
21299         * support.cs (Pair): Remove un-needed method.  I figured why I was
21300         getting the error in cs-parser.jay, the variable in a foreach loop
21301         is readonly, and the compiler does not really treat this as a variable.
21302
21303         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
21304         instead of EQUALS in grammar.  
21305
21306         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
21307
21308         * expression.cs (Unary.DoResolve): Check whether the argument is
21309         managed or not.
21310
21311 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
21312
21313         * support.cs: Api for Pair to set a value.  Despite the fact that
21314         the variables are public the MS C# compiler refuses to compile
21315         code that accesses the field if the variable is part of a foreach
21316         statement. 
21317
21318         * statement.cs (Fixed): Begin implementation of the fixed
21319         statement.
21320
21321         (Block.AddVariable): Return the VariableInfo on success and null
21322         on failure instead of true/false. 
21323
21324         * cs-parser.jay (foreach): Catch errors on variables already
21325         defined (we were ignoring this value before) and properly unwind
21326         the block hierarchy
21327
21328         (fixed_statement): grammar for the fixed statement.
21329
21330 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
21331
21332         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
21333         pointer types to be incretemented.
21334
21335         (SizeOf): Implement.
21336
21337         * cs-parser.jay (pointer_member_access): Implement
21338         expr->IDENTIFIER production.
21339
21340         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
21341         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
21342         on safe contexts.
21343
21344         (Unary): Implement indirection.
21345
21346         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
21347         use in non-unsafe context).
21348
21349         (SimpleName.DoResolve): Check for pointers in field access on safe
21350         contexts. 
21351
21352         (Expression.LoadFromPtr): Factor the load-indirect code in this
21353         function.  This was duplicated in UnboxCast and ParameterReference
21354
21355 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
21356
21357         * expression.cs (ComposedCast): report an error if a pointer cast
21358         is used in a safe region.
21359
21360         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
21361         pointer type casts in unsafe context.
21362
21363         * codegen.cs (EmitContext): Set up IsUnsafe.
21364
21365         * cs-parser.jay (non_expression_type): Add productions for pointer
21366         casts. 
21367
21368         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
21369         code.  We should not use force into static mode if the method is
21370         not virtual.  Fixes bug in MIS
21371
21372         * statement.cs (Do.Emit, While.Emit, For.Emit,
21373         Statement.EmitBoolExpression): Add support to Do and While to
21374         propagate infinite loop as `I do return' semantics.
21375
21376         Improve the For case to also test for boolean constants.
21377
21378         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
21379         to the list of attributes we can add.
21380
21381         Remove `EmitContext' argument.
21382
21383         * class.cs (Method.Define): Apply parameter attributes.
21384         (Constructor.Define): Apply parameter attributes.
21385         (MethodCore.LabelParameters): Move here the core of labeling
21386         parameters. 
21387
21388         * support.cs (ReflectionParameters.ParameterModifier,
21389         InternalParameters.ParameterModifier): Use IsByRef on the type and
21390         only return the OUT bit for these parameters instead of in/out/ref
21391         flags.
21392
21393         This is because I miss-understood things.  The ParameterInfo.IsIn
21394         and IsOut represent whether the parameter has the [In] and [Out]
21395         attributes set.  
21396
21397 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
21398
21399         * ecore.cs (FieldExpr.Emit): Release temporaries.
21400
21401         * assign.cs (LocalTemporary.Release): new function.
21402
21403         * codegen.cs (EmitContext.GetTemporaryStorage,
21404         EmitContext.FreeTemporaryStorage): Rework the way we deal with
21405         temporary storage.  Now we can "put back" localbuilders when we
21406         are done with them
21407
21408 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
21409
21410         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
21411         need to make a copy of the variable to generate verifiable code.
21412
21413 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
21414
21415         * driver.cs: Compute dynamically the system directory.
21416
21417         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
21418         Slower, but more generally useful.  Used by the abstract
21419         registering implementation. 
21420
21421         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
21422         the rules for the special rule on Type/instances.  First check if
21423         we have the same name, and if so, try that special static path
21424         rather than the instance path.
21425
21426 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
21427
21428         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
21429         for, while and if.
21430
21431         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
21432         Enum, ValueType, Delegate or Array for non-corlib compiles.
21433
21434         * cs-tokenizer.cs: Catch long identifiers (645)
21435
21436         * typemanager.cs (IndexerPropetyName): Ravi never tested this
21437         piece of code.
21438
21439         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
21440         fix, we were returning too early, so we were not registering
21441         pending methods from abstract classes.
21442
21443         Do not register pending methods if the class is abstract.
21444
21445         * expression.cs (Conditional.DoResolve): Report circular implicit
21446         conversions when we neecd to compute it for conditional
21447         expressions. 
21448
21449         (Is.DoResolve): If the expression is always of the provided type,
21450         flag warning 183.  If the expression can not ever be of the
21451         provided type flag warning 184.
21452
21453         * class.cs: Catch 169 as well.
21454
21455         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
21456         read. 
21457
21458 2002-01-18  Nick Drochak  <ndrochak@gol.com>
21459
21460         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
21461
21462 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
21463
21464         * interface.cs: (PopulateMethod): Check for pointers being defined
21465         only if the unsafe context is active.
21466         (PopulateProperty): ditto.
21467         (PopulateIndexer): ditto.
21468
21469         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
21470         specified.  If pointers are present, make sure that they are
21471         present in an unsafe context.
21472         (Constructor, Constructor.Define): ditto.
21473         (Field, Field.Define): ditto.
21474         (Property, Property.Define): ditto.
21475         (Event, Event.Define): ditto.
21476
21477         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
21478         hashtable if there are classes or structs defined.
21479
21480         * expression.cs (LocalVariableReference.DoResolve): Simplify this
21481         code, as the constant resolution moved.
21482
21483         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
21484         the metadata, so we can flag error 133. 
21485
21486         * decl.cs (MemberCore.UnsafeOK): New function to test that a
21487         pointer is being declared in an unsafe context.
21488
21489 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
21490
21491         * modifiers.cs (Modifiers.Check): Require a Location argument.
21492         Report error 227 for Unsafe use.
21493
21494         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
21495
21496         * statement.cs (For.Emit): If the test is null, then report that
21497         we do `return', as we wont reach anything afterwards.
21498
21499         (Switch.SwitchGoverningType): Track the expression that matched
21500         the conversion.
21501
21502         * driver.cs: Allow negative numbers as an error code to flag.
21503
21504         * cs-parser.jay: Handle 1551.
21505
21506         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
21507
21508 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21509
21510         * cs-parser.jay: Report 1518 (type declaration can only contain
21511         class, struct, interface, enum or delegate)
21512
21513         (switch_label): Report 1523 (keywords `case' or `default' must
21514         preced code)
21515
21516         (opt_switch_sections): Report 1522 (empty switch)
21517
21518         * driver.cs: Report 1515 (response file specified multiple times)
21519         Report 1516 (Source file specified multiple times).
21520
21521         * expression.cs (Argument.Resolve): Signal 1510
21522
21523         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
21524         access not allowed in static code)
21525
21526 2002-01-11  Ravi Pratap  <ravi@ximian.com>
21527
21528         * typemanager.cs (IsPointerType): Utility method which we are going
21529         to need a lot.
21530
21531         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
21532         the object type, so we take care of that.
21533
21534         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
21535
21536         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
21537         added to non-params parameters :-)
21538
21539         * typemanager.cs (CSharpName): Include 'void' type too. 
21540
21541         (void_ptr_type): Include in the set of core types.
21542
21543         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
21544         duplicating code.
21545
21546         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
21547         an unsafe context.
21548
21549         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
21550         completely forgotten about it.
21551
21552 2002-01-10  Ravi Pratap  <ravi@ximian.com>
21553
21554         * cs-parser.jay (pointer_type): Add. This begins our implementation
21555         of parsing rules for unsafe code.
21556
21557         (unsafe_statement): Implement.
21558
21559         (embedded_statement): Modify to include the above.
21560
21561         * statement.cs (Unsafe): Implement new class for unsafe blocks.
21562
21563         * codegen.cs (EmitContext.InUnsafe): Add. This determines
21564         if the current context is an unsafe one.
21565
21566         * cs-parser.jay (local_variable_pointer_type): Since local variable types
21567         are handled differently, we need separate rules for them.
21568
21569         (local_variable_declaration): Update to use local_variable_pointer_type
21570         to allow variable declarations of unmanaged pointer types.
21571
21572         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
21573         in unsafe contexts.
21574
21575         * ../errors/cs0214.cs : Add.
21576
21577 2002-01-16  Nick Drochak  <ndrochak@gol.com>
21578
21579         * makefile: remove 'response' file when cleaning.
21580
21581 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
21582
21583         * cs-parser.jay: Report 1524.
21584
21585 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
21586
21587         * typemanager.cs (RegisterMethod): drop checking if we have
21588         registered this from here
21589
21590 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
21591
21592         * class.cs (Method.EmitDestructor): Implement calling our base
21593         destructor. 
21594
21595         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
21596         value of InFinally.
21597
21598         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
21599         this routine and will wrap the call in a try/catch block.  Deal
21600         with the case.
21601
21602 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
21603
21604         * ecore.cs (Expression.MemberLookup): instead of taking a
21605         parameter `same_type' that was used to tell whether we could
21606         access private members we compute our containing type from the
21607         EmitContext.
21608
21609         (FieldExpr): Added partial support for volatile fields.  This does
21610         not work for volatile fields exposed from assemblies, as I can not
21611         figure out how to extract the modreq from it.
21612
21613         Updated all the source files to use this.
21614
21615         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
21616         because it is referenced by MemberLookup very often. 
21617
21618 2002-01-09  Ravi Pratap  <ravi@ximian.com>
21619
21620         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
21621         TypeBuilder.GetCustomAttributes to retrieve what we need.
21622
21623         Get rid of redundant default_member_attr_type as this is the same as
21624         default_member_type which already exists.
21625
21626         * interface.cs, attribute.cs : Update accordingly.
21627
21628 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
21629
21630         * typemanager.cs: Enable IndexerPropertyName again.  It does not
21631         work for TYpeBuilders though.  Ravi, can you please fix this?
21632
21633         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
21634
21635         * expression.cs (Argument.Emit): Handle the case of ref objects
21636         being passed to ref functions;  
21637
21638         (ParameterReference.EmitLoad): Loads the content of the pointer
21639         without dereferencing.
21640
21641 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21642
21643         * cs-tokenizer.cs: Implemented the pre-processing expressions.
21644
21645 2002-01-08  Ravi Pratap  <ravi@ximian.com>
21646
21647         * class.cs (Indexer.DefineMethod): Incorporate the interface
21648         type in the name of the method if we are doing explicit interface
21649         implementation.
21650
21651         * expression.cs (ConversionExists): Remove as it is completely obsolete.
21652
21653         (BetterConversion): Fix extremely trivial bug where we were referring to
21654         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
21655         again !
21656
21657         * ../errors/bug16.cs : Add although we have fixed it.
21658
21659 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
21660
21661         * expression.cs (BaseIndexer): Begin implementation.
21662
21663         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
21664
21665         * cs-parser.jay (indexer_declarator): Use qualified_identifier
21666         production directly to remove a shift/reduce, and implement
21667         explicit interface implementation.
21668
21669         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
21670         after a floating point suffix.
21671
21672         * expression.cs (DoNumericPromotions): Improved the conversion for
21673         uint/uint.  If we have a constant, we avoid doing a typecast to a
21674         larger type.
21675
21676         * class.cs (Indexer): Implement explicit interface implementation
21677         for indexers.
21678
21679 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
21680
21681         * class.cs: make the default instance constructor public and hidebysig.
21682
21683 2001-01-03  Ravi Pratap  <ravi@ximian.com>
21684
21685         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
21686         so we can call it from elsewhere.
21687
21688         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
21689         we emit it internally if the class has a defined indexer; otherwise the user
21690         emits it by decorating the class definition with the DefaultMemberAttribute.
21691
21692         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
21693         attribute is not used on a type which defines an indexer.
21694
21695         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
21696         character when we skip whitespace.
21697
21698         * ../errors/cs0646.cs : Add.
21699
21700 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
21701
21702         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
21703         again. 
21704
21705         * makefile: Add practical target `mcs3.exe' which builds the third
21706         generation compiler. 
21707
21708         * expression.cs (New): Fix structures constructor calling.
21709
21710         * class.cs (Property, Method, Indexer): Emit Final flag on the
21711         method if we are an interface implementation and we are not
21712         abstract. 
21713
21714         * ecore.cs (PropertyExpr): New public field `IsBase', tells
21715         whether this property is referencing a `base' method.
21716
21717         * expression.cs (Invocation.EmitCall): take an extra argument:
21718         is_base, this is used to determine whether the `call' or
21719         `callvirt' opcode should be used.
21720
21721
21722         * delegate.cs: update EmitCall.
21723
21724         * class.cs (Method.Define): Set NewSlot for the cases where we are
21725         not implementing an interface method.
21726
21727         (Property.Define): ditto.
21728
21729 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
21730
21731         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
21732         'r'.  Allows mcs to parse itself fully.
21733
21734 2002-01-02  Ravi Pratap  <ravi@ximian.com>
21735
21736         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
21737         of the number of initializers that require the InitializeArray method.
21738
21739         (CheckIndices): Store the Expression in all cases - not the plain value. Also
21740         update the above field where necessary.
21741
21742         (MakeByteBlob): Update accordingly.
21743
21744         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
21745         greater than 2.
21746
21747         (EmitDynamicInitializers): Update in accordance with the new optimization.
21748
21749         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
21750         same OpCode applies.
21751
21752         * cs-parser.jay : Fix some glaring errors I introduced.
21753
21754 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
21755
21756         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
21757         so that we can check for name clashes there too.
21758
21759         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
21760         for interface indexers.
21761
21762         * interfaces.cs (Define): Emit the default member attribute.
21763
21764         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
21765         variable was being referred to while setting the value ;-)
21766
21767 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
21768
21769         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
21770         byte-by-byte information when we know the data is zero.
21771
21772         Make the block always a multiple of 4, because
21773         DefineInitializedData has a bug.
21774
21775         * assign.cs: Fix, we should assign from the temporary, not from
21776         the source. 
21777
21778         * expression.cs (MakeByteBlob): Fix my incorrect code.
21779
21780 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
21781
21782         * typemanager.cs (EnumToUnderlying): This function is used to get
21783         the underlying type from an enumeration, because it does not
21784         always work. 
21785
21786         * constant.cs: Use the I4_S form for values between -128 and 127.
21787
21788         * statement.cs (Block.LookupLabel): Looks up a label.
21789         (Block): Drop support for labeled blocks.
21790
21791         (LabeledStatement): New kind of statement that represents a label
21792         only.
21793
21794         (Goto): Finally implement this bad boy.
21795
21796         * cs-parser.jay: Update to reflect new mechanism to implement
21797         labels.
21798
21799 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
21800
21801         * codegen.cs (EmitContext.This): a codegen property that keeps the
21802         a single instance of this instead of creating many different this
21803         instances. 
21804
21805         * delegate.cs (Delegate.DoResolve): Update to use the property;
21806
21807         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
21808
21809         * expression.cs (BaseAccess.DoResolve): Ditto.
21810
21811 2001-12-29  Ravi Pratap  <ravi@ximian.com>
21812
21813         * typemanager.cs (methodimpl_attr_type): Add to hold the type
21814         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
21815
21816         (InitCoreTypes): Update accordingly.
21817
21818         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
21819         so we can quickly store the state.
21820
21821         (ApplyAttributes): Set the correct implementation flags
21822         for InternalCall methods.
21823
21824 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
21825
21826         * expression.cs (EmitCall): if a method is not virtual, then do
21827         not use callvirt on it.
21828
21829         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
21830         user defined stuff) requires the use of stobj, which takes an
21831         address on the stack instead of an array and an index.  So emit
21832         the Ldelema operation for it.
21833
21834         (EmitStoreOpcode): Use stobj for valuetypes.
21835
21836         (UnaryMutator.EmitCode): Use the right 1 value depending on
21837         whether we are dealing with int64/uint64, float or doubles.
21838
21839         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
21840         constructors that I implemented last night.
21841
21842         (Constructor.IsDefault): Fix to work properly for static
21843         constructors.
21844
21845         * cs-parser.jay (CheckDef): report method signature errors.
21846         Update error number 103 to be 132.
21847
21848         * decl.cs: New AdditionResult enumeration value: MethodExists.
21849         Although we do this check for methods later on in the semantic
21850         analysis, catching repeated default constructors is so easy that
21851         we catch these here. 
21852
21853         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
21854         promotions code.
21855
21856         (ParameterReference.EmitAssign, Emit): handle
21857         bools as bytes.
21858
21859         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
21860         (ArrayAccess.EmitStoreOpcode): ditto.
21861
21862         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
21863
21864         * expression.cs (MakeByteBlob): Complete all the missing types
21865         (uint, short, ushort, byte, sbyte)
21866
21867         * class.cs: Only init instance field initializers on instance
21868         constructors. 
21869
21870         Rename `constructors' to instance_constructors. 
21871
21872         (TypeContainer.AddConstructor): Only add constructors to the list
21873         if it is not static.
21874
21875         Make sure that we handle default_static_constructor independently
21876         everywhere where we handle instance_constructors
21877
21878 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
21879
21880         * class.cs: Do not lookup or create a base initializer for a
21881         static constructor.
21882
21883         (ConstructorInitializer.Resolve): use the proper type to lookup
21884         for constructors.
21885
21886         * cs-parser.jay: Report error 1585 (modifiers between type and name).
21887
21888         * enum.cs, interface.cs: Remove CloseType, this is taken care by
21889         in DeclSpace. 
21890
21891         * decl.cs: CloseType is now an virtual method, the default
21892         implementation just closes this type.
21893
21894 2001-12-28  Ravi Pratap  <ravi@ximian.com>
21895
21896         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
21897         to PreserveSig by default. Also emit HideBySig on such methods.
21898
21899         Basically, set the defaults to standard values.
21900
21901         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
21902         argument, if candidate is better, it can't be worse than the best !
21903
21904         (Invocation): Re-write bits to differentiate between methods being
21905         applicable in their expanded form and their normal form - for params
21906         methods of course.
21907
21908         Get rid of use_standard everywhere as only standard conversions are allowed
21909         in overload resolution. 
21910
21911         More spec conformance.
21912
21913 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21914
21915         * driver.cs: Add --timestamp, to see where the compiler spends
21916         most of its time.
21917
21918         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
21919         `this' in static code.
21920
21921         (SimpleName.DoResolve): Implement in terms of a helper function
21922         that allows static-references to be passed upstream to
21923         MemberAccess.
21924
21925         (Expression.ResolveWithSimpleName): Resolve specially simple
21926         names when called by MemberAccess to implement the special
21927         semantics. 
21928
21929         (Expression.ImplicitReferenceConversion): Handle conversions from
21930         Null to reference types before others, as Null's type is
21931         System.Object. 
21932
21933         * expression.cs (Invocation.EmitCall): Handle the special case of
21934         calling methods declared on a reference type from a ValueType
21935         (Base classes System.Object and System.Enum)
21936
21937         (MemberAccess.Resolve): Only perform lookups on Enumerations if
21938         the left hand side is a TypeExpr, not on every enumeration. 
21939
21940         (Binary.Resolve): If types are reference types, then do a cast to
21941         object on operators != and == of both arguments.
21942
21943         * typemanager.cs (FindMembers): Extract instance and static
21944         members if requested.
21945
21946         * interface.cs (PopulateProperty): Use void_type instead of null
21947         as the return type for the setter method.
21948
21949         (PopulateIndexer): ditto.
21950
21951 2001-12-27  Ravi Pratap  <ravi@ximian.com>
21952
21953         * support.cs (ReflectionParameters): Fix minor bug where we
21954         were examining the wrong parameter for the ParamArray attribute.
21955
21956         Cope with requests for the type of the parameter at position
21957         greater than the params parameter's. We now return the element
21958         type of the params array as that makes more sense.
21959
21960         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
21961         accordingly as we no longer have to extract the element type
21962         ourselves.
21963
21964         (Invocation.OverloadResolve): Update.
21965
21966 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
21967
21968         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
21969         against IEnumerator, test whether the return value is a descendant
21970         of the IEnumerator interface.
21971
21972         * class.cs (Indexer.Define): Use an auxiliary method to implement
21973         the other bits of the method definition.  Begin support for
21974         explicit interface implementation.
21975
21976         (Property.DefineMethod): Use TypeManager.void_type instead of null
21977         for an empty return value.
21978
21979 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
21980
21981         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
21982         dealing with a FieldExpr which is composed of a FieldBuilder, in
21983         the code path we did extract the constant, but we should have
21984         obtained the underlying value to be able to cast it (otherwise we
21985         end up in an infinite loop, this is what Ravi was running into).
21986
21987         (ArrayCreation.UpdateIndices): Arrays might be empty.
21988
21989         (MemberAccess.ResolveMemberAccess): Add support for section
21990         14.5.4.1 that deals with the special case of E.I when E is a type
21991         and something else, that I can be a reference to a static member.
21992
21993         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
21994         handle a particular array type to create byte blobs, it is just
21995         something we dont generate byteblobs for.
21996
21997         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
21998         arguments. 
21999
22000         * location.cs (Push): remove the key from the hashtable that we
22001         are about to add.   This happens for empty files.
22002
22003         * driver.cs: Dispose files after we have parsed them.
22004
22005         (tokenize): new function that only runs the tokenizer on its
22006         input, for speed testing.
22007
22008 2001-12-26  Ravi Pratap  <ravi@ximian.com>
22009
22010         * class.cs (Event.Define): Define the private field only if there
22011         are no accessors defined.
22012
22013         * expression.cs (ResolveMemberAccess): If there is no associated
22014         field with the event, that means we have an event defined with its
22015         own accessors and we should flag error cs0070 since transforming
22016         ourselves into a field is not valid in that case.
22017
22018         * ecore.cs (SimpleName.DoResolve): Same as above.
22019
22020         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
22021         and charset to sane values.
22022
22023 2001-12-25  Ravi Pratap  <ravi@ximian.com>
22024
22025         * assign.cs (DoResolve): Perform check on events only if they 
22026         are being accessed outside the declaring type.
22027
22028         * cs-parser.jay (event_declarations): Update rules to correctly
22029         set the type of the implicit parameter etc.
22030
22031         (add_accessor, remove_accessor): Set current local parameters.
22032
22033         * expression.cs (Binary): For delegate addition and subtraction,
22034         cast the return value from the method into the appropriate delegate
22035         type.
22036
22037 2001-12-24  Ravi Pratap  <ravi@ximian.com>
22038
22039         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
22040         of these as the workaround is unnecessary.
22041
22042         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
22043         delegate data - none of that is needed at all.
22044
22045         Re-write bits to extract the instance expression and the delegate method
22046         correctly.
22047
22048         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
22049         on delegates too.
22050
22051         * attribute.cs (ApplyAttributes): New method to take care of common tasks
22052         of attaching attributes instead of duplicating code everywhere.
22053
22054         * everywhere : Update code to do attribute emission using the above method.
22055
22056 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22057
22058         * expression.cs (IsParamsMethodApplicable): if there are not
22059         parameters, return immediately.
22060
22061         * ecore.cs: The 0 literal can be implicity converted to an enum
22062         type. 
22063
22064         (SimpleName.DoResolve): First lookup the type, then lookup the
22065         members. 
22066
22067         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
22068         want to get its address.  If the InstanceExpression is not
22069         addressable, store the result in a temporary variable, then get
22070         the address of it.
22071
22072         * codegen.cs: Only display 219 errors on warning level or above. 
22073
22074         * expression.cs (ArrayAccess): Make it implement the
22075         IMemoryLocation interface.
22076
22077         (Binary.DoResolve): handle the operator == (object a, object b)
22078         and operator != (object a, object b) without incurring into a
22079         BoxedCast (because 5 != o should never be performed).
22080
22081         Handle binary enumerator operators.
22082
22083         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
22084         value type, otherwise use Ldelem_ref.
22085
22086         Use precomputed names;
22087
22088         (AddressOf): Implement address of
22089
22090         * cs-parser.jay (labeled_statement): Fix recursive block
22091         addition by reworking the production.
22092
22093         * expression.cs (New.DoEmit): New has a special case:
22094                 
22095                  If we are dealing with a ValueType, we have a few
22096                  situations to deal with:
22097                 
22098                     * The target of New is a ValueType variable, that is
22099                       easy, we just pass this as the variable reference
22100                 
22101                     * The target of New is being passed as an argument,
22102                       to a boxing operation or a function that takes a
22103                       ValueType.
22104                 
22105                       In this case, we need to create a temporary variable
22106                       that is the argument of New.
22107
22108
22109 2001-12-23  Ravi Pratap  <ravi@ximian.com>
22110
22111         * rootcontext.cs (LookupType): Check that current_type is not null before
22112         going about looking at nested types.
22113
22114         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
22115         not implement the IAssignMethod interface any more.
22116
22117         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
22118         where we tranform them into FieldExprs if they are being resolved from within
22119         the declaring type.
22120
22121         * ecore.cs (SimpleName.DoResolve): Do the same here.
22122
22123         * assign.cs (DoResolve, Emit): Clean up code considerably. 
22124
22125         * ../errors/bug10.cs : Add.
22126
22127         * ../errors/cs0070.cs : Add.
22128
22129         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
22130
22131         * assign.cs : Get rid of EventIsLocal everywhere.
22132
22133 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
22134
22135         * ecore.cs (ConvertIntLiteral): finished the implementation.
22136
22137         * statement.cs (SwitchLabel): Convert the value we are using as a
22138         key before looking up the table.
22139
22140 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22141
22142         * codegen.cs (EmitTopBlock): Require a Location argument now.
22143
22144         * cs-parser.jay (constructor_declarator): We need to setup
22145         current_local_parameters before we parse the
22146         opt_constructor_initializer, to allow the variables to be bound
22147         to the constructor arguments.
22148
22149         * rootcontext.cs (LookupType): First lookup nested classes in our
22150         class and our parents before we go looking outside our class.
22151
22152         * expression.cs (ConstantFold): Extract/debox the values at the
22153         beginnning. 
22154
22155         * rootcontext.cs (EmitCode): Resolve the constants first before we
22156         resolve the types.  This is not really needed, but it helps debugging.
22157
22158         * statement.cs: report location.
22159
22160         * cs-parser.jay: pass location to throw statement.
22161
22162         * driver.cs: Small bug fix.
22163
22164         * report.cs: Updated format to be 4-zero filled digits.
22165
22166 2001-12-22  Ravi Pratap  <ravi@ximian.com>
22167
22168         * expression.cs (CheckIndices): Fix minor bug where the wrong
22169         variable was being referred to ;-)
22170
22171         (DoEmit): Do not call EmitStaticInitializers when the 
22172         underlying type is System.Object.
22173
22174 2001-12-21  Ravi Pratap  <ravi@ximian.com>
22175
22176         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
22177         and do the usual workaround for SRE.
22178
22179         * class.cs (MyEventBuilder.EventType): New member to get at the type
22180         of the event, quickly.
22181
22182         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
22183
22184         * assign.cs (Assign.DoResolve): Handle the case when the target
22185         is an EventExpr and perform the necessary checks.
22186
22187         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
22188         interface.
22189
22190         (SimpleName.MemberStaticCheck): Include check for EventExpr.
22191
22192         (EventExpr): Set the type in the constructor itself since we 
22193         are meant to be born fully resolved.
22194
22195         (EventExpr.Define): Revert code I wrote earlier.
22196                 
22197         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
22198         instance expression is null. The instance expression is a This in that case
22199         or a null, depending on whether it is a static method or not.
22200
22201         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
22202         refers to more than one method.
22203
22204         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
22205         and accordingly flag errors.
22206
22207 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22208
22209         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
22210
22211 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
22212
22213         * location.cs (ToString): Provide useful rutine.
22214
22215 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
22216
22217         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
22218         objects, return the actual integral boxed.
22219
22220         * statement.cs (SwitchLabel): define an ILLabel for each
22221         SwitchLabel. 
22222
22223         (Switch.CheckSwitch): If the value is a Literal, extract
22224         the underlying literal.
22225
22226         Also in the unused hashtable we had, add the SwitchLabel so we can
22227         quickly look this value up.
22228
22229         * constant.cs: Implement a bunch of new constants.  Rewrite
22230         Literal based on this.  Made changes everywhere to adapt to this.
22231
22232         * expression.cs (Expression.MakeByteBlob): Optimize routine by
22233         dereferencing array only once, and also copes with enumrations.
22234
22235         bytes are two bytes wide, not one.
22236
22237         (Cast): Perform constant conversions.
22238
22239         * ecore.cs (TryImplicitIntConversion): Return literals instead of
22240         wrappers to the literals here.
22241
22242         * expression.cs (DoNumericPromotions): long literals can converted
22243         to ulong implicity (this is taken care of elsewhere, but I was
22244         missing this spot).
22245
22246         * ecore.cs (Expression.Literalize): Make the return type Literal,
22247         to improve type checking.
22248
22249         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
22250
22251 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22252
22253         * literal.cs: Revert code from ravi that checked the bounds.  The
22254         bounds are sane by the definition of the type itself. 
22255
22256         * typemanager.cs: Fix implementation of ImplementsInterface.  We
22257         need to actually look up in our parent hierarchy for interfaces
22258         implemented. 
22259
22260         * const.cs: Use the underlying type for enumerations
22261
22262         * delegate.cs: Compute the basename for the delegate creation,
22263         that should fix the delegate test case, and restore the correct
22264         Type Lookup semantics in rootcontext
22265
22266         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
22267         referencing a nested type with the Reflection API is using the "+"
22268         sign. 
22269
22270         * cs-parser.jay: Do not require EOF token at the end.
22271
22272 2001-12-20  Ravi Pratap  <ravi@ximian.com>
22273
22274         * rootcontext.cs (LookupType): Concatenate type names with
22275         a '.' instead of a '+' The test suite passes again.
22276
22277         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
22278         field of the enumeration.
22279
22280         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
22281         the case when the member is an EventExpr.
22282
22283         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
22284         static has an associated instance expression.
22285
22286         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
22287
22288         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
22289
22290         * class.cs (Event.Define): Register event and perform appropriate checks
22291         for error #111.
22292
22293         We define the Add and Remove methods even if the use provides none because
22294         in that case, we provide default implementations ourselves.
22295
22296         Define a private field of the type of the event. This is done by the CSC compiler
22297         and we should be doing it too ;-)
22298
22299         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
22300         More methods we use in code we generate.
22301
22302         (multicast_delegate_type, delegate_type): Two separate types since the distinction
22303         is important.
22304
22305         (InitCoreTypes): Update accordingly for the above.
22306
22307         * class.cs (Event.Emit): Generate code for default accessors that we provide
22308
22309         (EmitDefaultMethod): Do the job in the above.
22310
22311         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
22312         appropriate place.
22313
22314 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
22315
22316         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
22317         builders even if we were missing one.
22318
22319         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
22320         pass the Basename as our class name instead of the Name.  The
22321         basename will be correctly composed for us.
22322
22323         * parameter.cs (Paramters): Now takes a Location argument.
22324
22325         * decl.cs (DeclSpace.LookupType): Removed convenience function and
22326         make all the code call directly LookupType in RootContext and take
22327         this chance to pass the Location information everywhere.
22328
22329         * Everywhere: pass Location information.
22330
22331 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
22332
22333         * class.cs (Constructor.Define): Updated way of detecting the
22334         length of the parameters.
22335
22336         (TypeContainer.DefineType): Use basename as the type name for
22337         nested types.
22338
22339         (TypeContainer.Define): Do not recursively define types here, as
22340         definition is taken care in order by the RootContext.
22341
22342         * tree.cs: Keep track of namespaces in a per-file basis.
22343
22344         * parameter.cs (Parameter.ComputeSignature): Update to use
22345         DeclSpace. 
22346
22347         (Parameters.GetSignature): ditto.
22348
22349         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
22350         instead of a TypeContainer.
22351
22352         (Interface.SemanticAnalysis): Use `this' instead of our parent to
22353         resolve names.  Because we need to be resolve in our context, not
22354         our parents.
22355
22356         * driver.cs: Implement response files.
22357
22358         * class.cs (TypeContainer.DefineType): If we are defined, do not
22359         redefine ourselves.
22360
22361         (Event.Emit): Emit the code for add/remove handlers.
22362         (Event.Define): Save the MethodBuilders for add/remove.
22363
22364         * typemanager.cs: Use pair here too.
22365
22366         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
22367         DictionaryEntry requires the first argument to be non-null.  
22368
22369         (enum_declaration): Compute full name for registering the
22370         enumeration.
22371
22372         (delegate_declaration): Instead of using
22373         formal_parameter_list, use opt_formal_parameter_list as the list
22374         can be empty.
22375
22376         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
22377         (EventParsing): New property that controls whether `add' and
22378         `remove' are returned as tokens or identifiers (for events);
22379
22380 2001-12-19  Ravi Pratap  <ravi@ximian.com>
22381
22382         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
22383         use MyEventBuilder only and let it wrap the real builder for us.
22384
22385         (MyEventBuilder): Revamp constructor etc.
22386
22387         Implement all operations that we perform on EventBuilder in precisely the same
22388         way here too.
22389
22390         (FindMembers): Update to use the EventBuilder member.
22391
22392         (Event.Emit): Update accordingly.
22393
22394 2001-12-18  Ravi Pratap  <ravi@ximian.com>
22395
22396         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
22397         by calling the appropriate methods.
22398
22399         (GetCustomAttributes): Make stubs as they cannot possibly do anything
22400         useful.
22401
22402         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
22403
22404 2001-12-17  Ravi Pratap  <ravi@ximian.com>
22405
22406         * delegate.cs (Delegate.Populate): Check that the return type
22407         and various parameters types are indeed accessible.
22408
22409         * class.cs (Constructor.Define): Same here.
22410
22411         (Field.Define): Ditto.
22412
22413         (Event.Define): Ditto.
22414
22415         (Operator.Define): Check that the underlying Method defined itself
22416         correctly - so it's MethodBuilder should not be null.
22417
22418         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
22419         expression happens to be null.
22420
22421         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
22422         members but as of now we don't seem to be able to do anything really useful with it.
22423
22424         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
22425         not the EventBuilder.
22426
22427 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
22428
22429         * cs-tokenizer.cs: Add support for defines.
22430         Add support for #if, #elif, #else, #endif
22431
22432         (eval_var): evaluates a variable.
22433         (eval): stubbed for evaluating functions.
22434
22435         * cs-parser.jay: Pass the defines information
22436
22437         * driver.cs: Add --define command line option.
22438
22439         * decl.cs: Move MemberCore here.
22440
22441         Make it the base class for DeclSpace.  This allows us to catch and
22442         report 108 and 109 for everything now.
22443
22444         * class.cs (TypeContainer.Define): Extract all the members
22445         before populating and emit the warning 108 (new keyword required
22446         to override) instead of having each member implement this.
22447
22448         (MemberCore.Define): New abstract method, we will be using this in
22449         the warning reporting engine in Populate.
22450
22451         (Operator.Define): Adjust to new MemberCore protocol. 
22452
22453         * const.cs (Const): This does not derive from Expression, it is a
22454         temporary object we use to create fields, it is a MemberCore. 
22455
22456         * class.cs (Method.Define): Allow the entry point to be in a
22457         specific class.
22458
22459         * driver.cs: Rewrite the argument handler to clean it up a bit.
22460
22461         * rootcontext.cs: Made it just an auxiliary namespace feature by
22462         making everything static.
22463
22464         * driver.cs: Adapt code to use RootContext type name instead of
22465         instance variable.
22466
22467         * delegate.cs: Remove RootContext argument.
22468
22469         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
22470         argument. 
22471
22472         * class.cs (Event.Define): The lookup can fail.
22473
22474         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
22475
22476         * expression.cs: Resolve the this instance before invoking the code.
22477
22478 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
22479
22480         * cs-parser.jay: Add a production in element_access that allows
22481         the thing to become a "type" reference.  This way we can parse
22482         things like "(string [])" as a type.
22483
22484         Note that this still does not handle the more complex rules of
22485         casts. 
22486
22487
22488         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
22489
22490         * ecore.cs: (CopyNewMethods): new utility function used to
22491         assemble the list of methods from running FindMembers.
22492
22493         (MemberLookup): Rework FindMembers so that 
22494
22495 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
22496
22497         * class.cs (TypeContainer): Remove Delegates who fail to be
22498         defined.
22499
22500         * delegate.cs (Populate): Verify that we dont get null return
22501         values.   TODO: Check for AsAccessible.
22502
22503         * cs-parser.jay: Use basename to emit error 574 (destructor should
22504         have the same name as container class), not the full name.
22505
22506         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
22507         possible representation.  
22508
22509         Also implements integer type suffixes U and L.
22510
22511 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
22512
22513         * expression.cs (ArrayCreation.DoResolve): We need to do the
22514         argument resolution *always*.
22515
22516         * decl.cs: Make this hold the namespace.  Hold the root context as
22517         well.
22518         (LookupType): Move here.
22519
22520         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
22521
22522         * location.cs (Row, Name): Fixed the code, it was always returning
22523         references to the first file.
22524
22525         * interface.cs: Register properties defined through interfaces.
22526
22527         * driver.cs: Add support for globbing on the command line
22528
22529         * class.cs (Field): Make it derive from MemberCore as well.
22530         (Event): ditto.
22531
22532 2001-12-15  Ravi Pratap  <ravi@ximian.com>
22533
22534         * class.cs (Event::Define): Check that the type of the event is a delegate
22535         type else flag error #66.
22536
22537         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
22538         same.
22539
22540         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
22541         values of EntryPoint, CharSet etc etc.
22542
22543         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
22544
22545         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
22546         be null and we should ignore this. I am not sure if this is really clean. Apparently,
22547         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
22548         which needs this to do its work.
22549
22550         * ../errors/cs0066.cs : Add.
22551
22552 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
22553
22554         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
22555         helper functions.
22556
22557         * class.cs: (MethodSignature.MethodSignature): Removed hack that
22558         clears out the parameters field.
22559         (MemberSignatureCompare): Cleanup
22560
22561         (MemberCore): New base class used to share code between MethodCore
22562         and Property.
22563
22564         (RegisterRequiredImplementations) BindingFlags.Public requires
22565         either BindingFlags.Instace or Static.  Use instance here.
22566
22567         (Property): Refactored code to cope better with the full spec.
22568
22569         * parameter.cs (GetParameterInfo): Return an empty array instead
22570         of null on error.
22571
22572         * class.cs (Property): Abstract or extern properties have no bodies.
22573
22574         * parameter.cs (GetParameterInfo): return a zero-sized array.
22575
22576         * class.cs (TypeContainer.MethodModifiersValid): Move all the
22577         method modifier validation to the typecontainer so we can reuse
22578         this on properties.
22579
22580         (MethodCore.ParameterTypes): return an empty sized array of types.
22581
22582         (Property.Define): Test property modifier validity.
22583
22584         Add tests for sealed/override too.
22585
22586         (Method.Emit): abstract or extern methods have no bodies.
22587
22588 2001-12-14  Ravi Pratap  <ravi@ximian.com>
22589
22590         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
22591         thing.
22592
22593         (Method::Define, ::Emit): Modify accordingly.
22594
22595         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
22596
22597         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
22598
22599         * makefile: Pass in /unsafe.
22600
22601 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
22602
22603         * class.cs (MakeKey): Kill routine.
22604
22605         * class.cs (TypeContainer.Define): Correctly define explicit
22606         method implementations (they require the full interface name plus
22607         the method name).
22608
22609         * typemanager.cs: Deply the PtrHashtable here and stop using the
22610         lame keys.  Things work so much better.
22611
22612         This of course broke everyone who depended on `RegisterMethod' to
22613         do the `test for existance' test.  This has to be done elsewhere.
22614
22615         * support.cs (PtrHashtable): A hashtable that avoid comparing with
22616         the object stupid Equals method (because, that like fails all over
22617         the place).  We still do not use it.
22618
22619         * class.cs (TypeContainer.SetRequiredInterface,
22620         TypeContainer.RequireMethods): Killed these two routines and moved
22621         all the functionality to RegisterRequiredImplementations.
22622
22623         (TypeContainer.RegisterRequiredImplementations): This routine now
22624         registers all the implementations required in an array for the
22625         interfaces and abstract methods.  We use an array of structures
22626         which can be computed ahead of time to reduce memory usage and we
22627         also assume that lookups are cheap as most classes will not
22628         implement too many interfaces.
22629
22630         We also avoid creating too many MethodSignatures.
22631
22632         (TypeContainer.IsInterfaceMethod): Update and optionally does not
22633         clear the "pending" bit if we find that there are problems with
22634         the declaration.
22635
22636         (TypeContainer.VerifyPendingMethods): Update to report errors of
22637         methods that look like implementations but are not.
22638
22639         (TypeContainer.Define): Add support for explicit interface method
22640         implementation. 
22641
22642 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
22643
22644         * typemanager.cs: Keep track of the parameters here instead of
22645         being a feature of the TypeContainer.
22646
22647         * class.cs: Drop the registration of parameters here, as
22648         InterfaceMethods are also interface declarations.
22649
22650         * delegate.cs: Register methods with the TypeManager not only with
22651         the TypeContainer.  This code was buggy.
22652
22653         * interface.cs: Full registation here.
22654
22655 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
22656
22657         * expression.cs: Remove reducer for binary expressions, it can not
22658         be done this way.
22659
22660         * const.cs: Put here the code that used to go into constant.cs
22661
22662         * constant.cs: Put here the code for constants, this is a new base
22663         class for Literals.
22664
22665         * literal.cs: Make Literal derive from Constant.
22666
22667 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
22668
22669         * statement.cs (Return.Emit): Report error 157 if the user
22670         attempts to return from a finally block.
22671
22672         (Return.Emit): Instead of emitting a return, jump to the end of
22673         the function.
22674
22675         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
22676         LocalBuilder to store the result of the function.  ReturnLabel is
22677         the target where we jump.
22678
22679
22680 2001-12-09  Radek Doulik  <rodo@ximian.com>
22681
22682         * cs-parser.jay: remember alias in current namespace
22683
22684         * ecore.cs (SimpleName::DoResolve): use aliases for types or
22685         namespaces
22686
22687         * class.cs (LookupAlias): lookup alias in my_namespace
22688
22689         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
22690         aliases hashtable
22691         (LookupAlias): lookup alias in this and if needed in parent
22692         namespaces
22693
22694 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
22695
22696         * support.cs: 
22697
22698         * rootcontext.cs: (ModuleBuilder) Made static, first step into
22699         making things static.  I need this to avoid passing the
22700         TypeContainer when calling ParameterType.
22701
22702         * support.cs (InternalParameters.ParameterType): Remove ugly hack
22703         that did string manipulation to compute the type and then call
22704         GetType.  Use Parameter.ParameterType instead.
22705
22706         * cs-tokenizer.cs: Consume the suffix for floating values.
22707
22708         * expression.cs (ParameterReference): figure out whether this is a
22709         reference parameter or not.  Kill an extra variable by computing
22710         the arg_idx during emission.
22711
22712         * parameter.cs (Parameters.GetParameterInfo): New overloaded
22713         function that returns whether a parameter is an out/ref value or not.
22714
22715         (Parameter.ParameterType): The type of the parameter (base,
22716         without ref/out applied).
22717
22718         (Parameter.Resolve): Perform resolution here.
22719         (Parameter.ExternalType): The full type (with ref/out applied).
22720
22721         * statement.cs (Using.Emit, Using.EmitExpression): Implement
22722         support for expressions on the using statement.
22723
22724 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
22725
22726         * statement.cs (Using.EmitLocalVariableDecls): Split the
22727         localvariable handling of the using statement.
22728
22729         (Block.EmitMeta): Keep track of variable count across blocks.  We
22730         were reusing slots on separate branches of blocks.
22731
22732         (Try.Emit): Emit the general code block, we were not emitting it. 
22733
22734         Check the type of the declaration to be an IDisposable or
22735         something that can be implicity converted to it. 
22736
22737         Emit conversions if required.
22738
22739         * ecore.cs (EmptyExpression): New utility class.
22740         (Expression.ImplicitConversionExists): New utility function.
22741
22742 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
22743
22744         * statement.cs (Using): Implement.
22745
22746         * expression.cs (LocalVariableReference): Support read only variables.
22747
22748         * statement.cs: Remove the explicit emit for the Leave opcode.
22749         (VariableInfo): Add a readonly field.
22750
22751 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
22752
22753         * ecore.cs (ConvCast): new class used to encapsulate the various
22754         explicit integer conversions that works in both checked and
22755         unchecked contexts.
22756
22757         (Expression.ConvertNumericExplicit): Use new ConvCast class to
22758         properly generate the overflow opcodes.
22759
22760 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22761
22762         * statement.cs: The correct type for the EmptyExpression is the
22763         element_type, not the variable type.  Ravi pointed this out.
22764
22765 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22766
22767         * class.cs (Method::Define): Handle PInvoke methods specially
22768         by using DefinePInvokeMethod instead of the usual one.
22769
22770         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
22771         above to do the task of extracting information and defining the method.
22772
22773 2001-12-04  Ravi Pratap  <ravi@ximian.com>
22774
22775         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
22776         of the condition for string type.
22777
22778         (Emit): Move that here. 
22779
22780         (ArrayCreation::CheckIndices): Keep string literals in their expression
22781         form.
22782
22783         (EmitDynamicInitializers): Handle strings appropriately.
22784
22785 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
22786
22787         * codegen.cs (EmitContext): Replace multiple variables with a
22788         single pointer to the current Switch statement.
22789
22790         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
22791         EmitContext.
22792
22793 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22794
22795         * statement.cs 
22796
22797         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
22798         default'.
22799
22800         (Foreach.Emit): Foreach on arrays was not setting
22801         up the loop variables (for break/continue).
22802
22803         (GotoCase): Semi-implented.
22804
22805 2001-12-03  Ravi Pratap  <ravi@ximian.com>
22806
22807         * attribute.cs (CheckAttribute): Handle system attributes by using
22808         Attribute.GetAttributes to examine information we need.
22809
22810         (GetValidPlaces): Same here.
22811
22812         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
22813
22814         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
22815
22816         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
22817
22818         (Method::Define): Set appropriate flags if we have a DllImport attribute.
22819
22820         (Method::Emit): Handle the case when we are a PInvoke method.
22821
22822 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
22823
22824         * expression.cs: Use ResolveWithSimpleName on compound names.
22825
22826 2001-12-02  Ravi Pratap  <ravi@ximian.com>
22827
22828         * constant.cs (EmitConstant): Make sure we resolve the associated expression
22829         before trying to reduce it.
22830
22831         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
22832
22833         * constant.cs (LookupConstantValue): Implement.
22834
22835         (EmitConstant): Use the above in emitting the constant.
22836
22837         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
22838         that are user-defined by doing a LookupConstantValue on them.
22839
22840         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
22841         too, like above.
22842
22843 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
22844
22845         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
22846
22847         (BaseAccess.DoResolve): Implement.
22848
22849         (MemberAccess.DoResolve): Split this routine into a
22850         ResolveMemberAccess routine that can be used independently
22851
22852 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
22853
22854         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
22855         As that share bits of the implementation.  Is returns a boolean,
22856         while As returns the Type that is being probed.
22857
22858 2001-12-01  Ravi Pratap  <ravi@ximian.com>
22859
22860         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
22861         instead of a Literal - much easier.
22862
22863         (EnumInTransit): Remove - utterly useless :-)
22864
22865         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
22866
22867         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
22868
22869         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
22870         chain when we have no associated expression.
22871
22872 2001-11-30  Ravi Pratap  <ravi@ximian.com>
22873
22874         * constant.cs (Define): Use Location while reporting the errror.
22875
22876         Also emit a warning when 'new' is used and there is no inherited
22877         member to hide.
22878
22879         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
22880         populated.
22881
22882         (LookupEnumValue): Implement to lookup an enum member's value and define it
22883         if necessary.
22884
22885         (Populate): Re-write accordingly to use the above routine.
22886
22887 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
22888
22889         * expression.cs (This): Fix prototype for DoResolveLValue to
22890         override the base class DoResolveLValue.
22891
22892         * cs-parser.cs: Report errors cs574 and cs575 (destructor
22893         declarations) 
22894
22895         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
22896         (we need to load the address of the field here).  This fixes
22897         test-22. 
22898
22899         (FieldExpr.DoResolveLValue): Call the DoResolve
22900         function to initialize the Instance expression.
22901
22902         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
22903         correctly the GetEnumerator operation on a value type.
22904
22905         * cs-parser.jay: Add more simple parsing error catches.
22906
22907         * statement.cs (Switch): Add support for string switches.
22908         Handle null specially.
22909
22910         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
22911
22912 2001-11-28  Ravi Pratap  <ravi@ximian.com>
22913
22914         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
22915
22916         (declare_local_constant): New helper function.
22917
22918         * statement.cs (AddConstant): Keep a separate record of constants
22919
22920         (IsConstant): Implement to determine if a variable is a constant.
22921
22922         (GetConstantExpression): Implement.
22923
22924         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
22925
22926         * statement.cs (IsVariableDefined): Re-write.
22927
22928 2001-11-27  Ravi Pratap  <ravi@ximian.com>
22929
22930         * class.cs (TypeContainer::FindMembers): Look for constants
22931         in the case when we are looking for MemberTypes.Field
22932
22933         * expression.cs (MemberAccess::DoResolve): Check that in the
22934         case we are a FieldExpr and a Literal, we are not being accessed
22935         by an instance reference.
22936
22937         * cs-parser.jay (local_constant_declaration): Implement.
22938
22939         (declaration_statement): Implement for constant declarations.
22940
22941 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
22942
22943         * statement.cs (Switch): Catch double defaults.
22944
22945         (Switch): More work on the switch() statement
22946         implementation.  It works for integral values now, need to finish
22947         string support.
22948
22949
22950 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22951
22952         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
22953         integer literals into other integer literals.  To be used by
22954         switch. 
22955
22956 2001-11-24  Ravi Pratap  <ravi@ximian.com>
22957
22958         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
22959         some memory.
22960
22961         (EmitDynamicInitializers): Cope with the above since we extract data
22962         directly from ArrayData now.
22963
22964         (ExpectInitializers): Keep track of whether initializers are mandatory
22965         or not.
22966
22967         (Bounds): Make it a hashtable to prevent the same dimension being 
22968         recorded for every element in that dimension.
22969
22970         (EmitDynamicInitializers): Fix bug which prevented the Set array method
22971         from being found.
22972
22973         Also fix bug which was causing the indices to be emitted in the reverse
22974         order.
22975
22976 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
22977
22978         * expression.cs (ArrayCreation): Implement the bits that Ravi left
22979         unfinished.  They do not work, because the underlying code is
22980         sloppy.
22981
22982 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
22983
22984         * cs-parser.jay: Remove bogus fixme.
22985
22986         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
22987         on Switch statement.
22988
22989 2001-11-23  Ravi Pratap  <ravi@ximian.com>
22990
22991         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
22992         the same. 
22993
22994         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
22995         parameter. Apparently, any expression is allowed. 
22996
22997         (ValidateInitializers): Update accordingly.
22998
22999         (CheckIndices): Fix some tricky bugs thanks to recursion.
23000
23001         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
23002         I was being completely brain-dead.
23003
23004         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
23005         and re-write acordingly.
23006
23007         (DelegateInvocation): Re-write accordingly.
23008
23009         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
23010
23011         (MakeByteBlob): Handle types more correctly.
23012
23013         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
23014         initialization from expressions but it is incomplete because I am a complete
23015         Dodo :-|
23016
23017 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23018
23019         * statement.cs (If.Emit): Fix a bug that generated incorrect code
23020         on If.  Basically, we have to return `true' (ie, we do return to
23021         our caller) only if both branches of the if return.
23022
23023         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
23024         short-circuit operators, handle them as short circuit operators. 
23025
23026         (Cast.DoResolve): Resolve type.
23027         (Cast.Cast): Take an expression as the target type.
23028
23029         * cs-parser.jay (cast_expression): Remove old hack that only
23030         allowed a limited set of types to be handled.  Now we take a
23031         unary_expression and we resolve to a type during semantic
23032         analysis.
23033
23034         Use the grammar productions from Rhys to handle casts (this is
23035         not complete like Rhys syntax yet, we fail to handle that corner
23036         case that C# has regarding (-x), but we will get there.
23037
23038 2001-11-22  Ravi Pratap  <ravi@ximian.com>
23039
23040         * class.cs (EmitFieldInitializer): Take care of the case when we have a
23041         field which is an array type.
23042
23043         * cs-parser.jay (declare_local_variables): Support array initialization too.
23044
23045         * typemanager.cs (MakeKey): Implement.
23046
23047         (everywhere): Use the above appropriately.
23048
23049         * cs-parser.jay (for_statement): Update for array initialization while
23050         declaring variables.
23051
23052         * ecore.cs : The error message was correct, it's the variable's names that
23053         were misleading ;-) Make the code more readable.
23054
23055         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
23056         the correct type etc.
23057
23058         (ConvertExplicit): Handle Enum types by examining the underlying type.
23059
23060 2001-11-21  Ravi Pratap  <ravi@ximian.com>
23061
23062         * parameter.cs (GetCallingConvention): Always return
23063         CallingConventions.Standard for now.
23064
23065 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
23066
23067         * expression.cs (Binary.ResolveOperator): Update the values of `l'
23068         and `r' after calling DoNumericPromotions.
23069
23070         * ecore.cs: Fix error message (the types were in the wrong order).
23071
23072         * statement.cs (Foreach.ProbeCollectionType): Need to pass
23073         BindingFlags.Instance as well 
23074
23075         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
23076         implicit int literal conversion in an empty cast so that we
23077         propagate the right type upstream.
23078
23079         (UnboxCast): new class used to unbox value types.
23080         (Expression.ConvertExplicit): Add explicit type conversions done
23081         by unboxing.
23082
23083         (Expression.ImplicitNumericConversion): Oops, forgot to test for
23084         the target type before applying the implicit LongLiterals to ULong
23085         literal cast.
23086
23087 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
23088
23089         * cs-parser.jay (for_statement): Reworked the way For works: now
23090         we declare manually any variables that are introduced in
23091         for_initializer to solve the problem of having out-of-band code
23092         emition (that is what got for broken).
23093
23094         (declaration_statement): Perform the actual variable declaration
23095         that used to be done in local_variable_declaration here.
23096
23097         (local_variable_declaration): Do not declare anything, just pass
23098         the information on a DictionaryEntry
23099
23100 2001-11-20  Ravi Pratap  <ravi@ximian.com>
23101
23102         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
23103         re-write of the logic to now make it recursive.
23104
23105         (UpdateIndices): Re-write accordingly.
23106
23107         Store element data in a separate ArrayData list in the above methods.
23108
23109         (MakeByteBlob): Implement to dump the array data into a byte array.
23110
23111 2001-11-19  Ravi Pratap  <ravi@ximian.com>
23112
23113         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
23114         into CheckIndices.
23115
23116         * constant.cs (Define): Implement.
23117
23118         (EmitConstant): Re-write fully.
23119
23120         Pass in location info.
23121
23122         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
23123         respectively.
23124
23125         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
23126         DictionaryEntry since we need location info too.
23127
23128         (constant_declaration): Update accordingly.
23129
23130         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
23131         code into another method : UpdateIndices.
23132
23133 2001-11-18  Ravi Pratap  <ravi@ximian.com>
23134
23135         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
23136         some type checking etc.
23137
23138 2001-11-17  Ravi Pratap  <ravi@ximian.com>
23139
23140         * expression.cs (ArrayCreation::ValidateInitializers): Implement
23141         bits to provide dimension info if the user skips doing that.
23142
23143         Update second constructor to store the rank correctly.
23144
23145 2001-11-16  Ravi Pratap  <ravi@ximian.com>
23146
23147         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
23148         and try to implement.
23149
23150         * ../errors/cs0150.cs : Add.
23151
23152         * ../errors/cs0178.cs : Add.
23153
23154 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
23155
23156         * statement.cs: Implement foreach on multi-dimensional arrays. 
23157
23158         * parameter.cs (Parameters.GetParameterByName): Also lookup the
23159         name of the params argument.
23160
23161         * expression.cs: Use EmitStoreOpcode to get the right opcode while
23162         initializing the array.
23163
23164         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
23165         we can use this elsewhere.
23166
23167         * statement.cs: Finish implementation of foreach for single
23168         dimension arrays.
23169
23170         * cs-parser.jay: Use an out-of-band stack to pass information
23171         around, I wonder why I need this.
23172
23173         foreach_block: Make the new foreach_block the current_block.
23174
23175         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
23176         function used to return a static Parameters structure.  Used for
23177         empty parameters, as those are created very frequently.
23178
23179         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
23180
23181 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23182
23183         * interface.cs : Default modifier is private, not public. The
23184         make verify test passes again.
23185
23186 2001-11-15  Ravi Pratap  <ravi@ximian.com>
23187
23188         * support.cs (ReflectionParameters): Fix logic to determine
23189         whether the last parameter is a params one. Test 9 passes again.
23190
23191         * delegate.cs (Populate): Register the builders we define with
23192         RegisterParameterForBuilder. Test 19 passes again.
23193
23194         * cs-parser.jay (property_declaration): Reference $6 instead
23195         of $$ to get at the location.
23196
23197         (indexer_declaration): Similar stuff.
23198
23199         (attribute): Ditto.
23200
23201         * class.cs (Property): Register parameters for the Get and Set methods
23202         if they exist. Test 23 passes again.
23203
23204         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
23205         call to EmitArguments as we are sure there aren't any params arguments. 
23206         Test 32 passes again.
23207
23208         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
23209         IndexOutOfRangeException. 
23210
23211         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
23212         Test 33 now passes again.
23213
23214 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
23215
23216         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
23217         broke a bunch of things.  Will have to come up with a better way
23218         of tracking locations.
23219
23220         * statement.cs: Implemented foreach for single dimension arrays.
23221
23222 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23223
23224         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
23225         an error.  This removes the lookup from the critical path.
23226
23227         * cs-parser.jay: Removed use of temporary_loc, which is completely
23228         broken. 
23229
23230 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
23231
23232         * support.cs (ReflectionParameters.ParameterModifier): Report
23233         whether the argument is a PARAMS argument or not.
23234
23235         * class.cs: Set the attribute `ParamArrayAttribute' on the
23236         parameter argument.
23237
23238         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
23239         and cons_param_array_attribute (ConstructorInfo for
23240         ParamArrayAttribute)., 
23241
23242         * codegen.cs: Emit the return using the `Return' statement, that
23243         way we can report the error correctly for missing return values. 
23244
23245         * class.cs (Method.Emit): Clean up.
23246
23247         * expression.cs (Argument.Resolve): Take another argument: the
23248         location where this argument is used.  Notice that this is not
23249         part of the "Argument" class as to reduce the size of the
23250         structure (we know the approximate location anyways).
23251
23252         Test if the argument is a variable-reference, if not, then
23253         complain with a 206.
23254
23255         (Argument.Emit): Emit addresses of variables.
23256
23257         (Argument.FullDesc): Simplify.
23258
23259         (Invocation.DoResolve): Update for Argument.Resolve.
23260
23261         (ElementAccess.DoResolve): ditto.
23262
23263         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
23264         method should be virtual, as this method is always virtual.
23265
23266         (NewDelegate.DoResolve): Update for Argument.Resolve.
23267
23268         * class.cs (ConstructorInitializer.DoResolve): ditto.
23269
23270         * attribute.cs (Attribute.Resolve): ditto.
23271
23272 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
23273
23274         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
23275
23276         * expression.cs (ParameterReference): Drop IStackStorage and implement
23277         IAssignMethod instead. 
23278
23279         (LocalVariableReference): ditto.
23280
23281         * ecore.cs (FieldExpr): Drop IStackStorage and implement
23282         IAssignMethod instead. 
23283
23284 2001-11-13  Miguel de Icaza <miguel@ximian.com>
23285
23286         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
23287         enumerations that are used in heavily used structures derive from
23288         byte in a laughable and pathetic attempt to reduce memory usage.
23289         This is the kind of pre-optimzations that you should not do at
23290         home without adult supervision.
23291
23292         * expression.cs (UnaryMutator): New class, used to handle ++ and
23293         -- separatedly from the other unary operators.  Cleans up the
23294         code, and kills the ExpressionStatement dependency in Unary.
23295
23296         (Unary): Removed `method' and `Arguments' from this class, making
23297         it smaller, and moving it all to SimpleCall, so I can reuse this
23298         code in other locations and avoid creating a lot of transient data
23299         strucutres when not required.
23300
23301         * cs-parser.jay: Adjust for new changes.
23302
23303 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
23304
23305         * enum.cs (Enum.Populate): If there is a failure during
23306         definition, return
23307
23308         * cs-parser.jay (opt_enum_base): we used to catch type errors
23309         here, but this is really incorrect.  The type error should be
23310         catched during semantic analysis.
23311
23312 2001-12-11  Ravi Pratap  <ravi@ximian.com>
23313
23314         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
23315         current_local_parameters as expected since I, in my stupidity, had forgotten
23316         to do this :-)
23317
23318         * attribute.cs (GetValidPlaces): Fix stupid bug.
23319
23320         * class.cs (Method::Emit): Perform check on applicability of attributes.
23321
23322         (Constructor::Emit): Ditto.
23323
23324         (Field::Emit): Ditto.
23325
23326         (Field.Location): Store location information.
23327
23328         (Property, Event, Indexer, Operator): Ditto.
23329
23330         * cs-parser.jay (field_declaration): Pass in location for each field.
23331
23332         * ../errors/cs0592.cs : Add.
23333
23334 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23335
23336         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
23337
23338         (InitCoreTypes): Update accordingly.
23339
23340         (RegisterAttrType, LookupAttr): Implement.
23341
23342         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
23343         info about the same.
23344
23345         (Resolve): Update to populate the above as necessary.
23346
23347         (Error592): Helper.
23348
23349         (GetValidPlaces): Helper to the above.
23350
23351         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
23352
23353         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
23354
23355 2001-11-12  Ravi Pratap  <ravi@ximian.com>
23356
23357         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
23358
23359         * ../errors/cs0617.cs : Add.
23360
23361 2001-11-11  Ravi Pratap  <ravi@ximian.com>
23362
23363         * enum.cs (Emit): Rename to Populate to be more consistent with what
23364         we expect it to do and when exactly it is called.
23365
23366         * class.cs, rootcontext.cs : Update accordingly.
23367
23368         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
23369         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
23370
23371         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
23372
23373         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
23374         of a fieldinfo using the above, when dealing with a FieldBuilder.
23375
23376 2001-11-10  Ravi Pratap  <ravi@ximian.com>
23377
23378         * ../errors/cs0031.cs : Add.
23379
23380         * ../errors/cs1008.cs : Add.
23381
23382         * ../errrors/cs0543.cs : Add.
23383
23384         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
23385         enum type.
23386
23387         (FindMembers): Implement.
23388
23389         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
23390         enums and delegates too.
23391
23392         (enum_types): Rename to builder_to_enum.
23393
23394         (delegate_types): Rename to builder_to_delegate.
23395
23396         * delegate.cs (FindMembers): Implement.
23397
23398 2001-11-09  Ravi Pratap  <ravi@ximian.com>
23399
23400         * typemanager.cs (IsEnumType): Implement.
23401
23402         * enum.cs (Emit): Re-write parts to account for the underlying type
23403         better and perform checking etc.
23404
23405         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
23406         of the underlying type.
23407
23408         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
23409         value
23410
23411         * enum.cs (error31): Helper to report error #31.
23412
23413         * cs-parser.jay (enum_declaration): Store location of each member too.
23414
23415         * enum.cs (member_to_location): New hashtable. 
23416
23417         (AddEnumMember): Update location hashtable.
23418
23419         (Emit): Use the location of each member while reporting errors.
23420
23421 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
23422
23423         * cs-parser.jay: A for_initializer if is a
23424         local_variable_declaration really ammount to have an implicit
23425         block with the variable declaration and no initializer for for.
23426
23427         * statement.cs (For.Emit): Cope with null initializers.
23428
23429         This fixes the infinite loop on for initializers.
23430
23431 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
23432
23433         * enum.cs: More cleanup.
23434
23435         * ecore.cs: Remove dead code.
23436
23437         * class.cs (Property.Emit): More simplification.
23438         (Event.Emit): ditto.
23439
23440         Reworked to have less levels of indentation.
23441
23442 2001-11-08  Ravi Pratap  <ravi@ximian.com>
23443
23444         * class.cs (Property): Emit attributes.
23445
23446         (Field): Ditto.
23447
23448         (Event): Ditto.
23449
23450         (Indexer): Ditto.
23451
23452         (Operator): Ditto.
23453
23454         * enum.cs (Emit): Ditto.
23455
23456         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
23457         Enums too.
23458
23459         * class.cs (Field, Event, etc.): Move attribute generation into the
23460         Emit method everywhere.
23461
23462         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
23463         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
23464         as we had no way of defining nested enums !
23465
23466         * rootcontext.cs : Adjust code accordingly.
23467
23468         * typemanager.cs (AddEnumType): To keep track of enum types separately.
23469
23470 2001-11-07  Ravi Pratap  <ravi@ximian.com>
23471
23472         * expression.cs (EvalConstantExpression): Move into ecore.cs
23473
23474         * enum.cs (Enum): Rename some members and make them public and readonly
23475         according to our convention.
23476
23477         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
23478         nothing else.
23479
23480         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
23481
23482         (Enum::Emit): Write a simple version for now which doesn't try to compute
23483         expressions. I shall modify this to be more robust in just a while.
23484
23485         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
23486
23487         (TypeContainer::CloseType): Create the Enum types too.
23488
23489         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
23490
23491         * expression.cs (EvalConstantExpression): Get rid of completely.
23492
23493         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
23494         user-defined values and other cases.
23495
23496         (IsValidEnumLiteral): Helper function.
23497
23498         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
23499         out there in the case we had a literal FieldExpr.
23500
23501         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
23502
23503         (Literalize): Revamp a bit to take two arguments.
23504
23505         (EnumLiteral): New class which derives from Literal to wrap enum literals.
23506
23507 2001-11-06  Ravi Pratap  <ravi@ximian.com>
23508
23509         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
23510
23511         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
23512
23513         (Resolve): Use the above to ensure we have proper initializers.
23514
23515 2001-11-05  Ravi Pratap  <ravi@ximian.com>
23516
23517         * expression.cs (Expression::EvalConstantExpression): New method to 
23518         evaluate constant expressions.
23519
23520         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
23521
23522 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
23523
23524         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
23525         in an array.
23526
23527         (Binary.ResolveOperator): Handle operator != (object a, object b)
23528         and operator == (object a, object b);
23529
23530         (Binary.DoNumericPromotions): Indicate whether the numeric
23531         promotion was possible.
23532
23533         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
23534         Implement.  
23535
23536         Made the ArrayAccess implement interface IAssignMethod instead of
23537         IStackStore as the order in which arguments are passed reflects
23538         this.
23539
23540         * assign.cs: Instead of using expr.ExprClass to select the way of
23541         assinging, probe for the IStackStore/IAssignMethod interfaces.
23542
23543         * typemanager.cs: Load InitializeArray definition.
23544
23545         * rootcontext.cs (RootContext.MakeStaticData): Used to define
23546         static data that can be used to initialize arrays. 
23547
23548 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
23549
23550         * expression.cs: Handle operator== and operator!= for booleans.
23551
23552         (Conditioal.Reduce): Implement reducer for the ?: operator.
23553
23554         (Conditional.Resolve): Implement dead code elimination.
23555
23556         (Binary.Resolve): Catch string literals and return a new
23557         concatenated string.
23558
23559         (Unary.Reduce): Implement reduction of unary expressions.
23560
23561         * ecore.cs: Split out the expression core handling here.
23562
23563         (Expression.Reduce): New method used to perform constant folding
23564         and CSE.  This is needed to support constant-expressions. 
23565
23566         * statement.cs (Statement.EmitBoolExpression): Pass true and false
23567         targets, and optimize for !x.
23568
23569 2001-11-04  Ravi Pratap  <ravi@ximian.com>
23570
23571         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
23572         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
23573         set custom atttributes.
23574
23575         * literal.cs (Literal::GetValue): New abstract method to return the actual
23576         value of the literal, cast as an object.
23577
23578         (*Literal): Implement GetValue method.
23579
23580         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
23581         expressions to the arraylist but objects of type Argument.
23582
23583         * class.cs (TypeContainer::Emit): Emit our attributes too.
23584
23585         (Method::Emit, Constructor::Emit): Ditto.
23586
23587         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
23588         to be ignoring earlier.
23589
23590 2001-11-03  Ravi Pratap  <ravi@ximian.com>
23591
23592         * attribute.cs (AttributeSection::Define): Implement to do the business
23593         of constructing a CustomAttributeBuilder.
23594
23595         (Attribute): New trivial class. Increases readability of code.  
23596
23597         * cs-parser.jay : Update accordingly.
23598
23599         (positional_argument_list, named_argument_list, named_argument): New rules
23600
23601         (attribute_arguments): Use the above so that we are more correct.
23602
23603 2001-11-02  Ravi Pratap  <ravi@ximian.com>
23604
23605         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
23606         to perform all checks for a method with a params parameter.
23607
23608         (Invocation::OverloadResolve): Update to use the above method and therefore
23609         cope correctly with params method invocations.
23610
23611         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
23612         params too.
23613
23614         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
23615         constructors in our parent too because we can't afford to miss out on 
23616         protected ones ;-)
23617
23618         * attribute.cs (AttributeSection): New name for the class Attribute
23619
23620         Other trivial changes to improve readability.
23621
23622         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
23623         use the new class names.
23624
23625 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23626
23627         * class.cs (Method::Define): Complete definition for params types too
23628
23629         (Indexer::Define): Ditto.
23630
23631         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
23632         Cope everywhere with a request for info about the array parameter.
23633
23634 2001-11-01  Ravi Pratap  <ravi@ximian.com>
23635
23636         * tree.cs (RecordNamespace): Fix up to check for the correct key.
23637
23638         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
23639         local_variable_type to extract the string corresponding to the type.
23640
23641         (local_variable_type): Fixup the action to use the new helper method.
23642
23643         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
23644         go.
23645
23646         * expression.cs : Clean out code which uses the above.
23647
23648 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23649
23650         * typemanager.cs (RegisterMethod): Check if we already have an existing key
23651         and bale out if necessary by returning a false.
23652
23653         (RegisterProperty): Ditto.
23654
23655         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
23656         and print out appropriate error messages.
23657
23658         * interface.cs (everywhere): Ditto.
23659
23660         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
23661         location to constructor.
23662
23663         * class.cs (Property, Event, Indexer): Update accordingly.
23664
23665         * ../errors/cs111.cs : Added.
23666
23667         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
23668         of a method, as laid down by the spec.
23669
23670         (Invocation::OverloadResolve): Use the above method.
23671
23672 2001-10-31  Ravi Pratap  <ravi@ximian.com>
23673
23674         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
23675         now take a TypeContainer and a Parameters object.
23676
23677         (ParameterData): Modify return type of ParameterModifier method to be 
23678         Parameter.Modifier and not a string.
23679
23680         (ReflectionParameters, InternalParameters): Update accordingly.
23681
23682         * expression.cs (Argument::GetParameterModifier): Same here.
23683
23684         * support.cs (InternalParameters::ParameterType): Find a better way of determining
23685         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
23686         symbol in it at all so maybe this is only for now.
23687
23688 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23689
23690         * support.cs (InternalParameters): Constructor now takes an extra argument 
23691         which is the actual Parameters class.
23692
23693         (ParameterDesc): Update to provide info on ref/out modifiers.
23694
23695         * class.cs (everywhere): Update call to InternalParameters to pass in
23696         the second argument too.
23697
23698         * support.cs (ParameterData): Add ParameterModifier, which is a method 
23699         to return the modifier info [ref/out etc]
23700
23701         (InternalParameters, ReflectionParameters): Implement the above.
23702
23703         * expression.cs (Argument::ParameterModifier): Similar function to return
23704         info about the argument's modifiers.
23705
23706         (Invocation::OverloadResolve): Update to take into account matching modifiers 
23707         too.
23708
23709         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
23710         a new SetFormalParameters object which we pass to InternalParameters.
23711
23712 2001-10-30  Ravi Pratap  <ravi@ximian.com>
23713
23714         * expression.cs (NewArray): Merge into the ArrayCreation class.
23715
23716 2001-10-29  Ravi Pratap  <ravi@ximian.com>
23717
23718         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
23719         NewUserdefinedArray into one as there wasn't much of a use in having
23720         two separate ones.
23721
23722         * expression.cs (Argument): Change field's name to ArgType from Type.
23723
23724         (Type): New readonly property which returns the proper type, taking into 
23725         account ref/out modifiers.
23726
23727         (everywhere): Adjust code accordingly for the above.
23728
23729         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
23730         whether we are emitting for a ref or out parameter.
23731
23732         * expression.cs (Argument::Emit): Use the above field to set the state.
23733
23734         (LocalVariableReference::Emit): Update to honour the flag and emit the
23735         right stuff.
23736
23737         * parameter.cs (Attributes): Set the correct flags for ref parameters.
23738
23739         * expression.cs (Argument::FullDesc): New function to provide a full desc.
23740
23741         * support.cs (ParameterData): Add method ParameterDesc to the interface.
23742
23743         (ReflectionParameters, InternalParameters): Implement the above method.
23744
23745         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
23746         reporting errors.
23747
23748         (Invocation::FullMethodDesc): Ditto. 
23749
23750 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
23751
23752         * cs-parser.jay: Add extra production for the second form of array
23753         creation. 
23754
23755         * expression.cs (ArrayCreation): Update to reflect the above
23756         change. 
23757
23758         * Small changes to prepare for Array initialization.
23759
23760 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
23761
23762         * typemanager.cs (ImplementsInterface): interface might be null;
23763         Deal with this problem;
23764
23765         Also, we do store negative hits on the cache (null values), so use
23766         this instead of calling t.GetInterfaces on the type everytime.
23767
23768 2001-10-28  Ravi Pratap  <ravi@ximian.com>
23769
23770         * typemanager.cs (IsBuiltinType): New method to help determine the same.
23771
23772         * expression.cs (New::DoResolve): Get rid of array creation code and instead
23773         split functionality out into different classes.
23774
23775         (New::FormArrayType): Move into NewBuiltinArray.
23776
23777         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
23778         quite useless.
23779
23780         (NewBuiltinArray): New class to handle creation of built-in arrays.
23781
23782         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
23783         account creation of one-dimensional arrays.
23784
23785         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
23786
23787         (NewUserdefinedArray::DoResolve): Implement.
23788
23789         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
23790
23791         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
23792         we maintain inside the TypeManager. This is necessary to perform lookups on the
23793         module builder.
23794
23795         (LookupType): Update to perform GetType on the module builders too.     
23796
23797         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
23798
23799         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
23800
23801 2001-10-23  Ravi Pratap  <ravi@ximian.com>
23802
23803         * expression.cs (New::DoResolve): Implement guts of array creation.
23804
23805         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
23806
23807 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
23808
23809         * expression.cs: Fix bug I introduced lsat night that broke
23810         Delegates. 
23811
23812         (Expression.Resolve): Report a 246 error (can not resolve name)
23813         if we find a SimpleName in the stream.
23814
23815         (Expression.ResolveLValue): Ditto.
23816
23817         (Expression.ResolveWithSimpleName): This function is a variant of
23818         ResolveName, this one allows SimpleNames to be returned without a
23819         warning.  The only consumer of SimpleNames is MemberAccess
23820
23821 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
23822
23823         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
23824         might arrive here.  I have my doubts that this is correct.
23825
23826         * statement.cs (Lock): Implement lock statement.
23827
23828         * cs-parser.jay: Small fixes to support `lock' and `using'
23829
23830         * cs-tokenizer.cs: Remove extra space
23831
23832         * driver.cs: New flag --checked, allows to turn on integer math
23833         checking. 
23834
23835         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
23836         Threading.Monitor.Exit 
23837
23838 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
23839
23840         * expression.cs (IndexerAccess::DoResolveLValue): Set the
23841         Expression Class to be IndexerAccess.
23842
23843         Notice that Indexer::DoResolve sets the eclass to Value.
23844
23845 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
23846
23847         * class.cs (TypeContainer::Emit): Emit code for indexers.
23848
23849         * assign.cs (IAssignMethod): New interface implemented by Indexers
23850         and Properties for handling assignment.
23851
23852         (Assign::Emit): Simplify and reuse code. 
23853
23854         * expression.cs (IndexerAccess, PropertyExpr): Implement
23855         IAssignMethod, clean up old code. 
23856
23857 2001-10-22  Ravi Pratap  <ravi@ximian.com>
23858
23859         * typemanager.cs (ImplementsInterface): New method to determine if a type
23860         implements a given interface. Provides a nice cache too.
23861
23862         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
23863         method.
23864
23865         (ConvertReferenceExplicit): Ditto.
23866
23867         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
23868         various methods, with correct names etc.
23869
23870         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
23871         Operator.UnaryNegation.
23872
23873         * cs-parser.jay (operator_declarator): Be a little clever in the case where
23874         we have a unary plus or minus operator.
23875
23876         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
23877         UnaryMinus.
23878
23879         * everywhere : update accordingly.
23880
23881         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
23882         respectively.
23883
23884         * class.cs (Method::Define): For the case where we are implementing a method
23885         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
23886         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
23887
23888 2001-10-21  Ravi Pratap  <ravi@ximian.com>
23889
23890         * interface.cs (FindMembers): Implement to work around S.R.E
23891         lameness.
23892
23893         * typemanager.cs (IsInterfaceType): Implement.
23894
23895         (FindMembers): Update to handle interface types too.
23896
23897         * expression.cs (ImplicitReferenceConversion): Re-write bits which
23898         use IsAssignableFrom as that is not correct - it doesn't work.
23899
23900         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
23901         and accordingly override EmitStatement.
23902
23903         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
23904         using the correct logic :-)
23905
23906 2001-10-19  Ravi Pratap  <ravi@ximian.com>
23907
23908         * ../errors/cs-11.cs : Add to demonstrate error -11 
23909
23910 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
23911
23912         * assign.cs (Assign::Resolve): Resolve right hand side first, and
23913         then pass this as a hint to ResolveLValue.
23914
23915         * expression.cs (FieldExpr): Add Location information
23916
23917         (FieldExpr::LValueResolve): Report assignment to readonly
23918         variable. 
23919
23920         (Expression::ExprClassFromMemberInfo): Pass location information.
23921
23922         (Expression::ResolveLValue): Add new method that resolves an
23923         LValue. 
23924
23925         (Expression::DoResolveLValue): Default invocation calls
23926         DoResolve. 
23927
23928         (Indexers): New class used to keep track of indexers in a given
23929         Type. 
23930
23931         (IStackStore): Renamed from LValue, as it did not really describe
23932         what this did.  Also ResolveLValue is gone from this interface and
23933         now is part of Expression.
23934
23935         (ElementAccess): Depending on the element access type
23936
23937         * typemanager.cs: Add `indexer_name_type' as a Core type
23938         (System.Runtime.CompilerServices.IndexerNameAttribute)
23939
23940         * statement.cs (Goto): Take a location.
23941
23942 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23943
23944         * delegate.cs (Delegate::VerifyDelegate): New method to verify
23945         if two delegates are compatible.
23946
23947         (NewDelegate::DoResolve): Update to take care of the case when
23948         we instantiate a delegate from another delegate.
23949
23950         * typemanager.cs (FindMembers): Don't even try to look up members
23951         of Delegate types for now.
23952
23953 2001-10-18  Ravi Pratap  <ravi@ximian.com>
23954
23955         * delegate.cs (NewDelegate): New class to take care of delegate
23956         instantiation.
23957
23958         * expression.cs (New): Split the delegate related code out into 
23959         the NewDelegate class.
23960
23961         * delegate.cs (DelegateInvocation): New class to handle delegate 
23962         invocation.
23963
23964         * expression.cs (Invocation): Split out delegate related code into
23965         the DelegateInvocation class.
23966
23967 2001-10-17  Ravi Pratap  <ravi@ximian.com>
23968
23969         * expression.cs (New::DoResolve): Implement delegate creation fully
23970         and according to the spec.
23971
23972         (New::DoEmit): Update to handle delegates differently.
23973
23974         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
23975         because of which we were printing out arguments in reverse order !
23976
23977         * delegate.cs (VerifyMethod): Implement to check if the given method
23978         matches the delegate.
23979
23980         (FullDelegateDesc): Implement.
23981
23982         (VerifyApplicability): Implement.
23983
23984         * expression.cs (Invocation::DoResolve): Update to accordingly handle
23985         delegate invocations too.
23986
23987         (Invocation::Emit): Ditto.
23988
23989         * ../errors/cs1593.cs : Added.
23990
23991         * ../errors/cs1594.cs : Added.
23992
23993         * delegate.cs (InstanceExpression, TargetMethod): New properties.
23994
23995 2001-10-16  Ravi Pratap  <ravi@ximian.com>
23996
23997         * typemanager.cs (intptr_type): Core type for System.IntPtr
23998
23999         (InitCoreTypes): Update for the same.
24000
24001         (iasyncresult_type, asynccallback_type): Ditto.
24002
24003         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
24004         correct.
24005
24006         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
24007         too.
24008
24009         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
24010         the builders for the 4 members of a delegate type :-)
24011
24012         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
24013         type.
24014
24015         * expression.cs (New::DoResolve): Implement guts for delegate creation.
24016
24017         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
24018
24019 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
24020
24021         * statement.cs (Break::Emit): Implement.   
24022         (Continue::Emit): Implement.
24023
24024         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24025         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24026         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
24027         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
24028         end loop
24029
24030         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
24031         properties that track the label for the current loop (begin of the
24032         loop and end of the loop).
24033
24034 2001-10-15  Ravi Pratap  <ravi@ximian.com>
24035
24036         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
24037         use of emitting anything at all.
24038
24039         * class.cs, rootcontext.cs : Get rid of calls to the same.
24040
24041         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
24042
24043         (Populate): Define the constructor correctly and set the implementation
24044         attributes.
24045
24046         * typemanager.cs (delegate_types): New hashtable to hold delegates that
24047         have been defined.
24048
24049         (AddDelegateType): Implement.
24050
24051         (IsDelegateType): Implement helper method.
24052
24053         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
24054
24055         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
24056         and accordingly handle it.
24057
24058         * delegate.cs (Populate): Take TypeContainer argument.
24059         Implement bits to define the Invoke method. However, I still haven't figured out
24060         how to take care of the native int bit :-(
24061
24062         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
24063         Qualify the name of the delegate, not its return type !
24064
24065         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
24066         conversion.
24067
24068         (StandardConversionExists): Checking for array types turns out to be recursive.
24069
24070         (ConvertReferenceExplicit): Implement array conversion.
24071
24072         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
24073
24074 2001-10-12  Ravi Pratap  <ravi@ximian.com>
24075
24076         * cs-parser.jay (delegate_declaration): Store the fully qualified
24077         name as it is a type declaration.
24078
24079         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
24080         readonly.
24081
24082         (DefineDelegate): Renamed from Define. Does the same thing essentially,
24083         as TypeContainer::DefineType.
24084
24085         (Populate): Method in which all the definition of the various methods (Invoke)
24086         etc is done.
24087
24088         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
24089         see.
24090
24091         (CloseDelegate): Finally creates the delegate.
24092
24093         * class.cs (TypeContainer::DefineType): Update to define delegates.
24094         (Populate, Emit and CloseType): Do the same thing here too.
24095
24096         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
24097         delegates in all these operations.
24098
24099 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
24100
24101         * expression.cs: LocalTemporary: a new expression used to
24102         reference a temporary that has been created.
24103
24104         * assign.cs: Handle PropertyAccess back here, so that we can
24105         provide the proper semantic access to properties.
24106
24107         * expression.cs (Expression::ConvertReferenceExplicit): Implement
24108         a few more explicit conversions. 
24109
24110         * modifiers.cs: `NEW' modifier maps to HideBySig.
24111
24112         * expression.cs (PropertyExpr): Make this into an
24113         ExpressionStatement, and support the EmitStatement code path. 
24114
24115         Perform get/set error checking, clean up the interface.
24116
24117         * assign.cs: recognize PropertyExprs as targets, and if so, turn
24118         them into toplevel access objects.
24119
24120 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
24121
24122         * expression.cs: PropertyExpr::PropertyExpr: use work around the
24123         SRE.
24124
24125         * typemanager.cs: Keep track here of our PropertyBuilders again to
24126         work around lameness in SRE.
24127
24128 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
24129
24130         * expression.cs (LValue::LValueResolve): New method in the
24131         interface, used to perform a second resolution pass for LValues. 
24132
24133         (This::DoResolve): Catch the use of this in static methods.
24134
24135         (This::LValueResolve): Implement.
24136
24137         (This::Store): Remove warning, assigning to `this' in structures
24138         is 
24139
24140         (Invocation::Emit): Deal with invocation of
24141         methods on value types.  We need to pass the address to structure
24142         methods rather than the object itself.  (The equivalent code to
24143         emit "this" for structures leaves the entire structure on the
24144         stack instead of a pointer to it). 
24145
24146         (ParameterReference::DoResolve): Compute the real index for the
24147         argument based on whether the method takes or not a `this' pointer
24148         (ie, the method is static).
24149
24150         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
24151         value types returned from functions when we need to invoke a
24152         method on the sturcture.
24153
24154
24155 2001-10-11  Ravi Pratap  <ravi@ximian.com>
24156
24157         * class.cs (TypeContainer::DefineType): Method to actually do the business of
24158         defining the type in the Modulebuilder or Typebuilder. This is to take
24159         care of nested types which need to be defined on the TypeBuilder using
24160         DefineNestedMethod.
24161
24162         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
24163         methods in RootContext, only ported to be part of TypeContainer.
24164
24165         (TypeContainer::GetInterfaceOrClass): Ditto.
24166
24167         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
24168
24169         * interface.cs (Interface::DefineInterface): New method. Does exactly
24170         what RootContext.CreateInterface did earlier, only it takes care of nested types 
24171         too.
24172
24173         (Interface::GetInterfaces): Move from RootContext here and port.
24174
24175         (Interface::GetInterfaceByName): Same here.
24176
24177         * rootcontext.cs (ResolveTree): Re-write.
24178
24179         (PopulateTypes): Re-write.
24180
24181         * class.cs (TypeContainer::Populate): Populate nested types too.
24182         (TypeContainer::Emit): Emit nested members too.
24183
24184         * typemanager.cs (AddUserType): Do not make use of the FullName property,
24185         instead just use the name argument passed in as it is already fully
24186         qualified.
24187
24188         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
24189         to TypeContainer mapping to see if a type is user-defined.
24190
24191         * class.cs (TypeContainer::CloseType): Implement. 
24192
24193         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
24194         the default constructor.
24195
24196         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
24197         twice.
24198
24199         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
24200
24201         * interface.cs (CloseType): Create the type here.
24202
24203         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
24204         the hierarchy.
24205
24206         Remove all the methods which are now in TypeContainer.
24207
24208 2001-10-10  Ravi Pratap  <ravi@ximian.com>
24209
24210         * delegate.cs (Define): Re-write bits to define the delegate
24211         correctly.
24212
24213 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
24214
24215         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
24216
24217         * expression.cs (ImplicitReferenceConversion): handle null as well
24218         as a source to convert to any reference type.
24219
24220         * statement.cs (Return): Perform any implicit conversions to
24221         expected return type.  
24222
24223         Validate use of return statement.  
24224
24225         * codegen.cs (EmitContext): Pass the expected return type here.
24226
24227         * class.cs (Method, Constructor, Property): Pass expected return
24228         type to EmitContext.
24229
24230 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
24231
24232         * expression.cs: Make DoResolve take an EmitContext instead of a
24233         TypeContainer.
24234
24235         Replaced `l' and `location' for `loc', for consistency.
24236
24237         (Error, Warning): Remove unneeded Tc argument.
24238
24239         * assign.cs, literal.cs, constant.cs: Update to new calling
24240         convention. 
24241
24242         * codegen.cs: EmitContext now contains a flag indicating whether
24243         code is being generated in a static method or not.
24244
24245         * cs-parser.jay: DecomposeQI, new function that replaces the old
24246         QualifiedIdentifier.  Now we always decompose the assembled
24247         strings from qualified_identifier productions into a group of
24248         memberaccesses.
24249
24250 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
24251
24252         * rootcontext.cs: Deal with field-less struct types correctly now
24253         by passing the size option to Define Type.
24254
24255         * class.cs: Removed hack that created one static field. 
24256
24257 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24258
24259         * statement.cs: Moved most of the code generation here. 
24260
24261 2001-10-09  Ravi Pratap  <ravi@ximian.com>
24262
24263         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
24264         seem very right.
24265
24266         (ElementAccess): Remove useless bits for now - keep checks as the spec
24267         says.
24268
24269 2001-10-08  Ravi Pratap  <ravi@ximian.com>
24270
24271         * expression.cs (ElementAccess::DoResolve): Remove my crap code
24272         and start performing checks according to the spec.
24273
24274 2001-10-07  Ravi Pratap  <ravi@ximian.com>
24275
24276         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
24277         rank_specifiers instead.
24278
24279         (rank_specifiers): Change the order in which the rank specifiers are stored
24280
24281         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
24282
24283         * expression.cs (ElementAccess): Implement the LValue interface too.
24284
24285 2001-10-06  Ravi Pratap  <ravi@ximian.com>
24286
24287         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
24288         except that user defined conversions are not included.
24289
24290         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
24291         perform the conversion of the return type, if necessary.
24292
24293         (New::DoResolve): Check whether we are creating an array or an object
24294         and accordingly do the needful.
24295
24296         (New::Emit): Same here.
24297
24298         (New::DoResolve): Implement guts of array creation.
24299
24300         (New::FormLookupType): Helper function.
24301
24302 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
24303
24304         * codegen.cs: Removed most of the code generation here, and move the
24305         corresponding code generation bits to the statement classes. 
24306
24307         Added support for try/catch/finalize and throw.
24308
24309         * cs-parser.jay: Added support for try/catch/finalize.
24310
24311         * class.cs: Catch static methods having the flags override,
24312         virtual or abstract.
24313
24314         * expression.cs (UserCast): This user cast was not really doing
24315         what it was supposed to do.  Which is to be born in fully resolved
24316         state.  Parts of the resolution were being performed at Emit time! 
24317
24318         Fixed this code.
24319
24320 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24321
24322         * expression.cs: Implicity convert the result from UserCast.
24323
24324 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24325
24326         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
24327         prevented it from working correctly. 
24328
24329         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
24330         merely ConvertImplicit.
24331
24332 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
24333
24334         * typemanager.cs: Make the LookupTypeContainer function static,
24335         and not per-instance.  
24336
24337         * class.cs: Make static FindMembers (the one that takes a Type
24338         argument). 
24339
24340         * codegen.cs: Add EmitForeach here.
24341
24342         * cs-parser.jay: Make foreach a toplevel object instead of the
24343         inline expansion, as we need to perform semantic analysis on it. 
24344
24345 2001-10-05  Ravi Pratap  <ravi@ximian.com>
24346
24347         * expression.cs (Expression::ImplicitUserConversion): Rename to
24348         UserDefinedConversion.
24349
24350         (Expression::UserDefinedConversion): Take an extra argument specifying 
24351         whether we look for explicit user conversions too.
24352
24353         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
24354
24355         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
24356
24357         (ExplicitUserConversion): Make it a call to UserDefinedConversion
24358         with the appropriate arguments.
24359
24360         * cs-parser.jay (cast_expression): Record location too.
24361
24362         * expression.cs (Cast): Record location info.
24363
24364         (Expression::ConvertExplicit): Take location argument.
24365
24366         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
24367         to determine if we are doing explicit conversions.
24368
24369         (UserCast::Emit): Update accordingly.
24370
24371         (Expression::ConvertExplicit): Report an error if everything fails.
24372
24373         * ../errors/cs0030.cs : Add.
24374
24375 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
24376
24377         * modifiers.cs: If the ABSTRACT keyword is present, also set the
24378         virtual and newslot bits. 
24379
24380         * class.cs (TypeContainer::RegisterRequiredImplementations):
24381         Record methods we need.
24382
24383         (TypeContainer::MakeKey): Helper function to make keys for
24384         MethodBases, since the Methodbase key is useless.
24385
24386         (TypeContainer::Populate): Call RegisterRequiredImplementations
24387         before defining the methods.   
24388
24389         Create a mapping for method_builders_to_methods ahead of time
24390         instead of inside a tight loop.
24391
24392         (::RequireMethods):  Accept an object as the data to set into the
24393         hashtable so we can report interface vs abstract method mismatch.
24394
24395 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24396
24397         * report.cs: Make all of it static.
24398
24399         * rootcontext.cs: Drop object_type and value_type computations, as
24400         we have those in the TypeManager anyways.
24401
24402         Drop report instance variable too, now it is a global.
24403
24404         * driver.cs: Use try/catch on command line handling.
24405
24406         Add --probe option to debug the error reporting system with a test
24407         suite. 
24408
24409         * report.cs: Add support for exiting program when a probe
24410         condition is reached.
24411
24412 2001-10-03  Ravi Pratap  <ravi@ximian.com>
24413
24414         * expression.cs (Binary::DoNumericPromotions): Fix the case when
24415         we do a forcible conversion regardless of type, to check if 
24416         ForceConversion returns a null.
24417
24418         (Binary::error19): Use location to report error.
24419
24420         (Unary::error23): Use location here too.
24421
24422         * ../errors/cs0019.cs : Check in.
24423
24424         * ../errors/cs0023.cs : Check in.
24425
24426         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
24427         case of a non-null MethodInfo object with a length of 0 !
24428
24429         (Binary::ResolveOperator): Flag error if overload resolution fails to find
24430         an applicable member - according to the spec :-)
24431         Also fix logic to find members in base types.
24432
24433         (Unary::ResolveOperator): Same here.
24434
24435         (Unary::report23): Change name to error23 and make first argument a TypeContainer
24436         as I was getting thoroughly confused between this and error19 :-)
24437
24438         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
24439         (::FindMostEncompassedType): Implement.
24440         (::FindMostEncompassingType): Implement.
24441         (::StandardConversionExists): Implement.
24442
24443         (UserImplicitCast): Re-vamp. We now need info about most specific
24444         source and target types so that we can do the necessary conversions.
24445
24446         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
24447         mathematical union with no duplicates.
24448
24449 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
24450
24451         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
24452         in order from base classes to child classes, so that we can in
24453         child classes look up in our parent for method names and
24454         attributes (required for handling abstract, virtual, new, override
24455         constructs: we need to instrospect our base class, and if we dont
24456         populate the classes in order, the introspection might be
24457         incorrect.  For example, a method could query its parent before
24458         the parent has any methods and would determine that the parent has
24459         no abstract methods (while it could have had them)).
24460
24461         (RootContext::CreateType): Record the order in which we define the
24462         classes.
24463
24464 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
24465
24466         * class.cs (TypeContainer::Populate): Also method definitions can
24467         fail now, keep track of this.
24468
24469         (TypeContainer::FindMembers): Implement support for
24470         DeclaredOnly/noDeclaredOnly flag.
24471
24472         (Constructor::Emit) Return the ConstructorBuilder.
24473
24474         (Method::Emit) Return the MethodBuilder. 
24475         Check for abstract or virtual methods to be public.
24476
24477         * rootcontext.cs (RootContext::CreateType): Register all the
24478         abstract methods required for the class to be complete and the
24479         interface methods that must be implemented. 
24480
24481         * cs-parser.jay: Report error 501 (method requires body if it is
24482         not marked abstract or extern).
24483
24484         * expression.cs (TypeOf::Emit): Implement.
24485
24486         * typemanager.cs: runtime_handle_type, new global type.
24487
24488         * class.cs (Property::Emit): Generate code for properties.
24489
24490 2001-10-02  Ravi Pratap  <ravi@ximian.com>
24491
24492         * expression.cs (Unary::ResolveOperator): Find operators on base type
24493         too - we now conform exactly to the spec.
24494
24495         (Binary::ResolveOperator): Same here.
24496
24497         * class.cs (Operator::Define): Fix minor quirk in the tests.
24498
24499         * ../errors/cs0215.cs : Added.
24500
24501         * ../errors/cs0556.cs : Added.
24502
24503         * ../errors/cs0555.cs : Added.
24504
24505 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24506
24507         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
24508         single integer which is really efficient
24509
24510 2001-10-01  Ravi Pratap  <ravi@ximian.com>
24511
24512         *  expression.cs (Expression::ImplicitUserConversion): Use location
24513         even in the case when we are examining True operators.
24514  
24515         * class.cs (Operator::Define): Perform extensive checks to conform
24516         with the rules for operator overloading in the spec.
24517
24518         * expression.cs (Expression::ImplicitReferenceConversion): Implement
24519         some of the other conversions mentioned in the spec.
24520
24521         * typemanager.cs (array_type): New static member for the System.Array built-in
24522         type.
24523
24524         (cloneable_interface): For System.ICloneable interface.
24525
24526         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
24527         we start resolving the tree and populating types.
24528
24529         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
24530  
24531 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
24532
24533         * expression.cs (Expression::ExprClassFromMemberInfo,
24534         Expression::Literalize): Create literal expressions from
24535         FieldInfos which are literals.
24536
24537         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
24538         type casts, because they were wrong.  The test suite in tests
24539         caught these ones.
24540
24541         (ImplicitNumericConversion): ushort to ulong requires a widening
24542         cast. 
24543
24544         Int32 constant to long requires widening cast as well.
24545
24546         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
24547         for integers because the type on the stack is not i4.
24548
24549 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
24550
24551         * expression.cs (report118): require location argument. 
24552
24553         * parameter.cs: Do not dereference potential null value.
24554
24555         * class.cs: Catch methods that lack the `new' keyword when
24556         overriding a name.  Report warnings when `new' is used without
24557         anything being there to override.
24558
24559         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
24560
24561         * class.cs: Only add constructor to hashtable if it is non-null
24562         (as now constructors can fail on define).
24563
24564         (TypeManager, Class, Struct): Take location arguments.
24565
24566         Catch field instance initialization in structs as errors.
24567
24568         accepting_filter: a new filter for FindMembers that is static so
24569         that we dont create an instance per invocation.
24570
24571         (Constructor::Define): Catch errors where a struct constructor is
24572         parameterless 
24573
24574         * cs-parser.jay: Pass location information for various new
24575         constructs. 
24576
24577         * delegate.cs (Delegate): take a location argument.
24578
24579         * driver.cs: Do not call EmitCode if there were problesm in the
24580         Definition of the types, as many Builders wont be there. 
24581
24582         * decl.cs (Decl::Decl): Require a location argument.
24583
24584         * cs-tokenizer.cs: Handle properly hex constants that can not fit
24585         into integers, and find the most appropiate integer for it.
24586
24587         * literal.cs: Implement ULongLiteral.
24588
24589         * rootcontext.cs: Provide better information about the location of
24590         failure when CreateType fails.
24591
24592 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
24593
24594         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
24595         as well.
24596
24597         * expression.cs (Binary::CheckShiftArguments): Add missing type
24598         computation.
24599         (Binary::ResolveOperator): Add type to the logical and and logical
24600         or, Bitwise And/Or and Exclusive Or code paths, it was missing
24601         before.
24602
24603         (Binary::DoNumericPromotions): In the case where either argument
24604         is ulong (and most signed types combined with ulong cause an
24605         error) perform implicit integer constant conversions as well.
24606
24607 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24608
24609         * expression.cs (UserImplicitCast): Method should always be
24610         non-null. 
24611         (Invocation::BetterConversion): Simplified test for IntLiteral.
24612
24613         (Expression::ImplicitNumericConversion): Split this routine out.
24614         Put the code that performs implicit constant integer conversions
24615         here. 
24616
24617         (Expression::Resolve): Become a wrapper around DoResolve so we can
24618         check eclass and type being set after resolve.
24619
24620         (Invocation::Badness): Remove this dead function
24621
24622         (Binary::ResolveOperator): Do not compute the expensive argumnets
24623         unless we have a union for it.
24624
24625         (Probe::Emit): Is needs to do an isinst and then
24626         compare against null.
24627
24628         (::CanConvert): Added Location argument.  If the Location argument
24629         is null (Location.Null), then we do not report errors.  This is
24630         used by the `probe' mechanism of the Explicit conversion.  We do
24631         not want to generate an error for something that the user
24632         explicitly requested to be casted.  But the pipeline for an
24633         explicit cast first tests for potential implicit casts.
24634
24635         So for now, if the Location is null, it means `Probe only' to
24636         avoid adding another argument.   Might have to revise this
24637         strategy later.
24638
24639         (ClassCast): New class used to type cast objects into arbitrary
24640         classes (used in Explicit Reference Conversions).
24641
24642         Implement `as' as well.
24643
24644         Reverted all the patches from Ravi below: they were broken:
24645
24646                 * The use of `level' as a mechanism to stop recursive
24647                   invocations is wrong.  That was there just to catch the
24648                   bug with a strack trace but not as a way of addressing
24649                   the problem.
24650
24651                   To fix the problem we have to *understand* what is going
24652                   on and the interactions and come up with a plan, not
24653                   just get things going.
24654
24655                 * The use of the type conversion cache that I proposed
24656                   last night had an open topic: How does this work across
24657                   protection domains.  A user defined conversion might not
24658                   be public in the location where we are applying the
24659                   conversion, a different conversion might be selected
24660                   (ie, private A->B (better) but public B->A (worse),
24661                   inside A, A->B applies, but outside it, B->A will
24662                   apply).
24663
24664                 * On top of that (ie, even if the above is solved),
24665                   conversions in a cache need to be abstract.  Ie, `To
24666                   convert from an Int to a Short use an OpcodeCast', not
24667                   `To convert from an Int to a Short use the OpcodeCast on
24668                   the variable 5' (which is what this patch was doing).
24669
24670 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24671
24672         * expression.cs (Invocation::ConversionExists): Re-write to use
24673         the conversion cache
24674
24675         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
24676         cache all conversions done, not just user-defined ones.
24677
24678         (Invocation::BetterConversion): The real culprit. Use ConversionExists
24679         to determine if a conversion exists instead of acutually trying to 
24680         perform the conversion. It's faster too.
24681
24682         (Expression::ConvertExplicit): Modify to use ConversionExists to check
24683         and only then attempt the implicit conversion.
24684
24685 2001-09-28  Ravi Pratap  <ravi@ximian.com>
24686
24687         * expression.cs (ConvertImplicit): Use a cache for conversions
24688         already found. Check level of recursion and bail out if necessary.
24689
24690 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
24691
24692         * typemanager.cs (string_concat_string_string, string_concat_object_object):
24693         Export standard methods that we expect for string operations.
24694
24695         * statement.cs (Block::UsageWarning): Track usage of variables and
24696         report the errors for not used variables.
24697
24698         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
24699         operator. 
24700
24701 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24702
24703         * codegen.cs: remove unnneded code 
24704
24705         * expression.cs: Removed BuiltinTypeAccess class
24706
24707         Fix the order in which implicit conversions are
24708         done.  
24709
24710         The previous fixed dropped support for boxed conversions (adding a
24711         test to the test suite now)
24712
24713         (UserImplicitCast::CanConvert): Remove test for source being null,
24714         that code is broken.  We should not feed a null to begin with, if
24715         we do, then we should track the bug where the problem originates
24716         and not try to cover it up here.
24717
24718         Return a resolved expression of type UserImplicitCast on success
24719         rather than true/false.  Ravi: this is what I was talking about,
24720         the pattern is to use a static method as a "constructor" for
24721         objects. 
24722
24723         Also, do not create arguments until the very last minute,
24724         otherwise we always create the arguments even for lookups that
24725         will never be performed. 
24726
24727         (UserImplicitCast::Resolve): Eliminate, objects of type
24728         UserImplicitCast are born in a fully resolved state. 
24729
24730         * typemanager.cs (InitCoreTypes): Init also value_type
24731         (System.ValueType). 
24732
24733         * expression.cs (Cast::Resolve): First resolve the child expression.
24734
24735         (LValue): Add new method AddressOf to be used by
24736         the `&' operator.  
24737
24738         Change the argument of Store to take an EmitContext instead of an
24739         ILGenerator, because things like FieldExpr need to be able to call
24740         their children expression to generate the instance code. 
24741
24742         (Expression::Error, Expression::Warning): Sugar functions for
24743         reporting errors.
24744
24745         (Expression::MemberLookup): Accept a TypeContainer instead of a
24746         Report as the first argument.
24747
24748         (Expression::ResolvePrimary): Killed.  I still want to improve
24749         this as currently the code is just not right.
24750
24751         (Expression::ResolveMemberAccess): Simplify, but it is still
24752         wrong. 
24753
24754         (Unary::Resolve): Catch errors in AddressOf operators.
24755
24756         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
24757         index to a byte for the short-version, or the compiler will choose
24758         the wrong Emit call, which generates the wrong data.
24759
24760         (ParameterReference::Emit, ::Store): same.
24761
24762         (FieldExpr::AddressOf): Implement.
24763
24764         * typemanager.cs: TypeManager: made public variable instead of
24765         property.
24766
24767         * driver.cs: document --fatal.
24768
24769         * report.cs (ErrorMessage, WarningMessage): new names for the old
24770         Error and Warning classes.
24771
24772         * cs-parser.jay (member_access): Turn built-in access to types
24773         into a normal simplename
24774
24775 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24776
24777         * expression.cs (Invocation::BetterConversion): Fix to cope
24778         with q being null, since this was introducing a bug.
24779
24780         * expression.cs (ConvertImplicit): Do built-in conversions first.
24781
24782 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24783
24784         * expression.cs (UserImplicitCast::Resolve): Fix bug.
24785
24786 2001-09-27  Ravi Pratap  <ravi@ximian.com>
24787
24788         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
24789         I had introduced long ago (what's new ?).
24790
24791         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
24792         the work of all the checking. 
24793         (ConvertImplicit): Call CanConvert and only then create object if necessary.
24794         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
24795
24796         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
24797         that is the right way. 
24798
24799         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
24800         overloading resolution. Use everywhere instead of cutting and pasting code.
24801
24802         (Binary::ResolveOperator): Use MakeUnionSet.
24803
24804         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
24805         we have to convert to bool types. Not complete yet.
24806
24807 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
24808
24809         * typemanager.cs (TypeManager::CSharpName): support ushort.
24810
24811         * expression.cs (Expression::TryImplicitIntConversion): Attempts
24812         to provide an expression that performsn an implicit constant int
24813         conversion (section 6.1.6).
24814         (Expression::ConvertImplicitRequired): Reworked to include
24815         implicit constant expression conversions.
24816
24817         (Expression::ConvertNumericExplicit): Finished.
24818
24819         (Invocation::Emit): If InstanceExpression is null, then it means
24820         that we perform a call on this.
24821
24822 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24823
24824         * expression.cs (Unary::Emit): Remove some dead code.
24825         (Probe): Implement Resolve and Emit for `is'.
24826         (Expression::ConvertImplicitRequired): Attempt to do constant
24827         expression conversions here.  Maybe should be moved to
24828         ConvertImplicit, but I am not sure.
24829         (Expression::ImplicitLongConstantConversionPossible,
24830         Expression::ImplicitIntConstantConversionPossible): New functions
24831         that tell whether is it possible to apply an implicit constant
24832         expression conversion.
24833
24834         (ConvertNumericExplicit): Started work on explicit numeric
24835         conversions.
24836
24837         * cs-parser.jay: Update operator constants.
24838
24839         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
24840         (Parameters::GetSignature): Hook up VerifyArgs here.
24841         (Parameters::VerifyArgs): Verifies that no two arguments have the
24842         same name. 
24843
24844         * class.cs (Operator): Update the operator names to reflect the
24845         ones that the spec expects (as we are just stringizing the
24846         operator names).
24847
24848         * expression.cs (Unary::ResolveOperator): Fix bug: Use
24849         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
24850         previous usage did only work for our methods.
24851         (Expression::ConvertImplicit): Handle decimal implicit numeric
24852         conversions as well.
24853         (Expression::InternalTypeConstructor): Used to invoke constructors
24854         on internal types for default promotions.
24855
24856         (Unary::Emit): Implement special handling for the pre/post
24857         increment/decrement for overloaded operators, as they need to have
24858         the same semantics as the other operators.
24859
24860         (Binary::ResolveOperator): ditto.
24861         (Invocation::ConversionExists): ditto.
24862         (UserImplicitCast::Resolve): ditto.
24863
24864 2001-09-26  Ravi Pratap  <ravi@ximian.com>
24865
24866         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
24867         operator, return after emitting body. Regression tests pass again !
24868
24869         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
24870         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
24871         (Invocation::OverloadResolve): Ditto.
24872         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
24873
24874         * everywhere : update calls to the above methods accordingly.
24875
24876 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
24877
24878         * assign.cs (Assign): Make it inherit from ExpressionStatement.
24879
24880         * expression.cs (ExpressionStatement): New base class used for
24881         expressions that can appear in statements, so that we can provide
24882         an alternate path to generate expression that do not leave a value
24883         on the stack.
24884
24885         (Expression::Emit, and all the derivatives): We no longer return
24886         whether a value is left on the stack or not.  Every expression
24887         after being emitted leaves a single value on the stack.
24888
24889         * codegen.cs (EmitContext::EmitStatementExpression): Use the
24890         facilties of ExpressionStatement if possible.
24891
24892         * cs-parser.jay: Update statement_expression.
24893
24894 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
24895
24896         * driver.cs: Change the wording of message
24897
24898 2001-09-25  Ravi Pratap  <ravi@ximian.com>
24899
24900         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
24901         the type of the expression to the return type of the method if
24902         we have an overloaded operator match ! The regression tests pass again !
24903         (Unary::ResolveOperator): Ditto.
24904
24905         * expression.cs (Invocation::ConversionExists): Correct the member lookup
24906         to find "op_Implicit", not "implicit" ;-)
24907         (UserImplicitCast): New class to take care of user-defined implicit conversions.
24908         (ConvertImplicit, ForceConversion): Take TypeContainer argument
24909
24910         * everywhere : Correct calls to the above accordingly.
24911
24912         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
24913         (ConvertImplicit): Do user-defined conversion if it exists.
24914
24915 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
24916
24917         * assign.cs: track location.
24918         (Resolve): Use implicit conversions on assignment.
24919
24920         * literal.cs: Oops.  Not good, Emit of short access values should
24921         pass (Bytes) or the wrong argument will be selected.
24922
24923         * expression.cs (Unary::Emit): Emit code for -expr.
24924
24925         (Unary::ResolveOperator): Handle `Substract' for non-constants
24926         (substract from zero from the non-constants).
24927         Deal with Doubles as well. 
24928
24929         (Expression::ConvertImplicitRequired): New routine that reports an
24930         error if no implicit conversion exists. 
24931
24932         (Invocation::OverloadResolve): Store the converted implicit
24933         expressions if we make them
24934
24935 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24936
24937         * class.cs (ConstructorInitializer): Take a Location argument.
24938         (ConstructorBaseInitializer): Same here.
24939         (ConstructorThisInitializer): Same here.
24940
24941         * cs-parser.jay : Update all calls accordingly.
24942
24943         * expression.cs (Unary, Binary, New): Take location argument.
24944         Update accordingly everywhere.
24945
24946         * cs-parser.jay : Update all calls to the above to take a location
24947         argument.
24948
24949         * class.cs : Ditto.
24950
24951 2001-09-24  Ravi Pratap  <ravi@ximian.com>
24952
24953         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
24954         (Invocation::BetterConversion): Same here
24955         (Invocation::ConversionExists): Ditto.
24956
24957         (Invocation::ConversionExists): Implement.
24958
24959 2001-09-22  Ravi Pratap  <ravi@ximian.com>
24960
24961         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
24962         Also take an additional TypeContainer argument.
24963
24964         * All over : Pass in TypeContainer as argument to OverloadResolve.
24965
24966         * typemanager.cs (CSharpName): Update to check for the string type and return
24967         that too.
24968
24969         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
24970         a given method.
24971
24972 2001-09-21  Ravi Pratap  <ravi@ximian.com>
24973
24974         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
24975         (Invocation::BetterFunction): Implement.
24976         (Invocation::BetterConversion): Implement.
24977         (Invocation::ConversionExists): Skeleton, no implementation yet.
24978
24979         Okay, things work fine !
24980
24981 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
24982
24983         * typemanager.cs: declare and load enum_type, delegate_type and
24984         void_type. 
24985
24986         * expression.cs (Expression::Emit): Now emit returns a value that
24987         tells whether a value is left on the stack or not.  This strategy
24988         might be reveted tomorrow with a mechanism that would address
24989         multiple assignments.
24990         (Expression::report118): Utility routine to report mismatches on
24991         the ExprClass.
24992
24993         (Unary::Report23): Report impossible type/operator combination
24994         utility function.
24995
24996         (Unary::IsIncrementableNumber): Whether the type can be
24997         incremented or decremented with add.
24998         (Unary::ResolveOperator): Also allow enumerations to be bitwise
24999         complemented. 
25000         (Unary::ResolveOperator): Implement ++, !, ~,
25001
25002         (Invocation::Emit): Deal with new Emit convetion.
25003
25004         * All Expression derivatives: Updated their Emit method to return
25005         whether they leave values on the stack or not.
25006
25007         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
25008         stack for expressions that are statements. 
25009
25010 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25011
25012         * expression.cs (LValue): New interface.  Must be implemented by
25013         LValue objects.
25014         (LocalVariableReference, ParameterReference, FieldExpr): Implement
25015         LValue interface.
25016
25017         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
25018         interface for generating code, simplifies the code.
25019
25020 2001-09-20  Ravi Pratap  <ravi@ximian.com>
25021
25022         * expression.cs (everywhere): Comment out return statements in ::Resolve
25023         methods to avoid the warnings.
25024
25025 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
25026
25027         * driver.cs (parse): Report error 2001 if we can not open the
25028         source file.
25029
25030         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
25031         not resolve it.
25032
25033         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
25034         object. 
25035
25036         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
25037         otherwise nested blocks end up with the same index.
25038
25039         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
25040
25041         * expression.cs:  Instead of having FIXMEs in the Resolve
25042         functions, throw exceptions so it is obvious that we are facing a
25043         bug. 
25044
25045         * cs-parser.jay (invocation_expression): Pass Location information.
25046
25047         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
25048         Use a basename for those routines because .NET does not like paths
25049         on them. 
25050
25051         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
25052         already defined.
25053
25054 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
25055
25056         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
25057         are loading the correct data types (throws an exception if not).
25058         (TypeManager::InitCoreTypes): Use CoreLookupType
25059
25060         * expression.cs (Unary::ResolveOperator): return the child
25061         expression for expressions which are just +expr.
25062         (Unary::ResolveOperator): Return negative literals for -LITERAL
25063         expressions (otherwise they are Unary {Literal}).
25064         (Invocation::Badness): Take into account `Implicit constant
25065         expression conversions'.
25066
25067         * literal.cs (LongLiteral): Implement long literal class.
25068         (IntLiteral): export the `Value' of the intliteral. 
25069
25070 2001-09-19  Ravi Pratap  <ravi@ximian.com>
25071
25072         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
25073
25074         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
25075         instead of 'Operator'
25076
25077         * expression.cs (Binary::ResolveOperator): Update accordingly.
25078         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
25079         and 'Minus'
25080
25081         * cs-parser.jay (unary_expression): Update to use the new names.
25082
25083         * gen-treedump.cs (GetUnary): Same here.
25084
25085         * expression.cs (Unary::Resolve): Implement.
25086         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
25087         operators are found instead of making noise ;-)
25088         (Unary::ResolveOperator): New method to do precisely the same thing which
25089         Binary::ResolveOperator does for Binary expressions.
25090         (Unary.method, .Arguments): Add.
25091         (Unary::OperName): Implement.   
25092         (Unary::ForceConversion): Copy and Paste !
25093
25094         * class.cs (Operator::Define): Fix a small bug for the case when we have 
25095         a unary operator.
25096
25097         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
25098         for the inbuilt operators. Only overloading works for now ;-)
25099
25100 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
25101
25102         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
25103         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
25104
25105         * expression.cs (This::Emit): Implement. 
25106         (This::Resolve): Implement.
25107         (TypeOf:Resolve): Implement.
25108         (Expression::ResolveSimpleName): Add an implicit this to instance
25109         field references. 
25110         (MemberAccess::Resolve): Deal with Parameters and Fields. 
25111         Bind instance variable to Field expressions.
25112         (FieldExpr::Instance): New field used to track the expression that
25113         represents the object instance.
25114         (FieldExpr::Resolve): Track potential errors from MemberLookup not
25115         binding 
25116         (FieldExpr::Emit): Implement.
25117
25118         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
25119         the last instruction contains a return opcode to avoid generating
25120         the last `ret' instruction (this generates correct code, and it is
25121         nice to pass the peverify output).
25122
25123         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
25124         initializer for static and instance variables.
25125         (Constructor::Emit): Allow initializer to be null in the case of
25126         static constructors.  Only emit initializer for instance
25127         constructors. 
25128
25129         (TypeContainer::FindMembers): Return a null array if there are no
25130         matches.
25131
25132         Also fix the code for the MemberTypes.Method branch, as it was not
25133         scanning that for operators (or tried to access null variables before).
25134
25135         * assign.cs (Assign::Emit): Handle instance and static fields. 
25136
25137         * TODO: Updated.
25138
25139         * driver.cs: Stop compilation if there are parse errors.
25140
25141         * cs-parser.jay (constructor_declaration): Provide default base
25142         initializer for non-static constructors.
25143         (constructor_declarator): Do not provide a default base
25144         initializers if none was specified.
25145         Catch the fact that constructors should not have parameters.
25146
25147         * class.cs: Do not emit parent class initializers for static
25148         constructors, that should be flagged as an error.
25149
25150 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25151
25152         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
25153         Move back code into TypeContainer::Populate.
25154
25155 2001-09-18  Ravi Pratap  <ravi@ximian.com>
25156
25157         * class.cs (TypeContainer::AddConstructor): Fix the check to
25158         compare against Name, not Basename. 
25159         (Operator::OpType): Change Plus and Minus to Add and Subtract.
25160
25161         * cs-parser.jay : Update accordingly.
25162
25163         * class.cs (TypeContainer::FindMembers): For the case where we are searching
25164         for methods, don't forget to look into the operators too.
25165         (RegisterMethodBuilder): Helper method to take care of this for
25166         methods, constructors and operators.
25167         (Operator::Define): Completely revamp.
25168         (Operator.OperatorMethod, MethodName): New fields.
25169         (TypeContainer::Populate): Move the registering of builders into
25170         RegisterMethodBuilder.
25171         (Operator::Emit): Re-write.
25172
25173         * expression.cs (Binary::Emit): Comment out code path to emit method
25174         invocation stuff for the case when we have a user defined operator. I am
25175         just not able to get it right !
25176
25177 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25178
25179         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
25180         argument. 
25181
25182         (Expression::MemberLookup): Provide a version that allows to
25183         specify the MemberTypes and BindingFlags. 
25184
25185         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
25186         so it was not fetching variable information from outer blocks.
25187
25188         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
25189         Beforefieldinit as it was buggy.
25190
25191         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
25192         that Ravi put here.  
25193
25194         * class.cs (Constructor::Emit): Only emit if block is not null.
25195         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
25196         deal with this by semantically definining it as if the user had
25197         done it.
25198
25199         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
25200         constructors as we now "emit" them at a higher level.
25201
25202         (TypeContainer::DefineDefaultConstructor): Used to define the
25203         default constructors if none was provided.
25204
25205         (ConstructorInitializer): Add methods Resolve and Emit. 
25206
25207         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
25208
25209 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25210
25211         * class.cs (TypeContainer::EmitDefaultConstructor): Register
25212         the default constructor builder with our hashtable for methodbuilders
25213         to methodcores.
25214
25215         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
25216         and argument_count is 0 in which case we have a match.
25217         (Binary::ResolveOperator): More null checking and miscellaneous coding
25218         style cleanup.
25219
25220 2001-09-17  Ravi Pratap  <ravi@ximian.com>
25221
25222         * rootcontext.cs (IsNameSpace): Compare against null.
25223
25224         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
25225
25226         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
25227         and Unary::Operator.
25228
25229         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
25230         accordingly.
25231
25232         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
25233         we have overloaded operators.
25234         (Binary::ResolveOperator): Implement the part which does the operator overload
25235         resolution.
25236
25237         * class.cs (Operator::Emit): Implement.
25238         (TypeContainer::Emit): Emit the operators we have too.
25239
25240         * expression.cs (Binary::Emit): Update to emit the appropriate code for
25241         the case when we have a user-defined operator.
25242
25243 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
25244
25245         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
25246
25247 2001-09-16  Ravi Pratap  <ravi@ximian.com>
25248
25249         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
25250         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
25251         (Constructor::Emit): Implement.
25252         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
25253         if we have no work to do. 
25254         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
25255         Emit method.
25256
25257         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
25258         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
25259
25260         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
25261         of parent.parent.
25262
25263 2001-09-15  Ravi Pratap  <ravi@ximian.com>
25264
25265         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
25266         in the source.
25267         (Tree::RecordNamespace): Method to do what the name says ;-)
25268         (Tree::Namespaces): Property to get at the namespaces hashtable.
25269
25270         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
25271         keep track.
25272
25273         * rootcontext.cs (IsNamespace): Fixed it :-)
25274
25275 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25276
25277         * class.cs (TypeContainer::FindMembers): Add support for
25278         constructors. 
25279         (MethodCore): New class that encapsulates both the shared aspects
25280         of a Constructor and a Method.  
25281         (Method, Constructor): Factored pieces into MethodCore.
25282
25283         * driver.cs: Added --fatal which makes errors throw exceptions.
25284         Load System assembly as well as part of the standard library.
25285
25286         * report.cs: Allow throwing exceptions on errors for debugging.
25287
25288         * modifiers.cs: Do not use `parent', instead use the real type
25289         container to evaluate permission settings.
25290
25291         * class.cs: Put Ravi's patch back in.  He is right, and we will
25292         have to cope with the
25293
25294 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25295
25296         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
25297         FamORAssem, not FamANDAssem.
25298
25299 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
25300
25301         * driver.cs: Added --parse option that only parses its input files
25302         and terminates.
25303
25304         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
25305         incorrect.  IsTopLevel is not used to tell whether an object is
25306         root_types or not (that can be achieved by testing this ==
25307         root_types).  But to see if this is a top-level *class* (not
25308         necessarly our "toplevel" container). 
25309
25310 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25311
25312         * enum.cs (Enum::Define): Modify to call the Lookup method on the
25313         parent instead of a direct call to GetType.
25314
25315 2001-09-14  Ravi Pratap  <ravi@ximian.com>
25316
25317         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
25318         Modifiers.TypeAttr. This should just be a call to that method.
25319
25320         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
25321         object so that we can determine if we are top-level or not.
25322
25323         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
25324         TypeContainer too.
25325
25326         * enum.cs (Enum::Define): Ditto.
25327
25328         * modifiers.cs (FieldAttr): Re-write.
25329
25330         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
25331         (TypeContainer::HaveStaticConstructor): New property to provide access
25332         to precisely that info.
25333
25334         * modifiers.cs (MethodAttr): Re-write.
25335         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
25336
25337         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
25338         of top-level types as claimed.
25339
25340 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25341
25342         * expression.cs (MemberLookup): Fruitless attempt to lookup
25343         constructors.  Maybe I need to emit default constructors?  That
25344         might be it (currently .NET emits this for me automatically).
25345         (Invocation::OverloadResolve): Cope with Arguments == null.
25346         (Invocation::EmitArguments): new function, shared by the new
25347         constructor and us.
25348         (Invocation::Emit): Handle static and instance methods.  Emit
25349         proper call instruction for virtual or non-virtual invocations.
25350         (New::Emit): Implement.
25351         (New::Resolve): Implement.
25352         (MemberAccess:Resolve): Implement.
25353         (MethodGroupExpr::InstanceExpression): used conforming to the spec
25354         to track instances.
25355         (FieldExpr::Resolve): Set type.
25356
25357         * support.cs: Handle empty arguments.
25358                 
25359         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
25360         SimpleLookup): Auxiliary routines to help parse a qualifier
25361         identifier.  
25362
25363         Update qualifier_identifier rule.
25364
25365         * codegen.cs: Removed debugging messages.
25366
25367         * class.cs: Make this a global thing, this acts just as a "key" to
25368         objects that we might have around.
25369
25370         (Populate): Only initialize method_builders_to_methods once.
25371
25372         * expression.cs (PropertyExpr): Initialize type from the
25373         PropertyType. 
25374
25375         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
25376         Resolve pattern.  Attempt to implicitly convert value to boolean.
25377         Emit code.
25378
25379         * expression.cs: Set the type for the int32/int32 argument case.
25380         (Binary::ResolveOperator): Set the return type to boolean for
25381         comparission operators
25382
25383         * typemanager.cs: Remove debugging print code.
25384
25385         (Invocation::Resolve): resolve type.
25386
25387         * class.cs: Allocate a MemberInfo of the correct size, as the code
25388         elsewhere depends on the test to reflect the correct contents.
25389
25390         (Method::) Keep track of parameters, due to System.Reflection holes
25391
25392         (TypeContainer::Populate): Keep track of MethodBuilders to Method
25393         mapping here.
25394
25395         (TypeContainer::FindMembers): Use ArrayList and then copy an array
25396         of the exact size and return that.
25397
25398         (Class::LookupMethodByBuilder): New function that maps
25399         MethodBuilders to its methods.  Required to locate the information
25400         on methods because System.Reflection bit us again.
25401
25402         * support.cs: New file, contains an interface ParameterData and
25403         two implementations: ReflectionParameters and InternalParameters
25404         used to access Parameter information.  We will need to grow this
25405         as required.
25406
25407         * expression.cs (Invocation::GetParameterData): implement a cache
25408         and a wrapper around the ParameterData creation for methods. 
25409         (Invocation::OverloadResolve): Use new code.
25410
25411 2001-09-13  Ravi Pratap  <ravi@ximian.com>
25412
25413         * class.cs (TypeContainer::EmitField): Remove and move into 
25414         (Field::Define): here and modify accordingly.
25415         (Field.FieldBuilder): New member.
25416         (TypeContainer::Populate): Update accordingly.
25417         (TypeContainer::FindMembers): Implement.
25418
25419 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
25420
25421         * statement.cs: (VariableInfo::VariableType): New field to be
25422         initialized with the full type once it is resolved. 
25423
25424 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
25425
25426         * parameter.cs (GetParameterInfo): Use a type cache to compute
25427         things only once, and to reuse this information
25428
25429         * expression.cs (LocalVariableReference::Emit): Implement.
25430         (OpcodeCast::Emit): fix.
25431
25432         (ParameterReference::Resolve): Implement.
25433         (ParameterReference::Emit): Implement.
25434
25435         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
25436         that are expressions need to stay as Expressions.
25437
25438         * typemanager.cs (CSharpName): Returns the C# name of a type if
25439         possible. 
25440
25441         * expression.cs (Expression::ConvertImplicit): New function that
25442         implements implicit type conversions.
25443
25444         (Expression::ImplicitReferenceConversion): Implements implicit
25445         reference conversions.
25446
25447         (EmptyCast): New type for transparent casts.
25448
25449         (OpcodeCast): New type for casts of types that are performed with
25450         a sequence of bytecodes.
25451
25452         (BoxedCast): New type used for casting value types into reference
25453         types.  Emits a box opcode.
25454
25455         (Binary::DoNumericPromotions): Implements numeric promotions of
25456         and computation of the Binary::Type.
25457
25458         (Binary::EmitBranchable): Optimization.
25459
25460         (Binary::Emit): Implement code emission for expressions.
25461
25462         * typemanager.cs (TypeManager): Added two new core types: sbyte
25463         and byte.
25464
25465 2001-09-12  Ravi Pratap  <ravi@ximian.com>
25466
25467         * class.cs (TypeContainer::FindMembers): Method which does exactly
25468         what Type.FindMembers does, only we don't have to use reflection. No
25469         implementation yet.
25470
25471         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
25472         typecontainer objects as we need to get at them.
25473         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
25474
25475         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
25476         typecontainer object.
25477
25478         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
25479         of just a Report object.
25480
25481 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25482
25483         * class.cs (Event::Define): Go back to using the prefixes "add_" and
25484         "remove_"
25485         (TypeContainer::Populate): Now define the delegates of the type too.
25486         (TypeContainer.Delegates): Property to access the list of delegates defined
25487         in the type.
25488
25489         * delegates.cs (Delegate::Define): Implement partially.
25490
25491         * modifiers.cs (TypeAttr): Handle more flags.
25492
25493 2001-09-11  Ravi Pratap  <ravi@ximian.com>
25494
25495         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
25496         and not <=
25497         (Operator::Define): Re-write logic to get types by using the LookupType method
25498         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
25499         (Indexer::Define): Ditto.
25500         (Event::Define): Ditto.
25501         (Property::Define): Ditto.
25502
25503 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25504
25505         * class.cs (TypeContainer::Populate): Now define operators too. 
25506         (TypeContainer.Operators): New property to access the list of operators
25507         in a type.
25508         (Operator.OperatorMethodBuilder): New member to hold the method builder
25509         for the operator we are defining.
25510         (Operator::Define): Implement.
25511
25512 2001-09-10  Ravi Pratap  <ravi@ximian.com>
25513
25514         * class.cs (Event::Define): Make the prefixes of the accessor methods
25515         addOn_ and removeOn_ 
25516
25517         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
25518         of the location being passed in too. Ideally, this should go later since all
25519         error reporting should be done through the Report object.
25520
25521         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
25522         (Populate): Iterate thru the indexers we have and define them too.
25523         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
25524         for the get and set accessors.
25525         (Indexer::Define): Implement.
25526
25527 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
25528
25529         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
25530         my previous implementation, did not work.
25531
25532         * typemanager.cs: Add a couple of missing types (the longs).
25533
25534         * literal.cs: Use TypeManager.bool_type instead of getting it.
25535
25536         * expression.cs (EventExpr): New kind of expressions.
25537         (Expressio::ExprClassFromMemberInfo): finish
25538
25539 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
25540
25541         * assign.cs: Emit stores to static fields differently.
25542
25543 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25544
25545         * Merge in changes and adjust code to tackle conflicts. Backed out my
25546         code in Assign::Resolve ;-) 
25547
25548 2001-09-08  Ravi Pratap  <ravi@ximian.com>
25549
25550         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
25551         instead Report.Error and also pass in the location.
25552         (CSharpParser::Lexer): New readonly property to return the reference
25553         to the Tokenizer object.
25554         (declare_local_variables): Use Report.Error with location instead of plain 
25555         old error.
25556         (CheckDef): Ditto.
25557
25558         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
25559         (Operator.CheckBinaryOperator): Ditto.
25560
25561         * cs-parser.jay (operator_declarator): Update accordingly.
25562
25563         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
25564         (CheckBinaryOperator): Same here.
25565
25566         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
25567         on the name without any prefixes of namespace names etc. This is because we
25568         already might have something already fully qualified like 
25569         'System.Console.WriteLine'
25570
25571         * assign.cs (Resolve): Begin implementation. Stuck ;-)
25572
25573 2001-09-07  Ravi Pratap  <ravi@ximian.com>
25574
25575         * cs-tokenizer.cs (location): Return a string which also contains
25576         the file name.
25577
25578         * expression.cs (ElementAccess): New class for expressions of the
25579         type 'element access.'
25580         (BaseAccess): New class for expressions of the type 'base access.'
25581         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
25582         respectively.
25583
25584         * cs-parser.jay (element_access): Implement action.
25585         (base_access): Implement actions.
25586         (checked_expression, unchecked_expression): Implement.
25587
25588         * cs-parser.jay (local_variable_type): Correct and implement.
25589         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
25590
25591         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
25592
25593         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
25594         name and the specifiers.
25595
25596         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
25597
25598         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
25599         making them all public ;-)
25600
25601         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
25602         class anyways.
25603
25604 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
25605
25606         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
25607         PropertyExprs.
25608         (FieldExpr, PropertyExprs): New resolved expressions.
25609         (SimpleName::MemberStaticCheck): Perform static checks for access
25610         to non-static fields on static methods. Maybe this should be
25611         generalized for MemberAccesses. 
25612         (SimpleName::ResolveSimpleName): More work on simple name
25613         resolution. 
25614
25615         * cs-parser.jay (primary_expression/qualified_identifier): track
25616         the parameter index.
25617
25618         * codegen.cs (CodeGen::Save): Catch save exception, report error.
25619         (EmitContext::EmitBoolExpression): Chain to expression generation
25620         instead of temporary hack.
25621         (::EmitStatementExpression): Put generic expression code generation.
25622
25623         * assign.cs (Assign::Emit): Implement variable assignments to
25624         local variables, parameters and fields.
25625
25626 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
25627
25628         * statement.cs (Block::GetVariableInfo): New method, returns the
25629         VariableInfo for a variable name in a block.
25630         (Block::GetVariableType): Implement in terms of GetVariableInfo
25631
25632         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
25633         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
25634
25635 2001-09-06  Ravi Pratap  <ravi@ximian.com>
25636
25637         * cs-parser.jay (operator_declaration): Continue on my quest : update
25638         to take attributes argument.
25639         (event_declaration): Ditto.
25640         (enum_declaration): Ditto.
25641         (indexer_declaration): Ditto.
25642
25643         * class.cs (Operator::Operator): Update constructor accordingly.
25644         (Event::Event): Ditto.
25645
25646         * delegate.cs (Delegate::Delegate): Same here.
25647
25648         * enum.cs (Enum::Enum): Same here.
25649
25650 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25651
25652         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
25653
25654         * ../tests/cs0658.cs : New file to demonstrate error 0658.
25655
25656         * attribute.cs (Attributes): New class to encapsulate all attributes which were
25657         being passed around as an arraylist.
25658         (Attributes::AddAttribute): Method to add attribute sections.
25659
25660         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
25661         (struct_declaration): Update accordingly.
25662         (constant_declaration): Update.
25663         (field_declaration): Update.
25664         (method_header): Update.
25665         (fixed_parameter): Update.
25666         (parameter_array): Ditto.
25667         (property_declaration): Ditto.
25668         (destructor_declaration): Ditto.
25669
25670         * class.cs (Struct::Struct): Update constructors accordingly.
25671         (Class::Class): Ditto.
25672         (Field::Field): Ditto.
25673         (Method::Method): Ditto.
25674         (Property::Property): Ditto.
25675         (TypeContainer::OptAttribute): update property's return type.
25676
25677         * interface.cs (Interface.opt_attributes): New member.
25678         (Interface::Interface): Update to take the extra Attributes argument.
25679
25680         * parameter.cs (Parameter::Parameter): Ditto.
25681
25682         * constant.cs (Constant::Constant): Ditto.
25683
25684         * interface.cs (InterfaceMemberBase): New OptAttributes field.
25685         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
25686         the attributes as a parameter.
25687         (InterfaceProperty): Update constructor call.
25688         (InterfaceEvent): Ditto.
25689         (InterfaceMethod): Ditto.
25690         (InterfaceIndexer): Ditto.
25691
25692         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
25693         pass the attributes too.
25694         (interface_event_declaration): Ditto.
25695         (interface_property_declaration): Ditto.
25696         (interface_method_declaration): Ditto.
25697         (interface_declaration): Ditto.
25698
25699 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
25700
25701         * class.cs (Method::Define): Track the "static Main" definition to
25702         create an entry point. 
25703
25704         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
25705         EntryPoint if we find it. 
25706
25707         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
25708         (EmitContext::ig): Make this variable public.
25709
25710         * driver.cs: Make the default output file be the first file name
25711         with the .exe extension.  
25712
25713         Detect empty compilations
25714
25715         Handle various kinds of output targets.  Handle --target and
25716         rename -t to --dumper.
25717
25718         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
25719         methods inherited from Expression return now an Expression.  This
25720         will is used during the tree rewriting as we resolve them during
25721         semantic analysis.
25722
25723         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
25724         the spec.  Missing entirely is the information about
25725         accessability of elements of it.
25726
25727         (Expression::ExprClassFromMemberInfo): New constructor for
25728         Expressions that creates a fully initialized Expression based on
25729         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
25730         a Type.
25731
25732         (Invocation::Resolve): Begin implementing resolution of invocations.
25733
25734         * literal.cs (StringLiteral):  Implement Emit.
25735
25736 2001-09-05  Ravi Pratap  <ravi@ximian.com>
25737
25738         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
25739         member.
25740
25741 2001-09-04  Ravi Pratap  <ravi@ximian.com>
25742
25743         * cs-parser.jay (attribute_arguments): Implement actions.
25744         (attribute): Fix bug in production. Implement action.
25745         (attribute_list): Implement.
25746         (attribute_target): Implement.
25747         (attribute_target_specifier, opt_target_specifier): Implement
25748         (CheckAttributeTarget): New method to check if the attribute target
25749         is valid.
25750         (attribute_section): Implement.
25751         (opt_attributes): Implement.
25752
25753         * attribute.cs : New file to handle attributes.
25754         (Attribute): Class to hold attribute info.
25755
25756         * cs-parser.jay (opt_attribute_target_specifier): Remove production
25757         (attribute_section): Modify production to use 2 different rules to 
25758         achieve the same thing. 1 s/r conflict down !
25759         Clean out commented, useless, non-reducing dimension_separator rules.
25760
25761         * class.cs (TypeContainer.attributes): New member to hold list
25762         of attributes for a type.
25763         (Struct::Struct): Modify to take one more argument, the attribute list.
25764         (Class::Class): Ditto.
25765         (Field::Field): Ditto.
25766         (Method::Method): Ditto.
25767         (Property::Property): Ditto.
25768
25769         * cs-parser.jay (struct_declaration): Update constructor call to
25770         pass in the attributes too.
25771         (class_declaration): Ditto.
25772         (constant_declaration): Ditto.
25773         (field_declaration): Ditto.
25774         (method_header): Ditto.
25775         (fixed_parameter): Ditto.
25776         (parameter_array): Ditto.
25777         (property_declaration): Ditto.
25778
25779         * constant.cs (Constant::Constant): Update constructor similarly.
25780         Use System.Collections.
25781
25782         * parameter.cs (Parameter::Parameter): Update as above.
25783
25784 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25785
25786         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
25787         (TypeContainer.delegates): New member to hold list of delegates.
25788
25789         * cs-parser.jay (delegate_declaration): Implement the action correctly 
25790         this time as I seem to be on crack ;-)
25791
25792 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
25793
25794         * rootcontext.cs (RootContext::IsNamespace): new function, used to
25795         tell whether an identifier represents a namespace.
25796
25797         * expression.cs (NamespaceExpr): A namespace expression, used only
25798         temporarly during expression resolution.
25799         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
25800         utility functions to resolve names on expressions.
25801
25802 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
25803
25804         * codegen.cs: Add hook for StatementExpressions. 
25805
25806         * class.cs: Fix inverted test for static flag in methods.
25807
25808 2001-09-02  Ravi Pratap  <ravi@ximian.com>
25809
25810         * class.cs (Operator::CheckUnaryOperator): Correct error number used
25811         to make it coincide with MS' number.
25812         (Operator::CheckBinaryOperator): Ditto.
25813
25814         * ../errors/errors.txt : Remove error numbers added earlier.
25815
25816         * ../errors/cs1019.cs : Test case for error # 1019
25817
25818         * ../errros/cs1020.cs : Test case for error # 1020
25819
25820         * cs-parser.jay : Clean out commented cruft.
25821         (dimension_separators, dimension_separator): Comment out. Ostensibly not
25822         used anywhere - non-reducing rule.
25823         (namespace_declarations): Non-reducing rule - comment out.
25824
25825         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
25826         with TypeContainer::AddEnum.
25827
25828         * delegate.cs : New file for delegate handling classes.
25829         (Delegate): Class for declaring delegates.
25830
25831         * makefile : Update.
25832
25833         * cs-parser.jay (delegate_declaration): Implement.
25834
25835 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
25836
25837         * class.cs (Event::Define): Implement.
25838         (Event.EventBuilder): New member.
25839
25840         * class.cs (TypeContainer::Populate): Update to define all enums and events
25841         we have.
25842         (Events): New property for the events arraylist we hold. Shouldn't we move to using
25843         readonly fields for all these cases ?
25844
25845 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25846
25847         * class.cs (Property): Revamp to use the convention of making fields readonly.
25848         Accordingly modify code elsewhere.
25849
25850         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
25851         the Define method of the Property class.
25852
25853         * class.cs : Clean up applied patch and update references to variables etc. Fix 
25854         trivial bug.
25855         (TypeContainer::Populate): Update to define all the properties we have. Also
25856         define all enumerations.
25857
25858         * enum.cs (Define): Implement.
25859
25860 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
25861
25862         * cs-parser.jay (overloadable_operator): The semantic value is an
25863         enum of the Operator class.
25864         (operator_declarator): Implement actions.
25865         (operator_declaration): Implement.
25866
25867         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
25868         validity of definitions.
25869         (Operator::CheckBinaryOperator): Static method to check for binary operators
25870         (TypeContainer::AddOperator): New method to add an operator to a type.
25871
25872         * cs-parser.jay (indexer_declaration): Added line to actually call the
25873         AddIndexer method so it gets added ;-)
25874
25875         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
25876         already taken care of by the MS compiler ?  
25877
25878 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25879
25880         * class.cs (Operator): New class for operator declarations.
25881         (Operator::OpType): Enum for the various operators.
25882
25883 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
25884
25885         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
25886         ostensibly handle this in semantic analysis.
25887
25888         * cs-parser.jay (general_catch_clause): Comment out
25889         (specific_catch_clauses, specific_catch_clause): Ditto.
25890         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
25891         (catch_args, opt_catch_args): New productions.
25892         (catch_clause): Rewrite to use the new productions above
25893         (catch_clauses): Modify accordingly.
25894         (opt_catch_clauses): New production to use in try_statement
25895         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
25896         and re-write the code in the actions to extract the specific and
25897         general catch clauses by being a little smart ;-)
25898
25899         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
25900         Hooray, try and catch statements parse fine !
25901
25902 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25903
25904         * statement.cs (Block::GetVariableType): Fix logic to extract the type
25905         string from the hashtable of variables.
25906
25907         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
25908         I end up making that mistake ;-)
25909         (catch_clauses): Fixed gross error which made Key and Value of the 
25910         DictionaryEntry the same : $1 !!
25911
25912 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25913
25914         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
25915
25916         * cs-parser.jay (event_declaration): Correct to remove the semicolon
25917         when the add and remove accessors are specified. 
25918
25919 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
25920
25921         * cs-parser.jay (IndexerDeclaration): New helper class to hold
25922         information about indexer_declarator.
25923         (indexer_declarator): Implement actions.
25924         (parsing_indexer): New local boolean used to keep track of whether
25925         we are parsing indexers or properties. This is necessary because 
25926         implicit_parameters come into picture even for the get accessor in the 
25927         case of an indexer.
25928         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
25929
25930         * class.cs (Indexer): New class for indexer declarations.
25931         (TypeContainer::AddIndexer): New method to add an indexer to a type.
25932         (TypeContainer::indexers): New member to hold list of indexers for the
25933         type.
25934
25935 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25936
25937         * cs-parser.jay (add_accessor_declaration): Implement action.
25938         (remove_accessor_declaration): Implement action.
25939         (event_accessors_declaration): Implement
25940         (variable_declarators): swap statements for first rule - trivial.
25941
25942         * class.cs (Event): New class to hold information about event
25943         declarations.
25944         (TypeContainer::AddEvent): New method to add an event to a type
25945         (TypeContainer::events): New member to hold list of events.
25946
25947         * cs-parser.jay (event_declaration): Implement actions.
25948
25949 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
25950
25951         * cs-parser.jay (dim_separators): Implement. Make it a string
25952         concatenating all the commas together, just as they appear.
25953         (opt_dim_separators): Modify accordingly
25954         (rank_specifiers): Update accordingly. Basically do the same
25955         thing - instead, collect the brackets here.
25956         (opt_rank_sepcifiers): Modify accordingly.
25957         (array_type): Modify to actually return the complete type string
25958         instead of ignoring the rank_specifiers.
25959         (expression_list): Implement to collect the expressions
25960         (variable_initializer): Implement. We make it a list of expressions
25961         essentially so that we can handle the array_initializer case neatly too.
25962         (variable_initializer_list): Implement.
25963         (array_initializer): Make it a list of variable_initializers
25964         (opt_array_initializer): Modify accordingly.
25965
25966         * expression.cs (New::NType): Add enumeration to help us
25967         keep track of whether we have an object/delegate creation
25968         or an array creation.
25969         (New:NewType, New::Rank, New::Indices, New::Initializers): New
25970         members to hold data about array creation.
25971         (New:New): Modify to update NewType
25972         (New:New): New Overloaded contructor for the array creation
25973         case.
25974
25975         * cs-parser.jay (array_creation_expression): Implement to call
25976         the overloaded New constructor.
25977
25978 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
25979
25980         * class.cs (TypeContainer::Constructors): Return member
25981         constructors instead of returning null.
25982
25983 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
25984
25985         * typemanager.cs (InitCoreTypes): Initialize the various core
25986         types after we have populated the type manager with the user
25987         defined types (this distinction will be important later while
25988         compiling corlib.dll)
25989
25990         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
25991         on Expression Classification.  Now all expressions have a method
25992         `Resolve' and a method `Emit'.
25993
25994         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
25995         generation from working.     Also add some temporary debugging
25996         code. 
25997
25998 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
25999
26000         * codegen.cs: Lots of code generation pieces.  This is only the
26001         beginning, will continue tomorrow with more touches of polish.  We
26002         handle the fundamentals of if, while, do, for, return.  Others are
26003         trickier and I need to start working on invocations soon.
26004
26005         * gen-treedump.cs: Bug fix, use s.Increment here instead of
26006         s.InitStatement. 
26007
26008         * codegen.cs (EmitContext): New struct, used during code
26009         emission to keep a context.   Most of the code generation will be
26010         here. 
26011
26012         * cs-parser.jay: Add embedded blocks to the list of statements of
26013         this block.  So code generation proceeds in a top down fashion.
26014
26015 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
26016
26017         * statement.cs: Add support for multiple child blocks.
26018
26019 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
26020
26021         * codegen.cs (EmitCode): New function, will emit the code for a
26022         Block of code given a TypeContainer and its ILGenerator. 
26023
26024         * statement.cs (Block): Standard public readonly optimization.
26025         (Block::Block constructors): Link children. 
26026         (Block::Child): Child Linker.
26027         (Block::EmitVariables): Emits IL variable declarations.
26028
26029         * class.cs: Drop support for MethodGroups here, delay until
26030         Semantic Analysis.
26031         (Method::): Applied the same simplification that I did before, and
26032         move from Properties to public readonly fields.
26033         (Method::ParameterTypes): Returns the parameter types for the
26034         function, and implements a cache that will be useful later when I
26035         do error checking and the semantic analysis on the methods is
26036         performed.
26037         (Constructor::GetCallingConvention): Renamed from CallingConvetion
26038         and made a method, optional argument tells whether this is a class
26039         or a structure to apply the `has-this' bit.
26040         (Method::GetCallingConvention): Implement, returns the calling
26041         convention. 
26042         (Method::Define): Defines the type, a second pass is performed
26043         later to populate the methods.
26044
26045         (Constructor::ParameterTypes): implement a cache similar to the
26046         one on Method::ParameterTypes, useful later when we do semantic
26047         analysis. 
26048
26049         (TypeContainer::EmitMethod):  New method.  Emits methods.
26050
26051         * expression.cs: Removed MethodGroup class from here.
26052
26053         * parameter.cs (Parameters::GetCallingConvention): new method.
26054
26055 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
26056
26057         * class.cs (TypeContainer::Populate): Drop RootContext from the
26058         argument. 
26059
26060         (Constructor::CallingConvention): Returns the calling convention.
26061         (Constructor::ParameterTypes): Returns the constructor parameter
26062         types. 
26063
26064         (TypeContainer::AddConstructor): Keep track of default constructor
26065         and the default static constructor.
26066
26067         (Constructor::) Another class that starts using `public readonly'
26068         instead of properties. 
26069
26070         (Constructor::IsDefault): Whether this is a default constructor. 
26071
26072         (Field::) use readonly public fields instead of properties also.
26073
26074         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
26075         track of static constructors;  If none is used, turn on
26076         BeforeFieldInit in the TypeAttributes. 
26077
26078         * cs-parser.jay (opt_argument_list): now the return can be null
26079         for the cases where there are no arguments. 
26080
26081         (constructor_declarator): If there is no implicit `base' or
26082         `this', then invoke the default parent constructor. 
26083
26084         * modifiers.cs (MethodAttr): New static function maps a set of
26085         modifiers flags into a MethodAttributes enum
26086         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
26087         MethodAttr, TypeAttr to represent the various mappings where the
26088         modifiers are used.
26089         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
26090
26091 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
26092
26093         * parameter.cs (GetParameterInfo): Fix bug where there would be no
26094         method arguments.
26095
26096         * interface.cs (PopulateIndexer): Implemented the code generator
26097         for interface indexers.
26098
26099 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
26100
26101         * interface.cs (InterfaceMemberBase): Now we track the new status
26102         here.  
26103
26104         (PopulateProperty): Implement property population.  Woohoo!  Got
26105         Methods and Properties going today. 
26106
26107         Removed all the properties for interfaces, and replaced them with
26108         `public readonly' fields. 
26109
26110 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
26111
26112         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
26113         initialize their hashtables/arraylists only when they are needed
26114         instead of doing this always.
26115
26116         * parameter.cs: Handle refs and out parameters.
26117
26118         * cs-parser.jay: Use an ArrayList to construct the arguments
26119         instead of the ParameterCollection, and then cast that to a
26120         Parameter[] array.
26121
26122         * parameter.cs: Drop the use of ParameterCollection and use
26123         instead arrays of Parameters.
26124
26125         (GetParameterInfo): Use the Type, not the Name when resolving
26126         types. 
26127
26128 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
26129
26130         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
26131         and instead use public readonly fields.
26132
26133         * class.cs: Put back walking code for type containers.
26134
26135 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
26136
26137         * class.cs (MakeConstant): Code to define constants.
26138
26139         * rootcontext.cs (LookupType): New function.  Used to locate types 
26140
26141
26142 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
26143
26144         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
26145         this System.Reflection code is.  Kudos to Microsoft
26146
26147         * typemanager.cs: Implement a type cache and avoid loading all
26148         types at boot time.  Wrap in LookupType the internals.  This made
26149         the compiler so much faster.  Wow.  I rule!
26150
26151         * driver.cs: Make sure we always load mscorlib first (for
26152         debugging purposes, nothing really important).
26153
26154         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
26155         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
26156
26157         * rootcontext.cs: Lookup types on their namespace;  Lookup types
26158         on namespaces that have been imported using the `using' keyword.
26159
26160         * class.cs (TypeContainer::TypeAttr): Virtualize.
26161         (Class::TypeAttr): Return attributes suitable for this bad boy.
26162         (Struct::TypeAttr): ditto.
26163         Handle nested classes.
26164         (TypeContainer::) Remove all the type visiting code, it is now
26165         replaced with the rootcontext.cs code
26166
26167         * rootcontext.cs (GetClassBases): Added support for structs. 
26168
26169 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
26170
26171         * interface.cs, statement.cs, class.cs, parameter.cs,
26172         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
26173         Drop use of TypeRefs, and use strings instead.
26174
26175 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
26176
26177         * rootcontext.cs: 
26178
26179         * class.cs (Struct::Struct): set the SEALED flags after
26180         checking the modifiers.
26181         (TypeContainer::TypeAttr): new property, returns the
26182         TypeAttributes for a class.  
26183
26184         * cs-parser.jay (type_list): Oops, list production was creating a
26185         new list of base types.
26186
26187         * rootcontext.cs (StdLib): New property.
26188         (GetInterfaceTypeByName): returns an interface by type name, and
26189         encapsulates error handling here.
26190         (GetInterfaces): simplified.
26191         (ResolveTree): Encapsulated all the tree resolution here.
26192         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
26193         types. 
26194
26195         * driver.cs: Add support for --nostdlib, to avoid loading the
26196         default assemblies.
26197         (Main): Do not put tree resolution here. 
26198
26199         * rootcontext.cs: Beginning of the class resolution.
26200
26201 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
26202
26203         * rootcontext.cs: Provide better error reporting. 
26204
26205         * cs-parser.jay (interface_base): set our $$ to be interfaces.
26206
26207         * rootcontext.cs (CreateInterface): Handle the case where there
26208         are no parent interfaces.
26209
26210         (CloseTypes): Routine to flush types at the end.
26211         (CreateInterface): Track types.
26212         (GetInterfaces): Returns an array of Types from the list of
26213         defined interfaces.
26214
26215         * typemanager.c (AddUserType): Mechanism to track user types (puts
26216         the type on the global type hash, and allows us to close it at the
26217         end). 
26218
26219 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
26220
26221         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
26222         RecordInterface instead.
26223
26224         * cs-parser.jay: Updated to reflect changes above.
26225
26226         * decl.cs (Definition): Keep track of the TypeBuilder type that
26227         represents this type here.  Not sure we will use it in the long
26228         run, but wont hurt for now.
26229
26230         * driver.cs: Smaller changes to accomodate the new code.
26231
26232         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
26233         when done. 
26234
26235         * rootcontext.cs (CreateInterface):  New method, used to create
26236         the System.TypeBuilder type for interfaces.
26237         (ResolveInterfaces): new entry point to resolve the interface
26238         hierarchy. 
26239         (CodeGen): Property, used to keep track of the code generator.
26240
26241 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
26242
26243         * cs-parser.jay: Add a second production for delegate_declaration
26244         with `VOID'.
26245
26246         (enum_body): Put an opt_comma here instead of putting it on
26247         enum_body or enum_member_declarations so we can handle trailing
26248         commas on enumeration members.  Gets rid of a shift/reduce.
26249
26250         (type_list): Need a COMMA in the middle.
26251
26252         (indexer_declaration): Tell tokenizer to recognize get/set
26253
26254         * Remove old targets.
26255
26256         * Re-add the parser target.
26257
26258 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26259
26260         * cs-parser.jay: Add precendence rules for a number of operators
26261         ot reduce the number of shift/reduce conflicts in the grammar.
26262
26263 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
26264
26265         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
26266         and put it here.
26267
26268         Get rid of old crufty code.
26269
26270         * rootcontext.cs: Use this to keep track of the parsed
26271         representation and the defined types available to the program. 
26272
26273         * gen-treedump.cs: adjust for new convention.
26274
26275         * type.cs: Split out the type manager, and the assembly builder
26276         from here. 
26277
26278         * typemanager.cs: the type manager will live here now.
26279
26280         * cil-codegen.cs: And the code generator here. 
26281
26282 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
26283
26284         * makefile: Fixed up for easy making.
26285
26286 2001-07-13  Simon Cozens <simon@simon-cozens.org>
26287
26288         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
26289         the 
26290
26291         (unary_expression): Expand pre_increment_expression and
26292         post_decrement_expression to reduce a shift/reduce.
26293
26294 2001-07-11  Simon Cozens
26295
26296         * cs-tokenizer.cs: Hex numbers should begin with a 0.
26297
26298         Improve allow_keyword_as_indent name.
26299
26300 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
26301
26302         * Adjustments for Beta2. 
26303
26304 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
26305
26306         * decl.cs: Added `Define' abstract method.
26307         (InTransit): new property, used to catch recursive definitions. 
26308
26309         * interface.cs: Implement `Define'. 
26310
26311         * modifiers.cs: Map Modifiers.constants to
26312         System.Reflection.TypeAttribute flags.
26313
26314         * class.cs: Keep track of types and user-defined types.
26315         (BuilderInit): New method for creating an assembly
26316         (ResolveType): New function to launch the resolution process, only
26317         used by interfaces for now.
26318
26319         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
26320         that are inserted into the name space. 
26321
26322 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
26323
26324         * ARGH.  I have screwed up my tree so many times due to the use of
26325         rsync rather than using CVS.  Going to fix this at once. 
26326
26327         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
26328         load types.
26329
26330 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
26331
26332         * Experiment successful: Use System.Type rather that our own
26333         version of Type.  
26334
26335 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
26336
26337         * cs-parser.jay: Removed nsAliases from here.
26338
26339         Use new namespaces, handle `using XXX;' 
26340
26341         * namespace.cs: Reimplemented namespace handling, use a recursive
26342         definition of the class.  Now we can keep track of using clauses
26343         and catch invalid using clauses.
26344
26345 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
26346
26347         * gen-treedump.cs: Adapted for all the renaming.
26348
26349         * expression.cs (Expression): this class now has a Type property
26350         which returns an expression Type.
26351
26352         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
26353         `Type', as this has a different meaning now in the base
26354
26355 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
26356
26357         * interface.cs, class.cs: Removed from all the sources the
26358         references to signature computation, as we can not do method
26359         signature computation during the parsing time, as we are not
26360         trying to solve at that point distinguishing:
26361
26362         class X {
26363                 void a (Blah x) {}
26364                 void a (NS.Blah x) {}
26365         }
26366
26367         Which depending on the context might be valid or not, as we do not
26368         know if Blah is the same thing as NS.Blah at that point.
26369
26370         * Redid everything so the code uses TypeRefs now instead of
26371         Types.  TypeRefs are just temporary type placeholders, that need
26372         to be resolved.  They initially have a pointer to a string and the
26373         current scope in which they are used.  This is used later by the
26374         compiler to resolve the reference to an actual Type. 
26375
26376         * DeclSpace is no longer a CIR.Type, and neither are
26377         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
26378         are all DeclSpaces, but no Types. 
26379
26380         * type.cs (TypeRefManager): This implements the TypeRef manager,
26381         which keeps track of all the types that need to be resolved after
26382         the parsing has finished. 
26383
26384 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
26385
26386         * ARGH.  We are going to have to store `foreach' as a class rather
26387         than resolving it, as we need to verify error 1579 after name
26388         resolution.   *OR* we could keep a flag that says `This request to
26389         IEnumerator comes from a foreach statement' which we can then use
26390         to generate the error.
26391
26392 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
26393
26394         * class.cs (TypeContainer.AddMethod): we now add methods to the
26395         MethodGroup instead of the method hashtable.  
26396
26397         * expression.cs: Add MethodGroup abstraction, which gets us one
26398         step closer to the specification in the way we handle method
26399         declarations.  
26400
26401         * cs-parser.jay (primary_expression): qualified_identifier now
26402         tried to match up an identifier to a local variable reference or
26403         to a parameter reference.
26404
26405         current_local_parameters is now a parser global variable that
26406         points to the current parameters for the block, used during name
26407         lookup.
26408
26409         (property_declaration): Now creates an implicit `value' argument to
26410         the set accessor.
26411
26412 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
26413
26414         * parameter.cs: Do not use `param' arguments as part of the
26415         signature, per the spec.
26416
26417 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
26418
26419         * decl.cs: Base class for classes, structs and interfaces.  This
26420         is the "Declaration Space" 
26421
26422         * cs-parser.jay: Use CheckDef for checking declaration errors
26423         instead of having one on each function.
26424
26425         * class.cs: Factor out some code for handling error handling in
26426         accordance to the "Declarations" section in the "Basic Concepts"
26427         chapter in the ECMA C# spec.
26428
26429         * interface.cs: Make all interface member classes derive from
26430         InterfaceMemberBase.
26431
26432 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
26433
26434         * Many things: all interfaces are parsed and generated in
26435         gen-treedump.  Support for member variables, constructors,
26436         destructors, properties, constants is there.
26437
26438         Beginning of the IL backend, but very little done, just there for
26439         testing purposes. 
26440
26441 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
26442
26443         * cs-parser.jay: Fix labeled statement.
26444
26445         * cs-tokenizer.cs (escape): Escape " and ' always.
26446         ref_line, ref_name: keep track of the line/filename as instructed
26447         by #line by the compiler.
26448         Parse #line.
26449
26450 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
26451
26452         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
26453         to match the values in System.CodeDOM.
26454
26455         Divid renamed to Divide.
26456
26457         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
26458         statements. 
26459         (Statements.set): remove.
26460
26461         * System.CodeDOM/CodeCatchClause.cs: always have a valid
26462         statements. 
26463
26464         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
26465         falseStatements always have valid values. 
26466
26467         * cs-parser.jay: Use System.CodeDOM now.
26468