2006-08-30 Robert Jordan <robertj@gmx.net>
[mono.git] / mcs / mcs / ChangeLog
1 2006-08-29  Miguel de Icaza  <miguel@novell.com>
2
3         * cs-parser.jay: Turn 1522 into a warning, instead of an error #79210
4         
5 2006-08-17  Miguel de Icaza  <miguel@novell.com>
6
7         * cs-tokenizer.cs: Apply patch from Atsushi Enomoto that fixes
8         #52019 and #79064, the use of the \uXXXX sequence in source code
9         to represent unicode characters.
10
11 2006-08-15  Marek Safar  <marek.safar@seznam.cz>
12
13         * expression.cs (SizeOf.DoResolve): Check for void type. Fixed enum types
14         support.
15         * class.cs, ecore.cs, statement.cs: Merged to one error message.
16
17 2006-08-13  Miguel de Icaza  <miguel@novell.com>
18
19         * assign.cs: Catch attempts to assign to a method groups in += and
20         report as 1656
21
22 2006-08-13  Marek Safar  <marek.safar@seznam.cz>
23
24         A fix for #79056
25         * cs-parser.jay: Don't destroy current array type by typeof of array's.
26
27 2006-08-12  Marek Safar  <marek.safar@seznam.cz>
28
29         * class.cs (Method.Define): Issue a warning when generic method looks like
30         an entry point.
31         * decl.cs (MemberCore.GetSignatureForError): Print member type arguments
32         as well.
33
34 2006-08-09  Marek Safar  <marek.safar@seznam.cz>
35  
36         * anonymous.cs(AnonymousDelegate.Emit): Uses Constructor filter when
37         looking for ctor.
38         * decl.cs (MemberCache.FindMembers): When container is interface we need to
39         search all base interfaces as a member can be ambiguous.
40         * delegate.cs (Delegate.FindMembers): Fixed to return valid data for
41         Constructor member type filter. 
42         (Delegate.ResolveConstructorMethod) Uses Constructor filter.
43         * ecore.cs: (Expression.MemberLookup): Implemented ambiguity error/warning
44         reporting for returned memberinfos.
45         * report.cs: Updated.
46         * typemanager.cs (TypeManager.LookupBaseInterfacesCache): Uses TypeManager
47         version to work on all runtimes.
48         (TypeManager.RealMemberLookup): Removed members filtering.
49
50 2006-08-08  Raja R Harinath  <rharinath@novell.com>
51
52         * ecore.cs (FieldExpr.EmitAssign): Release temporary.
53         (PropertyExpr.EmitAssign): Likewise.
54         * expression.cs (Indirection.EmitAssign): Likewise.
55         (LocalVariableReference.EmitAssign): Likewise.
56         (ParameterReference.EmitAssign): Likewise.
57         (Invocation.EmitArguments): Likewise.
58         (ArrayAccess.EmitAssign): Likewise.
59         (IndexerAccess.EmitAssign): Likewise.
60         (This.EmitAssign): Likewise.
61         (ConditionalLogicalOperator.Emit): Likewise.
62
63         Fix #79026
64         * codegen.cs (EmitContext.GetTemporaryLocal): Simplify.  Use Stack
65         instead of ArrayList.  If the hashtable has a LocalBuilder, don't
66         leave it in after returning it.
67         (EmitContext.FreeTemporaryLocal): Simplify.  Update to changes.
68
69 2006-08-06  Marek Safar  <marek.safar@seznam.cz>
70
71         * expresssion.cs (IndexerAccess.DoResolve): Fixed to report correct error
72         message.
73
74 2006-08-03  Raja R Harinath  <rharinath@novell.com>
75
76         Fix cs0146-3.cs and cs0146-4.cs.
77         * class.cs (TypeManager.CheckRecursiveDefinition): Check that
78         enclosing types don't depend on the current type.
79
80 2006-08-02  Raja R Harinath  <rharinath@novell.com>
81
82         Fix #77963
83         * class.cs (TypeContainer.DoDefineMembers): Use
84         FindBaseMemberWithSameName on Parent, since we're interested in
85         whether we hide inherited members or not.
86         (FindBaseMemberWithSameName): Make slightly more robust.
87
88         Fix the non-generic testcase from #77396
89         * decl.cs (DeclSpace.DeclContainer): Remove override.
90
91         * namespace.cs (NamespaceEntry.Doppelganger): Create slave
92         declspaces for doppelgangers too.
93         (UsingEntry): Implement IResolveContext.
94         (UsingEntry.Resolve): Don't set ToplevelTypes.Namespace.  Use
95         'this' as the resolve context.
96         (LocalAliasEntry): Likewise.
97
98         Implement parts of #77403
99         * roottypes.cs (RootDeclSpace): New.  Used to represent the
100         toplevel declaration space.  Each namespace declaration introduces
101         a "partial" root declaretion space.
102         * namespace.cs (NamespaceEntry.SlaveDeclSpace): New.
103         (NamespaceEntry.ctor): Create a SlaveDeclSpace if necessary.
104         * cs-parser.jay (CSharpParser.ctor): Initialize 'current_class'
105         from 'current_namespace.SlaveDeclSpace'.
106         (namespace_declaration): Likewise.
107         * class.cs (TypeContainer.ctor): Remove parent==ToplevelTypes
108         check.  It can't happen now.
109         * decl.cs (DeclSpace.LookupType): Likewise.
110         * driver.cs (MainDriver): Sanity check.
111
112 2006-08-01  Raja R Harinath  <rharinath@novell.com>
113
114         * decl.cs (DeclSpace.FindNestedType): Remove.
115         (DeclSpace.LookupNestedTypeINHierarchy): Use PartialContainer and
116         LookupTypeContainer to get the container of the nested type.
117         * class.cs (TypeContainer.FindNestedType): Make non-override.
118
119 2006-07-31  Raja R Harinath  <rharinath@novell.com>
120
121         * decl.cs (DeclSpace.PartialContainer): Move field from ...
122         * class.cs (TypeContainer.PartialContainer): ... here.
123         (TypeContainer.AddBasesForPart): New helper.
124         (MemberBase.ParentContainer): Remove.  Use Parent.PartialContainer
125         instead.
126         * cs-parser.jay (current_class): Convert to DeclSpace.
127         (struct_declaration, interface_declaration, class_declaration):
128         Use AddBasesForPart instead of .Bases directly.
129         * const.cs, iterators.cs: Update to changes.
130
131 2006-07-28  Raja R Harinath  <rharinath@novell.com>
132
133         * class.cs (TypeContainer.AddMemberType): Rename from
134         AddToTypeContainer.
135         (TypeContainer.AddMember): Rename from AddToMemberContainer.
136         (AddTypeContainer): New.  Combine AddClassOrStruct and
137         AddInterface.
138         (AddPartial): Update.  Add 'is_partial' argument.
139         * roottypes.cs: Update to changes.
140         * cs-parser.jay (push_current_class): New helper for handling
141         current_container and current_class.
142         (struct_declaration, interface_declaration, class_declaration):
143         Use it.
144
145 2006-07-26  Raja R Harinath  <rharinath@novell.com>
146
147         * roottypes.cs: Rename from tree.cs.
148
149         Rename RootContext.Tree.Types to RootContext.ToplevelTypes.
150         * tree.cs (Tree, ITreeDump): Remove types.
151         * rootcontext.cs (tree, Tree): Remove fields.
152         (root, ToplevelTypes): New.
153         * *.cs: Update to rename.
154
155         * tree.cs (Tree.RecordDecl): Remove.
156         (RootTypes.AddToTypeContainer): Record the toplevel type in its
157         namespace here.
158         * class.cs, cs-parser.jay: Remove mention of RecordDecl.
159
160 2006-07-23  Raja R Harinath  <harinath@gmail.com>
161
162         * codegen.cs (EmitContext.Flags): Move InCatch, InFinally,
163         DoFlowAnalysis and OmitStructFlowAnalysis here.
164         (ec.With): Rename from WithUnsafe and generalize.
165         (ec.WithCheckState): Remove.  All users can be handled by 'With'.
166         (ec.WithFlowAnalyis): New.
167         * ecore.cs, expression.cs, statement.cs: Update.
168
169 2006-07-22  Raja R Harinath  <harinath@gmail.com>
170
171         * statement.cs (Block.ResolveMeta): Simplify slightly.
172
173         * codegen.cs (EmitContext.Flags): New enum.  Used to represent the
174         multiple boolean fields.  Convert InUnsafe, constant_check_state,
175         check_state to flags.
176         (CheckState, ConstantCheckState): Update.
177         (InUnsafe): New read-only property.
178         (FlagsHandle): Rename from CheckStateHandle and convert to handle
179         arbitrary flags.
180         (WithUnsafe): New helper similar to WithCheckState.
181         * statement.cs (Block.ResolveMeta): Use WithUnsafe.
182         (Unsafe.Resolve, Unsafe.DoEmit): Likewise.
183
184 2006-07-21  Raja R Harinath  <rharinath@novell.com>
185
186         Make comparisons use the same IL irrespective of whether they're
187         in a 'checked' or 'unchecked' context: one of the issues in #78899
188         * codegen.cs (EmitContext.CheckState): Make read-only property.
189         (EmitContext.ConstantCheckState): Likewise.
190         (EmitContext.CheckStateHandle, EmitContext.WithCheckState): New
191         helper that implement a save/restore stack for CheckState
192         values.  This is the only way to change check-state.
193         * ecore.cs (Expression.ExpressionToArrayArgument): Use WithCheckState.
194         * expression.cs (CheckedExpr.DoResolve, CheckedExpr.Emit): Likewise.
195         (CheckedExpr.EmitBranchable): New forwarding method.
196         (UnCheckedExpr): Likewise.
197         * statement.cs (Block.ResolveMeta): Use WithCheckState.
198         (Unchecked.Resolve, Unchecked.DoEmit): Likewise.
199         (Checked.Resolve, checked.DoEmit): Likewise.
200
201 2006-07-20  Miguel de Icaza  <miguel@novell.com>
202
203         * anonymous.cs: Cache the resolved anonymous delegate, and return
204         this so that the ResolveTopBlock is only triggered once, not
205         twice.
206
207         Currently we trigger ResolvetopBlock twice due to a first pass of
208         argument check compatibility, and a second pass that does the
209         actual resolution.   
210         
211 2006-07-16  Marek Safar  <marek.safar@seznam.cz>
212
213         A fix for #70506
214         * driver.cs (MainDriver): When a file extension is missing,
215         use a default one.
216
217 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
218
219         * annonymous.cs (AnonymousMethod.CreateScopeType): Fixed nested type
220         modifiers.
221         * rootcontext.cs (Reset): Add helper_classes.
222
223 2006-07-15  Marek Safar  <marek.safar@seznam.cz>
224
225         A fix for #78860
226         * statement.cs (Switch.SimpleSwitchEmit): Handle case null at any position
227         correctly.
228
229 2006-07-13  Miguel de Icaza  <miguel@novell.com>
230
231         * statement.cs (Lock): Handle expressions of type
232         TypeManager.null_type specially.  Fixes #78770
233
234 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
235
236         * expression.cs (Binary.ResolveOperator): Don't crash when null is assigned
237         to an event.
238
239 2006-07-08  Marek Safar  <marek.safar@seznam.cz>
240
241         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Fixed to look
242         for accessors as well.
243         * ecore.cs (EventExpr): Add AccessorTable.
244
245 2006-07-01  Marek Safar  <marek.safar@seznam.cz>
246
247         A fix for #78738
248         * attribute.cs, class.cs, ecore.cs : Add missing location of related symbol
249         for CS0122 where appropriate.
250         * typemanager.cs (IsNestedChildOf): Type can be null in the case of top
251         level attributes.
252         (Filter): Assembly can be null in the case of top level attributes.
253
254 2006-06-25  Marek Safar  <marek.safar@seznam.cz>
255
256         A fix for #78690
257
258         * ecore.cs (Expression.MemberLookupFailed): Don't crash when failed lookup
259         is done at global level.
260
261 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
262
263         A fix for #77002, Implemented TypeForwarder support.
264
265         * attribute.cs (Attribute.GetArgumentType): Reads type argument.
266         * expression.cs (TypeOf.TypeArgument): Exposes typeof type.
267         * typemanager.cs (): Add type_forwarder_attr_type.
268
269 2006-06-24  Marek Safar  <marek.safar@seznam.cz>
270
271         * report.cs: Add CS0469 warning.
272
273 2006-06-21  Martin Baulig  <martin@ximian.com>
274
275         * codegen.cs (CodeGen.Save): Moved the symbol file generation into
276         the `try'-block, so we also report CS0016 etc. there.
277
278 2006-06-21  Martin Baulig  <martin@ximian.com>
279
280         * delegate.cs
281         (Delegate.VerifyMethod): Allow `params' methods; fixes #78678.
282
283 2006-06-21  Martin Baulig  <martin@ximian.com>
284
285         * expression.cs (Unary.ResolveOperator): In `Operator.AddressOf',
286         also report CS1686 for parameters.
287
288 2006-06-21  Martin Baulig  <martin@ximian.com>
289
290         * statement.cs (GotoCase.Resolve): Report a warning (CS0469)
291         instead of an error if the value is not implicitly convertible to
292         the switch types; fixes #77964.
293
294 2006-06-21  Raja R Harinath  <rharinath@novell.com>
295
296         Fix #78673
297         * class.cs (FieldBase.ResolveInitializer): Stop resolution if
298         FieldBuilder is null.
299
300         Fix #78662
301         * expression.cs (Binary.CheckShiftArguments): Don't overwrite original
302         'left' and 'right' before error-checking.
303
304 2006-06-16  Juraj Skripsky  <js@hotfeet.ch>
305
306         * ecore.cs (SimpleName.Error_ObjectRefRequired): Do not truncate the name.
307         Fixed bug #78601.
308         (MemberExpr.EmitInstance): Use GetSignatureForError () to get full name.
309         (FieldExpr.DoResolve): likewise.
310         (PropertyExpr.InstanceResolve): likewise.
311         (EventExpr.InstanceResolve): likewise. 
312
313 2006-06-04  Marek Safar  <marek.safar@seznam.cz>
314
315         * parameter.cs (Parameter.ApplyAttributeBuilder): More DefaultValue
316         attribute applicable tests for attribute argument.
317
318 2006-06-02  Raja R Harinath  <rharinath@novell.com>
319
320         Fix #78079
321         * expression.cs (Binary.DoNumericPromotions): Remove and rewrite.
322         (Binary.OverloadResolve_PredefinedIntegral): New.
323         (Binary.OverloadResolve_PredefinedFloating): New.
324         (Binary.OverloadResolve_PredefinedString): New.
325         (Binary.ResolveOperator): Use those instead of DoNumericPromotions.
326         Follow the standard more closely, and treat numeric promotions in
327         terms of overload resolution.
328         (Binary.CheckShiftArguments): Simplify.
329
330 2006-06-01  Raja R Harinath  <rharinath@novell.com>
331
332         * flowanalysis.cs (MyBitVector): Simplify representation.
333         (MyBitVector.Clone): Avoid allocating BitArray.
334         (MyBitVector.operator&): Rename from MyBitVector.And and make symmetric.
335         (MyBitVector.operator|): Likewise, with MyBitVector.Or.
336         (*): Update.  Change all references to MyBitVector.And and
337         MyBitVector.Or to &= and |=.
338
339 2006-05-29  Raja R Harinath  <rharinath@novell.com>
340
341         Fix cs0231-[34].cs.
342         * cs-parser.jay (formal_parameter_list): Extend the pattern below
343         to param arguments too.
344
345 2006-05-26  Miguel de Icaza  <miguel@novell.com>
346
347         * cs-parser.jay: Catch another parsing form for arglist being
348         followed by other arguments.  Fixes #78313.
349
350 2006-05-24  Raja R Harinath  <rharinath@novell.com>
351
352         * flowanalysis.cs (FlowBranchingToplevel.AddReturnOrigin): Move
353         checking of out parameters to ...
354         (FlowBranchingToplevel.Merge): ... here.
355         (FlowBranchingException.AddBreakOrigin): If 'finally_vector' is
356         set, propagate the origin upward, and only complain if there was
357         no other error.
358         (FlowBranchingException.AddContinueOrigin): Likewise.
359         (FlowBranchingException.AddReturnOrigin): Likewise.
360         (FlowBranchingException.AddGotoOrigin): Likewise.       
361
362 2006-05-23  Raja R Harinath  <rharinath@novell.com>
363
364         * flowanalysis.cs (UsageVector.MergeOrigins): If an origin is
365         unreachable, skip it.
366         (FlowBranchingException.Merge): Always propagate jumps, even if
367         the finally block renders subsequent code unreachable.
368
369 2006-05-18  Raja R Harinath  <rharinath@novell.com>
370
371         Fix #77601
372         * statement.cs (Goto.Resolve): Move responsibility for resolving
373         'goto' to FlowBranching.AddGotoOrigin.
374         (Goto.SetResolvedTarget): New.  Callback to set the
375         LabeledStatement that's the target of the goto.
376         (Goto.DoEmit): Use Leave instead of Br when crossing an
377         unwind-protect boundary.
378         * flowanalysis.cs (FlowBranching.AddGotoOrigin): Rename from
379         LookupLabel and adjust to new semantics.
380         (FlowBranchingToplevel.AddGotoOrigin): Likewise.
381         (FlowBranchingBlock.AddGotoOrigin): Likewise. Use
382         Goto.SetResolvedTarget to update target.
383         (FlowBranchingLabeled.AddGotoOrigin): Likewise.
384         (FlowBranchingException.AddGotoOrigin): Rewrite to be similar to
385         AddBreakOrigin & co.  Delay propagation until ...
386         (FlowBranchingException.Merge): ... this.
387
388         * statement.cs (Block.Resolve): Always depend on flow-branching to
389         determine unreachability.  Kill workaround that originally emitted
390         only one statement after an "unreachable" label (see infloop in
391         test-515.cs).
392
393         Fix #77869, #76148, #77755, #75255 and a host of other bugs.
394         This is still "wrong", but anything better would probably need a
395         multi-pass algorithm.
396         * flowanalysis.cs (FlowBranchingLabeled): Salt away a copy of the
397         usage vector.  Force current usage vector to be reachable, to
398         optimistically signify backward jumps.
399         (FlowBranchingLabeled.LookupLabel): Note if a backward jump is
400         detected.
401         (FlowBranchingLabeled.Merge): New.  If no backward jump was
402         detected, return the original salted-away usage vector instead,
403         updated with appropriate changes.  Print unreachable warning if
404         necessary.
405         * statement.cs (Block.Resolve): Don't print unreachable warning on
406         a labeled statement.
407
408 2006-05-17  Gert Driesen  <drieseng@users.sourceforge.net>
409
410         * driver.cs: Pass filename without path to AssemblyBuilder's 
411         AddResourceFile. Fixes bug #78407.
412
413 2006-05-17  Raja R Harinath  <rharinath@novell.com>
414
415         * statement.cs (LabeledStatement.Resolve): Move merging of origins ...
416         * flowanalysis.cs (FlowBranchingLabeled): ... here.
417         (FlowBranching.MergeChild): Overwrite
418         reachability information from Labeled branchings too.
419
420 2006-05-16  Raja R Harinath  <rharinath@novell.com>
421
422         * statement.cs (Goto.Resolve): Merge jump origins here ...
423         * flowanalysis.cs (FlowBranching.Label): ... rather than here.
424
425         * flowanalysis.cs (FlowBranching.LookupLabel): Move CS0159 check ...
426         (FlowBranchingToplevel.LookupLabel): ... here.  Add CS1632 check.
427         (FlowBranchingGoto.LookupLabel): New.  Handle back jumps.
428         (FlowBranchingBlock.LookupLabel): Call LabeledStatement.AddReference
429         here, ...
430         * statement.cs (Goto.Resolve): ... not here.
431         (Goto.Emit): Remove CS1632 check.
432
433 2006-05-14  Marek Safar  <marek.safar@seznam.cz>
434
435         * ecore.cs (Expression.ResolveAsTypeTerminal): Fixed type in the obsolete
436         error message.
437
438 2006-05-11  Raja R Harinath  <rharinath@novell.com>
439
440         * flowanalysis.cs (UsageVector.MergeJumpOrigins): Kill.
441         (FlowBranchingBlock.Label): Use UsageVector.MergeOrigins.
442         (FlowBranchingException.Label): Likewise.
443
444         * flowanalysis.cs (MyBitVector.SetAll): New.  Sets all bits to the
445         given value.
446         (MyBitVector.Or): Use it to avoid losing information (Count).
447         (FlowBranching.MergeOrigins): Likewise.
448
449         * flowanalysis.cs (UsageVector.IsDirty): Remove.
450         (UsageVector.Parameters, UsageVector.ParameterVector): Likewise.
451         (UsageVector.Locals, UsageVector.LocalVector): Likewise.
452         (UsageVector.ToString): Simplify.
453         (UsageVector.MergeSiblings): Move here from ...
454         (FlowBranching.Merge): ... here.
455         (FlowBranchingToplevel.CheckOutParameters): Take an UsageVector,
456         not a MyBitVector.
457
458 2006-05-10  Raja R Harinath  <rharinath@novell.com>
459
460         * flowanalysis.cs (UsageVector.MergeOrigins): Simplify, now that a
461         null bitvector is treated as all-true.
462
463         * flowanalysis.cs (MyBitVector.And, MyBitVector.Or): Make lazier.
464         (MyBitVector): Rationalize invariants.  'vector != null' implies
465         that we have our own copy of the bitvector.  Otherwise,
466         'InheritsFrom == null' implies all inherited bits are true.
467
468 2006-05-09  Marek Safar  <marek.safar@seznam.cz>
469
470         * statement.cs (LocalInfo): Add IsConstant.
471         (LocalInfo.DeclareLocal): Moved from EmitMeta and changed to don't emit
472         local variable for constants.
473
474 2006-05-09  Raja R Harinath  <rharinath@novell.com>
475
476         * flowanalysis.cs (MyBitVector.Empty): New.
477         (MyBitVector): Don't allow InheritedFrom to be null.
478         (MyBitVector.And, MyBitVector.Or): Treat 'null' as all-ones.
479         (UsageVector, FlowBranching): Update to changes.
480
481         * flowanalysis.cs (FlowBranching.InTryWithCatch): Don't terminate
482         recursion.  The 'Parent == null' condition isn't sufficient for
483         anonymous methods.
484         (FlowBranching.AddBreakOrigin): Likewise.
485         (FlowBranching.AddContinueOrigin): Likewise.
486         (FlowBranching.AddReturnOrigin): Likewise.
487         (FlowBranching.StealFinallyClauses): Likewise.
488         (FlowBranching.MergeTopBlock): Move to FlowBranchingToplevel.
489         (FlowBranching.CheckOutParameters): Likewise.
490         (FlowBranchingToplevel): Terminate all the above recursions here.
491         (FlowBranchingToplevel.End): Rename from MergeTopBlock.
492         * codegen.cs (EmitContext.ResolveTopBlock): Update to changes.
493
494         * flowanalysis.cs (BranchingType.Toplevel): New.  Represents a
495         toplevel block.
496         (FlowBranchingToplevel): New.  Empty for now.
497         (FlowBranching.MergeTopBlock): Update.
498         * codegen.cs (EmitContext.ResolveTopBlock): Create a Toplevel
499         branching for the anonymous delegate.
500         (EmitContext.StartFlowBranching): Add ToplevelBlock variant.
501
502         * flowanalysis.cs (UsageVector.MergeOrigins): Reorganize.
503         (UsageVector.MergeJumpOrigins): Don't ignore current reachability
504         information at the start of the merge.  Reorganize.
505
506 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
507
508         * class.cs (MethodData.Define): Method cannot implement interface accessor.
509
510 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
511
512         * expression.cs (QualifiedAliasMember.ResolveAsTypeStep): Pass location
513         to newly introduced ctor.
514
515         * namespace.cs (Namespace.Error_NamespaceDoesNotExist): Moved an error
516         message to one place.
517         (GlobalRootNamespace.Error_NamespaceDoesNotExist): Custom message for
518         global namespace.
519
520 2006-05-07  Marek Safar  <marek.safar@seznam.cz>
521
522         * const.cs (Const.Error_ExpressionMustBeConstant): Better error message.
523
524         * ecore.cs (Expression.ResolveAsConstant): Updated.
525
526         * statement.cs (ResolveMeta): Updated.
527
528 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
529
530         * cs-parser.jay: __arglist cannot be used in initializer.
531
532 2006-05-06  Marek Safar  <marek.safar@seznam.cz>
533
534         A fix for #77879
535         * namespace.cs (LocalAliasEntry.DoResolve): Don't allow to access nested
536         private types.
537
538 2006-05-05  Raja R Harinath  <rharinath@novell.com>
539
540         * statement.cs (EmptyStatement.ResolveUnreachable): Override.
541         (LabeledStatement): Add 'name' parameter.
542         (LabeledStatement.Name, LabeledStatement.JumpOrigins): New.
543         (Block.AddLabel): Update to changes.
544         * cs-parser.jay (labeled_statement): Likewise.
545
546         * flowanalysis.cs (BranchingType.Labeled): New.
547         (UsageVector.MergeOrigins): Remove unused 'branching' argument.
548         (FlowBranchingLabeled): New.  Does nothing for now, but will
549         eventually handle 'goto' flows.
550         * codegen.cs (StartFlowBranching): Add new LabeledStatement variant.
551         * statement.cs (LabeledStatement.Resolve): Create a FlowBranching
552         that's terminated ...
553         (Block.Resolve): ... here.
554
555         * flowanalysis.cs (UsageVector.MergeFinally): Remove.
556         (UsageVector.MergeFinallyOrigins): Likewise.
557         (FlowBranching.InTryOrCatch): Likewise.
558         (FlowBranching.AddFinallyVector): Likewise.
559         (FlowBranchingException): Update to changes.
560
561         Fix #78290
562         * statement.cs (Return.Resolve): Move error checking to ...
563         * flowbranching.cs (FlowBranching.AddReturnOrigin): ... this.
564         (FlowBranchingException): Handle return origins like break and
565         continue origins.
566         (FlowBranching.UsageVector.CheckOutParameters): Remove.
567
568 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
569
570         A fix for #76122
571         * class.cs (TypeContainer.FindMembers): Includes event method in the methods
572         filter.
573
574 2006-05-04  Marek Safar  <marek.safar@seznam.cz>
575
576         A fix for #77543
577         * class.cs (MethodData.Define): Do public accessor check only when method
578         implements an interface.
579
580 2006-05-04  Raja R Harinath  <rharinath@novell.com>
581
582         Remove special handling of 'break'
583         * flowanalysis.cs (Reachability): Remove all mention of 'breaks'.
584         (Reachability.Meet): Simplify.  Remove 'do_breaks' argument.
585         (UsageVector.Break): Remove.
586         (FlowBranching.Merge): Use 'Reachable.IsUnreachable' to determine
587         reachability.
588         (FlowBranchingBreakable.Merge): Don't ResetBreaks.
589
590         * statement.cs (Break.Resolve): Call UsageVector.Goto (), not
591         UsageVector.Breaks ().  Don't set NeedsReturnLabel.
592
593 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
594
595         A fix for #75726
596         * pending.cs (PendingImplementation.BaseImplements): A found member cannot
597         be the interface member.
598
599 2006-05-03  Marek Safar  <marek.safar@seznam.cz>
600
601         A fix for #60069
602         * constant.cs (LongConstant.EmitLong): Fixed to catch also negative values
603         for emitting small (int) values.
604
605 2006-05-03  Raja R Harinath  <rharinath@novell.com>
606
607         Fix #59427
608         * flowanalysis.cs (FlowBranchingException.Merge): Ensure
609         control-flow passes through the 'finally' after merging-in all the
610         control-flows from 'try' and the 'catch' clauses.
611
612         * flowanalysis.cs (FlowBranching.IsLoop): Remove.
613         (FlowBranching.IsTryOrCatch): Remove 'is_return' parameter.  It's
614         always true at the only non-recursive entry point.
615         (FlowBranching.CreateBranching) [BranchingType.Loop]: Return a
616         FlowBranchingBreakable.
617         (FlowBranchingLoop): Remove.
618         * statement.cs (Return.DoResolve): Update to changes.
619
620         Fix #76471, #76665
621         * flowanalysis.cs (FlowBranching.BranchingType.Embedded): New.
622         (FlowBranching.CreateBranching): Handle it: create a
623         FlowBranchingContinuable.
624         (FlowBranching.BreakCrossesExceptionBoundary): Remove.
625         (FlowBranching.AddContinueOrigin): Similar to AddBreakOrigin,
626         except that it handles the 'continue' command.
627         (FlowBranching.UsageVector.MergeOrigins): Rename from
628         MergeBreakOrigins.
629         (FlowBranchingContinuable): Similar to FlowBranchingBreakable,
630         except that it overrides AddContinueOrigin.
631         (FlowBranchingException): Override AddContinueOrigin, similar to
632         AddBreakOrigin.
633         * statement.cs (While.Resolve, Foreach.ArrayForeach.Resolve):
634         Create a new branching around the embedded statement.
635         (Do.Resolve, For.Resolve): Likewise.  Do reachability analysis for
636         control flow after the embedded statement.
637         (Continue.Resolve): Move all error checking to AddContinueOrigin.
638
639         * flowanalysis.cs (FlowBranching.IsSwitch): Remove.
640         (FlowBranching.CreateBranching) [BranchingType.Switch]: Create a
641         FlowBranchingBreakable.
642         (FlowBranchingSwitch): Remove.
643
644         Fix test-503.cs
645         * statement.cs (Break.Resolve): Simplify.  Move responsibility for
646         error reporting to ...
647         * flowanalysis.cs (FlowBranching.AddBreakOrigin) ... this.
648         Rename from 'AddBreakVector'.  Add new location argument.  Return
649         a bool indicating whether the 'break' crosses an unwind-protect.
650         (FlowBranchingException.AddBreakOrigin): Add.
651         (FlowBranchingException.Merge): Propagate 'break's to surrounding
652         flowbranching after updating with the effects of the 'finally'
653         clause.
654         (FlowBranchingBreakable): New common base class for
655         FlowBranchingLoop and FlowBranchingSwitch.
656
657         * statement.cs (Foreach.ArrayForeach.Resolve): Set barrier after
658         embedded statement.
659         (Foreach.CollectionForeach.Resolve): Remove extraneous flowbranching.
660
661 2006-05-02  Raja R Harinath  <rharinath@novell.com>
662
663         * statement.cs (Do.Resolve): If the loop is infinite, set the
664         barrier.
665         (While.Resolve, For.Resolve): Set a barrier after the embedded
666         statement.  There's no direct control flow that goes from the end
667         of the embedded statement to the end of the loop.
668         * flowanalysis.cs (FlowBranching.Infinite): Remove.
669         (FlowBranchingLoop.Merge): Don't look at 'Infinite'.  The changes
670         above ensure that the reachability is correctly computed.
671
672         * flowanalysis.cs (Reachability.ResetBarrier): Remove.
673         (UsageVector.MergeBreakOrigins): If the current path is
674         unreachable, treat it as if all parameters/locals are initialized.
675         (FlowBranchingLoop.Merge): Don't clear any barriers.  Handle
676         infinite loops before merging-in break origins.
677
678         * flowanalysis.cs (Reachability.Meet): Simplify code handling 'returns'.
679         (Reachability.Reachable): Split part into ...
680         (Reachability.Unreachable): ... this.  Simplify.
681         (Reachability.IsUnreachable): Use 'Unreachable' instead.
682
683         * flowanalysis.cs (Reachability.SetReturnsSometimes): Remove.
684         (Reachability.SetThrowsSometimes): Likewise.
685         (FlowBranchingBlock.MergeTopBlock): Don't compare against
686         TriState.Always, use corresponding property.
687         * statement.cs (Lock.Resolve, Try.Resolve, Using.Resolve): Likewise.
688         (Block.Resolve): Likewise.  Remove some redundant checks.
689
690 2006-05-02  Raja R Harinath  <harinath@gmail.com>
691
692         * flowanalysis.cs (UsageVector.Throw): Set barrier too.
693         (Reachability.Meet): Don't bother checking AlwaysThrows --
694         barrier is always set.
695         (FlowBranchingBlock.Merge): Likewise.
696
697 2006-05-01  Raja R Harinath  <harinath@gmail.com>
698
699         * codegen.cs (EmitContext.ResolveTopBlock): Remove redundant
700         checks for unreachable.
701
702 2006-05-01  Marek Safar  <marek.safar@seznam.cz>
703
704         A fix for #77980
705         * flowanalysis.cs (UsageVector.IsAssigned): Add flag to ignore short path.
706
707         * statement.cs (Block.UsageWarning): Uses newly introduced flag to detect
708         whether field is really assigned.
709
710 2006-04-30  Raja R Harinath  <harinath@gmail.com>
711
712         * flowanalysis.cs (Reachability): Make 4-argument constructor
713         private.
714         (Reachability.Meet): Rename from 'And'.  Remove static variant.
715         (Reachability.Always): Rename from the highly misleading
716         'Reachability.Never'.
717         (FlowBranching.Merge): Update to changes.  Mark an impossible
718         situation with a 'throw'.
719         (*): Update to changes.
720
721 2006-04-29  Raja R Harinath  <harinath@gmail.com>
722
723         * flowanalysis.cs (TriState): Rename from FlowBranching.FlowReturns.
724         Remove 'Undefined'.
725         (FlowBranching.TriState_Meet): Rename from AndFlowReturns. Simplify.
726         (FlowBranching.TriState_Max): Rename from OrFlowReturns. Simplify.
727         (*): Update to changes.
728         * statement.cs: Update to changes.
729
730 2006-04-28  Marek Safar  <marek.safar@seznam.cz>
731
732         A fix for #78049
733         *class.cs (Method.FindOutBaseMethod): Base method cannot be property method.
734
735 2006-04-28  Raja R Harinath  <harinath@gmail.com>
736
737         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't create a
738         dummy UsageVector.
739
740         * flowanalysis.cs (UsageVector.MergeChild): Change FlowBranching
741         argument to two arguments: an usage-vector and a bool.  Move call
742         to FlowBranching.Merge () ...
743         (FlowBranching.MergeChild, FlowBranching.MergeTopBlock): ... here.
744
745         * flowanalysis.cs (UsageVector.MergeChild): Move special-case
746         handling of loop and switch reachability to ...
747         (FlowBranchingLoop.Merge, FlowBranchingSwitch.Merge): ... these.
748
749 2006-04-27  Raja R Harinath  <harinath@gmail.com>
750
751         * flowanalysis.cs (FlowBranching.InLoop): Move special-case
752         handling to FlowBranchingLoop.InLoop.
753         (FlowBranching.InSwitch): Likewise, to FlowBranchingSwitch.
754
755 2006-04-26  Marek Safar  <marek.safar@seznam.cz>
756
757         A fix for #78115
758         * anonymous.cs (AnonymousMethod.DoResolve): Moved the check whether
759         anonymous method is allowed from AnonymousContainer here.
760
761         * attribute.cs, codegen.cs (EmitContext): Add IsAnonymousMethodAllowed.
762
763 2006-04-24  Raja R Harinath  <rharinath@novell.com>
764
765         Fix #78156
766         * flowanalysis.cs (MyBitVector.Or): Add null check on argument.
767
768 2006-04-23  Marek Safar  <marek.safar@seznam.cz>
769
770         A fix for #49011.
771         * constant.cs (FloatConstant.Reduce): Add range checking for checked context.
772         (DoubleConstant.Reduce): Ditto.
773
774 2006-04-23  Raja R Harinath  <rharinath@novell.com>
775
776         * expression.cs (LocalVariableReference.DoResolveBase): Simplify.
777         Remove 'lvalue_right_side' argument.  Move parts to ...
778         (LocalVariableReference.ResolveLocalInfo, LocalVariable.DoResolve)
779         (LocalVariable.DoResolveLValue): ... these.
780
781 2006-04-21  Raja R Harinath  <rharinath@novell.com>
782
783         Fix cs1655.cs
784         * codegen.cs (EmitContext.InRefOutArgumentResolving): Remove.
785         * expression.cs (EmptyExpression.LValueMemberOutAccess): New.
786         (LocalVariableReference.DoResolveBase): Use it to implement new
787         CS1655 check.
788         (IndexerAccess.DoResolveLValue): Handle LValueMemberOutAccess.
789         (Argument.Resolve): Simplify.  Move CS1510 check ...
790         * ecore.cs (Expression.ResolveLValue): ... here.
791         (UnboxCast.DoResolveLValue): Handle LValueMemberOutAccess.
792         (PropertyExpr.DoResolveLValue): Likewise.
793         (FieldExpr.Report_AssignToReadonly): Likewise.
794         (FieldExpr.DoResolve): Add 'out_access' argument.  Use
795         LValueMemberAccess or LValueMemberOutAccess on instance depending
796         on it.
797         (FieldExpr.DoResolveLValue): Pass 'out_access' argument to
798         DoResolve as appropriate.
799
800 2006-04-20  Raja R Harinath  <rharinath@novell.com>
801
802         Fix #75800
803         * expression.cs (Invocation.VerifyArgumentsCompat): Don't try
804         implicit conversions on 'out' and 'ref' arguments.
805
806         * expression.cs (Invocation.VerifyArgumentsCompat): Reorganize to
807         improve clarity.  Remove dead code.
808
809         Fix #66031
810         * statement.cs (Block.UsageWarning): Allow VariableInfo to be null.
811         (Catch.Resolve): Resolve VarBlock if it exists.
812
813 2006-04-19  Miguel de Icaza  <miguel@novell.com>
814
815         * statement.cs (Foreach.EmitFinally): Do not emit the enumerator
816         twice, this was some residual code, the enumerator was emitted
817         properly in the two branche of if later.
818
819 2006-04-19  Raja R Harinath  <rharinath@novell.com>
820
821         * expression.cs (Cast.ResolveLValue): Remove.  The result of a
822         cast is never an lvalue.
823         (Cast.DoResolve, Cast.ResolveRest): Combine.
824         (Argument.Emit): Simplify slightly.  Move 'Expr is
825         IMemoryLocation' check ...
826         (Argument.Resolve): ... here.
827         (Argument.Error_LValueRequired): Remove.  Inline into only user.
828
829         Simplifications.  Fix cs0191-2.cs
830         * ecore.cs (FieldExpr.DoResolve): Move handling of CS0192, CS0198,
831         CS1649 and CS1651 to ...
832         (FieldExpr.Report_AssignToReadonly): ... this.  Simplify by moving
833         the actual selection of the error code and message to a lookup
834         table.  Add a dummy return value to simplify callsites.
835         (FieldExpr.ResolveLValue): Don't allow a constructor to write to
836         readonly fields of other instances of the same type.  Move CS0197
837         warning from ...
838         * expression.cs (Argument.Resolve): ... here.  Simplify code.
839         Ensure that ec.InRefOutArgumentResolving is only set during LValue
840         resolution of an out or ref argument.  The code simplification
841         above uses this invariant.
842
843 2006-04-18  Raja R Harinath  <rharinath@novell.com>
844
845         Possibly fix #77752.  Fix cs1690-[4-7].cs.
846         * ecore.cs (Expression.CheckMarshalByRefAccess): Renamed from
847         CheckMarshallByRefAccess.  Drop parameter.
848         (FieldExpr.CheckMarshalByRefAccess): Update.  Change CS1690 to a
849         warning.
850         (FieldExpr.DoResolve): Call CheckMarshalByRefAccess on
851         InstanceExpression.
852         * report.cs (AllWarnings): Add CS1690.
853         * expression.cs (Argument.Resolve): Use EmptyExpression.OutAccess
854         for ref access too.
855         (LocalVariableReference.DoResolveBase): Update.
856
857 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
858
859         * class.cs (MethodOrOperator): Moved common parts from method class.
860         detect obsolete attributes.
861         (Method.Define): Simplified as it reuses code from base.
862         (Constructor.ValidAttributeTargets): Fixed issue found during
863         refactoring.
864         (Destructor.ValidAttributeTargets): Fixed issue found during
865         refactoring.
866         (Operator): Finished refactoring set off by #78020. Operator class is now
867         ordinary method class.
868
869         * anonymous.cs: Updated.
870
871         * decl.cs (DeclSpace): Add IsGeneric
872
873 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
874
875         * class.cs (Constructor.Emit): Don't emit the attributes twice.
876
877 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
878
879         * class.cs (Operator.Emit): Extracted code from MethodData to correctly
880         detect obsolete attributes.
881         (Method.CreateEmitContext): Moved to MethodOrOperator.
882
883 2006-04-09  Marek Safar  <marek.safar@seznam.cz>
884
885         A fix for #78048.
886         * class.cs (TypeContainer.MemberCoreArrayList.DefineContainerMembers): Throw
887         customized exception to make crash detection easier.
888         (MethodOrOperator): Started to work on new base class for methods and
889         operators.
890         (Method): Derives from MethodOrOperator.
891         (Constructor.Emit): Emits its own attributes.
892         (AbstractPropertyEventMethod.Emit): Ditto.
893         (Operator): Derives from MethodOrOperator, will refactor fully in extra
894         patch.
895         (Operator.Emit): It's temporary more tricky than should be.
896         
897         * doc.cs (GetMethodDocCommentName): Updated after operator changes.
898
899         * report.cs (InternalErrorException): Add ctor with inner exception.
900
901 2006-04-08  Marek Safar  <marek.safar@seznam.cz>
902
903         A fix for #76744.
904         * ecore.cs (SimpleName.ResolveAsTypeStep): Report better error when type is
905         only not visible.
906
907 2006-04-07  Marek Safar  <marek.safar@seznam.cz>
908
909         A fix for #77916.
910         * expression.cs (ArrayCreation.GetAttributableValue): Creates correctly typed
911         array.
912
913 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
914
915         * class.cs (Class.ApplyAttributeBuilder): Report an error when ComImport
916         attribute is present and Guid not.
917         (Interface.ApplyAttributeBuilder): Ditto.
918
919         * attribute.cs: Add error message.
920
921 2006-04-06  Marek Safar  <marek.safar@seznam.cz>
922
923         A fix for #78020.
924
925         * attribute.cs (Attribute.AttachTo): The attribute can have multiple
926         sources (it's composite) so hold them in extra array as they are used in
927         Emit phase only. It worked in the previous versions by mistake.
928         (Attribute.Emit): Emit attribute for more owners when exist.
929
930         * codegen.cs, class.cs: Updated to don't re-attach attribute twice as now
931         it has now different behaviour.
932
933 2006-04-04  Marek Safar  <marek.safar@seznam.cz>
934
935         * constant.cs (Constant.IsDefaultInitializer): New method.
936
937         * class.cs: Updated.
938
939         * expression.cs (ArrayCreation.CheckIndices): Add an optimization to don't
940         re-initialize default values. It saves KBs almost for every assembly.
941         Thanks Zoltan for the idea.
942         (ArrayCreation.ResolveInitializers): Renamed from ValidateInitializers.
943         (ArrayCreation.DoResolve): Resolve only once.
944         (ArrayCreation.Emit): Emit static initializer only when it is faster.
945         (ArrayCreation.GetAttributableValue): Cope with optimized values.
946
947 2006-04-03  Zoltan Varga  <vargaz@gmail.com>
948
949         * report.cs (Warning, Error): Add 0-, 1-, and 2- argument specializations.
950         From #77961.
951
952 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
953
954         * assign.cs (Assign.DoResolve): Assignment to same variable can occur
955         in an embedded statement too.
956
957 2006-04-01  Raja R Harinath  <rharinath@novell.com>
958
959         Fix #77958
960         * statement.cs (Switch.EmitObjectInteger) [ulong]: Remove bad cast.
961
962 2006-04-01  Marek Safar  <marek.safar@seznam.cz>
963
964         A fix for #77966.
965
966         * class.cs (TypeContainer.AddPartial): Don't report an error when modifier
967         was not specified.
968
969         * modifiers.cs: Add DEFAULT_ACCESS_MODIFER.
970
971 2006-03-31  Marek Safar  <marek.safar@seznam.cz>
972
973         * assign.cs (LocalTemporary): Don't require ILGenerator in the resolve
974         phase.
975
976         * anonymous.cs, assign.cs, ecore.cs, expression.cs: Updated after
977         LocalTemporary change.
978
979         * class.cs (ClassOrStruct.DefineDefaultConstructor): Moved from
980         TypeContainer.
981         (ClassOrStruct.DefineFieldInitializers): Implemented static field
982         initializers optimization.
983         (ClassOrStruct.TypeAttr): Moved from modifiers.
984         (Constructor.CheckBase): Don't crash when static ctor has parameters.
985         (FieldBase.ResolveInitializer): Resolves initializer.
986         (FieldBase.HasDefaultInitializer): New property.
987
988         * cs-parser.jay: Removed message.
989
990         * expression.cs (CompilerGeneratedThis): New specialization.
991
992         * modifiers.cs (TypeAttr): Moved to ClassOrStruct.TypeAttr
993
994 2006-03-28  Marek Safar  <marek.safar@seznam.cz>
995
996         * cs-parser.jay, cs-tokenizer.cs: On demand Stack allocation.
997
998 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
999
1000         * ecore.cs (Expression.ResolveAsConstant): Clean up, enum constants should
1001         be now EnumConstants only.
1002
1003 2006-03-27  Marek Safar  <marek.safar@seznam.cz>
1004
1005         * attribute.cs, driver.cs: Reset more caches.
1006
1007 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1008
1009         * cs-tokenizer.cs (adjust_real): Uses float.Parse for float literals.
1010
1011 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1012
1013         * constant.cs (Constant.Reduce): Replaced EmitContext with single bool
1014         for easier reuse. Updated all overrides.
1015         (IntegralConstant): New base class for all integral constants.
1016         (IntegralConstant.Error_ValueCannotBeConverted): When assigned value if out
1017         of the constant range, report custom error.
1018         (UIntConstant.Reduce): Fixed uint conversion.
1019
1020         * ecore.cs, literal.cs: Reduce updates.
1021
1022 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1023
1024         A fix for #75813.
1025
1026         * class.cs (Constructor.Define): Removed extra if for default ctors.
1027         A patch from Atsushi Enomoto.
1028
1029 2006-03-26  Marek Safar  <marek.safar@seznam.cz>
1030
1031         * attribute.cs (Attribute.ResolveConstructor): Conversion was moved to
1032         GetAttributableValue.
1033
1034         * constant.cs (Constant.GetAttributableValue): Does implicit conversion
1035         when required.
1036
1037         * convert.cs (ImplicitConversionRequired): Error message moved to
1038         DoubleLiteral.
1039
1040         * ecore.cs (Expression.GetAttributableValue): Add type parameter for
1041         automatic implicit conversion of an output value.
1042         (EnumConstant.GetAttributableValue): Don't reduce the enum constants.
1043
1044         * expression.cs (ArrayCreation.GetAttributableValue): Add element type
1045         conversion.
1046         (TypeOf.GetAttributableValue): Add extra handling for object type.
1047
1048         * literal.cs (DoubleLiteral.Error_ValueCannotBeConverted): Doubles can have
1049         special error message.
1050
1051 2006-03-25  Marek Safar  <marek.safar@seznam.cz>
1052
1053         * class.cs (Constructor.Emit): Don't crash when struct ctor is
1054         InternalCall.
1055         (Constructor.ApplyAttributeBuilder): Transform MethodImplAttribute to be
1056         compatible with MS runtime.
1057
1058 2006-03-23  Marek Safar  <marek.safar@seznam.cz>
1059
1060         * attribute.cs (Attribute.ResolveConstructor): Check for an invalid
1061         attribute arguments here.
1062
1063         * class.cs (Indexer.Define): The check was moved to attribute class.
1064
1065 2006-03-22  Marek Safar  <marek.safar@seznam.cz>
1066
1067         * assign.cs, class.cs, codegen.cs, convert.cs, decl.cs, ecore.cs,
1068         expression.cs, typemanager.cs: Minor changes from gmcs to make merging
1069         easier.
1070
1071 2006-03-22  Raja R Harinath  <rharinath@novell.com>
1072
1073         Support ParameterDefaultValueAttribute in gmcs.  Also applied to
1074         mcs to keep code differences small.
1075         * attribute.cs (Attribute.GetParameterDefaultValue): New.
1076         * typemanager.cs (parameter_default_value_attribute_type): New.
1077         * parameter.cs (Parameter.ApplyAttributeBuilder): Use them.  Add
1078         CS1908 check.
1079
1080 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1081
1082         * expression.cs (StringConcat.Append): Reverted back to no warning state.
1083
1084 2006-03-21  Marek Safar  <marek.safar@seznam.cz>
1085
1086         * const.cs (Error_ConstantCanBeInitializedWithNullOnly): Share a message.
1087
1088         * statement.cs (Block.ResolveMeta): Look for wrong object constants in
1089         the blocks too.
1090
1091 2006-03-21  Atsushi Enomoto  <atsushi@ximian.com>
1092
1093         * doc-bootstrap.cs : fix build.
1094
1095 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1096
1097         * expression.cs (StringConcat.Append): Issue a warning when empty string
1098         is going to append.
1099
1100 2006-03-20  Marek Safar  <marek.safar@seznam.cz>
1101
1102         * assign.cs (CompoundAssign.ResolveSource): Removed.
1103
1104         * attribute.cs (ResolvePossibleAttributeType): Updated after MemberAccess
1105         clean up.
1106
1107         * class.cs (TypeContainer.FindMethods): Removed.
1108         (TypeContainer.CheckMemberUsage): Made static.
1109
1110         * codegen.cs (GetAssemblyName): Uses Length for empty string test.
1111
1112         * constant.cs (CheckRange): Removed unused type argument.
1113         (CheckUnsigned): Removed unused type argument.
1114
1115         * cs-parser.jay: Updated after MemberAccess clean up.
1116         Uses Length for empty string test.
1117
1118         * cs-tokenizer.cs: Uses Length for empty string test.
1119         (IsCastToken): Made static.
1120         (is_hex): Made static.
1121         (real_type_suffix): Made static.
1122
1123         * decl.cs (SetupCache): Made static.
1124         (OnGenerateDocComment): Removed unused ds argument.
1125
1126         * delegate.cs (VerifyDelegate): Removed unused argument.
1127
1128         * doc.cs: Uses Length for empty string test.
1129
1130         * driver.cs: Uses Length for empty string test.
1131
1132         * enum.cs (IsValidEnumType): Made static
1133
1134         * expression.cs (EnumLiftUp): Removed unused argument.
1135         (ResolveMethodGroup): Ditto.
1136         (BetterConversion): Ditto.
1137         (GetVarargsTypes): Ditto.
1138         (UpdateIndices): Ditto.
1139         (ValidateInitializers): Ditto.
1140         (MemberAccess.ctor): Ditto.
1141         (GetIndexersForType): Ditto.
1142
1143         * flowanalysis.cs: (MergeFinally): Removed unused argument.
1144
1145         * iterators.cs: Updated after MemberAccess clean up.
1146
1147         * location.cs: Uses Length for empty string test.
1148
1149         * namespace.cs: Uses Length for empty string test.
1150
1151          * report.cs (CheckWarningCode): Made static.
1152
1153         * statement.cs (LabeledStatement): Removed unused argument.
1154
1155         * typemanager.cs (FilterNone): Removed.
1156
1157 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1158
1159         * codegen.cs (EmitContext.TestObsoleteMethodUsage): Removed as it become
1160         obsolete.
1161
1162         * class.cs: Updated.
1163
1164 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1165
1166         * cs-parser.jay.cs: __arglist is not allowed for delegates.
1167
1168 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1169
1170         A fix for #77822.
1171
1172         * expression.cs (VerifyArgumentsCompat): Reverted to double error
1173         reporting, it's more tricky than I thought.
1174
1175 2006-03-18  Marek Safar  <marek.safar@seznam.cz>
1176
1177         A fix for #77816.
1178
1179         * anonymous.cs.cs (AnonymousMethod): Add host to allow access to 
1180         host container.
1181         (AnonymousMethod.ImplicitStandardConversionExists): New method.
1182         (AnonymousMethod.Compatible): Moved parameter resolving to DoResolve.
1183         Add more error reporting; Fixed issue with params.
1184
1185         * convert.cs (ImplicitStandardConversionExists): Returned conversion check.
1186
1187         * cs-parser.jay: AnonymousMethod requires host container.
1188
1189         * delegate.cs (NewDelegate.DoResolve): Updated after Compatible changes.
1190
1191 2006-03-18  Raja R Harinath  <harinath@gmail.com>
1192
1193         * class.cs: Change 'TypeContainer ds' constructor argument to
1194         'DeclSpace parent'.  Some classes were missed below due to
1195         different naming convention.
1196
1197         * class.cs (MemberCore.Parent): Delete.  This makes the
1198         ParentContainer changes below enforceable by the compiler.
1199
1200         Treat pointers to enclosing declaration space as 'DeclSpace', not
1201         'TypeContainer'.
1202         * class.cs, const.cs, delegate.cs, enum.cs, iterator.cs: Change
1203         'TypeContainer parent' constructor argument to 'DeclSpace parent'.
1204
1205         * statement.cs (LocalInfo..ctor): Use DeclSpace argument instead
1206         of TypeContainer.
1207         (Block.AddThisVariable): Likewise.
1208         * class.cs (MethodData.Define, MethodData.Emit): Likewise.
1209         (AbstractPropertyEventMethod.Emit): Likewise.
1210         (AbstractPropertyEventMethod.EmitMethod): Likewise.
1211         (GetMethod.Define, SetMethod.Define): Likewise.
1212         (PropertyMethod.Define, DelegateMethod.Define): Likewise.
1213         (DelegateMethod.EmitMethod): Likewise.
1214
1215         Fix regression test-partial-13.cs.
1216         Rationalize use of PartialContainer.  Ensure that the partial
1217         class semantics can be tied to type-correctness, i.e., any
1218         violation will cause a compile error.
1219         * class.cs, const.cs: Access all fields that belong to class
1220         TypeContainer via ParentContainer.  Arguments of EmitContexts and
1221         Resolve()-like functions still use 'Parent'.
1222
1223         * class.cs (SourceMethod): Use DeclSpace, not TypeContainer.
1224         (*.CreateEmitContext): Change TypeContainer argument to DeclSpace.
1225         (PropertyMethod.CheckModifiers): Remove unused argument.
1226         * codegen.cs (EmitContext..ctor): Change TypeContainer argument to
1227         DeclSpace.
1228
1229 2006-03-17  Raja R Harinath  <harinath@gmail.com>
1230
1231         Make semantics of PartialContainer simpler.
1232         * decl.cs (DeclSpace.IsPartial): Remove.
1233         * class.cs (TypeContainer.IsPartial): Likewise.
1234         (TypeContainer..ctor): Set PartialContainer to point to self.
1235         (TypeContainer.GetClsCompliantAttributeValue): Don't use IsPartial.
1236         (TypeContainer.FindNestedType): Likewise.
1237         (MemberCore.ParentContainer): Simplify.  Remove deprecation.
1238
1239 2006-03-17  Marek Safar  <marek.safar@seznam.cz>
1240
1241         * typemanager.cs.cs (GetInterfaces): Don't recreate 0-sized arrays.
1242
1243 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1244
1245         * class.cs (FieldMember.Emit): ParentContainer is real parent for partial
1246         classes.
1247
1248 2006-03-15  Marek Safar  <marek.safar@seznam.cz>
1249
1250         * class.cs (Operator.Define): An error for base conversion was not
1251         reported correctly.
1252
1253 2006-03-14  Atsushi Enomoto  <atsushi@ximian.com>
1254
1255         * iterator.cs : yield break is allowed in try statement which has
1256           catch clauses. Fixed bug #77767.
1257
1258 2006-03-13  Marek Safar  <marek.safar@seznam.cz>
1259
1260         A fix for #77593, #77574.
1261
1262         * class.cs (MethodCore.CheckBase): Another if for operator.
1263
1264 2006-03-09  Marek Safar  <marek.safar@seznam.cz>
1265
1266         * anonymous.cs (AnonymousMethod.Compatible): Don't crash when parameters
1267         were not resolved
1268
1269         * delegate.cs (Delegate.GetInvokeMethod): Use emitcontext free MemberLookup.
1270         (DelegateCreation.ImplicitStandardConversionExists): New method for just
1271         conversion test.
1272         
1273         *ecore.cs (Expression.MemberLookup): Don't ask for emitcontext when it's
1274         not needed.
1275
1276         * assign.cs, constant.cs, convert.cs, delegate.cs, expression.cs:
1277         Updated after another emitcontext usage was clean up. It should help us to
1278         synchronize with gmcs easier.
1279
1280 2006-03-04  Marek Safar  <marek.safar@seznam.cz>
1281
1282         A fix for #77353.
1283
1284         * class.cs (SetMethod.DefineParameters): Uses new parameters type ctor.
1285         (Event.Define): ditto
1286         (SetIndexerMethod.DefineParameters): Uses Parameters.MergeGenerated.
1287
1288         * delegate.cs (Delegate.Define): Uses Parameters.MergeGenerated.
1289         Removed redundant code and set NewSlot for Invoke method too.
1290
1291         * parameter.cs (Parameters.ctor): Add custom, type ctor.
1292         (Parameters.MergeGenerated): New method. Use this method when you merge
1293         compiler generated argument with user arguments.
1294
1295 2006-03-03  Marek Safar  <marek.safar@seznam.cz>
1296
1297         * attribute.cs (ResolveAsTypeTerminal): Removed.
1298
1299         * ecore.cs (Expression.ResolveAsTypeTerminal): Make virtual to allow
1300         specialization for predefined types; 30% speed up.
1301         Finally placed obsolete check to right place.
1302         (Expression.ResolveType): Removed.
1303
1304         * enum.cs, expression.cs, parameter.cs, statement.cs, typemanager.cs:
1305         Updated after ResolveType was removed.
1306
1307         * expression.cs (Cast.ctor): Check void cast.
1308         (Binary.ResolveAsTypeTerminal): Is never type.
1309         (Conditional.ResolveAsTypeTerminal): Is never type.
1310
1311         * rootcontext.cs (ResolveCore): Set base type to simplify some code later.
1312
1313 2006-03-01  Raja R Harinath  <rharinath@novell.com>
1314
1315         Fix #77679.
1316         * expression.cs (ParameterReference.DoResolveBase): Change return
1317         type to bool.
1318         (ParameterReference.DoResolve, ParameterReference.DoResolveLValue):
1319         Update.
1320
1321         Fix #77628.
1322         * ecore.cs (PropertyExpr.InstanceResolve): Fix CS1540 check.
1323
1324         Fix #77642.
1325         * typemanager.cs (GetFullNameSignature): Don't nullref on
1326         protected accessors.
1327
1328 2006-02-27  Marek Safar  <marek.safar@seznam.cz>
1329
1330         * attribute.cs (Attribute.PosArguments, Attribute.NamedArguments): Use
1331         these two separated members to simplify the code.
1332         (Attribute.Resolve): Refactored to use new fields and methods.
1333         (Attribute.ResolveConstructor): Extracted from ResolveArguments and
1334         implemented obsolete attribute checking.
1335         (Attribute.ResolveNamedArguments): Extracted from ResolveArguments and
1336         implemented obsolete checking again. It look line never ending quest ;-)
1337         (GlobalAttribute.ResolveConstructor): Need to override as the rest.
1338
1339         * cfold.cs (BinaryFold): TryReduce throws an exception to indicate error.
1340
1341         * constanct.cs (TryReduce): Throws OverflowException to indicate error.
1342
1343         *class.cs (Property.Define): Add RegisterProperty call.
1344
1345         * cs-parser.jay: Replaced ArrayList with fixed array for attribute
1346         argument groups (only 2).
1347
1348         * ecore.cs (Expression.GetAttributableValue): New virtual method used for
1349         encoding expression to arguments.
1350         (Expression.ExprClassToResolveFlags): Just turned to property.
1351
1352         * expression.cs (ArrayCreation.ValidateInitializers): Slightly optimized.
1353         (ArrayCreation.GetAttributableValue): Renamed from EncodeAsAttribute and
1354         optimized as well as implemented support for zero-length attributes.
1355
1356         * typemanager.cs (TypeManager.RegisterProperty, TypeManager.GetProperty):
1357         Add caching of PropertyInfo's.
1358
1359 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1360
1361         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Don't report
1362         error multiple times.
1363
1364 2006-02-25  Marek Safar  <marek.safar@seznam.cz>
1365
1366         New partial class implementation.
1367         A fix for #77027, #77029, #77403
1368
1369         * attribute.cs (Attributable): Made attributes protected.
1370
1371         * class.cs (TypeContainer): Add PartialContainer and partial_parts as
1372         the replacements of ClassPart and PartialContainer.
1373         (TypeContainer.AddClassOrStruct): Call RecordDecl here.
1374         (TypeContainer.AddInterface): Ditto.
1375         (TypeContainer.AddPartial): The main method for partial classes. It checks
1376         for errors and merges ModFlags and attributes. At the end class is added to
1377         partial_parts list.
1378         (TYpeContainer.DefineDefaultConstructor): Checks whether default ctor is
1379         required here.
1380         (TypeContainer.GetClsCompliantAttributeValue): Cope with partial class too.
1381         (TypeContainer.GetNormalPartialBases): Resolves base classes and interfaces
1382         from the rest of partial classes.
1383         (TypeContainer.GetClassBases): Simplified.
1384         (TypeContainer.DefineTypeBuilder): New method, mostly extracted from
1385         DefineType.
1386         (TypeContainer.DefineDefaultConstructor): Is used by derived classes.
1387         (TypeContainer.HasExplicitLayout): Uses Flags now.
1388         (PartialContainer): Removed.
1389         (ClassOrStruct.AddToContainer): Moved enclosing member name check here.
1390         (StaticClass): Was merged with Class.
1391         (Class.GetClassBases): class and static class bases are verified here.
1392         (Class.TypeAttr): Added static attributes when class is static.
1393         (Struct.RegisterFieldForInitialization): Moved from TypeContainer.
1394         (MemberBase): In some cases we need to call parent container for partial
1395         class. It should be eliminated but it's not easy now.
1396
1397         * cs-parser.jay: Replaced all PartialContainer with AddPartial.
1398
1399         * decls.cs (MemberCore.DocComment): Introduced new property as is used by
1400         partial classed to accumulate class comments.
1401         (MemberCore.GetClsCompliantAttributeValue): Moved from TypeContainer.
1402
1403         * doc.cs (GenerateTypeDocComment): Partial classes clean up.
1404
1405         * driver.cs (MainDriver): Tree.GetDecl was removed.
1406
1407         * modifiers.cs (Modifiers): Add partial modifier.
1408
1409         * tree.cs (Tree.decl): Removed.
1410         (RootTypes): Started to use this class more often for root types
1411         specializations.
1412
1413 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1414
1415         A fix for #77615
1416
1417         * attribute.cs (AttributeTester.GetCoClassAttribute): Don't crash when
1418         external interface does not have an attribute.
1419
1420 2006-02-22  Marek Safar  <marek.safar@seznam.cz>
1421
1422         Another prerequisites for new partial classs implementation.
1423         
1424         * attribute.cs (Attribute.Equal): Implemented.
1425         (Attribute.Emit): Changed as attributes can be applied more than twice.
1426         (Attributes.Emit): Check for duplicate attributes here.
1427
1428         * class.cs, decl.cs, delegate.cs, doc.cs, enum.cs: Don't pass DeclSpace
1429         as a parameter, clean-up.
1430
1431 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1432
1433         A fix for #77485
1434
1435         * class.cs (TypeContainer.DefineType): Cannot use ResolveType because it
1436         contains obsolete attribute check which can in some cases look for base
1437         type of current class which is not initialized yet.
1438         (TypeContainer.BaseType): Replacement of ptype.
1439
1440         * decl.cs (MemberCore.CheckObsoleteType): Reuse existing code.
1441
1442 2006-02-11  Marek Safar  <marek.safar@seznam.cz>
1443
1444         First of prerequisites for new partial classs implemention.
1445         
1446         * attribute.cs (Attributable): Extended by ResolveContext;
1447         Attributes finally have correct context for resolving in all cases.
1448         (AttachTo): Attribute owner is assigned here.
1449
1450         * codegen.cs (IResolveContext): Introduce new interface to hold
1451         all information needed in resolving phase.
1452         (EmitContext): Implements IResolveContext; more clean-up needed here.
1453         
1454         * decl.cs (MemberCore): Implemented IResolveContext.
1455
1456         * anonymous.cs, attribute.cs, class.cs, codegen.cs, const.cs,
1457         decl.cs, ecore.cs, enum.cs, expression.cs, iterators.cs, namespace.cs,
1458         parameter.cs, statement.cs, tree.cs, typemanager.cs:
1459         Refactored to use new IResolveContext instead of EmitContext; cleanup
1460
1461 2006-02-06  Miguel de Icaza  <miguel@novell.com>
1462
1463         * codegen.cs (EmitScopeInitFromBlock): check here the
1464         capture_context, there is no need to make two calls to the
1465         EmitContext. 
1466
1467         * anonymous.cs: Add some debugging messages that might help me
1468         track other instances of this problem in the future (the
1469         regression of test 467).
1470
1471         * cs-parser.jay: track the variable block, as we need to initalize
1472         any captured variables declared in this block for the "catch"
1473         portion of the "Try" statement.
1474
1475         * statement.cs (Try.Emit): If the "Catch" has a VarBlock, emit any
1476         scope initialization for captured variables. 
1477
1478         Also, move the emit for the variables after the block location has
1479         been marked.
1480
1481 2006-02-06  Marek Safar  <marek.safar@seznam.cz>
1482
1483         * ecore.cs (PropertyExpr.FindAccessors): Just made flags const.
1484
1485 2006-02-02  Miguel de Icaza  <miguel@novell.com>
1486
1487         * anonymous.cs (CaptureContext.EmitInitScope): I was wrong in the
1488         commit yesterday, the initialization for the roots is necessary.
1489         What is not necessary is the scope activation.
1490
1491 2006-02-02  Raja R Harinath  <rharinath@novell.com>
1492
1493         * ecore.cs (PropertyExpr.DoResolveLValue): Add CS0206 check.
1494         * expression.cs (IndexerAccess.DoResolveLValue): Add CS1612 and
1495         CS0206 checks.
1496         (Argument.Resolve): Remove CS0206 checks.
1497
1498 2006-02-01  Miguel de Icaza  <miguel@novell.com>
1499
1500         * anonymous.cs (CaptureContext.EmitInitScope): Do not emit the
1501         scopes for all the roots, the scopes will now be emitted when the
1502         Blocks are entered.   [This change was wrong, fixed on 2006-02-02]
1503
1504         (CaptureContext.EmitScopeInitFromBlock): Simply emit the ScopeInfo
1505         code.  This reduces a lot of existing cruft.
1506         
1507         * statement.cs (Block.Emit): Call EmitScopeInitFromBlock here, so
1508         that the ScopeInfo is generated as we enter the scope, not at the
1509         time of use, which is what we used to do before.
1510
1511         * codegen.cs (EmitScopeInitFromBlock): New routine, this is called
1512         every time a Block is about to be emitted if we have a
1513         CaptureContext. 
1514
1515 2006-02-01  Raja R Harinath  <rharinath@novell.com>
1516
1517         * typemanager.cs (NoTypes, NoTypeExprs): Remove.
1518         (Reset): Update.
1519         * *.cs: Use Type.EmptyTypes instead of TypeManager.NoTypes.
1520
1521         * typemanager.cs (cons_param_array_attribute): Make private.
1522         (Reset): Set it to null.
1523         (InitCoreHelpers): Don't initialize it.
1524         (ConsParamArrayAttribute): New.  Initialize it as needed.
1525         * parameter.cs (ParamsParameter.ApplyAttribute): Update to change.
1526
1527 2006-01-31  Miguel de Icaza  <miguel@novell.com>
1528
1529         * expression.cs: There might be errors reported during the
1530         selection of applicable methods.  If there are errors, do not
1531         continue execution as it will lead the compiler to crash.
1532
1533 2006-01-30  Miguel de Icaza  <miguel@novell.com>
1534
1535         * expression.cs: Member access is not allowed on anonymous
1536         methods.  Fixes #77402.
1537
1538 2006-01-30  Raja R Harinath  <rharinath@novell.com>
1539
1540         Fix #77401
1541         * cs-parser.jay (VariableDeclaration): Don't set
1542         current_array_type to null.
1543         (field_declaration, event_declaration, declaration_statement):
1544         Set it to null here.
1545
1546 2006-01-28  Raja R Harinath  <harinath@gmail.com>
1547
1548         * typemanager.cs (GenericParameterPosition): New.
1549         * doc.cs: Use it.
1550
1551 2006-01-28  Atsushi Enomoto  <atsushi@ximian.com>
1552
1553         * doc.cs : To process "include" elements, first we should create
1554           another list than XmlNodeList, because it could result in node
1555           removal, which could result in that the XmlNodeList gives up
1556           yielding next node.
1557
1558           (Also made code identical to gmcs again.)
1559
1560 2006-01-25  Miguel de Icaza  <miguel@novell.com>
1561
1562         * ecore.cs: Introduce an error report that we were not catching
1563         before, if not silent, we must report the error.  Gonzalo ran into
1564         it.
1565
1566 2006-01-23  Miguel de Icaza  <miguel@novell.com>
1567
1568         A fix for bug: #76957
1569         
1570         * iterators.cs (MoveNextMethod.CreateMethodHost): call
1571         ComputeMethodHost before creating the method, this is a new
1572         requirement. 
1573
1574         * anonymous.cs (AnonymousContainer): Now we track all the scopes
1575         that this method references (RegisterScope).  The actual scope
1576         where the method is hosted is computed with the ComputeMethodHost
1577         before we create the method.
1578
1579         Moved the Deepest routine here.
1580
1581         (AnonymousContainer.ComputeMethodHost): New routine used to
1582         compute the proper ScopeInfo that will host the anonymous method.
1583
1584         (ScopeInfo): Deal with multiple roots.  The problem was that we
1585         did not have a unique root where all ScopeInfos could be hanged
1586         from.   Remove `topmost' ScopeInfo, and instead keep an arraylist
1587         of roots.  
1588
1589         Remove AdjustMethodScope which is now computed at the end.  Remove
1590         LinkScope which did a partial link, instead link all ScopeInfos
1591         before code generation from the new "LinkScopes" routine. 
1592
1593         Simplify all the Add* routines as they no longer need to maintain
1594         the tree, they just need to record that they are using variables
1595         from a ScopeInfo.
1596
1597         (IsAncestor, GetAncestorScopes, GetParentScope, LinkScope): New
1598         routines to produce the forest of ScopeInfo trees.
1599
1600         * class.cs (TypeContainer.AppendMethod): This is just like
1601         AddMethod, but ensures that an interface implementation method
1602         (IEnumerable.XXX) is not inserted at the beginning of the queue of
1603         methods, but at the end.
1604
1605         We use this functionality to ensure that the generated MoveNext
1606         method in the iterator class is resolved/emitted before the
1607         enumerator methods created.   
1608
1609         This is required because the MoveNext method computes the right
1610         ScopeInfo for the method.  And the other methods will eventually
1611         need to resolve and fetch information computed from the anonymous
1612         method. 
1613
1614 2006-01-21  Raja R Harinath  <harinath@gmail.com>
1615             Carlos Alberto Cortez  <calberto.cortez@gmail.com>
1616
1617         Fix rest of #76995.
1618         * namespace.cs (NamespaceEntry.UsingExternalAliases): Don't add to
1619         the 'aliases' hash.
1620         (NamespaceEntry.LookupAlias): Lookup 'extern_aliases' hash too.
1621         (NamespaceEntry.VerifyUsing): Resolve external aliases too.
1622
1623 2006-01-18  Raja R Harinath  <rharinath@novell.com>
1624
1625         Fix #76656, cs0231-2.cs.
1626         * cs-parser.jay (formal_parameter_list): Make error case catch
1627         more issues.
1628         (parenthesized_expression_0): Add CS1026 check.
1629         (invocation_expression): Remove unused { $$ = lexer.Location }.
1630
1631 2006-01-17  Raja R Harinath  <rharinath@novell.com>
1632
1633         Fix #76824.
1634         * cs-parser.jay (statement_expression): Don't list out the
1635         individual statement-expressions.  Convert syntax error into
1636         CS0201 check.
1637
1638 2006-01-16  Raja R Harinath  <rharinath@novell.com>
1639
1640         Fix #76874.
1641         * ecore.cs (MemberAccess.CheckIntermediateModification): Remove.
1642         (UnboxCast.DoResolveLValue): New.  Move CS0445 check from
1643         CheckIntermediateModification.
1644         (FieldExpr.DoResolve): Add new two-argument version that
1645         allows us to resolve the InstanceExpression as an lvalue.
1646         The one-argument variant is now just a wrapper.
1647         (FieldExpr.DoResolveLValue): Use two-argument DoResolve.
1648         Resolve the lhs as an lvalue if the it has a value type.
1649         (FieldExpr.AssignToReadonly): Move CS1648 and CS1650 checks
1650         from Assign.DoResolve.
1651         (PropertyExpr.InstanceResolve): Allow InstanceExpression to be
1652         resolved as an lvalue.
1653         (PropertyExpr.DoResolve): Update.
1654         (PropertyExpr.DoResolveLValue): Resolve the lhs as an lvalue if it
1655         has a value type.  Move CS1612 check here from
1656         CheckIntermediateModification.
1657         * assign.cs (Assign.DoResolve): Remove CS1648 and CS1650 checks.
1658         * expression.cs (EmptyExpression.OutAccess): New.  Used as the
1659         'right_side' of a ResolveLValue on an 'out' argument.
1660         (EmptyExpression.LValueMemberAccess): New.  Used as the
1661         'right_side' of a propagated ResolveLValue on a value type.
1662         (LocalVariableReference.DoResolveBase): Recognize
1663         EmptyExpression.OutAccess and EmptyExpression.LValueMemberAccess.
1664         Add CS1654 check.
1665         (Argument.Resolve): Use EmptyExpression.OutAccess rather than
1666         EmptyExpression.Null.
1667
1668 2006-01-16  Atsushi Enomoto  <atsushi@ximian.com>
1669
1670         * typemanager.cs : added IsGenericParameter(). In mcs it always
1671           return false.
1672         * doc.cs : for generic parameters, use GenericParameterPosition,
1673           not FullName.
1674
1675 2006-01-12  Ben Maurer  <bmaurer@andrew.cmu.edu>
1676
1677         * expression.cs: Fix Console.WriteLine ((this = x).foo);
1678
1679 2006-01-12  Miguel de Icaza  <miguel@novell.com>
1680
1681         This fixes the problem where we used ldfld instead of ldflda to
1682         load the "THIS" pointer on captured parameters, when THIS is a
1683         value type.  See bug #77205.
1684         
1685         * iterators.cs (CapturedThisReference.Emit): Pass false to
1686         EmitThis (we do not need the address).
1687
1688         * codegen.cs (EmitThis): it needs to know whether we need the
1689         address of `this' or not.  This is used by value types.  
1690
1691         * expression.cs (This.AddressOf): Pass true to the EmitThis call,
1692         every other call passes false.
1693
1694 2006-01-12  Raja R Harinath  <rharinath@novell.com>
1695
1696         Fix #77221.
1697         * typemanager.cs (TryGetBaseDefinition): Rename from the mis-named
1698         GetOverride.
1699         * expression.cs (Invocation.OverloadResolve): Update.
1700         (Invocation.DoResolve): Avoid double resolution of invocation.
1701
1702 2006-01-11  Raja R Harinath  <rharinath@novell.com>
1703
1704         Fix #77180.
1705         * expression.cs (Unary.Emit): When in /checked+ mode, don't emit
1706         unary negation of floating point types as 0-expr; negation cannot
1707         overflow in floating point types.
1708
1709         Fix #77204.
1710         * expression.cs (MemberAccess.DoResolve): Disallow the use of '.'
1711         on operands of 'void' type.
1712
1713         Fix #77200.
1714         * cfold.cs (BinaryFold): Implement folding of BinaryOr, BinaryAnd
1715         and ExclusiveOr for boolean constants too.
1716
1717 2006-01-09  Raja R Harinath  <rharinath@novell.com>
1718
1719         Fix #75636.
1720         * expression.cs (Invocation.OverloadResolve): Replace reflected
1721         override methods with their base virtual methods, rather than
1722         skipping over them.
1723         * typemanager.cs (TypeManager.GetOverride): New.
1724
1725 2006-01-05  Jb Evain  <jbevain@gmail.com>
1726
1727         * class.cs (Property.Define, Indexer.Define): do not tag the
1728         properties as SpecialName | RTSpecialName.
1729
1730 2006-01-04  Miguel de Icaza  <miguel@novell.com>
1731
1732         * class.cs (MethodCore.IsDuplicateImplementation): This method was
1733         doing a low-level comparission of parameter types.  It was lacking
1734         a check for __argslist. 
1735
1736 2005-12-30  Miguel de Icaza  <miguel@novell.com>
1737
1738         * expression.cs (ParameterReference.DoResolveBase): Allow
1739         reference parameters if they are local to this block. 
1740
1741         This allows the ref and out parameters of a delegate to be used in
1742         an anonymous method, for example:
1743
1744         delegate void set (out int x);
1745
1746         set s = delegate (out int x){
1747                 x = 0;
1748         };
1749
1750         This is used by functionality introduced late in the C# language.
1751         
1752         * anonymous.cs (AnonymousMethod.Compatible): Allow anonymous
1753         method that take ref and out parameters. 
1754
1755         Fixes #77119 which was a late change in the spec.
1756
1757 2005-12-23  Miguel de Icaza  <miguel@novell.com>
1758
1759         * anonymous.cs (ScopeInfo.LinkScope): Do not link the scope to its
1760         parent if its the same scope.  Fixes #77060.
1761
1762 2005-12-21  Miguel de Icaza  <miguel@novell.com>
1763
1764         * driver.cs: Report the case of no source files and no -out:
1765         argument provided.
1766
1767 2005-12-20  Raja R Harinath  <rharinath@novell.com>
1768
1769         Fix #77035.
1770         * expression.cs (ComposedCast.GetSignatureForError): Define.
1771
1772 2005-12-18 Carlos Alberto Cortez <calberto.cortez@gmail.com>
1773
1774         Fix #76995
1775
1776         * namespace.cs (NamespaceEntry): Add extern_aliases as a
1777         ListDictionary, to contain the ExternAliasEntry entries (in
1778         addition to the NamespaceEntry.aliases hashtable). This field is
1779         shared between the original entry and its doppelganger (bodyless 
1780         copy of it).
1781         (NamespaceEntry.UsingExternalAlias): Add the extern alias entry to
1782         extern_aliases field.
1783         (NamespaceEntry.Lookup): Move the IsImplicit check after the
1784         lookup in extern_aliases.
1785
1786 2005-12-16  Raja R Harinath  <rharinath@novell.com>
1787
1788         Fix #77006.
1789         * class.cs (TypeContainer.Mark_HasEquals): New.
1790         (TypeContainer.Mark_HasGetHashCode): New.
1791         (ClassPart): Override them.
1792         (MethodCore.CheckBase): Use them instead of referring to Parent.Methods.
1793
1794         Fix #77008.
1795         * enum.cs (EnumMember.EnumMember): Pass the parent_enum as the
1796         'parent' argument to the base constructor.
1797
1798         Remove all mention of TypeContainer from decl.cs.
1799         * decl.cs (MemberCore.Parent): Change into a DeclSpace.
1800         (MemberCore.MemberCore): Change type of 'parent' argument to DeclSpace.
1801         (DeclSpace.DeclSpace): Likewise.
1802         (DeclSpace.DefineMembers): Remove unused argument.
1803         * cs-parser.jay (pop_current_class): Update to changes.  Simplify
1804         debugging check -- we don't care if the debug code throws an
1805         InvalidCastException instead of an InternalErrorException.
1806         * class.cs (TypeContainer.DefineMembers): Update to changes.
1807         (TypeContainer.DoDefineMembers): Likewise.
1808         (TypeContainer.GetMethods): Likewise.
1809         (PropertyMember.Define): Likewise.
1810         (MemberBase.Parent): New property that forwards to
1811         MemberCore.Parent, but ensures that we get a TypeContainer.
1812         * rootcontext.cs (RootContext.PopulateCoreType): Update to changes.
1813         (RootContext.PopulateTypes): Likewise.  Remove special case code
1814         for !RootContext.StdLib: DefineMembers is idempotent.
1815
1816 2005-12-14  Miguel de Icaza  <miguel@novell.com>
1817
1818         * convert.cs (ExplicitConversionCore): Check the return value from
1819         ExplicitConversionCore which can return null on failure.  Fixes #76914
1820
1821 2005-12-13  Marek Safar  <marek.safar@seznam.cz>
1822
1823         * class.cs (Method.ApplyAttributeBuilder): Test out modifier properly.
1824
1825 2005-12-11  Atsushi Enomoto  <atsushi@ximian.com>
1826
1827         * doc.cs : The search for referenced namespace was insufficient to
1828           get global one as it used to do. Fixed bug #76965.
1829
1830 2005-12-10  Atsushi Enomoto  <atsushi@ximian.com>
1831
1832         * doc.cs : check name in cref in the last phase that whether it is
1833           namespace or not.
1834
1835 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1836
1837         * cs-tokenizer.cs : reverted the latest change: it somehow broke
1838           Mono.C5.
1839
1840 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1841
1842         * doc.cs : so it turned out that we cannot skip override check for 
1843           interface members. Fixed bug #76954.
1844
1845 2005-12-09  Atsushi Enomoto  <atsushi@ximian.com>
1846
1847         * cs-tokenizer.cs : fixed bug #75984:
1848           - #warning and #error should not be handled when the source line
1849             is disabled.
1850           - #line is not checked strictly when the source line is disabled.
1851           - #define and #undef is on the other hand checked strictly at any
1852             state.
1853
1854 2005-12-08  Atsushi Enomoto  <atsushi@ximian.com>
1855
1856         * cs-tokenizer.cs : missing Location (actually, filename) in one of
1857           CS1027 report.
1858
1859 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1860
1861         * attribute.cs (GlobalAttribute.ctor): Pass NamespaceEntry only.
1862
1863         * class.cs (EmitFieldInitializers): Simplified and fixed to work with
1864         event initializers.
1865         (FieldBase.EmitInitializer): Moved from TypeContainer and simplified.
1866         (FieldBase.Initializer): Initializer is now optional.
1867         (EventField.Define): Only event field can have initializer.
1868
1869         * codegen.cs (EmitContext): DeclSpace is not readonly (small hack).
1870
1871         * const.cs (Const): Reuse initializer.
1872
1873         * cs-parser.jay: Updated after FieldBase changes.
1874         Added current_array_type to simplify array initializers.
1875
1876         * ecore.cs (NullCast.IsDefaultValue): Implemented.
1877
1878         * expression.cs, iterators.cs: Updated.
1879
1880         * namespace.cs (NamespaceEntry): Made UsingFound private.
1881
1882 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1883
1884         * parameterCollection.cs: Obsolete, removed.
1885         * parser.cs: Obsolete, removed.
1886
1887 2005-12-05  Marek Safar  <marek.safar@seznam.cz>
1888
1889         Fix #76849.
1890         * class.cs (Constructor.Emit): Set obsolete checking for whole context.
1891
1892         * enum.cs (Enum.Define): Set obsolete context here.
1893
1894 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1895
1896         * doc.cs :
1897           - FindDocumentedMember() now expects 1) paramList as null
1898             when "we don't have to check the number of parameters" and
1899             2) Type.EmptyTypes when "there is no arguments".
1900           - Introduced FoundMember struct to hold the exact type which was
1901             used to find the documented member (the above change broke
1902             test-xml-044; it might be better just to use DeclaringType than
1903             what MS does, like this change does, but it depends on usage.)
1904
1905 2005-12-05  Atsushi Enomoto  <atsushi@ximian.com>
1906
1907         * doc.cs : documented member might be from DeclaringType for nested
1908           types. Fixed bug #76782.
1909
1910 2005-12-03  Ben Maurer  <bmaurer@ximian.com>
1911
1912         * anonymous.cs: Have the param code handle leaving copies on the
1913         stack etc. Allows anonymous params to take part in the assignment
1914         code (++, +=, etc). Fixes bug #76550
1915
1916         * expression.cs: Handle the prepare_for_load/leave_copy by passing
1917         it down to the anon code.
1918
1919         * iterators.cs: Use dummy var here
1920
1921         * codegen.cs: Handle new vars
1922
1923 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1924
1925         Fix #76849.
1926         * class.cs (MethodData.Define): Set proper Obsolete context.
1927
1928         * ecore.cs (FieldExpr.ResolveMemberAccess): Don't check [Obsolete] in
1929         obsolete context.
1930         (FieldExpr.DoResolve): Ditto.
1931
1932 2005-12-01  Marek Safar  <marek.safar@seznam.cz>
1933
1934         Fix #76849.
1935         * class.cs (MethodCore.DoDefineParameters): Test [Obsolete] only when
1936         parent is not obsolete.
1937
1938 2005-12-01  Atsushi Enomoto  <atsushi@ximian.com>
1939
1940         * doc.cs : (FindDocumentedMember) find parameterless members first
1941           and get CS0419 in the early stage. Fixed first case of bug #76727.
1942
1943 2005-11-30  Marek Safar  <marek.safar@seznam.cz>
1944
1945         Fix #76859.
1946         * ecore.cs (Expression.ResolveAsConstant): Report constant error only when
1947         no error was reported.
1948
1949         *expression.cs (Binary.DoResolve): left can be null.
1950
1951 2005-11-22  Marek Safar  <marek.safar@seznam.cz>
1952
1953         Fix #76783.
1954         * class.cs (MethodData.Emit): Parameters should be labeled first.
1955
1956 2005-11-21  Marek Safar  <marek.safar@seznam.cz>
1957
1958         Fix #76761.
1959         * parameter.cs (Parameter.ApplyAttributeBuilder): Fixed `ref' detection.
1960
1961 2005-11-18  Marek Safar  <marek.safar@seznam.cz>
1962
1963         * attribute.cs (AreParametersCompliant): Moved to Parameter.
1964
1965         * class.cs (MethodCore): Parameter clean up.
1966         (IMethodData): Added ParameterInfo.
1967         (MethodData): Parameter clean up.
1968         (Indexer.Define): Parameter clean up.
1969
1970         * anonymous.cs,
1971         * codegen.cs,
1972         * cs-parser.jay,
1973         * decl.cs,
1974         * doc.cs,
1975         * ecore.cs,
1976         * flowanalysis.cs,
1977         * iterators.cs,
1978         * pending.cs,
1979         * statement.cs,
1980         * typemanager.cs: Parameter clean up.
1981
1982         * delegate.cs (Define): Get rid of duplicated code.
1983
1984         * expression.cs (ParameterReference): Removed useless parameters
1985         and simplified.
1986         (Invocation): Ditto.
1987
1988         * parameter.cs (ParamsParameter): New class, params specialization.
1989         (ArglistParameter): Attemp to separate arglist.
1990         (Parameter): Refactored to be reusable and faster.
1991         (Parameter.Modifier): Made understandable.
1992         (Parameters): Changed to be used as a class for `this' assembly
1993         parameters. Refactored to use new specialized classes.
1994
1995         * support.cs (ParameterData): Added Types property.
1996         (InternalParameters): Deleted.
1997
1998 2005-08-20  Martin Baulig  <martin@ximian.com>
1999
2000         Merging this patch from GMCS to fix #75867.
2001
2002         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2003         scope if we don't already have it.
2004
2005 2005-11-17  Martin Baulig  <martin@ximian.com>
2006
2007         * anonymous.cs
2008         (CaptureContext.EmitMethodHostInstance): Use `Ldarg_0' if we
2009         inherit the scope from our parent.  Fixes #76653.
2010
2011 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2012
2013         * doc.cs : the previous patch does not actually fix the bug.
2014           PropertyInfo override check is now implemented and really fixed it.
2015         * expression.cs : Invocation.IsAncestralType() is used from doc.cs.
2016
2017 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2018
2019         * doc.cs : apply "override filter" also to properties.
2020           Fixed bug #76730.
2021
2022 2005-11-16  Atsushi Enomoto  <atsushi@ximian.com>
2023
2024         * doc.cs : renamed FindMembers() to FindMethodBase(). For interfaces,
2025           no need to check overrides. For classes, omit those results from 
2026           interfaces since they must exist in the class. Fixed bug #76726.
2027
2028 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2029
2030         * typemanager.cs : (GetFullNameSignature) differentiate indexers
2031           with different parameters. Fixed the second problem in #76685.
2032
2033 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2034
2035         * doc.cs : (FindDocumentedMember) pass invocation_type as well (to
2036           get expected 'protected' access in CheckValidFamilyAccess()).
2037           Fixed bug #76692.
2038
2039 2005-11-15  Atsushi Enomoto  <atsushi@ximian.com>
2040
2041         * doc.cs : (GenerateTypeDocComment) Fields could be FixedField.
2042           Fixed bug #76705.  CS1569 was incorrectly commented out.
2043
2044 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2045
2046         * doc.cs : use Invocation.IsOverride() to do real override check.
2047         * expression.cs : made Invocation.IsOverride() internal.
2048
2049 2005-11-14  Atsushi Enomoto  <atsushi@ximian.com>
2050
2051         * doc.cs : use TypeManager.FindMembers() instead of (possible)
2052           TypeBuilder.FindMembers() and filter overriden base members out.
2053           Fixed bug #76990.
2054
2055 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2056
2057         * doc.cs : ref/out parameters are represented as '@' (instead of
2058           '&' in type FullName). Fixed bug #76630 (additionally crefs).
2059
2060 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2061
2062         * doc.cs : when there was no '.' in cref to methods in doc comment,
2063           then parameters were missing in the output. Fixed bug #76691.
2064
2065 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2066
2067         * driver.cs : don't output docs when there is an error.
2068           Fixed bug #76693.
2069
2070 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2071
2072         * doc.cs :
2073           Now it should detect indexers. Fixed primary concern in bug #76685.
2074           Fixed CS0419 message to not show the identical member signature in
2075           the message.
2076
2077 2005-11-13  Atsushi Enomoto  <atsushi@ximian.com>
2078
2079         * doc.cs : (FindDocumentedMember) use TypeManager.MemberLookup()
2080           instead of Type.FindMembers() since it does not handle events.
2081           Fixed bug #71604.
2082
2083 2005-11-12  Gert Driesen  <drieseng@users.sourceforge.net>
2084
2085         * codegen.cs: Fixed typo (speficied -> specified).
2086
2087 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2088
2089         Fix #76369.
2090         * doc.cs (FindDocumentedTypeNonArray): Don't resolve again.
2091
2092 2005-11-11  Marek Safar  <marek.safar@seznam.cz>
2093
2094         * attribute.cs: Changed error message.
2095
2096         * cs-tokenizer.cs: One more check.
2097
2098 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2099
2100         * statement.cs (Block.Resolve): Ignore empty statement.
2101
2102 2005-11-10  Marek Safar  <marek.safar@seznam.cz>
2103
2104         * report.cs: Made error/warning methods more strict to avoid
2105         their misuse.
2106
2107         * anonymous.cs, attribute.cs, class.cs, codegen.cs, constant.cs,
2108         convert.cs, cs-parser.jay, cs-tokenizer.cs, decl.cs, delegate.cs,
2109         doc.cs, driver.cs, ecore.cs, expression.cs, location.cs,
2110         namespace.cs, parameter.cs, statement.cs, typemanager.cs: Updated.
2111
2112 2005-11-08  Marek Safar  <marek.safar@seznam.cz>
2113
2114         * attribute.cs (Attribute.GetCoClassAttributeValue): New method.
2115         (AttributeTester.GetCoClassAttribute): Get CoClassAttribute.
2116
2117         * class.cs (TypeContainer.IsComImport): New property.
2118         (Constructor.Define): Create proper ctor for ComImport types.
2119
2120         * expression.cs (New.CheckComImport): Fixed.
2121
2122 2005-11-07  Miguel de Icaza  <miguel@novell.com>
2123
2124         * anonymous.cs (CaptureContext.AddParameterToContext): The fact
2125         that a parameter has been captured does not mean that we do not
2126         have to do the rest of the processing.  This fixes the second part
2127         of #76592.  If there was another anonymous method capturing
2128         values in the past, the Scope would never be set for the second
2129         method that captured the same parameter.
2130
2131         (CaptureContext.EmitAssignParameter): When `leave_copy' is passed,
2132         properly manipulate the stack.   Second part of fix for #76592.
2133
2134         * expression.cs (New): Add support for invoking "new" on
2135         interfaces that have been flagged with the ComImport attribute and
2136         the CoClass.  Fixes #76637 
2137
2138         * statement.cs (Try.DoEmit): When a variable is captured, do not
2139         try to emit the vi.LocalBuilder variable as it has been captured.
2140         Create a temporary variable and store the results on the
2141         FieldBuilder.  Fixes #76642
2142
2143 2005-11-07  Marek Safar  <marek.safar@seznam.cz>
2144
2145         * class.cs (CheckPairedOperators): Made compilable with csc 2.0.
2146
2147         * ecore.cs (InstanceResolve): Fixed CS1540 detection.
2148
2149         * expression.cs (Binary.DoResolve): Added && optimalization.
2150     
2151         * typemanager.cs (AddUserType): Removed useless argument.
2152
2153 2005-11-04  Marek Safar  <marek.safar@seznam.cz>
2154
2155         * statement.cs (Block.variables): Uses ListDictionary.
2156
2157 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2158
2159         Fix #75969.
2160         * class.cs (PartialContainer.EmitType): Customized to emit
2161         security attributes.
2162         (ClassPart.ApplyAttributeBuilder): Transform security attribute
2163         for partial classes.
2164
2165 2005-11-03  Marek Safar  <marek.safar@seznam.cz>
2166
2167         Fix #76599.
2168         * expression.cs (ElementAccess.DoResolveLValue): Fixed buffer
2169         access has to be fixed.
2170         
2171         * typemanager.cs (IsUnmanagedType): Wrong common field type.
2172
2173 2005-11-01  Marek Safar  <marek.safar@seznam.cz>
2174
2175         Fix #76590.
2176         * ecore.cs (NullCast.Reduce): Implemented.
2177
2178         * expression.cs (ArrayCreation.CheckIndices): Correcly check
2179         constant type.
2180         
2181         * statement.cs (SwitchLabel.ResolveAndReduce): Catch null
2182         properly.
2183         (Foreach.Resolve): Catch null properly.
2184
2185 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2186  
2187         * cs-tokenizer.cs: Warning text fix.
2188
2189         * driver.cs: AllWarningNumbers exposed on public interface.
2190
2191         * report.cs (): Reviewed warning numbers.
2192         (IsValidWarning): Use binary search.
2193
2194 2005-10-29  Marek Safar  <marek.safar@seznam.cz>
2195  
2196         * driver.cs: Implemeted resource visibility.
2197         (Resources): New class for code sharing between /res: and
2198         /linkres:
2199  
2200 2005-10-28  Marek Safar  <marek.safar@seznam.cz>
2201
2202         Fix #76568.
2203         * cfold.cs (ConstantFold.BinaryFold): Implemented null cast
2204         folding.
2205         
2206         * convert (Convert.ImplicitReferenceConversion): NullCast holds
2207         contants only.
2208         
2209         * ecore.cs (NullCast): Child is contant only.
2210         
2211         * literal.cs (NullLiteral.Reduce): null can be converted to any
2212         reference type.
2213
2214 2005-10-28  Kornél Pál  <kornelpal@hotmail.com>
2215
2216         * driver.cs: Use Encoding.Default as default code page instead
2217           of ISO-28591.
2218
2219 2005-10-27  Raja R Harinath  <rharinath@novell.com>
2220
2221         Fix #76085.
2222         * expression.cs (Invocation.Error_InvalidArguments): Handle
2223         __arglist parameters.
2224         (Invocation.VerifyArgumentsCompat): Likewise.
2225         * support.cs (ReflectionParameters.GetSignatureForError): Print
2226         __arglist parameters.
2227         (InternalParamters.GetSignatureForError): Likewise.
2228         * parameter.cs (Parameters.GetSignatureForError): Likewise.
2229
2230 2005-10-26  Marek Safar  <marek.safar@seznam.cz>
2231
2232         * attribute.cs (GetPropertyValue): Made public.
2233
2234         * codegen.cs (AssemblyClass): ResolveClsCompliance renamed to
2235         Resolve.
2236         Add new property WrapNonExceptionThrows to handle 2.0 assembly
2237         attribute.
2238         (AssemblyClass.Emit): Emit RuntimeCompatibilityAttribute when it
2239         is not defined.
2240         
2241         * driver.cs: Reflect method name change.
2242         
2243         * statement.cs (Try.Resolve): Warn when try has both general
2244         exception handlers.
2245         
2246         * typemanager.cs: runtime_compatibility_attr_type new predefined
2247         type.
2248
2249 2005-10-26  Raja R Harinath  <harinath@gmail.com>
2250
2251         Fix #76419.
2252         * pending.cs (InterfaceMethod): Allow tm.args [i] to be null --
2253         treat it as an empty parameter list.
2254
2255 2005-10-26  Raja R Harinath  <rharinath@novell.com>
2256
2257         Fix #76271.     
2258         * ecore.cs (SimpleName.DoSimpleNameResolve): Make fall-back 
2259         ResolveAsTypeStep silent.
2260         * statement.cs (Block.AddConstant): Mark block as used.
2261         (Block.ResolveMeta): Avoid piling on error messages
2262         if a constant initializer resolution fails.
2263
2264 2005-10-25  Raja R Harinath  <rharinath@novell.com>
2265
2266         * namespace.cs (RootNamespace.VerifyUsingForAll, Namespace.VerifyUsing):
2267         Remove.
2268         (NamespaceEntry.VerifyAllUsing): New.
2269         (NamespaceEntry.AliasEntry.Resolve): New.  Handles common error
2270         behaviour.  Delegates actual resolution of alias to ...
2271         (NamespaceEntry.DoResolve): ... this.  Renamed from Resolve.
2272         (NamespaceEntry.LocalAliasEntry, NamespaceEntry.ExternAliasEntry):
2273         Update.
2274         * driver.cs (Driver.MainDriver): Update.
2275         
2276         * namespace.cs (NamespaceEntry.DefineNamespace): Remove.
2277         (NamespaceEntry.SymbolFileID): Make into a on-demand computed
2278         property.
2279         (Namespace.DefineNamespaces, RootNamespace.DefineNamespacesForAll):
2280         Remove.
2281         * symbolwriter.cs (SymbolWriter.Initialize): Don't call
2282         RootNamespace.DefineNamespacesForAll.
2283
2284 2005-10-24  Raja R Harinath  <harinath@gmail.com>
2285
2286         * typemanager.cs (assemblies, external_aliases, modules)
2287         (AddAssembly, AddExternAlias, AddModule GetAssemblies, Modules)
2288         (ComputeNamespaces, GetRootNamespace): Remove extra staging
2289         overhead.  Move resposibility ...
2290         * namespace.cs (GlobalRootNamespace): ... here.  Update to changes.
2291         * driver.cs, attribute.cs, codegen.cs: Update to changes.
2292
2293 2005-10-23  Raja R Harinath  <harinath@gmail.com>
2294
2295         * namespace.cs (RootNamespace.all_namespaces): Renamed from
2296         cached_namespaces.  Improve usage.
2297         (RootNamespace.Reset, RootNamespace.RegisterNamespace)
2298         (RootNamespace.VerifyUsingForAll, RootNamespace.DefineNamespacesForAll):
2299         Move from GlobalRootNamespace and simplify.
2300         (RootNamespace.Global): Make instance variable.
2301         (RootNamespace.RootNamespace): Add "alias name" parameter.
2302         (GlobalRootNamespace): Simplify drastically.
2303         (Namespace.Lookup): Don't use GetNamespace.
2304         * typemanager.cs (GetRootNamespace): Rename from
2305         ComputeNamespaceForAlias.
2306         (NamespaceClash): Use Global.IsNamespace instead of GetNamespace.
2307
2308 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2309
2310         * anonymous.cs (AnonymousContainer): Don't crash when container
2311         doesn't exist.
2312
2313 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2314
2315         * expression.cs (Binary.DoResolve): Warn when comparing same
2316         values.
2317
2318 2005-10-23  Marek Safar  <marek.safar@seznam.cz>
2319
2320         Fix #76486.
2321         * expression.cs (Binary.DoResolve): It looks like there are no
2322         convetsion rules in enum context.
2323
2324 2005-10-19  Carlos Alberto Cortez <calberto.cortez@gmail.com>
2325
2326         Add support for extern alias qualifiers.
2327         * typemanager.cs: Move some LookupTypeReflection code
2328         to namespace.cs, to have cleaner code. Added some methods
2329         to help us keep track of the extern aliased references.
2330         * driver.cs: Add suport for extern alias assemblies on command
2331         line and check for their warnings/errors. Also keep track of the
2332         extern aliased assemblies.
2333         * namespace.cs: Move the global functionality of Namespace
2334         to GlobalRootNamespace/RootNamespace. Now the global namespace
2335         is GlobalRootNamespace.Globa. Also the code moved from 
2336         typemanager.cs lives in GlobalRootNames.cs/RootNamespace.cs. 
2337         Finally added LocalAliasEntry (AliasEntry before) and
2338         ExternAliasEntry, to handle alias statements.
2339         * cs-parser.jay: Add support in the grammar for extern alias
2340         statement.
2341         * doc.cs, delegate.cs, expression.cs ecore.cs, symbolwriter.cs: 
2342         Update callings to Namespace (now in GlobalRootNamespace).
2343
2344 2005-10-18  Raja R Harinath  <rharinath@novell.com>
2345
2346         Fix #76371.
2347         * class.cs (TypeContainer.DefineType): Move updating of
2348         topological sort earlier in the code.
2349         * decl.cs (DeclSpace.ResolveBaseTypeExpr): Don't use TypeBuilder.
2350
2351 2005-10-18  Marek Safar  <marek.safar@seznam.cz>
2352
2353         Fix #76273.
2354         * cfold.cs (BinaryFold): Reduce constant in enum conversion.
2355         
2356         * constant.cs (Constant.TryReduce): Moved from Cast class.
2357         (Reduce): Made little bit more OO and fixed missing conversions.
2358         
2359         * ecore.cs (Reduce): Implemented.
2360         (Binary.EnumLiftUp): New method to upgrade values to enum values.
2361         
2362         * literal.cs (Reduce): Implemented.
2363         
2364         * class.cs: Reverted Miguel's wrong commit.
2365
2366 2005-10-14  Miguel de Icaza  <miguel@novell.com>
2367
2368         * ecore.cs (GetMemberType): Report the correct mapping for the MemberCore
2369
2370 2005-10-14  Atsushi Enomoto  <atsushi@ximian.com>
2371
2372         * cs-parser.jay, expression.cs : CS0214 was missing error location
2373           for constants. Fixed bug #76404.
2374
2375 2005-10-11  Marek Safar  <marek.safar@seznam.cz>
2376
2377         Fix #76370.
2378         * convert.cs (ExplicitConversionCore): Fixed object->enum
2379         conversion.
2380
2381 2005-10-10  Raja R Harinath  <rharinath@novell.com>
2382
2383         * ecore.cs (PropertyExpr.Emit): Use Invocation.EmitCall to emit
2384         InstanceExpression.
2385         (PropertyExpr.EmitCall): Likewise.
2386         * expression.cs (Invocation.EmitArguments): Handle case where
2387         arguments == null.
2388         (Invocation.EmitCall): Avoid allocating temporary variable if
2389         there are no arguments.
2390
2391 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2392
2393         Fix #76323.
2394         * convert.cs (ImplicitConversionStandard): Move conversion of
2395         void* to arbitrary pointer types ...
2396         (ExplicitConversionStandard): .. here.
2397         * ecore.cs (Expression.Error_ValueCannotBeConverted): Fix CS0266
2398         error to always print typenames.
2399
2400 2005-10-07  Raja R Harinath  <rharinath@novell.com>
2401
2402         * convert.cs (GetConversionOperator): Rename from
2403         GetConversionOperators.  Move operator selection code from ...
2404         (UserDefinedConversion): ... here.
2405
2406 2005-10-06  Marek Safar  <marek.safar@seznam.cz>
2407
2408         * convert.cs (ExplicitConversionCore): Removed duplicate enum
2409         conversion.
2410
2411 2005-10-05  Marek Safar  <marek.safar@seznam.cz>
2412
2413         * assign.cs (Assign.DoResolve): Error method changed.
2414
2415         * cfold.cs (DoConstantNumericPromotions): Error method changed.
2416         
2417         * const.cs (ResolveValue): Reset in_transit immediately.
2418         
2419         * constant.cs: Error method changed.
2420         
2421         * convert.cs: Removed useless location parameter.
2422         (ExplicitNumericConversion): Don't do double enum check.
2423         (ExplicitConversionCore): Renamed from ExplicitConversion.
2424         (ExplicitUnsafe): Extracted from ExplicitConversion.
2425         (ExplicitConversion): Uses for error reporting.
2426         
2427         * ecore.cs (Error_ValueCannotBeConverted): More logic for more
2428         error messages.
2429         (ResolveBoolean): Uses common error method.
2430         (CastToDecimal): Get rid of ec.
2431         (CastFromDecimal): Optimized.
2432         (ConvCast): Get rid of ec.
2433         
2434         * enum.cs (ResolveValue): Reset in_transit immediately.
2435         (Emit): Return after first error.
2436         
2437         * expression.cs: Convert changes.
2438         
2439         * literal.cs: Error method changed.
2440         
2441         * statement.cs: Error method changed.
2442
2443 2005-10-03  Raja R Harinath  <rharinath@novell.com>
2444
2445         * support.cs (SeekableStreamReader.Position): Don't error out when
2446         the requested position is just beyond the end of the current
2447         buffered data.
2448
2449 2005-09-28  Raja R Harinath  <rharinath@novell.com>
2450
2451         * support.cs (SeekableStreamReader): Simplify drastically.  Don't
2452         try to keep in sync with the byte count of the underlying Stream.
2453         However, this limits us to a window size of 2048 characters: i.e.,
2454         the maximum lookahead of our lexer/parser can be 2048 characters.
2455
2456 2005-09-28  Marek Safar  <marek.safar@seznam.cz>
2457
2458         Fix #76255.
2459         * driver.cs: Fix compilation files with full root path.
2460
2461 2005-09-25  Miguel de Icaza  <miguel@novell.com>
2462
2463         * report.cs (SymbolRelatedToPreviousError): Format the output so
2464         it does not use an open parenthesis that is never closed. 
2465
2466         * driver.cs: Follow coding guidelines
2467
2468 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2469
2470         Fix #72930.
2471         * const.cs (Const.ResolveValue): Check for assigning non-null
2472         value to reference type.
2473
2474 2005-09-27  Marek Safar  <marek.safar@seznam.cz>
2475
2476         * anonymous.cs: Implemented ExprClassName.
2477         
2478         * assign.cs (Assign.DoResolve): Don't chrash when type is not
2479         delegate.
2480         
2481         * attribute.cs (ResolveArguments): Enabled MethodImplOptions
2482         check.
2483         
2484         * class.cs (StaticClass.DefineContainerMembers): Report protected
2485         members as error.
2486         
2487         * codegen.cs: if(ed) PRODUCTION.
2488         
2489         * convert.cs (Error_CannotImplicitConversion): Better error
2490         distinction.
2491         
2492         * cs-parser.jay: More error checks.
2493         
2494         * cs-tokenizer.cs (consume_identifier): Fixed Miguel's revert.
2495         
2496         * driver.cs (CSCParseOption): Enabled wrong option check.
2497         
2498         * ecore.cs (Expression.ExprClassName): Turned to property.
2499         (MemberExpr.CheckIntermediateModification): For checking boxed
2500         value types     modification.
2501         
2502         * statement.cs (Fixed.Resolve): Expression type must be
2503         convertible to fixed type.
2504         (CollectionForeach.GetEnumeratorFilter,TryType):
2505         Small refactoring for easier error checking.
2506
2507 2005-09-26  Marek Safar  <marek.safar@seznam.cz>
2508
2509         * attribute.cs (Attribute.Resolve): Check Obsolete attribute for
2510         attributes.
2511         
2512         * class.cs (GeneratedBaseInitializer): New class for customization
2513         compiler generated initializers.
2514         (MemberBase.DoDefine): Check Obsolete attribute here.
2515         (FieldMember.DoDefine): Ditto.
2516         
2517         * const.cs (ExternalConstant.CreateDecimal): Builder for decimal
2518         constants.
2519         
2520         * decl.cs (MemberCore.EmitContext): Returns valid current ec.
2521         (MemberCore.GetObsoleteAttribute): Removed argument.
2522         (MemberCore.CheckObsoleteness): Obsolete attributes are hierarchic.
2523         (MemberCore.CheckObsoleteType): New helper.
2524         
2525         * delegate.cs,
2526         * enum.cs,
2527         * statement.cs: Updates after MemberCore changes.
2528         
2529         * ecore.cs (TypeExpr.ResolveType): Check type obsoleteness here.
2530         (FieldExpr.ResolveMemberAccess): Fixed decimal constants checks.
2531         
2532         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't check
2533         obsolete attribute for compiler construct.
2534         (As.DoResolve): Cache result.
2535         
2536         * iterators.cs (Define_Constructor): Use GeneratedBaseInitializer.
2537
2538 2005-09-26  Raja R Harinath  <rharinath@novell.com>
2539
2540         Fix #76133.
2541         * expression.cs (This.VerifyFixed): In a value type T, the type of
2542         'this' is T&, iow, 'this' is either an out or ref parameter.  In a
2543         value type R, 'this' is treated as a value parameter.
2544
2545 2005-09-22  Miguel de Icaza  <miguel@novell.com>
2546
2547         * statement.cs (Lock): Use the TemporaryVariable class instead of
2548         manually using local variables as those do not work when variables
2549         are captured.
2550
2551         * ecore.cs: Moved the TemporaryVariable class from being a nested
2552         class inside Foreach to be a public class that can be employed in
2553         other places. 
2554
2555 2005-09-19  Marek Safar  <marek.safar@seznam.cz>
2556
2557         * cs-parser.jay: interface_accessors replaced by
2558         accessor_declarations.
2559
2560         * ecore.cs, literal.cs, statement.cs: NullLiteral holds null
2561         location.
2562         
2563         * statement.cs (GotoCase.Resolve): Convert null constant to
2564         null case.
2565         (SwitchLabel.ResolveAndReduce): Ditto.
2566         (SwitchLabel.NullStringCase): Custom null stamp.
2567         (Switch.SimpleSwitchEmit): Fix from NullLiteral to NullStringCase.
2568         
2569         typemanager.cs (CSharpSignature): Don't skip first argument
2570         for full names.
2571
2572 2005-09-18  Miguel de Icaza  <miguel@novell.com>
2573
2574         * driver.cs: Set InEmacs based on the environment variable EMACS. 
2575
2576         * location.cs (InEmacs): in this mode, do not report column
2577         location as it confuses Emacs.
2578
2579 2005-09-16  Marek Safar  <marek.safar@seznam.cz>
2580
2581         * cfold.cs, constant.cs, convert.cs, ecore.cs,
2582         expression.cs, iterators.cs, literal.cs: Store constants and
2583         literals location.
2584         
2585         * class.cs (MemberBase.ShortName): Pass location.
2586         
2587         * cs-parser.jay: Some location fixes.
2588         
2589         * ecore.cs (Expression.Location): Made virtual.
2590
2591 2005-09-05  Miguel de Icaza  <miguel@novell.com>
2592
2593         * expression.cs (Cast.TryReduce): Only reduce to an EnumConstant
2594         if the underlying types are the same, otherwise we need to produce
2595         code that will do the proper cast.
2596
2597         This was exposed by Marek's constant rewrite which produced
2598         invalid code for the call site:
2599
2600         enum X : long { a }
2601         void Method (X v) {}
2602
2603         Method ((X) 5)
2604
2605         This fixes test-49.cs
2606
2607 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2608
2609         * attribute.cs : (Attribute.IsValidArgumentType): array of string/
2610           Type/Object should be allowed as well. Fixed bug #75968.
2611
2612 2005-09-05  Atsushi Enomoto  <atsushi@ximian.com>
2613
2614         * expression.cs : (Binary.DoResolve): when one is enum constant and
2615           another is constant 0, then return enum one *as enum type*.
2616           Fixed bug 74846.
2617
2618 2005-09-02  Raja R Harinath  <rharinath@novell.com>
2619
2620         * attribute.cs (GetMarshal): Work even if "DefineCustom" is
2621         internal.
2622
2623         Fix #75941.
2624         * ecore.cs (SimpleNameResolve.DoSimpleNameResolve): Disable
2625         flow-branching for LocalVariableReferences in case we were invoked
2626         from a MemberAccess.
2627         * expression.cs (LocalVariableReference.VerifyAssigned): New.
2628         Carved out of ...
2629         (LocalVariableReference.DoResolveBase): ... this.
2630         (MemberAccess.Resolve): Do the check that was disabled during
2631         SimpleNameResolve.
2632
2633 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2634
2635         * class.cs :
2636           (PartialContainer.Create): check abstract/sealed/static strictly
2637           but abstract/sealed can exist only at one side. Fixed bug #75883.
2638
2639 2005-09-01  Kornél Pál  <kornelpal@hotmail.com>
2640
2641         Fix #75945.
2642         * attribute.cs (Attribute.GetMarshal): If ArraySubType is not
2643         specified, don't default to UnmanagedType.I4.
2644
2645 2005-09-01  Atsushi Enomoto  <atsushi@ximian.com>
2646
2647         * expression.cs : conditional operator should check possibly
2648           incorrect assign expression. Fixed bug #75946.
2649
2650 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2651
2652         * cs-tokenizer.cs, cs-parser.jay, driver.cs, support.cs :
2653           Reverting the change. gmcs is much complex than mcs on this matter.
2654
2655 2005-08-31  Atsushi Enomoto  <atsushi@ximian.com>
2656
2657         * cs-tokenizer.cs : To read another token ahead of the actual 
2658           consumption, use new SavedToken and cache token instead of moving
2659           back the stream with SeekableStreamReader (it seemed problematic).
2660         * cs-parser.jay,
2661           driver.cs : Thus use StreamReader directly.
2662         * support.cs : Thus removed SeekableStreamReader.
2663
2664 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2665
2666         Fix #75934.
2667         * anonymous.cs (ScopeInfo.MakeFieldName): New helper.
2668         (ScopeInfo.EmitScopeType): Use it to construct field names from
2669         names of captured locals.
2670
2671         Fix #75929.
2672         * ecore.cs (BoxedCast.BoxedCast) [1-argument variant]: Remove.
2673         * convert.cs (ImplicitReferenceConversion, TryImplicitIntConversion):
2674         Pass 'target_type' to BoxedCast.  Don't default to 'object'.
2675         (ExplicitConversion): Remove enum cases already handled by
2676         implicit conversion.  Move implicit conversion check to the beginning.
2677         * delegate.cs (DelegateCreation.ResolveMethodGroupExpr): Update.
2678         * expression.cs (ArrayCreation.EmitDynamicInitializers):
2679         Don't treat System.Enum as a struct.
2680
2681 2005-08-30  Jb Evain  <jbevain@gmail.com>
2682
2683         * attribute.cs: handles as expression in parameters.
2684
2685 2005-08-30  Raja R Harinath  <rharinath@novell.com>
2686
2687         Fix #75802.
2688         * class.cs (TypeContainer.VerifyClsName): Don't use a
2689         PartialContainer when verifying CLS compliance.
2690         (AbstractPropertyEventMethod): Set Parent here, ...
2691         (PropertyMethod): ... not here.
2692
2693 2005-08-30  Atsushi Enomoto  <atsushi@ximian.com>
2694
2695         * attribute.cs : escaped attribute name should not be allowed to be
2696           resolved (e.g. @class as classAttribute). Fixed bug #75930.
2697
2698 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2699
2700         Fix #75927.
2701         * convert.cs (ImplicitStandardConversionExists): Allow zero also
2702         when converting a long constant to unsigned long.
2703         * expression.cs (Invocation.OverloadResolve): Add sanity check to
2704         detect where IsApplicable and VerifyArgumentsCompat disagree.
2705
2706 2005-08-29  Raja R Harinath  <rharinath@novell.com>
2707         and Carlos Alberto Cortez  <carlos@unixmexico.org>
2708
2709         Fix #75848.
2710         * class.cs (TypeContainer.CanElideInitializer): New helper.
2711         (TypeContainer.EmitFieldInitializers): Use it to determine if we
2712         can safely emitting the initializer of a field.
2713
2714 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2715
2716         * statement.cs : (Continue.Resolve()) Unlike break, continue is not
2717           allowed inside a switch (without loop). Fixed bug #75433.
2718
2719 2005-08-26  Kornél Pál  <kornelpal@hotmail.com>
2720
2721         * AssemblyInfo.cs: Using Consts.MonoVersion instead of MonoVersion.cs.
2722         * mcs.exe.sources: Using Consts.MonoVersion instead of MonoVersion.cs.
2723
2724 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2725
2726         * driver.cs : kinda reverting the default encoding changes (not exact 
2727           revert since I noticed that "codepage:reset" might not work fine).
2728
2729 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2730
2731         * class.cs : (AbstractPropertyEventMethod) SetupName() now takes
2732           Location. Now getter and setter store location correctly.
2733           (errors/cs0111-12.cs now reports the expected location.)
2734
2735 2005-08-25  Atsushi Enomoto  <atsushi@ximian.com>
2736
2737         * driver.cs : Use default encoding on the environment.
2738           Removed (now that) extra parameter for SeekableStreamReader.
2739         * support.cs : (SeekableStreamReader) third .ctor() argument for
2740           StreamReader is not required (always true). preamble size could
2741           be acquired in simpler and safe way.
2742
2743 2005-08-24  Atsushi Enomoto  <atsushi@ximian.com>
2744
2745         * cs-parser.jay: report CS0642 at warning level 3
2746           and report CS0642 for an if else statement also
2747           fixes bug #74745. Patch by John Luke (and a bit
2748           modified by me).
2749           Removed extra CS0642 warning check for "while",
2750           "for" and "fixed".
2751         * statement.cs: In Block.Resolve(), CS0642 check
2752           is reimplemented to check a sequence of an empty
2753           statement and a block.
2754
2755           Both fix bug #66777.
2756
2757 2005-08-24  Marek Safar  <marek.safar@seznam.cz>
2758
2759         * attribute.cs (GetMethodObsoleteAttribute): Disabled obsolete properties
2760         detection until I fix it.
2761         
2762         * cs-tokenizer.cs: Changed error message.
2763         
2764         * cs-parser.jay: Fixed 2 error locations.
2765         
2766         * ecore.cs (Error_TypeDoesNotContainDefinition): Share error message.
2767         (PropertyExpr.Error_PropertyNotFound): First attempt to detect non C#
2768         properties.
2769         
2770         * enum.cs (GetSignatureForError): Fixed.
2771         
2772         * expression.cs (Invocation.IsSpecialMethodInvocation): Improved special
2773         method detection.
2774         
2775         * class.cs,
2776         * typemanager.cs (RegisterProperty): Removed.
2777         
2778         * statement.cs (CheckInvariantMeaningInBlock): Changed error message.
2779
2780 2005-08-24  Raja R Harinath  <rharinath@novell.com>
2781
2782         Fix #75874.
2783         * expression.cs (ArrayAccess.EmitLoadOpcode): Emit ldelem.i for pointers.
2784         (ArrayAccess.GetStoreOpcode): Return stelem.i for pointers.
2785
2786 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2787
2788         * expression.cs : tiny fix is required for not warning positive ulong.
2789           See test-441.cs.
2790
2791 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2792
2793         * expression.cs : add CS0652 check for constant and integral
2794           expression. Fixed bug #53974.
2795
2796 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2797
2798         * expression.cs : in DoNumericPromotions(), check if there is implicit
2799           conversion overload for string (to check CS0034). Fixed bug #52492.
2800
2801 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2802
2803         * cs-tokenizer.cs : Check newline in char constant. Fixed bug #75245.
2804
2805 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2806
2807         * ecore.cs : report location when it is *not* Null.
2808
2809 2005-08-23  Atsushi Enomoto  <atsushi@ximian.com>
2810
2811         * codegen.cs,
2812           ecore.cs,
2813           flowanalysis.cs,
2814           expression.cs:
2815           Added OmitStructFlowAnalysis to EmitContext to handle CS0165 check
2816           correctly. Fixed bug #75721.
2817
2818 2005-08-23  Raja R Harinath  <rharinath@novell.com>
2819
2820         * support.cs (SeekableStreamReader.Position): Avoid an expensive
2821         loop that performs 'min (pos, char_count)'.
2822
2823         Fix #75862.
2824         * expression.cs (Unary.ResolveOperator): Don't discard implicit
2825         converted value in Operator.OnesComplement.
2826
2827 2005-08-22  Ben Maurer  <bmaurer@ximian.com>
2828
2829         * anonymous.cs: If the anon method is pulled into a helper class,
2830         it needs to be `internal' not `private'. Fixes runtime behavior on
2831         msft. bug #75704
2832
2833 2005-08-20  Martin Baulig  <martin@ximian.com>
2834
2835         * anonymous.cs (CaptureContext.CaptureThis): Create the topmost
2836         scope if we don't already have it.
2837
2838         * expression.cs (Invocation.EmitCall): Use `ec.EmitThis ()' rather
2839         than `ig.Emit (OpCodes.Ldarg_0)' to make it work inside iterators;
2840         fixes #75867.
2841
2842 2005-08-17  Marek Safar  <marek.safar@seznam.cz>
2843
2844         Fix #75803
2845         * decl.cs (DeclSpace.VerifyClsCompliance): Skip when collision object
2846         is a partial class.
2847
2848 2005-08-16  Marek Safar  <marek.safar@seznam.cz>
2849
2850         The big constants rewrite
2851         Fix #75746, #75685 and more
2852         As a side effect saved 1MB for MWF ;-)
2853         
2854         * attribute.cs (GetAttributeArgumentExpression): Use ToType, GetTypedValue.
2855         (GetMarshal, GetMethodImplOptions, GetLayoutKindValue): Values are not
2856         enum based for corlib compilation.
2857         
2858         * cfold.cs (BinaryFold): Convert operand for enum additions. Fixed enum
2859         subtractions.
2860         
2861         * class.cs (FixedField.Define): Use ResolveAsConstant.
2862         
2863         * const.cs (IConstant): Interface constants and enums.
2864         (Const.ResolveValue): New method for constant resolvning.
2865         (ExternalConstant): Constants from imported assemblies.
2866         
2867         * constant.cs (Constant.GetTypedValue): Used to get constant with forced
2868         conversion; like enums.
2869         (Constant.ToType): Converts this constant to different type.
2870         (Constant.Increment): Adds 1.
2871         
2872         * convert.cs (ImplicitConversionRequired): Simplified.
2873         
2874         * cs-parser.jay: Create EnumMember directly.
2875         
2876         * decl.cs (MemberCore.CheckObsoleteness): Checks for ObsoleteAttribute presence.
2877         
2878         * doc.cs (GenerateEnumDocComment): Removed.
2879         
2880         * ecore.cs (Expression.ResolveAsConstant): New constant specific method.
2881         (ConvertIntLiteral): Removed.
2882         (FieldExpr.ResolveMemberAccess): Refactored to remove constant specific if(s).
2883         
2884         * enum.cs (EnumMember): Implement IConstant.
2885         (Enum.IsValidEnumConstant): Removed.
2886         (Enum.GetNextDefaultValue): Removed.
2887         (Enum.FindMembers): Updated.
2888         (Enum.GenerateDocComment): Iterate enum members.
2889         
2890         * expression.cs (Cast.TryReduce): Handle enums correctly.
2891         (New.Constantify): Made public.
2892         (MemberAccess.DoResolve): Removed contant specific if(s).
2893         
2894         * literal.cs (NullLiteral): Implement new abstract methods.
2895         
2896         * statement.cs (GotoCase.Resolve): Use new constant methods.
2897         (SwitchLabel.ResolveAndReduce): Use new constant methods.
2898         
2899         * typemanager.cs (LookupEnum): Removed.
2900         (IsEnumType): Fixed to work with corlib.
2901         (RegisterConstant): Removed.
2902         (LookupConstant): Removed.
2903         (GetConstant): Changed to work with IConstant.
2904
2905 2005-08-04  Atsushi Enomoto  <atsushi@ximian.com>
2906
2907         * location.cs : Fixed overflown (>255) column number.
2908
2909 2005-08-03  Raja R Harinath  <rharinath@novell.com>
2910
2911         First cut of the qualified-alias-member feature.
2912         * cs-tokenizer.cs (Tokenizer.is_punct): Recognize the double-colon
2913         token.
2914         * cs-parser.jay (DOUBLE_COLON): New token.
2915         (namespace_or_type_name): Add rule for recognizing
2916         qualified-alias-members.
2917         (primary_expression): Likewise.
2918         (element_access): Allow QualifiedAliasMember as a possible
2919         type-bearing expression.
2920         (local_variable_type, local_variable_pointer_type): Likewise.
2921         * namespace.cs (NamespaceEntry.LookupAlias): New.  Looks up
2922         aliases in the current and enclosing namespace declarations.
2923         (NamespaceEntry.UsingAlias): Add CS0440 warning.
2924         * decl.cs (MemberName.is_double_colon): New.
2925         (MemberName.MemberName): Add new constructor for alias-member.
2926         (MemberName.GetTypeExpression): Generate QualifiedAliasMember too.
2927         * expression.cs (QualifiedAliasMember): New expression type.
2928
2929 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2930
2931         * location.cs : it borked when no argument was specified.
2932
2933 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2934
2935         * location.cs : tiny ToString() format fix.
2936
2937 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2938
2939         * statement.cs : oops, it was missing.
2940
2941 2005-08-02  Atsushi Enomoto  <atsushi@ximian.com>
2942
2943         A set of fixes for precise line/column location.
2944
2945         * location.cs :
2946           "token" field now holds a file/line "delta", a line number offset 
2947           from the segment, and a column number. See also:
2948           http://lists.ximian.com/pipermail/mono-devel-list/2004-
2949           December/009508.html
2950           Removed static IsNull. Use instance IsNull property instead.
2951         * cs-tokenizer.cs :
2952           For some tokens it stores Location. For Identifier it stores
2953           LocatedToken which is a pair of string name and location.
2954           Column numbers are adjusted only at getChar().
2955         * report.cs :
2956           Use Location.ToString() for reporting (it now contains column).
2957         * cs-parser.jay :
2958           Largely modified to use LocatedToken instead of
2959           string (IDENTIFIER), and to acquire Location from some tokens.
2960         * namespace.cs, decl.cs, ecore.cs, class.cs, delegate.cs,
2961           iterators.cs, const.cs, anonymous.cs, tree.cs, enum.cs,
2962           codegen.cs :
2963           Now MemberName holds Location. DeclSpace.ctor() receives Location
2964           as a parameter. Removed extra parameters to all derived classes.
2965           Replaced Location.IsNull() with instance property.
2966         * assign.cs, expression.cs :
2967           Added .ctor() overload that omits Location.
2968         * attribute.cs :
2969           Added "nameEscaped" flag that indicates the identifier was escaped
2970           in the source file. This fixes bug #57047.
2971
2972 2005-08-02  Marek Safar  <marek.safar@seznam.cz>
2973
2974         * attribute.cs (AttributeTester.GetImportedIgnoreCaseClsType):
2975         New method, looking for lo-case imported cls type.
2976
2977         * decl.cs (DeclSpace.VerifyClsCompliance): Check CS3005 for types
2978         here.
2979
2980         * driver.cs: Removed VerifyTopLevelNameClsCompliance usage.
2981
2982         * enum (Enum.VerifyClsCompliance): Hardcode non-compliant types.
2983
2984         * typemanager.cs (TypeManager.AllClsTopLevelTypes): Renamed from
2985         all_imported_types.
2986         (TypeManager.LoadAllImportedTypes): Lo-case imported types.
2987
2988         Optimized to save 3.5 MB for SWF compilation.
2989
2990 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
2991
2992         * class.cs (AddToTypeContainer): Use inheritance insted of if(s).
2993         (PartialContainer.Create): Moved logic AddToContainer.
2994         (PartialContainer.MarkForDuplicationCheck): Shares name.
2995         
2996         * decl.cs (DeclSpace.AddToContainer): Check name collisions at one
2997         place.
2998         
2999         * namespace.cs (Namespace.AddDeclSpace): Lazy declspaces
3000         initialization.
3001         (Namespace.GetSignatureForError): New method.
3002         
3003         * tree.cs (Tree.RecordDecl): Moved to AddToContainer.
3004         (RootTypes.AddToTypeContainer): se inheritance insted of if(s).
3005
3006 2005-08-01  Raja R Harinath  <rharinath@novell.com>
3007
3008         Fix #75669.
3009         * ecore.cs (Expression.MemberLookupFailed): Use queried_type for
3010         member lookup rather than qualifier_type, since qualifier_type can
3011         be null.
3012
3013 2005-08-01  Marek Safar  <marek.safar@seznam.cz>
3014
3015         * enum.cs (Enum.VerifyClsName): Fixed to allow not CLSCompliant
3016         enum member.
3017
3018 2005-07-31  Miguel de Icaza  <miguel@novell.com>
3019
3020         * statement.cs: Copy the local exception into the exception
3021         captured local.  Fixes 75674
3022
3023 2005-07-31  Raja R Harinath  <harinath@gmail.com>
3024
3025         Fix #75658.
3026         * expression.cs (Invocation.OverloadResolve): Don't report error
3027         CS1501 if error CS1502 has been reported.
3028         (New.DoResolve): Delegate CS1501 reporting to
3029         Invocation.OverloadResolve.
3030
3031         Fix #75656.
3032         * statement.cs (Block.CheckInvariantMeaningInBlock): Verify
3033         invariant-meaning-in-block property in an enclosing block if
3034         necessary.
3035
3036 2005-07-29  Marek Safar  <marek.safar@seznam.cz>
3037
3038         * statement.cs (SwitchLabel.ResolveAndReduce): Refactored.
3039         (SwitchLabel.Erorr_AlreadyOccurs): Share error message.
3040         (Switch.CheckSwitch): Just save 50kb for SWF.
3041
3042 2005-07-27  Martin Baulig  <martin@ximian.com>
3043
3044         * anonymous.cs (CaptureContext.AddField): Added
3045         `AnonymousContainer am' argument; compute its toplevel scope if
3046         it's not already computed.  Fixes #75649.
3047
3048 2005-07-26  Raja R Harinath  <rharinath@novell.com>
3049
3050         Fix #75628.
3051         * class.cs (Constructor.Emit): Reset block to null if the block
3052         resolve fails.
3053
3054 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3055
3056         * class.cs (TypeContainer.VerifyMembers): Be compatible in warning 169.
3057
3058 2005-07-25  Marek Safar  <marek.safar@seznam.cz>
3059
3060         * class.cs (MethodData.Define): Check whether accessor implementing
3061         interface is public.
3062
3063         * driver.cs (Driver.parse): Try to be smart and check for `MZ' header.
3064
3065 2005-07-22  Marek Safar  <marek.safar@seznam.cz>
3066
3067         Fix #57245
3068         * namespace.cs (LookupType): Moved same type check to...
3069         
3070         * typemanager.cs (LookupTypeReflection): Don't allow to import more types
3071         with the same name.
3072
3073 2005-07-21  Raja R Harinath  <rharinath@novell.com>
3074
3075         * namespace.cs (NamespaceLookupType): Avoid a string allocation when we
3076         already found a typebuilder.
3077         * class.cs (MethodCore.IsDuplicateImplementation): Compare
3078         MemberNames, not strings.
3079
3080         * const.cs (Error_ExpressionMustBeConst): 
3081         Rename from Error_EpressionMustBeConst.
3082         * const.cs, class.cs, statement.cd: Update.
3083
3084 2005-07-21  Marek Safar  <marek.safar@seznam.cz>
3085
3086         Fix #65573
3087
3088         * const.cs (Const.LookupConstantValue): Report missing contant expression
3089         everytime.
3090         (Error_EpressionMustBeConstant): Only one error method.
3091
3092         * class.cs, statement.c: Updated.
3093
3094 2005-07-20  Raja R Harinath  <rharinath@novell.com>
3095
3096         * statement.cs (Block.Flags): Add back HasVarargs.
3097         (Block.flags): Make protected.
3098         (ToplevelBlock.HasVarargs): Convert to a property that updates flags.
3099
3100         * typemanager.cs (types, typecontainers, user_types): Remove.
3101         (UserTypes, TypeContainers): Likewise.
3102         (HandleDuplicate, AddDelegateType, AddEnumType): Likewise.
3103         (CleanUp, Reset): Update.
3104         (AddUserType): Combine variants.  Now, only updates builder_to_declspace.
3105         (GetNestedType): Use Type.GetNestedType.
3106         (CoreLookupType): Take two arguments, the namespace and the
3107         basename of the type.  Update to use the Namespace.Lookup
3108         mechanism.
3109         (InitEnumUnderlyingTypes, InitCoreTypes): Update.
3110         (RealMemberLookup): Use IsNestedChildOf instead of playing with
3111         string concatenation and substring matches.
3112         * class.cs, enum.cs, delegate.cs: Update to changes.
3113
3114 2005-07-20  Marek Safar  <marek.safar@seznam.cz>
3115
3116         * constant.cs (Constant.Error_ConstantValueCannotBeConverted): Moved from
3117         Expression and made virtual.
3118
3119         * convert.cs (ImplicitReferenceConversionExists): Skip for value types.
3120         (ImplicitStandardConversionExists): Fixed `byte' typo ?
3121
3122         * ecore.cs (Expression.Error_ConstantValueCannotBeConverted): Moved.
3123
3124         * literal.cs (NullLiteral.Error_ConstantValueCannotBeConverted): Customize
3125         error message.
3126
3127         * convert.cs, ecore.cs, enum.cs: Reflect Error_ConstantValueCannotBeConverted
3128         change.
3129
3130 2005-07-18  Marek Safar  <marek.safar@seznam.cz>
3131
3132         Fix #57707
3133         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Check whether
3134         AssemblyCultureAttribute is not used on executable.
3135
3136         * rootcontext.cs,
3137         * typemanager.cs: Add System.Reflection.AssemblyCultureAttribute.
3138
3139 2005-07-16  Raja R Harinath  <rharinath@novell.com>
3140
3141         Fix #60638.
3142         * expression.cs (Binary.Warning_UnintendeReferenceComparison):
3143         New.  Reports CS0252/CS0253.
3144         Mostly taken from preliminary patch by Duncak Mak.
3145         (Binary.DoResolveOperator): Store results of operator lookup.
3146         Use them to detect if we need to warn about unintended reference
3147         comparisons.
3148
3149 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3150
3151         Fix #72969.
3152         * namespace.cs (Namespace.Lookup): Add back location parameter.
3153         (Namespace.LookupType): Add CS0436 report.  Add location parameter.
3154         * delegate.cs, ecore.cs, expression.cs: Update to changes.
3155
3156         * codegen.cs (EmitContext.DeclSpace): Make readonly.
3157         * namespace.cs (Namespace.Lookup): Carve out type lookup into ...
3158         (Namespace.LookupType): ... this.
3159         (NamespaceEntry.GetUsingTable): Allocate only one zero-sized array
3160         of namespaces.
3161         * typemanager.cs (LookupTypeReflection): Remove buggy code that
3162         purported to handle pointers.
3163         (char_ptr_type, void_ptr_type): Use GetPointerType rather than
3164         CoreLookupType.
3165
3166 2005-07-15  Marek Safar  <marek.safar@seznam.cz>
3167
3168         * expression.cs (MemberAccess.ResolveNamespaceOrType): Don't report nested
3169         type as namespace.
3170
3171 2005-07-15  Raja R Harinath  <rharinath@novell.com>
3172
3173         * namespace.cs (Namespace.Lookup): Drop location parameter.
3174         (NamespaceEntry.LookupAlias): Remove.  Merge into ...
3175         (NamespaceEntry.Lookup): ... this.
3176         (NamespaceEntry.Error_AmbiguousTypeReference):
3177         Move here from DeclSpace.
3178         (NamespaceEntry.LookupNamespaceOrType): Move support for dotted
3179         names ...
3180         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): ... here.
3181         * decl.cs (DeclSpace.ErrorAmbiguousTypeReference):
3182         Move to NamespaceEntry.
3183         * delegate.cs, expression.cs: Update to changes.
3184
3185 2005-07-14  Marek Safar  <marek.safar@seznam.cz>
3186
3187         * attribute.cs (Attribute.ResolveAttributeType): Renamed from
3188         CheckAttributeType and refactored.
3189         (Attribute.ResolvePossibleAttributeType): Changed to reuse
3190         ResolveAsTypeTerminal error handling.
3191         (ResolveAsTypeTerminal): Introduced because of global attributes extra
3192         handling.
3193         (GetSignatureForError): Print errors in same way.
3194
3195         * class.cs,
3196         * codegen.cs: Reflect attribute GetSignatureForError change.
3197
3198         * ecore.cs,
3199         * expression.cs: Add silent parameter to ResolveAsTypeStep.
3200
3201         * namespace.cs (UsingEntry): Refactored to make fields private.
3202
3203         * assign.cs,
3204         statement.cs: Error_UnexpectedKind has extra parameter.
3205
3206 2005-07-14  Raja R Harinath  <rharinath@novell.com>
3207
3208         * ecore.cs (IAlias): Remove.
3209         * decl.cs (DeclSpace): Don't derive from IAlias.  Remove members
3210         that implement the interface.
3211         * namespace.cs (Namespace): Likewise.
3212         (Namespace.declspaces): Renamed from 'defined_names'.
3213         (Namespace.AddDeclSpace): Renamed from 'DefineName'.  Take a
3214         DeclSpace instead of an IAlias.
3215         * tree.cs (Tree.AddDecl): Update.
3216
3217 2005-07-12  Raja R Harinath  <rharinath@novell.com>
3218
3219         * statement.cs (Block.Flags); Remove HasVarargs.
3220         (Block.HasVarargs): Move to ToplevelBlock.
3221         (Block.ThisVariable, Block.AddThisVariable): Likewise.
3222         (Block.Variables): Make protected.  Initialize variable hashtable
3223         if necessary.
3224         (Block.AddVariable): Update.
3225         (Block.Resolve): Update to changes.
3226         (ToplevelBlock.HasVarargs): New boolean.
3227         (ToplevelBlock.ThisVariable): Move here from Block.
3228         (ToplevelBlock.AddThisVariable): Likewise.
3229         (ToplevelBlock.IsThisAssigned): New.  Forwards call to this_variable.
3230         * expression.cs (This.ResolveBase): Update to changes.
3231         (ArglistAccess.DoResolve): Likewise.
3232
3233 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3234
3235         Fix #75321
3236         * ecore.cs, class.cs: Use SetAssigned instead of direct access.
3237
3238         * class.cs (TypeContainer.VerifyMembers): Distinguish between
3239         not used and not used & assigned.
3240         (FieldBase.ASSIGNED): Moved to MemberCore.Flags.
3241
3242 2005-07-11  Marek Safar  <marek.safar@seznam.cz>
3243
3244         Fix #75053
3245         * expression.cs (Is.DoResolve): null is never provided type.
3246
3247 2005-07-08  Marek Safar  <marek.safar@seznam.cz>
3248
3249         Fix #52496
3250         * cs-parser.jay: Less strict event error rule to catch more errors.
3251
3252 2005-07-08  Martin Baulig  <martin@ximian.com>
3253
3254         Fix test-iter-10.cs - distinguish whether we `yield' in a property
3255         gettter (allowed) or setter (not allowed).
3256
3257         * class.cs (Accessor): Implement IIteratorContainer.
3258         (Accessor.Yields): New public field.
3259         (PropertyBase.PropertyMethod.Define): Handle iterators on a
3260         per-accessor basis.
3261
3262         * cs-parser.jay
3263         (get_accessor_declaration, set_accessor_declaration): Set the
3264         `yields' flag on the accessor, not the property.
3265         (property_declaration): Do the iterators check on a per-accessor
3266         basis and not for the whole property.
3267
3268 2005-07-08  Martin Baulig  <martin@ximian.com>
3269
3270         * anonymous.cs (CaptureContext.EmitParameterInstance): Correctly
3271         handle parameters in nested scopes; fixes #74808; see gtest-188.cs.
3272
3273 2005-07-07  Marek Safar  <marek.safar@seznam.cz>
3274
3275         Fix #74975
3276         * attribute.cs (orig_sec_assembly): Holds original version of assembly.
3277         (ExtractSecurityPermissionSet): Cope with self referencing security
3278         attributes properly.
3279
3280         * driver.cs (SetOutputFile): Made public property OutputFile.
3281
3282 2005-07-07  Raja R Harinath  <rharinath@novell.com>
3283
3284         Fix #75486.
3285         * class.cs (TypeContainer.first_nonstatic_field): Rename from
3286         has_nonstatic_fields.  Make into a FieldBase pointer.
3287         (TypeContainer.AddField): Add CS0282 check.
3288         (TypeContainer.EmitType): Update.
3289
3290 2005-07-06  Miguel de Icaza  <miguel@novell.com>
3291
3292         * cs-tokenizer.cs (consume_identifier): Do not create strings to
3293         compare if they start with __.
3294
3295 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3296
3297         * statement.cs (Switch.SwitchGoverningType): Only look at
3298         UserCasts that don't need implicit standard conversions to one of
3299         the allowed switch types (Fixes test-322.cs).
3300         (LocalInfo.Resolve): Re-enable sanity-test.
3301
3302 2005-07-06  Marek Safar  <marek.safar@seznam.cz>
3303
3304         * cs-tokenizer.cs (consume_identifier): Detect double undescores
3305         
3306         * ecore.cs (FieldExpr.AddressOf): Changed volatile error to warning.
3307         
3308         * expression.cs (Invocation.DoResolve): Report error CS0245 here.
3309
3310 2005-07-06  Raja R Harinath  <rharinath@novell.com>
3311
3312         Fix #75472.
3313         * ecore.cs (SimpleName.GetSignatureForError): Add.
3314         * expression.cs (MemberAccess.DoResolve): Don't clobber 'expr' field.
3315         (MemberAccess.GetSignatureForError): Add.
3316
3317 2005-07-05  Marek Safar  <marek.safar@seznam.cz>
3318  
3319         The big error and warning messages review.
3320         
3321         * anonymous.cs,
3322         * assign.cs,
3323         * attribute.cs,
3324         * class.cs,
3325         * codegen.cs,
3326         * convert.cs,
3327         * cs-parser.jay,
3328         * cs-tokenizer.cs,
3329         * decl.cs,
3330         * delegate.cs,
3331         * doc.cs,
3332         * driver.cs,
3333         * ecore.cs,
3334         * enum.cs,
3335         * expression.cs,
3336         * flowanalysis.cs,
3337         * iterators.cs,
3338         * literal.cs,
3339         * location.cs,
3340         * modifiers.cs,
3341         * namespace.cs,
3342         * parameter.cs,
3343         * pending.cs,
3344         * report.cs,
3345         * rootcontext.cs,
3346         * statement.cs,
3347         * support.cs,
3348         * tree.cs,
3349         * typemanager.cs: Updated.
3350         
3351         * class.cs: (MethodCore.SetYields): Moved here to share.
3352         (PropertyMethod.Define): Moved iterator setup here.
3353         
3354         * iterators.cs: Add orig_method to have full access to parent
3355         container.
3356
3357 2005-07-05  Raja R Harinath  <rharinath@novell.com>
3358
3359         Make 'fixed variable' handling standards compliant. Fix #70807, #72729.
3360         * ecore.cs (IVariable.VerifyFixed): Remove 'is_expression' parameter.
3361         (FieldExpr.VerifyFixed): Ensure that the field is part of a fixed
3362         variable of struct type.
3363         * expression.cs (Unary.ResolveOperator): Update to change.
3364         (Indirection.VerifyFixed): Likewise.
3365         (LocalVariableReference.VerifyFixed): A local variable is always fixed.
3366         (ParameterReference.VerifyFixed): Value parameters are fixed.
3367         (This.VerifyFixed): Treat 'this' as a value parameter.
3368         * statement.cs (LocalInfo.IsFixed): Remove.
3369
3370 2005-07-01  Martin Baulig  <martin@ximian.com>
3371
3372         * iterators.cs (Iterator.CapturedThisReference.Emit): Use
3373         `ec.EmitThis ()' to get the correct scope.
3374
3375 2005-07-01  Martin Baulig  <martin@ximian.com>
3376
3377         * ecore.cs (FieldExpr.DoResolve): Don't capture the field if it's
3378         instance is a ParameterReference; fixes #75299.
3379
3380 2005-07-01  Martin Baulig  <martin@ximian.com>
3381
3382         Reverted Marek's latest patch (r46725):
3383         - it contains structural changes which are neither mentioned in
3384           the ChangeLog nor explained anywhere; for example the additional
3385           argument of EmitContext's and Iterator's .ctor's and the
3386           TypeContainer.DefineMembers() change.
3387         - structural changes like this should go in in seperate patches
3388           and not be hidden in a huge patch which just seems to affect
3389           warnings and errors.
3390           a big and hard to understand patch.
3391         - it breaks iterators and causes regressions, for instance in
3392           test-iter-03.cs.      
3393
3394 2005-06-30  Raja R Harinath  <rharinath@novell.com>
3395
3396         Fix #75412.
3397         * expression.cs (Indexers.map): Remove.
3398         (Indexers.Append): Filter out inaccessible setters and getters.
3399         (IndexerAccess.DoResolve, IndexerAccess.DoResolveLValue): Update.
3400
3401         Fix #75283.
3402         * ecore.cs (MemberExpr.EmitInstance): New.  Add CS0120 check.
3403         Refactored from ...
3404         (FieldExpr.EmitInstance, PropertyExpr.EmitInstance): ... these.
3405         (FieldExpr.Emit, PropertyExpr.Emit): Update.
3406         (FieldExpr.EmitAssign, PropertyExpr.EmitAssign): Update.
3407         * expression.cs (Invocation.EmitCall): Add CS0120 check.
3408
3409 2005-06-30  Marek Safar  <marek.safar@seznam.cz>
3410
3411         Fix #75322
3412         * class.cs (FieldBase.GetInitializerExpression): One more field
3413         for backup.
3414
3415 2005-06-28  Miguel de Icaza  <miguel@novell.com>
3416
3417         * pending.cs: Do not define a proxy if the base method is virtual,
3418         it will be picked up by the runtime (bug 75270).
3419
3420 2005-06-08  Martin Baulig  <martin@ximian.com>
3421
3422         The big Iterators rewrite :-)
3423
3424         * iterators.cs: Rewrite this to use the anonymous methods framework.
3425
3426         * rootcontext.cs (RootContext.DefineTypes): Define Delegates
3427         before the TypeContainers; see 2test-21.cs.
3428
3429         * class.cs
3430         (TypeContainer.DefineType): Don't create a new EmitContext if we
3431         already have one (this only happens if we're an Iterator).
3432         (TypeContainer.Define): Also call Define() on all our iterators.
3433         (Method.CreateEmitContext): Added support for iterators.
3434
3435         * anonymous.cs
3436         (AnonymousContainer): New abstract base class for `AnonymousMethod'.
3437         (AnonymousContainer.CreateMethodHost): Moved here from
3438         AnonymousMethod and made abstract.
3439         (AnonymousContainer.CreateScopeType): New abstract method.
3440         (AnonymousContainer.IsIterator): New public property.
3441         (ScopeInfo.EmitScopeType): Call CreateScopeType() on our Host to
3442         get the ScopeTypeBuilder rather than manually defining it here. 
3443         (ScopeInfo.EmitScopeInstance): New public method; correctly handle
3444         iterators here.
3445
3446         * driver.cs (Driver.MainDriver): Call TypeManager.InitCodeHelpers()
3447         before RootContext.DefineTypes().
3448
3449         * codegen.cs (EmitContext.RemapToProxy): Removed.
3450         (EmitContext.CurrentAnonymousMethod): Changed type from
3451         AnonymousMethod -> AnonymousContainer.
3452         (EmitContext.ResolveTopBlock): Protect from being called twice.
3453         (EmitContext.MapVariable, RemapParameter(LValue)): Removed.
3454         (EmitContext.EmitThis): Removed the iterators hacks; use the
3455         anonymous methods framework for that.
3456
3457         * statement.cs
3458         (ToplevelBlock.Container): Make this a property, not a field.
3459         (ToplevelBlock.ReParent): New public method; move the
3460         ToplevelBlock into a new container.
3461         (Foreach.TemporaryVariable): Simplify.
3462
3463 2005-06-05  Martin Baulig  <martin@ximian.com>
3464
3465         * statement.cs (LocalInfo.CompilerGenerated): New flag.
3466         (Block.AddTemporaryVariable): New public method; creates a new
3467         `LocalInfo' for a temporary variable.
3468         (Block.EmitMeta): Create the LocalBuilders for all the temporary
3469         variables here.
3470         (Foreach.TemporaryVariable): Use Block.AddTemporaryVariable() for
3471         non-iterator variables.
3472
3473 2005-06-05  Martin Baulig  <martin@ximian.com>
3474
3475         * statement.cs (Foreach.TemporaryVariable): Create the
3476         LocalBuilder in the Emit phase and not in Resolve since in some
3477         situations, we don't have an ILGenerator during Resolve; see
3478         2test-19.cs for an example.
3479
3480 2005-06-04  Martin Baulig  <martin@ximian.com>
3481
3482         **** Merged r45395 from GCS ****
3483
3484         The big Foreach rewrite - Part II.
3485
3486         * typemanager.cs (TypeManager.object_getcurrent_void): Replaced
3487         with `PropertyInfo ienumerator_getcurrent'.
3488
3489         * codegen.cs (VariableStorage): Removed.
3490
3491         * statement.cs
3492         (Foreach): Derive from Statement, not ExceptionStatement.
3493         (Foreach.CollectionForeach): New nested class.  Moved all the code
3494         dealing with collection foreach here.
3495         (Foreach.ForeachHelperMethods): Removed.
3496         (Foreach.TemporaryVariable): Implement IMemoryLocation.
3497
3498 2005-05-23  Martin Baulig  <martin@ximian.com>
3499
3500         * statement.cs (Try.DoResolve): Don't create a `finally' if we
3501         don't need to.  Fix #75014.
3502
3503 2005-05-20  Martin Baulig  <martin@ximian.com>
3504
3505         Merged r44808 from GMCS.
3506
3507         * class.cs (TypeContainer.CircularDepException): Removed.
3508         (TypeContainer.DefineType): Removed the `InTransit' stuff.
3509         (TypeContainer.CheckRecursiveDefinition): Check for circular class
3510         (CS0146) and interface (CS0529) dependencies here.
3511
3512 2005-06-21  Raja R Harinath  <rharinath@novell.com>
3513
3514         * expression.cs (Invocation.EmitCall): Fix initialization
3515         'this_call' to reflect current behaviour.  Fix indentation.
3516
3517         * convert.cs (FindMostEncompassedType): Add two trivial special
3518         cases (number_of_types == 0 || number_of_types == 1).
3519         (FindMostEncompasingType): Likewise.
3520
3521 2005-06-17  Raja R Harinath  <rharinath@novell.com>
3522
3523         Some cleanups preparing for the fix of #75283.
3524         * ecore.cs (PropertyExpr.InstanceResolve): Tighten conditions for
3525         error testing.
3526         (EventExpr.InstanceResolve): Likewise.
3527         (EventExpr.DoResolve): Remove redundant checks.
3528
3529 2005-06-10  Duncan Mak  <duncan@novell.com>
3530
3531         * cs-tokenizer.cs (process_directives): New flag for controlling
3532         the processing of preprocessor directives.
3533         (x_token): After seeing a '#', return Token.NONE instead of going
3534         to handle_preprocessing_directive() when not processing
3535         directives. This avoids unnecessary processing during the token peek in
3536         is_punct().
3537
3538         This fixes #74939.
3539
3540         * cs-tokenizer.cs (handle_preprocessing_directive, xtoken): Use
3541         the existing error reporting methods instead of Report.Error.
3542
3543         * convert.cs (priv_fmt_expr): Remove. It's not needed anymore
3544         after Raja's rewrite.
3545
3546 2005-06-08  Miguel de Icaza  <miguel@novell.com>
3547
3548         * class.cs: Small fix.
3549
3550 2005-06-08  Raja R Harinath  <rharinath@novell.com>
3551
3552         Fix #75160.
3553         * class.cs (GetPartialBases): Fix return value check of
3554         part.GetClassBases.
3555
3556 2005-06-07  Raja R Harinath  <rharinath@novell.com>
3557
3558         Ensure that partial classes are registered in their enclosing
3559         namespace.  Initial part of fix of #75160.
3560         * tree.cs (Tree.RecordDecl): Add new namespace argument.
3561         Register declspace with namespace here, not in
3562         DeclSpace.RecordDecl.
3563         * cs-parser.jay: Pass namespace to RecordDecl.
3564         * class.cs (PartialContainer.Create): Likewise.
3565         (ClassPart.DefineType): New sanity-check.  Throws an exception if
3566         called.
3567         * decl.cs (Declspace.RecordDecl): Remove.
3568         * namespace.cs (NamespaceEntry.DefineName): Remove.
3569
3570 2005-06-06  Marek Safar  <marek.safar@seznam.cz>
3571
3572         * rootcontext.cs: Reset TargetExt as well.
3573
3574 2005-06-03  Raja R Harinath  <rharinath@novell.com>
3575
3576         * ecore.cs (Expression.Resolve): Emit CS0654 error when
3577         -langversion:ISO-1.
3578
3579 2005-06-02  Raja R Harinath  <rharinath@novell.com>
3580
3581         Fix #75080, cs0119.cs.
3582         * ecore.cs (Expression.ExprClassToResolveFlags): New.  Broken out
3583         of ...
3584         (Expression.Resolve): ... this.  Use it.  Remove bogus code
3585         allowing ExprClass.Type and ExprClass.Namespace for
3586         ResolveFlags.VariableOrValue.
3587         (Expression.Resolve) [1-argument variant]: Change default resolve
3588         flags based on language version.
3589         (Expression.Error_UnexpectedKind): Use a simple string array
3590         rather than an ArrayList.
3591         * expression.cs (TypeOf.DoResolve): Set eclass to ExprClass.Value,
3592         not ExprClass.Type.
3593         (TypeOfVoid.DoResolve): Likewise.
3594         (MemberAccess.DoResolve) [3-argument variant]: Make private.  Drop
3595         flags argument -- it always has the same value.
3596
3597 2005-05-31  Raja R Harinath  <rharinath@novell.com>
3598
3599         Fix #75081.
3600         * ecore.cs (Expression.ResolveLValue): Add a Location parameter.
3601         Use it in the error message.
3602         * assign.cs, expression.cs, statement.cs: Update.
3603
3604 2005-05-30  Raja R Harinath  <rharinath@novell.com>
3605
3606         Fix #75088.
3607         * ecore.cs (Expression.MemberLookupFailed): Add CS0122 check in
3608         the "almostMatchedMember" case too.
3609         * typemanager.cs (Closure.CheckValidFamilyAccess): Add anything
3610         that failed the accessibility checks to 'almost_match'.
3611
3612 2005-05-27  Vladimir Vukicevic  <vladimir@pobox.com>
3613
3614         * attribute.cs: Use internal MethodBuilder methods to set
3615         ExactSpelling and SetLastError on PInvoke methods, instead
3616         of passing them via charset.  Fixes #75060.
3617
3618 2005-05-27  Raja R Harinath  <rharinath@novell.com>
3619
3620         * parameter.cs (Parameter): Remove TODO comment.
3621         (Parameter.DefineParameter): Remove Location parameter.
3622         (Parameters.LabelParameters): Likewise.
3623         * class.cs (Constructor.Emit): Update to change.
3624         (MethodData.Emit): Likewise.
3625         * anonymous.cs (AnonymousMethod.EmitMethod): Likewise.  
3626         * delegate.cs (Delegate.Define, Delegate.Emit): Likewise.
3627
3628 2005-05-27  Atsushi Enomoto  <atsushi@ximian.com>
3629
3630         * parameter.cs,
3631           Removed Parameters.Location and added Parameter.Location instead.
3632           Removed Location parameter from Emit() and GetSignature().
3633         * anonymous.cs,
3634           class.cs,
3635           cs-parser.jay,
3636           delegate.cs,
3637           iterators.cs,
3638           statement.cs :
3639           Modified all related calls.
3640
3641 2005-05-26  Raja R Harinath  <rharinath@novell.com>
3642
3643         Improve user-defined conversion handling.
3644         * convert.cs (GetConversionOperators): Rewrite.  Return only the
3645         applicable operators.
3646         (AddConversionOperators): New.  Helper for GetConversionOperators.
3647         (FindMostEncompassedType, FindMostEncompassingType): Verify that
3648         there is only one most encompassed/encompassing type.
3649         (FindMostSpecificSource, FindMostSpecificTarget): Remove
3650         "applicable operator" handling.
3651         (UserConversion): Move cache here from GetConversionOperators.
3652         Directly cache the chosen operator, rather than the whole
3653         MethodGroup.
3654         (ExplicitNumericConversion): Fix buggy implementation of Decimal
3655         case.  Allow conversion of decimal to sbyte and byte too.
3656         * expression.cs (EmptyExpression.Grab, EmptyExpression.Release):
3657         New static methods.  Used to avoid allocating EmptyExpressions in
3658         convert.cs.
3659
3660 2005-05-24  Duncan Mak  <duncan@novell.com>
3661
3662         * ecore.cs (CastFromDecimal): New class for casting a decimal to
3663         another class, used in Convert.ExplicitNumericConversion.
3664         (CastToDecimal): New class, similar to above, but casts to
3665         System.Decimal, used in Convert.ImplicitNumericConversion and also
3666         in explicit convesion from double/float to decimal.
3667
3668         * convert.cs (ImplicitNumericConversion): Handle implicit
3669         conversions to System.Decimal.
3670         (ExplicitNumericConversion): handle explicit conversions to
3671         System.Decimal.
3672
3673         This fixes #68711.
3674         
3675 2005-05-20  Miguel de Icaza  <miguel@novell.com>
3676
3677         * typemanager.cs (EnumToUnderlying): Do not throw if we do not
3678         know the type at this stage, just break through.   Fixes #75008 
3679
3680 2005-05-19  Martin Baulig  <martin@ximian.com>
3681
3682         * delegate.cs
3683         (ImplicitDelegateCreation.Check): Added `bool check_only' argument
3684         to disable error reporting.
3685
3686         * convert.cs (Convert.ImplicitStandardConversionExists): Use it
3687         here since we don't want to report an error; see the new test-336.cs.
3688
3689 2005-05-19  Raja R Harinath  <rharinath@novell.com>
3690
3691         * statement.cs (ToplevelBlock.GetParameterReference)
3692         (ToplevelBlock.IsParameterReference,ToplevelBlock.IsLocalParameter):
3693         Move here from class Block.
3694         * ecore.cs (SimpleName.SimpleNameResolve): Update to changes.
3695         * expression.cs (ParameterReference.DoResolveBase): Likewise.
3696
3697 2005-05-18  Martin Baulig  <martin@ximian.com>
3698
3699         Fix #74978.
3700
3701         * flowanalysis.cs
3702         (FlowBranching.Reachability): Add non-static public And() and Or()
3703         methods.
3704         (FlowBranchingSwitch): New class; do the `break_origins' thing
3705         like in FlowBranchingLoop.
3706         (FlowBranching.UsageVector.MergeBreakOrigins): Also merge the
3707         reachability, not just locals and parameters.
3708         (FlowBranching.MergeChild): Remove some of the hacks for loop and
3709         switch; MergeBreakOrigins() now takes care of that.
3710
3711 2005-05-18  Martin Baulig  <martin@ximian.com>
3712
3713         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
3714         a loop and may leave it, reset the barrier; fixes #74974.
3715
3716 2005-05-17  Marek Safar  <marek.safar@seznam.cz>
3717         
3718         * attribute.cs (Attribute.ResolveArguments): GuidAttribute check
3719         is back.
3720         
3721         * cs-parser.jay: Catch more lexical errors.
3722         
3723         * report.cs: Add one more Error method.
3724         
3725         * rootcontext.cs,
3726         * typemanager.cs: Register System.Runtime.InteropServices.GuidAttribute
3727
3728 2005-05-17  Martin Baulig  <martin@ximian.com>
3729
3730         * expression.cs (Argument.Resolve): Turn on flow analysis; fix
3731         #70970. 
3732
3733 2005-05-16  Raja R Harinath  <rharinath@novell.com>
3734
3735         Fix test-382.cs.  Emit values of decimal constants.
3736         * class.cs (TypeContainer.RegisterFieldForInitialization): New.
3737         Carved out of ...
3738         (TypeContainer.AddField): ... this.
3739         (TypeContainer.EmitFieldInitializers): Allow the list of fields
3740         with initializers to include 'Const's.
3741         (ClassPart.RegisterFieldForInitialization): Forward to
3742         PartialContainer.
3743         * const.cs (Const.Const): Pass initializer to base class.
3744         (Const.Define): In case of decimal constants, register them for
3745         initialization in a static constructor.
3746
3747 2005-05-14  Martin Baulig  <martin@ximian.com>
3748
3749         * statement.cs (Block.Resolve): Correctly handle unreachable code;
3750         do not call ResolveUnreachable() on unreachable statements in
3751         here, see the comment in the source code.
3752
3753 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3754
3755         Fix #74934.
3756         * expression.cs (BinaryResolveOperator): If one of the operands of
3757         an equality comparison is 'null' and the other is a pointer type,
3758         convert the null to a NullPointer.
3759         * convert.cs (ImplicitReferenceConversion): If the expression is a
3760         NullLiteral and the target type is a pointer type, return a
3761         NullPointer instead.
3762         (ImplicitConversionStandard): Likewise.
3763
3764 2005-05-13  Marek Safar  <marek.safar@seznam.cz>
3765         
3766         * cs-parser.jay: Set readonly context based on special constructs.
3767         
3768         * expression.cs (LocalVariableReference.DoResolveBase): Improved
3769         readonly variable error handling.
3770         
3771         * rootcontext.cs (EmitCode): Don't verify members when error
3772         occurred.
3773         
3774         * statement.cs (LocalInfo): Add reaodnly context information.
3775         (SetReadOnlyContext, GetReadOnlyContext): New methods.
3776
3777 2005-05-13  Raja R Harinath  <rharinath@novell.com>
3778
3779         * statement.cs (Block.Resolve): Revert change below.  Modify fix
3780         for #74041 to initialize 'resolved' to false only for explicit
3781         blocks.  Fixes #74873.
3782
3783 2005-05-12  Raja R Harinath  <harinath@gmail.com>
3784
3785         Fix #74920.
3786         * typemanager.cs (unmanaged_enclosing_types): New.
3787         (IsUnmanagedType): Avoid infloops by using
3788         'unmanaged_enclosing_types' to talk with recursive invocations.
3789
3790 2005-05-13  Martin Baulig  <martin@ximian.com>
3791
3792         * statement.cs (Block.Resolve): Make the `bool unresolved' flag an
3793         instance variable, not a local.  Fix #74873.
3794         (Block.ResolveUnreachable): Set it to true here.
3795
3796 2005-05-11  Duncan Mak  <duncan@novell.com>
3797
3798         * cs-tokenizer.cs (get_cmd_arg): Check that 'c' is not -1 before
3799         continuing to process for 'arg'.
3800         (handle_preprocessing_directive): Check the argument of the #endif
3801         directive and report error CS1025 if there are any trailing
3802         characters.
3803
3804         According to the C# spec, having even whitespace after the #endif
3805         directive is illegal; however, because we call arg.TrimEnd ()
3806         beforehand, we have the same behavior as csc, allowing whitespace
3807         after the directive.
3808
3809         Fixes #74892.
3810
3811 2005-05-11  Marek Safar  <marek.safar@seznam.cz>
3812
3813         Fix #74863.
3814         
3815         * class.cs (ConstructorInitializer.GetOverloadedConstructor): Removed.
3816         (Constructor.GetObsoleteAttribute): Implemented correctly.
3817
3818 2005-05-10  Martin Baulig  <martin@ximian.com>
3819
3820         * support.cs (ReflectionParameters.ParameterModifier): Use
3821         `Parameter.Modifier.REF' if we both have `ParameterAttributes.Out'
3822         and `ParameterAttributes.In'.  Fixes #74884.
3823
3824 2005-05-10  Marek Safar  <marek.safar@seznam.cz>
3825
3826         * class.cs (Method.Define): Catch attempt for Finalizer declaration.
3827         
3828         * expression.cs (Argument.GetParameterModifier): Turned to property.
3829         (Invocation.Error_InvalidArguments): Add more descriptive errors.
3830         
3831         * parameter.cs (Parameter.GetModifierSignature): Translates modifier to
3832         its C# equivalent.
3833         
3834 2005-05-09  Raja R Harinath  <rharinath@novell.com>
3835
3836         Fix #74852.
3837         * decl.cs (MemberCache.AddMethods): Register override methods,
3838         rather than non-override methods.
3839         * typemanager.cs (RegisterOverride): New.
3840         (IsOverride): Update.
3841
3842 2005-05-09  Marek Safar  <marek.safar@seznam.cz>
3843
3844         Fix #73105.
3845         
3846         * ecore.cs (SimpleName.SimpleNameResolve): Add in_transit to catch
3847         recursive declaration.
3848         
3849         * statement.cs (Block.ResolveMeta): Report any error in resolving.
3850         
3851 2005-05-06  Marek Safar  <marek.safar@seznam.cz>
3852
3853         * cfold (DoConstantNumericPromotions): Don't try to convert 0 enum.
3854         
3855         * expression.cs (Binary.DoResolve): (x && 0) is always 0.
3856
3857 2005-05-05  Raja R Harinath  <rharinath@novell.com>
3858
3859         Fix #74797.
3860         * decl.cs (DeclSpace.FamilyAccessible): 
3861         Use TypeManager.IsNestedFamilyAccessible.
3862
3863         Fix reopened #64812.
3864         * typemanager.cs (Closure.Filter): Introduce checks for 'protected
3865         internal'.
3866
3867 2005-05-04  Raja R Harinath  <rharinath@novell.com>
3868             Abin Thomas  <projectmonokochi@rediffmail.com>
3869             Anoob V E  <projectmonokochi@rediffmail.com>
3870             Harilal P R  <projectmonokochi@rediffmail.com>
3871
3872         Fix #64812.
3873         * typemanager.cs (Closure.CheckValidFamilyAccess): Don't blindly
3874         allow access to all static members.
3875
3876 2005-05-04  Martin Baulig  <martin@ximian.com>
3877
3878         * ecore.cs (FieldExpr.DoResolveLValue): Always call fb.SetAssigned().
3879
3880 2005-05-04  Martin Baulig  <martin@ximian.com>
3881
3882         Fix #74655.
3883
3884         * statement.cs (Switch.SimpleSwitchEmit): Always emit the default
3885         section at the end; make things work if `default' is not the last
3886         section.        
3887
3888 2005-05-04  Martin Baulig  <martin@ximian.com>
3889
3890         Fix #70400.
3891
3892         * statement.cs (Switch): Replaced the `got_default' field with a
3893         `default_section' one.
3894         (Switch.CheckSwitch): Set `default_section' here.
3895         (Switch.Resolve): If we're a constant switch and the constant is
3896         not found, use the default section.
3897
3898 2005-05-03  Martin Baulig  <martin@ximian.com>
3899
3900         * expression.cs (ArrayAccess.EmitGetLength): New public method.
3901
3902         * statement.cs (Foreach.ArrayForeach): New nested class.
3903         (Foreach.TemporaryVariable): New nested class.
3904         (Foreach.EmitArrayForeach): Removed; this is now in the new
3905         ArrayForeach class.
3906
3907 2005-05-03  Raja R Harinath  <rharinath@novell.com>
3908
3909         * pending.cs (BaseImplements): Move the #74773 fix here.  This is
3910         more conservative.
3911         (VerifyPendingMethods): Revert change below.
3912
3913         * typemanager.cs (IsOverride, RegisterNonOverride): New.
3914         * decl.cs (MemberCache.AddMethod): Register "non-override" methods
3915         that used to trigger warning -28.  Remove warning -28.
3916         * expression.cs (Invocation.OverloadResolve): Use
3917         TypeManager.IsOverride to distinguish override methods.
3918
3919         Fix #74773.
3920         * pending.cs (VerifyPendingMethods): If a base type implements the
3921         requested interface, don't bother checking individual methods of
3922         the base type.  As a side-effect, this prevents the creation of
3923         unnecessary proxies.
3924
3925 2005-05-02  Martin Baulig  <martin@ximian.com>
3926
3927         Fix #70182.
3928
3929         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
3930         Also `And' the locals if the old vector is null.
3931         (FlowBranching.UsageVector.BitVector.And): Allow `vector' being
3932         null; in this case we basically reset all the variables.        
3933
3934 2005-05-02  Martin Baulig  <martin@ximian.com>
3935
3936         Fix #74529.
3937
3938         * flowanalysis.cs (FlowBranching.UsageVector.MergeBreakOrigins):
3939         Added `FlowBranching branching' argument; always `and' the
3940         variables instead of `or'ing them unless we're an infinite loop.
3941
3942         * statement.cs (While.Resolve): Create a new sibling unless we're
3943         infinite.       
3944
3945 2005-05-02  Martin Baulig  <martin@ximian.com>
3946
3947         Fix #70140.
3948
3949         * class.cs (ConstructorInitializer.Resolve): Added `Block block'
3950         arguments; use it instead of creating a new TopLevelBlock.
3951         (Constructor.Emit): Call `block.ResolveMeta ()' before resolving
3952         our ConstructorInitializer.
3953
3954         * statement.cs
3955         (TopLevelBlock.TopLevelBranching): New public property.
3956         (TopLevelBlock.ResolveMeta): New public method; call ResolveMeta()
3957         and create our `TopLevelBranching'.
3958
3959         * codegen.cs (EmitContext.ResolveTopBlock): If we're not an
3960         anonymous method host, use `block.TopLevelBranching' rather than
3961         creating a new branching.
3962
3963 2005-04-20  Miguel de Icaza  <miguel@novell.com>
3964
3965         * anonymous.cs (ScopeInfo.AddChild): when adding a new child to
3966         a ScopeInfo, if any of the current children is a child of the new
3967         entry, move those children there.
3968
3969 2005-04-30  Martin Baulig  <martin@ximian.com>
3970
3971         * statement.cs (Switch.SimpleSwitchEmit): Reset `default_at_end'
3972         at the beginning of a SwitchSection.  Fix #73335.
3973
3974 2005-04-27  Marek Safar  <marek.safar@seznam.cz>
3975
3976         Fix #74378
3977         * class.cs (EmitFieldInitializers): Use FieldExpr in initializer.
3978         
3979         * ecore.cs (FieldExpr): Add a new ctor with in_initializer.
3980         (FieldExpr.DoResolve): Obsolete members are ignored for field
3981         initializers.
3982         
3983 2005-04-26  Marek Safar  <marek.safar@seznam.cz>
3984
3985         * attribute.cs (AreOverloadedMethodParamsClsCompliant): Add array
3986         of arrays detection.
3987
3988         * class.cs (Interface.VerifyClsCompliance): Add base interfaces
3989         verification.
3990         (Field.VerifyClsCompliance): Volatile fields are not compliant.
3991
3992         * decl.cs (MemberCache.VerifyClsParameterConflict): Add array of
3993         arrays report.
3994
3995 2005-04-25  Ben Maurer  <bmaurer@ximian.com>
3996
3997         * cs-parser.jay: Use the prefered version of -unsafe in error
3998         message.
3999
4000 2005-04-22  Marek Safar  <marek.safar@seznam.cz>
4001
4002         * driver.cs (CompilerCallableEntryPoint.Invoke): Reset under any
4003         circumstances.
4004
4005 2005-04-20  John Luke  <john.luke@gmail.com>
4006
4007         * driver.cs: fix typo in error message, --outout to --output
4008
4009 2005-04-20  Marek Safar  <marek.safar@seznam.cz>
4010
4011         * codegen.cs (InRefOutArgumentResolving): New field.
4012         
4013         * ecore.cs (FieldExpr.DoResolve): Check for assigning to readonly
4014         fields outside contructor.
4015         
4016         * expression.cs (Argument.Resolve): Set InRefOutArgumentResolving.
4017         
4018 2005-04-19  Miguel de Icaza  <miguel@novell.com>
4019
4020         * anonymous.cs (CaptureContext.EmitParameterInstance): The
4021         parameter code was not completed ever, so it was not as up-to-date
4022         as local variables.  Must finish it.
4023
4024         The bug fix was to compare the Toplevel of the block, not the
4025         current block.  Thanks for Ben for pointing this out. 
4026
4027 2005-04-19  Raja R Harinath  <rharinath@novell.com>
4028
4029         * decl.cs (AddMethods): Use the declaring type of the problem
4030         method to determine if we want to squash a warning.
4031
4032 2005-04-19  Marek Safar  <marek.safar@seznam.cz>
4033
4034         * attribute.cs: Removed debug output.
4035
4036         * decl.cs (MemberCache.AddMethods): Fixed Finalize ignoring.
4037         
4038         * driver.cs (Driver.parse): Synchronize parser ErrorOutput with
4039         Report.Stderr.
4040         
4041 2005-04-18  Raja R Harinath  <rharinath@novell.com>
4042
4043         Fix #74481.
4044         * expression.cs (Binary.EqualsNullIsReferenceEquals): New.
4045         (Binary.DoResolveOperator): Use it to avoid blindly optimizing out
4046         all null comparisons against reference types.
4047
4048 2005-04-18  Marek Safar  <marek.safar@seznam.cz>
4049
4050         Fix# 74565
4051         * class.cs (TypeContainer.CircularDepException) New nested
4052         exception class.
4053         (GetPartialBases, GetNormalBases, GetClassBases): Removed error.
4054         (TypeContainer.DefineType): Removed error, reset InTransit before
4055         exit.
4056         (Class.DefineType): Throw exception when is in Transit.
4057         Catch exception and report error.
4058         (Struct.DefineType): Throw exception when is in Transit.
4059         Catch exception and report error.
4060         (Interface.DefineType): Throw exception when is in Transit.
4061         Catch exception and report error.
4062
4063         * codegen.cs: Add InCatch,InFinally to EmitContext to easily
4064         handle nested exception handlers.
4065
4066         * flowanalysis.cs (InTryWithCatch): New method, search for try with
4067         a catch.
4068
4069         * iterators.cs (Yield.CheckContext): Add CS1626 report. Updated
4070         InFinally and InCatch storage.
4071
4072         * statement.cs (Throw.Resolve): Use InCatch, InFinally from ec.
4073         (Catch.Resolve): Set and Restore ec.InCatch.
4074         (Try.Resolve): Set and Restore ec.InFinally.
4075         (Try.HasCatch): True when try has catch.
4076
4077 2005-04-17  Atsushi Enomoto  <atsushi@ximian.com>
4078
4079         * doc.cs : In some cases FilterName returns MonoEvent and MonoField
4080           for the same event member, so exclude such cases from warning 419.
4081           Fixed bug #74633.
4082
4083 2005-04-16  Miguel de Icaza  <miguel@novell.com>
4084
4085         * expression.cs (Binary.ResolveOperator): Apply patch from John
4086         Luke to fix bug 59864: operators &, | and ^ on enumerations
4087         require that the same enum type on both sides.
4088
4089         * driver.cs: Add warnings to old flag usage, this is to assist
4090         people who produce Makefiles and hope that the Makefiles will be
4091         used on Windows.
4092
4093         * class.cs (TypeContainer.EmitType): Moved the definition of the
4094         special $PRIVATE$ field from the resolve phase to the Emit phase.
4095         During resolve we do not know if we are a struct with
4096         HasExplicitLayout, we know this only after the attributes for the
4097         type are emitted.
4098
4099         Set the FieldOffset to zero on the dummy field that we create for
4100         the class.   Fixes 74590.
4101
4102 2005-04-16  Raja R Harinath  <rharinath@novell.com>
4103
4104         Fix #73834.
4105         * ecore.cs (PropertyExpr.resolved): New.
4106         (DoResolve): Use it to handle a case of double resolution here.
4107         Handle a case of identical-name-and-type-name.
4108         * expression.cs (ArrayCreation.CheckIndices): Avoid double
4109         resolution by storing the results of expression resolution back
4110         into the "probes" array.
4111
4112 2005-04-15  Raja R Harinath  <rharinath@novell.com>
4113
4114         Fix cs0208-7.cs and cs0208-8.cs.
4115         * typemanager.cs (IsUnmanagedType): Arrays are not allowed
4116         (cf. ECMA standard, behaviour of CSC 1.1 and CSC 2.0).  Improve
4117         error reporting to point out the reason a struct is not unmanaged.
4118
4119 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4120
4121         * doc.cs : In FindDocumentedType(), avoid TypeExpr.ResolveType() and 
4122           just use TypeExpr.Type. This fixes bug #74595 when merged to gmcs.
4123
4124 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4125
4126         Fix #74528.
4127         * ecore.cs (PropertyExpr.InstanceResolve): Handle a case of
4128         IdenticalNameAndTypeName here.
4129         (EventExpr.InstanceResolve): Likewise.
4130
4131 2005-04-13  Marek Safar  <marek.safar@seznam.cz>
4132
4133         C# 2.0 DefaultCharSetAttribute implementation
4134         
4135         * attribute.cs (Attribute.ResolveAsTypeStep): New protected method
4136         which allows us to set GlobalNamespace for every resolve.
4137         (Attribute.ResolveArguments): Cut from Resolve.
4138         (Attribute.GetCharSetValue): Returns CharSet named argument.
4139         (Attribute.DefinePInvokeMethod): Gets default charset from
4140         module settings.
4141         (GlobalAttribute.ResolveAsTypeStep): Override.
4142         (GlobalAttribute.ResolveArguments): Override.
4143         
4144         * class.cs (TypeAttr): Is protected.
4145         
4146         * codegen.cs (ModuleClass.DefaultCharSet): New member.
4147         (ModuleClass.DefaultCharSetType): New memeber.
4148         (ModuleClass.ResolveAttributes): Resolves DefaultCharSetAttribute.
4149         
4150         * decl.cs (Decl.TypeAttr): New protected virtual. Returns default
4151         charset from module.
4152         
4153         * delegate.cs (TypeAttr): Override.
4154         (Delegate.DefineType): Use this TypeAttr.
4155         
4156         * driver.cs (Driver.MainDriver): Call Module.ResolveAttributes
4157         at very early stage (before types are defined) to resolve model
4158         module attributes. It will probably not work with corlib but it
4159         should be ok.
4160         
4161         * enum.cs (Enum.TypeAttr): New protected virtual. Returns default
4162         charset from module.
4163         
4164         * typemanager.cs (default_charset_type): New type.
4165
4166 2005-04-13  Raja R Harinath  <rharinath@novell.com>
4167
4168         * decl.cs (MemberCache.AddMethods): Don't warn if
4169         System.Object.Finalize has buggy MethodAttributes.
4170
4171         * typemanager.cs (IsUnmanagedType): Restore !IsValueType check
4172         removed below.
4173
4174 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4175
4176         * doc.cs : detect ambiguous reference to overloaded members.
4177           Fixed bug #71603. MS 1.1 csc does not detect it.
4178
4179 2005-04-13  Atsushi Enomoto  <atsushi@ximian.com>
4180
4181         * doc.cs : delegates must not be referenced with parameters.
4182           Fixed bug #71605.
4183
4184 2005-04-12  Miguel de Icaza  <miguel@novell.com>
4185
4186         * typemanager.cs (IsUnmanagedType): Arrays are allowed.
4187
4188 2005-04-10  Miguel de Icaza  <miguel@novell.com>
4189
4190         * driver.cs (MainDriver): Stop processing if the CLS stage found
4191         errors. 
4192
4193         (CompilerCallableEntryPoint.InvokeCompiler): Always
4194         reset after execution;   Take a TextWriter argument for the
4195         output.
4196
4197         * report.cs: Use the error stream instead of hardcoding stderr. 
4198
4199 2005-04-09  Miguel de Icaza  <miguel@novell.com>
4200
4201         * class.cs: Reduce code paths to test, too small of an
4202         optimization to make it worth the extra testing.  Always perform
4203         it. 
4204
4205 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4206
4207         Fix #74510.
4208         * class.cs (OperatorArrayList.CheckPairedOperators): Skip
4209         operators that had errors reported on them.
4210
4211 2005-04-08  Marek Safar  <marek.safar@seznam.cz>
4212
4213         * attribute.cs (Attribute.IsValidArgumentType): Test valid named
4214         argument types.
4215         (Attribute.Resolve): Add named argument type checking.
4216         
4217         * class.cs (FixedField.Define): Use IsPrimitiveType
4218         
4219         * expression.cs (Binary.ResolveOperator): Reflect IsCLRType renaming.
4220         
4221         * iterators.cs (Iterator.DefineIterator): Add check for arglist and
4222         unsafe parameter types.
4223         
4224         * statement.cs (Using.ResolveExpression): Add better error description.
4225         
4226         * typemanager.cs (IsCLRType): Renamed to IsPrimitiveType.
4227         
4228 2005-04-08  Raja R Harinath  <rharinath@novell.com>
4229
4230         Fix #74484.
4231         * attribute.cs (Attribute.GetAttributeUsage): Resolve
4232         AttributeUsageAttribute in the emitcontext of the attribute class,
4233         not in the emitcontext of the attributable entity it was attached to.
4234         * cs-parser.jay: Use 'current_class', not 'current_container',
4235         when creating a GlobalAttribute.
4236
4237 2005-04-08  Alp Toker  <alp@atoker.com>
4238
4239         * pending.cs: The fix to #58413 failed to compile methods implementing
4240         interfaces with/without params modifiers and vice versa, even though
4241         params modifiers aren't part of the signature. Make the modifier check
4242         less strict as in csc.
4243
4244 2005-04-07  Abin Thomas  <projectmonokochi@rediffmail.com>
4245             Anoob V E  <projectmonokochi@rediffmail.com>
4246             Harilal P R  <projectmonokochi@rediffmail.com>
4247
4248         Fix #58413.
4249         * pending.cs (TypeAndMethods.mods): New.  Store the parameter
4250         modifiers of pending methods.
4251         (PendingImplementation.PendingImplementation): Initialize it.
4252         Add Parameter.Modifier [][] mods and initialize it with ParameterData.
4253         (PendingImplementation.InterFaceMethod): Repalce Type[] argument
4254         with ParameterData.  Add check for modifiers.
4255         * class.cs (MethodData.Define): Update to changes.
4256
4257 2005-04-07  Raja R Harinath  <rharinath@novell.com>
4258
4259         * ecore.cs (Expression.IsAccessorAccessible): Clarify code somewhat.
4260
4261 2005-04-07  Marek Safar  <marek.safar@seznam.cz>
4262
4263         * class.cs (PropertyMethod.Define): Check private accessor in abstract
4264         property.
4265         
4266         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't allow RequiredAttribute
4267         
4268         * rootcontext.cs,
4269         * typemanager.cs: Registered RequiredAttributeAttribute.
4270         
4271 2005-04-06  Marek Safar  <marek.safar@seznam.cz>
4272
4273         * class.cs (VerifyMembers): Doesn't need EmitContext argument.
4274         Warning CS0169 is back at level 3.
4275         (IMethodData.SetMemberIsUsed): New method.
4276         
4277         * decl.cs (IsUsed): New value; moved from FieldBase.Status
4278         (SetMemberIsUsed, IsUsed): New methods, encapsulate IsUsed.
4279         
4280         * delegate.cs (ResolveMethodGroupExpr): Call SetMemberIsUsed.
4281
4282         * ecore.cs (FieldExpr.ResolveMemberAccess): Call SetMemberIsUsed for
4283         contants.
4284         (PropertyExpr.ResolveAccessors): Call SetMemberIsUsed when delegate
4285         is used.
4286         
4287         * expression.cs (OverloadResolve): Call SetMemberIsUsed. when method
4288         is used.
4289         
4290         * rootcontext.cs (RootContext.EmitCode): Call VerifyMembers in extra run
4291         to avoid the problems with nested types.
4292
4293 2005-04-05  Abin Thomas  <projectmonokochi@rediffmail.com>
4294             Anoob V.E  <projectmonokochi@rediffmail.com>
4295             Harilal P.R  <projectmonokochi@rediffmail.com>
4296             Raja R Harinath  <rharinath@novell.com>
4297
4298         Fix #73820.
4299         * delegate.cs (Define): Emit ParamArrayAttribute for 'params'
4300         attribute.
4301         * typemanager (GetConstructor): Make public.
4302
4303 2005-04-05  John Luke  <john.luke@gmail.com>
4304             Raja R Harinath  <rharinath@novell.com>
4305
4306         Fix #62232.
4307         * typemanager.cs (IsUnmanagedType): Check non-public fields of a
4308         struct too.  Return false quicker in a few cases.
4309         (VerifyUnManaged): Use it.
4310
4311 2005-04-05  Raja R Harinath  <rharinath@novell.com>
4312
4313         Fix #74041.
4314         * statement.cs (Block.Resolve): Initialize 'unreachable' to false,
4315         not 'unreachable_seen'.
4316
4317 2005-04-04  Marek Safar  <marek.safar@seznam.cz>
4318
4319         * attribute.cs (Attribute.GetValue): Removed unused.
4320         
4321         * codegen.cs (CodeGen.TrimExt): Removed unused.
4322         
4323         * cs-parser.jay (output): Removed unused.
4324         
4325         * cs-tokenizer.cs (hex_digits): Removed unused.
4326         
4327         * enum.cs (MapToInternalType, GetEnumeratorName): Removed unused.
4328         
4329         * expression.cs (Indirection.LoadExprValue): Removed unused.
4330         (ArrayCreation.ExpressionToArrayArgument): Removed unused.
4331         
4332         * iterators.cs (Iterator.param_types): Removed unused.
4333         
4334         * statement.cs (Goto.block): Removed unused.
4335         (ToplevelBlock.did): Removed unused.
4336         (Switch.ResolveConstantSwitch): Removed unused.
4337
4338 2005-04-01  Ben Maurer  <bmaurer@ximian.com>
4339
4340         * rootcontext.cs: Allow mcs to bootstrap with the compilation
4341         resetting thingy.
4342
4343 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4344
4345         Fix #74232 and cs0208-3.cs.
4346         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0208 check.
4347         * typemanager.cs (IsUnmanagedType): Don't allow 'object' as an
4348         unmanaged type.  Don't use FieldBuilders when 't' is a
4349         TypeBuilder.  Use ModFlags and MemberType fields.
4350         * class.cs (MemberBase.member_type): Rename from MemberType.
4351         (MemberBase.MemberType): New property.  Determines member_type on
4352         demand.
4353         (MemberBase.DoDefine): Don't initialize MemberType here.
4354         (FieldMember.Define): Likewise.
4355
4356 2005-04-01  Marek Safar  <marek.safar@seznam.cz>
4357
4358         Fix #74241
4359         * class.cs (Event.Emit): Call Add/Remove emit even for interfaces.
4360         Attributes are emitted there.
4361         
4362 2005-04-01  Raja R Harinath  <rharinath@novell.com>
4363
4364         * cs-tokenizer.cs (consume_identifier): Treat 'partial' as a
4365         keyword in 'partial enum' too.
4366         * cs-parser.jay (enum_declaration): Add CS0267 check ('partial enum'
4367         is not allowed).
4368         Report from Kamil Skalski <nazgul@omega.pl>.
4369
4370         Fix #74309.
4371         * rootcontext.cs (ResolveTree): The 'root.Interfaces' list can
4372         have partial containers too.
4373
4374         * ecore.cs (SimpleName.SimpleNameResolve): Move 'invariant meaning
4375         in block' checks to Block.CheckInvariantMeaningInBlock.
4376         * statement.cs (Block.GetKnownVariableInfo): Make private.
4377         (Block.IsVariableUsedInChildBlock): Remove.
4378         (Block.IsVariableUsedInBlock): Likewise.
4379         (Block.CheckInvariantMeaningInBlock): New.  Show location of
4380         conflicting declaration.
4381         (Block.AddVariable): Make error messages less long-winded and more
4382         specific.  Show location of conflicting declaration.
4383         * parameter.cs (Parameters.Location): New readonly property.
4384
4385 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4386
4387         Clean up semantics of invoking ResolveMemberAccess.
4388         * ecore.cs (SimpleName.DoSimpleNameResolve): If a MemberExpression
4389         can have an instance, ensure that we pass in a non-TypeExpression
4390         to ResolveMemberAccess.  Tighten up IdenticalNameAndTypeName checks.
4391         (MemberExpr.DoSimpleNameResolve): Remove type_is_inferred
4392         argument.  Update to changes and simplify.
4393         (FieldExpr.Emitinstance): Remove CS0120 check.
4394         (PropertyExpr.EmitInstance): Likewise.
4395         * expression.cs (Argument.Resolve): Likewise.
4396         (Invocation.DoResolve): Update to changes in semantics of
4397         InstanceExpression.
4398
4399 2005-03-31  Marek Safar  <marek.safar@seznam.cz>
4400
4401         Fix #74241
4402         * class.cs (AbstractPropertyEventMethod.EmitMethod): Enable emit method
4403         customization.
4404         
4405         * decl.cs (MemberCache.AddMethods): Fix infinite loop.
4406
4407 2005-03-31  Raja R Harinath  <rharinath@novell.com>
4408
4409         Fix difference in behaviour with commandline invocation.
4410         * driver.cs (Driver.Reset): New.
4411         (CompilerCallableEntryPoint): Call it.
4412
4413         * statement.cs (If.Resolve): Avoid spurious "uninitialized
4414         variable" warnings if the boolean expression failed to resolve.
4415
4416 2005-03-30  Sebastien Pouliot  <sebastien@ximian.com>
4417
4418         * attribute.cs: Fix the union of several permissions when some of them
4419         are unrestricted (so the result isn't an unrestricted permission set).
4420         Fix #74036.
4421
4422 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4423
4424         * ecore.cs (MemberExpr): New class.  Convert from interface
4425         IMemberExpr.
4426         (MemberExpr.ResolveMemberAccess): Refactor and move here from
4427         MemberAccess.ResolveMemberAccess.  Tighten up pre-conditions and
4428         error checks.
4429         (MethodGroupExpr, FieldExpr, PropertyExpr, EventExpr): Update.
4430         (MethodGroupExpr.IsExplicitImpl): Remove.
4431         (Expression.GetFieldFromEvent): Remove.
4432         (SimpleName.MemberStaticCheck): Remove.
4433         (SimpleName.DoSimpleNameResolve): Update to changes.
4434         * expression.cs (MemberAccess.ResolveMemberAccess): Refactor.
4435         (MemberAccess.IdenticalNameAndTypeName): Remove.
4436         (MemberAccess.error176): Move to MemberExpr.
4437         (MemberAccess.DoResolve): Update to changes.
4438         (BaseAccess.DoResolve): Likewise.
4439
4440 2005-03-30  Marek Safar  <marek.safar@seznam.cz>
4441
4442         C# 2.0 Conditional attribute class implementation
4443         
4444         * attribute.cs (AttributeTester.IsAttributeExcluded): New method.
4445         Analyzes class whether it has attribute which has ConditionalAttribute
4446         and its condition is not defined.
4447         
4448         * class.cs (Class.ApplyAttributeBuilder): Add IsAttributeExcluded check.
4449         (Class.IsExcluded): New method. Search for at least one defined
4450         condition in ConditionalAttribute of attribute class.
4451
4452 2005-03-30  Raja R Harinath  <rharinath@novell.com>
4453
4454         * ecore.cs (PropertyExpr): Derive from Expression, not
4455         ExpressionStatement.
4456         (PropertyExpr.EmitStatement): Remove.
4457
4458 2005-03-29  Raja R Harinath  <rharinath@novell.com>
4459
4460         Fix #74060.
4461         * expression.cs (MemberAccess.ResolveMemberAccess): Allow the
4462         internal field "value__" of an enum be private.  The examples for
4463         "value__" that I found on MSDN all used FieldAttributes.Private.
4464
4465         * decl.cs (MemberCache.AddMethods): Use C# terminology in warning.
4466         Don't mention IL method attribute names.
4467
4468         Fix #47991.  Remove a TODO.
4469         * statement.cs (Block.Toplevel): Make into a field.
4470         (Block.Parameters): Move into ToplevelBlock.
4471         (Block.known_variables): Rename from child_variable_names.
4472         (Block.Block): Remove variants that take Parameters.  Initialize
4473         'Toplevel' with the immediately surrounding toplevel block.
4474         (Block.AddKnownVariable): Rename from AddChildVariableName.  Add a
4475         LocalInfo parameter.
4476         (Block.GetKnownVariableInfo): New.
4477         (Block.IsVariableNameUsedInChildBlock): Update.
4478         (Block.IsVariableNameUsedInBlock): New.  Checks if a name is used in
4479         the block, even though it may not be in scope.
4480         (Block.AddVariable): Remove Parameters parameter.  Use
4481         Toplevel.Parameters instead.
4482         (Block.AddConstant): Remove Parameters parameter.
4483         (Block.GetParameterReference): Update to use Toplevel.Parameters.
4484         (Block.IsParamaterReference): Likewise.
4485         (Block.IsLocalParameter): Likewise.  Simplify a lot.
4486         (ToplevelBlock.Parameters): New.  Moved from Block.
4487         (ToplevelBlock.ToplevelBlock): Update to changes.  Always
4488         initialize Parameters to a non-null value.
4489         * cs-parser.jay: Update to changes.
4490         * ecore.cs (SimpleName.SimpleNameResolve): Emit cs0136 error for
4491         simple names that mean different things in the same block.  Use
4492         Block.IsVariableNameUsedInBlock.
4493
4494 2005-03-28  Raja R Harinath  <rharinath@novell.com>
4495
4496         * typemanager.cs (TypeHandle.BaseType): Make into an IMemberContainer.
4497         (TypeHandle.TypeHandle): Use LookupMemberCache rather than
4498         GetTypeHandle.  It is possible for a reflected type to derive from
4499         a TypeBuilder (e.g., int[] derives from the TypeBuilder
4500         System.Array during mscorlib compilation).
4501         * decl.cs (MemberCache.MemberCache): If the base cache doesn't
4502         contain a method_hash, don't create one either.  Don't create a
4503         deep copy of the base cache's method_hash.
4504         (MemberCache.SetupCache): Rename back from DeepCopy.
4505         (MemberCache.AddMethods): Rewrite, now that method_hash isn't
4506         already initialized.  If we see an override function, add its
4507         underlying base virtual function to the member_hash too.
4508
4509         * enum.cs (Enum.LookupEnumValue): Remove debugging code.
4510
4511 2005-03-26  Raja R Harinath  <harinath@acm.org>
4512
4513         Fix #73038.
4514         * assign.cs (Assign.DoResolve): When the RHS of an assignment
4515         fails to resolve, ensure that the LHS is still resolved as an
4516         lvalue.
4517
4518 2005-03-25  Raja R Harinath  <harinath@acm.org>
4519
4520         * enum.cs (Enum.DefineType): Set ec.InEnumContext and
4521         ec.ContainerType.
4522         (Enum.current_ec): Remove.
4523         (Enum.LookupEnumValue): Remove EmitContext argument.
4524         Just uses the one created during DefineType.
4525         (Enum.FindMembers): Update.
4526         * expression.cs (MemberAccess.DoResolve): Update.
4527
4528 2005-03-22  Marek Safar  <marek.safar@seznam.cz>
4529
4530         * assign.cs (Assign.DoResolve): Check for CS1717 when
4531         source and target are same (uses Equals).
4532
4533         * expression.cs (LocalVariableReference, ParameterReference,
4534         This): Implemented Equals, GetHashCode.
4535
4536         * statement.cs (Block.GetParameterReference): Removed useless
4537         local variable.
4538
4539 2005-03-22  Raja R Harinath  <rharinath@novell.com>
4540
4541         Fix cs0128.cs
4542         * statement.cs (Block.AddVariable): Ensure that we skip implicit
4543         blocks before deciding whether the error is cs0136 or cs0128.
4544
4545         * cs-parser.jay: Pass MemberName to RootContext.Tree.RecordDecl.
4546         (using_alias_directive, using_namespace_directive): Pass
4547         MemberName, not an expression to Namespace.UsingAlias and
4548         Namespace.Using.
4549         (MakeName): Use the MemberName of the namespace.
4550         * namespace.cs (Namespace.MemberName): New.
4551         (UsingEntry.UsingEntry): Take a MemberName, not an expression.
4552         (AliasEntry.AliasEntry, Namespace.Using, Namespace.UsingAlias):
4553         Likewise.
4554         * decl.cs (MemberName.Name): Make readonly.
4555         (MemberName.FromDotted): New "constructor".
4556         (MemberName.Equals, MemberName.GetHashCode): Implement overrides.
4557         (MemberCore.Name): Compute from MemberName on demand.
4558         (MemberCore.SetMemberName): Provide a way to change the
4559         MemberName.
4560         (MemberCore.AddToContainer): Don't take a fullname parameter.
4561         * class.cs (TypeContainer.AddToMemberContainer): Don't add the
4562         fully qualified name of the container to the member name.
4563         (TypeContainer.AddToTypeContainer): Use a fully qualified name
4564         only if the type is a member of the root container.
4565         (TypeContainer.AddMethod, TypeContainer.AddProperty): Use
4566         MemberName.Left rather than searching for an embedded ".".
4567         (PartialContainer.CreatePart): Update to changes in RootContext.
4568         (MemberBase.ShortName): Turn into a property.  Use
4569         MemberCore.SetMemberName.
4570         (MemberBase.ExplicitInterfaceName): Remove.
4571         (MemberBase.UpdateMemberName): Remove.
4572         (AbstractPropertyEventMethod.UpdateName): Use SetMemberName.
4573         (PropertyBase.SetMemberName): New override.
4574         * tree.cs (Tree.RecordDecl): Take a MemberName and use it as hash key.
4575         (Tree.GetDecl): New.
4576         (Tree.AllDecls): Rename from Decls.
4577         * attribute.cs, enum.cs, report.cs: Update to changes.
4578         * driver.cs (MainDriver): Use MemberName.FromDotted on
4579         RootContext.MainClass.
4580
4581 2005-03-21  Marek Safar  <marek.safar@seznam.cz>
4582
4583         * class.cs (FixedField.Define): Check for CS1664 and more sanity
4584         checks.
4585
4586         * expression.cs (ElementAccess.DoResolveLValue): Check for CS1708.
4587
4588 2005-03-18  Marek Safar  <marek.safar@seznam.cz>
4589
4590         * modifiers.cs (Modifiers.PROPERTY_CUSTOM): New constant for
4591         property accessor modifiers.
4592
4593         * class.cs (FieldMember.ApplyAttributeBuilder): Don't allow apply
4594         fixed buffer attribute (CS1716).
4595         (PropertyMethod.HasCustomAccessModifier): When property accessor
4596         has custom modifier.
4597
4598         * ecore (PropertyExpr.DoResolve): Add CS0271 for custom accessor
4599         modifiers.
4600         (PropertyExpr.DoResolveLValue): Add CS0272.
4601
4602 2005-03-17  Miguel de Icaza  <miguel@novell.com>
4603
4604         * convert.cs: When converting to a pointer, use the proper Conv.U
4605         or Conv.I depending on the source data type.
4606
4607         * cs-tokenizer.cs: Make the size for large decimal constants,
4608         fixes #72957.
4609
4610 2005-03-17  Martin Baulig  <martin@ximian.com>
4611
4612         * anonymous.cs (AnonymousMethod.method_modifiers): Change default
4613         from `Modifiers.INTERNAL' to `Modifiers.PRIVATE'.  Fixes #73260.
4614
4615 2005-03-17  Martin Baulig  <martin@ximian.com>
4616
4617         * anonymous.cs (AnonymousMethod.EmitMethod): Changed return type
4618         to bool so we can return an error condition.
4619         (AnonymousDelegate.Emit): Check whether AnonymousMethod.EmitMethod()
4620         returned an error.
4621
4622 2005-03-16  Zoltan Varga  <vargaz@freemail.hu>
4623
4624         * attribute.cs: Encode ThrowOnUnmappableChar and BestFitMapping
4625         attributes.
4626
4627 2005-03-16  Raja R Harinath  <rharinath@novell.com>
4628
4629         Remove TypeManager.LookupType and TypeManager.LookupTypeDirect.
4630         Refactor to avoid traversing the list of assemblies, and to avoid
4631         string concatenation.
4632         * typemanager.cs (guid_attr_type): Remove.
4633         (negative_hits, pointers, references): Remove hashes.
4634         (type_hash): New.
4635         (GetConstructedType): New.  Uses type_hash to handle constructed
4636         types (arrays, references, pointers).
4637         (GetReferenceType, GetPointerType): Use it.
4638         (GetNestedType): New.  Uses type_hash to handle nested types of
4639         reflected types.
4640         (LookupType, LookupTypeDirect): Remove.
4641         (CoreLookupType): Inline parts of old LookupTypeDirect code.  Use
4642         'types' hash and LookupTypeReflection directly.
4643         (params_string, params_object): Use GetConstructedType.
4644         * namespace.cs (Namespace.cached_types): New.  Cache of reflected
4645         top-level types.
4646         (Namespace.Lookup): Use cached_types.
4647         (NamespaceEntry.LookupNamespaceOrType): Inline the functionality
4648         provided by old TypeManager.LookupType.
4649         * rootcontext.cs (MakeFQN): Remove.
4650         * decl.cs (DeclSpace.MakeFQN): Likewise.
4651         (DeclSpace.LookupType): Use TypeManager.GetNestedType.
4652         * expression.cs (ComposedCast.DoResolveAsTypeStep): Use
4653         TypeManager.GetConstructedType.
4654         * tree.cs (decl_ns_hash, LookupByNamespace): Remove.
4655
4656 2005-03-15  Marek Safar  <marek.safar@seznam.cz>
4657
4658         * class.cs (MethodCore.CheckBase): Report CS1715 for properties and
4659         indexers.
4660
4661         * cs-parser.jay: Reports CS1527 for any namespace element.
4662
4663         * delegate.cs (DelegateCreation.Error_NoMatchingMethodForDelegate):
4664         Added CS0407.
4665
4666         * expression.cs (ParameterReference.IsAssigned): Changed error to
4667         CS0269.
4668         (Error_WrongNumArguments): Moved CS0245 detection here.
4669
4670         * statement.cs (Return.Resolve): Add CS1622 report.
4671
4672 2005-03-11  Marek Safar  <marek.safar@seznam.cz>
4673
4674         * class.cs (StaticClass.DefineContainerMembers): Added CS0720.
4675
4676 2005-03-11  Zoltan Varga  <vargaz@freemail.hu>
4677
4678         * attribute.cs expression.cs: Get rid of some allocations.
4679
4680 2004-03-11  Atsushi Enomoto  <atsushi@ximian.com>
4681
4682         * doc.cs : just eliminate the latest change.
4683
4684 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4685
4686         * doc.cs : commented out the latest change. It breaks xml-030.cs
4687
4688 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4689
4690         * doc.cs : When TypeBuilder did not create Type yet, GetEvents() will
4691           fail. So invoke CreateType() in FindDocumentedType().
4692
4693 2004-03-10  Atsushi Enomoto  <atsushi@ximian.com>
4694
4695         * cs-tokenizer.cs : added IsKeyword().
4696         * doc.cs : Detect keyword incorrectly used as identifier.
4697           Allow identifiers prefixed by @.
4698
4699 2005-03-10  Marek Safar  <marek.safar@seznam.cz>
4700
4701         * attributes.cs (Attributes.Emit): Continue after CheckTargets.
4702         It caused exception in namespace resolving (again!).
4703         
4704         * class.cs (Class.ctor): Removed exit.
4705         (PropertyMethod.ctor): ditto.
4706         
4707         * codegen.cs (Codegen.Reset): Reset static data.
4708         (Codegen.ResolveTopBlock): Forward error status from ResolveMeta.
4709         
4710         * cs-tokenizer.cs (Cleanup): Removed.
4711         
4712         * driver.cs (GetSystemDir): Rewrote to one line command.
4713         It caused problem with unloaded dynamic modules.
4714         (UnixParseOption): Removed Exit.
4715         (CompilerCallableEntryPoint.InvokeCompiler): Make static.
4716         (CompilerCallableEntryPoint.Reset): Reset suitable static data.
4717         Now can be mcs used as library.
4718         
4719         * ecore.cs (Expression.ResolveBoolean): Use Location.Null for
4720         empty location.
4721         
4722         * location.cs (Reset): Reset static data.
4723         
4724         * namespace.cs (Reset): Reset static data.
4725         
4726         * report.cs (Report.Reset): Reset static data.
4727         
4728         * rootcontext.cs (RootContext.Reset): Reset static data.
4729         
4730         * tree.cs (RootTypes.ctor): Use Location.Null
4731         
4732         * typemanager.cs (TypeManager.Reset): Reset static data.
4733         (CoreLookupType): Removed Exit.
4734         (TypeHandle.Reset): Reset static data.
4735         
4736 2005-03-10  Raja R Harinath  <rharinath@novell.com>
4737
4738         Fix #73516.
4739         * typemanager.cs (ComputeNamespaces): Import namespaces from
4740         referenced modules too.
4741
4742 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4743
4744         * class.cs (TypeContainer.AddToMemberContainer): Use "." rather
4745         than '.'.
4746
4747 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4748
4749         * decl.cs (DeclSpace.LookupType): Don't loop but recurse into
4750         enclosing DeclSpace.  This ensures that a name-lookup populates
4751         more caches and there are fewer 'TypeExpression's.  Carve out
4752         nested type lookup into ...
4753         (LookupNestedTypeInHierarchy): ... this.
4754
4755 2005-03-09  Raja R Harinath  <rharinath@novell.com>
4756
4757         Clean up a few partial-class semantics.  
4758         Fixes test-357.cs and cs1618-2.cs.
4759         * cs-parser.jay (struct_declaration): Use 'current_class' as
4760         parent of newly-created struct.  Remove call to Register ().
4761         Use 'pop_current_class' to complete handing the current struct.
4762         (interface_declaration): Likewise.
4763         (class_declaration): Likewise.
4764         (enum_declaration): Use 'current_class' as parent of newly created
4765         enum.
4766         (delegate_declaration): Likewise.
4767         (pop_current_class): New function.  This is used to handle closing
4768         up the 'current_class' and 'current_container', and pointing them
4769         to the enclosing class/container.
4770         (CSharpParser): Initialize 'current_class' too.
4771         * decl.cs (MemberCore): Add check for invariant: a partial
4772         container is not a parsed entity, and thus does not enclose any
4773         parsed members.
4774         (DeclSpace.TypeResolveEmitContext): Expose 'type_resolve_ec'.
4775         (DeclSpace.BaseTypeExpr): Use it.
4776         (DeclSpace.LookupType): Add check for invariant.
4777         * class.cs (TypeContainer): Add check for invariant: a nested
4778         class should have the same NamespaceEntry as its enclosing class.
4779         (TypeContainer.EmitFieldInitializers): Make virtual.
4780         (TypeContainer.DefineDefaultConstructor): Adhere to invariant in
4781         MemberCore.
4782         (TypeContainer.Register): Remove.
4783         (TypeContainer.DefineType): Set the 'ec' of a PartialContainer to
4784         null.  Use TypeResolveEmitContext for resolving base types and
4785         interfaces.  Move initialization of Parts.TypeBuilder here from
4786         ...
4787         (TypeContainer.DefineNestedTypes): ... here.
4788         (PartialContainer): Take a Namespace not a NamespaceEntry.
4789         (PartialContainer.Create): Don't use Register.  Call the
4790         appropriate Add... function directly.
4791         (ClassPart): Take both the PartialContainer and the enclosing
4792         class as constructor arguments.
4793         (ClassPart.EmitFieldInitializers): Override.
4794         (ClassPart.PartFindNestedTypes): Remove.
4795         (FieldBase.GetInitializerExpression): Resolve the initializer
4796         expression in the emit context of the enclosing class.
4797         * tree.cs (RootTypes): Remove Register ().
4798         
4799 2005-03-08  Marek Safar  <marek.safar@seznam.cz>
4800
4801         * cs-parser.jay: Removed CS0134.
4802         
4803         * driver.cs: Removed CS1901.
4804         
4805         * expression.cs (SizeOf.DoResolve): Don't report CS0233
4806         for predefined types.
4807
4808 2005-03-07  Duncan Mak  <duncan@novell.com>
4809
4810         * codegen.cs (Save):  Catch UnauthorizedAccessException as
4811         well. Fixes bug #73454.
4812
4813 2005-03-07  Marek Safar  <marek.safar@seznam.cz>
4814
4815         * cs-tokenizer.cs (xtoken): Add CS1035.
4816         
4817         * class.cs (MethodData.Define): Add CS0683.
4818         (FieldMember.ctor): Add CS0681.
4819
4820 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4821
4822         * ecore.cs (SimpleName.DoResolve): Rename from
4823         SimpleName.DoResolveAllowStatic.
4824         (SimpleName.DoSimpleNameResolve): Remove 'allow_static' argument.
4825         Pass 'intermediate' flag to MemberStaticCheck.
4826         (SimpleName.MemberStaticCheck): Skip "static check" only in case
4827         of "intermediate" lookups via MemberAccess.
4828         (SimpleName.IdenticalNameAndTypeName): New.  Carved out of ...
4829         * expression.cs (MemberAccess.IdenticalNameAndTypeName): ... this.
4830
4831 2005-03-07  Raja R Harinath  <rharinath@novell.com>
4832
4833         Fix #73394.
4834         * ecore.cs (FieldExpr.EmitInstance): Catch cases of CS0120 that
4835         slipped in because of variable names that are identical to a
4836         builtin type's BCL equivalent ('string String;', 'int Int32;').
4837         (PropertyExpr.EmitInstance): Likewise.
4838
4839 2005-03-04  Marek Safar  <marek.safar@seznam.cz>
4840
4841         * cs-tokenizer.cs (PreProcessPragma): Add warning 1633, 1635.
4842         
4843         * report.cs (warning_ignore_table): Made public.
4844
4845 2005-03-04  Raja R Harinath  <rharinath@novell.com>
4846
4847         Fix #73282.
4848         * class.cs (MethodData.Emit): Pass 'container' to
4849         container.GetObsoleteAttribute instead of 'container.Parent'.
4850
4851 2005-03-03  Marek Safar  <marek.safar@seznam.cz>
4852
4853         * cs-parser.jay: Add 1534 error test.
4854
4855         * iterators.cs (Yield.CheckContext): Add error 1629.
4856         (Iterator.ctor): Save unsafe modifier.
4857         (MoveNextMethod.DoEmit): Restore unsafe context.
4858
4859         * namespace.cs (UsingAlias): Better error message.
4860
4861 2005-03-03  Dan Winship  <danw@novell.com>
4862
4863         * convert.cs (Error_CannotImplicitConversion): fix two bugs in
4864         the warning message [#73219]
4865
4866 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4867
4868         Fix compile with MCS 1.0.0.0.
4869         * cs-tokenizer.cs (PreProcessPragma): Simplify w_disable and
4870         w_restore to not depend on string constant folding.
4871
4872 2005-03-03  Raja R Harinath  <rharinath@novell.com>
4873
4874         * decl.cs (DeclSpace.LookupType): Remove 'silent' argument.  Move
4875         CS0246 check to users who passed 'silent = false'.
4876         * ecore.cs (TypeLookupExpression.DoResolveAsTypeStep): Add CS0246
4877         check.
4878         (SimpleName.SimpleNameResolve): Update.
4879         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add CS0246 check.
4880         (MemberAccess.IdenticalNameAndTypeName): Update.
4881         * doc.cs (FindDocumentedTypeNonArray): Update.
4882
4883 2005-03-03  Raja R Harinath  <rharinath@novell.com>     
4884
4885         * codegen.cs (EmitContext): Remove ResolvingTypeTree.
4886         * parameters.cs (ComputeAndDefineParameters): Remove.
4887         * decl.cs (ResolveBaseTypeExpr): Don't set ResolvingTypeTree.
4888         * delegate.cs (Define): Don't invoke ComputeAndDefineParameters.
4889         Use GetParameterInfo.
4890
4891 2005-03-02  Marek Safar  <marek.safar@seznam.cz>
4892
4893         * report.cs (StaticClass.DefineContainerMembers): Add warning 628.
4894
4895 2005-03-02  Raja R Harinath  <rharinath@novell.com>
4896
4897         Unify DeclSpace.LookupType and DeclSpace.FindType.
4898         * decl.cs (DeclSpace.FindNestedType): New virtual function.  This
4899         is in charge of defining nested types on demand.
4900         (DeclSpace.LookupType): Use it when the current_type is a
4901         TypeBuilder.  Use LookupTypeDirect for reflected types.
4902         (DeclSpace.FindType): Remove.
4903         (DeclSpace.LookupInterfaceOrClass): Likewise.
4904         (DeclSpace.DefineTypeAndParents): Likewise.
4905         * ecore.cs (SimpleName.ResolveAsTypeStep): Just call
4906         DeclSpace.LookupType.
4907         * doc.cs (FindDocumentedTypeNonArray): Use DeclSpace.LookupType.
4908         * typemanager.cs (LookupType): Simplify.
4909         (AddUserType): Remove type from negative_hits.
4910         * namespace.cs (Namespace.Lookup): Use TypeManager.LookupTypeDirect.
4911         * class.cs (TypeContainer.FindMembers): Move handling of nested
4912         types ...
4913         (TypeContainer.FindMembers_NestedTypes): ... here.
4914         (TypeContainer.FindNestedType): Implement override.
4915         (ClassPart.FindNestedType): Delegate to PartialContainer.
4916         (ClassPart.PartFindNestedType): Looks up the nested types of the
4917         part alone.
4918
4919 2005-03-02  Martin Baulig  <martin@ximian.com>
4920
4921         * class.cs (TypeContainer.DoDefineMembers): We also need a default
4922         static constructor in static classes.
4923
4924 2005-03-01  Zoltan Varga  <vargaz@freemail.hu>
4925
4926         * attribute.cs: Pass -1 to DefineLPArrayInternal if sizeConst or
4927         sizeParamIndex is not specified.
4928
4929 2005-03-01  Marek Safar  <marek.safar@seznam.cz>
4930
4931         Fix #73117
4932         * report.cs (WarningMessage.IsEnabled): Missing null check.
4933
4934 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4935
4936         * attribute.cs (DefinePInvokeMethod): Fix, all data are stored
4937         in the fields and not in the properties.
4938
4939 2005-02-28  Zoltan Varga  <vargaz@freemail.hu>
4940
4941         * attribute.cs (GetMarshal): Marshal SizeConst and SizeParamIndex 
4942         fields as well.
4943
4944 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4945
4946         * attribute.cs: Small refactoring (improved robustness).
4947         (ImplOptions, UnmanagedType, UsageAttribute): Removed members.
4948         (ValidateGuid): Removed.
4949         (Resolve): Removed referenced to above mentioned.
4950         (GetAttributeUsage): Made private and changed to work without
4951         class assistance.
4952         (GetIndexerAttributeValue): Don't crash.
4953         (GetConditionalAttributeValue): Ditto.
4954         (GetClsCompliantAttributeValue): Ditto.
4955         (ExtractSecurityPermissionSet): All attributes exceptions are
4956         error 648.
4957         (GetPropertyValue): New helper.
4958         (GetMethodImplOptions): New method.
4959         (DefinePInvokeMethod): Reuse common code. Implemented handling of
4960         some missing properties.
4961         
4962         * class.cs (ClassOrStruct.ApplyAttributeBuilder): Updated.
4963         (Method.ApplyAttributeBuilder): Updated.
4964         
4965         * decl.cs (DeclSpace.ApplyAttributeBuilder): Don't catch shared
4966         exception.
4967
4968 2005-02-28  Raja R Harinath  <rharinath@novell.com>
4969
4970         Fix #73052.
4971         * report.cs (Report.SymbolRelatedToPreviousError): Handle
4972         non-simple types (array, pointer, reference).
4973
4974 2005-02-28  Marek Safar  <marek.safar@seznam.cz>
4975
4976         * cs-parser.jay: Add errors 1617, 650, 1007, 531, 547, 548
4977
4978         * class.cs (MethodCore.IsDuplicateImplementation): Special error
4979         for operators.
4980         (Method.CheckBase): Catch wrong destructor here.
4981         (MethodData.Define): Add errors 550, 668.
4982
4983         * cs-tokenizer.cs (PreProcessPragma): Add warning 1634.
4984
4985         * ecore.cs (PropertyExpr.DoResolveLValue): Fixed wrong error code.
4986
4987         * pending.cs (VerifyPendingMethods): Add error 551.
4988
4989         * typemanager.cs (CSharpName): Next error report helper.
4990
4991 2005-02-25  Marek Safar  <marek.safar@seznam.cz>
4992
4993         * attribute.cs (Atttribute.Resolve): Add cache for parameter-less
4994         attributes. Removed useless attribute double check.
4995         It saves almost 2MBs for corlib.
4996
4997 2005-02-25  Raja R Harinath  <rharinath@novell.com>
4998
4999         Fix #72924.
5000         * statement.cs (ExpressionStatement.Resolve): Make robust to being
5001         called twice in case of error.
5002
5003 2005-02-23  Chris Toshok  <toshok@ximian.com>
5004
5005         Fix compiler portions of #72827.
5006         * statement.cs (Block.Emit): call Begin/EndScope on the
5007         EmitContext instead of the ILGenerator.
5008
5009         * codegen.cs (EmitContext.BeginScope): new method, call
5010         ILGenerator.BeginScope as well as the SymbolWriter's OpenScope (if
5011         we have one.)
5012         (EmitContext.BeginScope): same, but EndScope and CloseScope
5013
5014         * symbolwriter.cs (SymbolWriter.OpenScope): get the current il
5015         offset and call the superclass's OpenScope(int) with it.
5016         (SymbolWriter.CloseScope): get the current il
5017         offset and call superclass's CloseScope(int) with it.
5018
5019 2005-02-23  Marek Safar  <marek.safar@seznam.cz>
5020
5021         * anonymous.cs (AnonymousMethod.Compatible): Fixed to report
5022         CS1677 for out and ref as well.
5023
5024         * class.cs (Method.Define): Add error CS1599 detection.
5025         
5026         * cs-parser.jay: Add CS1609, CS1670, CS1627 detection.
5027         
5028         * cs-tokenizer.cs (xtoken): Add error CS1646 detection.
5029         
5030         * delegate.cs (Delegate.Define): Add error CS1599 detection.
5031         
5032         * support.cs.cs (ModifierDesc): New helper method.
5033
5034 2005-02-23  Raja R Harinath  <rharinath@novell.com>
5035             Abin Thomas  <projectmonokochi@rediffmail.com>
5036             Anoob V E  <projectmonokochi@rediffmail.com>
5037             Harilal P R  <projectmonokochi@rediffmail.com>
5038
5039         Fix #57851, #72718.
5040         * class.cs (ConstructorBuilder.Resolve): Make sure that the second
5041         MemberLookup (used for error reporting) actually returns a result.
5042         Fix error report number (122, not 112).
5043
5044 2005-02-22  Abin Thomas  <projectmonokochi@rediffmail.com>
5045             Anoob V E  <projectmonokochi@rediffmail.com>
5046             Harilal P R  <projectmonokochi@rediffmail.com>
5047
5048         Fix #71134.
5049         * pending.cs (PendingImplementation.GetAbstractMethods):
5050         Find NonPublic members too.
5051
5052 2005-02-22  Marek Safar  <marek.safar@seznam.cz>
5053
5054         * expression.cs.cs (ConditionalLogicalOperator.DoResolve):
5055         Fixed error 217.
5056         
5057         * class.cs (MethodCore.CheckMethodAgainstBase):
5058         Add error 239 report.
5059
5060 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5061
5062         Fix #68955.
5063         * expression.cs (Invocation.IsApplicable): Make public.
5064         (Invocation.IsParamsMethodApplicable): Likewise.
5065         * delegate.cs (Delegate.VerifyApplicability): Don't use
5066         Invocation.VerifyArgumentCompat for parameter applicability
5067         testing.  Use Invocation.IsApplicable and
5068         Invocation.IsParamsMethodApplicable.
5069
5070 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5071
5072         * ecore.cs (PropertyExpr.DoResolve): Add error 214 report.
5073         
5074         * class.cs (Operator.Define): Add error 217 report.
5075         
5076 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5077
5078         * namespace.cs (UsingEntry.Resolve): Undo change below.
5079
5080 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5081
5082         Fix #72756.
5083         * ecore.cs (Expression.MemberLookupFailed): Add argument to
5084         disable the error message when the extended MemberLookup also
5085         fails.
5086         (Expression.MemberLookupFinal): Update.
5087         (SimpleName.DoSimpleNameResolve): Update.
5088         * expression.cs (MemberAccess.ResolveNamespaceOrType):
5089         Don't use MemberLookupFinal.
5090         (New.DoResolve): Update.
5091         (BaseAccess.CommonResolve): Update.
5092
5093 2005-02-21  Raja R Harinath  <rharinath@novell.com>
5094
5095         Fix #72732.
5096         * attribute.cs (Attribute.ResolveType): If a 'resolve_error' had
5097         occured previously, don't resolve again.
5098
5099 2005-02-21  Marek Safar  <marek.safar@seznam.cz>
5100
5101         Fix #69949
5102         * attribute.cs (Attribute.GetAttributeUsage): Add EmitContext
5103         argument. Call ResolveAttributeUsage for unresolved.
5104         when types doesn't match ctor arguments.
5105         
5106         * class.cs (DoDefineMembers.TypeContainer): Removed safety check
5107         for nested attribute classes.
5108         (Class.attribute_usage): Removed.
5109         (Class.ResolveAttributeUsage): Resolves AttributeUsageAttribute
5110         for attribute class.
5111         
5112         * ecore.cs (IsAttribute): Removed.
5113         
5114         * namespace.cs (UsingEntry.Resolve): Don't destroy NamespaceEntry.
5115         
5116         * rootcontext.cs (RegisterAttribute): Removed, attributes are
5117         now normal types.
5118         (attribute_types): Removed.
5119         (EmitCode): Global attributes are emited as the latest.
5120
5121 2005-02-18  Marek Safar  <marek.safar@seznam.cz>
5122
5123         * class.cs (EmitFieldInitializers): Don't emit field initializer
5124         for default values when optimilization is on.
5125         
5126         * constant.cs (Constant.IsDefaultValue): New property.
5127         
5128         * driver.cs: Add /optimize handling.
5129         
5130         * constant.cs,
5131         * ecore.cs,
5132         * literal.cs: Implement new IsDefaultValue property.
5133         
5134         * rootcontext.cs (Optimize): New field, holds /optimize option.
5135
5136 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5137
5138         Fix crasher in re-opened #72347.
5139         * namespace.cs (Namespace.Lookup): Return null if
5140         DeclSpace.DefineType returns null.
5141
5142         Fix #72678.
5143         * expression.cs (Argument.Resolve): Handle a case of CS0120 here.
5144
5145 2005-02-18  Raja R Harinath  <rharinath@novell.com>
5146
5147         Fix remainder of #63202.  Change semantics of DoResolveLValue: it
5148         now returns null if it cannot resolve to an lvalue.
5149         * ecore.cs (Expression.DoResolveLValue): Return 'null' by default.
5150         (Expression.ResolveLValue): Emit CS0131 error if DoResolveLValue
5151         returned null.  Remove check for SimpleName.
5152         (EventExpr.DoResolveLValue): New.
5153         * iterators.cs (Iterator.FieldExpression.DoResolveLValue): New.
5154         * expression.cs (Argument.Error_LValueRequired): New.  Move CS1510
5155         error from ...
5156         (Argument.Resolve): ... here.  Use it.  Use DoResolveLValue to
5157         avoid CS0131 error.
5158         (Unary.ResolveOperator): Move CS0211 check ...
5159         (Unary.DoResolve): ... here.  Use DoResolveLValue to avoid
5160         CS0131 error.
5161         (Unary.DoResolveLValue): Simplify.
5162         (AddressOf.DoResolveLValue): New.
5163         (ArrayAccess.DoResolveLValue): New.
5164
5165 2005-02-16  Marek Safar  <marek.safar@seznam.cz>
5166
5167         * attribute.cs (Attribute.Resolve): Add arguments casting for
5168         when types doesn't match ctor arguments.
5169
5170 2005-02-16  Raja R Harinath  <rharinath@novell.com>
5171
5172         Fix parts of #63202.
5173         * expression.cs (UnaryMutator.ResolveOperator): Remove redundant
5174         lookup of operator in base type.  Ensure that all checks happen
5175         when the operator resolves to an "op_..." method.
5176
5177 2005-02-15  Raja R Harinath  <rharinath@novell.com>
5178
5179         Fix #71992.
5180         * namespace.cs (NamespaceEntry.LookupNamespaceOrType): Add
5181         'ignore_cs0104' parameter.  Pass it to ...
5182         (NamespaceEntry.Lookup): ... this.
5183         * decl.cs (DeclSpace.LookupType): Add 'ignore_cs0104' parameter.
5184         * ecore.cs (SimpleName.ResolveAsTypeStep): Update.
5185         (TypeLookupExpression.DoResolveAsTypeStep): Update.
5186         * expression.cs (MemberAccess.IdenticalNameAndTypeName):
5187         Update.  Request that cs0104 errors be ignored.
5188         (ComposedCast.ResolveAsTypeStep): Update.
5189
5190 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5191
5192         Fix #59209.
5193         * expression.cs (Invocation.BetterFunction): Remove support for
5194         comparing virtual functions and their overrides.
5195         (Invocation.IsOverride): New.
5196         (Invocation.OverloadResolve): Don't consider 'override' functions
5197         during candidate selection.  Store them in a lookaside list.
5198         If the selected method is a 'virtual' function, use the list to
5199         find any overrides that are closer to the LHS type.
5200
5201 2005-02-14  Marek Safar  <marek.safar@seznam.cz>
5202
5203         * expression.cs (New.DoResolve): Add complex core type reduction.
5204         (New.Constantify): Converts complex core type syntax like 'new int ()'
5205         to simple constant.
5206         
5207 2005-02-14  Raja R Harinath  <rharinath@novell.com>
5208
5209         * decl.cs (EntryType.EntryType): New constructor to create an
5210         updated copy of a cache entry.
5211         (MemberCache.AddMethods): Use it.
5212         (MemberCache.ClearDeclaredOnly): Remove.
5213         (MemberCache.MemberCache): Update.
5214
5215 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5216
5217         * codegen.cs (EmitContext): Introduce the `MethodIsStatic'
5218         variable.  This one is represents the actual low-level declaration
5219         of the method, as opposed to the semantic level `IsStatic'.   
5220
5221         An anonymous method which is hosted into a static method might be
5222         actually an instance method.  IsStatic would reflect the
5223         container, while MethodIsStatic represents the actual code
5224         generated.
5225
5226         * expression.cs (ParameterReference): Use the new MethodIsStatic
5227         instead of IsStatic.
5228
5229         * anonymous.cs (AnonymousMethod.Compatible): Pass the
5230         Modifiers.STATIC to the Anonymous' Method EmitContext if static is
5231         set on the current EmitContext. 
5232
5233         * expression.cs (Cast): Overload DoResolveLValue so we can pass
5234         resolve our casted expression as an LValue.  This triggers the
5235         proper LValue processing that is later required by Assign.
5236
5237         This fixes 72347.
5238
5239         * cs-tokenizer.cs (pp_and): recurse on pp_and, fixes #61903.
5240
5241 2005-02-11  Marek Safar  <marek.safar@seznam.cz>
5242
5243         C# 2.0 Fixed buffer implementation
5244
5245         * anonymous.cs: Update after RegisterHelperClass renaming.
5246
5247         * attribute.cs (AttributeTester.fixed_buffer_cache):
5248         Cache of external fixed buffers.
5249         (AttributeTester.GetFixedBuffer): Returns IFixedBuffer
5250         implementation if field is fixed buffer else null.
5251
5252         * class.cs
5253         (TypeContainer.AddField): Accept FieldMember instead of Field.
5254         (FieldBase.IsFieldClsCompliant): Extracted code from
5255         VerifyClsCompliance descendant customization.
5256         (FixedField): New class handles fixed buffer fields.
5257         (FixedFieldExternal): Keeps information about imported fixed
5258         buffer.
5259         (IFixedField): Make access to internal or external fixed buffer
5260         same.
5261
5262         * cs-parser.jay: Add fixed buffer parsing.
5263
5264         * ecore.cs (FieldExpr.Emit): Add special emit case for fixed
5265         buffer.
5266
5267         * expression.cs (Indirection): Extended implementation to accept
5268         fixed buffer field.
5269         (PointerArithmetic.Emit): Get element from fixed buffer as well.
5270         (ElementAccess.MakePointerAccess): Get type as parameter.
5271         (DoResolve): Add fixed buffer field expression conversion.
5272         (DoResolveLValue): Ditto.
5273         (FixedBufferPtr): New class. Moved most of original ArrayPtr.
5274         (ArrayPtr): Derives from FixedBufferPtr.
5275         (ArrayPtr.Emit): Add extra emit for array elements.
5276
5277         * flowanalysis.cs.cs (StructInfo): Use FieldMember.
5278
5279         * rootcontext.cs (CloseTypes): Emit CompilerGenerated attribute
5280         for compiler generated types.
5281         (RegisterCompilerGeneratedType): Renamed from RegisterHelperClass.
5282
5283         * statement.cs (Fixed): Refactored to be easier add fixed buffer
5284         and consume less memory.
5285         (Fixed.Resolve): Add fixed buffer case.
5286
5287         * typemanager.cs (compiler_generated_attr_ctor,
5288         fixed_buffer_attr_ctor): Add new 2.0 compiler attributes.
5289         (HasElementType): Add our own implementation to work on every
5290         runtime.
5291
5292 2005-02-11  Miguel de Icaza  <miguel@novell.com>
5293
5294         * anonymous.cs (CaptureContext): Track whether `this' has been
5295         referenced.   
5296
5297         * expression.cs (This.ResolveBase): Call CaptureThis.  Before we
5298         only captured `this' if it was implicitly done (instance
5299         methods/variables were used). 
5300
5301         * codegen.cs (EmitContext.CaptureThis): New method to flag that
5302         `this' must be captured.
5303
5304 2005-01-30  Miguel de Icaza  <miguel@novell.com>
5305  
5306         * anonymous.cs (CreateMethodHost): If there Scope.ScopeTypeBuilder
5307         is null it means that there has been no need to capture anything,
5308         so we just create a sibling.
5309
5310         Renamed `EmitHelperClasses' to `EmitAnonymousHelperClasses'
5311
5312         Just a partial fix.  The other half is fairly elusive.
5313         
5314 2005-02-10  Raja R Harinath  <rharinath@novell.com>
5315
5316         Fix #52586, cs0121-4.cs.
5317         * decl.cs (MemberCache.DeepCopy): Rename from SetupCache.  Take
5318         and return a hashtable.
5319         (MemberCache.ClearDeclaredOnly): New.
5320         (MemberCache.MemberCache): Update to change.  Make a deep copy of
5321         the method_hash of a base type too.
5322         (MemberCache.AddMethods): Adapt to having a deep copy of the base
5323         type methods.  Overwrite entries with the same MethodHandle so
5324         that the ReflectedType is correct.  The process leaves in base
5325         virtual functions and their overrides as distinct entries.
5326         (CacheEntry): Now a class instead of a struct.  It shouldn't alter
5327         matters since it was boxed in a ArrayList before.
5328         (CacheEntry.Member, CacheEntry.EntryType): Remove 'readonly'
5329         modifier.
5330         * expression.cs (Invocation.BetterFunction): Simplify.  Handle the
5331         case of a virtual function and its override (choose the overload
5332         as better).
5333         (Invocation.OverloadResolve): Avoid 'override' members during
5334         'applicable_type' calculation.
5335
5336 2005-02-09  Raja R Harinath  <rharinath@novell.com>
5337
5338         Combine two near-redundant caches.
5339         * typemanager.cs (method_params): Rename from method_internal_params.
5340         (TypeManager.GetParameterData): New.  Replace
5341         Invocation.GetParameterData.
5342         (TypeManager.LookupParametersByBuilder): Remove.
5343         * expression.cs (Invocation.method_parameter_cache): Remove.
5344         (Invocation.GetParameterData): Remove.
5345         Update to changes.
5346         * anonymous.cs, attribute.cs, convert.cs, delegate.cs:
5347         Update to changes.
5348
5349 2005-02-08  Raja R Harinath  <rharinath@novell.com>
5350
5351         Fix #72015.
5352         * delegate.cs (Delegate.DefineType): When bootstrapping corlib, if
5353         TypeManager.multicast_delegate_type is null, resolve it by looking
5354         up "System.MulticastDelegate".
5355         * rootcontext.cs (RootContext.ResolveCore): Simplify.
5356
5357 2005-02-07  Abin Thomas (NOSIP)  <projectmonokochi@rediffmail.com>
5358             Anoob V.E (NOSIP)  <projectmonokochi@rediffmail.com>
5359             Harilal P.R (NOSIP)  <projectmonokochi@rediffmail.com>
5360
5361         Fix cs0164.cs.
5362         * statement.cs (LabeledStatement.Resolve): Don't set 'referenced'.
5363         (LabeledStatement.AddReference): New.  Set 'referenced'.
5364         (Goto.Resolve): Use it.
5365
5366 2005-02-05  John Luke  <john.luke@gmail.com>
5367
5368         * driver.cs: remove duplicate -doc line in Usage ()
5369
5370 2005-02-04  Raja R Harinath  <rharinath@novell.com>
5371
5372         * location.cs (Location.AddFile): Fix CS2002 error report.
5373
5374 2005-02-02  Martin Baulig  <martin@ximian.com>
5375
5376         * delegate.cs (Delegate.DefineType): Report an internal error if
5377         TypeManager.multicast_delegate_type is null.  See bug #72015 for
5378         details.        
5379
5380 2005-02-02  Raja R Harinath  <rharinath@novell.com>
5381
5382         Fix a crasher in a variant of #31984.
5383         * const.cs (Constant.CheckBase): New override that defers the
5384         new-or-override check in case the base type hasn't been populated
5385         yet.
5386         (Constant.Define): Ensure the new-or-override check is performed.
5387
5388 2005-02-01  Duncan Mak  <duncan@ximian.com>
5389
5390         * const.cs (LookupConstantValue): Check that `ce' is not null
5391         before calling GetValue ().
5392
5393 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5394
5395         Fix test-334.cs (#69519).
5396         * cs-parser.jay (using_alias_directive): Pass in an expression to
5397         NamespaceEntry.UsingAlias.
5398         (using_namespace_directive): Pass in an expression to
5399         NamespaceEntry.Using.
5400         (namespace_name): Don't flatten to a string.
5401         * namespace.cs (NamespaceEntry.AliasEntry): Store an expression.
5402         (NamespaceEntry.AliasEntry.Resolve): Lookup using
5403         ResolveAsTypeStep.
5404         (NamespaceEntry.UsingEntry): Likewise.
5405         (NamespaceEntry.Using,NamespaceEntry.UsingAlias): Update to
5406         changes.
5407         (NamespaceEntry.LookupForUsing): Remove.
5408         (NamespaceEntry.LookupNamespaceOrType): Add support for dotted
5409         names.
5410         (NamespaceEntry.Lookup): Remove support for dotted names.
5411
5412 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5413
5414         * namespace.cs (NamespaceEntry.NamespaceEntry): Simplify, and
5415         split into two.
5416         (NamespaceEntry.ImplicitParent): Compute on demand.
5417         (NamespaceEntry.Doppelganger): New implicit namespace-entry that
5418         parallels the current.
5419         (NamespaceEntry.LookupForUsing): Use it.
5420         (NamespaceEntry.Lookup): If the current namespace-entry is
5421         implicit, don't search aliases and using tables.
5422
5423 2005-02-01  Raja R Harinath  <rharinath@novell.com>
5424
5425         Fix #31984.
5426         * class.cs (TypeContainer.DoDefineMembers): Don't initialize
5427         BaseCache here.
5428         (TypeContainer.BaseCache): Compute on demand.
5429         (TypeContainer.FindMembers): Define constants and types if they're
5430         not already created.
5431         (FieldMember.Define): Move resetting of ec.InUnsafe before error
5432         check.
5433         * const.cs (Constant.Define): Make idempotent.
5434
5435 2005-01-29  Miguel de Icaza  <miguel@novell.com>
5436
5437         * pending.cs: Produce better code (no nops produced by using Ldarg
5438         + value).
5439         
5440         * pending.cs (PendingImplementation.DefineProxy): It was not `arg
5441         i - 1' it should be arg + 1.
5442
5443         Fixes bug #71819.
5444
5445 2005-01-28  Raja R Harinath  <rharinath@novell.com>
5446
5447         * attribute.cs (Attribute.CheckAttributeType): Make private
5448         non-virtual.
5449         (Attribute.ResolveType): Make virtual.
5450         (GlobalAttribute.ResolveType,GlobalAttribute.Resolve): Simplify
5451         handling of RootContext.Tree.Types.
5452
5453 2005-01-27  Raja R Harinath  <rharinath@novell.com>
5454
5455         Update attribute-handling to use the SimpleName/MemberAccess
5456         mechanisms.
5457         * cs-parser.jay (attribute): Pass in an expression to the
5458         constructors of Attribute and GlobalAttribute.
5459         * attribute.cs (Attribute): Take an expression for the name.
5460         (Attribute.ResolvePossibleAttributeTypes): New.  Resolves the
5461         passed in attribute name expression.
5462         (Attribute.CheckAttributeType): Use it.
5463         * ecore.cs (FullNamedExpression.ResolveAsTypeStep): New.
5464         * expression.cs (MemberAccess.ResolveAsTypeStep): Move body to ...
5465         (MemberAccess.ResolveNamespaceOrType): ... here.  Add 'silent'
5466         argument to prevent error messages if the lookup fails.
5467
5468 2005-01-27  Marek Safar  <marek.safar@seznam.cz>
5469
5470         * expression.cs (Indirection): Implemented IVariable interface
5471         to support indirection in AddressOf operator.
5472         (PointerArithmetic.Emit): Add optimalization for case where
5473         result can be precomputed.
5474
5475 2005-01-26  Martin Baulig  <martin@ximian.com>
5476
5477         * class.cs (TypeContainer.AttributeTargets): Return the correct
5478         AttributeTargets depending on our `Kind' instead of throwing an
5479         exception; fixes #71632.
5480
5481 2005-01-26  Marek Safar  <marek.safar@seznam.cz>
5482
5483         Fix #71257
5484         * expression.cs (MemberAccess.ResolveMemberAccess): Add CS0176 test for
5485         constant members.
5486
5487 2005-01-25  Raja R Harinath  <rharinath@novell.com>
5488
5489         Fix #71602.
5490         * expression.cs (MemberAccess.DoResolve): Don't complain with
5491         cs0572 when the LHS of a member access has identical name and type
5492         name.
5493
5494 2005-01-25  Marek Safar  <marek.safar@seznam.cz>
5495
5496         Fix #71651, #71675
5497         * attribute.cs (ExtractSecurityPermissionSet): Catch exceptions from
5498         CreatePermission.
5499         Create custom PermissionSet only for PermissionSetAttribute.
5500
5501 2005-01-24  Marek Safar  <marek.safar@seznam.cz>
5502
5503         Fix #71649
5504         * class.cs (StaticClass.DefineContainerMembers): Enable enums and
5505         delegates in static class.
5506
5507 2005-01-24  Martin Baulig  <martin@ximian.com>
5508
5509         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
5510         merging an implicit block, just use its reachability.
5511
5512         * statement.cs (Block.Resolve): Make the unreachable code check
5513         work wrt. implicit blocks; see test-337 from #63842.
5514
5515 2005-01-21  Alp Toker  <alp@atoker.com>
5516  
5517         * cs-parser.jay: destructor_declaration's container is PartialContainer
5518         not Class when partial types are used, so use Kind prop instead of
5519         'is'.
5520         
5521 2005-01-22  Miguel de Icaza  <miguel@ximian.com>
5522
5523         * cs-parser.jay: Improve error reporting when an interface
5524         declares new types.
5525
5526 2005-01-20  Dick Porter  <dick@ximian.com>
5527
5528         * support.cs: SeekableStreamReader fix from Sandor Dobos
5529         (dobos_s@ibcnet.hu) to cope with Position setting when multibyte
5530         chars are read.  Fixes bug 70369.
5531
5532 2005-01-20  Raja R Harinath  <rharinath@novell.com>
5533
5534         * cs-parser.jay (catch_clause): Simplify current_block handling
5535         somewhat.
5536
5537 2005-01-17  Miguel de Icaza  <miguel@ximian.com>
5538
5539         * convert.cs (ImplicitStandardConversionExists): Synchronize the
5540         code with ImplicitStandardConversion to handle the implicit
5541         conversion of method groups into valid delegate invocations. 
5542
5543         The problem is that in parameter handling we were using this code
5544         path.  Fixes bug #64698
5545
5546 2005-01-19  Raja R Harinath  <rharinath@novell.com>
5547
5548         * cs-parser.jay: Fix several infelicities.
5549         - Avoid assigning to the parser value stack.  Code like 
5550           '$3 = null' is unclean.  Synthesize a value for the code block
5551           instead. 
5552         - Avoid using oob_stack for storing location information.  Use ...
5553         (_mark_): ... this.  New (empty) rule.  Saves the current location
5554         in $$.
5555         (foreach_statement): Avoid using oob_stack for current_block
5556         handling.  Use technique used in for_statement and
5557         using_statement.  Synthesize a value for the code block to store
5558         additional intermediate information.
5559
5560 2005-01-13  Miguel de Icaza  <miguel@ximian.com>
5561
5562         * ecore.cs (IsAccessorAccessible): Accessibility to private fields
5563         of a different type is only allowed to private fields of a
5564         containing type, not on fields of a base class.
5565
5566         See test-174.cs and error cs0122-9.cs
5567
5568 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5569
5570         Fix test-335.cs (bug #58126).
5571         * cs-parser.jay (argument): Split out non-expression parts of the
5572         rule into 'non_simple_argument'.
5573         (invocation_expression): Support parenthesized invocations with
5574         multiple arguments, and with single non-simple arguments.
5575
5576 2005-01-13  Raja R Harinath  <rharinath@novell.com>
5577
5578         * cs-tokenizer.cs (xtoken): Reset 'comments_seen' in a couple more
5579         places.
5580
5581 2005-01-12  Raja R Harinath  <rharinath@novell.com>
5582
5583         Fix cs0038-1.cs, cs1640-6.cs.
5584         * ecore.cs (Expression.Resolve): Remove special-case for
5585         SimpleName in error-handling.
5586         (Expression.almostMatchedMembers): Relax access permission to
5587         protected.
5588         (Expression.MemberLookupFailed): Handle duplicates in
5589         almostMatchedMembers list.
5590         (SimpleName.DoSimpleNameResolve): Catch CS0038 errors earlier.
5591         * expression.cs (New.DoResolve): Report CS1540 for more cases.
5592         * typemanager.cs (GetFullNameSignature): Use the MethodBase
5593         overload if the passed in MemberInfo is a MethodBase.
5594
5595 2005-01-12  Marek Safar  <marek.safar@seznam.cz>
5596
5597         Fix #70749
5598         * attribute.cs (ExtractSecurityPermissionSet): Don't report error
5599         for non-CAS & merge permission sets properly.
5600
5601 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5602
5603         Improve standard-compliance of simple name and member access 
5604         resolution.  Fixes bugs #52697, #57200, #67520, #69519.
5605         * ecore.cs (FullNamedExpression): New abstract base class 
5606         for Namespaces and TypeExpressions.
5607         (ResolveFlags.SimpleName): Remove.
5608         (SimpleName): Remove support for dotted names.
5609         (SimpleName.ResolveAsTypeStep): Simplify.  Now just a wrapper to 
5610         DeclSpace.FindType and DeclSpace.LookupType.
5611         (SimpleName.DoSimpleNameResolve): Remove support for dotted names.
5612         (Expression.ExprClassName): Make member function.
5613         * expression.cs (MemberAccess.ResolveAsTypeStep): Support LHS being
5614         a namespace.  Remove creation of dotted "SimpleName"s.
5615         (MemberAccess.DoResolve): Likewise.
5616         * decl.cs (DeclSpace.Cache): Make private.
5617         (DeclSpace.LookupInterfaceOrClass): Return a FullNamedExpression.
5618         (DeclSpace.FindType): Update.
5619         (DeclSpace.LookupType): Move here from RootContext.  Return a 
5620         FullNamedExpression.
5621         * namespace.cs (Namespace): Derive from FullNamedExpression
5622         so that it can be part of expression resolution.
5623         (Namespace.Lookup): Return an FullNamedExpression.
5624         (NamespaceEntry.LookupAlias): Lookup aliases only in current
5625         namespace.
5626         * rootcontext.cs (NamespaceLookup): Remove.
5627         (LookupType): Move to DeclSpace.
5628         * attribute.cs (CheckAttributeType): Update.
5629         * doc.cs (FindDocumentedType): Remove allowAlias argument.
5630         (FindDocumentedTypeNonArray): Likewise.
5631
5632 2005-01-11  Raja R Harinath  <rharinath@novell.com>
5633
5634         Fix cs0509.cs, cs1632.cs.
5635         * class.cs (TypeContainer.GetNormalBases): Don't assume !IsClass
5636         is the same as IsInterface.
5637         (TypeContainer.GetClassBases): Likewise.
5638         * statement.cs (LabeledStatement.ig): New field.
5639         (LabeledStatement.LabelTarget): Save ILGenerator which created the
5640         label.
5641         (LabeledStatement.DoEmit): Check that the label was created with
5642         the same ILGenerator.
5643
5644 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5645
5646         Fix #71058
5647         * attribute.cs (GetMethodObsoleteAttribute): Need to transform
5648         accessors to its properties.
5649
5650         * ecore.cs (PropertyExpr): Add AccessorTable to help track back
5651         from accessors to property.
5652         
5653 2005-01-10  Marek Safar  <marek.safar@seznam.cz>
5654
5655         Fix #70722
5656         * class.cs (MethodCore.CheckBase): Test base method obsoleteness
5657         only for overrides.
5658         
5659 2005-01-08  Miguel de Icaza  <miguel@ximian.com>
5660
5661         * attribute.cs: Check for null and empty strings.  
5662
5663         I have lost another battle to Paolo.
5664
5665 2005-01-07  Marek Safar  <marek.safar@seznam.cz>
5666
5667         Fix #70942
5668         * class.cs (PropertyMethod): Set Parent field in ctors.
5669         (SetMethod.InternalParameters): Add unsafe switch hack.
5670         Override MarkForDuplicationCheck where it is appropriate.
5671
5672         * decl.cs (MemberCore.MarkForDuplicationCheck): New method.
5673         It says whether container allows members with the same name.
5674         Base default is no.
5675         (DeclSpace.AddToContainer): Use MarkForDuplicationCheck.
5676         Removed is_method parameter.
5677
5678 2005-01-06  Duncan Mak  <duncan@ximian.com>
5679
5680         * cs-tokenizer.cs (xtoken): Redo the work for signaling CS1040
5681         because the previous change led to incorrect reporting of CS1032
5682         ("Cannot define/undefine preprocessor symbols after first token in
5683         file"). Instead of using `tokens_seen' as the only flag that
5684         triggers CS1040, introduce `comments_seen'. This new flag is used
5685         to signify having seen comments on the current line, so it is
5686         unset after a newline.
5687
5688 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5689
5690         * doc.cs : When searching for a type, find nested type too.
5691           This fixes bug #71040.
5692
5693 2005-01-06  Atsushi Enomoto  <atsushi@ximian.com>
5694
5695         * doc.cs :
5696           - Warn missing member comment on those classes which also does not
5697             have doc comments. Fixed bug #71041.
5698           - Don't warn missing doc comment on default constructor.
5699             Fixed bug #71042.
5700
5701 2005-01-06  Duncan Mak  <duncan@ximian.com>
5702
5703         * cs-tokenizer.cs (xtoken): After handling traditional C-style
5704         comments, set `tokens_seen' to true. This allows us to detect
5705         misplaced preprocessor directives (i.e. not at the beginning of
5706         the a line, nor after whitespaces). In that case, report error
5707         CS1040. This fixes bug #56460.
5708
5709         * cs-parser.jay (interface_member_declaration): Add checks for
5710         IsExplicitImpl, and report CS0541 error if an interface member is
5711         defined as an explicit interface declaration.
5712
5713 2005-01-06  Marek Safar  <marek.safar@seznam.cz>
5714
5715         Fix #70817
5716         * class.cs (PropertyMethod): Set Parent field in ctors.
5717         (SetMethod.InternalParameters): Add unsafe switch hack.
5718         
5719         * decl.cs (MemberCore.Parent): Cannot be readonly.
5720
5721 2005-01-06  Raja R Harinath  <rharinath@novell.com>
5722
5723         * decl.cs (DeclSpace.ResolveType): Remove.
5724         (DeclSpace.ResolveBaseTypeExpr): Rename from ResolveTypeExpr.
5725         Merge in code from ...
5726         (DeclSpace.GetTypeResolvingEmitContext): ... here.  Remove.
5727         * class.cs, enum.cs: Update to changes.
5728
5729 2005-01-06  Miguel de Icaza  <miguel@ximian.com>
5730
5731         * anonymous.cs: Ensure that we init the scope of our parent if it
5732         has not been initialized yet.
5733
5734 2004-12-30  Duncan Mak  <duncan@ximian.com>
5735
5736         * typemanager.cs (TypeManager.CheckStructCycles): Don't crash here
5737         if field.FieldBuilder is null. Fixes #70758.
5738
5739         * convert.cs: Fixed some typos and updated some of the comments.
5740         (ImplicitStandardConversionExists):
5741         (TryImplicitIntConversion): If `target_type' is an interface and
5742         the type of `ic' implements this interface, return true or a new
5743         BoxedCast instead of null. This fixes #70468.
5744
5745 2004-12-29  Duncan Mak  <duncan@ximian.com>
5746
5747         * expression.cs (Argument.Emit): Check that Expr is
5748         IMemoryLocation before casting to it, and report CS1510 otherwise.
5749
5750         This fixes #70402.
5751
5752 2004-12-21  Ben Maurer  <bmaurer@ximian.com>
5753
5754         * statement.cs (Block.ThisVariable): remove the recursion here, to
5755         make the --profile more sane.
5756
5757 2004-12-17  Carlos Cortez <calberto.cortez@gmail.com>
5758
5759         * driver.cs: Patch to handle a xsp bug that prevents to reference an .exe
5760         assembly, by JB Evain.
5761
5762 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5763
5764         * class.cs, decl.cs, ecore.cs, iterators.cs, pending.cs, 
5765           rootcontext.cs, typemanager.cs: Make nomenclature consistent.
5766         "parent" refers to enclosing type/class.  "base" refers to superclass.
5767
5768 2004-12-17  Raja R Harinath  <rharinath@novell.com>
5769
5770         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5771         Ensure that we only have GlobalAttributes.
5772         * attribute.cs (Attribute.Emit): Make non-virtual.
5773         (GlobalAttribute.Emit): Remove.
5774         (Attribute.Resolve): Make virtual.
5775         (GlobalAttribute.Resolve): New.  Set Rootcontext.Tree.Types.NamespaceEntry.
5776         (Attribute.GetConditionalAttributeValue): Take an EmitContext as
5777         the argument. Don't create one.
5778         (Attribute.GetObsoleteAttribute): Likewise.
5779         (Attribute.GetClsCompliantAttributeValue): Likewise.
5780         * class.cs, decl.cs: Update to changes.
5781
5782 2004-12-17  Marek Safar  <marek.safar@seznam.cz>
5783
5784         * delegate.cs (NewDelegate.DoResolve): Add error 149 report.
5785         
5786         * ecore.cs (Expression.MemberLookupFailed): Fixed error 143.
5787         
5788         * statement.cs (Foreach.Resolve): Add error 186 report.
5789
5790 2004-12-16  Marek Safar  <marek.safar@seznam.cz>
5791
5792         * expression.cs (Conditional.DoResolve): Add warning 429.
5793         
5794         * statement.cs (If.Resolve): Add warning 665.
5795
5796 2004-12-16  Raja R Harinath  <rharinath@novell.com>
5797
5798         New invariant: RootContext.Tree.Types.NamespaceEntry == null
5799         except when in the parser, and in GlobalAttribute.
5800         * driver.cs (MainDriver): Reset RootContext.Tree.Types.NamespaceEntry.
5801         * attribute.cs (GlobalAttribute.CheckAttributeType): Reset
5802         RootContext.Tree.Types.NamespaceEntry once work is done.
5803         (GlobalAttribute.Emit): New.  Wrapper for Attribute.Emit, but sets
5804         and resets RootContext.Tree.Types.NamespaceEntry.
5805
5806 2004-12-15  Marek Safar  <marek.safar@seznam.cz>
5807
5808         * cs-parser.jay: Don't create a block for every variable.
5809
5810 2004-12-14  Miguel de Icaza  <miguel@ximian.com>
5811
5812         * location.cs: Provide extra information.
5813
5814         * statement.cs: The instance is not `ldarg_0.THIS' when accessing
5815         variables from the captured environment, it is the ldarg_0.
5816
5817 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5818
5819         * cs-parser.jay: Changed warning level for 642 to 4 until Miguel
5820         find a conclusion.
5821         
5822         * class.cs: Changed warning level for 169 to avoid developer
5823         displeasure from warning flooding. It will be changed back when they
5824         fix most of current BCL warnings.
5825         
5826         * RootContext.cs: Pushed default WarningLevel to 3.
5827         
5828         * statement.cs: Removed unused variable.
5829
5830 2004-12-14  Marek Safar  <marek.safar@seznam.cz>
5831
5832         * class.cs (TypeContainer.GetClassBases): Add error 1521 report.
5833         (TypeContainer.MethodModifiersValid): Refactored to use MemberCore.
5834         Add error 502 report.
5835         (StaticClass.DefineType): Add error 441 report.
5836         (Class.AllowedModifiersProp): New virtual property as temporary
5837         extension to AllowedModifiers.
5838         (Class.DefineType): Add error 418 report. Moved ModFlags check here
5839         to share implementation with StaticClass and don't call virtual
5840         methods from ctor.
5841         
5842         * driver.cs (MainDriver): Add error 1558 test.
5843
5844         * parameter.cs (Parameter.ApplyAttributeBuilder): Add error 662
5845         report. Moved error 36 test here.
5846
5847         * statement.cs (Throw.Resolve): Add error 724 report.
5848
5849         * typemanager.cs: Add out_attribute_type core type.
5850         
5851 2004-12-13  Marek Safar  <marek.safar@seznam.cz>
5852
5853         * class.cs (TypeContainer.VerifyClsCompliance): Add error
5854         3018 report.
5855         (PropertyBase.VerifyClsCompliance): Add errror 3025 report.
5856
5857         * codegen.cs (ModuleClass.ApplyAttributeBuilder): Add error
5858         3017 report.
5859         
5860         * decl.cs (MemberCore.VerifyClsCompliance): Add warning 3021.
5861
5862         * parameter.cs (ReturnParameter.ApplyAttributeBuilder): 
5863         Add error 3023 report.
5864         (Parameter.ApplyAttributeBuilder): Add error 3022 report.
5865
5866         * tree.cs (RootTypes.IsClsCompliaceRequired): Add fake
5867         implementation.
5868
5869 2004-12-12  John Luke  <john.luke@gmail.com>
5870
5871         * driver.cs (AddArgs): take -- into account when
5872         adding arguments, fixes bug 65710 
5873
5874 2004-12-12  Martin Baulig  <martin@ximian.com>
5875
5876         * expression.cs (Unary.TryReduceNegative): Added support for
5877         SByteConstant and ByteConstant.
5878         (Unary.Reduce): Check error values from TryReduceNegative().
5879
5880 2004-12-10  Marek Safar  <marek.safar@seznam.cz>
5881
5882         * attributes.cs (Attribute.Resolve): Avoid multiple error report
5883         and report exception as error 182.
5884
5885 2004-12-10  Raja R Harinath  <rharinath@novell.com>
5886
5887         * driver.cs (Main): Fix message when there are warnings.
5888
5889 2004-12-09  Miguel de Icaza  <miguel@ximian.com>
5890
5891         * delegate.cs: Fixed my fix from yesterday, sorry about that.
5892
5893 2004-12-09  Marek Safar  <marek.safar@seznam.cz>
5894
5895         * anonymous.cs, class.cs, convert.cs, doc.cs, support.cs: 
5896         Reduced number of warnings.
5897         
5898         * class.cs (TypeContainer.VerifyClsCompliance): One if is enough.
5899
5900 2004-12-08  Miguel de Icaza  <miguel@ximian.com>
5901
5902         * driver.cs: Removed message.
5903
5904         * delegate.cs: Fix bug introduced in 1.1.x: 70219.
5905
5906 2004-12-08    <vargaz@freemail.hu>
5907
5908         * cs-tokenizer.cs: Add workaround for NET 2.0 beta 1 csc bug.
5909
5910 2004-12-08  Martin Baulig  <martin@ximian.com>
5911
5912         * class.cs (TypeContainer.VerifyClsCompliance): Report a CS3003
5913         instead of a CS3002 for properties and indexer.
5914
5915 2004-12-08  Martin Baulig  <martin@ximian.com>
5916
5917         * decl.cs (MemberName.ToString): Make this work again.
5918
5919 2004-12-08  Marek Safar  <marek.safar@seznam.cz>
5920
5921         * attribute.cs (Resolve): Add error 591 detection.
5922
5923         * class.cs (FieldMember.Define): Add error 1547 detection.
5924         (Indexer.Define): Add error 620 detection.
5925         (Operator.Define): Add error 590 detection.
5926
5927         * ecore.cs: Missing argument for error 79.
5928
5929         * expression.cs (ComposedCast.DoResolveAsTypeStep): Add error 611
5930         detection.
5931
5932 2004-12-07  Marek Safar  <marek.safar@seznam.cz>
5933
5934         Fix #70106
5935         * assign.cs.cs (Assign.DoResolve): Reports error 1648 for value types
5936         only.
5937
5938 2004-12-07  Atsushi Enomoto  <atsushi@ximian.com>
5939
5940         * cs-parser.jay : handle doc comments on implicit/explicit operators.
5941           Some operator comments were suppressed.
5942         * doc.cs : Implicit/explicit operator name in doc comments are like
5943           "op_Explicit(type)~returnType", so added suffix handling.
5944
5945 2004-12-07  Martin Baulig  <martin@ximian.com>
5946
5947         * decl.cs
5948         (MemberCore.GetObsoleteAttribute): Don't create a new EmitContext.
5949         (MemberCore.GetClsCompliantAttributeValue): Likewise.
5950         (DeclSpace.ec): New protected field; store the EmitContext here.
5951         (DeclSpace.EmitContext): New public property; moved here from
5952         `TypeContainer'.
5953         (DeclSpace.GetClsCompliantAttributeValue): Don't create a new
5954         EmitContext.
5955
5956         * enum.cs (Enum.Define): Store the EmitContext in the `ec' field.
5957         (Enum.Emit): Don't create a new EmitContext.
5958
5959         * delegate.cs (Delegate.DefineType): Always create the
5960         EmitContext.
5961
5962         * iterators.cs (Iterators.DefineIterator): Create a new
5963         EmitContext and store it in `ec'.
5964
5965 2004-08-24  Martin Baulig  <martin@ximian.com>
5966
5967         * typemanager.cs
5968         (TypeManager.IsSubclassOf): Renamed to IsFamilyAccessible; use
5969         this for accessibility checks.
5970         (TypeManager.IsSubclassOrNestedChildOf): Renamed to
5971         IsNestedFamilyAccessible.
5972         (TypeManager.IsSubclassOf): New method, do what the name actually
5973         says.   
5974
5975 2004-12-06  Raja R Harinath  <rharinath@novell.com>
5976
5977         Fix crash on cs0657-17.cs.
5978         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
5979         Use RootContext.Tree.Types, not 'new RootTypes ()'.
5980         * attribute.cs (GlobalAttribute.CheckAttributeType): Narrow down
5981         the case where the NamespaceEntry gets overwritten.
5982
5983 2004-12-06  Marek Safar  <marek.safar@seznam.cz>
5984
5985         Fixed #69195, #56821
5986         * ecore.cs (ResolveBoolean): Tiny refactoring.
5987
5988         * expression.cs (Binary.DoResolve): Add warning 429 and skipping
5989         of right expression resolving when left is false constant and
5990         operator is LogicalAnd OR true constant and operator is LogicalOr.
5991
5992         * statement.cs (ResolveUnreachable): Always reports warning.
5993
5994 2004-12-05  Miguel de Icaza  <miguel@ximian.com>
5995
5996         * class.cs: Distinguish between 1721 and 1722 (just a little help
5997         for the programmer).
5998
5999 2004-12-03  Miguel de Icaza  <miguel@ximian.com>
6000
6001         * delegate.cs: Only allow this on new versions of the language. 
6002
6003 2004-12-02  Duncan Mak  <duncan@ximian.com>
6004
6005         * ecore.cs (PropertyExpr.IsAccessorAccessible): Moved to
6006         Expression class.
6007         (Expression.IsAccessorAccessible): Moved from the PropertyExpr to
6008         here as a static method. Take an additional bool out parameter
6009         `must_do_cs1540_check' for signaling to InstanceResolve.
6010         (PropertyExpr.InstanceResolve): Removed the `must_do_cs1540_check'
6011         member field from PropertyExpr class and made it an argument of
6012         the method instead.
6013         (EventExpr.InstanceResolve): Copied from PropertyExpr, removed the
6014         check for MarshalByRefObject, and report CS0122 instead of CS1540.
6015         (EventExpr.DoResolve): Call IsAccessorAccessible on `add_accessor'
6016         and `remove_accessor' as well as InstanceResolve: report CS0122
6017         where applicable.
6018
6019         Fixes #70129.
6020
6021 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6022
6023         Fix test-327.cs, test-328.cs, and put in early infrastructure
6024         for eventually fixing #52697.
6025         * namespace.cs (NamespaceEntry.LookupForUsing): New method.
6026         (NamespaceEntry.LookupNamespaceOrType): New method, refactored
6027         from other methods.
6028         (NamespaceEntry.Lookup): Remove 'ignore_using' flag.
6029         (AliasEntry.Resolve, UsingEntry.Resolve): Use 'LookupForUsing'.
6030         (VerifyUsing, error246): Update.
6031         * rootcontext.cs (RootContext.NamespaceLookup): Just use
6032         'NamespaceEntry.LookupNamespaceOrType'.
6033
6034 2004-12-03  Martin Baulig  <martin@ximian.com>
6035
6036         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6037         method as our child, call AnonymousMethod.Compatible() on it.
6038
6039 2004-12-03  Raja R Harinath  <rharinath@novell.com>
6040
6041         Disable XML documentation support in 'basic' profile.
6042         * decl.cs, class.cs [BOOTSTRAP_WITH_OLDLIB]: Don't import System.Xml.
6043         Redirect XmlElement to System.Object.
6044         * driver.cs, enum.cs, rootcontext.cs: Don't reference System.Xml.
6045         * doc.cs [BOOTSTRAP_WITH_OLDLIB]: Disable compile.
6046         * mcs.exe.sources: Add doc-bootstrap.cs.
6047         * doc-bootstrap.cs: New file.  Contains empty stub implementation
6048         of doc.cs.
6049
6050 2004-12-03  Atsushi Enomoto  <atsushi@ximian.com>
6051
6052         * cs-tokenizer.cs : Only '////' is rejected. Other non-whitespace
6053           comments are allowed.
6054
6055 2004-12-03  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6056
6057         * delegate.cs: Add checks for subtypes in paramaters and return values
6058         in VerifyMethod () to add support for Covariance/Contravariance
6059         in delegates.
6060         
6061 2004-12-02  Miguel de Icaza  <miguel@ximian.com>
6062
6063         * report.cs: Remove extra closing parenthesis.
6064
6065         * convert.cs (Error_CannotImplicitConversion): If the name of the
6066         types are the same, provide some extra information.
6067
6068         * class.cs (FieldBase): Use an unused bit field from the field to
6069         encode the `has_offset' property from the FieldMember.  This saves
6070         a couple of Ks on bootstrap compilation.
6071
6072         * delegate.cs (NewDelegate.DoResolve): If we have an anonymous
6073         method as our child, return the AnonymousMethod resolved
6074         expression.
6075
6076         * expression.cs (New.DoResolve): Allow return values from
6077         NewDelegate to also include AnonymousMethods.
6078
6079         Fixes #70150.
6080
6081 2004-12-02  Marek Safar  <marek.safar@seznam.cz>
6082
6083         Fix bug #70102
6084         * attribute.cs (Resolve): Improved implementation of params
6085         attribute arguments.
6086
6087         * support.cs (ParameterData): Add HasParams to be faster.
6088
6089 2004-12-02  Atsushi Enomoto  <atsushi@ximian.com>
6090
6091         all things are for /doc support:
6092
6093         * doc.cs: new file that supports XML documentation generation.
6094         * mcs.exe.sources: added doc.cs.
6095         * driver.cs:
6096           Handle /doc command line option.
6097           Report error 2006 instead of 5 for missing file name for /doc.
6098           Generate XML documentation when required, after type resolution.
6099         * cs-tokenizer.cs:
6100           Added support for picking up documentation (/// and /** ... */),
6101           including a new XmlCommentState enumeration.
6102         * cs-parser.jay:
6103           Added lines to fill Documentation element for field, constant,
6104           property, indexer, method, constructor, destructor, operator, event
6105           and class, struct, interface, delegate, enum.
6106           Added lines to warn incorrect comment.
6107         * rootcontext.cs :
6108           Added Documentation field (passed only when /doc was specified).
6109         * decl.cs:
6110           Added DocComment, DocCommentHeader, GenerateDocComment() and
6111           OnGenerateDocComment() and some supporting private members for
6112           /doc feature to MemberCore.
6113         * class.cs:
6114           Added GenerateDocComment() on TypeContainer, MethodCore and Operator.
6115         * delegate.cs:
6116           Added overriden DocCommentHeader.
6117         * enum.cs:
6118           Added overriden DocCommentHeader and GenerateDocComment().
6119
6120 2004-12-01  Miguel de Icaza  <miguel@ximian.com>
6121
6122         * cfold.cs (ConstantFold.DoConstantNumericPromotions): After
6123         unwrapping the enumeration values, chain to
6124         DoConstantNumericPromotions again, so we can promote things to the
6125         fundamental types (takes care of enums that are bytes, sbytes).
6126
6127         Fixes bug #62054.
6128
6129 2004-12-01  Raja R Harinath  <rharinath@novell.com>
6130
6131         * attribute.cs (Attribute.CheckAttributeType): Remove complain flag.
6132         Fix long-standing bug in type-lookup.  Use FindType instead of
6133         LookupType when ec.ResolvingTypeTree.
6134         (Attribute.ResolveType, Attribute.Resolve)
6135         (Attribute.DefinePInvokeMethod,GlobalAttribute.CheckAttributeType):
6136         Update to changes.
6137         (Attributes.Search): Remove internal version.  Update.
6138         (Attributes.SearchMulti): Update.
6139         (Attributes.GetClsCompliantAttribute): Remove.
6140         (Attributes.GetIndexerNameAttribute): Remove.
6141         * decl.cs (MemberCore.GetClsCompliantAttributeValue): Update to changes.
6142         (DeclSpace.GetClsCompliantAttributeValue): Likewise.
6143         * class.cs (Indexer.Define): Likewise.
6144
6145 2004-12-01  Marek Safar  <marek.safar@seznam.cz>
6146
6147         Fix bug #68790
6148         * ecore.cs: CheckMarshallByRefAccess new virtual method for testing
6149         MarshallByReference members access.
6150
6151         * expression.cs: Use CheckMarshallByRefAccess;
6152         Better error CS0197 message.
6153
6154         * report.cs: Print whole related error message.
6155
6156 2004-11-30  Raja R Harinath  <rharinath@novell.com>
6157
6158         * Makefile (mcs.exe) [PROFILE=default]: Keep a copy of mcs.exe in
6159         the current directory to help debugging.
6160
6161 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6162
6163         * class (GetClassBases): Better error 60 report.
6164         (EventProperty): Disabled warning 67 detection.
6165
6166 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6167
6168         Fix bug #60324
6169         * cfold.cs (Assign.DoResolve): Add subtraction for DecimalConstant.
6170
6171         * constant.cs (DecimalConstant.Emit): Don't use int ctor for
6172         precise values.
6173
6174 2004-11-29  Marek Safar  <marek.safar@seznam.cz>
6175
6176         Fix bug #49488
6177         * assign.cs (Assign.DoResolve): Add error 1648, 1650 report.
6178
6179         * decl.cs (MemberCore.MemberName): Error 1648 in compiler.
6180
6181 2004-11-26  Miguel de Icaza  <miguel@ximian.com>
6182
6183         * attribute.cs (Attribute.Resolve): Refine error reporting and
6184         report a cs0117 if the identifier does not exist, to distinguish
6185         from 0617 which is a miss-use of the actual identifier.
6186
6187         * ecore.cs (EventExpr.Emit): Refine error report and distinguish
6188         between cs0070 and cs0079.
6189
6190         * class.cs (MemberBase.DoDefine): When reporting a wrong
6191         accessibility level, we use MethodCore to compare instead of
6192         Method (this was a regression in some refactoring effort).
6193
6194         So now we correctly report cs0056 again.
6195
6196         * convert.cs (ImplicitReferenceConversion): Corrected typo, I was
6197         testing the target_type (which was known to be object_type) and
6198         not the source type (which is anonymous_method).
6199
6200         Fixed reporting of error cs1660.
6201
6202         * expression.cs (UserCast.Source): Expose the underlying cast.
6203
6204         * statement.cs (Switch.SwitchGoverningType): Sort the list of
6205         allowed types to find a match to int32 first (most common).
6206
6207         In addition, it ignores any ImplicitUserConversions that did an
6208         internal implicit conversion (as the switch statement allows only
6209         one integral conversion to exist).
6210
6211         * class.cs (PartialContainer.Create): rename `name' to
6212         `member_name' for clarity.  Then replace the string calls with a
6213         call to MemberName.GetPartialName, as now using
6214         MemberName.ToString is an error (this is due to the side effects
6215         it had, that were fixed in the past).
6216
6217         This will restore the error reporting on a number of partial class
6218         errors that were missusing this (and getting an exception as a
6219         results, which is now just a plain textual warning, because
6220         yyparse debug output would crash otherwise).
6221
6222 2004-11-26  Raja R Harinath  <rharinath@novell.com>
6223
6224         * Makefile (PROGRAM_INSTALL_DIR): Remove.
6225
6226 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6227
6228         * rootcontext.cs (LookupType): Make sure to cache lookups that
6229         don't give us a negative result. This saves about 5% of corlib
6230         compilation time.
6231
6232 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6233
6234         * report.cs (AbstractMessage.Print): messages are sent to stderr
6235
6236         * class.cs (TypeContainer.GetClassBases): It is an error to have a
6237         non-interface in the list of interfaces (at this point, either
6238         parent was properly set, or a base class is being listed in the
6239         interfaces section).
6240
6241         This flags error 1722, and resolves the crash from bug 69259.
6242
6243 2004-11-25  Ben Maurer  <bmaurer@ximian.com>
6244
6245         * statement.cs (Using.EmitExpressionFinally): make this work right
6246         for valuetypes. Fixes 69926.
6247
6248 2004-11-25  Miguel de Icaza  <miguel@ximian.com>
6249
6250         * const.cs (Const.ChangeType): Cope with the "0 literal can be
6251         converted to an enum" here, before we try to change the underlying
6252         type.  This code exists, but it is a different code path than the
6253         one used while encoding constants.
6254
6255         * convert.cs (ImplicitReferenceConversionExists): A surprisingly
6256         old bug: when converting from the null literal to a pointer,
6257         return an EmptyCast, not the NullLiteral.
6258
6259         This fixes #69921, the recent null_type changes probably made this
6260         bug more prominent.
6261
6262         (ImplicitReferenceConversionExists): In addition, resynchronized
6263         the code here, so it matches the same code in
6264         ImplicitReferenceConversionExists for the `from any class-type S
6265         to any interface-type T'.
6266         
6267
6268 2004-11-25  Marek Safar  <marek.safar@seznam.cz>
6269
6270         * cfold.cs (BinaryFold): Add addition for DecimalConstant.
6271
6272 2004-11-24  Miguel de Icaza  <miguel@ximian.com>
6273
6274         * cs-parser.jay: Use verbosity accordingly. 
6275
6276 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6277
6278         * expression.cs (Unary.ResolveOperator): Do not report warning;
6279         AddressOf reads from variable.
6280         
6281         (LocalVariableReferences.DoResolveBase): Improved my previous fix.
6282
6283 2004-11-24  Marek Safar  <marek.safar@seznam.cz>
6284
6285         Fix bug #69462
6286
6287         * attribute.cs (Attributable): Removed CheckTargets.
6288         (Attributes.Emit): Explicit attribute targets are tested here.
6289
6290         * class.cs (EventField.ValidAttributeTargets): Explicit target "field" is
6291         not enabled for interfaces.
6292
6293         * codegen.cs (CommonAssemblyModulClass.AddAttributes): Removed CheckTargets.
6294         (GetAssemblyName): Ouch next bug there.
6295
6296 2004-11-23  Carlos Alberto Cortez <calberto.cortez@gmail.com>
6297
6298         * expression.cs: Error 275 added.
6299         
6300 2004-11-23  Marek Safar  <marek.safar@seznam.cz>
6301
6302         Fix bug #69177 (Implemented decimal constant support)
6303
6304         * cfold.cs (DoConstantNumericPromotions: Add DecimalConstant.
6305         (BinaryFold): Add DecimalConstant.
6306
6307         * const.cs (Define): Decimal constant 
6308         (is not constant.
6309         (ChangeType): Add decimal type handling.
6310         (LookupConstantValue): Don't set value for decimal type but
6311         emit DecimalConstantAttribute. Needed for constant optimization.
6312
6313         * constant.cs (ToDecimal): New method.
6314         (ConvertToDecimal): New method.
6315         (IntConstant): Implemented ConvertToDecimal.
6316         (DecimalConstant.Emit): Emit optimized version for decimals in
6317         int range.
6318
6319         * expression.cs (ResolveOperator): Changed order of constant
6320         reduction to work correctly with native types which have
6321         overloaded operators.
6322         (ResolveMemberAccess): Extract constant value from attribute
6323         for decimal type.
6324
6325         * rootcontext.cs (ResolveCore): Add DecimalConstantAttribute.
6326
6327         * typemanager.cs (TypeManager): Add decimal_constant_attribute_type,
6328         void_decimal_ctor_int_arg, decimal_constant_attribute_ctor.
6329         (ChangeType): Decimal is special.
6330         (TypeToCoreType): Add decimal type.
6331
6332 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6333
6334         * convert.cs (ImplicitConversionRequired): Add error cs0642 for
6335         decimal types.
6336
6337 2004-11-22  Marek Safar  <marek.safar@seznam.cz>
6338
6339         * class.cs (EventField.ApplyAttributeBuilder): Fix error
6340         test cs1667-5.cs.
6341
6342 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6343
6344         * class.cs (MemberBase.DoDefine): Fix error cs0508 report.
6345
6346         * pending.cs (PendingImplementation): Grab only interfaces.
6347
6348 2004-11-19  Marek Safar  <marek.safar@seznam.cz>
6349
6350         * statement.cs (ForeachHelperMethods): Add location member and
6351         error 202 detection.
6352
6353 2004-11-19  Raja R Harinath  <rharinath@novell.com>
6354
6355         * Makefile (EXTRA_DISTFILES): Remove mcs.exe.config.  It's
6356         automatically handled by executable.make.
6357         (PROGRAM): Make profile-specific.
6358
6359 2004-11-18  Marek Safar  <marek.safar@seznam.cz>
6360
6361         * expression.cs (DoResolveBase): Fixed wrong warning for out
6362         variables.
6363
6364 2004-11-18  Martin Baulig  <martin@ximian.com>
6365
6366         Merged latest changes into gmcs.  Please keep this comment in
6367         here, it makes it easier for me to see what changed in MCS since
6368         the last time I merged.
6369
6370 2004-11-17  Raja R Harinath  <rharinath@novell.com>
6371
6372         * typemanager.cs (TypeHandle.GetTypeHandle): Make private.
6373         (TypeHandle.GetMemberCache): New.
6374         (TypeHandle.TypeHandle): Update.
6375         (TypeManager.LookupMemberCache): Rewritten from LookupMemberContainer.
6376         (TypeManager.LookupParentInterfacesCache):
6377         Rename from LookupInterfaceCache.  Optimize slightly.
6378         (TypeManager.MemberLookup_FindMembers): Update.
6379         * decl.cs (MemberCache.MemberCache): Set Container to null in the
6380         multi-type variant.
6381         (AddCacheContents): Rename from AddHashtable.
6382         * class.cs (TypeContainer.parent_container): Remove.
6383         (TypeContainer.VerifyClsCompliance): Don't use parent_container.
6384         (TypeContainer.DoDefineMembers): Don't initialize it.
6385         Update to name changes.
6386         
6387 2004-11-17  Miguel de Icaza  <miguel@ximian.com>
6388
6389         * class.cs (MethodCore.CheckAccessModifiers): New helper routine
6390         that factors the code to check access modifiers on override.  
6391
6392         (PropertyBase): Use the code here.
6393
6394         Patch from Lluis S'anchez, fixes bug #69361.
6395
6396 2004-11-15  Miguel de Icaza  <miguel@ximian.com>
6397
6398         * anonymous.cs (AnonymousMethod.Error_AddressOfCapturedVar): New
6399         routine that is used to report the use of a captured variable
6400         whose address has been taken.
6401
6402         There are two checks: one when variables are being captured and
6403         the other check is when the address of a variable is taken. 
6404         
6405         (because an anonymous methods might be resolved before *or* after
6406         the address has been taken) and 
6407
6408         * expression.cs (Conditional.DoResolve): Remove the special
6409         casing that Martin added to trueExpr and falseExpr being both
6410         NullLiteral.  We get the right behavior now just by introducing
6411         the null_type into the compiler. 
6412
6413         * convert.cs (ExplicitConversion): Change the code to use
6414         null_type instead of testing `expr is NullLiteral'.
6415         (ImplicitConversionStandard): use null_type too.
6416         (ImplicitReferenceConversionExists): use null_type too.
6417         (ImplicitReferenceConversion): use null_type too.
6418
6419         * literal.cs: The type of `NullLiteral' is now null_type instead
6420         of object_type. 
6421         (Resolve): Set the type here.
6422
6423         * typemanager.cs: Introduce null_type.
6424
6425 2004-11-17  Martin Baulig  <martin@ximian.com>
6426
6427         * decl.cs (MemberCache.AddHashtable): Add entries in the opposite
6428         direction, like FindMembers() does.  Fixes #69546, testcase is in
6429         test-315.cs.    
6430
6431 2004-11-16  Martin Baulig  <martin@ximian.com>
6432
6433         This is based on a patch from Marek Safar, see bug #69082.
6434         Fixes bugs #63705 and #67130.
6435
6436         * typemanager.cs (TypeManager.LookupInterfaceCache): New public
6437         method; create a MemberCache for an interface type and cache the
6438         result.
6439
6440         * decl.cs (IMemberContainer.ParentContainer): Removed.
6441         (IMemberContainer.ParentCache): New property.
6442         (MemberCache.SetupCacheForInterface): Removed.
6443         (MemberCache..ctor): Added .ctor which takes a `Type[]'; use this
6444         to create a cache for an interface's "parent".
6445
6446         * class.cs (TypeContainer.DoDefineMembers): Setup cache for
6447         interfaces too.
6448
6449 2004-11-16  Martin Baulig  <martin@ximian.com>
6450
6451         Merged back from gmcs; these changes already went into gmcs a
6452         couple of weeks ago.
6453
6454         * typemanager.cs
6455         (TypeManager.AddUserType): Removed the `ifaces' argument.
6456         (TypeManager.RegisterBuilder): Take a `Type []' instead of a
6457         `TypeExpr []'.
6458         (TypeManager.AddUserInterface): Removed.
6459         (TypeManager.ExpandInterfaces): Return a `Type []' instead of a
6460         `TypeExpr []'.
6461         (TypeManager.GetInterfaces): Likewise.
6462         (TypeManager.GetExplicitInterfaces): Likewise.
6463
6464         * ecore.cs (TypeExpr.GetInterfaces): Removed.
6465
6466         * class.cs (TypeContainer.base_class_type): Replaced with `ptype'.
6467         (TypeContainer.base_inteface_types): Replaced with `ifaces'.
6468
6469 2004-11-14  Ben Maurer  <bmaurer@ximian.com>
6470
6471         * statement.cs: Avoid adding bools to a hashtable.
6472
6473 2004-11-07  Miguel de Icaza  <miguel@ximian.com>
6474
6475         * expression.cs (Invocation.OverloadResolve): Flag error if we are
6476         calling an unsafe method from a safe location.
6477
6478 2004-11-06  Marek Safar  <marek.safar@seznam.cz>
6479
6480         Fix #69167
6481         * codegen.cs (ApplyAttributeBuilder): Do not return; it is only warning.
6482
6483 2004-11-06  Miguel de Icaza  <miguel@ximian.com>
6484
6485         * namespace.cs (VerifyUsing): use GetPartialName instead of
6486         ToString. 
6487
6488 2004-11-05  Miguel de Icaza  <miguel@ximian.com>
6489
6490         * statement.cs (Return.Resolve): Fix regression in typo: if
6491         `in_exc', we have to request a NeedReturnLabel, this was a typo
6492         introduced in the anonymous method check-in.  Fixes #69131.
6493
6494         * Indexers were using the ShortName when defining themselves,
6495         causing a regression in the compiler bootstrap when applying the
6496         patch from 2004-11-02 (first part), now they use their full name
6497         and the bug is gone.
6498
6499 2004-11-04  Zoltan Varga  <vargaz@freemail.hu>
6500
6501         * driver.cs: Strip the path from the names of embedded resources. Fixes
6502         #68519.
6503
6504 2004-11-04  Raja R Harinath  <rharinath@novell.com>
6505
6506         Fix error message regression: cs0104-2.cs.
6507         * namespace.cs (NamespaceEntry.Lookup): Remove 'silent' flag.
6508         (AliasEntry.Resolve): Update.
6509         * rootcontext.cs (RootContext.NamespaceLookup): Update.  Remove
6510         'silent' flag.
6511         (RootContext.LookupType): Update.
6512
6513 2004-11-03  Carlos Alberto Cortez <carlos@unixmexico.org>
6514
6515         * cs-parser.jay: Add support for handling accessor modifiers
6516         * class: Add support port accessor modifiers and error checking,
6517         define PropertyMethod.Define as virtual (not abstract anymore)
6518         * ecore.cs: Add checking for proeprties access with access modifiers
6519         * iterators.cs: Modify Accessor constructor call based in the modified
6520         constructor
6521 2004-11-02  Ben Maurer  <bmaurer@ximian.com>
6522
6523         * expression.cs (StringConcat): Handle being called twice,
6524         as when we have a concat in a field init with more than two
6525         ctors in the class
6526
6527 2004-11-02  Miguel de Icaza  <miguel@ximian.com>
6528
6529         * class.cs (Event.Define, Indexer.Define, Property.Define): Do not
6530         special case explicit implementations, we should always produce
6531         the .property or .event declaration.
6532         
6533         * decl.cs (MemberName): Renamed GetFullName to GetPartialName
6534         since it will not return correct data if people use this
6535         unresolved in the presence of using statements (see test-313).
6536
6537         * class.cs (MethodData.Define): If we are an explicit interface
6538         implementation, set the method name to the full name of the
6539         interface plus the name of the method.  
6540
6541         Notice that using the method.MethodName.GetFullName() does not
6542         work, as it will only contain the name as declared on the source
6543         file (it can be a shorthand in the presence of using statements)
6544         and not the fully qualifed type name, for example:
6545
6546         using System;
6547
6548         class D : ICloneable {
6549                 object ICloneable.Clone ()  {
6550                 }
6551         }
6552
6553         Would produce a method called `ICloneable.Clone' instead of
6554         `System.ICloneable.Clone'.
6555
6556         * namespace.cs (Alias.Resolve): Use GetPartialName.
6557         
6558 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6559
6560         * cs-parser.jay: Add error 1055 report.
6561
6562 2004-11-01  Miguel de Icaza  <miguel@ximian.com>
6563
6564         * assign.cs (Assign.DoResolve): Only do the transform of
6565         assignment into a New if the types are compatible, if not, fall
6566         through and let the implicit code deal with the errors and with
6567         the necessary conversions. 
6568
6569 2004-11-01  Marek Safar  <marek.safar@seznam.cz>
6570
6571         * cs-parser.jay: Add error 1031 report.
6572
6573         * cs-tokenizer.cs: Add location for error 1038.
6574
6575 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6576
6577         * cs-parser.jay: Add error 1016 report.
6578
6579 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6580
6581         * cs-parser.jay: Add errors 1575,1611 report.
6582
6583 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6584
6585         * cs-parser.jay: Add error 1001 report.
6586
6587 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6588
6589         Fix #68850
6590         * attribute.cs (GetMarshal): Add method argument for
6591         caller identification.
6592
6593         * class.cs, codegen.cs, enum.cs, parameter.cs: Added
6594         agument for GetMarshal and RuntimeMissingSupport.
6595
6596 2004-10-31  Marek Safar  <marek.safar@seznam.cz>
6597
6598         * attribute.cs (ExtractSecurityPermissionSet): Removed
6599         TypeManager.code_access_permission_type.
6600
6601         * typemanager.cs: Removed TypeManager.code_access_permission_type.
6602
6603 2004-10-27  Miguel de Icaza  <miguel@ximian.com>
6604
6605         * expression.cs (LocalVariableReference.DoResolveLValue): Check
6606         for obsolete use of a variable here.   Fixes regression on errors
6607         cs0619-25 and cs0619-26.
6608
6609 2004-10-27  Marek Safar  <marek.safar@seznam.cz>
6610
6611         Fix #62358, implemented security attribute encoding.
6612
6613         * attribute.cs (Attribute.CheckSecurityActionValididy): New method.
6614         Tests permitted SecurityAction for assembly or other types.
6615         (Assembly.ExtractSecurityPermissionSet): New method. Transforms
6616         data from SecurityPermissionAttribute to PermisionSet class.
6617
6618         * class.cs (ApplyAttributeBuilder): Added special handling
6619         for System.Security.Permissions.SecurityAttribute based types.
6620
6621         * codegen.cs (AssemblyClass.ApplyAttributeBuilder): Added
6622         special handling for System.Security.Permissions.SecurityAttribute
6623         based types.
6624
6625         * enum.cs (ApplyAttributeBuilder): Added special handling
6626         for System.Security.Permissions.SecurityAttribute based types.
6627
6628         * parameter.cs (ApplyAttributeBuilder): Added special handling
6629         for System.Security.Permissions.SecurityAttribute based types.
6630
6631         * rootcontext.cs: Next 2 core types.
6632
6633         * typemanager.cs (TypeManager.security_permission_attr_type):
6634         Built in type for the SecurityPermission Attribute.
6635         (code_access_permission_type): Build in type.
6636
6637 2004-10-17  Miguel de Icaza  <miguel@ximian.com>
6638
6639         * expression.cs (LocalVariableReference.DoResolveBase, Emit):
6640         Remove the tests for `ec.RemapToProxy' from here, and encapsulate
6641         all of this information into
6642         EmitContext.EmitCapturedVariableInstance.
6643         
6644         * codegen.cs (EmitCapturedVariableInstance): move here the
6645         funcionality of emitting an ldarg.0 in the presence of a
6646         remapping.   This centralizes the instance emit code.
6647
6648         (EmitContext.EmitThis): If the ScopeInfo contains a THIS field,
6649         then emit a load of this: it means that we have reached the
6650         topmost ScopeInfo: the one that contains the pointer to the
6651         instance of the class hosting the anonymous method.
6652
6653         * anonymous.cs (AddField, HaveCapturedFields): Propagate field
6654         captures to the topmost CaptureContext.
6655
6656 2004-10-12  Miguel de Icaza  <miguel@ximian.com>
6657
6658         * expression.cs (LocalVariableReference): Move the knowledge about
6659         the iterators into codegen's EmitCapturedVariableInstance.
6660
6661 2004-10-11  Miguel de Icaza  <miguel@ximian.com>
6662
6663         * codegen.cs (EmitContext.ResolveTopBlock): Emit a 1643 when not
6664         all code paths return a value from an anonymous method (it is the
6665         same as the 161 error, but for anonymous methods).
6666
6667 2004-10-08  Miguel de Icaza  <miguel@ximian.com>
6668
6669         The introduction of anonymous methods in the compiler changed
6670         various ways of doing things in the compiler.  The most
6671         significant one is the hard split between the resolution phase
6672         and the emission phases of the compiler.
6673
6674         For instance, routines that referenced local variables no
6675         longer can safely create temporary variables during the
6676         resolution phase: they must do so from the emission phase,
6677         since the variable might have been "captured", hence access to
6678         it can not be done with the local-variable operations from the runtime.
6679         
6680         * statement.cs 
6681
6682         (Block.Flags): New flag `IsTopLevel' to indicate that this block
6683         is a toplevel block.
6684
6685         (ToplevelBlock): A new kind of Block, these are the blocks that
6686         are created by the parser for all toplevel method bodies.  These
6687         include methods, accessors and anonymous methods.
6688
6689         These contain some extra information not found in regular blocks:
6690         A pointer to an optional CaptureContext (for tracking captured
6691         local variables and parameters).  A pointer to the parent
6692         ToplevelBlock.
6693         
6694         (Return.Resolve): Catch missmatches when returning a value from an
6695         anonymous method (error 1662).
6696         Invoke NeedReturnLabel from the Resolve phase instead of the emit
6697         phase.
6698
6699         (Break.Resolve): ditto.
6700
6701         (SwitchLabel): instead of defining the labels during the
6702         resolution phase, we now turned the public ILLabel and ILLabelCode
6703         labels into methods called GetILLabelCode() and GetILLabel() that
6704         only define the label during the Emit phase.
6705
6706         (GotoCase): Track the SwitchLabel instead of the computed label
6707         (its contained therein).  Emit the code by using
6708         SwitchLabel.GetILLabelCode ().
6709
6710         (LocalInfo.Flags.Captured): A new flag has been introduce to track
6711         whether the Local has been captured or not.
6712
6713         (LocalInfo.IsCaptured): New property, used to tell whether the
6714         local has been captured.
6715         
6716         * anonymous.cs: Vastly updated to contain the anonymous method
6717         support.
6718
6719         The main classes here are: CaptureContext which tracks any
6720         captured information for a toplevel block and ScopeInfo used to
6721         track the activation frames for various local variables.   
6722
6723         Each toplevel block has an optional capture context associated
6724         with it.  When a method contains an anonymous method both the
6725         toplevel method and the anonymous method will create a capture
6726         context.   When variables or parameters are captured, they are
6727         recorded on the CaptureContext that owns them, for example:
6728
6729         void Demo () {
6730              int a;
6731              MyDelegate d = delegate {
6732                  a = 1;
6733              }
6734         }
6735
6736         Here `a' will be recorded as captured on the toplevel
6737         CapturedContext, the inner captured context will not have anything
6738         (it will only have data if local variables or parameters from it
6739         are captured in a nested anonymous method.
6740
6741         The ScopeInfo is used to track the activation frames for local
6742         variables, for example:
6743
6744         for (int i = 0; i < 10; i++)
6745                 for (int j = 0; j < 10; j++){
6746                    MyDelegate d = delegate {
6747                         call (i, j);
6748                    }
6749                 }
6750
6751         At runtime this captures a single captured variable `i', but it
6752         captures 10 different versions of the variable `j'.  The variable
6753         `i' will be recorded on the toplevel ScopeInfo, while `j' will be
6754         recorded on a child.  
6755
6756         The toplevel ScopeInfo will also track information like the `this'
6757         pointer if instance variables were referenced (this is necessary
6758         as the anonymous method lives inside a nested class in the host
6759         type of the method). 
6760
6761         (AnonymousMethod): Expanded to track the Toplevel, implement
6762         `AnonymousMethod.Compatible' to tell whether an anonymous method
6763         can be converted to a target delegate type. 
6764
6765         The routine now also produces the anonymous method content
6766
6767         (AnonymousDelegate): A helper class that derives from
6768         DelegateCreation, this is used to generate the code necessary to
6769         produce the delegate for the anonymous method that was created. 
6770
6771         * assign.cs: API adjustments for new changes in
6772         Convert.ImplicitStandardConversionExists.
6773
6774         * class.cs: Adjustments to cope with the fact that now toplevel
6775         blocks are of type `ToplevelBlock'. 
6776
6777         * cs-parser.jay: Now we produce ToplevelBlocks for toplevel blocks
6778         insteda of standard blocks.
6779
6780         Flag errors if params arguments are passed to anonymous methods.
6781
6782         * codegen.cs (EmitContext): Replace `InAnonymousMethod' with
6783         `CurrentAnonymousMethod' which points to the current Anonymous
6784         Method.  The variable points to the AnonymousMethod class that
6785         holds the code being compiled.  It is set in the new EmitContext
6786         created for the anonymous method.
6787
6788         (EmitContext.Phase): Introduce a variable and an enumeration to
6789         assist in enforcing some rules about when and where we are allowed
6790         to invoke certain methods (EmitContext.NeedsReturnLabel is the
6791         only one that enfonces this right now).
6792
6793         (EmitContext.HaveCaptureInfo): new helper method that returns
6794         whether we have a CapturedContext initialized.
6795
6796         (EmitContext.CaptureVariable): New method used to register that a
6797         LocalInfo must be flagged for capturing. 
6798
6799         (EmitContext.CapturedParameter): New method used to register that a
6800         parameters must be flagged for capturing. 
6801         
6802         (EmitContext.CapturedField): New method used to register that a
6803         field must be flagged for capturing. 
6804
6805         (EmitContext.HaveCapturedVariables,
6806         EmitContext.HaveCapturedFields): Return whether there are captured
6807         variables or fields. 
6808
6809         (EmitContext.EmitMethodHostInstance): This is used to emit the
6810         instance for the anonymous method.  The instance might be null
6811         (static methods), this (for anonymous methods that capture nothing
6812         and happen to live side-by-side with the current method body) or a
6813         more complicated expression if the method has a CaptureContext.
6814
6815         (EmitContext.EmitTopBlock): Routine that drives the emission of
6816         code: it will first resolve the top block, then emit any metadata
6817         and then emit the code.  The split is done so that we can extract
6818         any anonymous methods and flag any captured variables/parameters.
6819         
6820         (EmitContext.ResolveTopBlock): Triggers the resolution phase,
6821         during this phase, the ILGenerator should not be used as labels
6822         and local variables declared here might not be accessible to any
6823         code that is part of an anonymous method.  
6824
6825         Exceptions to this include the temporary variables that are
6826         created by some statements internally for holding temporary
6827         variables. 
6828         
6829         (EmitContext.EmitMeta): New routine, in charge of emitting all the
6830         metadata for a cb
6831
6832         (EmitContext.TemporaryReturn): This method is typically called
6833         from the Emit phase, and its the only place where we allow the
6834         ReturnLabel to be defined other than the EmitMeta.  The reason is
6835         that otherwise we would have to duplicate a lot of logic in the
6836         Resolve phases of various methods that today is on the Emit
6837         phase. 
6838
6839         (EmitContext.NeedReturnLabel): This no longer creates the label,
6840         as the ILGenerator is not valid during the resolve phase.
6841
6842         (EmitContext.EmitThis): Extended the knowledge in this class to
6843         work in anonymous methods in addition to iterators. 
6844
6845         (EmitContext.EmitCapturedVariableInstance): This emits whatever
6846         code is necessary on the stack to access the instance to a local
6847         variable (the variable will be accessed as a field).
6848
6849         (EmitContext.EmitParameter, EmitContext.EmitAssignParameter,
6850         EmitContext.EmitAddressOfParameter): Routines to support
6851         parameters (not completed at this point). 
6852         
6853         Removals: Removed RemapLocal and RemapLocalLValue.  We probably
6854         will also remove the parameters.
6855
6856         * convert.cs (Convert): Define a `ConstantEC' which points to a
6857         null.  This is just to prefity some code that uses
6858         ImplicitStandardConversion code and do not have an EmitContext
6859         handy.
6860
6861         The idea is to flag explicitly that at that point in time, it is
6862         known that the conversion will not trigger the delegate checking
6863         code in implicit conversions (which requires a valid
6864         EmitContext). 
6865
6866         Everywhere: pass new EmitContext parameter since
6867         ImplicitStandardConversionExists now requires it to check for
6868         anonymous method conversions. 
6869
6870         (Convert.ImplicitStandardConversionExists): If the type of an
6871         expression is the anonymous_method_type, and the type is a
6872         delegate, we invoke the AnonymousMethod.Compatible method to check
6873         whether an implicit conversion is possible. 
6874
6875         (Convert.ImplicitConversionStandard): Only do implicit method
6876         group conversions if the language level is not ISO_1.
6877
6878         * delegate.cs (Delegate.GetInvokeMethod): Common method to get the
6879         MethodInfo for the Invoke method.  used by Delegate and
6880         AnonymousDelegate.
6881
6882         * expression.cs (Binary.DoNumericPromotions): only allow anonymous
6883         method conversions if the target type is a delegate.
6884
6885         Removed extra debugging nops.
6886
6887         (LocalVariableReference): Turn the `local_info' into a public
6888         field. 
6889
6890         Add `prepared' field, the same hack used for FieldExprs to cope
6891         with composed assignments, as Local variables do not necessarily
6892         operate purely on the stack as they used to: they can be captured
6893         fields. 
6894
6895         Add `temp' for a temporary result, like fields.
6896
6897         Refactor DoResolve and DoResolveLValue into DoResolveBase.
6898
6899         It now copes with Local variables that are captured and emits the
6900         proper instance variable to load it from a field in the captured
6901         case. 
6902
6903         (ParameterReference.DoResolveBase): During the resolve phase,
6904         capture parameters if we are in an anonymous method.
6905
6906         (ParameterReference.Emit, ParameterReference.AddressOf): If in an
6907         anonymous method, use the EmitContext helper routines to emit the
6908         parameter reference.
6909
6910         * iterators.cs: Set RemapToProxy to true/false during the
6911         EmitDispose class.
6912
6913         * parameters.cs (GetParameterByName): New helper method. 
6914
6915         * typemanager.cs (anonymous_method_type) a new type that
6916         represents an anonyous method.  This is always an internal type,
6917         used as a fencepost to test against the anonymous-methodness of an
6918         expression. 
6919         
6920 2004-10-20  Marek Safar  <marek.safar@seznam.cz>
6921
6922         * class.cs (MethodCore.CheckBase): Add errors 505, 533, 544,
6923         561 report.
6924         (PropertyBase.FindOutParentMethod): Add errors 545, 546 report.
6925
6926 2004-10-18  Martin Baulig  <martin@ximian.com>
6927
6928         * statement.cs (Fixed.Resolve): Don't access the TypeExpr's
6929         `Type' directly, but call ResolveType() on it.
6930         (Catch.Resolve): Likewise.
6931         (Foreach.Resolve): Likewise.
6932
6933 2004-10-18  Martin Baulig  <martin@ximian.com>
6934
6935         * expression.cs (Cast.DoResolve): Don't access the TypeExpr's
6936         `Type' directly, but call ResolveType() on it.
6937         (Probe.DoResolve): Likewise.
6938         (ArrayCreation.LookupType): Likewise.
6939         (TypeOf.DoResolve): Likewise.
6940         (SizeOf.DoResolve): Likewise.
6941
6942 2004-10-18  Martin Baulig  <martin@ximian.com>
6943
6944         * expression.cs (Invocation.BetterFunction): Put back
6945         TypeManager.TypeToCoreType().
6946
6947 2004-10-18  Raja R Harinath  <rharinath@novell.com>
6948
6949         * class.cs (FieldMember.DoDefine): Reset ec.InUnsafe after doing
6950         the ResolveType.
6951
6952 2004-10-18  Martin Baulig  <martin@ximian.com>
6953
6954         * parameter.cs (Parameter.Resolve):  Don't access the TypeExpr's
6955         `Type' directly, but call ResolveType() on it.
6956
6957 2004-10-18  Martin Baulig  <martin@ximian.com>
6958
6959         * class.cs (FieldMember.Define): Don't access the TypeExpr's
6960         `Type' directly, but call ResolveType() on it.
6961         (MemberBase.DoDefine): Likewise.
6962
6963         * expression.cs (New.DoResolve): Don't access the TypeExpr's
6964         `Type' directly, but call ResolveType() on it.
6965         (ComposedCast.DoResolveAsTypeStep): Likewise.
6966
6967         * statement.cs (LocalInfo.Resolve): Don't access the TypeExpr's
6968         `Type' directly, but call ResolveType() on it.
6969
6970 2004-10-17  John Luke  <john.luke@gmail.com>
6971
6972         * class.cs (Operator.GetSignatureForError): use CSharpName
6973
6974         * parameter.cs (Parameter.GetSignatureForError): Returns
6975         correct name even if was not defined.
6976
6977 2004-10-13  Raja R Harinath  <rharinath@novell.com>
6978
6979         Fix #65816.
6980         * class.cs (TypeContainer.EmitContext): New property.
6981         (DefineNestedTypes): Create an emitcontext for each part.
6982         (MethodCore.DoDefineParameters): Use container's emitcontext.
6983         Pass type array to InternalParameters.
6984         (MemberBase.DoDefine): Use container's emitcontext.
6985         (FieldMember.Define): Likewise.
6986         (Event.Define): Likewise.
6987         (SetMethod.GetParameterInfo): Change argument to EmitContext.
6988         Pass type array to InternalParameters.
6989         (SetIndexerMethod.GetParameterInfo): Likewise.
6990         (SetMethod.Define): Pass emitcontext to GetParameterInfo.
6991         * delegate.cs (Define): Pass emitcontext to
6992         ComputeAndDefineParameterTypes and GetParameterInfo.  Pass type
6993         array to InternalParameters.
6994         * expression.cs (ParameterReference.DoResolveBase): Pass
6995         emitcontext to GetParameterInfo.
6996         (ComposedCast.DoResolveAsTypeStep): Remove check on
6997         ec.ResolvingTypeTree.
6998         * parameter.cs (Parameter.Resolve): Change argument to
6999         EmitContext.  Use ResolveAsTypeTerminal.
7000         (Parameter.GetSignature): Change argument to EmitContext.
7001         (Parameters.ComputeSignature): Likewise.
7002         (Parameters.ComputeParameterTypes): Likewise.
7003         (Parameters.GetParameterInfo): Likewise.
7004         (Parameters.ComputeAndDefineParameterTypes): Likewise.
7005         Re-use ComputeParameterTypes.  Set ec.ResolvingTypeTree.
7006         * support.cs (InternalParameters..ctor): Remove variant that takes
7007         a DeclSpace.
7008         * typemanager.cs (system_intptr_expr): New.
7009         (InitExpressionTypes): Initialize it.
7010
7011 2004-10-12  Chris Toshok  <toshok@ximian.com>
7012
7013         * cs-parser.jay: fix location for try_statement and catch_clause.
7014
7015 2004-10-11  Martin Baulig  <martin@ximian.com>
7016
7017         * report.cs: Don't make --fatal abort on warnings, we have
7018         -warnaserror for that.
7019
7020 2004-10-07  Raja R Harinath  <rharinath@novell.com>
7021
7022         More DeclSpace.ResolveType avoidance.
7023         * decl.cs (MemberCore.InUnsafe): New property.
7024         * class.cs (MemberBase.DoDefine): Use ResolveAsTypeTerminal 
7025         with newly created EmitContext.
7026         (FieldMember.Define): Likewise.
7027         * delegate.cs (Delegate.Define): Likewise.
7028         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup with alias
7029         only if normal name-lookup fails.
7030         (TypeExpr.DoResolve): Enable error-checking.
7031         * expression.cs (ArrayCreation.DoResolve): Use ResolveAsTypeTerminal.
7032         (SizeOf.DoResolve): Likewise.
7033         (ComposedCast.DoResolveAsTypeStep): Likewise.
7034         (StackAlloc.DoResolve): Likewise.
7035         * statement.cs (Block.Flags): Add new flag 'Unsafe'.
7036         (Block.Unsafe): New property.
7037         (Block.EmitMeta): Set ec.InUnsafe as appropriate.
7038         (Unsafe): Set 'unsafe' flag of contained block.
7039         (LocalInfo.Resolve): Use ResolveAsTypeTerminal.
7040         (Fixed.Resolve): Likewise.
7041         (Catch.Resolve): Likewise.
7042         (Using.ResolveLocalVariableDecls): Likewise.
7043         (Foreach.Resolve): Likewise.
7044
7045 2004-10-05  John Luke <john.luke@gmail.com>
7046
7047         * cs-parser.jay: add location to error CS0175
7048
7049 2004-10-04  Miguel de Icaza  <miguel@ximian.com>
7050
7051         * ecore.cs (Expression.Constantity): Add support for turning null
7052         into a constant.
7053
7054         * const.cs (Const.Define): Allow constants to be reference types
7055         as long as the value is Null.
7056
7057 2004-10-04  Juraj Skripsky  <js@hotfeet.ch>
7058
7059         * namespace.cs (NamespaceEntry.Using): No matter which warning
7060         level is set, check if this namespace name has already been added.
7061
7062 2004-10-03 Ben Maurer  <bmaurer@ximian.com>
7063
7064         * expression.cs: reftype [!=]= null should always use br[true,false].
7065         # 67410
7066
7067 2004-10-03  Marek Safar  <marek.safar@seznam.cz>
7068
7069         Fix #67108
7070         * attribute.cs: Enum conversion moved to 
7071         GetAttributeArgumentExpression to be applied to the all
7072         expressions.
7073
7074 2004-10-01  Raja R Harinath  <rharinath@novell.com>
7075
7076         Fix #65833, test-300.cs, cs0122-5.cs, cs0122-6.cs.
7077         * class.c (TypeContainer.DefineType): Flag error if
7078         base types aren't accessible due to access permissions.
7079         * decl.cs (DeclSpace.ResolveType): Move logic to
7080         Expression.ResolveAsTypeTerminal.
7081         (DeclSpace.ResolveTypeExpr): Thin layer over
7082         Expression.ResolveAsTypeTerminal.
7083         (DeclSpace.CheckAccessLevel, DeclSpace.FamilyAccess):
7084         Refactor code into NestedAccess.  Use it.
7085         (DeclSpace.NestedAccess): New.
7086         * ecore.cs (Expression.ResolveAsTypeTerminal): Add new
7087         argument to silence errors.  Check access permissions.
7088         (TypeExpr.DoResolve, TypeExpr.ResolveType): Update.
7089         * expression.cs (ProbeExpr.DoResolve): Use ResolveAsTypeTerminal.
7090         (Cast.DoResolve): Likewise.
7091         (New.DoResolve): Likewise.
7092         (InvocationOrCast.DoResolve,ResolveStatement): Likewise.
7093         (TypeOf.DoResolve): Likewise.
7094
7095         * expression.cs (Invocation.BetterConversion): Return the Type of
7096         the better conversion.  Implement section 14.4.2.3 more faithfully.
7097         (Invocation.BetterFunction): Make boolean.  Make correspondence to
7098         section 14.4.2.2 explicit.
7099         (Invocation.OverloadResolve): Update.
7100         (Invocation): Remove is_base field.
7101         (Invocation.DoResolve): Don't use is_base.  Use mg.IsBase.
7102         (Invocation.Emit): Likewise.
7103
7104 2004-09-27  Raja R Harinath  <rharinath@novell.com>
7105
7106         * README: Update to changes.
7107
7108 2004-09-24  Marek Safar  <marek.safar@seznam.cz>
7109
7110         * cs-parser.jay: Reverted 642 warning fix.
7111
7112 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7113
7114         Fix bug #66615
7115         * decl.cs (FindMemberWithSameName): Indexer can have more than
7116         1 argument.
7117
7118 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7119
7120         * expression.cs (LocalVariableReference.DoResolveLValue):
7121         Do not report warning 219 for out values.
7122         (EmptyExpression.Null): New member to avoid extra allocations.
7123
7124 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7125
7126         * cs-parser.jay: Fix wrong warning 642 report.
7127
7128         * cs-tokenizer.cs (CheckNextToken): New helper;
7129         Inspect next character if is same as expected.
7130
7131 2004-09-23  Martin Baulig  <martin@ximian.com>
7132
7133         * convert.cs (Convert.ImplicitReferenceConversion): Some code cleanup.
7134         (Convert.ImplicitReferenceConversionExists): Likewise.
7135
7136 2004-09-23  Marek Safar  <marek.safar@seznam.cz>
7137
7138         * class.cs (Operator.Define): Add error 448 and 559 report.
7139
7140 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7141
7142         * class.cs (MemberBase.IsTypePermitted): New protected
7143         method for checking error CS0610.
7144
7145 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7146
7147         * class.cs (TypeContainer.HasExplicitLayout): New property
7148         Returns whether container has StructLayout attribute set Explicit.
7149         (FieldMember): New abstract class for consts and fields.
7150         (FieldMember.ApplyAttributeBuilder): Add error 636 and 637 report.
7151         (Field): Reuse FieldMember.
7152
7153         * const.cs (Const): Reuse FieldMember.
7154
7155         * rootcontext.cs: EmitConstants call moved to class.
7156
7157 2004-09-22  Martin Baulig  <martin@ximian.com>
7158
7159         Thanks to Peter Sestoft for this bug report.
7160
7161         * expression.cs (Conditional): If both the `trueExpr' and the
7162         `falseExpr' is a NullLiteral, return a NullLiteral.
7163
7164 2004-09-22  Martin Baulig  <martin@ximian.com>
7165
7166         * statement.cs (Foreach.EmitCollectionForeach): If we're in an
7167         iterator, use `enumerator.EmitThis()' instead of `ec.EmitThis()'
7168         for the "get_Current" call.
7169
7170 2004-09-22  Martin Baulig  <martin@ximian.com>
7171
7172         Marek and me just fixed one of our oldest bugs: #28562 :-)
7173
7174         * ecore.cs (EnumConstant.GetValueAsEnumType): New public method.
7175
7176         * attribute.cs (Attribute.GetAttributeArgumentExpression): If
7177         we're an EnumConstant, just return that.
7178         (Attribute.Resolve): GetAttributeArgumentExpression() may give us
7179         an EnumConstant.  In this case, we need to use GetValueAsEnumType()
7180         to get the value which'll actually be written into the attribute.
7181         However, we have to use GetValue() to access the attribute's value
7182         in the compiler.        
7183
7184 2004-09-22  Marek Safar  <marek.safar@seznam.cz>
7185
7186         * constant.cs (Constant.IsNegative): New abstract property
7187         IsNegative.
7188
7189         * expression.cs (ArrayAccess.DoResolve): Add warning 251.
7190         (StackAlloc.DoResolve): Reused IsNegative.
7191
7192 2004-09-21  Martin Baulig  <martin@ximian.com>
7193
7194         * codegen.cs (VariableStorage): Don't store the ILGenerator here;
7195         if we're used in an iterator, we may be called from different
7196         methods.
7197
7198         * statement.cs (Foreach.EmitFinally): Only emit an `Endfinally' if
7199         we actually have an exception block.
7200
7201 2004-09-20  John Luke <jluke@cfl.rr.com>
7202
7203         * class.cs, cs-parser.jay: Improve the error report for 1520:
7204         report the actual line where the error happens, not where the
7205         class was declared.
7206
7207         * assign.cs, delegate.cs, ecore.cs, expression.cs, statement.cs:
7208         Pass location information that was available elsewhere.
7209
7210 2004-09-19  Sebastien Pouliot  <sebastien@ximian.com>
7211
7212         * codegen.cs: Fix bug #56621. It is now possible to use MCS on the MS
7213         runtime to delay sign assemblies.
7214
7215 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7216
7217         * cs-parser.jay: Do not report the stack trace, this is barely
7218         used nowadays.
7219
7220 2004-08-22  John Luke  <john.luke@gmail.com>
7221  
7222         * driver.cs : check that a resource id is not already used
7223         before adding it, report CS1508 if it is, bug #63637
7224
7225 2004-09-19  Miguel de Icaza  <miguel@ximian.com>
7226
7227         * ecore.cs: Removed dead code.
7228
7229 2004-09-18  Marek Safar  <marek.safar@seznam.cz>
7230
7231         * class.cs: Do not report warning CS0067 on the interfaces.
7232
7233 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7234
7235         * cs-parser.jay: Add error 504 report.
7236
7237 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7238
7239         * rootcontext.cs: WarningLevel is 4 by default now.
7240
7241         * statement.cs (Fixed.Resolve): Do not null
7242         VariableInfo.
7243
7244 2004-09-16  Marek Safar  <marek.safar@seznam.cz>
7245
7246         Fixed bug #55780
7247         * ecore.cs (PropertyExpr.FindAccessors): Do not perform
7248         deep search when property is not virtual.
7249         (PropertyExpr.ResolveAccessors): Make one call for both
7250         accessors.
7251
7252 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7253
7254         Fixed bug #65766
7255         * statement.cs: Error 152 report constains also location.
7256
7257 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7258
7259         Fixed bug #65766
7260         * const.cs: Explicitly set constant as static.
7261
7262 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7263
7264         Fixed bug #64226
7265         * cs-parser.jay: Add error 1017 report.
7266
7267 2004-09-15  Marek Safar  <marek.safar@seznam.cz>
7268
7269         Fixed bug #59980, #64224
7270         * expression.cs (Invocation.DoResolve): Fixed error CS0571 test.
7271
7272         * typemanager.cs (IsSpecialMethod): Simplified
7273
7274 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7275
7276         * decl.cs (MemberCore.Emit): Resuscitated VerifyObsoleteAttribute
7277         condition with better params.
7278
7279 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7280
7281         Fixed bug #65238
7282         * attribute.cs (Resolve): Property has to have both
7283         accessors.
7284
7285 2004-09-14  Martin Baulig  <martin@ximian.com>
7286
7287         * decl.cs (MemberCore.Emit): Always call VerifyObsoleteAttribute().
7288
7289 2004-09-14  Marek Safar  <marek.safar@seznam.cz>
7290
7291         Fixed bug #61902
7292         * codegen.cs (TestObsoleteMethodUsage): Trace when method is
7293         called and is obsolete then this member suppress message
7294         when call is inside next [Obsolete] method or type.
7295
7296         * expression.cs: Use TestObsoleteMethodUsage member.
7297
7298 2004-09-14  Martin Baulig  <martin@ximian.com>
7299
7300         * cs-parser.jay: Sync a bit with the GMCS version.
7301
7302 2004-09-14  Martin Baulig  <martin@ximian.com>
7303
7304         * cs-parser.jay (CSharpParser): Don't derive from GenericsParser.
7305         (CSharpParser.yacc_verbose_flag): New public field.
7306
7307         * genericparser.cs: Removed.
7308
7309 2004-09-14  Raja R Harinath  <rharinath@novell.com>
7310
7311         * cs-parser.jay (event_declaration): Re-enable cs0071 error.
7312
7313 2004-09-13  Marek Safar  <marek.safar@seznam.cz>
7314
7315         * class.cs (MethodCore.CheckBase): Fix bug #65757.
7316
7317 2004-09-10  Martin Baulig  <martin@ximian.com>
7318
7319         Backported my MemberName changes from GMCS into MCS.
7320
7321         - we are now using a special `MemberName' class instead of using
7322         strings; in GMCS, the `MemberName' also contains the type
7323         arguments.
7324
7325         - changed the grammar rules a bit:
7326           * the old `member_name' is now a `namespace_or_type_name':
7327             The rule is that we use `namespace_or_type_name' everywhere
7328             where we expect either a "member name" (GetEnumerator) or a
7329             "member name" with an explicit interface name
7330             (IEnumerable.GetEnumerator).
7331             In GMCS, the explicit interface name may include type arguments
7332             (IEnumerable<T>.GetEnumerator).
7333           * we use `member_name' instead of just `IDENTIFIER' for
7334             "member names":
7335             The rule is that we use `member_name' wherever a member may
7336             have type parameters in GMCS.       
7337
7338         * decl.cs (MemberName): New public class.
7339         (MemberCore.MemberName): New public readonly field.
7340         (MemberCore.ctor): Take a `MemberName' argument, not a string.
7341         (DeclSpace): Likewise.
7342
7343         * delegate.cs (Delegate.ctor): Take a MemberName, not a string.
7344         * enum.cs (Enum.ctor): Likewise.
7345
7346         * namespace.cs (AliasEntry.Alias): Changed type from Expression to
7347         MemberName.     
7348         (AliasEntry.ctor): Take a MemberName, not an Expression.
7349         (AliasEntry.UsingAlias): Likewise.
7350
7351         * class.cs (TypeContainer.ctor): Take a MemberName, not a string.
7352         (IMethodData.MemberName): Changed type from string to MemberName.
7353         (MemberBase.ExplicitInterfaceName): Likewise.
7354         (AbstractPropertyEventMethod.SetupName): Make this private.
7355         (AbstractPropertyEventMethod.ctor): Added `string prefix'
7356         argument; compute the member name here.
7357         (AbstractPropertyEventMethod.UpdateName): Recompute the name based
7358         on the `member.MemberName' and the `prefix'.
7359
7360         * cs-parser.jay (attribute_name): Use `namespace_or_type_name',
7361         not `type_name'.
7362         (struct_declaration): Use `member_name' instead of `IDENTIFIER';
7363         thus, we get a `MemberName' instead of a `string'.  These
7364         declarations may have type parameters in GMCS.
7365         (interface_method_declaration, delegate_declaration): Likewise.
7366         (class_declaration, interface_declaration): Likewise.
7367         (method_header): Use `namespace_or_type_name' instead of
7368         `member_name'.  We may be an explicit interface implementation.
7369         (property_declaration, event_declaration): Likewise.
7370         (member_name): This is now just an `IDENTIFIER', not a
7371         `namespace_or_type_name'.
7372         (type_name, interface_type): Removed.
7373         (namespace_or_type_name): Return a MemberName, not an Expression.
7374         (primary_expression): Use `member_name' instead of `IDENTIFIER';
7375         call GetTypeExpression() on the MemberName to get an expression.
7376         (IndexerDeclaration.interface_type): Changed type from string to
7377         MemberName.
7378         (MakeName): Operate on MemberName's instead of string's.
7379
7380 2004-09-13  Raja R Harinath  <rharinath@novell.com>
7381
7382         Fix bug #55770.
7383         * namespace.cs (AliasEntry.Resolve): Implement section 16.3.1.
7384         (NamespaceEntry.Lookup): Add new argument to flag if we want the
7385         lookup to avoid symbols introduced by 'using'.
7386         * rootcontext.cs (NamespaceLookup): Update.
7387
7388 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7389
7390         * class.cs (TypeContainer.DoDefineMembers): Do not call
7391         DefineDefaultConstructor for static classes.
7392
7393 2004-09-12  Marek Safar  <marek.safar@seznam.cz>
7394
7395         * attribute.cs (Attribute.Resolve): Add error 653 report.
7396
7397         * class.cs (Class.ApplyAttributeBuilder): Add error 641
7398         report.
7399         (Method.ApplyAttributeBuilder): Add error 685 report.
7400         (Operator.Define): Add error 564 report.
7401
7402         * cs-tokenizer.cs (handle_hex): Add error 1013 report.
7403
7404         * expression.cs (Invocation.DoResolve): Add error
7405         245 and 250 report.
7406
7407         * parameter.cs (Parameter.ApplyAttributeBuilder): Add
7408         error 674 report.
7409
7410 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7411
7412         * class.cs (ConstructorInitializer.Resolve):
7413         Wrong error number (515->516).
7414
7415 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7416
7417         * class.cs (Indexer.Define): Add error 631 report.
7418
7419 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7420
7421         * ecore.cs (Error_NegativeArrayIndex): Fix 248 error.
7422
7423 2004-09-11  Marek Safar  <marek.safar@seznam.cz>
7424
7425         * expression.cs (Probe.DoResolve): Add error CS0241 report.
7426
7427 2004-09-10  Marek Safar  <marek.safar@seznam.cz>
7428
7429         * cs-parser.jay: Added error CS0241 report.
7430
7431 2004-09-10  Raja R Harinath  <rharinath@novell.com>
7432
7433         * cs-parser.jay (fixed_statement): Introduce a scope for the
7434         declaration in the 'fixed' statement.
7435
7436 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7437
7438         * cs-parser.jay: Added CS0230 error report.
7439
7440 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7441
7442         * cs-parser.jay: Added errors CS0231 and CS0257 report.
7443
7444 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7445
7446         * expression.cs (Argument.Resolve): Added error CS0192 and
7447         CS0199 report.
7448
7449 2004-09-09  Marek Safar  <marek.safar@seznam.cz>
7450
7451         C# 2.0 #pragma warning feature
7452
7453         * cs-tokenizer.cs (PreProcessPragma): New method; 
7454         Handles #pragma directive.
7455
7456         * report.cs (WarningRegions): New class; Support
7457         class for #pragma warning directive. It tests whether
7458         warning is enabled for a given line.
7459
7460 2004-09-08  Miguel de Icaza  <miguel@ximian.com>
7461
7462         * const.cs: Add more descriptive error report, tahnks to
7463         Sebastien. 
7464
7465 2004-09-08  Marek Safar  <marek.safar@seznam.cz>
7466
7467         * ecore.cs (FieldExpr.DoResolveLValue): Fixed CS0198 report.
7468
7469 2004-09-07  Miguel de Icaza  <miguel@ximian.com>
7470
7471         * expression.cs: Apply patch from Ben: Remove dead code from
7472         ArrayCreation, and remove the TurnintoConstant call in const.cs,
7473         as that code just threw an exception anwyays.
7474
7475         * const.cs: Remove the call to the turnintoconstant, for details
7476         see bug: #63144
7477         
7478         * literal.cs: The type of the null-literal is the null type;  So
7479         we use a placeholder type (literal.cs:System.Null, defined here)
7480         for it.
7481
7482         * expression.cs (Conditional.DoResolve): Remove some old code that
7483         is no longer needed, conversions have been fixed.
7484
7485         (ArrayCreationExpression.DoResolve): Return false if we fail to
7486         resolve the inner expression.
7487
7488 2004-09-07  Raja R Harinath  <rharinath@novell.com>
7489
7490         Fix test-290.cs.
7491         * cs-parser.jay (delegate_declaration): Record a delegate
7492         declaration as a type declaration.
7493         Reported by Jo Vermeulen <jo@lumumba.luc.ac.be>.
7494
7495 2004-09-06  Miguel de Icaza  <miguel@ximian.com>
7496
7497         * parameter.cs: Do not crash if the type can not be resolved. 
7498
7499         * expression.cs: Report errors with unsafe pointers, fixes #64896
7500
7501 2004-09-06 Ben Maurer  <bmaurer@users.sourceforge.net>
7502
7503         * expression.cs: Pointer arith always needs to do a conv.i
7504         if the operand is a long. fix 65320
7505
7506 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7507
7508         Fixed cs0619-37.cs, cs0619-38.cs
7509
7510         * enum.cs (GetObsoleteAttribute): Removed.
7511
7512         * expression.cs (MemberAccess.DoResolve): Test for [Obsolete]
7513         on Enum member is double staged. The first is tested member
7514         and then enum.
7515
7516 2004-09-04  Marek Safar  <marek.safar@seznam.cz>
7517
7518         Fixed #56986, #63631, #65231
7519
7520         * class.cs: (TypeContainer.AddToMemberContainer): New method,
7521         adds member to name container.
7522         (TypeContainer.AddToTypeContainer): New method, adds type to
7523         name container.
7524         (AddConstant, AddEnum, AddClassOrStruct, AddDelegate, AddMethod,
7525         AddConstructor, AddInterface, AddField, AddProperty, AddEvent,
7526         AddOperator): Simplified by reusing AddToMemberContainer.
7527         (TypeContainer.UserDefinedStaticConstructor): Changed to property
7528         instead of field.
7529         (Method.CheckForDuplications): Fixed implementation to test all
7530         possibilities.
7531         (MemberBase): Detection whether member is explicit interface
7532         implementation is now in constructor.
7533         (MemberBase.UpdateMemberName): Handles IndexerName.
7534         (Accessor): Changed to keep also location information.
7535         (AbstractPropertyEventMethod): Is derived from MemberCore.
7536         (AbstractPropertyEventMethod.IsDummy): Says whether accessor
7537         will be emited or not.
7538         (PropertyBase.AreAccessorsDuplicateImplementation):
7539         Tests whether accessors are not in collision with some method.
7540         (Operator): Is derived from MethodCore to simplify common
7541         operations.
7542
7543         * decl.cs (Flags.TestMethodDuplication): Test for duplication
7544         must be performed.
7545         (DeclSpace.AddToContainer): Adds the member to defined_names
7546         table. It tests for duplications and enclosing name conflicts.
7547
7548         * enum.cs (EnumMember): Clean up to reuse the base structures
7549
7550 2004-09-03  Martin Baulig  <martin@ximian.com>
7551
7552         * class.cs (TypeContainer.DefineDefaultConstructor): Put this back
7553         into TypeContainer, to make partial classes work again.
7554
7555 2004-09-03  Martin Baulig  <martin@ximian.com>
7556
7557         * rootcontext.cs (RootContext.V2): Removed.
7558
7559 2004-03-23  Martin Baulig  <martin@ximian.com>
7560
7561         * expression.cs (Invocation.OverloadResolve): Added `bool
7562         may_fail' argument and use it instead of the Location.IsNull() hack.
7563
7564 2004-09-03  Martin Baulig  <martin@ximian.com>
7565
7566         Merged latest changes into gmcs.  Please keep this comment in
7567         here, it makes it easier for me to see what changed in MCS since
7568         the last time I merged.
7569
7570 2004-09-03  Raja R Harinath  <rharinath@novell.com>
7571
7572         Fix #61128.
7573         * expression.cs (BetterConversion): Don't allow either conversion 
7574         to be null.  Remove redundant implicit conversion test when 'q ==
7575         null' -- when this function is invoked, we already know that the
7576         implicit conversion exists.
7577         (BetterFunction): Assume that 'best' is non-null.  Remove
7578         redundant reimplementation of IsApplicable when 'best' is null.
7579         (IsParamsMethodApplicable, IsApplicable): Add new parameter for
7580         number of arguments.
7581         (IsAncestralType): Extract from OverloadResolve.
7582         (OverloadResolve): Make robust to the MethodGroupExpr being
7583         unsorted.  Implement all the logic of Section 14.5.5.1, and
7584         support overloading of methods from multiple applicable types.
7585         Clean up logic somewhat.  Don't pass null methods to BetterFunction.
7586
7587         * report.cs (SymbolRelatedToPreviousError): Cleanup output.
7588         (RealError, Warning): Append type of report to related symbol.
7589
7590 2004-09-03  Marek Safar  <marek.safar@seznam.cz>
7591
7592         * enum.cs: Fixed CLS-Compliance checks for enum members.
7593         Error tests cs3008-8.cs, cs3014-8.cs
7594
7595 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7596
7597         Fixed bug #62342, #63102
7598         * class.cs: ImplementIndexer uses member.IsExplicitImpl
7599         like ImplementMethod.
7600
7601 2004-09-02  Marek Safar  <marek.safar@seznam.cz>
7602
7603         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7604         Fixed bug #65170.
7605
7606 2004-09-02  Martin Baulig  <martin@ximian.com>
7607
7608         * statement.cs (Using.EmitLocalVariableDeclFinally): Use
7609         TypeManager.GetArgumentTypes() rather than calling GetParameters()
7610         on the MethodBase.
7611
7612 2004-09-01  Marek Safar  <marek.safar@seznam.cz>
7613
7614         C# 2.0 Static classes implemented
7615
7616         * class.cs (TypeContainer): instance_constructors,
7617         initialized_fields, initialized_static_fields,
7618         default_constructor, base_inteface_types are protected to be
7619         accessible from StaticClass.
7620         (TypeContainer.DefineDefaultConstructor): New virtual method
7621         for custom default constructor generating
7622         (StaticClass): New class to handle "Static classes" feature.
7623
7624         * cs-parser.jay: Handle static keyword on class like instance
7625         of StaticClass.
7626
7627         * driver.cs: Added "/langversion" command line switch with two
7628         options (iso-1, default).
7629
7630 2004-08-31  Marek Safar  <marek.safar@seznam.cz>
7631
7632         * ecore.cs (FieldExpr.Resolve): Fixed bug #64689.
7633
7634 2004-08-31  Miguel de Icaza  <miguel@ximian.com>
7635
7636         * delegate.cs: Style.
7637
7638 2004-08-31 Ben Maurer  <bmaurer@users.sourceforge.net>
7639
7640         * delegate.cs: Add seperate instance expr field for miguel.
7641
7642 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7643
7644         * PointerArithmetic (Resolve): make sure we are not doing
7645         pointer arith on void*. Also, make sure we are resolved
7646         by not setting eclass until resolve.
7647
7648         All callers: Make sure that PointerArithmetic gets resolved.
7649
7650 2004-08-29 Ben Maurer  <bmaurer@users.sourceforge.net>
7651
7652         * ArrayCreation (LookupType): If the type does not resolve 
7653         to an array, give an error.
7654
7655 2004-08-27  Marek Safar  <marek.safar@seznam.cz>
7656
7657         * statement.cs (Try.Resolve): Fixed bug #64222
7658
7659 2004-08-27  Martin Baulig  <martin@ximian.com>
7660
7661         * class.cs
7662         (TC.OperatorArrayList.OperatorEntry.CheckPairedOperators): Don't
7663         crash here.     
7664
7665 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7666
7667         * ecore.cs (Constantify): Get underlying type via
7668         System.Enum.GetUnderlyingType to avoid StackOverflow on the
7669         Windows in special cases.
7670
7671 2004-08-26  Marek Safar  <marek.safar@seznam.cz>
7672
7673         * typemanager.cs (GetAddMethod): Used GetAddMethod (true)
7674         for obtaining also private methods.
7675         (GetRemoveMethod): Used GetRemoveMethod (true)
7676         for obtaining also private methods.
7677
7678 2004-08-24  Martin Baulig  <martin@ximian.com>
7679
7680         * class.cs (Method.Define): Set MethodAttributes.SpecialName and
7681         MethodAttributes.HideBySig for operators.
7682
7683 2004-08-23  Martin Baulig  <martin@ximian.com>
7684
7685         Back to the old error reporting system :-)
7686
7687         * report.cs (Message): Removed.
7688         (Report.MessageData, ErrorData, WarningData): Removed.
7689         (Report.Error, Warning): Back to the old system.
7690
7691 2004-08-23  Martin Baulig  <martin@ximian.com>
7692
7693         * decl.cs (IMemberContainer.Parent): Renamed to ParentContainer.
7694
7695         * class.cs (TypeContainer.ParentContainer): New public virtual
7696         method; replaces the explicit interface implementation.
7697         (ClassPart.ParentContainer): Override.
7698
7699 2004-08-23  Martin Baulig  <martin@ximian.com>
7700
7701         * statement.cs (Switch): Added support for constant switches; see
7702         #59428 or test-285.cs.
7703
7704 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7705
7706         Fixed bug #62740.
7707         * statement.cs (GetEnumeratorFilter): Removed useless
7708         logic because C# specs is strict. GetEnumerator must be
7709         public.
7710
7711 2004-08-22  Martin Baulig  <martin@ximian.com>
7712
7713         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
7714         a switch and may break, reset the barrier.  Fixes #59867.
7715
7716 2004-08-22  Marek Safar  <marek.safar@seznam.cz>
7717
7718         CLS-Compliance speed up (~5% for corlib)
7719
7720         * attribute.cs (AttributeTester.VerifyTopLevelNameClsCompliance):
7721         New method. Tests container for CLS-Compliant names
7722
7723         * class.cs (TypeContainer.VerifyClsName): New method.
7724         Checks whether container name is CLS Compliant.
7725         (Constructor): Implements IMethodData.
7726
7727         * decl.cs (MemberCache.GetPublicMembers ): New method. Builds
7728         low-case table for CLS Compliance test.
7729         (MemberCache.VerifyClsParameterConflict): New method.
7730         Checks method parameters for CS3006 error.
7731
7732         * enum.cs (EnumMember): Is derived from MemberCore.
7733         (Enum.VerifyClsName): Optimized for better performance.
7734
7735 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7736
7737         * report.cs: Renamed Error_T to Error and changed all
7738         references.
7739
7740 2004-08-06  Marek Safar  <marek.safar@seznam.cz>
7741
7742         * class.cs (TypeContainer.IndexerArrayList): New inner class
7743         container for indexers.
7744         (TypeContainer.DefaultIndexerName): New constant for default
7745         indexer name. Replaced all "Item" with this constant.
7746         (TypeContainer.DefineIndexers): Moved to IndexerArrayList class.
7747
7748         * typemanager.cs (TypeManager.default_member_ctor): Cache here
7749         DefaultMemberAttribute constructor.
7750
7751 2004-08-05  Martin Baulig  <martin@ximian.com>
7752
7753         * flowanalysis.cs (FlowBranching.UsageVector.MergeJumpOrigins):
7754         Fix bug #59429.
7755
7756 2004-08-05  Marek Safar  <marek.safar@seznam.cz>
7757
7758         * mcs.exe.sources: $(EXTRA_SOURCES) are now here to avoid
7759         multi platforms problem.
7760
7761         * compiler.csproj: Included shared files.
7762
7763 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7764
7765         Fix bug 60333, 55971 in the more general way
7766         * attribute.cs (Attribute.GetAttributeArgumentExpression):
7767         Added arg_type argument for constant conversion.
7768         (Attribute.Resolve): Reuse GetAttributeArgumentExpression.
7769
7770 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7771
7772         Fix bug #59760
7773         * class.cs (TypeContainer ): New inner classes MethodArrayList, 
7774         OperatorArrayList, MethodCoreArrayList for typecontainer
7775         containers. Changed class member types to these new types.
7776         (MethodArrayList.DefineMembers): Added test for CS0659.
7777
7778 2004-08-04  Miguel de Icaza  <miguel@ximian.com>
7779
7780         * cfold.cs: Synchronize the folding with the code in expression.cs
7781         Binary.DoNumericPromotions for uint operands.
7782
7783         * attribute.cs: Revert patch from Raja, it introduced a regression
7784         while building Blam-1.2.1 (hard to isolate a test case).
7785
7786 2004-08-04  Marek Safar  <marek.safar@seznam.cz>
7787
7788         Fix for #55382
7789         * class.cs:
7790         (TypeContainer.Define): Renamed to DefineContainerMembers because of
7791         name collision.
7792         (MethodCore.parent_method): New member. The method we're overriding
7793         if this is an override method.
7794         (MethodCore.CheckBase): Moved from Method class and made common.
7795         (MethodCore.CheckMethodAgainstBase): Moved from MemberBase and made
7796         private.
7797         (MethodCore.CheckForDuplications): New abstract method. For custom
7798         member duplication search in a container
7799         (MethodCore.FindOutParentMethod): New abstract method. Gets parent
7800         method and its return type.
7801         (Event.conflict_symbol): New member. Symbol with same name in the
7802         parent class.
7803
7804         * decl.cs:
7805         (MemberCache.FindMemberWithSameName): New method. The method
7806         is looking for conflict with inherited symbols.
7807
7808 2004-08-04  Martin Baulig  <martin@ximian.com>
7809
7810         * codegen.cs (VariableStorage.EmitLoadAddress): New public method.
7811
7812         * statement.cs (Foreach.EmitFinally): Make this work for valuetypes.
7813
7814 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7815
7816         * report.cs (Message): New enum for better error, warning reference in
7817         the code.
7818         (MessageData): New inner abstract class. It generally handles printing of
7819         error and warning messages.
7820         Removed unused Error, Warning, Message methods.
7821
7822 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7823
7824         Fix for cs0592-8.cs test
7825         * attribute.cs
7826         (Attributable.ValidAttributeTargets): Made public.
7827         (Attribute.ExplicitTarget): New member for explicit target value.
7828         (Attribute.CheckTargets): Now we translate explicit attribute
7829         target to Target here.
7830
7831 2004-08-03  Ben Maurer  <bmaurer@ximian.com>
7832
7833         * ecore.cs (MethodGroupExpr): new IsBase property.
7834
7835         * expression.cs (BaseAccess): Set IsBase on MethodGroupExpr.
7836
7837         * delegate.cs (DelegateCreation): store a MethodGroupExpr
7838         rather than an instance expr.
7839
7840         (DelegateCreation.Emit): Use the method group rather than
7841         the instance expression. Also, if you have base.Foo as the
7842         method for a delegate, make sure to emit ldftn, not ldftnvirt.
7843
7844         (ResolveMethodGroupExpr): Use the MethodGroupExpr. 
7845
7846         (NewDelegate.DoResolve): Only check for the existance of Invoke
7847         if the method is going to be needed. Use MethodGroupExpr.
7848
7849         (NewDelegate.Emit): Remove, DelegateCreation implements this.   
7850
7851         * expression.cs: For pointer arith., make sure to use
7852         the size of the type, not the size of the pointer to
7853         the type.
7854
7855 2004-08-03  Marek Safar  <marek.safar@seznam.cz>
7856
7857         Fix for #60722
7858         * class.cs (Class): Added error CS0502 test.
7859
7860 2004-08-03  John Luke  <jluke@cfl.rr.com>
7861             Raja R Harinath  <rharinath@novell.com>
7862
7863         Fix for #60997.
7864         * attribute.cs (Attribute.complained_before): New flag.
7865         (Attribute.ResolveType, Attribute.Resolve),
7866         (Attribute.DefinePInvokeMethod): Set it.
7867         (Attributes.Search): Pass 'complain' to Attribute.ResolveType.
7868         
7869 2004-08-03  Martin Baulig  <martin@ximian.com>
7870
7871         * expression.cs (Binary.ResolveOperator): Don't abort if we can't
7872         use a user-defined operator; we still need to do numeric
7873         promotions in case one argument is a builtin type and the other
7874         one has an implicit conversion to that type.  Fixes #62322.
7875
7876 2004-08-02  Martin Baulig  <martin@ximian.com>
7877
7878         * statement.cs (LocalInfo.Flags): Added `IsThis'.
7879         (LocalInfo.IsThis): New public property.
7880         (Block.EmitMeta): Don't create a LocalBuilder for `this'.
7881
7882 2004-08-01  Martin Baulig  <martin@ximian.com>
7883
7884         * class.cs (TypeContainer.GetClassBases): Don't set the default
7885         here since we may get called from GetPartialBases().
7886         (TypeContainer.DefineType): If GetClassBases() didn't return a
7887         parent, use the default one.
7888
7889 2004-07-30  Duncan Mak  <duncan@ximian.com>
7890
7891         * Makefile (mcs2.exe, mcs3.exe): add $(EXTRA_SOURCES).
7892
7893 2004-07-30  Martin Baulig  <martin@ximian.com>
7894
7895         * Makefile (EXTRA_SOURCES): List the symbol writer's sources here.
7896
7897         * class.cs (SourceMethod): New public class, derive from the
7898         symbol writer's ISourceMethod.
7899         (Method): Use the new symbol writer API.
7900
7901         * codegen.cs (CodeGen.InitializeSymbolWriter): Take the filename
7902         as argument and use the new symbol writer.
7903
7904         * location.cs
7905         (SourceFile): Implement the symbol writer's ISourceFile.
7906         (Location.SymbolDocument): Removed.
7907         (Location.SourceFile): New public property.
7908
7909         * symbolwriter.cs: Use the new symbol writer API.
7910
7911 2004-07-30  Raja R Harinath  <rharinath@novell.com>
7912
7913         * Makefile (install-local): Remove.  Functionality moved to
7914         executable.make.
7915
7916 2004-07-28  Lluis Sanchez Gual  <lluis@novell.com>
7917
7918         * Makefile: Install mcs.exe.config file together with mcs.exe.
7919         * mcs.exe.config: Added supportedRuntime entry to make sure it runs in the
7920         correct runtime version.
7921         
7922 2004-07-25  Martin Baulig  <martin@ximian.com>
7923
7924         * class.cs
7925         (TypeContainer.RegisterOrder): Removed, this was unused.
7926         (TypeContainer, interface_order): Removed.
7927         (TypeContainer.AddClass, AddStruct, AddInterface): Take a
7928         TypeContainer as argument since we can also be called with a
7929         `PartialContainer' for a partial class/struct/interface.
7930         (TypeContainer.IsInterface): Use `Kind == Kind.Interface' instead
7931         of checking whether we're an `Interface' - we could be a
7932         `PartialContainer'.
7933         (PartialContainer.Register): Override; call
7934         AddClass()/AddStruct()/AddInterface() on our parent.
7935
7936         * cs-parser.jay (interface_member_declaration): Add things to the
7937         `current_container', not the `current_class'.
7938
7939         * rootcontext.cs (RegisterOrder): The overloaded version which
7940         takes an `Interface' was unused, removed.
7941
7942         * typemanager.cs (TypeManager.LookupInterface): Return a
7943         `TypeContainer', not an `Interface'.
7944         (TypeManager.IsInterfaceType): The `builder_to_declspace' may
7945         contain a `PartialContainer' for an interface, so check it's
7946         `Kind' to figure out what it is.
7947
7948 2004-07-25  Martin Baulig  <martin@ximian.com>
7949
7950         * class.cs (Class.DefaultTypeAttributes): New public constant.
7951         (Struct.DefaultTypeAttributes): Likewise.
7952         (Interface.DefaultTypeAttributes): Likewise.
7953         (PartialContainer.TypeAttr): Override this and add the
7954         DefaultTypeAttributes.
7955
7956 2004-07-25  Martin Baulig  <martin@ximian.com>
7957
7958         * decl.cs (DeclSpace.Emit): Removed the `TypeContainer' argument,
7959         we can just use the `Parent' field instead.
7960
7961 2004-07-25  Martin Baulig  <martin@ximian.com>
7962
7963         * class.cs (TypeContainer.Emit): Renamed to EmitType().
7964
7965 2004-07-25  Martin Baulig  <martin@ximian.com>
7966
7967         * class.cs (TypeContainer.DefineMembers): Call DefineMembers() on
7968         our parts before defining any methods.
7969         (TypeContainer.VerifyImplements): Make this virtual.
7970         (ClassPart.VerifyImplements): Override and call VerifyImplements()
7971         on our PartialContainer.
7972
7973 2004-07-25  Martin Baulig  <martin@ximian.com>
7974
7975         * iterators.cs (Iterator.Define): Renamed to DefineIterator().
7976
7977         * decl.cs (DeclSpace.Define): Removed the `TypeContainer'
7978         argument, we can just use the `Parent' field instead.
7979
7980         * class.cs
7981         (MemberBase.CheckBase): Removed the `TypeContainer' argument.   
7982         (MemberBase.DoDefine): Likewise.
7983
7984 2004-07-24  Martin Baulig  <martin@ximian.com>
7985
7986         * decl.cs (MemberCore.Parent): New public field.
7987         (DeclSpace.Parent): Moved to MemberCore.
7988
7989         * class.cs (MethodCore.ds): Removed; use `Parent' instead.
7990         (MemberBase.ctor): Added TypeContainer argument, pass it to our
7991         parent's .ctor.
7992         (FieldBase, Field, Operator): Likewise.
7993         (EventProperty.ctor): Take a TypeContainer instead of a DeclSpace.
7994         (EventField, Event): Likewise.
7995
7996 2004-07-23  Martin Baulig  <martin@ximian.com>
7997
7998         * class.cs (PartialContainer): New public class.
7999         (ClassPart): New public class.
8000         (TypeContainer): Added support for partial classes.
8001         (TypeContainer.GetClassBases): Splitted some of the functionality
8002         out into GetNormalBases() and GetPartialBases().
8003
8004         * cs-tokenizer.cs (Token.PARTIAL): New token.
8005         (Tokenizer.consume_identifier): Added some hacks to recognize
8006         `partial', but only if it's immediately followed by `class',
8007         `struct' or `interface'.
8008
8009         * cs-parser.jay: Added support for partial clases.
8010
8011 2004-07-23  Martin Baulig  <martin@ximian.com>
8012
8013         * class.cs (MethodCore.ds): Made this a `TypeContainer' instead of
8014         a `DeclSpace' and also made it readonly.
8015         (MethodCore.ctor): Take a TypeContainer instead of a DeclSpace.
8016         (Method.ctor, Constructor.ctor, Destruktor.ctor): Likewise.
8017         (PropertyBase.ctor, Property.ctor, Indexer.ctor): Likewise.
8018
8019         * cs-parser.jay: Pass the `current_class', not the
8020         `current_container' (at the moment, this is still the same thing)
8021         to a new Method, Property, Event, Indexer or Constructor.
8022
8023 2004-07-23  Martin Baulig  <martin@ximian.com>
8024
8025         * cs-parser.jay (CSharpParser): Added a new `current_class' field
8026         and removed the `current_interface' one.
8027         (struct_declaration, class_declaration, interface_declaration):
8028         Set `current_class' to the newly created class/struct/interface;
8029         set their `Bases' and call Register() before parsing their body.
8030
8031 2004-07-23  Martin Baulig  <martin@ximian.com>
8032
8033         * class.cs (Kind): New public enum.
8034         (TypeContainer): Made this class abstract.
8035         (TypeContainer.Kind): New public readonly field.
8036         (TypeContainer.CheckDef): New public method; moved here from
8037         cs-parser.jay.
8038         (TypeContainer.Register): New public abstract method.
8039         (TypeContainer.GetPendingImplementations): New public abstract
8040         method.
8041         (TypeContainer.GetClassBases): Removed the `is_class' and
8042         `is_iface' parameters.
8043         (TypeContainer.DefineNestedTypes): Formerly known as
8044         DoDefineType().
8045         (ClassOrStruct): Made this class abstract.
8046
8047         * tree.cs (RootTypes): New public type. 
8048
8049 2004-07-20  Martin Baulig  <martin@ximian.com>
8050
8051         * tree.cs (Tree.RecordNamespace): Removed.
8052         (Tree.Namespaces): Removed.
8053
8054         * rootcontext.cs (RootContext.IsNamespace): Removed.
8055
8056         * cs-parser.jay (namespace_declaration): Just create a new
8057         NamespaceEntry here.
8058
8059 2004-07-20  Martin Baulig  <martin@ximian.com>
8060
8061         * statement.cs (ExceptionStatement): New abstract class.  This is
8062         now used as a base class for everyone who's using `finally'.
8063         (Using.ResolveLocalVariableDecls): Actually ResolveLValue() all
8064         our local variables before using them.
8065
8066         * flowanalysis.cs (FlowBranching.StealFinallyClauses): New public
8067         virtual method.  This is used by Yield.Resolve() to "steal" an
8068         outer block's `finally' clauses.
8069         (FlowBranchingException): The .ctor now takes an ExceptionStatement
8070         argument.
8071
8072         * codegen.cs (EmitContext.StartFlowBranching): Added overloaded
8073         version which takes an ExceptionStatement.  This version must be
8074         used to create exception branchings.
8075
8076         * iterator.cs
8077         (Yield.Resolve): "Steal" all `finally' clauses from containing blocks.
8078         (Iterator.EmitMoveNext): Added exception support; protect the
8079         block with a `fault' clause, properly handle 'finally' clauses.
8080         (Iterator.EmitDispose): Run all the `finally' clauses here.
8081
8082 2004-07-20  Martin Baulig  <martin@ximian.com>
8083
8084         * iterator.cs: This is the first of a set of changes in the
8085         iterator code.  Match the spec more closely: if we're an
8086         IEnumerable, then GetEnumerator() must be called.  The first time
8087         GetEnumerator() is called, it returns the current instance; all
8088         subsequent invocations (if any) must create a copy.
8089
8090 2004-07-19  Miguel de Icaza  <miguel@ximian.com>
8091
8092         * expression.cs: Resolve the constant expression before returning
8093         it. 
8094
8095 2004-07-19  Martin Baulig  <martin@ximian.com>
8096
8097         * iterators.cs (Iterator.MapVariable): Don't define fields twice.
8098         (Iterator.MoveNextMethod.DoEmit): Use `TypeManager.int32_type' as
8099         the return type of the new EmitContext.
8100
8101 2004-07-18  Martin Baulig  <martin@ximian.com>
8102
8103         * class.cs (Property.Define): Fix iterators.
8104
8105         * iterators.cs (Iterator.Define): Moved the
8106         `container.AddInterator (this)' call here from the .ctor; only do
8107         it if we resolved successfully.
8108
8109 2004-07-17  Miguel de Icaza  <miguel@ximian.com>
8110
8111         * cs-tokenizer.cs (handle_preprocessing_directive): Do not return
8112         `true' for preprocessing directives that we parse.  The return
8113         value indicates whether we should return to regular tokenizing or
8114         not, not whether it was parsed successfully.
8115
8116         In the past if we were in: #if false ... #line #endif, we would
8117         resume parsing after `#line'.  See bug 61604.
8118
8119         * typemanager.cs: Removed an old hack from Gonzalo to get corlib
8120         building: IsEnumType should return true only for enums, not for
8121         enums or System.Enum itself.  This fixes #61593.
8122
8123         Likely what happened is that corlib was wrong: mcs depended on
8124         this bug in some places.  The bug got fixed, we had to add the
8125         hack, which caused bug 61593.
8126
8127         * expression.cs (ArrayAccess.GetStoreOpCode): Remove an old hack
8128         that was a workaround for the older conditions.
8129
8130 2004-07-16  Ben Maurer  <bmaurer@ximian.com>
8131
8132         * assign.cs: IAssignMethod has a new interface, as documented
8133         inline. All assignment code now uses this new api.
8134
8135         * ecore.cs, expression.cs: All classes which implement
8136         IAssignMethod now use the new interface.
8137
8138         * expression.cs (Invocation): add a hack to EmitCall so that
8139         IndexerAccess can be the target of a compound assignment without
8140         evaluating its arguments twice.
8141
8142         * statement.cs: Handle changes in Invocation api.
8143
8144 2004-07-16  Martin Baulig  <martin@ximian.com>
8145
8146         * iterators.cs: Rewrote this.  We're now using one single Proxy
8147         class for both the IEnumerable and the IEnumerator interface and
8148         `Iterator' derives from Class so we can use the high-level API.
8149
8150         * class.cs (TypeContainer.AddIterator): New method.
8151         (TypeContainer.DoDefineType): New protected virtual method, which
8152         is called from DefineType().
8153         (TypeContainer.DoDefineMembers): Call DefineType() and
8154         DefineMembers() on all our iterators.
8155         (TypeContainer.Emit): Call Emit() on all our iterators.
8156         (TypeContainer.CloseType): Call CloseType() on all our iterators.
8157
8158         * codegen.cs (EmitContext.CurrentIterator): New public field.
8159
8160 2004-07-15  Martin Baulig  <martin@ximian.com>
8161
8162         * typemanager.cs
8163         (TypeManager.not_supported_exception_type): New type.   
8164
8165 2004-07-14  Martin Baulig  <martin@ximian.com>
8166
8167         * iterators.cs: Use real error numbers.
8168
8169 2004-07-14  Martin Baulig  <martin@ximian.com>
8170
8171         * iterator.cs (IteratorHandle.IsIEnumerable): The spec explicitly
8172         requires this to be a System.Collection.IEnumerable and not a
8173         class implementing that interface.
8174         (IteratorHandle.IsIEnumerator): Likewise, for IEnumerator.      
8175
8176 2004-07-13  Marek Safar  <marek.safar@seznam.cz>
8177
8178         * class.cs: Fixed previous fix, it broke some error tests.
8179
8180 2004-07-12  Martin Baulig  <martin@ximian.com>
8181
8182         * enum.cs (Enum.Define): Call Emit() to emit the attributes.
8183         Fixes #61293.
8184
8185 2004-07-09  Miguel de Icaza  <miguel@ximian.com>
8186
8187         * assign.cs (LocalTemporary): Add new argument: is_address,If
8188         `is_address' is true, then the value that we store is the address
8189         to the real value, and not the value itself.
8190         
8191         * ecore.cs (PropertyExpr): use the new local temporary
8192         stuff to allow us to handle X.Y += z (where X is a struct)
8193
8194 2004-07-08  Martin Baulig  <martin@ximian.com>
8195
8196         * statement.cs (Lock.Resolve): Set ec.NeedReturnLabel() if we do
8197         not always return, just like we're doing in Using.Resolve().
8198
8199 2004-07-07  Miguel de Icaza  <miguel@ximian.com>
8200
8201         * cs-parser.jay (fixed_statement): flag this as Pinned.
8202
8203 2004-07-06  Miguel de Icaza  <miguel@ximian.com>
8204
8205         * typemanager.cs (TypeManager): Removed MakePinned method, this
8206         mechanism is replaced with the .NET 2.x compatible mechanism of
8207         calling `ILGenerator.DeclareLocal (Type t, bool pinned)'.
8208
8209         * statement.cs (LocalInfo): Remove MakePinned, add Pinned property 
8210         Rename `Fixed' to `Pinned' as a flag, to distinguish from the
8211         `IsFixed' property which has a different meaning.
8212
8213 2004-07-02  Raja R Harinath  <rharinath@novell.com>
8214
8215         * ecore.cs (DoSimpleNameResolve): Expand CS0038 check to all names
8216         visible from inside a nested class, not just the names of the
8217         immediately enclosing class.
8218         Fix for bug #60730.
8219
8220 2004-06-24  Raja R Harinath  <rharinath@novell.com>
8221
8222         * expression.cs (BetterConversion): Remove buggy special-case
8223         handling of "implicit constant expression conversions".  At this
8224         point, we already know that the conversion is possible -- we're
8225         only checking to see which is better.
8226
8227 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8228
8229         * cs-parser.jay: Added error CS0210 test.
8230
8231 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8232
8233         * cs-parser.jay: Added error CS0134 test.
8234
8235 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8236
8237         Fix bug #52507
8238         * cs-parser.jay: Added error CS0145 test.
8239
8240 2004-06-24  Marek Safar  <marek.safar@seznam.cz>
8241
8242         * class.cs (Operator.Define): Added test for errors CS0553, CS0554.
8243
8244 2004-06-23  Ben Maurer  <bmaurer@ximian.com>
8245         
8246         * expression.cs (StackAlloc.Resolve): The argument may not
8247         be a constant; deal with this case.
8248         
8249 2004-06-23  Marek Safar  <marek.safar@seznam.cz>
8250
8251         * attribute.cs (IndexerName_GetIndexerName): Renamed to
8252         GetIndexerAttributeValue.
8253         (ScanForIndexerName): Renamed to GetIndexerNameAttribute.
8254
8255         * class.cs (Indexer.Define): Added error tests for CS0415,
8256         CS0609.
8257
8258 2004-06-23  Miguel de Icaza  <miguel@ximian.com>
8259
8260         * attribute.cs (Attribute.Resolve): Keep field code in sync with
8261         property code.
8262
8263 2004-06-23  Martin Baulig  <martin@ximian.com>
8264
8265         * flowanalysis.cs (UsageVector.MergeChild): If we're a loop and we
8266         neither return nor throw, reset the barrier as well.  Fixes #60457.
8267
8268 2004-06-22  Atsushi Enomoto  <atsushi@ximian.com>
8269
8270         * class.cs : EventAttributes is now set to None by default.
8271           This fixes bug #60459.
8272
8273 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8274
8275         Fix bug #60219
8276         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8277         Don't throw exception but return null (it's sufficient now).
8278
8279 2004-06-18  Marek Safar  <marek.safar@seznam.cz>
8280
8281         * typemanager.cs (GetArgumentTypes): Faster implementation.
8282
8283 2004-06-18  Martin Baulig  <martin@ximian.com>
8284
8285         * attribute.cs (Attribute.Resolve): Check whether we're an
8286         EmptyCast which a Constant child.  Fixes #60333.
8287
8288 2004-06-17  Ben Maurer  <bmaurer@ximian.com>
8289
8290         * statement.cs (EmitCollectionForeach): Account for the fact that
8291         not all valuetypes are in areas which we can take the address of.
8292         For these variables, we store to a temporary variable. Also, make
8293         sure that we dont emit a `callvirt' on a valuetype method.
8294
8295 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8296
8297         * expression.cs (StackAlloc.DoReSolve): Added test for
8298         negative parameter (CS0247).
8299
8300 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8301
8302         Fix bug #59792
8303         * class.cs: (Event.DelegateMethod.Emit): Added synchronization flag.
8304
8305 2004-06-15  Marek Safar  <marek.safar@seznam.cz>
8306
8307         Fix bug #59781
8308         * expression.cs: (Binary.DoNumericPromotions): Added conversion for
8309         ulong.
8310
8311 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8312
8313         Fix bug #58254 & cs1555.cs, cs1556.cs
8314         * driver.cs (MainDriver): Added tests for errors CS1555, CS1556.
8315
8316 2004-06-14  Marek Safar  <marek.safar@seznam.cz>
8317
8318         * cs-parser.jay: Added error CS1669 test for indexers.
8319
8320 2004-06-11  Martin Baulig  <martin@ximian.com>
8321
8322         * expression.cs (Invocation.IsParamsMethodApplicable): We need to
8323         call this twice: for params and varargs methods.
8324
8325 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8326
8327         * class.cs:
8328         (FieldBase.DoDefine, PropertyBase.DoDefine): Added error test CS0610.
8329
8330 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8331
8332         * attribute.cs (Attribute.GetValidTargets): Made public.
8333
8334         * class.cs: 
8335         (AbstractPropertyEventMethod): New class for better code sharing.
8336         (AbstractPropertyEventMethod.ApplyAttributeBuilder): Add error
8337         CS1667 report.
8338         (PropertyMethod, DelegateMethod): Derived from AbstractPropertyEventMethod
8339
8340 2004-06-11  Raja R Harinath  <rharinath@novell.com>
8341
8342         Fix bug #59477.
8343         * ecore.cs (ResolveFlags): Add new 'Intermediate' flag to tell
8344         that the call to Resolve is part of a MemberAccess.
8345         (Expression.Resolve): Use it for SimpleName resolution.
8346         (SimpleName.SimpleNameResolve, SimpleName.DoResolveAllowStatic):
8347         Add 'intermediate' boolean argument.
8348         (SimpleName.DoSimpleNameResolve): Likewise.  Use it to disable an
8349         error message when the SimpleName can be resolved ambiguously
8350         between an expression and a type.
8351         * expression.cs (MemberAccess.IdenticalNameAndTypeName): Make
8352         public.
8353         (MemberAccess.Resolve): Pass 'Intermediate' flag to the Resolve()
8354         call on the left-side.
8355
8356 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8357
8358         * class.cs:
8359         (MethodCore.VerifyClsCompliance): Added test for error CS3000.
8360
8361 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8362
8363         * attribute.cs (Attribute.Emit): Fixed error CS0579 reporting.
8364
8365 2004-06-11  Martin Baulig  <martin@ximian.com>
8366
8367         * expression.cs (Invocation.EmitCall): Use OpCodes.Callvirt for
8368         varargs methods if applicable.
8369
8370 2004-06-11  Martin Baulig  <martin@ximian.com>
8371
8372         * expression.cs (Invocation.EmitCall): Don't use
8373         `method.CallingConvention == CallingConventions.VarArgs' since the
8374         method could also have `CallingConventions.HasThis'.
8375
8376 2004-06-11  Marek Safar  <marek.safar@seznam.cz>
8377
8378         * class.cs (Event.GetSignatureForError): Implemented.
8379         Fixed crash in error test cs3010.cs
8380
8381 2004-06-10  Miguel de Icaza  <miguel@ximian.com>
8382
8383         * cs-tokenizer.cs: Change the way we track __arglist to be
8384         consistent with the other keywords.
8385
8386 2004-06-09  Miguel de Icaza  <miguel@ximian.com>
8387
8388         * codegen.cs: FAQ avoider: turn 1577 into a warning for now until
8389         tomorrow.
8390
8391 2004-06-09  Sebastien Pouliot  <sebastien@ximian.com>
8392
8393         * codegen.cs: Check that all referenced assemblies have a strongname
8394         before strongnaming the compiled assembly. If not report error CS1577.
8395         Fix bug #56563. Patch by Jackson Harper.
8396         * typemanager.cs: Added a method to return all referenced assemblies.
8397         Fix bug #56563. Patch by Jackson Harper.
8398
8399 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8400
8401         * class.cs:
8402         (Method.ApplyAttributeBuilder): Moved and added conditional
8403         attribute error tests (CS0577, CS0578, CS0243, CS0582, CS0629).
8404
8405         * delegate.cs:
8406         (DelegateCreation.ResolveMethodGroupExpr): Added error CS1618 test.
8407
8408 2004-06-08  Marek Safar  <marek.safar@seznam.cz>
8409
8410         Fixed #59640
8411         * class.cs: (EventField.attribute_targets): Changed default target.
8412
8413 2004-06-08  Martin Baulig  <martin@ximian.com>
8414
8415         * expression.cs (Invocation.EmitCall): Enable varargs methods.
8416
8417 2004-06-08  Martin Baulig  <martin@ximian.com>
8418
8419         * rootcontext.cs (ResolveCore): Added "System.RuntimeArgumentHandle".
8420
8421 2004-06-07  Martin Baulig  <martin@ximian.com>
8422
8423         Added support for varargs methods.
8424
8425         * cs-tokenizer.cs (Token.ARGLIST): New token for the `__arglist'
8426         keyword.
8427
8428         * cs-parser.jay: Added support for `__arglist'.
8429
8430         * decl.cs (MemberCache.AddMethods): Don't ignore varargs methods.
8431
8432         * expression.cs (Argument.AType): Added `ArgList'.
8433         (Invocation): Added support for varargs methods.
8434         (ArglistAccess): New public class.
8435         (Arglist): New public class.
8436
8437         * parameter.cs (Parameter.Modifier): Added `ARGLIST'.
8438
8439         * statement.cs (Block.Flags): Added `HasVarargs'.  We set this on
8440         a method's top-level block if the method has varargs.
8441
8442         * support.cs (ReflectionParameters, InternalParameters): Added
8443         support for varargs methods.    
8444
8445 2004-06-07  Miguel de Icaza  <miguel@ximian.com>
8446
8447         * class.cs: Provide location in indexer error report.
8448
8449         * driver.cs: Use standard names.
8450
8451         * namespace.cs: Catch the use of using after a namespace has been
8452         declared also on using aliases.
8453
8454 2004-06-03  Raja R Harinath  <rharinath@novell.com>
8455
8456         Bug #50820.
8457         * typemanager.cs (closure_private_ok, closure_invocation_type)
8458         (closure_qualifier_type, closure_invocation_assembly)
8459         (FilterWithClosure): Move to ...
8460         (Closure): New internal nested class.
8461         (Closure.CheckValidFamilyAccess): Split out from Closure.Filter.
8462         (MemberLookup, RealMemberLookup): Add new almost_match parameter.
8463         * ecore.cs (almostMatchedMembers): New variable to help report CS1540.
8464         (MemberLookup, MemberLookupFailed): Use it.
8465         * expression.cs (New.DoResolve): Treat the lookup for the
8466         constructor as being qualified by the 'new'ed type.
8467         (Indexers.GetIndexersForTypeOrInterface): Update.
8468
8469 2004-06-03  Marek Safar  <marek.safar@seznam.cz>
8470
8471         * attribute.cs
8472         (GetConditionalAttributeValue): New method. Returns
8473         condition of ConditionalAttribute.
8474         (SearchMulti): New method.  Returns all attributes of type 't'.
8475         Use it when attribute is AllowMultiple = true.
8476         (IsConditionalMethodExcluded): New method.
8477
8478         * class.cs
8479         (Method.IsExcluded): Implemented. Returns true if method has conditional
8480         attribute and the conditions is not defined (method is excluded).
8481         (IMethodData): Extended interface for ConditionalAttribute support.
8482         (PropertyMethod.IsExcluded): Implemented.
8483
8484         * decl.cs
8485         (MemberCore.Flags): Excluded_Undetected, Excluded new caching flags.
8486
8487         * expression.cs
8488         (Invocation.IsMethodExcluded): Checks the ConditionalAttribute
8489         on the method.
8490
8491 2004-06-02 Ben Maurer  <bmaurer@users.sourceforge.net>
8492
8493         * expression.cs (ArrayCreationExpression): Make this just an
8494         `expression'. It can't be a statement, so the code here was
8495         dead.
8496
8497 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8498
8499         Fixed #59072
8500         * typemanager.cs (GetFullNameSignature): New method for
8501         MethodBase types.
8502
8503 2004-06-02  Marek Safar  <marek.safar@seznam.cz>
8504
8505         Fixed #56452
8506         * class.cs (MemberBase.GetSignatureForError): New virtual method.
8507         Use this method when MethodBuilder is null.
8508         (MethodData.DefineMethodBuilder): Encapsulated code to the new method.
8509         Added test for error CS0626 (MONO reports error for this situation).
8510         (IMethodData.GetSignatureForError): Extended interface.
8511
8512 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8513
8514         * attribute.cs
8515         (AttributeTester.GetObsoleteAttribute): Returns instance of
8516         ObsoleteAttribute when type is obsolete.
8517
8518         * class.cs
8519         (TypeContainer.VerifyObsoleteAttribute): Override.
8520         (Method.GetSignatureForError): New method for usage when MethodBuilder is null.
8521         (MethodCode.VerifyObsoleteAttribute): Override.
8522         (MemberBase.VerifyObsoleteAttribute): Override.
8523
8524         * decl.cs
8525         (MemberCore.CheckUsageOfObsoleteAttribute): Tests presence of ObsoleteAttribute
8526         and report proper error.
8527
8528         *delegate.cs
8529         Delegate.VerifyObsoleteAttribute): Override.
8530
8531         * ecore.cs
8532         (Expression.CheckObsoleteAttribute): Tests presence of ObsoleteAttribute
8533         and report proper error.
8534         (FieldExpr.DoResolve): Added tests for ObsoleteAttribute.
8535
8536         * enum.cs
8537         (Enum.GetObsoleteAttribute): Returns ObsoleteAttribute for both enum type
8538         and enum member.
8539
8540         * expression.cs
8541         (Probe.DoResolve, Cast.DoResolve, LocalVariableReference.DoResolve,
8542         New.DoResolve, SizeOf.DoResolve, TypeOf.DoResolce, MemberAccess.DoResolve):
8543         Added test for ObsoleteAttribute.
8544
8545         * statement.cs
8546         (Catch): Derived from Statement.
8547
8548 2004-06-01  Marek Safar  <marek.safar@seznam.cz>
8549  
8550         Fixed bug #59071 & cs0160.cs
8551  
8552         * statement.cs (Try.Resolve): Check here whether order of catch
8553         clauses matches their dependencies.
8554
8555 2004-05-31  Miguel de Icaza  <miguel@ximian.com>
8556
8557         * Reverted patch to namespace.cs (Use lookuptypedirect).  This
8558         caused a regression: #59343.  Referencing nested classes from an
8559         assembly stopped working.
8560
8561 2004-05-31  Martin Baulig  <martin@ximian.com>
8562
8563         MCS is now frozen for beta 2.
8564
8565 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8566
8567         * convert.cs: add a trivial cache for overload operator resolution.
8568
8569 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8570
8571         * decl.cs: If possible, use lookuptypedirect here. We can only do
8572         this if there is no `.' after the namespace. Avoids using
8573         LookupType, which does lots of slow processing.
8574         (FindNestedType) New method, does what it says :-).
8575         * namespace.cs: use LookupTypeDirect.
8576         * rootcontext.cs: use membercache, if possible.
8577         * typemanager.cs (LookupTypeDirect): Cache negative hits too.
8578
8579 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8580
8581         * expression.cs:
8582         According to the spec, 
8583
8584         In a member access of the form E.I, if E is a single identifier,
8585         and if the meaning of E as a simple-name (§7.5.2) is a constant,
8586         field, property, localvariable, or parameter with the same type as
8587         the meaning of E as a type-name (§3.8), then both possible
8588         meanings of E are permitted.
8589
8590         We did not check that E as a simple-name had the same type as E as
8591         a type name.
8592
8593         This trivial check gives us 5-7% on bootstrap time.
8594
8595 2004-05-30 Ben Maurer  <bmaurer@users.sourceforge.net>
8596
8597         * expression.cs (Invocation.OverloadResolve): Avoid the
8598         use of hashtables and boxing here by allocating on demand.
8599
8600 2004-05-30  Martin Baulig  <martin@ximian.com>
8601
8602         * rootcontext.cs (RootContext.LookupType): Don't cache things if
8603         we're doing a silent lookup.  Don't try to lookup nested types in
8604         TypeManager.object_type (thanks to Ben Maurer).
8605
8606 2004-05-30  Martin Baulig  <martin@ximian.com>
8607
8608         Committing a patch from Ben Maurer.
8609
8610         * rootcontext.cs (RootContext.LookupType): Cache negative results.
8611
8612 2004-05-29  Martin Baulig  <martin@ximian.com>
8613
8614         * class.cs (IMethodData.ShouldIgnore): New method.
8615
8616         * typemanager.cs (TypeManager.MethodFlags): Don't take a
8617         `Location' argument, we don't need it anywhere.  Use
8618         `IMethodData.ShouldIgnore ()' instead of
8619         `MethodData.GetMethodFlags ()'.
8620         (TypeManager.AddMethod): Removed.
8621         (TypeManager.AddMethod2): Renamed to AddMethod.
8622
8623 2004-05-29  Martin Baulig  <martin@ximian.com>
8624
8625         Committing a patch from Benjamin Jemlich <pcgod@gmx.net>.
8626
8627         * convert.cs (Convert.ImplicitReferenceConversion): If we're
8628         converting from a class type S to an interface type and we already
8629         have an object on the stack, don't box it again.  Fixes #52578.
8630
8631 2004-05-29  Martin Baulig  <martin@ximian.com>
8632
8633         * class.cs (ConstructorInitializer.GetOverloadedConstructor):
8634         Added support for `params' parameters.  Fixes #59267.
8635
8636 2004-05-29  Martin Baulig  <martin@ximian.com>
8637
8638         * literal.cs (NullPointer): Provide a private .ctor which sets
8639         `type' to TypeManager.object_type.  Fixes #59048.
8640
8641 2004-05-29  Martin Baulig  <martin@ximian.com>
8642
8643         * expression.cs (MemberAccess.ResolveMemberAccess): If we're an
8644         EventExpr, set `ee.InstanceExpression = left'.  Fixes #59188.
8645
8646         * ecore.cs (EventExpr.instance_expr): Make the field private.
8647
8648 2004-05-26  Marek Safar  <marek.safar@seznam.cz>
8649
8650         Fixed bug #50080 & cs0214-2.cs
8651         * expression.cs (Cast.DoResolve): Check unsafe context here.
8652         
8653         * statement.cs (Resolve.DoResolve): Likewise.
8654
8655 2004-05-26  Martin Baulig  <martin@ximian.com>
8656
8657         * namespace.cs (NamespaceEntry.Lookup): Added `bool silent'.
8658
8659         * rootcontext.cs (RootContext.NamespaceLookup): Added `bool silent'.
8660         (RootContext.LookupType): Pass down the `silent' flag.
8661
8662 2004-05-25  Martin Baulig  <martin@ximian.com>
8663
8664         * expression.cs
8665         (MethodGroupExpr.IdenticalTypeName): New public property.
8666         (Invocation.DoResolve): Don't report a CS0176 if the "instance"
8667         expression actually refers to a type.
8668
8669 2004-05-25  Martin Baulig  <martin@ximian.com>
8670
8671         * expression.cs (Invocation.DoResolve): Applied Ben Maurer's patch
8672         for #56176 and made it actually work.
8673
8674 2004-05-25  Martin Baulig  <martin@ximian.com>
8675
8676         * ecore.cs (Expression.CacheTemporaries): Make this virtual.
8677         (FieldExpr, PropertyExpr): Override and implement
8678         CacheTemporaries.  Fixes #52279.
8679
8680 2004-05-25  Miguel de Icaza  <miguel@ximian.com>
8681
8682         * location.cs: In the new compiler listing a file twice is a
8683         warning, not an error.
8684
8685 2004-05-24  Martin Baulig  <martin@ximian.com>
8686
8687         * enum.cs (Enum.DefineType): For the `BaseType' to be a
8688         TypeLookupExpression; otherwise, report a CS1008.  Fixes #58571.
8689
8690 2004-05-24  Martin Baulig  <martin@ximian.com>
8691
8692         * decl.cs (DeclSpace.FindType): Try doing an alias lookup before
8693         walking the `using' list.  Fixes #53921.
8694
8695 2004-05-24  Martin Baulig  <martin@ximian.com>
8696
8697         * const.cs (Const.LookupConstantValue): Added support for
8698         EmptyCast's; fixes #55251.
8699
8700 2004-05-24  Martin Baulig  <martin@ximian.com>
8701
8702         * ecore.cs (SimpleName.SimpleNameResolve): Renamed to
8703         DoSimpleNameResolve() and provide a SimpleNameResolve() wrapper
8704         which does the CS0135 check.  The reason is that we first need to
8705         check whether the variable actually exists.
8706
8707 2004-05-24  Martin Baulig  <martin@ximian.com>
8708
8709         * class.cs (MemberBase.DoDefine): Use DeclSpace.FindType() rather
8710         than RootContext.LookupType() to find the explicit interface
8711         type.  Fixes #58584.
8712
8713 2004-05-24  Raja R Harinath  <rharinath@novell.com>
8714
8715         * Makefile: Simplify.  Use executable.make.
8716         * mcs.exe.sources: New file.  List of sources of mcs.exe.
8717
8718 2004-05-24  Anders Carlsson  <andersca@gnome.org>
8719
8720         * decl.cs:
8721         * enum.cs:
8722         Use the invariant culture when doing String.Compare for CLS case
8723         sensitivity.
8724         
8725 2004-05-23  Martin Baulig  <martin@ximian.com>
8726
8727         * decl.cs (DeclSpace.FindType): Only check the `using' list if we
8728         don't have any dots.  Fixes #52622, added cs0246-8.cs.
8729
8730         * namespace.cs (NamespaceEntry.Lookup): Likewise.
8731         
8732 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8733
8734         * class.cs (MemberBase.Define): Reuse MemberType member for 
8735         resolved type. Other methods can use it too.
8736
8737 2004-05-23  Martin Baulig  <martin@ximian.com>
8738
8739         * ecore.cs (SimpleName.SimpleNameResolve): Only report a CS0135 if
8740         the variable also exists in the current block (otherwise, we need
8741         to report a CS0103).  Fixes #58670.
8742
8743 2004-05-23  Martin Baulig  <martin@ximian.com>
8744
8745         * flowanalysis.cs (Reachability.Reachable): Compute this
8746         on-the-fly rather than storing it as a field.
8747
8748 2004-05-23  Martin Baulig  <martin@ximian.com>
8749
8750         * flowanalysis.cs (Reachability.And): Manually compute the
8751         resulting `barrier' from the reachability.      
8752        
8753 2004-05-23  Marek Safar  <marek.safar@seznam.cz>
8754
8755         Fix bug #57835
8756         * attribute.cs (AttributeTester.GetMethodObsoleteAttribute): Returns
8757         instance of ObsoleteAttribute when symbol is obsolete.
8758
8759         * class.cs
8760         (IMethodData): Extended interface for ObsoleteAttribute support.
8761
8762 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8763
8764         * attribute.cs: Fix bug #55970
8765
8766 2004-05-22  Marek Safar  <marek.safar@seznam.cz>
8767
8768         Fix bug #52705
8769         * attribute.cs
8770         (GetObsoleteAttribute): New method. Creates the instance of
8771         ObsoleteAttribute.
8772         (AttributeTester.GetMemberObsoleteAttribute): Returns instance of
8773         ObsoleteAttribute when member is obsolete.
8774         (AttributeTester.Report_ObsoleteMessage): Common method for
8775         Obsolete error/warning reporting.
8776
8777         * class.cs
8778         (TypeContainer.base_classs_type): New member for storing parent type.
8779
8780         * decl.cs
8781         (MemberCore.GetObsoleteAttribute): Returns instance of ObsoleteAttribute
8782         for this MemberCore.
8783
8784 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8785
8786         * attribute.cs, const.cs: Fix bug #58590
8787
8788 2004-05-21  Martin Baulig  <martin@ximian.com>
8789
8790         * flowanalysis.cs (FlowBranching.MergeTopBlock): Don't check for
8791         out parameters if the end of the method is unreachable.  Fixes
8792         #58098. 
8793
8794 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8795
8796         * codegen.cs, cs-parser.jay: Removed SetAttributes method.
8797         Hari was right, why extra method.
8798
8799 2004-05-21  Marek Safar  <marek.safar@seznam.cz>
8800
8801         * attribute.cs, cs-parser.jay: Fix errors/cs0579-7.cs.
8802
8803 2004-05-20  Martin Baulig  <martin@ximian.com>
8804
8805         Merged this back from gmcs to keep the differences to a minumum.
8806
8807         * attribute.cs (Attribute.CheckAttributeType): Take an EmitContext
8808         instead of a Declspace.
8809         (Attribute.ResolveType): Likewise.
8810         (Attributes.Search): Likewise.
8811         (Attributes.Contains): Likewise.
8812         (Attributes.GetClsCompliantAttribute): Likewise.
8813
8814         * class.cs (TypeContainer.VerifyMembers): Added EmitContext
8815         argument.
8816         (MethodData.ApplyAttributes): Take an EmitContext instead of a
8817         DeclSpace.
8818
8819 2004-05-19  Marek Safar  <marek.safar@seznam.cz>
8820
8821         Fix bug #58688 (MCS does not report error when the same attribute
8822         is assigned twice)
8823
8824         * attribute.cs (Attribute.Emit): Distinction between null and default.
8825
8826 2004-05-19  Raja R Harinath  <rharinath@novell.com>
8827
8828         * cs-parser.jay (attribute): Create a GlobalAttribute for the case
8829         of a top-level attribute without an attribute target.
8830         * attribute.cs (Attribute.Error_AttributeConstructorMismatch): 
8831         Make non-static.
8832         (Attribute.Conditional_GetConditionName), 
8833         (Attribute.Obsolete_GetObsoleteMessage): Update.
8834         (Attribute.IndexerName_GetIndexerName): New.  Attribute-specific
8835         part of ScanForIndexerName.
8836         (Attribute.CanIgnoreInvalidAttribute): New function.
8837         (Attribute.ScanForIndexerName): Move to ...
8838         (Attributes.ScanForIndexerName): ... here.
8839         (Attributes.Attrs): Rename from now-misnamed AttributeSections.
8840         (Attributes.Search): New internal variant that can choose not to
8841         complain if types aren't resolved.  The original signature now
8842         complains.
8843         (Attributes.GetClsCompliantAttribute): Use internal variant, with
8844         complaints suppressed.
8845         (GlobalAttribute.CheckAttributeType): Overwrite ds.NamespaceEntry
8846         only if it not useful.
8847         (CanIgnoreInvalidAttribute): Ignore assembly attribute errors at
8848         top-level for attributes that are shared between the assembly
8849         and a top-level class.
8850         * parameter.cs (ImplicitParameter): Rename from ParameterAtribute.
8851         * class.cs: Update to reflect changes.
8852         (DefineIndexers): Fuse loops.
8853         * codegen.cs (GetAssemblyName): Update to reflect changes.  Accept
8854         a couple more variants of attribute names.
8855
8856 2004-05-18  Marek Safar  <marek.safar@seznam.cz>
8857
8858         Fix bug #52585 (Implemented explicit attribute declaration)
8859
8860         * attribute.cs:
8861         (Attributable.ValidAttributeTargets): New abstract method. It gets
8862         list of valid attribute targets for explicit target declaration.
8863         (Attribute.Target): It holds target itself.
8864         (AttributeSection): Removed.
8865         (Attribute.CheckTargets): New method. It checks whether attribute
8866         target is valid for the current element.
8867
8868         * class.cs:
8869         (EventProperty): New class. For events that are declared like
8870         property (with add and remove accessors).
8871         (EventField): New class. For events that are declared like field.
8872         class.cs
8873
8874         * cs-parser.jay: Implemented explicit attribute target declaration.
8875
8876         * class.cs, decl.cs, delegate.cs, enum.cs, parameter.cs:        
8877         Override ValidAttributeTargets.
8878
8879         * parameter.cs:
8880         (ReturnParameter): Class for applying custom attributes on 
8881         the return type.
8882         (ParameterAtribute): New class. Class for applying custom
8883         attributes on the parameter type.
8884
8885 2004-05-17  Miguel de Icaza  <miguel@ximian.com>
8886
8887         * class.cs (MemberBase.DoDefine): Pass UNSAFE on interface
8888         definitions. 
8889
8890         (Method): Allow UNSAFE here.
8891
8892         * modifiers.cs: Support unsafe reporting.
8893
8894 2004-05-17  Marek Safar  <marek.safar@seznam.cz>
8895
8896         * decl.cs: Fix bug #58478.
8897
8898 2004-05-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
8899
8900         * statement.cs: When checking for unreachable code on an EmptyStatement,
8901         set the location. Fixes bug #58488.
8902
8903 2004-05-13  Miguel de Icaza  <miguel@ximian.com>
8904
8905         * driver.cs: Add -pkg handling.
8906
8907         From Gonzalo: UseShelLExecute=false
8908
8909 2004-05-12  Marek Safar  <marek.safar@seznam.cz>
8910
8911         * attribute.cs:
8912         (Attribute.GetAttributeTargets): New method. Gets AttributeTargets
8913         for attribute.
8914         (Attribute.IsClsCompliaceRequired): Moved to base for better
8915         accesibility.
8916         (Attribute.UsageAttribute): New property for AttributeUsageAttribute
8917         when attribute is AttributeUsageAttribute.
8918         (Attribute.GetValidTargets): Simplified.
8919         (Attribute.GetAttributeUsage): New method returns AttributeUsage
8920         attribute for this type.
8921         (Attribute.ApplyAttributes): Method renamed to Emit and make
8922         non-static.
8923         (GlobalAttributeSection): New class for special handling of global
8924         attributes (assembly, module).
8925         (AttributeSection.Emit): New method.
8926
8927         * class.cs: Implemented Attributable abstract methods.
8928         (MethodCore.LabelParameters): Moved to Parameter class.
8929         (Accessor): Is back simple class.
8930         (PropertyMethod): Implemented Attributable abstract class.
8931         (DelegateMethod): Implemented Attributable abstract class.
8932         (Event): New constructor for disctintion between normal Event
8933         and Event with accessors.
8934
8935         * cs-parser.jay: Used new Event ctor and GlobalAttributeSection.
8936
8937         * codegen.cs, const.cs, decl.cs, delegate.cs:
8938         (CommonAssemblyModulClass): Implemented Attributable abstract class
8939         and simplified.
8940
8941         * enum.cs: Implement IAttributeSupport interface.
8942         (EnumMember): New class for emum members. Implemented Attributable
8943         abstract class
8944
8945         * parameter.cs:
8946         (ParameterBase): Is abstract.
8947         (ReturnParameter): New class for easier [return:] attribute handling.
8948
8949         * typemanager.cs: Removed builder_to_attr.
8950
8951 2004-05-11  Raja R Harinath  <rharinath@novell.com>
8952
8953         Fix bug #57151.
8954         * attribute.cs (Attribute.GetPositionalValue): New function.
8955         * class.cs (TypeContainer.VerifyMembers): New function.
8956         (TypeContainer.Emit): Use it.
8957         (ClassOrStruct): New base class for Class and Struct.
8958         (ClassOrStruct.ApplyAttributeBuilder): New function.  Note if 
8959         StructLayout(LayoutKind.Explicit) was ascribed to the struct or
8960         class.
8961         (ClassOrStruct.VerifyMembers): If the struct is explicitly laid out,
8962         then each non-static field should have a FieldOffset attribute.
8963         Otherwise, none of the fields should have a FieldOffset attribute.
8964         * rootcontext.cs (RootContext.ResolveCore): Resolve StructLayout 
8965         and FieldOffset attributes.
8966         * typemanager.cs (TypeManager.struct_layout_attribute_type)
8967         (TypeManager.field_offset_attribute_type): New core types.
8968         (TypeManager.InitCoreTypes): Initialize them.
8969
8970 2004-05-11  Michal Moskal  <malekith@pld-linux.org>
8971
8972         * class.cs (Event.RemoveDelegateMethod.DelegateMethodInfo):
8973         Return correct type.
8974         From bug #58270.
8975
8976 2004-05-09  Miguel de Icaza  <miguel@ximian.com>
8977
8978         * expression.cs (Binary.DoNumericPromotions): 0 long constant can
8979         be implicitly converted to ulong.
8980         
8981         * expression.cs: The logic for allowing operator &, | and ^ worked
8982         was wrong, it worked before because we did not report an error in
8983         an else branch.  Fixes 57895.
8984
8985         * class.cs: Applied patch from iain@mccoy.id.au Iain McCoy to
8986         allow volatile fields to be reference types.
8987
8988 2004-05-07  Miguel de Icaza  <miguel@ximian.com>
8989
8990         * driver.cs: Add support for /debug-
8991
8992 2004-05-07  Raja R Harinath  <rharinath@novell.com>
8993
8994         * attribute.cs (Attribute.CheckAttributeType, Attribute.ResolveType): 
8995         Add a 'complain' parameter to silence errors.
8996         (Attribute.Resolve): Update to changes.  Put in sanity check to catch
8997         silently overlooked type-resolutions.
8998         (Attribute.ScanForIndexerName, Attribute.DefinePInvokeMethod): Update
8999         to reflect changes.
9000         (Attributes.Search): New function.
9001         (Attributes.Contains, Attributes.GetClsCompliantAttribute): Use Search.
9002         (Attributes.GetAttributeFullName): Remove hack.
9003         * class.cs (MethodCore.LabelParameters, MethodData.ApplyAttributes): 
9004         Update to reflect changes.
9005         * codegen.cs (CommonAssemblyModulClass.GetClsCompliantAttribute):
9006         Use Attributes.Search instead of nested loops.
9007
9008 2004-05-07  Marek Safar  <marek.safar@seznam.cz>
9009
9010         * decl.cs:
9011         (MemberCore.Flags): Extended for caching presence of CLSCompliantAttribute.
9012         (MemberCore.VerifyClsCompliance): Implemented CS3019 error report.
9013         (DeclSpace.GetClsCompliantAttributeValue): Returns simple bool.
9014
9015         * report.cs: (Report.Warning): Renamed to Warning_T because of
9016         parameter collision.
9017
9018 2004-05-05  Raja R Harinath  <rharinath@novell.com>
9019
9020         * expression.cs (MemberAccess.ResolveMemberAccess):
9021         Exit with non-zero status after Report.Error.
9022         * rootcontext.cs (RootContext.BootstrapCorlib_ResolveDelegate):
9023         Likewise.
9024         * typemanager.cs (TypeManager.CoreLookupType): Likewise.
9025
9026 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9027
9028         * support.cs: Don't hang when the file is empty.
9029
9030 2004-05-04  Lluis Sanchez Gual  <lluis@ximian.com>
9031
9032         * support.cs: In SeekableStreamReader, compute the preamble size of the
9033           underlying stream. Position changes should take into account that initial
9034           count of bytes.
9035
9036 2004-05-03  Todd Berman  <tberman@sevenl.net>
9037
9038         * driver.cs: remove unused GetSysVersion function.
9039
9040 2004-05-03  Todd Berman  <tberman@sevenl.net>
9041
9042         * driver.cs: Remove the hack from saturday, as well as the hack
9043         from jackson (LoadAssemblyFromGac), also adds the CWD to the
9044         link_paths to get that bit proper.
9045
9046 2004-05-01  Todd Berman  <tberman@sevenl.net>
9047
9048         * driver.cs: Try a LoadFrom before a Load, this checks the current
9049         path. This is currently a bug in mono that is be fixed, however, this
9050         provides a workaround for now. This will be removed when the bug
9051         is fixed.
9052
9053 2004-05-01  Sebastien Pouliot  <sebastien@ximian.com>
9054
9055         * CryptoConvert.cs: Updated to latest version. Fix issue with 
9056         incomplete key pairs (#57941).
9057
9058 2004-05-01  Todd Berman  <tberman@sevenl.net>
9059
9060         * driver.cs: Remove '.' from path_chars, now System.* loads properly
9061         from the GAC
9062
9063 2004-04-30  Jackson Harper  <jackson@ximian.com>
9064
9065         * codegen.cs: Open keys readonly.
9066         
9067 2004-04-30  Gonzalo Paniagua Javier <gonzalo@ximian.com>
9068
9069         * typemanager.cs: don't report cyclic struct layout when a struct
9070         contains 2 or more fields of the same type. Failed for Pango.AttrShape
9071         which has 2 Pango.Rectangle fields.
9072
9073 2004-04-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9074
9075         * expression.cs: Handle IntPtr comparisons with IL code
9076         rather than a method call.
9077
9078 2004-04-29  Martin Baulig  <martin@ximian.com>
9079
9080         * ecore.cs (PropertyExpr.FindAccessor): New private method.  Walk
9081         the list of PropertyInfo's in class hierarchy and find the
9082         accessor.  Fixes #56013.
9083
9084 2004-04-29  Martin Baulig  <martin@ximian.com>
9085
9086         * typemanager.cs (TypeManager.CheckStructCycles): Fixed.
9087
9088 2004-04-29  Martin Baulig  <martin@ximian.com>
9089
9090         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9091
9092         * ecore.cs (FieldExpr.AddressOf): Make this work for valuetypes.
9093
9094 2004-04-29  Martin Baulig  <martin@ximian.com>
9095
9096         * class.cs (ConstructorInitializer.Resolve): Check whether the
9097         parent .ctor is accessible.  Fixes #52146.
9098
9099 2004-04-29  Martin Baulig  <martin@ximian.com>
9100
9101         Applying a patch from Benjamin Jemlich <pcgod@gmx.net>.
9102
9103         * statement.cs (Using.EmitLocalVariableDecls): Use
9104         TypeManager.idisposable_type, not typeof (IDisposable).
9105         (Foreach.EmitCollectionForeach): Added support for valuetypes.
9106
9107 2004-04-29  Martin Baulig  <martin@ximian.com>
9108
9109         * class.cs (Event.Define): Don't emit the field and don't set
9110         RTSpecialName and SpecialName for events on interfaces.  Fixes
9111         #57703. 
9112
9113 2004-04-29  Raja R Harinath  <rharinath@novell.com>
9114
9115         Refactor Attribute.ApplyAttributes.
9116         * attribute.cs (Attributable): New base class for objects that can
9117         have Attributes applied on them.
9118         (Attribute): Make AttributeUsage fields public.
9119         (Attribute.GetFieldValue, Attribute.GetMarshal): Make non-static.
9120         (Attribute.IsInternalCall): New property.
9121         (Attribute.UsageAttr): Convert to a public read-only property.
9122         (Attribute.CheckAttributeType): Use a DeclSpace, not an EmitContext.
9123         (Attribute.ResolveType, Attribute.Resolve)
9124         (Attribute.ScanForIndexerName): Update to reflect changes.
9125         (Attribute.CheckAttributeTarget): Re-format.
9126         (Attribute.ApplyAttributes): Refactor, to various
9127         Attributable.ApplyAttributeBuilder methods.
9128         * decl.cs (MemberCore): Make Attributable.
9129         * class.cs (Accessor): Make Attributable.
9130         (MethodData.ApplyAttributes): Use proper attribute types, not
9131         attribute names.
9132         (TypeContainer.LabelParameters): Pass Parameter to ApplyAttributes.
9133         (TypeContainer.ApplyAttributeBuilder)
9134         (Method.ApplyAttributeBuilder, Constructor.ApplyAttributeBuilder)
9135         (Field.ApplyAttributeBuilder, Accessor.ApplyAttributeBuilder)   
9136         (PropertyBase.ApplyAttributeBuilder, Event.ApplyAttributeBuilder)
9137         (Operator.ApplyAttributeBuilder): New factored-out methods.
9138         * const.cs (Const.ApplyAttributeBuilder): Likewise.
9139         * delegate.cs (Delegate.ApplyAttributeBuilder): Likewise.
9140         * enum.cs (Enum.ApplyAttributeBuilder): Likewise.
9141         * parameter.cs (ParameterBase): New Attributable base class
9142         that can also represent Return types.
9143         (Parameter): Update to the changes.
9144
9145 2004-04-29  Jackson Harper  <jackson@ximian.com>
9146
9147         * driver.cs: Prefer the corlib system version when looking for
9148         assemblies in the GAC. This is still a hack, but its a better hack
9149         now.
9150         
9151 2004-04-29  Marek Safar  <marek.safar@seznam.cz>
9152
9153         * decl.cs, enum.cs: Improved error 3005 reporting.
9154   
9155         * report.cs (SymbolRelatedToPreviousError): New method for error reporting.
9156         (related_symbols): New private member for list of symbols
9157         related to reported error/warning.
9158         
9159         * tree.cs: Do not use now obsolete Report.LocationOfPreviousError.
9160
9161 2004-04-29  Martin Baulig  <martin@ximian.com>
9162
9163         * ecore.cs (Expression.Constantify): If we're an enum and
9164         TypeManager.TypeToCoreType() doesn't give us another type, use
9165         t.UnderlyingSystemType.  Fixes #56178.  
9166
9167 2004-04-29  Martin Baulig  <martin@ximian.com>
9168
9169         * decl.cs (MemberCache.SetupCacheForInterface): Look over all our
9170         interfaces and for each interface, only add members directly
9171         declared in that interface.  Fixes #53255.
9172
9173 2004-04-28  Martin Baulig  <martin@ximian.com>
9174
9175         * expression.cs (ConditionalLogicalOperator): Use a temporary
9176         variable for `left' to avoid that we evaluate it more than once;
9177         bug #52588.
9178
9179 2004-04-28  Martin Baulig  <martin@ximian.com>
9180
9181         * expression.cs (ComposedCast.DoResolveAsTypeStep): Don't allow
9182         `void[]' (CS1547).
9183
9184 2004-04-28  Martin Baulig  <martin@ximian.com>
9185
9186         * statement.cs (LocalInfo.Resolve): Check whether the type is not
9187         void (CS1547).
9188
9189         * class.cs (MemberBase.CheckParameters, FieldBase.DoDefine): Check
9190         whether the type is not void (CS1547).
9191
9192 2004-04-28  Martin Baulig  <martin@ximian.com>
9193
9194         * expression.cs (Unary.DoResolveLValue): Override this and report
9195         CS0131 for anything but Operator.Indirection.
9196
9197 2004-04-28  Martin Baulig  <martin@ximian.com>
9198
9199         Committing a patch from Ben Maurer; see bug #50820.
9200
9201         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9202         check for classes.
9203
9204         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9205         classes.        
9206
9207 2004-04-28  Martin Baulig  <martin@ximian.com>
9208
9209         Committing a patch from Ben Maurer; see bug #50820.
9210
9211         * typemanager.cs (TypeManager.FilterWithClosure): Added CS1540
9212         check for classes.
9213
9214         * ecore.cs (Expression.MemberLookupFailed): Added CS1540 check for
9215         classes.        
9216
9217 2004-04-28  Martin Baulig  <martin@ximian.com>
9218
9219         * statement.cs (Block.LookupLabel): Also lookup in implicit child blocks.
9220         (Block.AddLabel): Call DoLookupLabel() to only search in the
9221         current block.
9222
9223 2004-04-28  Martin Baulig  <martin@ximian.com>
9224
9225         * cfold.cs (ConstantFold.BinaryFold): Added special support for
9226         comparing StringConstants and NullLiterals in Equality and Inequality.
9227
9228 2004-04-28  Jackson Harper  <jackson@ximian.com>
9229
9230         * driver.cs: Attempt to load referenced assemblies from the
9231         GAC. This is the quick and dirty version of this method that
9232         doesnt take into account versions and just takes the first
9233         canidate found. Will be good enough for now as we will not have more
9234         then one version installed into the GAC until I update this method.
9235
9236 2004-04-28  Martin Baulig  <martin@ximian.com>
9237
9238         * typemanager.cs (TypeManager.CheckStructCycles): New public
9239         static method to check for cycles in the struct layout.
9240
9241         * rootcontext.cs (RootContext.PopulateTypes): Call
9242         TypeManager.CheckStructCycles() for each TypeContainer.
9243         [Note: We only need to visit each type once.]
9244
9245 2004-04-28  Martin Baulig  <martin@ximian.com>
9246
9247         * constant.cs (StringConstant.Emit): Emit Ldnull if we're null.
9248
9249         * const.cs (Const.LookupConstantValue): Return a `bool' signalling
9250         success and added `out object value'.  Use a `bool resolved' field
9251         to check whether we've already been called rather than
9252         `ConstantValue != null' since this breaks for NullLiterals.
9253
9254 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9255
9256         * driver.cs (Driver.MainDriver) [IsModuleOnly]: Open code the
9257         setting of this flag, since the 'set' method may be non-public.
9258
9259 2004-04-28  Raja R Harinath  <rharinath@novell.com>
9260
9261         * flowanalysis.cs (FlowBranchingException.LookupLabel): Add a null
9262         check on current_vector.Block.
9263
9264 2004-04-27  Martin Baulig  <martin@ximian.com>
9265
9266         * expression.cs (BaseAccess.CommonResolve): Don't allow `base' in
9267         a field initializer.  Fixes #56459.
9268
9269 2004-04-27  Martin Baulig  <martin@ximian.com>
9270
9271         * ecore.cs (PropertyExpr.DoResolve/DoResolveLValue): Check whether
9272         we're not attempting to use an indexer.  Fixes #52154.
9273
9274 2004-04-27  Martin Baulig  <martin@ximian.com>
9275
9276         * statement.cs (Return): Don't create a return label if we don't
9277         need it; reverts my change from January 20th.  Thanks to Ben
9278         Maurer for this.
9279
9280 2004-04-27  Martin Baulig  <martin@ximian.com>
9281
9282         According to the spec, `goto' can only leave a nested scope, but
9283         never enter it.
9284
9285         * statement.cs (Block.LookupLabel): Only lookup in the current
9286         block, don't recurse into parent or child blocks.
9287         (Block.AddLabel): Check in parent and child blocks, report
9288         CS0140/CS0158 if we find a duplicate.
9289         (Block): Removed this indexer for label lookups.
9290         (Goto.Resolve): Call LookupLabel() on our current FlowBranching;
9291         this already does the error reporting for us.
9292
9293         * flowanalysis.cs
9294         (FlowBranching.UsageVector.Block): New public variable; may be null.
9295         (FlowBranching.CreateSibling): Added `Block' argument.
9296         (FlowBranching.LookupLabel): New public virtual method.  Lookup a
9297         label for the target of a `goto' and check whether we're not
9298         leaving a `finally'.
9299
9300 2004-04-27  Martin Baulig  <martin@ximian.com>
9301
9302         * flowanalysis.cs (FlowBranching.UsageVector.MergeChild): If we're
9303         a finite loop block, also do the ALWAYS->SOMETIMES for throws (not
9304         just for returns).
9305
9306 2004-04-27  Martin Baulig  <martin@ximian.com>
9307
9308         * statement.cs (Block.AddLabel): Also check for implicit blocks
9309         and added a CS0158 check.
9310
9311 2004-04-27  Martin Baulig  <martin@ximian.com>
9312
9313         * flowanalysis.cs (FlowBranchingLoop): New class.
9314         (FlowBranching.UsageVector.MergeJumpOrigins): Take a list of
9315         UsageVector's instead of an ArrayList.
9316         (FlowBranching.Label): Likewise.
9317         (FlowBranching.UsageVector.MergeBreakOrigins): New method.
9318         (FlowBranching.AddBreakVector): New method.
9319
9320 2004-04-27  Miguel de Icaza  <miguel@ximian.com>
9321
9322         * attribute.cs: Small regression fix: only convert the type if we
9323         the type is different, fixes System.Drawing build.
9324
9325 2004-04-27  Martin Baulig  <martin@ximian.com>
9326
9327         * attribute.cs (Attribute.Resolve): If we have a constant value
9328         for a named field or property, implicity convert it to the correct
9329         type.
9330
9331 2004-04-27  Raja R Harinath  <rharinath@novell.com>
9332
9333         * statement.cs (Block.Block): Implicit blocks share
9334         'child_variable_names' fields with parent blocks.
9335         (Block.AddChildVariableNames): Remove.
9336         (Block.AddVariable): Mark variable as "used by a child block" in
9337         every surrounding block.
9338         * ecore.cs (SimpleName.SimpleNameResolve): If the name has already
9339         been used in a child block, complain about violation of "Invariant
9340         meaning in blocks" rule.
9341         * cs-parser.jay (declare_local_variables): Don't use
9342         AddChildVariableNames.
9343         (foreach_statement): Don't create an implicit block: 'foreach'
9344         introduces a scope.
9345
9346 2004-04-23  Miguel de Icaza  <miguel@ximian.com>
9347
9348         * convert.cs (ImplicitNumericConversion): 0 is also positive when
9349         converting from 0L to ulong.  Fixes 57522.
9350
9351 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9352
9353         * decl.cs (FindMemberToOverride): Fix wrong warning for case when
9354         derived class hides via 'new' keyword field from base class (test-242.cs).
9355         TODO: Handle this in the more general way.
9356         
9357         * class.cs (CheckBase): Ditto.
9358
9359 2004-04-22  Marek Safar  <marek.safar@seznam.cz>
9360
9361         * decl.cs (caching_flags): New member for storing cached values
9362         as bit flags.
9363         (MemberCore.Flags): New enum where bit flags for caching_flags
9364         are defined.
9365         (MemberCore.cls_compliance): Moved to caching_flags.
9366         (DeclSpace.Created): Moved to caching_flags.
9367
9368         * class.cs: Use caching_flags instead of DeclSpace.Created
9369         
9370 2004-04-21  Miguel de Icaza  <miguel@ximian.com>
9371
9372         * ecore.cs (PropertyExpr.GetAccesor): Only perform the 1540 check
9373         if we are only a derived class, not a nested class.
9374
9375         * typemanager.cs: Same as above, but do this at the MemberLookup
9376         level (used by field and methods, properties are handled in
9377         PropertyExpr).   Allow for the qualified access if we are a nested
9378         method. 
9379
9380 2004-04-21  Marek Safar  <marek.safar@seznam.cz>
9381
9382         * class.cs: Refactoring.
9383         (IMethodData): New inteface; Holds links to parent members
9384         to avoid member duplication (reduced memory allocation).
9385         (Method): Implemented IMethodData interface.
9386         (PropertyBase): New inner classes for get/set methods.
9387         (PropertyBase.PropertyMethod): Implemented IMethodData interface
9388         (Event): New inner classes for add/remove methods.
9389         (Event.DelegateMethod): Implemented IMethodData interface.
9390
9391         * cs-parser.jay: Pass DeclSpace to Event class for creation of valid
9392         EmitContext (related to class.cs refactoring).
9393
9394 2004-04-21  Raja R Harinath  <rharinath@novell.com>
9395
9396         * delegate.cs (Delegate.VerifyApplicability): If the number of
9397         arguments are the same as the number of parameters, first try to
9398         verify applicability ignoring  any 'params' modifier on the last
9399         parameter.
9400         Fixes #56442.
9401
9402 2004-04-16  Raja R Harinath  <rharinath@novell.com>
9403
9404         * class.cs (TypeContainer.AddIndexer): Use
9405         'ExplicitInterfaceName' to determine if interface name was
9406         explicitly specified.  'InterfaceType' is not initialized at this time.
9407         (TypeContainer.DefineIndexers): Remove use of temporary list.  The
9408         Indexers array is already in the required order.  Initialize
9409         'IndexerName' only if there are normal indexers.
9410         (TypeContainer.DoDefineMembers): Don't initialize IndexerName.
9411         (TypeContainer.Emit): Emit DefaultMember attribute only if
9412         IndexerName is initialized.
9413         Fixes #56300.
9414
9415 2004-04-15  Benjamin Jemlich  <pcgod@gmx.net>
9416
9417         * enum.cs (Enum.DefineType): Don't allow char as type for enum.
9418         Fixes #57007
9419
9420 2004-04-15  Raja R Harinath  <rharinath@novell.com>
9421
9422         * attribute.cs (Attribute.CheckAttributeType): Check for ambiguous
9423         attributes.
9424         Fix for #56456.
9425
9426         * attribute.cs (Attribute.Resolve): Check for duplicate named
9427         attributes.
9428         Fix for #56463.
9429
9430 2004-04-15  Miguel de Icaza  <miguel@ximian.com>
9431
9432         * iterators.cs (MarkYield): track whether we are in an exception,
9433         and generate code accordingly.  Use a temporary value to store the
9434         result for our state.
9435
9436         I had ignored a bit the interaction of try/catch with iterators
9437         since their behavior was not entirely obvious, but now it is
9438         possible to verify that our behavior is the same as MS .NET 2.0
9439
9440         Fixes 54814
9441
9442 2004-04-14  Miguel de Icaza  <miguel@ximian.com>
9443
9444         * iterators.cs: Avoid creating temporaries if there is no work to
9445         do. 
9446
9447         * expression.cs (ArrayAccess.EmitLoadOpcode): If dealing with
9448         Enumerations, use TypeManager.EnumToUnderlying and call
9449         recursively. 
9450
9451         Based on the patch from Benjamin Jemlich (pcgod@gmx.net), fixes
9452         bug #57013
9453
9454         (This.Emit): Use EmitContext.EmitThis to emit our
9455         instance variable.
9456
9457         (This.EmitAssign): Ditto.
9458
9459         * ecore.cs (FieldExpr.Emit): Remove RemapToProxy special
9460         codepaths, we will move all the functionality into
9461         Mono.CSharp.This 
9462
9463         (FieldExpr.EmitAssign): Ditto.
9464
9465         This fixes several hidden bugs that I uncovered while doing a code
9466         review of this today.
9467
9468         * codegen.cs (EmitThis): reworked so the semantics are more clear
9469         and also support value types "this" instances.
9470
9471         * iterators.cs: Changed so that for iterators in value types, we
9472         do not pass the value type as a parameter.  
9473
9474         Initialization of the enumerator helpers is now done in the caller
9475         instead of passing the parameters to the constructors and having
9476         the constructor set the fields.
9477
9478         The fields have now `assembly' visibility instead of private.
9479
9480 2004-04-11  Miguel de Icaza  <miguel@ximian.com>
9481
9482         * expression.cs (Argument.Resolve): Check if fields passed as ref
9483         or out are contained in a MarshalByRefObject.
9484
9485         * typemanager.cs, rootcontext.cs: Add System.Marshalbyrefobject as
9486         another compiler type.
9487
9488 2004-04-06 Ben Maurer  <bmaurer@users.sourceforge.net>
9489
9490         * class.cs (Indexer.Define): use the new name checking method.
9491         Also, return false on an error.
9492         * cs-tokenizer.cs (IsValidIdentifier): Checks for a valid identifier.
9493         (is_identifier_[start/part]_character): make static.
9494
9495 2004-04-10  Miguel de Icaza  <miguel@ximian.com>
9496
9497         * expression.cs (Binary.ResolveOperator): Do no append strings
9498         twice: since we can be invoked more than once (array evaluation)
9499         on the same concatenation, take care of this here.  Based on a fix
9500         from Ben (bug #56454)
9501
9502 2004-04-08  Sebastien Pouliot  <sebastien@ximian.com>
9503
9504         * codegen.cs: Fix another case where CS1548 must be reported (when 
9505         delay-sign isn't specified and no private is available #56564). Fix
9506         loading the ECMA "key" to delay-sign an assembly. Report a CS1548 
9507         error when MCS is used on the MS runtime and we need to delay-sign 
9508         (which seems unsupported by AssemblyBuilder - see #56621).
9509
9510 2004-04-08  Marek Safar  <marek.safar@seznam.cz>
9511
9512         * typemanager.cs (TypeManager.TypeToCoreType): Handle IntPtr too.
9513         (TypeManager.ComputeNamespaces): Faster implementation for
9514         Microsoft runtime.
9515
9516         * compiler.csproj: Updated AssemblyName to mcs.
9517
9518 2004-04-07  Miguel de Icaza  <miguel@ximian.com>
9519
9520         * rootcontext.cs: Add new types to the boot resolution.
9521
9522         * ecore.cs (TypeExpr.CanInheritFrom): Inheriting from
9523         MulticastDelegate is not allowed.
9524
9525         * typemanager.cs: Add new types to lookup: System.TypedReference
9526         and ArgIterator.
9527
9528         * paramter.cs (Parameter.Resolve): if we are an out/ref parameter,
9529         check for TypedReference or ArgIterator, they are not allowed. 
9530
9531         * ecore.cs (BoxedCast): Set the eclass to ExprClass.Value, this
9532         makes us properly catch 1510 in some conditions (see bug 56016 for
9533         details). 
9534
9535 2004-04-06  Bernie Solomon  <bernard@ugsolutions.com>
9536
9537         * CryptoConvert.cs: update from corlib version
9538         with endian fixes.
9539
9540 2004-04-05  Miguel de Icaza  <miguel@ximian.com>
9541
9542         * class.cs (Indexer.Define): Check indexername declaration
9543
9544 2004-04-05  Marek Safar  <marek.safar@seznam.cz>
9545
9546         * attribute.cs (IsClsCompliant): Fixed problem with handling
9547         all three states (compliant, not-compliant, undetected).
9548
9549 2004-03-30  Marek Safar  <marek.safar@seznam.cz>
9550
9551         * attribute.cs (Attribute): Location is now public.
9552         (Resolve): Store resolved arguments (pos_values) in attribute class.
9553         Attribute extractors (now GetClsCompliantAttributeValue) can reuse them.
9554         (GetClsCompliantAttributeValue): New method that gets
9555         CLSCompliantAttribute value.
9556         (GetClsCompliantAttribute): Returns CLSCompliantAttribute for DeclSpace
9557         if exists else null.
9558         (AttributeTester): New class for CLS-Compliant verification routines.
9559
9560         * class.cs (Emit): Add CLS-Compliant verification.
9561         (Method.GetSignatureForError): Implemented.
9562         (Constructor.GetSignatureForError): Implemented
9563         (Constructor.HasCompliantArgs): Returns if constructor has
9564         CLS-Compliant arguments.
9565         (Constructor.Emit): Override.
9566         (Construcor.IsIdentifierClsCompliant): New method; For constructors
9567         is needed to test only parameters.
9568         (FieldBase.GetSignatureForError): Implemented.
9569         (TypeContainer): New member for storing base interfaces.
9570         (TypeContainer.FindMembers): Search in base interfaces too.
9571
9572         * codegen.cs (GetClsComplianceAttribute): New method that gets
9573         assembly or module CLSCompliantAttribute value.
9574         (ResolveClsCompliance): New method that resolve CLSCompliantAttribute
9575         for assembly.
9576         (ModuleClass.Emit): Add error 3012 test.
9577
9578         * const.cs (Emit): Override and call base for CLS-Compliant tests.
9579
9580         * decl.cs (ClsComplianceValue): New enum that holds CLS-Compliant
9581         state for all decl types.
9582         (MemberCore.Emit): Emit is now virtual and call VerifyClsCompliance
9583         if CLS-Compliant tests are required.
9584         (IsClsCompliaceRequired): New method. Analyze whether code
9585         must be CLS-Compliant.
9586         (IsExposedFromAssembly): New method. Returns true when MemberCore
9587         is exposed from assembly.
9588         (GetClsCompliantAttributeValue): New method. Resolve CLSCompliantAttribute
9589         value or gets cached value.
9590         (HasClsCompliantAttribute): New method. Returns true if MemberCore
9591         is explicitly marked with CLSCompliantAttribute.
9592         (IsIdentifierClsCompliant): New abstract method. This method is
9593         used to testing error 3005.
9594         (IsIdentifierAndParamClsCompliant): New method. Common helper method
9595         for identifier and parameters CLS-Compliant testing.
9596         (VerifyClsCompliance): New method. The main virtual method for
9597         CLS-Compliant verifications.
9598         (CheckAccessLevel): In one special case (System.Drawing) was TypeBuilder
9599         null. I don't know why is null (too many public members !).
9600         (GetClsCompliantAttributeValue). New method. Goes through class hierarchy
9601         and get value of first CLSCompliantAttribute that found.
9602
9603         * delegate.cs (Emit): Override and call base for CLS-Compliant tests.
9604         (VerifyClsCompliance): Override and add extra tests.
9605
9606         * driver.cs (CSCParseOption): New command line options (clscheck[+|-]).
9607         clscheck- disable CLS-Compliant verification event if assembly is has
9608         CLSCompliantAttribute(true).
9609
9610         * enum.cs (Emit): Override and call base for CLS-Compliant tests.
9611         ApllyAttribute is now called in emit section as in the other cases.
9612         Possible future Emit integration.
9613         (IsIdentifierClsCompliant): New override.
9614         (VerifyClsCompliance): New override.
9615         (GetEnumeratorName): Returns full enum name.
9616
9617         * parameter.cs (GetSignatureForError): Implemented.
9618
9619         * report.cs (WarningData): New struct for Warning message information.
9620         (LocationOfPreviousError): New method.
9621         (Warning): New method. Reports warning based on the warning table.
9622         (Error_T): New method. Reports error based on the error table.
9623
9624         * rootcontext.cs (EmitCode): Added new Emit(s) because CLS-Compliant
9625         verifications are done here.
9626
9627         * tree.cs (RecordDecl): Used new LocationOfPreviousError method.
9628
9629         * typemanager.cs (cls_compliant_attribute_type): New member thath holds
9630         CLSCompliantAttribute.
9631         (all_imported_types): New member holds all imported types from other
9632         assemblies.
9633         (LoadAllImportedTypes): New method fills static table with exported types
9634         from all referenced assemblies.
9635         (Modules): New property returns all assembly modules.
9636
9637 2004-03-30  Miguel de Icaza  <miguel@ximian.com>
9638
9639         * cs-parser.jay: Add a rule to catch wrong event syntax instead of
9640         throwing a parser error.
9641
9642         * ecore.cs (PropertyExpr.GetAccessor): Apply patch from Patrik Reali
9643         which removes the hardcoded get_/set_ prefixes for properties, as
9644         IL allows for the properties to be named something else.  
9645
9646         Bug #56013
9647
9648         * expression.cs: Do not override operand before we know if it is
9649         non-null.  Fix 56207
9650
9651 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9652
9653         * typemanager.cs: support for pinned variables.
9654
9655 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9656
9657         * decl.cs, typemanager.cs: Avoid using an arraylist
9658         as a buffer if there is only one result set.
9659
9660 2004-03-29 Ben Maurer  <bmaurer@users.sourceforge.net>
9661
9662         * expression.cs: Make sure you cant call a static method
9663         with an instance expression, bug #56174.
9664
9665 2004-03-29  Miguel de Icaza  <miguel@ximian.com>
9666
9667         * class.cs (IsDuplicateImplementation): Improve error reporting to
9668         flag 663 (method only differs in parameter modifier).
9669
9670         * cs-tokenizer.cs: Do not require whitespace when a ( or " will do
9671         in preprocessor directives.
9672
9673         * location.cs (LookupFile): Allow for the empty path.
9674
9675         * attribute.cs (DefinePInvokeMethod): Fix 56148;  I would like a
9676         better approach for some of that patch, but its failing with the
9677         CharSet enumeration.  For now try/catch will do.
9678
9679         * typemanager.cs: Do not crash if a struct does not have fields.
9680         Fixes 56150.
9681
9682 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9683
9684         * expression.cs: cs0213, cant fix a fixed expression.
9685         fixes 50231.
9686
9687 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9688
9689         * cs-parser.jay: detect invalid embeded statements gracefully.
9690         bug #51113.
9691
9692 2004-03-28 Ben Maurer  <bmaurer@users.sourceforge.net>
9693
9694         * ecore.cs, typemanager.cs: Correct impl of cs1540 check.
9695         As a regex:
9696         s/
9697         the invocation type may not be a subclass of the tye of the item/
9698         The type of the item must be a subclass of the invocation item.
9699         /g
9700
9701         Fixes bug #50820.
9702
9703 2004-03-25  Sebastien Pouliot  <sebastien@ximian.com>
9704
9705         * attribute.cs: Added methods to get a string and a bool from an
9706         attribute. Required to information from AssemblyKeyFileAttribute,
9707         AttributeKeyNameAttribute (string) and AssemblyDelaySign (bool).
9708         * codegen.cs: Modified AssemblyName creation to include support for
9709         strongnames. Catch additional exceptions to report them as CS1548.
9710         * compiler.csproj: Updated include CryptoConvert.cs.
9711         * compiler.csproj.user: Removed file - user specific configuration.
9712         * CryptoConvert.cs: New. A COPY of the class CryptoConvert from 
9713         Mono.Security assembly. The original class is maintained and tested in
9714         /mcs/class/Mono.Security/Mono.Security.Cryptography/CryptoConvert.cs.
9715         * drivers.cs: Added support for /keyfile, /keycontainer and /delaysign
9716         like CSC 8.0 (C# v2) supports.
9717         * Makefile: Added CryptoConvert.cs to mcs sources.
9718         * rootcontext.cs: Added new options for strongnames.
9719
9720 2004-03-24 Ben Maurer  <bmaurer@users.sourceforge.net>
9721
9722         * driver.cs: For --expect-error, report error code `2'
9723         if the program compiled with no errors, error code `1' if
9724         it compiled with an error other than the one expected.
9725
9726 2004-03-24  Sebastien Pouliot  <sebastien@ximian.com>
9727
9728         * compiler.csproj: Updated for Visual Studio .NET 2003.
9729         * compiler.csproj.user: Updated for Visual Studio .NET 2003.
9730         * compiler.sln: Updated for Visual Studio .NET 2003.
9731
9732 2004-03-24  Ravi Pratap M  <ravi@ximian.com>
9733
9734         * expression.cs: Fix bug #47234. We basically need to apply the
9735         rule that we prefer the conversion of null to a reference type
9736         when faced with a conversion to 'object' (csc behaviour).
9737
9738 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9739
9740         * statement.cs: Shorter form for foreach, eliminates
9741         a local variable. r=Martin.
9742
9743 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9744
9745         * constant.cs, ecore.cs, literal.cs: New prop IsZeroInteger that
9746         checks if we can use brtrue/brfalse to test for 0.
9747         * expression.cs: use the above in the test for using brtrue/brfalse.
9748         cleanup code a bit.
9749
9750 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9751
9752         * expression.cs: Rewrite string concat stuff. Benefits:
9753
9754         - "a" + foo + "b" + "c" becomes "a" + foo + "bc"
9755         - "a" + foo + "b" + bar + "c" + baz ... uses concat (string []).
9756         rather than a concat chain.
9757
9758         * typemanager.cs: Add lookups for more concat overloads.
9759
9760 2004-03-23 Ben Maurer  <bmaurer@users.sourceforge.net>
9761
9762         * expression.cs: Emit shorter il code for array init.
9763
9764         newarr
9765         dup
9766         // set 1
9767
9768         // set 2
9769
9770         newarr
9771         stloc.x
9772
9773         ldloc.x
9774         // set 1
9775
9776         ldloc.x
9777         // set 2
9778
9779 2004-03-22 Ben Maurer  <bmaurer@users.sourceforge.net>
9780
9781         * statement.cs: Before, two switch blocks would be merged if the
9782         total size of the blocks (end_item - begin_item + 1) was less than
9783         two times the combined sizes of the blocks.
9784
9785         Now, it will only merge if after the merge at least half of the
9786         slots are filled.
9787
9788         fixes 55885.
9789
9790 2004-03-20  Atsushi Enomoto  <atsushi@ximian.com>
9791
9792         * class.cs : csc build fix for GetMethods(). See bug #52503.
9793
9794 2004-03-20 Ben Maurer  <bmaurer@users.sourceforge.net>
9795
9796         * expression.cs: Make sure fp comparisons work with NaN.
9797         This fixes bug #54303. Mig approved this patch a long
9798         time ago, but we were not able to test b/c the runtime
9799         had a related bug.
9800
9801 2004-03-19  Miguel de Icaza  <miguel@ximian.com>
9802
9803         * ecore.cs (TypExpr.GetHashCode): implement this overload. 
9804
9805 2004-03-19  Martin Baulig  <martin@ximian.com>
9806
9807         * class.cs (MemberCore.IsDuplicateImplementation): Report the
9808         error here and not in our caller.
9809
9810 2004-03-19  Martin Baulig  <martin@ximian.com>
9811
9812         * interface.cs: Completely killed this file.
9813         (Interface): We're now a TypeContainer and live in class.cs.
9814
9815         * class.cs (TypeContainer.GetClassBases): Added `bool is_iface'
9816         argument; we're now also called for interfaces.
9817         (TypeContainer.DefineMembers): Allow this method being called
9818         multiple times.
9819         (TypeContainer.GetMethods): New public method; formerly known as
9820         Interface.GetMethod().  This is used by PendingImplementation.
9821         (TypeContainer.EmitDefaultMemberAttr): Moved here from Interface;
9822         it's now private and non-static.
9823         (Interface): Moved this here; it's now implemented similar to
9824         Class and Struct.
9825         (Method, Property, Event, Indexer): Added `bool is_interface'
9826         argument to their .ctor's.
9827         (MemberBase.IsInterface): New public field.
9828
9829         * cs-parser.jay: Create normal Method, Property, Event, Indexer
9830         instances instead of InterfaceMethod, InterfaceProperty, etc.
9831         (opt_interface_base): Removed; we now use `opt_class_base' instead.
9832         (InterfaceAccessorInfo): Create `Get' and `Set' Accessor's.
9833
9834 2004-03-19  Martin Baulig  <martin@ximian.com>
9835
9836         * class.cs (MethodCore.IsDuplicateImplementation): New private
9837         method which does the CS0111 checking.
9838         (Method.CheckBase, Constructor.CheckBase, PropertyBase.CheckBase):
9839         Use IsDuplicateImplementation().
9840
9841 2004-03-17 Ben Maurer  <bmaurer@users.sourceforge.net>
9842
9843         * decl.cs (FindMemberToOverride): New method to find the correct
9844         method or property to override in the base class.
9845         * class.cs
9846             - Make Method/Property use the above method to find the
9847               version in the base class.
9848             - Remove the InheritableMemberSignatureCompare as it is now
9849               dead code.
9850
9851         This patch makes large code bases much faster to compile, as it is
9852         O(n) rather than O(n^2) to do this validation.
9853
9854         Also, it fixes bug 52458 which is that nested classes are not
9855         taken into account when finding the base class member.
9856
9857         Reviewed/Approved by Martin.
9858
9859 2004-03-17  Marek Safar  <marek.safar@seznam.cz>
9860
9861         * interface.cs: In all interface classes removed redundant
9862         member initialization.
9863
9864 2004-03-16  Martin Baulig  <martin@ximian.com>
9865
9866         * class.cs (TypeContainer.GetClassBases): Fix the CS0528 check.
9867
9868 2004-03-15  Miguel de Icaza  <miguel@ximian.com>
9869
9870         * decl.cs (DefineTypeAndParents): New helper method to define a
9871         type's containers before the type itself is defined;  This is a
9872         bug exposed by the recent changes to Windows.Forms when an
9873         implemented interface was defined inside a class that had not been
9874         built yet.   
9875
9876         * modifiers.cs (MethodAttr): All methods in C# are HideBySig.
9877
9878         (Check): Loop correctly to report errors modifiers
9879         (UNSAFE was not in the loop, since it was the same as TOP).
9880
9881         * interface.cs: Every interface member now takes a ModFlags,
9882         instead of a "is_new" bool, which we set on the base MemberCore. 
9883
9884         Every place where we called "UnsafeOk" in the interface, now we
9885         call the proper member (InterfaceMethod.UnsafeOK) instead to get
9886         the unsafe settings from the member declaration instead of the
9887         container interface. 
9888
9889         * cs-parser.jay (opt_new): Allow unsafe here per the spec. 
9890
9891         * pending.cs (TypeAndMethods): Add `get_indexer_name' and
9892         `set_indexer_name' to the pending bits (one per type).
9893
9894         We fixed a bug today that was picking the wrong method to
9895         override, since for properties the existing InterfaceMethod code
9896         basically ignored the method name.  Now we make sure that the
9897         method name is one of the valid indexer names.
9898
9899 2004-03-14  Gustavo Giráldez  <gustavo.giraldez@gmx.net>
9900  
9901         * support.cs (SeekableStreamReader): Keep track of stream byte
9902         positions and don't mix them with character offsets to the buffer.
9903
9904         Patch from Gustavo Giráldez
9905
9906 2004-03-15  Marek Safar  <marek.safar@seznam.cz>
9907
9908         * interface.cs (InterfaceSetGetBase): Removed double member
9909         initialization, base class does it as well.
9910
9911 2004-03-13  Martin Baulig  <martin@ximian.com>
9912
9913         * class.cs: Reverted Miguel's latest commit; it makes mcs crash
9914         when compiling corlib.
9915
9916 2004-03-13  Miguel de Icaza  <miguel@ximian.com>
9917
9918         * convert.cs (ExplicitConversion): We were reporting an error on
9919         certain conversions (object_type source to a value type, when the
9920         expression was `null') before we had a chance to pass it through
9921         the user defined conversions.
9922
9923         * driver.cs: Replace / and \ in resource specifications to dots.
9924         Fixes 50752
9925
9926         * class.cs: Add check for duplicate operators.  Fixes 52477
9927
9928 2004-03-11  Miguel de Icaza  <miguel@ximian.com>
9929
9930         * statement.cs (Switch.SimpleSwitchEmit): Deal with default labels
9931         that are in the middle of the statements, not only at the end.
9932         Fixes #54987
9933
9934         * class.cs (TypeContainer.AddField): No longer set the
9935         `HaveStaticConstructor' flag, now we call it
9936         `UserDefineStaticConstructor' to diferentiate the slightly
9937         semantic difference.
9938
9939         The situation is that we were not adding BeforeFieldInit (from
9940         Modifiers.TypeAttr) to classes that could have it.
9941         BeforeFieldInit should be set to classes that have no static
9942         constructor. 
9943
9944         See:
9945
9946         http://www.yoda.arachsys.com/csharp/beforefieldinit.html
9947
9948         And most importantly Zoltan's comment:
9949
9950         http://bugzilla.ximian.com/show_bug.cgi?id=44229
9951
9952         "I think beforefieldinit means 'it's ok to initialize the type sometime 
9953          before its static fields are used', i.e. initialization does not need
9954          to be triggered by the first access to the type. Setting this flag
9955          helps the JIT to compile better code, since it can run the static
9956          constructor at JIT time, and does not need to generate code to call it
9957          (possibly lots of times) at runtime. Unfortunately, mcs does not set
9958          this flag for lots of classes like String. 
9959          
9960          csc sets this flag if the type does not have an explicit static 
9961          constructor. The reasoning seems to be that if there are only static
9962          initalizers for a type, and no static constructor, then the programmer
9963          does not care when this initialization happens, so beforefieldinit
9964          can be used.
9965          
9966          This bug prevents the AOT compiler from being usable, since it 
9967          generates so many calls to mono_runtime_class_init that the AOT code
9968          is much slower than the JITted code. The JITted code is faster, 
9969          because it does not generate these calls if the vtable is type is
9970          already initialized, which is true in the majority of cases. But the
9971          AOT compiler can't do this."
9972
9973 2004-03-10  Miguel de Icaza  <miguel@ximian.com>
9974
9975         * class.cs (MethodData.Emit): Refactor the code so symbolic
9976         information is generated for destructors;  For some reasons we
9977         were taking a code path that did not generate symbolic information
9978         before. 
9979
9980 2004-03-11 Ben Maurer  <bmaurer@users.sourceforge.net>
9981
9982         * class.cs: Create a Constructor.CheckBase method that
9983         takes care of all validation type code. The method
9984         contains some code that was moved from Define.
9985
9986         It also includes new code that checks for duplicate ctors.
9987         This fixes bug #55148.
9988
9989 2004-03-09  Joshua Tauberer <tauberer@for.net>
9990
9991         * expression.cs (ArrayCreation): Fix: More than 6 nulls in
9992         a { ... }-style array creation invokes EmitStaticInitializers
9993         which is not good for reference-type arrays.  String, decimal
9994         and now null constants (NullCast) are not counted toward
9995         static initializers.
9996
9997 2004-03-05  Martin Baulig  <martin@ximian.com>
9998
9999         * location.cs (SourceFile.HasLineDirective): New public field;
10000         specifies whether the file contains or is referenced by a "#line"
10001         directive.
10002         (Location.DefineSymbolDocuments): Ignore source files which
10003         either contain or are referenced by a "#line" directive.        
10004
10005 2004-02-29  Ben Maurer <bmaurer@users.sourceforge.net>
10006
10007         * class.cs (Method.CheckBase): Avoid using FindMembers, we have
10008         direct access to our parent, so check the method inline there.
10009
10010 2004-02-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10011
10012         * expression.cs (Invocation.EmitCall): Miguel's last commit
10013         caused a regression. If you had:
10014
10015             T t = null;
10016             t.Foo ();
10017
10018         In Foo the implict this would be null.
10019
10020 2004-02-27  Miguel de Icaza  <miguel@ximian.com>
10021
10022         * expression.cs (Invocation.EmitCall): If the method is not
10023         virtual, do not emit a CallVirt to it, use Call.
10024
10025         * typemanager.cs (GetFullNameSignature): Improve the method to
10026         cope with ".ctor" and replace it with the type name.
10027
10028         * class.cs (ConstructorInitializer.Resolve): Now the method takes
10029         as an argument the ConstructorBuilder where it is being defined,
10030         to catch the recursive constructor invocations.
10031
10032 2004-02-26  Miguel de Icaza  <miguel@ximian.com>
10033
10034         * iterators.cs (IteratorHandler.IsIEnumerator, IsIEnumerable): New
10035         routines to check if a type is an enumerable/enumerator allow
10036         classes that implement the IEnumerable or IEnumerator interfaces.
10037
10038         * class.cs (Property, Operator): Implement IIteratorContainer, and
10039         implement SetYields.
10040
10041         (Property.Define): Do the block swapping for get_methods in the
10042         context of iterators.   We need to check if Properties also
10043         include indexers or not.
10044
10045         (Operator): Assign the Block before invoking the
10046         OperatorMethod.Define, so we can trigger the Iterator code
10047         replacement. 
10048
10049         * cs-parser.jay (SimpleIteratorContainer): new helper class.  Both
10050         Property and Operator classes are not created when we parse the
10051         declarator but until we have the block completed, so we use a
10052         singleton SimpleIteratorContainer.Simple to flag whether the
10053         SetYields has been invoked.
10054
10055         We propagate this setting then to the Property or the Operator to
10056         allow the `yield' to function.
10057
10058 2004-02-25  Marek Safar  <marek.safar@seznam.cz>
10059
10060         * codegen.cs: Implemented attribute support for modules.
10061         New AssemblyClass, ModuleClass and CommonAssemblyModulClass for
10062         Assembly/Module functionality.
10063
10064         * attribute.cs, class.cs, cs-parser.jay, delegate.cs, driver.cs, enum.cs
10065         interface.cs, rootcontext.cs, statement.cs, typemanager.cs:
10066         Updated dependencies on CodeGen.ModuleBuilder and CodeGen.AssemblyBuilder.
10067
10068 2004-02-16  Marek Safar  <marek.safar@seznam.cz>
10069
10070         * interface.cs (FindMembers): The operation is performed on all base
10071         interfaces and not only on the first. It is required for future CLS Compliance patch.
10072
10073 2004-02-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10074
10075         * statement.cs, codegen.cs:
10076         This patch deals with patterns such as:
10077
10078         public class List : IEnumerable {
10079
10080                 public MyEnumerator GetEnumerator () {
10081                         return new MyEnumerator(this);
10082                 }
10083
10084                 IEnumerator IEnumerable.GetEnumerator () {
10085                         ...
10086                 }
10087                 
10088                 public struct MyEnumerator : IEnumerator {
10089                         ...
10090                 }
10091         }
10092
10093         Before, there were a few things we did wrong:
10094         1) we would emit callvirt on a struct, which is illegal
10095         2) we emited ldarg when we needed to emit ldarga
10096         3) we would mistakenly call the interface methods on an enumerator
10097         type that derived from IEnumerator and was in another assembly. For example:
10098
10099         public class MyEnumerator : IEnumerator
10100
10101         Would have the interface methods called, even if there were public impls of the
10102         method. In a struct, this lead to invalid IL code.
10103
10104 2004-02-11  Marek Safar  <marek.safar@seznam.cz>
10105
10106         * const.cs: Const is now derived from FieldBase. Method EmitConstant name
10107           renamed to Emit.
10108
10109         * delegate.cs (Define): Fixed crash when delegate type is undefined.
10110
10111 2004-02-11  Miguel de Icaza  <miguel@ximian.com>
10112
10113         * cs-parser.jay: Fix small regression: we were not testing V2
10114         compiler features correctly.
10115
10116         * interface.cs: If the emit context is null, then create one
10117
10118 2004-02-09  Marek Safar  <marek.safar@seznam.cz>
10119
10120         * decl.cs (GetSignatureForError): New virtual method to get full name
10121           for error messages.
10122
10123         * attribute.cs (IAttributeSupport): New interface for attribute setting.
10124           Now it is possible to rewrite ApplyAttributes method to be less if/else.
10125
10126         * interface.cs : All InterfaceXXX classes are now derived from MemberCore.
10127           Duplicated members and code in these classes has been removed.
10128           Better encapsulation in these classes.
10129
10130 2004-02-07  Miguel de Icaza  <miguel@ximian.com>
10131
10132         * assign.cs (Assign.DoResolve): When dealing with compound
10133         assignments, there is a new rule in ECMA C# 2.4 (might have been
10134         there before, but it is documented here) that states that in:
10135
10136         a op= b;
10137
10138         If b is of type int, and the `op' is a shift-operator, then the
10139         above is evaluated as:
10140
10141         a = (int) a op b 
10142
10143         * expression.cs (Binary.ResolveOperator): Instead of testing for
10144         int/uint/long/ulong, try to implicitly convert to any of those
10145         types and use that in pointer arithmetic.
10146
10147         * delegate.cs (Error_NoMatchingMethodForDelegate): Compute the
10148         method to print information for from the type, not from the
10149         null-method we were given.
10150
10151 2004-02-01  Duncan Mak  <duncan@ximian.com>
10152
10153         * cs-tokenizer.cs (get_cmd_arg): Skip over whitespace before
10154         parsing for cmd, fixes bug #53694.
10155
10156 2004-02-04  Marek Safar  <marek.safar@seznam.cz>
10157
10158         * class.cs, decl.cs: Fixed problem where IndexerName attribute was ignored
10159         in the member name duplication tests. Property and operator name duplication
10160         was missing too (error tests cs0102-{2,3,4,5}.cs, cs0111-{3,4}.cs).
10161
10162 2004-02-03  Marek Safar  <marek.safar@seznam.cz>
10163
10164         * interface.cs (PopulateMethod): Fixed crash when interface method
10165         returns not existing type (error test cs0246-3.cs).
10166
10167 2004-02-02  Ravi Pratap M <ravi@ximian.com>
10168
10169         * cs-parser.jay (interface_accessors): Re-write actions to also
10170         store attributes attached to get and set methods. Fix spelling
10171         while at it.
10172
10173         (inteface_property_declaration): Modify accordingly.
10174
10175         (InterfaceAccessorInfo): New helper class to store information to pass
10176         around between rules that use interface_accessors.
10177
10178         * interface.cs (Emit): Apply attributes on the get and set
10179         accessors of properties and indexers too.
10180
10181         * attribute.cs (ApplyAttributes): Modify accordingly to use the
10182         right MethodBuilder when applying attributes to the get and set accessors.
10183
10184 2004-01-31  Miguel de Icaza  <miguel@ximian.com>
10185
10186         * cs-tokenizer.cs: Applied patch from Marek Safar to fix bug 53386
10187
10188 2004-01-26  Miguel de Icaza  <miguel@ximian.com>
10189
10190         * cs-tokenizer.cs: Handle #line hidden from PDC bits.
10191
10192 2004-01-25  Miguel de Icaza  <miguel@ximian.com>
10193
10194         * cs-parser.jay: Remove YIELD token, instead use the new grammar
10195         changes that treat `yield' specially when present before `break'
10196         or `return' tokens.
10197
10198         * cs-tokenizer.cs: yield is no longer a keyword.
10199
10200 2004-01-23  Marek Safar  <marek.safar@seznam.cz>
10201
10202         * cs-parser.jay, class.cs (DefineDefaultConstructor): Fixed ModFlags
10203         setting for default constructors.
10204         For default constructors are almost every time set wrong Modifier. The
10205         generated IL code has been alright. But inside mcs this values was
10206         wrong and this was reason why several of my CLS Compliance tests
10207         failed.
10208
10209 2004-01-22  Martin Baulig  <martin@ximian.com>
10210
10211         * cs-parser.jay (namespace_or_type_name): Return an Expression,
10212         not a QualifiedIdentifier.  This is what `type_name_expression'
10213         was previously doing.
10214         (type_name_expression): Removed; the code is now in
10215         `namespace_or_type_name'.
10216         (qualified_identifier): Removed, use `namespace_or_type_name'
10217         instead.
10218         (QualifiedIdentifier): Removed this class.      
10219
10220 2004-01-22  Martin Baulig  <martin@ximian.com>
10221
10222         * namespace.cs (NamespaceEntry.UsingAlias): Take an Expression,
10223         not a string as alias name.
10224
10225 2004-01-21  Miguel de Icaza  <miguel@ximian.com>
10226
10227         * ecore.cs (FieldInfo.AddressOf): Revert patch from previous
10228         #52730 bug, and instead compute correctly the need to use a
10229         temporary variable when requesting an address based on the
10230         static/instace modified of the field and the constructor.
10231  
10232 2004-01-21  Martin Baulig  <martin@ximian.com>
10233
10234         * ecore.cs (SimpleName.ResolveAsTypeStep): Lookup in the current
10235         class and namespace before looking up aliases.  Fixes #52517.
10236
10237 2004-01-21  Martin Baulig  <martin@ximian.com>
10238
10239         * flowanalysis.cs (UsageVector.Merge): Allow variables being
10240         assinged in a 'try'; fixes exception4.cs.
10241
10242 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10243         * class.cs : Implemented parameter-less constructor for TypeContainer
10244
10245         * decl.cs: Attributes are now stored here. New property OptAttributes
10246
10247         * delegate.cs, enum.cs, interface.cs: Removed attribute member.
10248
10249         * rootcontext.cs, tree.cs: Now use parameter-less constructor of TypeContainer
10250
10251 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10252
10253         * typemanager.cs (CSharpSignature): Now reports also inner class name.
10254           (CSharpSignature): New method for indexer and property signature.
10255
10256 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10257
10258         * pending.cs (IsVirtualFilter): Faster implementation.
10259
10260 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10261
10262         * typemanager.cs: Avoid inclusion of same assembly more than once.
10263
10264 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10265
10266         * cs-parser.jay: Fixed problem where the last assembly attribute
10267           has been applied also to following declaration (class, struct, etc.)
10268           
10269 2004-01-21  Marek Safar  <marek.safar@seznam.cz>
10270
10271         * class.cs: Added error CS0538, CS0539 reporting.
10272         Fixed crash on Microsoft runtime when field type is void.
10273
10274         * cs-parser.jay: Added error CS0537 reporting.
10275
10276         * pending.cs: Added error CS0535 reporting.
10277         Improved error report for errors CS0536, CS0534.
10278
10279 2004-01-20  Miguel de Icaza  <miguel@ximian.com>
10280
10281         Merge a few bits from the Anonymous Method MCS tree.
10282
10283         * statement.cs (ToplevelBlock): New class for toplevel methods,
10284         will hold anonymous methods, lifted variables.
10285
10286         * cs-parser.jay: Create toplevel blocks for delegates and for
10287         regular blocks of code. 
10288
10289 2004-01-20  Martin Baulig  <martin@ximian.com>
10290
10291         * codegen.cs (EmitContext): Removed `InTry', `InCatch',
10292         `InFinally', `InLoop', `TryCatchLevel', `LoopBeginTryCatchLevel'
10293         and `NeedExplicitReturn'; added `IsLastStatement'.
10294         (EmitContext.EmitTopBlock): Emit the explicit "ret" if we either
10295         have a `ReturnLabel' or we're not unreachable.
10296
10297         * flowanalysis.cs (FlowBranching.MergeChild): Actually merge the
10298         child's reachability; don't just override ours with it.  Fixes
10299         #58058 (lluis's example).
10300         (FlowBranching): Added public InTryOrCatch(), InCatch(),
10301         InFinally(), InLoop(), InSwitch() and
10302         BreakCrossesTryCatchBoundary() methods.
10303
10304         * statement.cs (Return): Do all error checking in Resolve().
10305         Unless we are the last statement in a top-level block, always
10306         create a return label and jump to it.
10307         (Break, Continue): Do all error checking in Resolve(); also make
10308         sure we aren't leaving a `finally'.
10309         (Block.DoEmit): Set `ec.IsLastStatement' when emitting the last
10310         statement in a top-level block.
10311         (Block.Flags): Added `IsDestructor'.
10312         (Block.IsDestructor): New public property.
10313
10314 2004-01-20  Martin Baulig  <martin@ximian.com>
10315
10316         * statement.cs (Break.DoEmit): Set ec.NeedExplicitReturn; fixes #52427.
10317
10318 2004-01-20  Martin Baulig  <martin@ximian.com>
10319
10320         * statement.cs (Statement.ResolveUnreachable): New public method.
10321         (If, While): Do the dead-code elimination in Resolve(), not in Emit().
10322         (Block.Resolve): Resolve unreachable statements.
10323
10324 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10325
10326         * expression.cs: We need to fix the case where we do
10327         not have a temp variable here.
10328
10329         * assign.cs: Only expression compound assignments need
10330         temporary variables.
10331
10332 2004-01-19 Ben Maurer  <bmaurer@users.sourceforge.net>
10333
10334         * flowanalysis.cs: Reduce memory allocation in a few ways:
10335           - A block with no variables should not allocate a bit
10336             vector for itself.
10337           - A method with no out parameters does not need any tracking
10338             for assignment of the parameters, so we need not allocate
10339             any data for it.
10340           - The arrays:
10341                 public readonly Type[] VariableTypes;
10342                 public readonly string[] VariableNames;
10343             Are redundant. The data is already stored in the variable
10344             map, so we need not allocate another array for it.
10345           - We need to add alot of checks for if (params | locals) == null
10346             due to the first two changes.
10347
10348 2004-01-18  Miguel de Icaza  <miguel@ximian.com>
10349
10350         * ecore.cs (FieldExpr.AddressOf): For ValueTypes that do not
10351         implement IMemoryLocation, we store a copy on a local variable and
10352         take the address of it.  Patch from Benjamin Jemlich
10353
10354         * cs-parser.jay: Applied patch from Ben Maurer to the "type" rule
10355         to use a special "type_name_expression" rule which reduces the
10356         number of "QualifiedIdentifier" classes created, and instead
10357         directly creates MemberAccess expressions.
10358
10359 2004-01-17  Miguel de Icaza  <miguel@ximian.com>
10360
10361         * convert.cs: Applied patch from Benjamin Jemlich (pcgod@gmx.net)
10362         that fixes #52853.  Null literal assignment to ValueType
10363
10364         * class.cs (MethodData.Emit): Instead of checking the name of the
10365         method to determine if its a destructor, create a new derived
10366         class from Method called Destructor, and test for that.  
10367
10368         * cs-parser.jay: Create a Destructor object instead of a Method.  
10369
10370         Based on a fix from Benjamin Jemlich (pcgod@gmx.net)
10371
10372         Fixes: 52933
10373
10374 2004-01-16  Miguel de Icaza  <miguel@ximian.com>
10375
10376         * expression.cs (Binary.ResolveOperator): Perform an implicit
10377         conversion from MethodGroups to their delegate types on the
10378         Addition operation.
10379
10380         * delegate.cs: Introduce a new class DelegateCreation that is the
10381         base class for `NewDelegate' and `ImplicitDelegateCreation',
10382         factor some code in here.
10383
10384         * convert.cs (Convert.ImplicitConversionStandard): Add an implicit
10385         conversion from MethodGroups to compatible delegate types. 
10386
10387         * ecore.cs (Expression.Resolve): Do not flag error 654
10388         (Methodgroupd needs parenthesis) if running on the V2 compiler, as
10389         we allow conversions from MethodGroups to delegate types now.
10390
10391         * assign.cs (Assign.DoResolve): Do not flag errors on methodgroup
10392         assignments in v2 either.
10393
10394 2004-01-10  Miguel de Icaza  <miguel@ximian.com>
10395
10396         * ecore.cs (FieldExpr.AddressOf): Fix generated IL for accessing
10397         static read-only fields in ctors.
10398
10399         Applied patch from Benjamin Jemlich 
10400
10401         * expression.cs (UnaryMutator): Avoid leaking local variables. 
10402
10403 2004-01-09  Miguel de Icaza  <miguel@ximian.com>
10404
10405         * cs-tokenizer.cs (IsCastToken): Allow the various native types
10406         here to return true, as they can be used like this:
10407
10408                 (XXX) int.MEMBER ()
10409
10410         Fixed 49836 and all the other dups
10411
10412 2004-01-09  Zoltan Varga  <vargaz@freemail.hu>
10413
10414         * driver.cs: Implement /win32res and /win32icon.
10415
10416 2004-01-08  Miguel de Icaza  <miguel@ximian.com>
10417
10418         * cs-parser.jay: Add a rule to improve error handling for the
10419         common mistake of placing modifiers after the type.
10420
10421 2004-01-07  Miguel de Icaza  <miguel@ximian.com>
10422
10423         * cs-parser.jay (interface_event_declaration): Catch
10424         initialization of events on interfaces, and report cs0068
10425
10426         * cs-parser.jay (interface_event_declaration): Catch
10427         initialization of events. 
10428
10429         * ecore.cs: Better report missing constructors.
10430
10431         * expression.cs (Binary.ResolveOperator): My previous bug fix had
10432         the error reporting done in the wrong place.  Fix.
10433
10434         * expression.cs (Binary.ResolveOperator): Catch the 
10435         operator + (E x, E y) error earlier, and later allow for implicit
10436         conversions in operator +/- (E e, U x) from U to the underlying
10437         type of E.
10438
10439         * class.cs (TypeContainer.DefineDefaultConstructor): Fix bug
10440         52596, if the container class is abstract, the default constructor
10441         is protected otherwise its public (before, we were always public).
10442
10443         * statement.cs (Fixed.Resolve): Catch a couple more errors in the
10444         fixed statement.
10445
10446         (Using.EmitLocalVariableDecls): Applied patch from Benjamin
10447         Jemlich that fixes bug #52597, MCS was generating invalid code for
10448         idisposable structs.   Thanks to Ben for following up with this
10449         bug as well.
10450
10451 2004-01-06  Miguel de Icaza  <miguel@ximian.com>
10452
10453         * driver.cs: Allow assemblies without code to be generated, fixes
10454         52230.
10455
10456 2004-01-07  Nick Drochak <ndrochak@gol.com>
10457
10458         * attribute.cs: Remove unneeded catch variables. Eliminates a warning.
10459
10460 2004-01-05  Miguel de Icaza  <miguel@ximian.com>
10461
10462         * cs-parser.jay: Add rules to improve error reporting if fields or
10463         methods are declared at the namespace level (error 116)
10464
10465         * Add rules to catch event add/remove
10466
10467 2004-01-04  David Sheldon <dave-mono@earth.li>
10468
10469   * expression.cs: Added matching ")" to error message for 
10470   CS0077
10471
10472 2004-01-03 Todd Berman <tberman@gentoo.org>
10473
10474         * ecore.cs, attribute.cs:
10475         Applying fix from #52429.
10476
10477 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10478
10479         * ecore.cs, expression.cs, statement.cs:
10480         Total rewrite of how we handle branching. We
10481         now handle complex boolean expressions with fewer
10482         jumps. As well if (x == 0) no longer emits a ceq.
10483
10484         if (x is Foo) is much faster now, because we generate
10485         better code.
10486
10487         Overall, we get a pretty big improvement on our benchmark
10488         tests. The code we generate is smaller and more readable.
10489
10490         I did a full two-stage bootstrap. The patch was reviewed
10491         by Martin and Miguel.
10492
10493 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10494
10495         * cs-parser.jay: Make primary_expression not take a QI.
10496         we dont need this because the member_access rule covers
10497         us here. So we replace the rule with just IDENTIFIER.
10498
10499         This has two good effects. First, we remove a s/r conflict.
10500         Second, we allocate many fewer QualifiedIdentifier objects.
10501
10502 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10503
10504         * attribute.cs: Handle MarshalAs attributes as pseudo, and
10505         set the correct information via SRE. This prevents
10506         hanging on the MS runtime. Fixes #29374.
10507
10508 2004-01-03 Ben Maurer  <bmaurer@users.sourceforge.net>
10509
10510         * convert.cs: correctly handle conversions to value types
10511         from Enum and ValueType as unboxing conversions.
10512
10513         Fixes bug #52569. Patch by Benjamin Jemlich.
10514
10515 2004-01-02  Ravi Pratap  <ravi@ximian.com>
10516
10517         * expression.cs (BetterConversion): Prefer int -> uint
10518         over int -> ulong (csc's behaviour). This fixed bug #52046.
10519
10520 2004-01-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10521
10522         * decl.cs (MemberCache.FindMembers): now returns a
10523         MemberInfo [].
10524
10525         * typemanager.cs: In general, go with with ^^.
10526         (CopyNewMethods): take an IList.
10527         (RealMemberLookup): Only allocate an arraylist
10528         if we copy from two sets of methods.
10529
10530         This change basically does two things:
10531         1) Fewer array lists allocated due to CopyNewMethods.
10532         2) the explicit cast in MemberList costed ALOT.
10533
10534 2004-01-02  Zoltan Varga  <vargaz@freemail.hu>
10535
10536         * cs-tokenizer.cs (consume_identifier) driver.cs: Cache identifiers in
10537         a hashtable to avoid needless string allocations when an identifier is
10538         used more than once (the common case).
10539
10540 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10541
10542         * pending.cs: MS's TypeBuilder.GetInterfaces ()
10543         is broken, it will not return anything. So, we
10544         have to use the information we have in mcs to
10545         do the task.
10546
10547         * typemanager.cs: Add a cache for GetInterfaces,
10548         since this will now be used more often (due to ^^)
10549
10550         (GetExplicitInterfaces) New method that gets the
10551         declared, not effective, interfaces on a type
10552         builder (eg, if you have interface IFoo, interface
10553         IBar, Foo : IFoo, Bar : Foo, IBar, GetExplInt (Bar) ==
10554         { IBar }.
10555
10556         This patch makes MCS able to bootstrap itself on
10557         Windows again.
10558
10559 2004-01-01 Ben Maurer  <bmaurer@users.sourceforge.net>
10560
10561         * expression.cs: Remove the Nop's that Miguel put
10562         in by mistake.
10563
10564 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10565
10566         * report.cs, codegen.cs: Give the real stack trace to
10567         the error when an exception is thrown.
10568
10569 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10570
10571         * decl.cs: only allocate hashtables for ifaces if 
10572         it is an iface!
10573
10574 2003-12-31 Ben Maurer  <bmaurer@users.sourceforge.net>
10575
10576         * expression.cs: fix the error from cs0121-2.cs
10577         (a parent interface has two child interfaces that
10578         have a function with the same name and 0 params
10579         and the function is called through the parent).
10580
10581 2003-12-30 Ben Maurer  <bmaurer@users.sourceforge.net>
10582
10583         * class.cs, rootcontext.cs, typmanager.cs: do not
10584         leak pointers.
10585
10586 2003-12-28 Ben Maurer  <bmaurer@users.sourceforge.net>
10587
10588         * codegen.cs: remove stack for the ec flow branching.
10589         It is already a linked list, so no need.
10590
10591 2003-12-27 Ben Maurer  <bmaurer@users.sourceforge.net>
10592
10593         * Makefile: Allow custom profiler here.
10594
10595 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10596
10597         * typemanager.cs (LookupType):
10598           - Use a static char [], because split takes
10599             a param array for args, so it was allocating
10600             every time.
10601           - Do not store true in a hashtable, it boxes.
10602
10603 2003-12-26 Ben Maurer  <bmaurer@users.sourceforge.net>
10604
10605         * flowanalysis.cs: bytify common enums.
10606
10607 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10608
10609         * modifiers.cs: Add a new set of flags for the
10610         flags allowed on explicit interface impls.
10611         * cs-parser.jay: catch the use of modifiers in
10612         interfaces correctly.
10613         * class.cs: catch private void IFoo.Blah ().
10614
10615         All related to bug #50572.
10616
10617 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10618
10619         * decl.cs: Rewrite the consistant accessability checking.
10620         Accessability is not linear, it must be implemented in
10621         a tableish way. Fixes #49704.
10622
10623 2003-12-25 Ben Maurer  <bmaurer@users.sourceforge.net>
10624
10625         * expression.cs: Handle negation in a checked context.
10626         We must use subtraction from zero. Fixes #38674.
10627
10628 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10629
10630         * class.cs: Ignore static void main in DLLs.
10631         * rootcontext.cs: Handle the target type here,
10632         since we are have to access it from class.cs
10633         * driver.cs: account for the above.
10634
10635 2003-12-23 Ben Maurer  <bmaurer@users.sourceforge.net>
10636
10637         * report.cs: Give line numbers and files if available.
10638
10639 2003-12-20  Zoltan Varga  <vargaz@freemail.hu>
10640
10641         * driver.cs: Implement /addmodule.
10642
10643         * typemanager.cs:  Change 'modules' field so it now contains Modules not
10644         ModuleBuilders.
10645
10646 2003-12-20  Martin Baulig  <martin@ximian.com>
10647
10648         * class.cs (TypeContainer.DefineMembers): Don't do the CS0649 check here.
10649         (FieldBase.IsAssigned): Removed this field.
10650         (FieldBase.SetAssigned): New public method.
10651         (TypeContainer.Emit): Make the CS0169/CS0649 checks actually work.
10652
10653 2003-12-20  Martin Baulig  <martin@ximian.com>
10654
10655         * expression.cs (LocalVariableReference.DoResolve): Don't set
10656         `vi.Used' if we're called from DoResolveLValue().
10657
10658         * statement.cs (Block.DoResolve): `ec.DoEndFlowBranching()' now
10659         returns the usage vector it just merged into the current one -
10660         pass this one to UsageWarning().
10661         (Block.UsageWarning): Take the `FlowBranching.UsageVector' instead
10662         of the `EmitContext', don't call this recursively on our children.
10663
10664 2003-12-19  Zoltan Varga  <vargaz@freemail.hu>
10665
10666         * driver.cs: Implement /target:module.
10667
10668 2003-12-18  Zoltan Varga  <vargaz@freemail.hu>
10669
10670         * support.cs (CharArrayHashtable): New helper class.
10671
10672         * cs-tokenizer.cs: Store keywords in a hashtable indexed by 
10673         char arrays, not strings, so we can avoid creating a string in
10674         consume_identifier if the identifier is a keyword.
10675
10676 2003-12-16  Martin Baulig  <martin@ximian.com>
10677
10678         * statement.cs (LocalInfo.Assigned): Removed this property.
10679         (LocalInfo.Flags): Removed `Assigned'.
10680         (LocalInfo.IsAssigned): New public method; takes the EmitContext
10681         and uses flow analysis.
10682         (Block.UsageWarning): Made this method private.
10683         (Block.Resolve): Call UsageWarning() if appropriate.
10684
10685         * expression.cs (LocalVariableReference.DoResolve): Always set
10686         LocalInfo.Used here.
10687
10688 2003-12-13  Martin Baulig  <martin@ximian.com>
10689
10690         * statement.cs (Statement.DoEmit, Statement.Emit): Don't return
10691         any value here; we're now using flow analysis to figure out
10692         whether a statement/block returns a value.
10693
10694 2003-12-13  Martin Baulig  <martin@ximian.com>
10695
10696         * flowanalysis.cs (UsageVector.MergeFinallyOrigins): Made this
10697         working again.
10698         (FlowBranching.MergeFinally): Don't call
10699         `branching.CheckOutParameters()' here, this is called in
10700         MergeTopBlock().
10701         (FlowBranchingException.AddSibling): Call MergeFinallyOrigins()
10702         when adding the `finally' vector.       
10703
10704 2003-12-13  Martin Baulig  <martin@ximian.com>
10705
10706         * flowanalysis.cs
10707         (UsageVector.MergeJumpOrigins, FlowBranching.Label): Make this
10708         actually work and also fix #48962.
10709
10710 2003-12-12 Ben Maurer  <bmaurer@users.sourceforge.net>
10711
10712         * decl.cs: Do not check System.Object for nested types,
10713         since we know it does not have any. Big bang for buck:
10714
10715         BEFORE:
10716            Run 1:   8.35 seconds
10717            Run 2:   8.32 seconds
10718            corlib:  17.99 seconds
10719         AFTER:
10720            Run 1:   8.17 seconds
10721            Run 2:   8.17 seconds
10722            corlib:  17.39 seconds
10723
10724 2003-12-11 Ben Maurer  <bmaurer@users.sourceforge.net>
10725
10726         * class.cs (FindMembers): Allocate arraylists on demand. Most of the
10727         time we are returning 0 members, so we save alot here.
10728
10729 2003-12-11  Martin Baulig  <martin@ximian.com>
10730
10731         * flowanalysis.cs (UsageVector.MergeResult): Renamed this back to
10732         `MergeChild()', also just take the `FlowBranching' as argument;
10733         call Merge() on it and return the result.
10734         (FlowBranching.Merge): We don't need to do anything if we just
10735         have one sibling.
10736
10737 2003-12-11  Martin Baulig  <martin@ximian.com>
10738
10739         * flowanalysis.cs: Use a list of `UsageVector's instead of storing
10740         them in an `ArrayList' to reduce memory usage.  Thanks to Ben
10741         Maurer for this idea.
10742
10743 2003-12-11  Martin Baulig  <martin@ximian.com>
10744
10745         * flowanalysis.cs (MergeResult): This class is now gone; we now
10746         use the `UsageVector' for this.  The reason for this is that if a
10747         branching just has one sibling, we don't need to "merge" them at
10748         all - that's the next step to do.
10749         (FlowBranching.Merge): We now return a `UsageVector' instead of a
10750         `MergeResult'.
10751
10752 2003-12-11  Martin Baulig  <martin@ximian.com>
10753
10754         Reworked flow analyis and made it more precise and bug-free.  The
10755         most important change is that we're now using a special `Reachability'
10756         class instead of having "magic" meanings of `FlowReturns'.  I'll
10757         do some more cleanups and optimizations and also add some more
10758         documentation this week.
10759
10760         * flowanalysis.cs (Reachability): Added `Throws' and `Barrier';
10761         largely reworked this class.
10762         (FlowReturns): Removed `Unreachable' and `Exception'; we now use
10763         the new `Reachability' class instead of having "magic" values here.
10764         (FlowBranching): We're now using an instance of `Reachability'
10765         instead of having separate `Returns', `Breaks' etc. fields.
10766
10767         * codegen.cs (EmitContext.EmitTopBlock): Set `has_ret' solely
10768         based on flow analysis; ignore the return value of block.Emit ().
10769
10770 2003-12-10  Zoltan Varga  <vargaz@freemail.hu>
10771
10772         * driver.cs typemanager.cs: Find the mono extensions to corlib even
10773         if they are private.
10774
10775 2003-12-09  Martin Baulig  <martin@ximian.com>
10776
10777         * flowanalyis.cs (FlowBranching.Return, Goto, Throw): Removed;
10778         call them directly on the UsageVector.
10779
10780 2003-12-09  Martin Baulig  <martin@ximian.com>
10781
10782         * flowanalysis.cs (FlowBranching.MergeChild, MergeTopBlock):
10783         Changed return type from `FlowReturns' to `Reachability'.
10784
10785 2003-12-09  Martin Baulig  <martin@ximian.com>
10786
10787         * flowanalysis.cs (FlowBranching.Reachability): New sealed class.
10788         (FlowBranching.MergeResult): Replaced the `Returns', `Breaks' and
10789         `Reachable' fields with a single `Reachability' one.
10790
10791 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10792
10793         * class.cs (FindMembers): Remove foreach's.
10794
10795         Bootstrap times:
10796
10797         BEFORE
10798                 Run 1:   8.74 seconds
10799                 Run 2:   8.71 seconds
10800
10801         AFTER
10802                 Run 1:   8.64 seconds
10803                 Run 2:   8.58 seconds
10804
10805
10806 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10807
10808         * cs-parser.jay:
10809         * gen-treedump.cs:
10810         * statement.cs:
10811         This patch does a few things:
10812                 1. EmptyStatement is now a singleton, so it is never reallocated.
10813                 2. All blah is EmptyStatement constructs have been changed to
10814                    blah == EmptyStatement.Value, which is much faster and valid
10815                    now that EmptyStatement is a singleton.
10816                 3. When resolving a block, rather than allocating a new array for
10817                    the non-empty statements, empty statements are replaced with
10818                    EmptyStatement.Value
10819                 4. Some recursive functions have been made non-recursive.
10820         Mainly the performance impact is from (3), however (1) and (2) are needed for
10821         this to work. (4) does not make a big difference in normal situations, however
10822         it makes the profile look saner.
10823
10824         Bootstrap times:
10825
10826         BEFORE
10827         9.25user 0.23system 0:10.28elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10828         9.34user 0.13system 0:10.23elapsed 92%CPU (0avgtext+0avgdata 0maxresident)k
10829         Total memory allocated: 56397 KB
10830
10831         AFTER
10832         9.13user 0.09system 0:09.64elapsed 95%CPU (0avgtext+0avgdata 0maxresident)k
10833         8.96user 0.24system 0:10.13elapsed 90%CPU (0avgtext+0avgdata 0maxresident)k
10834         Total memory allocated: 55666 KB
10835
10836 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10837
10838         * support.cs: Rewrite DoubleHash to use its own impl. Is faster
10839         than the hashtable in a hashtable version
10840
10841         * decl.cs: Right now, whenever we try to lookup a type inside a namespace,
10842         we always end up concating a string. This results in a huge perf
10843         loss, because many strings have to be tracked by the GC. In this
10844         patch, we first use a hashtable that works with two keys, so that
10845         the strings do not need to be concat'ed.
10846
10847         Bootstrap times:
10848         BEFORE
10849                 Run 1:   8.74 seconds
10850                 Run 2:   8.71 seconds
10851
10852         AFTER
10853                 Run 1:   8.65 seconds
10854                 Run 2:   8.56 seconds
10855
10856 2003-12-08 Ben Maurer  <bmaurer@users.sourceforge.net>
10857
10858         * Makefile: Add a new target `do-time' that does a quick and simple
10859         profile, leaving easy to parse output.
10860
10861 2003-12-08  Zoltan Varga  <vargaz@freemail.hu>
10862
10863         * codegen.cs (Init): Create the dynamic assembly with 
10864         AssemblyBuilderAccess.Save, to enable some optimizations in the runtime.
10865
10866 2003-12-02 Ben Maurer  <bmaurer@users.sourceforge.net>
10867
10868         * support.cs: Make the PtrHashtable use only one
10869         instance of its comparer.
10870
10871 2003-11-30  Zoltan Varga  <vargaz@freemail.hu>
10872
10873         * typemanager.cs: Fix lookup of GetNamespaces.
10874
10875 2003-11-29  Miguel de Icaza  <miguel@ximian.com>
10876
10877         * expression.cs: Removed redundant line.
10878
10879         * statement.cs (Block.Resolve, Block.Emit): Avoid foreach on
10880         ArrayLists, use for loops with bounds.  
10881
10882         * flowanalysis.cs (FlowBranching.Merge): Avoid foreach on
10883         arraylist.
10884
10885         * expression.cs (Invocation.OverloadResolve): Avoid foreach on
10886         arraylists, use for loop with bounds.
10887
10888         The above three changes give us a 0.071 second performance
10889         improvement out of 3.294 seconds down to 3.223.  On my machine
10890         the above changes reduced the memory usage by 1,387 KB during
10891         compiler bootstrap.
10892
10893         * cs-parser.jay (QualifiedIdentifier): New class used to represent
10894         QualifiedIdentifiers.  Before we created a new string through
10895         concatenation, and mostly later on, the result would be
10896         manipulated by DecomposeQI through string manipulation.
10897
10898         This reduced the compiler memory usage for bootstrapping from
10899         59380 KB to 59007 KB on my machine, 373 KB, and also reduced the
10900         compile times in 0.05 seconds.
10901
10902 2003-11-28  Dick Porter  <dick@ximian.com>
10903
10904         * support.cs: Do string compares with the Invariant culture.
10905
10906         * rootcontext.cs: 
10907         * gen-treedump.cs: 
10908         * expression.cs: 
10909         * driver.cs: 
10910         * decl.cs: 
10911         * codegen.cs: 
10912         * class.cs: Use the char forms of IndexOf and LastIndexOf, so that
10913         the comparison is done with the Invariant culture.
10914
10915 2003-11-27  Miguel de Icaza  <miguel@ximian.com>
10916
10917         * statement.cs (Foreach.TryType): Use DeclaredOnly to find the
10918         GetEnumerator method.
10919
10920         (ProbeCollectionType): Iterate starting at the most specific type
10921         upwards looking for a GetEnumerator
10922
10923         * expression.cs: Shift count can be up to 31 for int/uint and 63
10924         for long/ulong.
10925
10926 2003-11-26  Miguel de Icaza  <miguel@ximian.com>
10927
10928         * statement.cs (Block.LookupLabel): Also look for the label on the
10929         children blocks.  Use a hash table to keep track of visited
10930         nodes. 
10931
10932         * cfold.cs (IntConstant to UIntConstant mapping): Only return if
10933         we actually did transform the other operand, otherwise fall back
10934         to the common codepath that casts to long.
10935
10936         * cs-tokenizer.cs: Use the same code pattern as the int case.
10937         Maybe I should do the parsing myself, and avoid depending on the
10938         Parse routines to get this done.
10939
10940 2003-11-25  Miguel de Icaza  <miguel@ximian.com>
10941
10942         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10943         which fixes bug 51347.  This time test it.
10944
10945         * expression.cs: Make TypeOfVoid derive from TypeOf, so code in
10946         attributes for example can not tell the difference between these.
10947         The difference was only a syntax feature of the language. 
10948
10949         * attribute.cs: Apply attributes to delegates.
10950
10951         * delegate.cs: Call the apply attributes method.
10952
10953 2003-11-24  Miguel de Icaza  <miguel@ximian.com>
10954
10955         * convert.cs (TryImplicitIntConversion): One line bug fix: we were
10956         comparing 0 vs Byte.MinValue, not the value
10957
10958         (ImplicitConversionRequired): When reporting a conversion error,
10959         use error 31 to print out the constant error instead of the
10960         simpler 29.
10961
10962         * expression.cs: Apply fix from l_m@pacbell.net (Laurent Morichetti),  
10963         which fixes bug 51347.
10964
10965 2003-11-22  Miguel de Icaza  <miguel@ximian.com>
10966
10967         * driver.cs: Applied patch from gert.driesen@pandora.be (Gert Driesen) 
10968         which fixes the -warnaserror command line option.
10969
10970 2003-11-21  Miguel de Icaza  <miguel@ximian.com>
10971
10972         * cfold.cs (DoNumericPromotions): During constant folding of
10973         additions on UIntConstant, special case intconstants with
10974         IntConstants like we do on the expression binary operator. 
10975
10976 2003-11-12  Miguel de Icaza  <miguel@ximian.com>
10977
10978         * convert.cs (ImplicitReferenceConversion): We were missing a case
10979         (System.Enum are not value types or class types, so we need to
10980         classify them separatedly).
10981
10982         * driver.cs: We do not support error 2007.
10983
10984 2003-11-12 Jackson Harper <jackson@ximian.com>
10985
10986         * driver.cs: Use corlib.dll or mscorlib.dll when looking up the
10987         system directory. Also use the full file name so users can
10988         libraries names mscorlib-o-tron.dll in a non system dir.
10989
10990 2003-11-10  Martin Baulig  <martin@ximian.com>
10991
10992         * typemanager.cs (TypeManager.ResolveExpressionTypes): Removed.
10993         (TypeManager.InitCoreTypes): Initialize them here, but instead of
10994         calling `ResolveType()' on them, directly assign their `Type'.
10995
10996 2003-11-08  Martin Baulig  <martin@ximian.com>
10997
10998         * class.cs (TypeContainer.GetClassBases): Use TypeExpr's for the
10999         return value and the `out parent' parameter.
11000         (TypeContainer.DefineType): Moved the CS0644 check into
11001         GetClassBases().  Don't pass the interface types to the
11002         `builder.DefineType()'/`builder.DefineNestedType()', but resolve
11003         them later and then call `TypeBuilder.AddInterfaceImplementation()'.
11004
11005         * ecore.cs (TypeExpr.IsAttribute): New property.
11006         (TypeExpr.GetInterfaces): New method.
11007
11008         * interface.cs (Interface.GetInterfaceTypeByName): Return a
11009         TypeExpr instead of a Type.
11010         (Interface.GetInterfaceBases): Return TypeExpr's instead of Type's.
11011         (Interface.DefineType): Don't pass the interface types to the
11012         `builder.Definetype()'/`builder.DefineNestedType()', but resolve
11013         them later and then call `TypeBulider.AddInterfaceImplementation()'.
11014
11015         * typemanager.cs (TypeManager.AddUserType): Take a `TypeExpr[]'
11016         instead of a `Type[]'.
11017         (TypeManager.RegisterBuilder): Likewise.
11018         (TypeManager.AddUserInterface): Likewise.
11019         (TypeManager.ExpandInterfaces): Take a `Type[]' instead of a
11020         `Type[]' and also return a `TypeExpr[]'.
11021         (TypeManager.GetInterfaces): Return a `TypeExpr[]'.
11022
11023 2003-11-08  Martin Baulig  <martin@ximian.com>
11024
11025         * decl.cs (DeclSpace.ResolveTypeExpr): Return a TypeExpr, not an
11026         Expression.     
11027
11028 2003-11-08  Martin Baulig  <martin@ximian.com>
11029
11030         * decl.cs (DeclSpace.GetTypeResolveEmitContext): Call
11031         TypeManager.ResolveExpressionTypes().
11032
11033         * ecore.cs (Expression.ResolveAsTypeTerminal): Return a TypeExpr
11034         instead of an Expression.
11035         (TypeExpr): This is now an abstract base class for `TypeExpression'.
11036         (TypeExpression): New public class; formerly known as `TypeExpr'.
11037
11038         * expression.cs (ComposedCast): Derive from TypeExpr.
11039
11040         * typemanager.cs (TypeManager.system_*_expr): These are now
11041         TypExpr's instead of Expression's.
11042         (TypeManager.ResolveExpressionTypes): New public static function;
11043         called from DeclSpace.GetTypeResolveEmitContext() to resolve all
11044         of them.        
11045
11046 2003-11-06  Miguel de Icaza  <miguel@ximian.com>
11047
11048         * expression.cs (New.DoResolve): Do not dereference value that
11049         might be a null return.
11050
11051         * statement.cs (Block.EmitMeta): Use the Const.ChangeType to make
11052         sure that the constant value has the right type.  Fixes an
11053         unreported bug, similar to 50425.
11054
11055         * const.cs (Const.LookupConstantValue): Call
11056         ImplicitStandardConversionExists before doing a conversion to
11057         avoid havng the TypeManager.ChangeType do conversions.
11058
11059         Reduced the number of casts used
11060
11061         (Const.ChangeType): New routine to enable reuse of the constant
11062         type changing code from statement.
11063
11064         * typemanager.cs (ChangeType): Move common initialization to
11065         static global variables.
11066
11067         Fixes #50425.
11068
11069         * convert.cs (ImplicitReferenceConversion): Somehow we allowed
11070         every value type to go through, even if it was void.  Fix that. 
11071
11072         * cs-tokenizer.cs: Use is_identifier_start_character on the start
11073         character of the define, and the is_identifier_part_character for
11074         the rest of the string.
11075
11076 2003-11-05  Miguel de Icaza  <miguel@ximian.com>
11077
11078         * expression.cs (UnaryMutator.EmitCode): When I updated
11079         LocalVariableReference.DoResolve, I overdid it, and dropped an
11080         optimization done on local variable references.
11081
11082 2003-11-04  Miguel de Icaza  <miguel@ximian.com>
11083
11084         * ecore.cs: Convert the return from Ldlen into an int.
11085
11086 2003-10-20  Miguel de Icaza  <miguel@ximian.com>
11087
11088         * decl.cs (DeclSpace.GetAccessLevel): Handle NotPublic case for
11089         the accessibility, this is a special case for toplevel non-public
11090         classes (internal for instance).
11091
11092 2003-10-20  Nick Drochak <ndrochak@gol.com>
11093
11094         * ecore.cs: Fix typo and build.  Needed another right paren.
11095
11096 2003-10-19  Miguel de Icaza  <miguel@ximian.com>
11097
11098         * ecore.cs: Applied fix from Ben Maurer.   We were handling in the
11099         `internal' case regular and protected, but not allowing protected
11100         to be evaluated later.  Bug 49840
11101
11102 2003-10-15  Miguel de Icaza  <miguel@ximian.com>
11103
11104         * statement.cs (Switch.TableSwitchEmit): Compare the upper bound
11105         to kb.Nlast, and not the kb.nFirst to isolate the switch
11106         statement.
11107
11108         Extract the underlying type, so enumerations of long/ulong are
11109         treated like long/ulong.
11110
11111 2003-10-14  Miguel de Icaza  <miguel@ximian.com>
11112
11113         * expression.cs (New): Overload the meaning of RequestedType to
11114         track the possible creation of the NewDelegate type, since
11115         DoResolve is invoked more than once for new constructors on field
11116         initialization.
11117
11118         See bugs: #48800 and #37014
11119
11120         * cs-parser.jay (declare_local_constants): Take an arraylist
11121         instead of a single constant.
11122
11123         (local_constant_declaration): It should take a
11124         constant_declarators, not a constant_declarator.  Fixes 49487
11125
11126         * convert.cs: Fix error report.
11127
11128 2003-10-13 Jackson Harper <jackson@ximian.com>
11129
11130         * typemanager.cs (TypeToCoreType): Add float and double this fixes
11131         bug #49611
11132
11133 2003-10-09  Martin Baulig  <martin@ximian.com>
11134
11135         * class.cs (MethodCore): Added additional `DeclSpace ds' argument
11136         to the .ctor.
11137         (MethodCore.DoDefineParameters): Removed the TypeContainer
11138         argument; use the DeclSpace which was passed to the .ctor instead.
11139         (MethodCore.CheckParameter): Take a DeclSpace instead of a
11140         TypeContainer; we only need a DeclSpace here.
11141
11142 2003-10-09  Martin Baulig  <martin@ximian.com>
11143
11144         * class.cs (MethodData): Added additional `DeclSpace ds' argument
11145         to the .ctor.
11146         (MethodData.Define, MethodData.Emit): Pass the `ds' to the
11147         EmitContext's .ctor.    
11148
11149 2003-10-09  Martin Baulig  <martin@ximian.com>
11150
11151         * decl.cs (DeclSpace.AsAccessible): Moved here from TypeContainer.
11152         (AccessLevel, CheckAccessLevel, GetAccessLevel): They're used by
11153         AsAccessible(), moved them as well.
11154
11155         * class.cs (TypeContainer.AsAccessible): Moved to DeclSpace.
11156
11157 2003-10-08  Atsushi Enomoto <ginga@kit.hi-ho.ne.jp>
11158
11159         * cs-parser.jay : Renamed yyName to yyNames related to jay.
11160
11161 2003-10-07  Miguel de Icaza  <miguel@ximian.com>
11162
11163         * expression.cs (Binary.Emit.GreatherThanOrEqual): Fix the code
11164         generation for >=, as spotted by Paolo, bug 48679.  
11165         Patch from David Waite.
11166
11167         * cs-tokenizer.cs: Add handling for #pragma.
11168
11169         * cs-parser.jay: Allow for both yield and yield return in the
11170         syntax.  The anti-cobolization of C# fight will go on!
11171
11172         * class.cs (TypeBuilder.DefineType): Catch error condition here
11173         (Parent.DefineType erroring out and returning null).
11174
11175         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
11176         coping with enumerations variables, we were mistakenly processing
11177         them as a regular value type instead of built-in types.  Fixes the
11178         bug #48063
11179
11180         * typemanager.cs (IsBuiltinOrEnum): New method.
11181
11182 2003-09-30  Miguel de Icaza  <miguel@ximian.com>
11183
11184         * cs-parser.jay: Upgrade: yield now needs the return clause.
11185
11186 2003-09-19  Martin Baulig  <martin@ximian.com>
11187
11188         * decl.cs (MemberCache.SetupCacheForInterface): Take a
11189         `MemberCache parent' argument.  Normally, an interface doesn't
11190         have a parent type except System.Object, but we use this in gmcs
11191         for generic type parameters.
11192
11193 2003-09-18  Martin Baulig  <martin@ximian.com>
11194
11195         * typemanager.cs (TypeHandle.ctor): Set `IsInterface' solely based
11196         on `type.IsInterface'; don't check whether the type has a parent
11197         to determine whether it's an interface.
11198
11199 2003-09-15  Martin Baulig  <martin@ximian.com>
11200
11201         * class.cs (TypeContainer.DefineType): Added an error flag to
11202         avoid reporting duplicate CS0146's ("class definition is
11203         circular.").
11204
11205         * driver.cs (Driver.MainDriver): Abort if
11206         RootContext.ResolveTree() reported any errors.
11207
11208 2003-09-07  Martin Baulig  <martin@ximian.com>
11209
11210         * report.cs (Error, Warning): Added overloaded versions which take
11211         a `params object[] args' and call String.Format().
11212
11213 2003-09-07  Martin Baulig  <martin@ximian.com>
11214
11215         * decl.cs (DeclSpace..ctor): Don't call
11216         NamespaceEntry.DefineName() here; do it in RecordDecl() which is
11217         called from Tree.RecordDecl().  Fixes the CS0101 reporting.
11218         (DeclSpace.RecordDecl): New method.
11219
11220         * tree.cs (Tree.RecordDecl): Call ds.RecordDecl().
11221
11222 2003-09-02  Ravi Pratap  <ravi@ximian.com>
11223
11224         * attribute.cs (CheckAttributeTarget): Ensure that we allow return
11225         value attributes to be applied to ParameterBuilders.
11226
11227         * class.cs (MethodCore.LabelParameters): Make static and more
11228         generic so that it can be used from other places - like interface
11229         methods, for instance.
11230
11231         * interface.cs (Interface.Emit): Call LabelParameters before
11232         emitting attributes on the InterfaceMethod.
11233
11234 2003-08-26  Martin Baulig  <martin@ximian.com>
11235
11236         * ecore.cs (SimpleName.SimpleNameResolve): Look for members before
11237         resolving aliases; fixes #47927.
11238
11239 2003-08-26  Martin Baulig  <martin@ximian.com>
11240
11241         * statement.cs (Using.DoResolve): This is internally emitting a
11242         try/finally clause, so we need to set ec.NeedExplicitReturn if we
11243         do not always return.  Fixes #47681.
11244
11245 2003-08-26  Martin Baulig  <martin@ximian.com>
11246
11247         * decl.cs (MemberCore): Moved WarningNotHiding(),
11248         Error_CannotChangeAccessModifiers() and CheckMethodAgainstBase()
11249         into MemberBase.
11250         (AdditionResult): Make this nested in DeclSpace.
11251         (DeclSpace.ctor): The .ctor now takes an additional NamespaceEntry
11252         argument; call NamespaceEntry.Define() unless we're nested in a
11253         class or struct.
11254
11255         * namespace.cs (Namespace.DefineName): New public function.  This
11256         is called from DeclSpace's .ctor to add 
11257         (Namespace.Lookup): Include DeclSpaces in the lookup.
11258
11259         * class.cs (Operator): Derive from MemberBase, not MemberCore.
11260
11261         * const.cs (Const): Derive from MemberBase, not MemberCore.     
11262
11263 2003-08-25  Martin Baulig  <martin@ximian.com>
11264
11265         * convert.cs (Convert.ExplicitReferenceConversion): When
11266         converting from an interface type to a class, unbox if the target
11267         type is a struct type.  Fixes #47822.
11268
11269 2003-08-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11270
11271         * typemanager.cs: fixed the values of MethodFlags. Closes #47855 and
11272         #47854.
11273
11274 2003-08-22  Martin Baulig  <martin@ximian.com>
11275
11276         * class.cs (TypeManager.DefineType): When defining a nested type,
11277         call DefineType() on our parent; fixes #47801.
11278
11279 2003-08-22  Martin Baulig  <martin@ximian.com>
11280
11281         * class.cs (MethodData.Define): While checking if a method is an
11282         interface implementation, improve the test a bit more to fix #47654.
11283
11284 2003-08-22  Martin Baulig  <martin@ximian.com>
11285
11286         * expression.cs (Probe.DoResolve): Check whether `expr' resolved
11287         correctly; fixes #47722.
11288
11289 2003-08-22  Martin Baulig  <martin@ximian.com>
11290
11291         * expression.cs (UnaryMutator.ResolveVariable): If the target is a
11292         LocalVariableReference, ensure it's not read-only.  Fixes #47536.
11293
11294         * statement.cs (Fixed.DoResolve): Make all variables read-only. 
11295
11296 2003-08-22  Martin Baulig  <martin@ximian.com>
11297
11298         * ecore.cs (FieldExpr.DoResolveLValue): Static read-only fields
11299         can only be assigned in static constructors.  Fixes #47161.
11300
11301 2003-08-22  Martin Baulig  <martin@ximian.com>
11302
11303         Rewrote and improved the flow analysis code.
11304
11305         * flowbranching.cs (FlowBranching): Make this class abstract.
11306         (FlowBranching.CreateBranching): New static function to create a
11307         new flow branching.
11308         (FlowBranchingBlock, FlowBranchingException): New classes.
11309         (FlowBranching.UsageVector.Type): New public readonly field.
11310         (FlowBranching.UsageVector.Breaks): Removed the setter.
11311         (FlowBranching.UsageVector.Returns): Removed the setter.
11312         (FlowBranching.UsageVector): Added Break(), Return(),
11313         NeverReachable() and Throw() methods to modify the reachability.
11314         (FlowBranching.UsageVector.MergeChildren): Removed, this is now
11315         done by FlowBranching.Merge().
11316         (FlowBranching.UsageVector.MergeChild): New method; merges the
11317         merge result into the current vector.
11318         (FlowBranching.Merge): New abstract method to merge a branching.
11319
11320 2003-08-12  Martin Baulig  <martin@ximian.com>
11321
11322         * expression.cs (Indirection.CacheTemporaries): Create the
11323         LocalTemporary with the pointer type, not its element type.
11324
11325 2003-08-10  Miguel de Icaza  <miguel@ximian.com>
11326
11327         * cs-parser.jay: FIRST_KEYWORD, LAST_KEYWORD: used to know if a
11328         token was a keyword or not.
11329
11330         Add `error' options where an IDENTIFIER was expected;  Provide
11331         CheckToken and CheckIdentifierToken convenience error reporting
11332         functions. 
11333
11334         Do not use `DeclSpace.Namespace', use `DeclSpace.NamespaceEntry'.
11335
11336         * decl.cs: Rename `NamespaceEntry Namespace' public field into
11337         NameSpaceEntry NameSpaceEntry.
11338
11339         (LookupInterfaceOrClass): Avoid creating a full qualified name
11340         from namespace and name: avoid doing lookups when we know the
11341         namespace is non-existant.   Use new Tree.LookupByNamespace which
11342         looks up DeclSpaces based on their namespace, name pair.
11343
11344         * driver.cs: Provide a new `parser verbose' to display the
11345         exception thrown during parsing.  This is turned off by default
11346         now, so the output of a failure from mcs is more graceful.
11347
11348         * namespace.cs: Track all the namespaces defined in a hashtable
11349         for quick lookup.
11350
11351         (IsNamespace): New method
11352
11353 2003-08-09  Miguel de Icaza  <miguel@ximian.com>
11354
11355         * namespace.cs: Remove redundant call;  Avoid using MakeFQN when
11356         we know that we need to concatenate (full typename can never be
11357         null). 
11358
11359         * class.cs: ditto.
11360
11361         * statement.cs: Use a bitfield;  Do not initialize to null things
11362         which are done by the constructor by default.
11363
11364         * cs-parser.jay: bug fix, parameter was 4, not 3.
11365
11366         * expression.cs: Just use the property;
11367
11368         * statement.cs: No need for GetVariableInfo method.
11369
11370 2003-08-08  Martin Baulig  <martin@ximian.com>
11371
11372         * flowanalysis.cs (FlowReturns): This is now nested in the
11373         `FlowBranching' class.
11374         (MyBitVector): Moved this here from statement.cs.
11375         (FlowBranching.SiblingType): New enum type.
11376         (FlowBranching.CreateSibling): Added `SiblingType' argument.
11377
11378 2003-08-07  Martin Baulig  <martin@ximian.com>
11379
11380         * flowanalysis.cs (FlowBranchingType): This is now nested in the
11381         `FlowBranching' class and called `BranchingType'.
11382
11383 2003-08-07  Martin Baulig  <martin@ximian.com>
11384
11385         * flowanalysis.cs: Moved all the control flow analysis code into
11386         its own file.
11387
11388 2003-08-07  Martin Baulig  <martin@ximian.com>
11389
11390         * assign.cs (Assign.DoResolve): `target' must either be an
11391         IAssignMethod or an EventAccess; report a CS0131 otherwise.  Fixes
11392         #37319.
11393
11394 2003-08-07  Miguel de Icaza  <miguel@ximian.com>
11395
11396         * expression.cs (BinaryMethod): This kind of expression is created by the
11397         Binary class if it determines that the operator has to be handled
11398         by a method.
11399
11400         (BinaryDelegate): This kind of expression is created if we are
11401         dealing with a + or - operator on delegates.
11402
11403         (Binary): remove method, argumetns, and DelegateOperator: when
11404         dealing with methods, 
11405
11406         * ecore.cs (EventExpr.EmitAddOrRemove): Update to new layout.
11407
11408         * statement.cs (Block): use bitfields for the three extra booleans
11409         we had in use.   Remove unused topblock parameter.
11410
11411         * codegen.cs: Remove unecessary argument to Block.EmitTopBlock
11412
11413         * assign.cs: Drop extra unneeded tests.
11414
11415 2003-08-06  Miguel de Icaza  <miguel@ximian.com>
11416
11417         * iterators.cs (Mapvariable): provide a mechanism to use prefixes.
11418
11419         * statement.cs (Foreach): Use VariableStorage instead of
11420         LocalBuilders.   
11421
11422         * codegen.cs (VariableStorage): New class used by clients that
11423         require a variable stored: locals or fields for variables that
11424         need to live across yield.
11425
11426         Maybe provide a convenience api for EmitThis+EmitLoad?
11427
11428         (GetTemporaryLocal, FreeTemporaryLocal): Recycle
11429         these bad boys.
11430
11431 2003-08-05  Miguel de Icaza  <miguel@ximian.com>
11432
11433         * codegen.cs (RemapLocal, RemapLocalLValue, RemapParameter,
11434         RemapParameterLValue): New methods that are used to turn a
11435         precomputed FieldInfo into an expression like this:
11436
11437                 instance.FieldInfo
11438
11439         The idea is to use this instead of making LocalVariableReference
11440         have more than one meaning.
11441
11442         * cs-parser.jay: Add error production to BASE.
11443
11444         * ecore.cs: Deal with TypeManager.GetField returning null, which
11445         is now a valid return value.
11446
11447         (FieldExprNoAddress): New expression for Fields whose address can
11448         not be taken.
11449
11450         * expression.cs (LocalVariableReference): During the resolve
11451         phases, create new expressions if we are in a remapping context.
11452         Remove code that dealt with remapping here.
11453
11454         (ParameterReference): same.
11455
11456         (ProxyInstance): New expression, like the `This' expression, but
11457         it is born fully resolved.  We know what we are doing, so remove
11458         the errors that are targeted to user-provided uses of `this'.
11459
11460         * statement.cs (Foreach): our variable is now stored as an
11461         Expression;  During resolution, follow the protocol, dont just
11462         assume it will return this.
11463
11464 2003-08-06  Martin Baulig  <martin@ximian.com>
11465
11466         * support.cs (SeekableStreamReader.cs): New public class.
11467
11468         * cs-tokenizer.cs, cs-parser.jay, driver.cs: Use the new
11469         SeekableStreamReader instead of the normal StreamReader.
11470
11471 2003-08-04  Martin Baulig  <martin@ximian.com>
11472
11473         * cs-parser.jay (CLOSE_PARENS_CAST, CLOSE_PARENS_NO_CAST,
11474         CLOSE_PARENS_OPEN_PARENS, CLOSE_PARENS_MINUS): New tokens to
11475         deambiguate casts and delegate invocations.
11476         (parenthesized_expression): Use the new tokens to ensure this is
11477         not a cast of method invocation.
11478
11479         * cs-tokenizer.cs (is_punct): Return one of the new special tokens
11480         when reading a `)' and Deambiguate_CloseParens () was previously
11481         called.
11482
11483         * expression.cs (ParenthesizedExpression): New class.  This is
11484         just used for the CS0075 test.
11485         (Binary.DoResolve): Check for CS0075.   
11486
11487 2003-07-29  Ravi Pratap  <ravi@ximian.com>
11488
11489         * expression.cs (Invocation.MakeUnionSet): Patch from Lluis
11490         Sanchez : use TypeManager.ArrayContainsMethod instead of a direct
11491         reference comparison.
11492
11493         (TypeManager.ArrayContainsMethod): When we have a MethodInfo, also
11494         examine the ReturnType for equality - this is necessary in the
11495         cases of implicit and explicit operators whose signature also
11496         includes the return type.
11497
11498 2003-07-26  Miguel de Icaza  <miguel@ximian.com>
11499
11500         * namespace.cs: Cache the result of the namespace computation,
11501         instead of computing it every time.
11502
11503 2003-07-24  Miguel de Icaza  <miguel@ximian.com>
11504
11505         * decl.cs: Use a global arraylist that we reuse over invocations
11506         to avoid excesive memory consumption.  Reduces memory usage on an
11507         mcs compile by one meg (45 average).
11508
11509         * typemanager.cs (LookupTypeReflection): In .NET pointers are
11510         private, work around that.
11511
11512 2003-07-23  Miguel de Icaza  <miguel@ximian.com>
11513
11514         * literal.cs (IntLiteral): Define Zero and One static literals. 
11515
11516         * cs-parser.jay (integer_literal): use static literals to reduce
11517         memory usage for the most used literals (0, 1 and -1).  211kb
11518         reduced in memory usage.
11519
11520         Replace all calls to `new ArrayList' with `new
11521         ArrayList(4)' which is a good average number for most allocations,
11522         and also requires only 16 bytes of memory for its buffer by
11523         default. 
11524
11525         This reduced MCS memory usage in seven megabytes for the RSS after
11526         bootstrapping.
11527
11528 2003-07-28  Ravi Pratap  <ravi@ximian.com>
11529
11530         * expression.cs (Invocation.OverloadResolve): Fix the algorithm to
11531         handle params methods the correct way by forming only one
11532         applicable set with params and normal methods in them. Earlier we
11533         were looking at params methods only if we found no normal methods
11534         which was not the correct thing to do.
11535
11536         (Invocation.BetterFunction): Take separate arguments indicating
11537         when candidate and the best method are params methods in their
11538         expanded form.
11539
11540         This fixes bugs #43367 and #46199.
11541
11542         * attribute.cs: Documentation updates.
11543
11544         (CheckAttribute): Rename to CheckAttributeTarget.
11545         (GetValidPlaces): Rename to GetValidTargets.
11546
11547         * expression.cs (Invocation.IsParamsMethodApplicable): Fix trivial
11548         bug - use Convert.ImplicitConversion, not ImplicitUserConversion!
11549
11550         Fixes bug #44468.
11551
11552 2003-07-28  Martin Baulig  <martin@ximian.com>
11553
11554         * class.cs (TypeContainer.DefineMembers): Use the base type's full
11555         name when looking up the base class of a nested class.  Fixes #46977.
11556
11557 2003-07-26  Martin Baulig  <martin@ximian.com>
11558
11559         * expression.cs (Indexers.Indexer): New nested struct; contains
11560         getter, setter and the indexer's type.
11561         (Indexers.Properties): This is now an ArrayList of
11562         Indexers.Indexer's.
11563         (IndexerAccess.DoResolveLValue): Correctly set the type if the
11564         indexer doesn't have any getters.
11565
11566         * assign.cs (Assign.DoResolve): Also do the implicit conversions
11567         for embedded property and indexer assignments.
11568
11569 2003-07-26  Martin Baulig  <martin@ximian.com>
11570
11571         * cs-tokenizer.cs (Tokenizer.xtoken): Report a CS1040 if a
11572         preprocessor directive is not the first non-whitespace character
11573         on a line.
11574
11575 2003-07-26  Martin Baulig  <martin@ximian.com>
11576
11577         * namespace.cs (NamespaceEntry.Lookup): New method; rewrote the
11578         namespace parsing, follow the spec more closely.
11579
11580         * rootcontext.cs (RootContext.NamespaceLookup): Use the new
11581         NamespaceEntry.Lookup().
11582
11583 2003-07-25  Martin Baulig  <martin@ximian.com>
11584
11585         * MethodCore.cs (OverridesSomething): New public field; it's set
11586         from TypeContainer.DefineMembers if this method overrides
11587         something (which doesn't need to be a method).  Fix #39462.
11588
11589 2003-07-25  Ravi Pratap  <ravi@ximian.com>
11590
11591         * typemanager.cs (GetMembers): Ensure that the list of members is
11592         reversed. This keeps things in sync.
11593
11594         * attribute.cs (Attribute.CheckAttribute): Break as soon as we
11595         find an AttributeUsage attribute.
11596
11597         * expression.cs (Invocation.OverloadResolve): Perform the check
11598         which disallows Invoke to be directly called on a Delegate.
11599
11600         (Error_InvokeOnDelegate): Report error cs1533.
11601
11602 2003-07-25  Martin Baulig  <martin@ximian.com>
11603
11604         * expression.cs (Indexers.GetIndexersForType): Only look in the
11605         interface hierarchy if the requested type is already an
11606         interface.  Fixes #46788 while keeping #46502 fixed.
11607
11608 2003-07-25  Martin Baulig  <martin@ximian.com>
11609
11610         * class.cs (TypeContainer.DefineMembers): Check whether all
11611         readonly fields have been assigned and report warning CS0649 if
11612         not.
11613
11614         * statement.cs (LocalInfo.IsFixed): Always return true if this is
11615         a valuetype.
11616
11617 2003-07-24  Ravi Pratap  <ravi@ximian.com>
11618
11619         * decl.cs (MemberCache.AddMethods): Reverse the order of the array
11620         returned from GetMethods to make things consistent with the
11621         assumptions MCS makes about ordering of methods.
11622
11623         This should comprehensively fix bug #45127 and it does :-)
11624
11625         * ecore.cs (MethodGroupExpr.DeclaringType): Correct bug - the
11626         ordering is actually reverse.
11627
11628         * Clean up some debug messages I left lying around.
11629
11630         * interface.cs (Populate*): Get rid of code which emits attributes
11631         since the stage in which we emit attributes is the 'Emit' stage,
11632         not the define stage.
11633
11634         (Emit): Move attribute emission for interface members here.
11635
11636 2003-07-22  Ravi Pratap  <ravi@ximian.com>
11637
11638         * expression.cs (Invocation.OverloadResolve): Follow the spec more
11639         closely: we eliminate methods in base types when we have an
11640         applicable method in a top-level type.
11641
11642         Please see section 14.5.5.1 for an exact description of what goes
11643         on. 
11644
11645         This fixes bug #45127 and a host of other related to corlib compilation.
11646
11647         * ecore.cs (MethodGroupExpr.DeclaringType): The element in the
11648         array is the method corresponding to the top-level type (this is
11649         because of the changes made to icall.c) so we change this
11650         accordingly.
11651
11652         (MethodGroupExpr.Name): This too.
11653
11654         * typemanager.cs (GetElementType): New method which does the right
11655         thing when compiling corlib. 
11656
11657         * everywhere: Make use of the above in the relevant places.
11658
11659 2003-07-22  Martin Baulig  <martin@ximian.com>
11660
11661         * cs-parser.jay (invocation_expression): Moved
11662         `OPEN_PARENS expression CLOSE_PARENS unary_expression' here from
11663         `cast_expression', but create a InvocationOrCast which later
11664         resolves to either an Invocation or a Cast.
11665
11666         * ecore.cs (ExpressionStatement.ResolveStatement): New virtual
11667         method; call this before EmitStatement() to make sure that this
11668         expression can be used as a statement.
11669
11670         * expression.cs (InvocationOrCast): New class; resolves to either
11671         an Invocation or a Cast.
11672
11673         * statement.cs (StatementExpression): Call ResolveStatement() on
11674         the ExpressionStatement before emitting it.
11675
11676 2003-07-21  Martin Baulig  <martin@ximian.com>
11677
11678         * expression.cs (Invocation.VerifyArgumentsCompat): Check whether
11679         `ref' and `out' attributes match; fixes #46220.
11680         (MemberAccess.ResolveMemberAccess): You can't reference a type
11681         through an expression; fixes #33180.
11682         (Indexers.GetIndexersForType): Don't return the indexers from
11683         interfaces the class implements; fixes #46502.
11684
11685 2003-07-21  Martin Baulig  <martin@ximian.com>
11686
11687         * class.cs (TypeContainer.CheckPairedOperators): Added CS0660 and
11688         CS0661 checks; fixes bug #30442.
11689
11690 2003-07-21  Martin Baulig  <martin@ximian.com>
11691
11692         * decl.cs (AdditionResult): Added `Error'.
11693
11694         * enum.cs (AddEnumMember): Report a CS0076 if name is `value__'.
11695
11696         * typemanager.cs (TypeManager.ChangeType): Catch exceptions;
11697         makes cs0031.cs actually work.
11698
11699 2003-07-20  Martin Baulig  <martin@ximian.com>
11700
11701         * namespace.cs: Fixed that bug which caused a crash when compiling
11702         the debugger's GUI.
11703
11704 2003-07-20  Miguel de Icaza  <miguel@ximian.com>
11705
11706         * typemanager.cs (LookupTypeReflection): Never expose types which
11707         are NotPublic, NestedPrivate, NestedAssembly, or
11708         NestedFamANDAssem.  We used to return these, and later do a check
11709         that would report a meaningful error, but the problem is that we
11710         would not get the real match, if there was a name override.
11711
11712 2003-07-18  Miguel de Icaza  <miguel@ximian.com>
11713
11714         * namespace.cs (Namespace, Name): Do not compute the namespace
11715         name dynamically, compute it in the constructor.  This reduced
11716         memory usage by 1697 KB.
11717
11718         * driver.cs: Use --pause to pause at the end.
11719
11720 2003-07-17  Peter Williams  <peter@newton.cx>
11721
11722         * Makefile: Change the name of the test target so that it doesn't
11723         conflict with the recursive test target.
11724
11725 2003-07-17  Miguel de Icaza  <miguel@ximian.com>
11726
11727         * expression.cs (LocalVariableReference.Emit, EmitAssign,
11728         AddressOf): Do not use EmitThis, that was wrong, use the actual
11729         this pointer.
11730
11731 2003-07-15  Miguel de Icaza  <miguel@ximian.com>
11732
11733         * class.cs (MethodData.Define): While checking if a method is an
11734         interface implementation, improve the test: If we are not public
11735         (use new test here: use the computed MethodAttributes directly,
11736         instead of the parsed modifier flags) check if the `implementing'
11737         method comes from an interface or not.
11738
11739         * pending.cs (VerifyPendingMethods): Slightly better error
11740         message.
11741
11742         * makefile: add test target that does the mcs bootstrap.
11743
11744 2003-07-16  Ravi Pratap  <ravi@ximian.com>
11745
11746         * interface.cs (Define): Do nothing here since there are no
11747         members to populate etc. Move the attribute emission out of here
11748         since this was just totally the wrong place to put it. Attribute
11749         application happens during the 'Emit' phase, not in the 'Define'
11750         phase.
11751
11752         (Emit): Add this method and move the attribute emission here
11753
11754         * rootcontext.cs (EmitCode): Call the Emit method on interface
11755         types too.
11756
11757 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11758
11759         * expression.cs (OverloadResolve): Report error only if Location
11760         is not 'Null' which means that there was a probe going on.
11761
11762 2003-07-14  Martin Baulig  <martin@ximian.com>
11763
11764         * expression.cs (ConditionalLogicalOperator): New public class to
11765         implement user defined conditional logical operators.
11766         This is section 14.11.2 in the spec and bug #40505.
11767
11768 2003-07-14  Martin Baulig  <martin@ximian.com>
11769
11770         * ecore.cs (FieldExpr.DoResolveLValue): Fixed bug #46198.
11771
11772 2003-07-14  Martin Baulig  <martin@ximian.com>
11773
11774         * codegen.cs (EmitContext.InFixedInitializer): New public field.
11775
11776         * ecore.cs (IVariable.VerifyFixed): New interface method.
11777
11778         * expression.cs (Unary.ResolveOperator): When resolving the `&'
11779         operator, check whether the variable is actually fixed.  Fixes bug
11780         #36055.  Set a variable definitely assigned when taking its
11781         address as required by the spec.
11782
11783         * statement.cs (LocalInfo.IsFixed): New field.
11784         (LocalInfo.MakePinned): Set `IsFixed' to true.
11785
11786 2003-07-14  Ravi Pratap M  <ravi@ximian.com>
11787
11788         * attribute.cs (Attribute.Resolve): While doing a Member lookup
11789         for .ctors, ensure that we only ask for members declared in the
11790         attribute type (BindingFlags.DeclaredOnly).
11791
11792         Fixes bug #43632.
11793
11794         * expression.cs (Error_WrongNumArguments): Report error 1501
11795         correctly the way CSC does.
11796
11797 2003-07-13  Martin Baulig  <martin@ximian.com>
11798
11799         * expression.cs (MemberAccess.ResolveAsTypeStep): Try to do a type
11800         lookup on the fully qualified name, to make things like "X.X" work
11801         where "X.X" is a fully qualified type name, but we also have a
11802         namespace "X" in the using list.  Fixes #41975.
11803
11804 2003-07-13  Martin Baulig  <martin@ximian.com>
11805
11806         * assign.cs (Assign.GetEmbeddedAssign): New protected virtual
11807         function. If we're a CompoundAssign, we need to create an embedded
11808         CompoundAssign, not an embedded Assign.
11809         (Assign.DoResolve): Make this work for embedded CompoundAssign's.
11810         Fixes #45854.
11811
11812 2003-07-13  Martin Baulig  <martin@ximian.com>
11813
11814         * typemanager.cs (TypeManager.IsNestedChildOf): Make this actually
11815         work to fix bug #46088.
11816
11817 2003-07-13  Ravi Pratap <ravi@ximian.com>
11818
11819         * class.cs (Operator.Emit): Do not emit attributes here - it is
11820         taken care of by the Method class that we delegate too. This takes
11821         care of bug #45876.
11822
11823 2003-07-10  Martin Baulig  <martin@ximian.com>
11824
11825         * expression.cs (TypeOfVoid): New class.
11826         (TypeOf): Report a CS0673 if it's System.Void.  Fixes #42264.
11827
11828 2003-07-10  Martin Baulig  <martin@ximian.com>
11829
11830         * class.cs (MethodCore.DoDefineParameters): Added CS0225 check;
11831         bug #35957.
11832
11833 2003-07-10  Martin Baulig  <martin@ximian.com>
11834
11835         * rootcontext.cs (RootContext.NamespaceLookup): Take a DeclSpace,
11836         not a NamespaceEntry, so we can use DeclSpace.CheckAccessLevel().
11837
11838         * decl.cs (DeclSpace.FindType): Use DeclSpace.CheckAccessLevel().
11839
11840         * typemanager.cs (TypeManager.IsAccessibleFrom): Removed.
11841
11842 2003-07-10  Martin Baulig  <martin@ximian.com>
11843
11844         * expression.cs (ArrayCreation): Don't use a byte blob for arrays
11845         of decimal.  Fixes #42850.
11846
11847         NOTE: I also fixed the created byte blob, but this doesn't work on
11848         the MS runtime and csc never produces any byte blobs for decimal
11849         arrays.
11850
11851 2003-07-10  Martin Baulig  <martin@ximian.com>
11852
11853         * statement.cs (StructInfo.GetStructInfo): Catch deep cycles in
11854         structs; fixes #32068.
11855         (Block.AddChildVariableNames): Fixed #44302.
11856
11857 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11858
11859         * namespace.cs: fixed compilation with csc. It's bugzilla #44302.
11860
11861 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11862
11863         * attribute.cs: And this test is onger needed.
11864
11865 2003-07-08  Martin Baulig  <martin@ximian.com>
11866
11867         * rootcontext.cs (RootContext.NamespaceLookup): Ignore
11868         inaccessible types.  Fixes #36313.
11869
11870         * decl.cs (DeclSpace.FindType): Ignore inaccessible types.
11871
11872         * namespace.cs (NamespaceEntry): Create implicit entries for all
11873         namespaces; ie. if we have `namespace N1.N2.N3 { ... }', we create
11874         implicit entries for N1.N2 and N1.
11875
11876 2003-07-08  Martin Baulig  <martin@ximian.com>
11877
11878         Rewrote the handling of namespaces to fix a lot of the issues
11879         wrt. `using' aliases etc.
11880
11881         * namespace.cs (Namespace): Splitted this class into a
11882         per-assembly `Namespace' and a per-file `NamespaceEntry'.
11883
11884         * typemanager.cs (TypeManager.IsNamespace): Removed.
11885         (TypeManager.ComputeNamespaces): Only compute namespaces from
11886         loaded assemblies here, not the namespaces from the assembly we're
11887         currently compiling.
11888
11889 2003-07-08  Martin Baulig  <martin@ximian.com>
11890
11891         * rootcontext.cs, class.cs: Fixed the CS1530 reporting.
11892
11893 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11894
11895         * typemanager.cs: Reverted patch from Gonzalo, my previous patch
11896         already fixed it.  
11897
11898         I thought about the memory savings here, but LookupTypeReflection
11899         is used under already very constrained scenarios.  Compiling
11900         corlib or mcs only exposes one hit, so it would not really reduce
11901         any memory consumption.
11902
11903 2003-07-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
11904
11905         * typemanager.cs: fixes bug #45889 by only adding public types from
11906         other assemblies to the list of known types.
11907
11908 2003-07-07  Miguel de Icaza  <miguel@ximian.com>
11909
11910         * attribute.cs (Attribute.Resolve): Add call to CheckAccessLevel
11911         on the type we resolved.
11912
11913 2003-07-05  Martin Baulig  <martin@ximian.com>
11914
11915         * pending.cs (PendingImplementation.ParentImplements): Don't
11916         create the proxy if the parent is abstract.
11917
11918         * class.cs (TypeContainer.DefineIndexers): Process explicit
11919         interface implementations first.  Fixes #37714.
11920
11921 2003-07-04  Miguel de Icaza  <miguel@ximian.com>
11922
11923         * expression.cs (MemberAccess.ResolveMemberAccess): Events are
11924         defined recursively;  but since we modify the input parameters
11925         (left is set to `this' temporarily), we reset this value if the
11926         left_is_explicit is false, which gives the original semantics to
11927         the code.  
11928
11929         * literal.cs (NullPointer): new class used to represent a null
11930         literal in a pointer context.
11931
11932         * convert.cs (Convert.ImplicitReferenceConversion): Is the target
11933         type is a pointer, use a NullPointer object instead of a
11934         NullLiteral.   Closes 43687
11935
11936         (ExplicitConversion): Convert pointer values using
11937         the conv opcode to the proper type.
11938
11939         * ecore.cs (New): change ValueTypeVariable property into a method,
11940         that returns whether the valuetype is suitable for being used.
11941
11942         * expression.cs (Binary.DoNumericPromotions): Only return if we
11943         the int constant was a valid uint, and we can return both left and
11944         right as uints.  If not, we continue processing, to trigger the
11945         type conversion.  This fixes 39018.
11946
11947         * statement.cs (Block.EmitMeta): During constant resolution, set
11948         the CurrentBlock property on the emitcontext, so that we resolve
11949         constants propertly.
11950
11951 2003-07-02  Martin Baulig  <martin@ximian.com>
11952
11953         * codegen.cs (EmitContext.NeedExplicitReturn): New public variable.
11954         (EmitContext.EmitTopBlock): Emit an explicit return if it's set.
11955
11956         * statement.cs (Try.Resolve): Set ec.NeedExplicitReturn rather
11957         than emitting it here.
11958
11959         * statement.cs: Fixed some more flow analysis bugs.
11960
11961 2003-07-02  Martin Baulig  <martin@ximian.com>
11962
11963         * class.cs (MethodData.Define): When implementing interface
11964         methods, set Final unless we're Virtual.
11965
11966         * decl.cs (MemberCore.CheckMethodAgainstBase): Make the CS0506
11967         check work for interface methods.
11968
11969 2003-07-01  Martin Baulig  <martin@ximian.com>
11970
11971         * ecore.cs (EmitContext.This): Replaced this property with a
11972         GetThis() method which takes a Location argument.  This ensures
11973         that we get the correct error location for a CS0188.
11974
11975 2003-07-01  Miguel de Icaza  <miguel@ximian.com>
11976
11977         * ecore.cs: (Convert.ConvertIntLiteral): Add test for
11978         ImplicitStandardConversion.
11979
11980         * class.cs (TypeContainer.GetClassBases): Small bug fix for 45649.
11981
11982 2003-07-01  Zoltan Varga  <vargaz@freemail.hu>
11983
11984         * expression.cs (ResolveOperator): Fix Concat (string, string, string)
11985         optimization.
11986
11987 2003-06-30  Miguel de Icaza  <miguel@ximian.com>
11988
11989         * class.cs (Constructor.Define): Turn off initlocals for unsafe
11990         constructors.
11991
11992         (MethodData.Define): Turn off initlocals for unsafe methods.
11993
11994 2003-06-29  Miguel de Icaza  <miguel@ximian.com>
11995
11996         * decl.cs (DeclSpace.CheckAccessLevel): Make this routine
11997         complete;  Fixes #37521.
11998
11999         * delegate.cs: Use Modifiers.TypeAttr to compute the
12000         TypeAttributes, instead of rolling our own.  This makes the flags
12001         correct for the delegates.
12002
12003 2003-06-28  Miguel de Icaza  <miguel@ximian.com>
12004
12005         * class.cs (Constructor.Define): Set the private flag for static
12006         constructors as well.
12007
12008         * cs-parser.jay (statement_expression): Set the return value to
12009         null, to avoid a crash when we catch an error.
12010
12011 2003-06-24  Miguel de Icaza  <miguel@ximian.com>
12012
12013         * cs-parser.jay: Applied patch from Jackson that adds support for
12014         extern and unsafe modifiers to destructor declarations.
12015
12016         * expression.cs: Report error 21 if the user is trying to index a
12017         System.Array.
12018
12019         * driver.cs: Add an error message, suggested by the bug report.
12020
12021         * class.cs (TypeContainer.Emit): Only call EmitFieldInitializers
12022         if we do not have a ": this ()" constructor initializer.  Fixes 45149
12023
12024 2003-06-14  Miguel de Icaza  <miguel@ximian.com>
12025
12026         * namespace.cs: Add some information to reduce FAQs.
12027
12028 2003-06-13  Miguel de Icaza  <miguel@ximian.com>
12029
12030         * cfold.cs (BinaryFold): BitwiseAnd, BitwiseOr: handle other
12031         underlying enumeration types.  Fixes #43915.
12032
12033         * expression.cs: Treat ushort/short as legal values to be used in
12034         bitwise operations.
12035
12036 Wed Jun 4 13:19:04 CEST 2003 Paolo Molaro <lupus@ximian.com>
12037
12038         * delegate.cs: transfer custom attributes for paramenters from
12039         the delegate declaration to Invoke and BeginInvoke.
12040
12041 Tue Jun 3 11:11:08 CEST 2003 Paolo Molaro <lupus@ximian.com>
12042
12043         * attribute.cs: handle custom marshalers and emit marshal info
12044         for fields, too.
12045
12046 2003-05-28  Hector E. Gomez Morales  <hgomez_36@flashmail.com>
12047
12048         * makefile.gnu: Added anonymous.cs to the compiler sources.
12049
12050 2003-05-28  Miguel de Icaza  <miguel@ximian.com>
12051
12052         * iterators.cs: Change the name of the proxy class to include two
12053         underscores.
12054
12055         * cs-parser.jay: Update grammar to include anonymous methods.
12056
12057         * anonymous.cs: new file.
12058
12059 2003-05-27  Miguel de Icaza  <miguel@ximian.com>
12060
12061         * class.cs (Field.Define): Add missing test for pointers and
12062         safety. 
12063
12064 2003-05-27  Ravi Pratap  <ravi@ximian.com>
12065
12066         * expression.cs (ArrayAccess.GetStoreOpCode): For System.IntPtr,
12067         we use the stobj opcode.
12068
12069         (ArrayCreation.EmitDynamicInitializers): Revert Miguel's patch
12070         since it wasn't the correct fix. 
12071
12072         It still is puzzling that we are required to use stobj for IntPtr
12073         which seems to be a ValueType.
12074
12075 2003-05-26  Miguel de Icaza  <miguel@ximian.com>
12076
12077         * ecore.cs (SimpleName.SimpleNameResolve): Consider using aliases
12078         during regular simple name resolution.   Now, the trick is that
12079         instead of returning for processing the simplename, we do a
12080         TypeManager.LookupType (ie, a rooted lookup as opposed to a
12081         contextual lookup type).   If a match is found, return that, if
12082         not, return for further composition.
12083
12084         This fixes long-standing 30485.
12085
12086         * expression.cs (ArrayCreation.EmitDynamicInitializers): When
12087         using the address to initialize an object, do an Stobj instead of
12088         using the regular Stelem.
12089
12090         (IndexerAccess.Emit, IndexerAccess.EmitAssign):
12091         Pass `is_base_indexer' to Invocation.EmitCall instead of false.
12092         Because if we are a BaseIndexerAccess that value will be true.
12093         Fixes 43643.
12094
12095         * statement.cs (GotoCase.Resolve): Return after reporting an
12096         error, do not attempt to continue. 
12097
12098         * expression.cs (PointerArithmetic.Emit): If our operand is a
12099         long, convert our constants to match the operand before
12100         multiplying.  Convert to I type before adding.   Fixes 43670.
12101
12102 2003-05-14  Ravi Pratap  <ravi@ximian.com>
12103
12104         * enum.cs (ImplicitConversionExists) : Rename to
12105         ImplicitEnumConversionExists to remove ambiguity. 
12106
12107         * ecore.cs (NullCast): New type of cast expression class which
12108         basically is very similar to EmptyCast with the difference being
12109         it still is a constant since it is used only to cast a null to
12110         something else
12111         (eg. (string) null)
12112
12113         * convert.cs (ImplicitReferenceConversion): When casting a null
12114         literal, we return a NullCast.
12115
12116         * literal.cs (NullLiteralTyped): Remove - I don't see why this
12117         should be around anymore.
12118
12119         The renaming (reported was slightly wrong). Corrections:
12120
12121         ConvertImplicitStandard -> ImplicitConversionStandard
12122         ConvertExplicitStandard -> ExplicitConversionStandard
12123
12124         * expression.cs (StaticCallExpr.MakeSimpleCall): Resolve arguments
12125         before passing them in !
12126
12127         * convert.cs (ImplicitConversionStandard): When comparing for
12128         equal expr and target types, ensure that expr is not a
12129         NullLiteral.
12130
12131         In general, we must not be checking (expr_type ==
12132         target_type) in the top level conversion methods
12133         (ImplicitConversion, ExplicitConversion etc). This checking is
12134         done in the methods that they delegate to.
12135
12136 2003-05-20  Miguel de Icaza  <miguel@ximian.com>
12137
12138         * convert.cs: Move Error_CannotConvertType,
12139         ImplicitReferenceConversion, ImplicitReferenceConversionExists,
12140         ImplicitNumericConversion, ImplicitConversionExists,
12141         ImplicitUserConversionExists, StandardConversionExists,
12142         FindMostEncompassedType, FindMostSpecificSource,
12143         FindMostSpecificTarget, ImplicitUserConversion,
12144         ExplicitUserConversion, GetConversionOperators,
12145         UserDefinedConversion, ConvertImplicit, ConvertImplicitStandard,
12146         TryImplicitIntConversion, Error_CannotConvertImplicit,
12147         ConvertImplicitRequired, ConvertNumericExplicit,
12148         ExplicitReferenceConversionExists, ConvertReferenceExplicit,
12149         ConvertExplicit, ConvertExplicitStandard from the ecore.cs into
12150         its own file.
12151
12152         Perform the following renames:
12153
12154         StandardConversionExists -> ImplicitStandardConversionExists
12155         ConvertImplicit -> ImplicitConversion
12156         ConvertImplicitStandard -> ImplicitStandardConversion
12157         TryImplicitIntConversion -> ImplicitIntConversion
12158         ConvertImplicitRequired -> ImplicitConversionRequired
12159         ConvertNumericExplicit -> ExplicitNumericConversion
12160         ConvertReferenceExplicit -> ExplicitReferenceConversion
12161         ConvertExplicit -> ExplicitConversion
12162         ConvertExplicitStandard -> ExplicitStandardConversion
12163
12164 2003-05-19  Martin Baulig  <martin@ximian.com>
12165
12166         * statement.cs (TypeInfo.StructInfo): Made this type protected.
12167         (TypeInfo): Added support for structs having structs as fields.
12168
12169         * ecore.cs (FieldExpr): Implement IVariable.
12170         (FieldExpr.DoResolve): Call VariableInfo.GetSubStruct() to get the
12171         VariableInfo for the field.
12172
12173 2003-05-18  Martin Baulig  <martin@ximian.com>
12174
12175         * expression.cs (This.DoResolve): Report a CS0027 if we're
12176         emitting a field initializer.
12177
12178 2003-05-18  Martin Baulig  <martin@ximian.com>
12179
12180         * expression.cs (This.ResolveBase): New public function.
12181         (This.DoResolve): Check for CS0188.
12182
12183         * codegen.cs (EmitContext.This): Just call This.ResolveBase(), not
12184         This.Resolve().
12185
12186         * ecore.cs (MethodGroupExpr.DoResolve): Set the
12187         `instance_expression' to null if we don't have any non-static
12188         methods.
12189
12190 2003-05-18  Martin Baulig  <martin@ximian.com>
12191
12192         Reworked the way how local variables and parameters are handled by
12193         the flow analysis code.
12194
12195         * statement.cs (TypeInfo, VariableMap): New public classes.
12196         (VariableInfo): New public class.  This is now responsible for
12197         checking whether a variable has been assigned.  It is used for
12198         parameters and local variables.
12199         (Block.EmitMeta): Take the InternalParameters as argument; compute
12200         the layout of the flow vectors here.
12201         (Block.LocalMap, Block.ParameterMap): New public properties.
12202         (FlowBranching): The .ctor doesn't get the InternalParameters
12203         anymore since Block.EmitMeta() now computes the layout of the flow
12204         vector.
12205         (MyStructInfo): This class is now known as `StructInfo' and nested
12206         in `TypeInfo'; we don't access this directly anymore.
12207
12208         * ecore.cs (IVariable): Added `VariableInfo VariableInfo'
12209         property and removed IsAssigned(), IsFieldAssigned(),
12210         SetAssigned() and SetFieldAssigned(); we now call them on the
12211         VariableInfo so we don't need to duplicate this code everywhere.
12212
12213         * expression.cs (ParameterReference): Added `Block block' argument
12214         to the .ctor.
12215         (LocalVariableReference, ParameterReference, This): The new
12216         VariableInfo class is now responsible for all the definite
12217         assignment stuff.
12218
12219         * codegen.cs (EmitContext.IsVariableAssigned, SetVariableAssigned,
12220         IsParameterAssigned, SetParameterAssigned): Removed.
12221
12222 2003-05-18  Martin Baulig  <martin@ximian.com>
12223
12224         * typemanager.cs (InitCoreTypes): Try calling
12225         SetCorlibTypeBuilders() with 4 args; if that fails, fall back to
12226         the 3-args-version.  Corlib now also needs our `void_type'.
12227         (GetMethod): Added overloaded version which takes an optional
12228         `bool report_errors' to allow lookups of optional methods.
12229
12230 2003-05-12  Martin Baulig  <martin@ximian.com>
12231
12232         * statement.cs (VariableInfo): Renamed to LocalInfo since it's
12233         only used for locals and not for parameters.
12234
12235 2003-05-12  Miguel de Icaza  <miguel@ximian.com>
12236
12237         * support.cs (InternalParameters.ParameterType): Return the
12238         ExternalType of the parameter.
12239
12240         * parameter.cs (Parameter.ExternalType): drop the two arguments,
12241         they were unused.
12242
12243 2003-05-11  Miguel de Icaza  <miguel@ximian.com>
12244
12245         * class.cs (MethodData.Define): Do not set the `newslot' on
12246         interface members, if they are also flagged as "override".
12247
12248         * expression.cs (UnaryMutator.EmitCode): Simple workaround to emit
12249         better code for ++i and i++.  This only works for static fields
12250         and local variables.
12251
12252         * typemanager.cs (LookupDeclSpace): Add new method, sometimes we
12253         want to pull the DeclSpace out of the builder_to_declspace instead
12254         of the TypeBuilder (like in TypeContainer.FindMembers).
12255
12256         * class.cs (TypeContainer.FindMembers): Use LookupDeclSpace
12257         instead of LookupTypeContainer.  Fixes the crash on .NET for
12258         looking up interface members.
12259
12260         * const.cs: Create our own emit context during the Definition
12261         stage, so that constants are evaluated in the proper context, when
12262         a recursive definition happens.
12263
12264 2003-05-11  Martin Baulig  <martin@ximian.com>
12265
12266         * statement.cs (Block.CreateSwitchBlock): New method.  Creates a
12267         new block for a switch section.
12268         (Block.AddLabel, Block.LookupLabel): If we're a switch section, do
12269         the adding/lookup in the switch block.  Fixes #39828.
12270
12271 2003-05-09  Miguel de Icaza  <miguel@ximian.com>
12272
12273         * expression.cs (UnaryMutator.LoadOneAndEmitOp): Missing
12274         functionality: I needed to convert the data after I had performed
12275         the add/sub operation into the operands type size.
12276
12277         * ecore.cs (ImplicitReferenceConversion): When boxing an interface
12278         pass the type for the box operation, otherwise the resulting
12279         object would have been of type object.
12280
12281         (BoxedCast): Add constructor to specify the type to box as.
12282
12283 2003-05-07  Miguel de Icaza  <miguel@ximian.com>
12284
12285         * iterators.cs: I was reusing the `count' variable inadvertently,
12286         take steps to not allow this to happen.
12287
12288 2003-05-06  Miguel de Icaza  <miguel@ximian.com>
12289
12290         * attribute.cs (Attribute.Resolve): Params attributes are encoded
12291         by creating an array at the point where the params starts and
12292         putting all those arguments there, then adjusting the size of the
12293         array.
12294
12295 2003-05-05  Miguel de Icaza  <miguel@ximian.com>
12296
12297         * expression.cs (New.AddressOf): Implement interface
12298         IMemoryLocation.  This is used when the `new' operator is used in
12299         the context of an invocation to a method on a value type.
12300
12301         See http://bugzilla.ximian.com/show_bug.cgi?id=#42390 for an
12302         example. 
12303
12304         * namespace.cs: Also check the using aliases here.
12305
12306         * driver.cs: Move the test for using validity after the types have
12307         been entered, so we do a single pass that also includes the using
12308         aliases. 
12309
12310         * statement.cs (Try.Resolve): Avoid crashing if there is a failure
12311         in the regular case.   CreateSiblingForFinally is doing extra
12312         error checking.
12313
12314         * attribute.cs (GetAttributeArgumentExpression): Store the result
12315         on an out value, and use the return value to indicate failure
12316         instead of using null (which is a valid return for Constant.GetValue).
12317
12318         * statement.cs: Perform the analysis flow for the increment
12319         portion after the statement, because this will be the real flow of
12320         execution.  Fixes #42385
12321
12322         * codegen.cs (EmitContext.EmitArgument,
12323         EmitContext.EmitStoreArgument): New helper functions when the
12324         RemapToProxy flag is set.
12325
12326         * expression.cs (ParameterReference.EmitLdarg): Expose this useful
12327         function.
12328
12329         Add support for remapping parameters. 
12330
12331         * iterators.cs: Propagate parameter values;  Store parameter
12332         values in the proxy classes.
12333
12334 2003-05-04  Miguel de Icaza  <miguel@ximian.com>
12335
12336         * ecore.cs (FieldExpr): Fix an obvious bug.  static fields do not
12337         need a proxy reference;  I do not know what I was thinking
12338
12339         * cs-parser.jay (constructor_initializer): catch another error,
12340         and display nice message.
12341
12342         (field_declaration): catch void field declaration
12343         to flag a better error. 
12344
12345         * class.cs (MemberBase.CheckBase): Report an error instead of a
12346         warning if a new protected member is declared in a struct. 
12347         (Field.Define): catch the error of readonly/volatile.
12348
12349         * ecore.cs (FieldExpr.EmitAssign): reuse the field lookup.
12350
12351         (FieldExpr.AddressOf): ditto.  Catch error where the address of a
12352         volatile variable is taken
12353
12354 2003-05-02  Miguel de Icaza  <miguel@ximian.com>
12355
12356         * statement.cs (Fixed.Resolve): Report an error if we are not in
12357         an unsafe context.
12358
12359 2003-05-01  Miguel de Icaza  <miguel@ximian.com>
12360
12361         * typemanager.cs: reuse the code that handles type clashes for
12362         delegates and enumerations.
12363
12364         * class.cs (Report28): Always report.
12365
12366         * expression.cs (EncodeAsAttribute): Allow nulls here.
12367
12368 2003-04-28  Miguel de Icaza  <miguel@ximian.com>
12369
12370         * attribute.cs (Attribute.GetAttributeArgumentExpression): Moved
12371         the functionality for testing whether an expression is valid for
12372         an attribute here.  Also handle the case of arrays of elements
12373         being stored. 
12374
12375         * expression.cs (ArrayCreation.EncodeAsAttribute): Add support for
12376         encoding a linear array into an array of objects that are suitable
12377         to be passed to an CustomAttributeBuilder.
12378
12379         * delegate.cs: Check unsafe types being used outside of an Unsafe context.
12380
12381         * ecore.cs: (FieldExpr): Handle field remapping here.
12382
12383         * iteratators.cs: Pass the instance variable (if the method is an
12384         instance method) to the constructors, so we can access the field
12385         variables on the class.
12386
12387         TODO: Test this with structs.  I think the THIS variable on
12388         structs might have to be a pointer, and not a refenrece
12389
12390 2003-04-27  Miguel de Icaza  <miguel@ximian.com>
12391
12392         * codegen.cs (EmitContext.Mapvariable): Adds a mechanism to map
12393         local variables to fields in a proxy class.
12394
12395         * iterators.cs (PopulateProxy): Rename our internal fields to
12396         <XXX>.  
12397         Create a <THIS> field if we are an instance method, so we can
12398         reference our parent container variables.
12399         (MapVariable): Called back from the EmitContext code to enter a
12400         new variable to field mapping into the proxy class (we just create
12401         a FieldBuilder).
12402
12403         * expression.cs
12404         (LocalVariableReference.{Emit,EmitAssign,AddressOf}): Add support
12405         for using the remapped locals to fields.
12406
12407         I placed the code here, because that gives the same semantics to
12408         local variables, and only changes the Emit code.
12409
12410         * statement.cs (Fixed.Resolve): it is not allowed to have fixed
12411         statements inside iterators.
12412         (VariableInfo): Add a FieldBuilder for the cases when we are
12413         remapping local variables to fields in a proxy class
12414
12415         * ecore.cs (SimpleNameResolve): Avoid testing two times for
12416         current_block != null.
12417
12418         * statement.cs (Swithc.SimpleSwitchEmit): Removed code that did
12419         not cope with strings, as it has been moved to the
12420         TableSwitchEmit.  Fixed bug in switch generation.
12421
12422         * expression.cs (New.DoResolve): Provide more context for the user
12423         when reporting an error.
12424
12425         * ecore.cs (Expression.LoadFromPtr): Use ldind_i when loading
12426         pointers. 
12427
12428         * expression.cs (MemberAccess.DoResolve): When we get a type back,
12429         check the permissions for it.  Note than in a type-resolution
12430         context the check was already present in DeclSpace.ResolveType,
12431         but was missing from the MemberAccess.
12432
12433         (ArrayCreation.CheckIndices): warn if the user has
12434         more nested levels of expressions, but there are no more
12435         dimensions specified.  Avoids crash on bug 41906.
12436
12437 2003-04-26  Miguel de Icaza  <miguel@ximian.com>
12438
12439         * statement.cs (Block): replace Implicit bool, for a generic
12440         flags.   
12441         New flag: `Unchecked'.  This is used during the EmitMeta phase
12442         (which is out-of-line with the regular Resolve/Emit process for a
12443         statement, as this is done ahead of time, but still gets a chance
12444         to call constant resolve).
12445
12446         (Block.Flags): new enum for adding a new flag.
12447
12448         (Block.EmitMeta): track the state of unchecked.
12449
12450         (Unchecked): Set the "UnChecked" flags on any blocks we enclose,
12451         to enable constant resolution to work there as well.
12452
12453 2003-04-22  Miguel de Icaza  <miguel@ximian.com>
12454
12455         * typemanager.cs (ienumerable_type): Also look up
12456         System.Collections.IEnumerable. 
12457
12458 2003-04-21  Miguel de Icaza  <miguel@ximian.com>
12459
12460         TODO: Test more than one conditional per method.
12461
12462         * class.cs (Indexer.Define): Report the location where the user is
12463         referencing the unsupported feature.
12464
12465         (MethodData): Overload the use of `conditionals' to
12466         minimize the creation of needless ArrayLists.   This saves roughly
12467         212kb on my machine.
12468
12469         (Method): Implement the new IIteratorContainer interface.
12470         (Method.SetYields): Implement the method by setting the ModFlags
12471         to contain METHOD_YIELDS.
12472
12473         * expression.cs (Unary.ResolveOperator): Use expr_type, not Expr,
12474         which just got set to null.
12475
12476         * iterators.cs: New file.
12477
12478         (Yield, YieldBreak): New statements.
12479
12480         * statement.cs (Return.Resolve): Flag an error if we are used in
12481         an iterator method.
12482
12483         * codegen.cs (InIterator): New flag set if the code is being
12484         compiled in an iterator method.
12485
12486         * modifiers.cs: New flag METHOD_YIELDS.  This modifier is an
12487         internal modifier, and we just use it to avoid adding extra
12488         fields, as this is seldom used.  
12489
12490         * cs-parser.jay: Add yield_statement (yield and yield break).
12491
12492         * driver.cs: New flag -v2 to turn on version 2 features. 
12493
12494         * cs-tokenizer.cs (Tokenizer): Add yield and __yield to the
12495         hashtable when v2 is enabled.
12496
12497 2003-04-20  Miguel de Icaza  <miguel@ximian.com>
12498
12499         * typemanager.cs (TypeManager.NamespaceClash): Use to check if
12500         there is already a namespace defined with this name.
12501
12502         (TypeManager.InitCoreTypes): Remove the temporary workaround, as
12503         people upgraded their corlibs.
12504
12505         (TypeManager.CoreLookupType): Use LookupTypeDirect, as we
12506         always use fully qualified types, no need to use the compiler
12507         front end.
12508
12509         (TypeManager.IsNamespace): Use binarysearch.
12510
12511         * class.cs (AddClass, AddStruct, AddInterface, AddEvent,
12512         AddDelegate): I did not quite use the new IsValid API properly: I
12513         have to pass the short-name and the fullname.  I was passing only
12514         the basename instead of the fullname sometimes. 
12515
12516         (TypeContainer.DefineType): call NamespaceClash.
12517
12518         * interface.cs (Interface.DefineType): use NamespaceClash before
12519         defining the type.
12520
12521         * delegate.cs (Delegate.DefineType): use NamespaceClash before
12522         defining the type.
12523
12524         * enum.cs: (Enum.DefineType): use NamespaceClash before
12525         defining the type.
12526
12527         * typemanager.cs (: 3-line patch that gives us some tasty 11%
12528         speed increase.  First, use the negative_hits cache when we get a
12529         negative.  Second, add the type with its full original name
12530         instead of the new . and + encoded name (reflection uses + to
12531         separate type from a nested type).  Use LookupTypeReflection
12532         directly which bypasses the type->name hashtable (that we already
12533         know does not contain the type.
12534
12535         * decl.cs (DeclSpace.ResolveTypeExpr): track the
12536         location/container type. 
12537
12538         * driver.cs: When passing utf8, use directly the UTF8Encoding.
12539
12540 2003-04-19  Miguel de Icaza  <miguel@ximian.com>
12541
12542         * decl.cs (ResolveTypeExpr): Mirror check acess here too.
12543
12544         * delegate.cs (NewDelegate.Resolve): Test whether an instance
12545         method is being referenced in the method group from a static
12546         context, and report error 120 if so.
12547
12548         * expression.cs, ecore.cs (Error_UnexpectedKind): New name for
12549         Error118. 
12550
12551         * typemanager.cs: Add intermediate namespaces (if a namespace A.B
12552         is created, we create the A namespace).
12553
12554         * cs-parser.jay: A namespace also introduces a DeclarationFound.
12555         Fixes #41591
12556
12557 2003-04-18  Miguel de Icaza  <miguel@ximian.com>
12558
12559         * typemanager.cs (GetReferenceType, GetPointerType): In .NET each
12560         invocation to ModuleBuilder.GetType with the same values will
12561         return a new type instance, so we need to cache its return
12562         values. 
12563
12564         * expression.cs (Binary.ResolveOperator): Only allow the compare
12565         operators on enums if they are of the same type.
12566
12567         * ecore.cs (Expression.ImplicitReferenceConversion): handle target
12568         types of ValueType on their own case.  Before we were giving them
12569         the same treatment as objects.
12570
12571         * decl.cs (DeclSpace.IsValid): IsValid takes the short name and
12572         fullname.  Short name is used to compare against container name.
12573         Fullname is used to check against defined namespace names.
12574
12575         * class.cs (AddProperty, AddField, AddClass, AddStruct, AddEnum,
12576         AddDelegate, AddEvent): Pass new parameter to DeclSpace.IsValid
12577
12578         (Method.CheckBase): Call parent.
12579         (MemberBase.CheckBase): Check for protected members on sealed
12580         classes.
12581         (PropertyBase.CheckBase): Call parent.
12582         (Field.Define): Call parent.
12583
12584         * report.cs: Negative error codes are now mapped to 8000 - code,
12585         so that the display is render more nicely.
12586
12587         * typemanager.cs: Do not use try/catch, instead report a regular
12588         error. 
12589
12590         (GetPointerType, GetReferenceType): These methods provide
12591         mechanisms to obtain the T* and T& from a T.  We had the code
12592         previously scattered around the code base, and it also used
12593         TypeManager.LookupType that would go through plenty of caches.
12594         This one goes directly to the type source.
12595
12596         In some places we did the Type.GetType followed by
12597         ModuleBuilder.GetType, but not in others, so this unifies the
12598         processing as well.
12599
12600         * namespace.cs (VerifyUsing): Perform a non-lazy approach to using
12601         statements now that we have namespace information.
12602
12603         * typemanager.cs (IsNamespace): New method, returns whether the
12604         string presented is a namespace or not.
12605
12606         (ComputeNamespaces): New public entry point, computes the list of
12607         available namespaces, using the GetNamespaces API call in Mono, or
12608         the slower version in MS.NET.   
12609
12610         Now before we start the semantic analysis phase, we have a
12611         complete list of namespaces including everything that the user has
12612         provided.
12613
12614         Deleted old code to cache namespaces in .nsc files.
12615
12616 2003-04-17  Miguel de Icaza  <miguel@ximian.com>
12617
12618         * class.cs: (TypeContainer.DefineDefaultConstructor): Use the
12619         class/struct location definition Location for the implicit
12620         constructor location.
12621
12622         (Operator.Define): Use the location of the operator for the
12623         implicit Method definition.
12624
12625         (Constructor.Emit): use the constructor location for the implicit
12626         base initializer constructor.
12627
12628         * ecore.cs: Remove ITypeExpression.  This interface is now gone,
12629         and the Expression class now contains two new methods:
12630
12631         ResolveAsTypeStep and ResolveAsTypeTerminal.  This is used to
12632         isolate type lookup from the rest of the resolution process.
12633
12634         Since we use Expressions to hold type definitions due to the way
12635         we parse the input we have historically overloaded Resolve to
12636         perform the Type lookups if a special flag is passed.  Now this is
12637         eliminated and two methods take their place. 
12638
12639         The differences in the two methods between xStep and xTerminal is
12640         that xStep is involved in our current lookup system that uses
12641         SimpleNames to compose a name, while xTerminal is used just to
12642         catch the case where the simplename lookup failed.
12643
12644 2003-04-16  Miguel de Icaza  <miguel@ximian.com>
12645
12646         * expression.cs (ResolveMemberAccess): Remove redundant code.
12647         TypeExpr expressions are always born fully resolved.
12648
12649         * interface.cs (PopulateMethod): Do not lookup the types twice.
12650         We were doing it once during SemanticAnalysis and once during
12651         PopulateMethod.
12652
12653         * cs-parser.jay: Due to our hack in the grammar, things like A.B[]
12654         in local variable type definitions, were being returned as a
12655         SimpleName (we decomposed everything into a string), that is
12656         because primary_expression was being used instead of a type in the
12657         grammar (reduce/reduce conflicts).
12658
12659         The part that was wrong is that we converted the expression into a
12660         string (an oversimplification in one hand, compounded with primary
12661         expressions doing string concatenation).
12662
12663         So things like:
12664
12665         A.B.C [] x;
12666
12667         Would return "A.B.C[]" as a SimpleName.  This stopped things like
12668         using clauses from working on this particular context.  And a type
12669         was being matched directly against "A.B.C[]".
12670
12671         We now use the correct approach, and allow for ComposedCast to be
12672         part of the unary expression.  So the "A.B.C []" become a composed
12673         cast of "A.B.C" (as a nested group of MemberAccess with a
12674         SimpleName at the end) plus the rank composition "[]". 
12675
12676         Also fixes 35567
12677
12678 2003-04-10  Miguel de Icaza  <miguel@ximian.com>
12679
12680         * decl.cs (CheckAccessLevel): Implement the NestedPrivate rules
12681         for the access level checking.
12682
12683         * class.cs: Cosmetic changes.  Renamed `TypeContainer parent' to
12684         `TypeContainer container', because I kept getting confused when I
12685         was debugging this code.
12686
12687         * expression.cs (Indexers): Instead of tracking getters/setters,
12688         we now track them in parallel.  We create one arraylist less, but
12689         most importantly it is possible now for the LValue code to find a
12690         matching get for a set.
12691
12692         (IndexerAccess.DoResolveLValue): Update the code.
12693         GetIndexersForType has been modified already to extract all the
12694         indexers from a type.  The code assumed it did not.
12695
12696         Also make the code set the correct return type for the indexer.
12697         This was fixed a long time ago for properties, but was missing for
12698         indexers.  It used to be void_type.
12699
12700         (Binary.Emit): Test first for doubles instead of
12701         floats, as they are more common.
12702
12703         (Binary.EmitBranchable): Use the .un version of the branch opcodes
12704         when dealing with floats and the <=, >= operators.  This fixes bug
12705         #39314 
12706
12707         * statement.cs (Foreach.EmitArrayForeach): bug fix: The code used
12708         to load the array value by emitting a load on the foreach variable
12709         type.  This was incorrect.  
12710
12711         We now emit the code to load an element using the the array
12712         variable type, and then we emit the conversion operator.
12713
12714         Fixed #40176
12715
12716 2003-04-10  Zoltan Varga  <vargaz@freemail.hu>
12717
12718         * attribute.cs: Avoid allocation of ArrayLists in the common case.
12719
12720 2003-04-09  Miguel de Icaza  <miguel@ximian.com>
12721
12722         * class.cs (MethodSignature.InheritableMemberSignatureCompare):
12723         test for protection before we test for signatures. 
12724
12725         (MethodSignature.ToString): implement.
12726
12727         * expression.cs (Unary.TryReduceNegative): Add missing minus sign
12728         to the case where we reduced into a LongConstant.
12729
12730         * decl.cs (CheckAccessLevel): If the type is an array, we can not
12731         depend on whether the information is acurrate, because the
12732         Microsoft runtime will always claim that the array type is public,
12733         regardless of the real state.
12734
12735         If the type is a pointer, another problem happens: the type is
12736         reported as non-public in Microsoft.  
12737
12738         In both cases we have to call CheckAccessLevel recursively with
12739         the underlying type as the argument to be tested.
12740
12741 2003-04-08  Miguel de Icaza  <miguel@ximian.com>
12742
12743         * assign.cs (Assign.Emit): If we are dealing with a compound
12744         assignment expression, we should use the code path that stores the
12745         intermediate result in a temporary value.  This fixes #40903.
12746
12747         *expression.cs (Indirection.ToString): Provide ToString method for
12748         debugging. 
12749
12750 2003-04-08  Zoltan Varga  <vargaz@freemail.hu>
12751
12752         * class.cs: Null out fields holding references to Block objects so
12753         they can be garbage collected.
12754
12755         * expression.cs (OverloadResolve): Remove unused local.
12756
12757 2003-04-07  Martin Baulig  <martin@ximian.com>
12758
12759         * codegen.cs (EmitContext.CurrentFile): New public field.
12760         (EmitContext.Mark): Use the CurrentFile to check whether the
12761         location is in the correct file.
12762         (EmitContext.EmitTopBlock): Initialize CurrentFile here.
12763
12764 2003-04-07  Martin Baulig  <martin@ximian.com>
12765
12766         * ecore.cs (Expression.ResolveBoolean): Don't call ec.Mark().
12767
12768         * codegen.cs (EmitContext.EmitTopBlock): Don't call Mark() on the
12769         location.  [FIXME: The location argument which gets passed to this
12770         method is sometimes wrong!]
12771
12772 2003-04-07  Nick Drochak <ndrochak@gol.com>
12773
12774         * codegen.cs: Be more verbose when we can't find the symbol writer dll.
12775
12776 2003-04-07  Miguel de Icaza  <miguel@ximian.com>
12777
12778         * expression.cs (Indirection.EmitAssign): We were using the
12779         temporary, but returning immediately instead of continuing the
12780         EmitAssing flow.
12781
12782 2003-04-06  Martin Baulig  <martin@ximian.com>
12783
12784         * ecore.cs (SimpleName.SimpleNameResolve): Don't report an error
12785         if it's a nested child, but also deriving from the outer class.
12786         See test 190.cs.
12787
12788         * typemanager.cs (IsNestedChildOf): Make this work if it's a
12789         nested child, but also deriving from the outer class.  See
12790         test-190.cs.
12791         (FilterWithClosure): We may access private members of the outer
12792         class if we're a nested child and deriving from the outer class.
12793         (RealMemberLookup): Only set `closure_private_ok' if the
12794         `original_bf' contained BindingFlags.NonPublic.
12795
12796 2003-04-05  Martin Baulig  <martin@ximian.com>
12797
12798         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #40670.
12799
12800 2003-04-02  Miguel de Icaza  <miguel@ximian.com>
12801
12802         * class.cs (Event.Define): Do not allow abstract events to have
12803         initializers. 
12804
12805 2003-04-01  Miguel de Icaza  <miguel@ximian.com>
12806
12807         * cs-parser.jay: Add error productions for ADD/REMOVE missing a
12808         block in event declarations.
12809
12810         * ecore.cs (FieldExpr.AddressOf): If our instance expression is a
12811         value type, get its address.
12812
12813         * expression.cs (Is.Emit): For action `LeaveOnStack' we were
12814         leaving a class on the stack instead of a boolean value (int
12815         0/1).  Change the code so we compare against null, and then the
12816         result against zero.
12817
12818         * class.cs (TypeContainer.GetClassBases): We were checking for the
12819         parent class being sealed too late.
12820
12821         * expression.cs (Binary.Emit): For <= and >= when dealing with
12822         floating point values, use cgt.un and clt.un instead of cgt and
12823         clt alone.
12824
12825 2003-04-01  Zoltan Varga  <vargaz@freemail.hu>
12826
12827         * statement.cs: Apply the same optimization as MS: skip the 
12828         GetEnumerator returning an IEnumerator, and use the one returning a 
12829         CharEnumerator instead. This allows us to avoid the try-finally block 
12830         and the boxing.
12831
12832 2003-03-31  Gaurav Vaish <gvaish_mono@lycos.com>
12833
12834         * cs-parser.jay: Attributes cannot be applied to
12835                          namespaces. Fixes #40473
12836
12837 2003-03-31  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12838
12839         * class.cs:
12840         (Add*): check if the name is valid using the full name for constants,
12841         fields, properties and events.
12842
12843 2003-03-28  Miguel de Icaza  <miguel@ximian.com>
12844
12845         * enum.cs (Enum.DefineType, Enum.IsValidEnumConstant): Also allow
12846         char constants to be part of the enumeration.
12847
12848         * expression.cs (Conditional.DoResolve): Add support for operator
12849         true. Implements the missing functionality from 14.12
12850
12851         * class.cs (TypeContainer.CheckPairedOperators): Report error for missmatch on
12852         operator true/false as required by the spec.
12853
12854         * expression.cs (Unary.ResolveOperator): In LogicalNot, do an
12855         implicit conversion to boolean.
12856
12857         * statement.cs (Statement.ResolveBoolean): A boolean expression is
12858         also one where the type implements `operator true'. 
12859
12860         * ecore.cs (Expression.GetOperatorTrue): New helper routine to
12861         get an expression that will invoke operator true based on an
12862         expression.  
12863
12864         (GetConversionOperators): Removed the hack that called op_True
12865         here.  
12866
12867         (Expression.ResolveBoolean): Move this from Statement.
12868
12869 2003-03-17  Miguel de Icaza  <miguel@ximian.com>
12870
12871         * ecore.cs (FieldExpr): do not allow initialization of initonly
12872         fields on derived classes
12873
12874 2003-03-13  Martin Baulig  <martin@ximian.com>
12875
12876         * statement.cs (Block.Emit): Call ig.BeginScope() and
12877         ig.EndScope() when compiling with debugging info; call
12878         LocalBuilder.SetLocalSymInfo _after_ opening the scope.
12879
12880 2003-03-08  Miguel de Icaza  <miguel@ximian.com>
12881
12882         * expression.cs (Indexers): Do not construct immediately, allow
12883         for new members to be appended as we go.  Fixes 38143
12884
12885 2003-03-07  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12886
12887         * expression.cs: save/restore context when resolving an unchecked
12888         expression.
12889
12890 2003-03-05  Miguel de Icaza  <miguel@ximian.com>
12891
12892         * cfold.cs: Catch division by zero in modulus operator during
12893         constant folding.
12894
12895 2003-03-03  Miguel de Icaza  <miguel@ximian.com>
12896
12897         * interface.cs (Interface.DefineMembers): Avoid defining members
12898         twice. 
12899
12900 2003-02-27  Miguel de Icaza  <miguel@ximian.com>
12901
12902         * driver.cs: handle the +/- options for -noconfig
12903
12904         * statement.cs (Unckeched.Resolve): Also track the state of
12905         unchecked in the Resolve phase.
12906
12907 2003-02-27  Martin Baulig  <martin@ximian.com>
12908
12909         * ecore.cs (Expression.MemberLookup): Don't create a
12910         MethodGroupExpr for something which is not a method.  Fixes #38291.
12911
12912 2003-02-25  Miguel de Icaza  <miguel@ximian.com>
12913
12914         * class.cs (MemberBase.CheckParameters): Also check that the type
12915         is unmanaged if it is a pointer.
12916
12917         * expression.cs (SizeOf.Resolve): Add location information.
12918
12919         * statement.cs (Block.EmitMeta): Flag error (208) if a pointer to
12920         a managed type is declared.
12921
12922         * expression.cs (Invocation.VerifyArgumentsCompat): Check for the
12923         parameter modifiers as well.  Fixes bug 38606
12924
12925         * class.cs: Very sad.  Am backing out the speed up changes
12926         introduced by the ArrayList -> Array in the TypeContainer, as they
12927         were not actually that much faster, and introduced a bug (no error
12928         reports on duplicated methods).
12929
12930         * assign.cs (CompoundAssign.DoLResolve): Resolve the original
12931         source first, this will guarantee that we have a valid expression
12932         before calling in lower levels functions that will require a
12933         resolved object.  Then use this original_source in the
12934         target.ResolveLValue instead of the original source that was
12935         passed to us.
12936
12937         Another change.  Use target.Resolve instead of LValueResolve.
12938         Although we are resolving for LValues, we will let the Assign code
12939         take care of that (it will be called again from Resolve).  This
12940         basically allows code like this:
12941
12942         class X { X operator + (X x, object o) {} X this [int idx] { get; set; } }
12943         class Y { void A (X x) { x [0] += o; }
12944
12945         The problem was that the indexer was trying to resolve for
12946         set_Item (idx, object o) and never finding one.  The real set_Item
12947         was set_Item (idx, X).  By delaying the process we get the right
12948         semantics. 
12949
12950         Fixes bug 36505
12951
12952 2003-02-23  Martin Baulig  <martin@ximian.com>
12953
12954         * statement.cs (Block.Emit): Override this and set ec.CurrentBlock
12955         while calling DoEmit ().
12956
12957         * codegen.cs (EmitContext.Mark): Don't mark locations in other
12958         source files; if you use the #line directive inside a method, the
12959         compiler stops emitting line numbers for the debugger until it
12960         reaches the end of the method or another #line directive which
12961         restores the original file.
12962
12963 2003-02-23  Martin Baulig  <martin@ximian.com>
12964
12965         * statement.cs (FlowBranching.UsageVector.MergeChildren): Fix bug #37708.
12966
12967 2003-02-23  Martin Baulig  <martin@ximian.com>
12968
12969         * statement.cs (Block.AddChildVariableNames): We need to call this
12970         recursively, not just for our immediate children.
12971
12972 2003-02-23  Martin Baulig  <martin@ximian.com>
12973
12974         * class.cs (Event.Define): Always make the field private, like csc does.
12975
12976         * typemanager.cs (TypeManager.RealMemberLookup): Make events
12977         actually work, fixes bug #37521.
12978
12979 2003-02-23  Miguel de Icaza  <miguel@ximian.com>
12980
12981         * delegate.cs: When creating the various temporary "Parameters"
12982         classes, make sure that we call the ComputeAndDefineParameterTypes
12983         on those new parameters (just like we do with the formal ones), to
12984         allow them to be resolved in the context of the DeclSpace.
12985
12986         This fixes the bug that Dick observed in Bugzilla #38530.
12987
12988 2003-02-22  Miguel de Icaza  <miguel@ximian.com>
12989
12990         * expression.cs (ResolveMemberAccess): When resolving a constant,
12991         do not attempt to pull a constant if the value was not able to
12992         generate a valid constant.
12993
12994         * const.cs (LookupConstantValue): Do not report more errors than required.
12995
12996 2003-02-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
12997
12998         * expression.cs: fixes bug #38328.
12999
13000 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13001
13002         * class.cs: Changed all the various members that can be part of a
13003         class from being an ArrayList to be an Array of the right type.
13004         During the DefineType type_list, interface_list, delegate_list and
13005         enum_list are turned into types, interfaces, delegates and enums
13006         arrays.  
13007
13008         And during the member population, indexer_list, event_list,
13009         constant_list, field_list, instance_constructor_list, method_list,
13010         operator_list and property_list are turned into their real arrays.
13011
13012         Although we could probably perform this operation earlier, for
13013         good error reporting we need to keep the lists and remove the
13014         lists for longer than required.
13015
13016         This optimization was triggered by Paolo profiling the compiler
13017         speed on the output of `gen-sample-program.pl' perl script. 
13018
13019         * decl.cs (DeclSpace.ResolveType): Set the ContainerType, so we do
13020         not crash in methods like MemberLookupFailed that use this field.  
13021
13022         This problem arises when the compiler fails to resolve a type
13023         during interface type definition for example.
13024
13025 2003-02-18  Miguel de Icaza  <miguel@ximian.com>
13026
13027         * expression.cs (Indexers.GetIndexersForType): Interfaces do not
13028         inherit from System.Object, so we have to stop at null, not only
13029         when reaching System.Object.
13030
13031 2003-02-17  Miguel de Icaza  <miguel@ximian.com>
13032
13033         * expression.cs: (Indexers.GetIndexersForType): Martin's fix used
13034         DeclaredOnly because the parent indexer might have had a different
13035         name, but did not loop until the top of the hierarchy was reached.
13036
13037         The problem this one fixes is 35492: when a class implemented an
13038         indexer from an interface, we were getting the interface method
13039         (which was abstract) and we were flagging an error (can not invoke
13040         abstract method).
13041
13042         This also keeps bug 33089 functioning, and test-148 functioning.
13043
13044         * typemanager.cs (IsSpecialMethod): The correct way of figuring
13045         out if a method is special is to see if it is declared in a
13046         property or event, or whether it is one of the predefined operator
13047         names.   This should fix correctly #36804.
13048
13049 2003-02-15  Miguel de Icaza  <miguel@ximian.com>
13050
13051         The goal here is to remove the dependency on EmptyCast.Peel ().
13052         Killing it completely.
13053
13054         The problem is that currently in a number of places where
13055         constants are expected, we have to "probe" for an EmptyCast, and
13056         Peel, which is not the correct thing to do, as this will be
13057         repetitive and will likely lead to errors. 
13058
13059         The idea is to remove any EmptyCasts that are used in casts that
13060         can be reduced to constants, so we only have to cope with
13061         constants. 
13062
13063         This bug hunt was triggered by Bug 37363 and the desire to remove
13064         the duplicate pattern where we were "peeling" emptycasts to check
13065         whether they were constants.  Now constants will always be
13066         constants.
13067
13068         * ecore.cs: Use an enumconstant here instead of wrapping with
13069         EmptyCast.  
13070
13071         * expression.cs (Cast.TryReduce): Ah, the tricky EnumConstant was
13072         throwing me off.  By handling this we can get rid of a few hacks.
13073
13074         * statement.cs (Switch): Removed Peel() code.
13075
13076 2003-02-14  Miguel de Icaza  <miguel@ximian.com>
13077
13078         * class.cs: Location information for error 508
13079
13080         * expression.cs (New.DoResolve): Add a guard against double
13081         resolution of an expression.  
13082
13083         The New DoResolve might be called twice when initializing field
13084         expressions (see EmitFieldInitializers, the call to
13085         GetInitializerExpression will perform a resolve on the expression,
13086         and later the assign will trigger another resolution
13087
13088         This leads to bugs (#37014)
13089
13090         * delegate.cs: The signature for EndInvoke should contain any ref
13091         or out parameters as well.  We were not doing this in the past. 
13092
13093         * class.cs (Field.Define): Do not overwrite the type definition
13094         inside the `volatile' group.  Turns out that volatile enumerations
13095         were changing the type here to perform a validity test, which
13096         broke conversions. 
13097
13098 2003-02-12  Miguel de Icaza  <miguel@ximian.com>
13099
13100         * ecore.cs (FieldExpr.AddressOf): In the particular case of This
13101         and structs, we do not want to load the instance variable
13102
13103         (ImplicitReferenceConversion, ImplicitReferenceConversionExists):
13104         enum_type has to be handled like an object reference (implicit
13105         conversions exists from this to object), but the regular IsClass
13106         and IsValueType tests will never return true for this one.
13107
13108         Also we use TypeManager.IsValueType instead of type.IsValueType,
13109         just for consistency with the rest of the code (this is only
13110         needed if we ever use the construct exposed by test-180.cs inside
13111         corlib, which we dont today).
13112
13113 2003-02-12  Zoltan Varga  <vargaz@freemail.hu>
13114
13115         * attribute.cs (ApplyAttributes): apply all MethodImplAttributes, not
13116         just InternalCall.
13117
13118 2003-02-09  Martin Baulig  <martin@ximian.com>
13119
13120         * namespace.cs (Namespace..ctor): Added SourceFile argument.
13121         (Namespace.DefineNamespaces): New static public method; this is
13122         called when we're compiling with debugging to add all namespaces
13123         to the symbol file.
13124
13125         * tree.cs (Tree.RecordNamespace): Added SourceFile argument and
13126         pass it to the Namespace's .ctor.
13127
13128         * symbolwriter.cs (SymbolWriter.OpenMethod): Added TypeContainer
13129         and MethodBase arguments; pass the namespace ID to the symwriter;
13130         pass the MethodBase instead of the token to the symwriter.
13131         (SymbolWriter.DefineNamespace): New method to add a namespace to
13132         the symbol file.
13133
13134 2003-02-09  Martin Baulig  <martin@ximian.com>
13135
13136         * symbolwriter.cs: New file.  This is a wrapper around
13137         ISymbolWriter with a cleaner API.  We'll dynamically Invoke()
13138         methods here in near future.
13139
13140 2003-02-09  Martin Baulig  <martin@ximian.com>
13141
13142         * codegen.cs (EmitContext.Mark): Just pass the arguments to
13143         ILGenerator.MarkSequencePoint() which are actually used by the
13144         symbol writer.
13145
13146 2003-02-09  Martin Baulig  <martin@ximian.com>
13147
13148         * location.cs (SourceFile): New public sealed class.  This
13149         contains the name and an index which is used in the location's token.
13150         (Location): Reserve an appropriate number of bits in the token for
13151         the source file instead of walking over that list, this gives us a
13152         really huge performance improvement when compiling with debugging.
13153
13154         * driver.cs (Driver.parse, Driver.tokenize_file): Take a
13155         `SourceFile' argument instead of a string.
13156         (Driver.ProcessFile): Add all the files via Location.AddFile(),
13157         but don't parse/tokenize here, we need to generate the list of all
13158         source files before we do that.
13159         (Driver.ProcessFiles): New static function.  Parses/tokenizes all
13160         the files.
13161
13162         * cs-parser.jay (CSharpParser): Take a `SourceFile' argument
13163         instead of a string.
13164
13165         * cs-tokenizer.cs (Tokenizer): Take `SourceFile' argument instead
13166         of a string.
13167
13168 2003-02-09  Martin Baulig  <martin@ximian.com>
13169
13170         * cs-tokenizer.cs (Tokenizer.PreProcessLine): Also reset the
13171         filename on `#line default'.
13172
13173 Sat Feb 8 17:03:16 CET 2003 Paolo Molaro <lupus@ximian.com>
13174
13175         * statement.cs: don't clear the pinned var when the fixed statement
13176         returns from the method (fixes bug#37752).
13177
13178 Sat Feb 8 12:58:06 CET 2003 Paolo Molaro <lupus@ximian.com>
13179
13180         * typemanager.cs: fix from mathpup@mylinuxisp.com (Marcus Urban) 
13181         to IsValueType.
13182
13183 2003-02-07  Martin Baulig  <martin@ximian.com>
13184
13185         * driver.cs: Removed the `--debug-args' command line argument.
13186
13187         * codegen.cs (CodeGen.SaveSymbols): Removed, this is now done
13188         automatically by the AsssemblyBuilder.
13189         (CodeGen.InitializeSymbolWriter): We don't need to call any
13190         initialization function on the symbol writer anymore.  This method
13191         doesn't take any arguments.
13192
13193 2003-02-03  Miguel de Icaza  <miguel@ximian.com>
13194
13195         * driver.cs: (AddAssemblyAndDeps, LoadAssembly): Enter the types
13196         from referenced assemblies as well.
13197
13198 2003-02-02  Martin Baulig  <martin@ximian.com>
13199
13200         * class.cs (MethodData.Emit): Generate debugging info for external methods.
13201
13202 2003-02-02  Martin Baulig  <martin@ximian.com>
13203
13204         * class.cs (Constructor.Emit): Open the symbol writer before
13205         emitting the constructor initializer.
13206         (ConstructorInitializer.Emit): Call ec.Mark() to allow
13207         single-stepping through constructor initializers.
13208
13209 2003-01-30  Miguel de Icaza  <miguel@ximian.com>
13210
13211         * class.cs: Handle error 549: do not allow virtual methods in
13212         sealed classes. 
13213
13214 2003-02-01 Jackson Harper <jackson@latitudegeo.com>
13215
13216         * decl.cs: Check access levels when resolving types
13217
13218 2003-01-31 Jackson Harper <jackson@latitudegeo.com>
13219
13220         * statement.cs: Add parameters and locals set in catch blocks that might 
13221         return to set vector
13222
13223 2003-01-29  Miguel de Icaza  <miguel@ximian.com>
13224
13225         * class.cs (Operator): Set the SpecialName flags for operators.
13226
13227         * expression.cs (Invocation.DoResolve): Only block calls to
13228         accessors and operators on SpecialName methods.
13229
13230         (Cast.TryReduce): Handle conversions from char constants.
13231
13232
13233 Tue Jan 28 17:30:57 CET 2003 Paolo Molaro <lupus@ximian.com>
13234
13235         * statement.cs: small memory and time optimization in FlowBranching.
13236
13237 2003-01-28  Pedro Mart  <yoros@wanadoo.es>
13238
13239         * expression.cs (IndexerAccess.DoResolveLValue): Resolve the same
13240         problem that the last fix but in the other sid (Set).
13241
13242         * expression.cs (IndexerAccess.DoResolve): Fix a problem with a null
13243         access when there is no indexer in the hierarchy.
13244
13245 2003-01-27 Jackson Harper <jackson@latitudegeo.com>
13246
13247         * class.cs: Combine some if statements.
13248
13249 2003-01-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13250
13251         * driver.cs: fixed bug #37187.
13252
13253 2003-01-27  Pedro Martinez Juliá  <yoros@wanadoo.es>
13254
13255         * expression.cs (IndexerAccess.DoResolve): Before trying to resolve
13256         any indexer, it's needed to build a list with all the indexers in the
13257         hierarchy (AllGetters), else we have problems. Fixes #35653.
13258
13259 2003-01-23  Miguel de Icaza  <miguel@ximian.com>
13260
13261         * class.cs (MethodData.Define): It is wrong for an interface
13262         implementation to be static in both cases: explicit and implicit.
13263         We were only handling this in one case.
13264
13265         Improve the if situation there to not have negations.
13266
13267         * class.cs (Field.Define): Turns out that we do not need to check
13268         the unsafe bit on field definition, only on usage.  Remove the test.
13269
13270 2003-01-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13271
13272         * driver.cs: use assembly.Location instead of Codebase (the latest
13273         patch made mcs fail when using MS assemblies).
13274
13275 2003-01-21  Tim Haynes <thaynes@openlinksw.com>
13276
13277         * driver.cs: use DirectorySeparatorChar instead of a hardcoded "/" to
13278         get the path to *corlib.dll.
13279
13280 2003-01-21  Nick Drochak <ndrochak@gol.com>
13281
13282         * cs-tokenizer.cs:
13283         * pending.cs:
13284         * typemanager.cs: Remove compiler warnings
13285
13286 2003-01-20  Duncan Mak  <duncan@ximian.com>
13287
13288         * AssemblyInfo.cs: Bump the version number to 0.19.
13289
13290 2003-01-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13291
13292         * cs-tokenizer.cs: little fixes to line numbering when #line is used.
13293
13294 2003-01-18  Zoltan Varga  <vargaz@freemail.hu>
13295
13296         * class.cs (Constructor::Emit): Emit debugging info for constructors.
13297
13298 2003-01-17  Miguel de Icaza  <miguel@ximian.com>
13299
13300         * cs-parser.jay: Small fix: we were not comparing the constructor
13301         name correctly.   Thanks to Zoltan for the initial pointer.
13302
13303 2003-01-16 Jackson Harper <jackson@latitudegeo.com>
13304
13305         * cs-tokenizer.cs: Set file name when specified with #line
13306
13307 2003-01-15  Miguel de Icaza  <miguel@ximian.com>
13308
13309         * cs-parser.jay: Only perform the constructor checks here if we
13310         are named like the class;  This will help provider a better
13311         error.  The constructor path is taken when a type definition is
13312         not found, but most likely the user forgot to add the type, so
13313         report that rather than the constructor error.
13314
13315 Tue Jan 14 10:36:49 CET 2003 Paolo Molaro <lupus@ximian.com>
13316
13317         * class.cs, rootcontext.cs: small changes to avoid unnecessary memory
13318         allocations.
13319
13320 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13321
13322         * cs-parser.jay: Add cleanup call.
13323
13324 2003-01-13  Duncan Mak  <duncan@ximian.com>
13325
13326         * cs-tokenizer.cs (Cleanup): Rename to 'cleanup' to make it more
13327         consistent with other methods.
13328
13329 2003-01-13 Jackson Harper <jackson@latitudegeo.com>
13330
13331         * cs-tokenizer.cs: Add Cleanup method, also fix #region error messages.
13332
13333 Sun Jan 12 19:58:42 CET 2003 Paolo Molaro <lupus@ximian.com>
13334
13335         * attribute.cs: only set GuidAttr to true when we have a
13336         GuidAttribute.
13337
13338 2003-01-09  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13339
13340         * ecore.cs:
13341         * expression.cs:
13342         * typemanager.cs: fixes to allow mcs compile corlib with the new
13343         Type.IsSubclassOf fix.
13344
13345 2003-01-08  Miguel de Icaza  <miguel@ximian.com>
13346
13347         * expression.cs (LocalVariableReference.DoResolve): Classify a
13348         constant as a value, not as a variable.   Also, set the type for
13349         the variable.
13350
13351         * cs-parser.jay (fixed_statement): take a type instead of a
13352         pointer_type, so we can produce a better error message later.
13353
13354         * statement.cs (Fixed.Resolve): Flag types that are not pointers
13355         as an error.  
13356
13357         (For.DoEmit): Make inifinite loops have a
13358         non-conditional branch back.
13359
13360         (Fixed.DoEmit): First populate the pinned variables, then emit the
13361         statement, then clear the variables.  Before I was emitting the
13362         code once for each fixed piece.
13363
13364
13365 2003-01-08  Martin Baulig  <martin@ximian.com>
13366
13367         * statement.cs (FlowBranching.MergeChild): A break in a
13368         SWITCH_SECTION does not leave a loop.  Fixes #36155.
13369
13370 2003-01-08  Martin Baulig  <martin@ximian.com>
13371
13372         * statement.cs (FlowBranching.CheckOutParameters): `struct_params'
13373         lives in the same number space than `param_map'.  Fixes #36154.
13374
13375 2003-01-07  Miguel de Icaza  <miguel@ximian.com>
13376
13377         * cs-parser.jay (constructor_declaration): Set the
13378         Constructor.ModFlags before probing for it.  This makes the
13379         compiler report 514, 515 and 132 (the code was there, but got
13380         broken). 
13381
13382         * statement.cs (Goto.Resolve): Set `Returns' to ALWAYS.
13383         (GotoDefault.Resolve): Set `Returns' to ALWAYS.
13384         (GotoCase.Resolve): Set `Returns' to ALWAYS.
13385
13386 Tue Jan 7 18:32:24 CET 2003 Paolo Molaro <lupus@ximian.com>
13387
13388         * enum.cs: create the enum static fields using the enum type.
13389
13390 Tue Jan 7 18:23:44 CET 2003 Paolo Molaro <lupus@ximian.com>
13391
13392         * class.cs: don't try to create the ParamBuilder for the return
13393         type if it's not needed (and handle it breaking for the ms runtime
13394         anyway).
13395
13396 2003-01-06 Jackson Harper <jackson@latitudegeo.com>
13397
13398         * cs-tokenizer.cs: Add REGION flag to #region directives, and add checks to make sure that regions are being poped correctly
13399
13400 2002-12-29  Miguel de Icaza  <miguel@ximian.com>
13401
13402         * cs-tokenizer.cs (get_cmd_arg): Fixups to allow \r to terminate
13403         the command.   This showed up while compiling the JANET source
13404         code, which used \r as its only newline separator.
13405
13406 2002-12-28  Miguel de Icaza  <miguel@ximian.com>
13407
13408         * class.cs (Method.Define): If we are an operator (because it
13409         reuses our code), then set the SpecialName and HideBySig.  #36128
13410
13411 2002-12-22  Miguel de Icaza  <miguel@ximian.com>
13412
13413         * ecore.cs (FieldExpr.DoResolve): Instead of throwing an
13414         exception, report error 120 `object reference required'.
13415
13416         * driver.cs: Add --pause option, used during to measure the size
13417         of the process as it goes with --timestamp.
13418
13419         * expression.cs (Invocation.DoResolve): Do not allow methods with
13420         SpecialName to be invoked.
13421
13422 2002-12-21  Miguel de Icaza  <miguel@ximian.com>
13423
13424         * cs-tokenizer.cs: Small fix to the parser: compute the ascii
13425         number before adding it.
13426
13427 2002-12-21  Ravi Pratap  <ravi@ximian.com>
13428
13429         * ecore.cs (StandardImplicitConversion): When in an unsafe
13430         context, we allow conversion between void * to any other pointer
13431         type. This fixes bug #35973.
13432
13433 2002-12-20 Jackson Harper <jackson@latitudegeo.com>
13434
13435         * codegen.cs: Use Path.GetFileNameWithoutExtension so an exception
13436         is not thrown when extensionless outputs are used 
13437
13438 2002-12-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13439
13440         * rootcontext.cs: fixed compilation of corlib.
13441
13442 2002-12-19  Miguel de Icaza  <miguel@ximian.com>
13443
13444         * attribute.cs (Attributes.Contains): Add new method.
13445
13446         * class.cs (MethodCore.LabelParameters): if the parameter is an
13447         `out' parameter, check that no attribute `[In]' has been passed.
13448
13449         * enum.cs: Handle the `value__' name in an enumeration.
13450
13451 2002-12-14  Jaroslaw Kowalski <jarek@atm.com.pl>
13452
13453         * decl.cs: Added special case to allow overrides on "protected
13454         internal" methods
13455
13456 2002-12-18  Ravi Pratap  <ravi@ximian.com>
13457
13458         * attribute.cs (Attributes.AddAttributeSection): Rename to this
13459         since it makes much more sense.
13460
13461         (Attributes.ctor): Don't require a Location parameter.
13462
13463         * rootcontext.cs (AddGlobalAttributeSection): Rename again.
13464
13465         * attribute.cs (ApplyAttributes): Remove extra Location parameters
13466         since we already have that information per attribute.
13467
13468         * everywhere : make appropriate changes.
13469
13470         * class.cs (LabelParameters): Write the code which actually
13471         applies attributes to the return type. We can't do this on the MS
13472         .NET runtime so we flag a warning in the case an exception is
13473         thrown.
13474
13475 2002-12-18  Miguel de Icaza  <miguel@ximian.com>
13476
13477         * const.cs: Handle implicit null conversions here too.
13478
13479 2002-12-17  Ravi Pratap  <ravi@ximian.com>
13480
13481         * class.cs (MethodCore.LabelParameters): Remove the extra
13482         Type [] parameter since it is completely unnecessary. Instead
13483         pass in the method's attributes so that we can extract
13484         the "return" attribute.
13485
13486 2002-12-17  Miguel de Icaza  <miguel@ximian.com>
13487
13488         * cs-parser.jay (parse): Use Report.Error to flag errors instead
13489         of ignoring it and letting the compile continue.
13490
13491         * typemanager.cs (ChangeType): use an extra argument to return an
13492         error condition instead of throwing an exception.
13493
13494 2002-12-15  Miguel de Icaza  <miguel@ximian.com>
13495
13496         * expression.cs (Unary.TryReduce): mimic the code for the regular
13497         code path.  Perform an implicit cast in the cases where we can
13498         implicitly convert to one of the integral types, and then reduce
13499         based on that constant.   This fixes bug #35483.
13500
13501 2002-12-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13502
13503         * typemanager.cs: fixed cut & paste error in GetRemoveMethod.
13504
13505 2002-12-13  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13506
13507         * namespace.cs: fixed bug #35489.
13508
13509 2002-12-12  Miguel de Icaza  <miguel@ximian.com>
13510
13511         * class.cs: Remove some dead code.
13512
13513         * cs-parser.jay: Estimate the number of methods needed
13514         (RootContext.MethodCount);
13515
13516         * cs-tokenizer.cs: Use char arrays for parsing identifiers and
13517         numbers instead of StringBuilders.
13518
13519         * support.cs (PtrHashtable): Add constructor with initial size;
13520         We can now reduce reallocations of the method table.
13521
13522 2002-12-10  Ravi Pratap  <ravi@ximian.com>
13523
13524         * attribute.cs (ApplyAttributes): Keep track of the emitted
13525         attributes on a per-target basis. This fixes bug #35413.
13526
13527 2002-12-10  Miguel de Icaza  <miguel@ximian.com>
13528
13529         * driver.cs (MainDriver): On rotor encoding 28591 does not exist,
13530         default to the Windows 1252 encoding.
13531
13532         (UnixParseOption): Support version, thanks to Alp for the missing
13533         pointer. 
13534
13535         * AssemblyInfo.cs: Add nice assembly information.
13536
13537         * cs-tokenizer.cs: Add fix from Felix to the #if/#else handler
13538         (bug 35169).
13539
13540         * cs-parser.jay: Allow a trailing comma before the close bracked
13541         in the attribute_section production.
13542
13543         * ecore.cs (FieldExpr.AddressOf): Until I figure out why the
13544         address of the instance was being taken, I will take this out,
13545         because we take the address of the object immediately here.
13546
13547 2002-12-09  Ravi Pratap  <ravi@ximian.com>
13548
13549         * typemanager.cs (AreMultipleAllowed): Take care of the most
13550         obvious case where attribute type is not in the current assembly -
13551         stupid me ;-)
13552
13553 2002-12-08  Miguel de Icaza  <miguel@ximian.com>
13554
13555         * ecore.cs (SimpleName.DoResolve): First perform lookups on using
13556         definitions, instead of doing that afterwards.  
13557
13558         Also we use a nice little hack, depending on the constructor, we
13559         know if we are a "composed" name or a simple name.  Hence, we
13560         avoid the IndexOf test, and we avoid 
13561
13562         * codegen.cs: Add code to assist in a bug reporter to track down
13563         the source of a compiler crash. 
13564
13565 2002-12-07  Ravi Pratap  <ravi@ximian.com>
13566
13567         * attribute.cs (Attribute.ApplyAttributes) : Keep track of which attribute
13568         types have been emitted for a given element and flag an error
13569         if something which does not have AllowMultiple set is used more
13570         than once.
13571
13572         * typemanager.cs (RegisterAttributeAllowMultiple): Keep track of
13573         attribute types and their corresponding AllowMultiple properties
13574
13575         (AreMultipleAllowed): Check the property for a given type.
13576
13577         * attribute.cs (Attribute.ApplyAttributes): Register the AllowMultiple
13578         property in the case we have a TypeContainer.
13579
13580         (Attributes.AddAttribute): Detect duplicates and just skip on
13581         adding them. This trivial fix catches a pretty gross error in our
13582         attribute emission - global attributes were being emitted twice!
13583
13584         Bugzilla bug #33187 is now fixed.
13585
13586 2002-12-06  Miguel de Icaza  <miguel@ximian.com>
13587
13588         * cs-tokenizer.cs (pp_expr): Properly recurse here (use pp_expr
13589         instead of pp_and).
13590
13591         * expression.cs (Binary.ResolveOperator): I can only use the
13592         Concat (string, string, string) and Concat (string, string,
13593         string, string) if the child is actually a concatenation of
13594         strings. 
13595
13596 2002-12-04  Miguel de Icaza  <miguel@ximian.com>
13597
13598         * cs-tokenizer.cs: Small fix, because decimal_digits is used in a
13599         context where we need a 2-character lookahead.
13600
13601         * pending.cs (PendingImplementation): Rework so we can keep track
13602         of interface types all the time, and flag those which were
13603         implemented by parents as optional.
13604
13605 2002-12-03  Miguel de Icaza  <miguel@ximian.com>
13606
13607         * expression.cs (Binary.ResolveOperator): Use
13608         String.Concat(string,string,string) or
13609         String.Concat(string,string,string,string) when possible. 
13610
13611         * typemanager: More helper methods.
13612
13613
13614 Tue Dec 3 19:32:04 CET 2002 Paolo Molaro <lupus@ximian.com>
13615
13616         * pending.cs: remove the bogus return from GetMissingInterfaces()
13617         (see the 2002-11-06 entry: the mono runtime is now fixed in cvs).
13618
13619 2002-12-02  Gonzalo Paniagua Javier <gonzalo@ximian.com>
13620
13621         * namespace.cs: avoid duplicated 'using xxx' being added to
13622         using_clauses. This prevents mcs from issuing and 'ambiguous type' error
13623         when we get more than one 'using' statement for the same namespace.
13624         Report a CS0105 warning for it.
13625
13626 2002-11-30  Miguel de Icaza  <miguel@ximian.com>
13627
13628         * cs-tokenizer.cs (consume_identifier): use read directly, instead
13629         of calling getChar/putback, uses internal knowledge of it.    
13630
13631         (xtoken): Reorder tokenizer so most common patterns are checked
13632         first.  This reduces the compilation time in another 5% (from 8.11s
13633         average to 7.73s for bootstrapping mcs on my Mobile p4/1.8ghz).
13634
13635         The parsing time is 22% of the compilation in mcs, and from that
13636         64% is spent on the tokenization process.  
13637
13638         I tried using a binary search for keywords, but this is slower
13639         than the hashtable.  Another option would be to do a couple of
13640         things:
13641
13642                 * Not use a StringBuilder, instead use an array of chars,
13643                   with a set value.  Notice that this way we could catch
13644                   the 645 error without having to do it *afterwards*.
13645
13646                 * We could write a hand-parser to avoid the hashtable
13647                   compares altogether.
13648
13649         The identifier consumption process takes 37% of the tokenization
13650         time.  Another 15% is spent on is_number.  56% of the time spent
13651         on is_number is spent on Int64.Parse:
13652
13653                 * We could probably choose based on the string length to
13654                   use Int32.Parse or Int64.Parse and avoid all the 64-bit
13655                   computations. 
13656
13657         Another 3% is spend on wrapping `xtoken' in the `token' function.
13658
13659         Handle 0xa0 as whitespace (#34752)
13660
13661 2002-11-26  Miguel de Icaza  <miguel@ximian.com>
13662
13663         * typemanager.cs (IsCLRType): New routine to tell whether a type
13664         is one of the builtin types.  
13665
13666         Maybe it needs to use TypeCodes to be faster.  Maybe we could use
13667         typecode in more places instead of doing pointer comparissions.
13668         We could leverage some knowledge about the way the typecodes are
13669         laid out.
13670
13671         New code to cache namespaces in assemblies, it is currently not
13672         invoked, to be used soon.
13673
13674         * decl.cs (DeclSpace.MakeFQN): Simple optimization.
13675
13676         * expression.cs (Binary.ResolveOperator): specially handle
13677         strings, and do not perform user-defined operator overloading for
13678         built-in types.
13679
13680 2002-11-24  Miguel de Icaza  <miguel@ximian.com>
13681
13682         * cs-tokenizer.cs: Avoid calling Char.IsDigit which is an
13683         internalcall as it is a pretty simple operation;  Avoid whenever
13684         possible to call Char.IsLetter.
13685
13686         (consume_identifier): Cut by half the number of
13687         hashtable calls by merging the is_keyword and GetKeyword behavior.
13688
13689         Do not short-circuit, because if we do, we
13690         report errors (ie, #if false && true would produce an invalid
13691         directive error);
13692
13693
13694 2002-11-24  Martin Baulig  <martin@ximian.com>
13695
13696         * expression.cs (Cast.TryReduce): If we're in checked syntax,
13697         check constant ranges and report a CS0221.  Fixes #33186.
13698
13699 2002-11-24  Martin Baulig  <martin@ximian.com>
13700
13701         * cs-parser.jay: Make this work for uninitialized variable
13702         declarations in the `for' initializer.  Fixes #32416.
13703
13704 2002-11-24  Martin Baulig  <martin@ximian.com>
13705
13706         * ecore.cs (Expression.ConvertExplicit): Make casting from/to
13707         System.Enum actually work.  Fixes bug #32269, added verify-6.cs.
13708
13709 2002-11-24  Martin Baulig  <martin@ximian.com>
13710
13711         * expression.cs (Binary.DoNumericPromotions): Added `check_user_conv'
13712         argument; if true, we also check for user-defined conversions.
13713         This is only needed if both arguments are of a user-defined type.
13714         Fixes #30443, added test-175.cs.
13715         (Binary.ForceConversion): Pass the location argument to ConvertImplicit.
13716
13717         * ecore.cs (Expression.ImplicitUserConversionExists): New method.
13718
13719 2002-11-24  Martin Baulig  <martin@ximian.com>
13720
13721         * expression.cs (ArrayAccess.GetStoreOpcode): New public static
13722         function to get the store opcode.
13723         (Invocation.EmitParams): Call ArrayAccess.GetStoreOpcode() and
13724         only emit the Ldelema if the store opcode is Stobj.  You must run
13725         both test-34 and test-167 to test this.  Fixes #34529.
13726
13727 2002-11-23  Martin Baulig  <martin@ximian.com>
13728
13729         * ecore.cs (Expression.MemberLookup): Added additional
13730         `qualifier_type' argument which is used when we're being called
13731         from MemberAccess.DoResolve() and null if we're called from a
13732         SimpleName lookup.
13733         (Expression.MemberLookupFailed): New method to report errors; this
13734         does the CS1540 check and reports the correct error message.
13735
13736         * typemanager.cs (MemberLookup): Added additional `qualifier_type'
13737         argument for the CS1540 check and redone the way how we're dealing
13738         with private members.  See the comment in the source code for details.
13739         (FilterWithClosure): Reverted this back to revision 1.197; renamed
13740         `closure_start_type' to `closure_qualifier_type' and check whether
13741         it's not null.  It was not this filter being broken, it was just
13742         being called with the wrong arguments.
13743
13744         * expression.cs (MemberAccess.DoResolve): use MemberLookupFinal()
13745         and pass it the correct `qualifier_type'; this also does the error
13746         handling for us.
13747
13748 2002-11-22  Miguel de Icaza  <miguel@ximian.com>
13749
13750         * expression.cs (Invocation.EmitParams): If the we are dealing
13751         with a non-built-in value type, load its address as well.
13752
13753         (ArrayCreation): Use a a pretty constant instead
13754         of the hardcoded value 2.   Use 6 instead of 2 for the number of
13755         static initializers.  
13756
13757         (ArrayCreation.EmitDynamicInitializers): Peel enumerations,
13758         because they are not really value types, just glorified integers. 
13759
13760         * driver.cs: Do not append .exe, the CSC compiler does not do it.
13761
13762         * ecore.cs: Remove redundant code for enumerations, make them use
13763         the same code path as everything else, fixes the casting issue
13764         with enumerations in Windows.Forms.
13765
13766         * attribute.cs: Do only cast to string if it is a string, the
13767         validation happens later.
13768
13769         * typemanager.cs: Temproary hack to avoid a bootstrap issue until
13770         people upgrade their corlibs.
13771
13772         * ecore.cs: Oops, enumerations were not following the entire code path
13773
13774 2002-11-21  Miguel de Icaza  <miguel@ximian.com>
13775
13776         * typemanager.cs (FilterWithClosure): Commented out the test for
13777         1540 in typemanager.cs, as it has problems when accessing
13778         protected methods from a parent class (see test-174.cs). 
13779
13780         * attribute.cs (Attribute.ValidateGuid): new method.
13781         (Attribute.Resolve): Use above.
13782
13783 2002-11-19  Miguel de Icaza  <miguel@ximian.com>
13784
13785         * enum.cs: In FindMembers, perform a recursive lookup for values. (34308)
13786
13787         * ecore.cs (SimpleName.SimpleNameResolve): Remove the special
13788         handling for enumerations, as we only needed the TypeContainer
13789         functionality to begin with (this is required for the fix below to
13790         work for enums that reference constants in a container class for
13791         example). 
13792
13793         * codegen.cs (EmitContext): Make TypeContainer a DeclSpace.
13794
13795         * enum.cs (Enum.Define): Use `this' instead of parent, so we have
13796         a valid TypeBuilder to perform lookups on.o
13797
13798         * class.cs (InheritableMemberSignatureCompare): Use true in the
13799         call to GetGetMethod and GetSetMethod, because we are comparing
13800         the signature, and we need to get the methods *even* if they are
13801         private. 
13802
13803         (PropertyBase.CheckBase): ditto.
13804
13805         * statement.cs (Switch.ResolveAndReduce, Block.EmitMeta,
13806         GotoCase.Resolve): Use Peel on EmpytCasts.
13807
13808         * ecore.cs (EmptyCast): drop child, add Peel method.
13809
13810 2002-11-17  Martin Baulig  <martin@ximian.com>
13811
13812         * ecore.cs (EmptyCast.Child): New public property.
13813
13814         * statement.cs (SwitchLabel.ResolveAndReduce): Check whether the
13815         label resolved to an EmptyCast.  Fixes #34162.
13816         (GotoCase.Resolve): Likewise.
13817         (Block.EmitMeta): Likewise.
13818
13819 2002-11-17  Martin Baulig  <martin@ximian.com>
13820
13821         * expression.cs (Invocation.BetterConversion): Prefer int over
13822         uint; short over ushort; long over ulong for integer literals.
13823         Use ImplicitConversionExists instead of StandardConversionExists
13824         since we also need to check for user-defined implicit conversions.
13825         Fixes #34165.  Added test-173.cs.
13826
13827 2002-11-16  Martin Baulig  <martin@ximian.com>
13828
13829         * expression.cs (Binary.EmitBranchable): Eliminate comparisions
13830         with the `true' and `false' literals.  Fixes #33151.
13831
13832 2002-11-16  Martin Baulig  <martin@ximian.com>
13833
13834         * typemanager.cs (RealMemberLookup): Reverted Miguel's patch from
13835         October 22nd; don't do the cs1540 check for static members.
13836
13837         * ecore.cs (PropertyExpr.ResolveAccessors): Rewrote this; we're
13838         now using our own filter here and doing the cs1540 check again.
13839
13840 2002-11-16  Martin Baulig  <martin@ximian.com>
13841
13842         * support.cs (InternalParameters): Don't crash if we don't have
13843         any fixed parameters.  Fixes #33532.
13844
13845 2002-11-16  Martin Baulig  <martin@ximian.com>
13846
13847         * decl.cs (MemberCache.AddMethods): Use BindingFlags.FlattenHierarchy
13848         when looking up static methods to make this work on Windows.
13849         Fixes #33773.
13850
13851 2002-11-16  Martin Baulig  <martin@ximian.com>
13852
13853         * ecore.cs (PropertyExpr.VerifyAssignable): Check whether we have
13854         a setter rather than using PropertyInfo.CanWrite.
13855
13856 2002-11-15  Nick Drochak  <ndrochak@gol.com>
13857
13858         * class.cs: Allow acces to block member by subclasses. Fixes build
13859         breaker.
13860
13861 2002-11-14  Martin Baulig  <martin@ximian.com>
13862
13863         * class.cs (Constructor.Emit): Added the extern/block check.
13864         Fixes bug #33678.
13865
13866 2002-11-14  Martin Baulig  <martin@ximian.com>
13867
13868         * expression.cs (IndexerAccess.DoResolve): Do a DeclaredOnly
13869         iteration while looking for indexers, this is needed because the
13870         indexer may have a different name in our base classes.  Fixed the
13871         error reporting (no indexers at all, not get accessor, no
13872         overloaded match).  Fixes bug #33089.
13873         (IndexerAccess.DoResolveLValue): Likewise.
13874
13875 2002-11-14  Martin Baulig  <martin@ximian.com>
13876
13877         * class.cs (PropertyBase.CheckBase): Make this work for multiple
13878         indexers.  Fixes the first part of bug #33089.
13879         (MethodSignature.InheritableMemberSignatureCompare): Added support
13880         for properties.
13881
13882 2002-11-13  Ravi Pratap  <ravi@ximian.com>
13883
13884         * attribute.cs (Attribute.Resolve): Catch the
13885         NullReferenceException and report it since it isn't supposed to
13886         happen. 
13887
13888 2002-11-12  Miguel de Icaza  <miguel@ximian.com>
13889
13890         * expression.cs (Binary.EmitBranchable): Also handle the cases for
13891         LogicalOr and LogicalAnd that can benefit from recursively
13892         handling EmitBranchable.  The code now should be nice for Paolo.
13893
13894 2002-11-08  Miguel de Icaza  <miguel@ximian.com>
13895
13896         * typemanager.cs (LookupType): Added a negative-hit hashtable for
13897         the Type lookups, as we perform quite a number of lookups on
13898         non-Types.  This can be removed once we can deterministically tell
13899         whether we have a type or a namespace in advance.
13900
13901         But this might require special hacks from our corlib.
13902
13903         * TODO: updated.
13904
13905         * ecore.cs (TryImplicitIntConversion): Handle conversions to float
13906         and double which avoids a conversion from an integer to a double.
13907
13908         * expression.cs: tiny optimization, avoid calling IsConstant,
13909         because it effectively performs the lookup twice.
13910
13911 2002-11-06  Miguel de Icaza  <miguel@ximian.com>
13912
13913         But a bogus return here to keep the semantics of the old code
13914         until the Mono runtime is fixed.
13915
13916         * pending.cs (GetMissingInterfaces): New method used to remove all
13917         the interfaces that are already implemented by our parent
13918         classes from the list of pending methods. 
13919
13920         * interface.cs: Add checks for calls after ResolveTypeExpr.
13921
13922 2002-11-05  Miguel de Icaza  <miguel@ximian.com>
13923
13924         * class.cs (Class.Emit): Report warning 67: event not used if the
13925         warning level is beyond 3.
13926
13927         * ecore.cs (Expression.ConvertExplicit): Missed a check for expr
13928         being a NullLiteral.
13929
13930         * cs-parser.jay: Fix, Gonzalo reverted the order of the rank
13931         specifiers. 
13932
13933         * class.cs (TypeContainer.GetClassBases): Cover a missing code
13934         path that might fail if a type can not be resolved.
13935
13936         * expression.cs (Binary.Emit): Emit unsigned versions of the
13937         operators. 
13938
13939         * driver.cs: use error 5.
13940
13941 2002-11-02  Gonzalo Paniagua Javier <gonzalo@gnome-db.org>
13942
13943         * cs-parser.jay: simplified a rule and 5 SR conflicts dissapeared.
13944
13945 2002-11-01  Miguel de Icaza  <miguel@ximian.com>
13946
13947         * cs-parser.jay (switch_section): A beautiful patch from Martin
13948         Baulig that fixed 33094.
13949
13950 2002-10-31  Miguel de Icaza  <miguel@ximian.com>
13951
13952         * ecore.cs (PropertyExpr.DoResolveLValue, PropertyExpr.DoResolve):
13953         Check whether the base is abstract and report an error if so.
13954
13955         * expression.cs (IndexerAccess.DoResolveLValue,
13956         IndexerAccess.DoResolve): ditto. 
13957
13958         (Invocation.DoResolve): ditto.
13959
13960         (Invocation.FullMethodDesc): Improve the report string.
13961
13962         * statement.cs (Block): Eliminate IsVariableDefined as it is
13963         basically just a wrapper for GetVariableInfo.
13964
13965         * ecore.cs (SimpleName): Use new 
13966
13967         * support.cs (ReflectionParamter.ParameterType): We unwrap the
13968         type, as we return the actual parameter ref/unref state on a
13969         different call.
13970
13971 2002-10-30  Miguel de Icaza  <miguel@ximian.com>
13972
13973         * support.cs: Return proper flags REF/OUT fixing the previous
13974         commit.  
13975
13976         * expression.cs: Reverted last patch, that was wrong.  Is_ref is
13977         not used to mean `ref' but `ref or out' in ParameterReference
13978
13979         * delegate.cs (FullDelegateDesc): use ParameterDesc to get the
13980         full type signature instead of calling TypeManger.CSharpName
13981         ourselves. 
13982
13983         * support.cs (InternalParameters.ParameterDesc): Do not compare
13984         directly to the modflags, because REF/OUT will actually be bitsets
13985         if set. 
13986
13987         * delegate.cs (VerifyMethod): Check also the modifiers.
13988
13989         * cs-tokenizer.cs: Fix bug where floating point values with an
13990         exponent where a sign was missing was ignored.
13991
13992         * driver.cs: Allow multiple assemblies to be specified in a single
13993         /r: argument
13994
13995 2002-10-28  Miguel de Icaza  <miguel@ximian.com>
13996
13997         * cs-parser.jay: Ugly.  We had to add a multiplicative_expression,
13998         because identifiers after a parenthesis would end up in this kind
13999         of production, and we needed to desamiguate it for having casts
14000         like:
14001
14002                 (UserDefinedType *) xxx
14003
14004 2002-10-24  Miguel de Icaza  <miguel@ximian.com>
14005
14006         * typemanager.cs (RealMemberLookup): when we deal with a subclass,
14007         we should set on the Bindingflags.NonPublic, but not turn on
14008         private_ok.  private_ok controls whether a Private member is
14009         returned (this is chekced on the filter routine), while the
14010         BindingFlags.NonPublic just controls whether private/protected
14011         will be allowed.   This fixes the problem part of the problem of
14012         private properties being allowed to be used in derived classes.
14013
14014         * expression.cs (BaseAccess): Provide an DoResolveLValue method,
14015         so we can call the children DoResolveLValue method (this will
14016         properly signal errors on lvalue assignments to base properties)
14017
14018         * ecore.cs (PropertyExpr.ResolveAccessors): If both setter and
14019         getter are null, and we have a property info, we know that this
14020         happened because the lookup failed, so we report an error 122 for
14021         protection level violation.
14022
14023         We also silently return if setter and getter are null in the
14024         resolve functions, this condition only happens if we have flagged
14025         the error before.  This is the other half of the problem. 
14026
14027         (PropertyExpr.ResolveAccessors): Turns out that PropertyInfo does
14028         not have accessibility information, that is why we were returning
14029         true in the filter function in typemanager.cs.
14030
14031         To properly report 122 (property is inaccessible because of its
14032         protection level) correctly, we report this error in ResolveAccess
14033         by failing if both the setter and the getter are lacking (ie, the
14034         lookup failed). 
14035
14036         DoResolve and DoLResolve have been modified to check for both
14037         setter/getter being null and returning silently, the reason being
14038         that I did not want to put the knowledge about this error in upper
14039         layers, like:
14040
14041         int old = Report.Errors;
14042         x = new PropertyExpr (...);
14043         if (old != Report.Errors)
14044                 return null;
14045         else
14046                 return x;
14047
14048         So the property expr is returned, but it is invalid, so the error
14049         will be flagged during the resolve process. 
14050
14051         * class.cs: Remove InheritablePropertySignatureCompare from the
14052         class, as we no longer depend on the property signature to compute
14053         whether it is possible to implement a method or not.
14054
14055         The reason is that calling PropertyInfo.GetGetMethod will return
14056         null (in .NET, in Mono it works, and we should change this), in
14057         cases where the Get Method does not exist in that particular
14058         class.
14059
14060         So this code:
14061
14062         class X { public virtual int A { get { return 1; } } }
14063         class Y : X { }
14064         class Z : Y { public override int A { get { return 2; } } }
14065
14066         Would fail in Z because the parent (Y) would not have the property
14067         defined.  So we avoid this completely now (because the alternative
14068         fix was ugly and slow), and we now depend exclusively on the
14069         method names.
14070
14071         (PropertyBase.CheckBase): Use a method-base mechanism to find our
14072         reference method, instead of using the property.
14073
14074         * typemanager.cs (GetPropertyGetter, GetPropertySetter): These
14075         routines are gone now.
14076
14077         * typemanager.cs (GetPropertyGetter, GetPropertySetter): swap the
14078         names, they were incorrectly named.
14079
14080         * cs-tokenizer.cs: Return are more gentle token on failure. 
14081
14082         * pending.cs (PendingImplementation.InterfaceMethod): This routine
14083         had an out-of-sync index variable, which caused it to remove from
14084         the list of pending methods the wrong method sometimes.
14085
14086 2002-10-22  Miguel de Icaza  <miguel@ximian.com>
14087
14088         * ecore.cs (PropertyExpr): Do not use PropertyInfo.CanRead,
14089         CanWrite, because those refer to this particular instance of the
14090         property, and do not take into account the fact that we can
14091         override single members of a property.
14092
14093         Constructor requires an EmitContext.  The resolution process does
14094         not happen here, but we need to compute the accessors before,
14095         because the resolution does not always happen for properties.
14096
14097         * typemanager.cs (RealMemberLookup): Set private_ok if we are a
14098         subclass, before we did not update this flag, but we did update
14099         bindingflags. 
14100
14101         (GetAccessors): Drop this routine, as it did not work in the
14102         presence of partially overwritten set/get methods. 
14103
14104         Notice that this broke the cs1540 detection, but that will require
14105         more thinking. 
14106
14107 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14108
14109         * class.cs:
14110         * codegen.cs:
14111         * driver.cs: issue a warning instead of an error if we don't support
14112         debugging for the platform. Also ignore a couple of errors that may
14113         arise when trying to write the symbols. Undo my previous patch.
14114
14115 2002-10-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14116
14117         * driver.cs: ignore /debug switch except for Unix platforms.
14118
14119 2002-10-23  Nick Drochak  <ndrochak@gol.com>
14120
14121         * makefile: Remove mcs2.exe and mcs3.exe on 'make clean'
14122
14123 2002-10-21  Miguel de Icaza  <miguel@ximian.com>
14124
14125         * driver.cs: Do not make mcs-debug conditional, so we do not break
14126         builds that use it.
14127
14128         * statement.cs (UsageVector.MergeChildren): I would like Martin to
14129         review this patch.  But basically after all the children variables
14130         have been merged, the value of "Breaks" was not being set to
14131         new_breaks for Switch blocks.  I think that it should be set after
14132         it has executed.  Currently I set this to the value of new_breaks,
14133         but only if new_breaks is FlowReturn.ALWAYS, which is a bit
14134         conservative, but I do not understand this code very well.
14135
14136         I did not break anything in the build, so that is good ;-)
14137
14138         * cs-tokenizer.cs: Also allow \r in comments as a line separator.
14139
14140 2002-10-20  Mark Crichton  <crichton@gimp.org>
14141
14142         * cfold.cs: Fixed compile blocker.  Really fixed it this time.
14143
14144 2002-10-20  Nick Drochak  <ndrochak@gol.com>
14145
14146         * cfold.cs: Fixed compile blocker.
14147
14148 2002-10-20  Miguel de Icaza  <miguel@ximian.com>
14149
14150         * driver.cs: I was chekcing the key, not the file.
14151
14152 2002-10-19  Ravi Pratap  <ravi@ximian.com>
14153
14154         * ecore.cs (UserDefinedConversion): Get rid of the bogus error
14155         message that we were generating - we just need to silently return
14156         a null.
14157
14158 2002-10-19  Miguel de Icaza  <miguel@ximian.com>
14159
14160         * class.cs (Event.Define): Change my previous commit, as this
14161         breaks the debugger.  This is a temporary hack, as it seems like
14162         the compiler is generating events incorrectly to begin with.
14163
14164         * expression.cs (Binary.ResolveOperator): Added support for 
14165         "U operator - (E x, E y)"
14166
14167         * cfold.cs (BinaryFold): Added support for "U operator - (E x, E
14168         y)".
14169
14170         * ecore.cs (FieldExpr.AddressOf): We had a special code path for
14171         init-only variables, but this path did not take into account that
14172         there might be also instance readonly variables.  Correct this
14173         problem. 
14174
14175         This fixes bug 32253
14176
14177         * delegate.cs (NewDelegate.DoResolve): Catch creation of unsafe
14178         delegates as well.
14179
14180         * driver.cs: Change the extension for modules to `netmodule'
14181
14182         * cs-parser.jay: Improved slightly the location tracking for
14183         the debugger symbols.
14184
14185         * class.cs (Event.Define): Use Modifiers.FieldAttr on the
14186         modifiers that were specified instead of the hardcoded value
14187         (FamAndAssem).  This was basically ignoring the static modifier,
14188         and others.  Fixes 32429.
14189
14190         * statement.cs (Switch.SimpleSwitchEmit): Simplified the code, and
14191         fixed a bug in the process (32476)
14192
14193         * expression.cs (ArrayAccess.EmitAssign): Patch from
14194         hwang_rob@yahoo.ca that fixes bug 31834.3
14195
14196 2002-10-18  Miguel de Icaza  <miguel@ximian.com>
14197
14198         * driver.cs: Make the module extension .netmodule.
14199
14200 2002-10-16  Miguel de Icaza  <miguel@ximian.com>
14201
14202         * driver.cs: Report an error if the resource file is not found
14203         instead of crashing.
14204
14205         * ecore.cs (PropertyExpr.EmitAssign): Pass IsBase instead of
14206         false, like Emit does.
14207
14208 2002-10-16  Nick Drochak  <ndrochak@gol.com>
14209
14210         * typemanager.cs: Remove unused private member.  Also reported mcs
14211         bug to report this as a warning like csc.
14212
14213 2002-10-15  Martin Baulig  <martin@gnome.org>
14214
14215         * statement.cs (Statement.Emit): Made this a virtual method; emits
14216         the line number info and calls DoEmit().
14217         (Statement.DoEmit): New protected abstract method, formerly knows
14218         as Statement.Emit().
14219
14220         * codegen.cs (EmitContext.Mark): Check whether we have a symbol writer.
14221
14222 2002-10-11  Miguel de Icaza  <miguel@ximian.com>
14223
14224         * class.cs: Following the comment from 2002-09-26 to AddMethod, I
14225         have fixed a remaining problem: not every AddXXXX was adding a
14226         fully qualified name.  
14227
14228         Now everyone registers a fully qualified name in the DeclSpace as
14229         being defined instead of the partial name.  
14230
14231         Downsides: we are slower than we need to be due to the excess
14232         copies and the names being registered this way.  
14233
14234         The reason for this is that we currently depend (on the corlib
14235         bootstrap for instance) that types are fully qualified, because
14236         we dump all the types in the namespace, and we should really have
14237         types inserted into the proper namespace, so we can only store the
14238         basenames in the defined_names array.
14239
14240 2002-10-10  Martin Baulig  <martin@gnome.org>
14241
14242         * expression.cs (ArrayAccess.EmitStoreOpcode): Reverted the patch
14243         from bug #31834, see the bug report for a testcase which is
14244         miscompiled.
14245
14246 2002-10-10  Martin Baulig  <martin@gnome.org>
14247
14248         * codegen.cs (EmitContext.Breaks): Removed, we're now using the
14249         flow analysis code for this.
14250
14251         * statement.cs (Do, While, For): Tell the flow analysis code about
14252         infinite loops.
14253         (FlowBranching.UsageVector): Added support for infinite loops.
14254         (Block.Resolve): Moved the dead code elimination here and use flow
14255         analysis to do it.
14256
14257 2002-10-09  Miguel de Icaza  <miguel@ximian.com>
14258
14259         * class.cs (Field.Define): Catch cycles on struct type
14260         definitions. 
14261
14262         * typemanager.cs (IsUnmanagedtype): Do not recursively check
14263         fields if the fields are static.  We only need to check instance
14264         fields. 
14265
14266         * expression.cs (As.DoResolve): Test for reference type.
14267
14268         * statement.cs (Using.ResolveExpression): Use
14269         ConvertImplicitRequired, not ConvertImplicit which reports an
14270         error on failture
14271         (Using.ResolveLocalVariableDecls): ditto.
14272
14273         * expression.cs (Binary.ResolveOperator): Report errors in a few
14274         places where we had to.
14275
14276         * typemanager.cs (IsUnmanagedtype): Finish implementation.
14277
14278 2002-10-08  Miguel de Icaza  <miguel@ximian.com>
14279
14280         * expression.cs: Use StoreFromPtr instead of extracting the type
14281         and then trying to use Stelem.  Patch is from hwang_rob@yahoo.ca
14282
14283         * ecore.cs (ImplicitReferenceConversion): It is possible to assign
14284         an enumeration value to a System.Enum, but System.Enum is not a
14285         value type, but an class type, so we need to box.
14286
14287         (Expression.ConvertExplicit): One codepath could return
14288         errors but not flag them.  Fix this.  Fixes #31853
14289
14290         * parameter.cs (Resolve): Do not allow void as a parameter type.
14291
14292 2002-10-06  Martin Baulig  <martin@gnome.org>
14293
14294         * statemenc.cs (FlowBranching.SetParameterAssigned): Don't crash
14295         if it's a class type and not a struct.  Fixes #31815.
14296
14297 2002-10-06  Martin Baulig  <martin@gnome.org>
14298
14299         * statement.cs: Reworked the flow analysis code a bit to make it
14300         usable for dead code elimination.
14301
14302 2002-10-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14303
14304         * cs-parser.jay: allow empty source files. Fixes bug #31781.
14305
14306 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14307
14308         * expression.cs (ComposedCast.DoResolveType): A quick workaround
14309         to fix the test 165, will investigate deeper.
14310
14311 2002-10-04  Martin Baulig  <martin@gnome.org>
14312
14313         * statement.cs (FlowBranching.UsageVector.MergeChildren): Make
14314         finally blocks actually work.
14315         (Try.Resolve): We don't need to create a sibling for `finally' if
14316         there is no finally block.
14317
14318 2002-10-04  Martin Baulig  <martin@gnome.org>
14319
14320         * class.cs (Constructor.Define): The default accessibility for a
14321         non-default constructor is private, not public.
14322
14323 2002-10-04  Miguel de Icaza  <miguel@ximian.com>
14324
14325         * class.cs (Constructor): Make AllowedModifiers public, add
14326         EXTERN.
14327
14328         * cs-parser.jay: Perform the modifiers test here, as the
14329         constructor for the Constructor class usually receives a zero
14330         because of the way we create it (first we create, later we
14331         customize, and we were never checking the modifiers).
14332
14333         * typemanager.cs (Typemanager.LookupTypeDirect): This new function
14334         is a version of LookupTypeReflection that includes the type-name
14335         cache.  This can be used as a fast path for functions that know
14336         the fully qualified name and are only calling into *.GetType() to
14337         obtain a composed type.
14338
14339         This is also used by TypeManager.LookupType during its type
14340         composition.
14341
14342         (LookupType): We now also track the real type name, as sometimes
14343         we can get a quey for the real type name from things like
14344         ComposedCast.  This fixes bug 31422.
14345
14346         * expression.cs (ComposedCast.Resolve): Since we are obtaining a
14347         complete type fullname, it does not have to go through the type
14348         resolution system to obtain the composed version of the type (for
14349         obtaining arrays or pointers).
14350
14351         (Conditional.Emit): Use the EmitBoolExpression to
14352         generate nicer code, as requested by Paolo.
14353
14354         (ArrayCreation.CheckIndices): Use the patch from
14355         hwang_rob@yahoo.ca to validate the array initializers. 
14356
14357 2002-10-03  Miguel de Icaza  <miguel@ximian.com>
14358
14359         * class.cs (ConstructorInitializer.Emit): simplify code by using
14360         Invocation.EmitCall, and at the same time, fix the bugs in calling
14361         parent constructors that took variable arguments. 
14362
14363         * ecore.cs (Expression.ConvertNumericExplicit,
14364         Expression.ImplicitNumericConversion): Remove the code that
14365         manually wrapped decimal (InternalTypeConstructor call is now gone
14366         as well).
14367
14368         * expression.cs (Cast.TryReduce): Also handle decimal types when
14369         trying to perform a constant fold on the type.
14370
14371         * typemanager.cs (IsUnmanagedtype): Partially implemented.
14372
14373         * parameter.cs: Removed ResolveAndDefine, as it was not needed, as
14374         that only turned off an error report, and did nothing else. 
14375
14376 2002-10-02  Miguel de Icaza  <miguel@ximian.com>
14377
14378         * driver.cs: Handle and ignore /fullpaths
14379
14380 2002-10-01  Miguel de Icaza  <miguel@ximian.com>
14381
14382         * expression.cs (Binary.ResolveOperator): Catch the case where
14383         DoNumericPromotions returns true, 
14384
14385         (Binary.DoNumericPromotions): Simplify the code, and the tests.
14386
14387 2002-09-27  Miguel de Icaza  <miguel@ximian.com>
14388
14389         * ecore.cs (EventExpr.Emit): Instead of emitting an exception,
14390         report error 70.
14391
14392 2002-09-26  Miguel de Icaza  <miguel@ximian.com>
14393
14394         * ecore.cs (ConvertNumericExplicit): It is not enough that the
14395         conversion exists, but it is also required that the conversion be
14396         performed.  This manifested in "(Type64Enum) 2".  
14397
14398         * class.cs (TypeManager.AddMethod): The fix is not to change
14399         AddEnum, because that one was using a fully qualified name (every
14400         DeclSpace derivative does), but to change the AddMethod routine
14401         that was using an un-namespaced name.  This now correctly reports
14402         the duplicated name.
14403
14404         Revert patch until I can properly fix it.  The issue
14405         is that we have a shared Type space across all namespaces
14406         currently, which is wrong.
14407
14408         Options include making the Namespace a DeclSpace, and merge
14409         current_namespace/current_container in the parser.
14410
14411 2002-09-25  Miguel de Icaza  <miguel@ximian.com>
14412
14413         * cs-parser.jay: Improve error reporting when we get a different
14414         kind of expression in local_variable_type and
14415         local_variable_pointer_type. 
14416
14417         Propagate this to avoid missleading errors being reported.
14418
14419         * ecore.cs (ImplicitReferenceConversion): treat
14420         TypeManager.value_type as a target just like object_type.   As
14421         code like this:
14422
14423         ValueType v = 1;
14424
14425         Is valid, and needs to result in the int 1 being boxed before it
14426         is assigned to the value type v.
14427
14428         * class.cs (TypeContainer.AddEnum): Use the basename, not the name
14429         to validate the enumeration name.
14430
14431         * expression.cs (ArrayAccess.EmitAssign): Mimic the same test from
14432         EmitDynamicInitializers for the criteria to use Ldelema.  Thanks
14433         to hwang_rob@yahoo.ca for finding the bug and providing a patch.
14434
14435         * ecore.cs (TryImplicitIntConversion): When doing an
14436         implicit-enumeration-conversion, check if the type is 64-bits and
14437         perform a conversion before passing to EnumConstant.
14438
14439 2002-09-23  Miguel de Icaza  <miguel@ximian.com>
14440
14441         * decl.cs (Error_AmbiguousTypeReference); New routine used to
14442         report ambiguous type references.  Unlike the MS version, we
14443         report what the ambiguity is.   Innovation at work ;-)
14444
14445         (DeclSpace.FindType): Require a location argument to
14446         display when we display an ambiguous error.
14447
14448         * ecore.cs: (SimpleName.DoResolveType): Pass location to FindType.
14449
14450         * interface.cs (GetInterfaceTypeByName): Pass location to FindType.
14451
14452         * expression.cs (EmitDynamicInitializers): Apply patch from
14453         hwang_rob@yahoo.ca that fixes the order in which we emit our
14454         initializers. 
14455
14456 2002-09-21  Martin Baulig  <martin@gnome.org>
14457
14458         * delegate.cs (Delegate.VerifyApplicability): Make this work if the
14459         delegate takes no arguments.
14460
14461 2002-09-20  Miguel de Icaza  <miguel@ximian.com>
14462
14463         * constant.cs: Use Conv_U8 instead of Conv_I8 when loading longs
14464         from integers.
14465
14466         * expression.cs: Extract the underlying type.
14467
14468         * ecore.cs (StoreFromPtr): Use TypeManager.IsEnumType instad of IsEnum
14469
14470         * decl.cs (FindType): Sorry about this, fixed the type lookup bug.
14471
14472 2002-09-19  Miguel de Icaza  <miguel@ximian.com>
14473
14474         * class.cs (TypeContainer.DefineType): We can not use the nice
14475         PackingSize with the size set to 1 DefineType method, because it
14476         will not allow us to define the interfaces that the struct
14477         implements.
14478
14479         This completes the fixing of bug 27287
14480
14481         * ecore.cs (Expresion.ImplicitReferenceConversion): `class-type S'
14482         means also structs.  This fixes part of the problem. 
14483         (Expresion.ImplicitReferenceConversionExists): ditto.
14484
14485         * decl.cs (DeclSparce.ResolveType): Only report the type-not-found
14486         error if there were no errors reported during the type lookup
14487         process, to avoid duplicates or redundant errors.  Without this
14488         you would get an ambiguous errors plus a type not found.  We have
14489         beaten the user enough with the first error.  
14490
14491         (DeclSparce.FindType): Emit a warning if we have an ambiguous
14492         reference. 
14493
14494         * ecore.cs (SimpleName.DoResolveType): If an error is emitted
14495         during the resolution process, stop the lookup, this avoids
14496         repeated error reports (same error twice).
14497
14498         * rootcontext.cs: Emit a warning if we have an ambiguous reference.
14499
14500         * typemanager.cs (LookupType): Redo the type lookup code to match
14501         the needs of System.Reflection.  
14502
14503         The issue is that System.Reflection requires references to nested
14504         types to begin with a "+" sign instead of a dot.  So toplevel
14505         types look like: "NameSpace.TopLevelClass", and nested ones look
14506         like "Namespace.TopLevelClass+Nested", with arbitrary nesting
14507         levels. 
14508
14509 2002-09-19  Martin Baulig  <martin@gnome.org>
14510
14511         * codegen.cs (EmitContext.EmitTopBlock): If control flow analysis
14512         says that a method always returns or always throws an exception,
14513         don't report the CS0161.
14514
14515         * statement.cs (FlowBranching.UsageVector.MergeChildren): Always
14516         set `Returns = new_returns'.
14517
14518 2002-09-19  Martin Baulig  <martin@gnome.org>
14519
14520         * expression.cs (MemberAccess.ResolveMemberAccess): When resolving
14521         to an enum constant, check for a CS0176.
14522
14523 2002-09-18  Miguel de Icaza  <miguel@ximian.com>
14524
14525         * class.cs (TypeContainer.CheckPairedOperators): Now we check
14526         for operators that must be in pairs and report errors.
14527
14528         * ecore.cs (SimpleName.DoResolveType): During the initial type
14529         resolution process, when we define types recursively, we must
14530         check first for types in our current scope before we perform
14531         lookups in the enclosing scopes.
14532
14533         * expression.cs (MakeByteBlob): Handle Decimal blobs.
14534
14535         (Invocation.VerifyArgumentsCompat): Call
14536         TypeManager.TypeToCoreType on the parameter_type.GetElementType.
14537         I thought we were supposed to always call this, but there are a
14538         few places in the code where we dont do it.
14539
14540 2002-09-17  Miguel de Icaza  <miguel@ximian.com>
14541
14542         * driver.cs: Add support in -linkres and -resource to specify the
14543         name of the identifier.
14544
14545 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14546
14547         * ecore.cs (StandardConversionExists): Sync with the conversion
14548         code: allow anything-* to void* conversions.
14549
14550         (FindMostSpecificSource): Use an Expression argument
14551         instead of a Type, because we might be handed over a Literal which
14552         gets a few more implicit conversions that plain types do not.  So
14553         this information was being lost.
14554
14555         Also, we drop the temporary type-holder expression when not
14556         required.
14557
14558 2002-09-17  Martin Baulig  <martin@gnome.org>
14559
14560         * class.cs (PropertyBase.CheckBase): Don't check the base class if
14561         this is an explicit interface implementation.
14562
14563 2002-09-17  Martin Baulig  <martin@gnome.org>
14564
14565         * class.cs (PropertyBase.CheckBase): Make this work for indexers with
14566         different `IndexerName' attributes.
14567
14568         * expression.cs (BaseIndexerAccess): Rewrote this class to use IndexerAccess.
14569         (IndexerAccess): Added special protected ctor for BaseIndexerAccess and
14570         virtual CommonResolve().
14571
14572 2002-09-16  Miguel de Icaza  <miguel@ximian.com>
14573
14574         * enum.cs (LookupEnumValue): Use the EnumConstant declared type,
14575         and convert that to the UnderlyingType.
14576
14577         * statement.cs (Foreach.Resolve): Indexers are just like variables
14578         or PropertyAccesses.
14579
14580         * cs-tokenizer.cs (consume_string): Track line numbers and columns
14581         inside quoted strings, we were not doing this before.
14582
14583 2002-09-16  Martin Baulig  <martin@gnome.org>
14584
14585         * ecore.cs (MethodGroupExpr.DoResolve): If we have an instance expression,
14586         resolve it.  This is needed for the definite assignment check of the
14587         instance expression, fixes bug #29846.
14588         (PropertyExpr.DoResolve, EventExpr.DoResolve): Likewise.
14589
14590 2002-09-16  Nick Drochak  <ndrochak@gol.com>
14591
14592         * parameter.cs: Fix compile error.  Cannot reference static member
14593         from an instance object.  Is this an mcs bug?
14594
14595 2002-09-14  Martin Baulig  <martin@gnome.org>
14596
14597         * decl.cs (MemberCache.SetupCacheForInterface): Don't add an interface
14598         multiple times.  Fixes bug #30295, added test-166.cs.
14599
14600 2002-09-14  Martin Baulig  <martin@gnome.org>
14601
14602         * statement.cs (Block.Emit): Don't emit unreachable code.
14603         (Switch.SimpleSwitchEmit, Switch.TableSwitchEmit): Check for missing
14604         `break' statements.
14605         (Goto.Emit, Continue.Emit): Set ec.Breaks = true.
14606
14607 2002-09-14  Martin Baulig  <martin@gnome.org>
14608
14609         * parameter.cs (Parameter.Attributes): Make this work if Modifier.ISBYREF
14610         is set.
14611
14612 2002-09-14  Martin Baulig  <martin@gnome.org>
14613
14614         * typemanager.cs (TypeManager.IsNestedChildOf): This must return false
14615         if `type == parent' since in this case `type.IsSubclassOf (parent)' will
14616         be false on the ms runtime.
14617
14618 2002-09-13  Martin Baulig  <martin@gnome.org>
14619
14620         * ecore.cs (SimpleName.SimpleNameResolve): Include the member name in
14621         the CS0038 error message.
14622
14623 2002-09-12  Miguel de Icaza  <miguel@ximian.com>
14624
14625         * expression.cs (CheckedExpr, UnCheckedExpr): If we have a
14626         constant inside, return it.
14627
14628 2002-09-12  Martin Baulig  <martin@gnome.org>
14629
14630         * cfold.cs (ConstantFold.DoConstantNumericPromotions): Check whether an
14631         implicit conversion can be done between enum types.
14632
14633         * enum.cs (Enum.LookupEnumValue): If the value is an EnumConstant,
14634         check whether an implicit conversion to the current enum's UnderlyingType
14635         exists and report an error if not.
14636
14637         * codegen.cs (CodeGen.Init): Delete the symbol file when compiling
14638         without debugging support.
14639
14640         * delegate.cs (Delegate.CloseDelegate): Removed, use CloseType instead.
14641         Fixes bug #30235.  Thanks to Ricardo Fernández Pascual.
14642
14643 2002-09-12  Martin Baulig  <martin@gnome.org>
14644
14645         * typemanager.cs (TypeManager.IsNestedChildOf): New method.
14646
14647         * ecore.cs (IMemberExpr.DeclaringType): New property.
14648         (SimpleName.SimpleNameResolve): Check whether we're accessing a
14649         nonstatic member of an outer type (CS0038).
14650
14651 2002-09-11  Miguel de Icaza  <miguel@ximian.com>
14652
14653         * driver.cs: Activate the using-error detector at warning level
14654         4 (at least for MS-compatible APIs).
14655
14656         * namespace.cs (VerifyUsing): Small buglett fix.
14657
14658         * pending.cs (PendingImplementation): pass the container pointer. 
14659
14660         * interface.cs (GetMethods): Allow for recursive definition.  Long
14661         term, I would like to move every type to support recursive
14662         definitions, not the current ordering mechanism that we have right
14663         now.
14664
14665         The situation is this: Attributes are handled before interfaces,
14666         so we can apply attributes to interfaces.  But some attributes
14667         implement interfaces, we will now handle the simple cases
14668         (recursive definitions will just get an error).  
14669
14670         * parameter.cs: Only invalidate types at the end if we fail to
14671         lookup all types.  
14672
14673 2002-09-09  Martin Baulig  <martin@gnome.org>
14674
14675         * ecore.cs (PropertyExpr.Emit): Also check for
14676         TypeManager.system_int_array_get_length so this'll also work when
14677         compiling corlib.  Fixes #30003.
14678
14679 2002-09-09  Martin Baulig  <martin@gnome.org>
14680
14681         * expression.cs (ArrayCreation.MakeByteBlob): Added support for enums
14682         and throw an exception if we can't get the type's size.  Fixed #30040,
14683         added test-165.cs.
14684
14685 2002-09-09  Martin Baulig  <martin@gnome.org>
14686
14687         * ecore.cs (PropertyExpr.DoResolve): Added check for static properies.
14688
14689         * expression.cs (SizeOf.DoResolve): Sizeof is only allowed in unsafe
14690         context.  Fixes bug #30027.
14691
14692         * delegate.cs (NewDelegate.Emit): Use OpCodes.Ldvirtftn for
14693         virtual functions.  Fixes bug #30043, added test-164.cs.
14694
14695 2002-09-08  Ravi Pratap  <ravi@ximian.com>
14696
14697         * attribute.cs : Fix a small NullRef crash thanks to my stupidity.
14698
14699 2002-09-08  Nick Drochak  <ndrochak@gol.com>
14700
14701         * driver.cs: Use an object to get the windows codepage since it's not a
14702         static property.
14703
14704 2002-09-08  Miguel de Icaza  <miguel@ximian.com>
14705
14706         * statement.cs (For.Emit): for infinite loops (test == null)
14707         return whether there is a break inside, not always "true".
14708
14709         * namespace.cs (UsingEntry): New struct to hold the name of the
14710         using definition, the location where it is defined, and whether it
14711         has been used in a successful type lookup.
14712
14713         * rootcontext.cs (NamespaceLookup): Use UsingEntries instead of
14714         strings.
14715
14716         * decl.cs: ditto.
14717
14718 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14719
14720         * attribute.cs : Fix incorrect code which relied on catching
14721         a NullReferenceException to detect a null being passed in
14722         where an object was expected.
14723
14724 2002-09-06  Miguel de Icaza  <miguel@ximian.com>
14725
14726         * statement.cs (Try): flag the catch variable as assigned
14727
14728         * expression.cs (Cast): Simplified by using ResolveType instead of
14729         manually resolving.
14730
14731         * statement.cs (Catch): Fix bug by using ResolveType.
14732
14733 2002-09-06  Ravi Pratap  <ravi@ximian.com>
14734
14735         * expression.cs (BetterConversion): Special case for when we have
14736         a NullLiteral as the argument and we have to choose between string
14737         and object types - we choose string the way csc does.
14738
14739         * attribute.cs (Attribute.Resolve): Catch the
14740         NullReferenceException and report error #182 since the Mono
14741         runtime no more has the bug and having this exception raised means
14742         we tried to select a constructor which takes an object and is
14743         passed a null.
14744
14745 2002-09-05  Ravi Pratap  <ravi@ximian.com>
14746
14747         * expression.cs (Invocation.OverloadResolve): Flag a nicer error
14748         message (1502, 1503) when we can't locate a method after overload
14749         resolution. This is much more informative and closes the bug
14750         Miguel reported.
14751
14752         * interface.cs (PopulateMethod): Return if there are no argument
14753         types. Fixes a NullReferenceException bug.
14754
14755         * attribute.cs (Attribute.Resolve): Ensure we allow TypeOf
14756         expressions too. Previously we were checking only in one place for
14757         positional arguments leaving out named arguments.
14758
14759         * ecore.cs (ImplicitNumericConversion): Conversion from underlying
14760         type to the enum type is not allowed. Remove code corresponding to
14761         that.
14762
14763         (ConvertNumericExplicit): Allow explicit conversions from
14764         the underlying type to enum type. This precisely follows the spec
14765         and closes a bug filed by Gonzalo.
14766
14767 2002-09-04  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14768
14769         * compiler.csproj:
14770         * compiler.csproj.user: patch from Adam Chester (achester@bigpond.com).
14771
14772 2002-09-03  Miguel de Icaza  <miguel@ximian.com>
14773
14774         * statement.cs (SwitchLabel.ResolveAndReduce): In the string case,
14775         it was important that we stored the right value after the
14776         reduction in `converted'.
14777
14778 2002-09-04  Martin Baulig  <martin@gnome.org>
14779
14780         * location.cs (Location.SymbolDocument): Use full pathnames for the
14781         source files.
14782
14783 2002-08-30  Miguel de Icaza  <miguel@ximian.com>
14784
14785         * expression.cs (ComposedCast): Use DeclSparce.ResolveType instead
14786         of the expression resolve mechanism, because that will catch the
14787         SimpleName error failures.
14788
14789         (Conditional): If we can not resolve the
14790         expression, return, do not crash.
14791
14792 2002-08-29  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14793
14794         * cs-tokenizer.cs:
14795         (location): display token name instead of its number.
14796
14797 2002-08-28  Martin Baulig  <martin@gnome.org>
14798
14799         * expression.cs (Binary.ResolveOperator): Don't silently return
14800         but return an error if an operator cannot be applied between two
14801         enum types.
14802
14803 2002-08-28  Martin Baulig  <martin@gnome.org>
14804
14805         * class.cs (Constructor.Define): Set the permission attributes
14806         correctly instead of making all constructors public.
14807
14808 2002-08-28  Martin Baulig  <martin@gnome.org>
14809
14810         * ecore.cs (Expression.DoResolve): Do a TypeManager.MemberLook
14811         for private members before reporting a CS0103; if we find anything,
14812         it's a CS0122.
14813
14814 2002-08-28  Martin Baulig  <martin@gnome.org>
14815
14816         * typemanager.cs (TypeManager.FilterWithClosure): It's not enough
14817         to check whether `closure_start_type == closure_invocation_type',
14818         we also need to check whether `m.DeclaringType == closure_invocation_type'
14819         before bypassing the permission checks.  We might be accessing
14820         protected/private members from the base class.
14821         (TypeManager.RealMemberLookup): Only set private_ok if private
14822         members were requested via BindingFlags.NonPublic.
14823
14824         * ecore.cs (MethodGroupExpr.IsExplicitImpl): New property.
14825
14826         * expression.cs (MemberAccess.ResolveMemberAccess): Set
14827         MethodGroupExpr.IsExplicitImpl if appropriate.
14828         (Invocation.DoResolve): Don't report the CS0120 for explicit
14829         interface implementations.
14830
14831 2002-08-27  Martin Baulig  <martin@gnome.org>
14832
14833         * expression.cs (Invocation.DoResolve): If this is a static
14834         method and we don't have an InstanceExpression, we must report
14835         a CS0120.
14836
14837 2002-08-25  Martin Baulig  <martin@gnome.org>
14838
14839         * expression.cs (Binary.ResolveOperator): Don't allow `!=' and
14840         `==' between a valuetype and an object.
14841
14842 2002-08-25  Miguel de Icaza  <miguel@ximian.com>
14843
14844         * ecore.cs (TypeExpr): Provide a ToString method.
14845
14846 2002-08-24  Martin Baulig  <martin@gnome.org>
14847
14848         * codegen.cs (CodeGen.InitMonoSymbolWriter): The symbol file is
14849         now called proggie.dbg and it's a binary file.
14850
14851 2002-08-23  Martin Baulig  <martin@gnome.org>
14852
14853         * decl.cs (MemberCache.AddMethods): Ignore varargs methods.
14854
14855 2002-08-23  Martin Baulig  <martin@gnome.org>
14856
14857         * struct.cs (MyStructInfo.ctor): Make this work with empty
14858         structs; it's not allowed to use foreach() on null.
14859
14860 2002-08-23  Martin Baulig  <martin@gnome.org>
14861
14862         * codegen.cs (CodeGen.InitMonoSymbolWriter): Tell the symbol
14863         writer the full pathname of the generated assembly.
14864
14865 2002-08-23  Martin Baulig  <martin@gnome.org>
14866
14867         * statements.cs (FlowBranching.UsageVector.MergeChildren):
14868         A `finally' block never returns or breaks; improved handling of
14869         unreachable code.
14870
14871 2002-08-23  Martin Baulig  <martin@gnome.org>
14872
14873         * statement.cs (Throw.Resolve): Allow `throw null'.
14874
14875 2002-08-23  Martin Baulig  <martin@gnome.org>
14876
14877         * expression.cs (MemberAccess.ResolveMemberAccess): If this is an
14878         EventExpr, don't do a DeclaredOnly MemberLookup, but check whether
14879         `ee.EventInfo.DeclaringType == ec.ContainerType'.  The
14880         MemberLookup would return a wrong event if this is an explicit
14881         interface implementation and the class has an event with the same
14882         name.
14883
14884 2002-08-23  Martin Baulig  <martin@gnome.org>
14885
14886         * statement.cs (Block.AddChildVariableNames): New public method.
14887         (Block.AddChildVariableName): Likewise.
14888         (Block.IsVariableNameUsedInChildBlock): Likewise.
14889         (Block.AddVariable): Check whether a variable name has already
14890         been used in a child block.
14891
14892         * cs-parser.jay (declare_local_variables): Mark all variable names
14893         from the current block as being used in a child block in the
14894         implicit block.
14895
14896 2002-08-23  Martin Baulig  <martin@gnome.org>
14897
14898         * codegen.cs (CodeGen.InitializeSymbolWriter): Abort if we can't
14899         find the symbol writer.
14900
14901         * driver.cs: csc also allows the arguments to /define being
14902         separated by commas, not only by semicolons.
14903
14904 2002-08-23  Martin Baulig  <martin@gnome.org>
14905
14906         * interface.cs (Interface.GetMembers): Added static check for events.
14907
14908 2002-08-15  Martin Baulig  <martin@gnome.org>
14909
14910         * class.cs (MethodData.EmitDestructor): In the Expression.MemberLookup
14911         call, use ec.ContainerType.BaseType as queried_type and invocation_type.
14912
14913         * ecore.cs (Expression.MemberLookup): Added documentation and explained
14914         why the MethodData.EmitDestructor() change was necessary.
14915
14916 2002-08-20  Martin Baulig  <martin@gnome.org>
14917
14918         * class.cs (TypeContainer.FindMembers): Added static check for events.
14919
14920         * decl.cs (MemberCache.AddMembers): Handle events like normal members.
14921
14922         * typemanager.cs (TypeHandle.GetMembers): When queried for events only,
14923         use Type.GetEvents(), not Type.FindMembers().
14924
14925 2002-08-20  Martin Baulig  <martin@gnome.org>
14926
14927         * decl.cs (MemberCache): Added a special method cache which will
14928         be used for method-only searched.  This ensures that a method
14929         search will return a MethodInfo with the correct ReflectedType for
14930         inherited methods.      
14931
14932 2002-08-20  Martin Baulig  <martin@gnome.org>
14933
14934         * decl.cs (DeclSpace.FindMembers): Made this public.
14935
14936 2002-08-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
14937
14938         * delegate.cs: fixed build on windows.
14939         [FIXME:  Filed as bug #29150: MCS must report these errors.]
14940
14941 2002-08-19  Ravi Pratap  <ravi@ximian.com>
14942
14943         * ecore.cs (StandardConversionExists): Return a false
14944         if we are trying to convert the void type to anything else
14945         since that is not allowed.
14946
14947         * delegate.cs (DelegateInvocation.DoResolve): Ensure that
14948         we flag error 70 in the event an event is trying to be accessed
14949         directly from outside the declaring type.
14950
14951 2002-08-20  Martin Baulig  <martin@gnome.org>
14952
14953         * typemanager.cs, decl.cs: Moved MemberList, IMemberContainer and
14954         MemberCache from typemanager.cs to decl.cs.
14955
14956 2002-08-19  Martin Baulig  <martin@gnome.org>
14957
14958         * class.cs (TypeContainer): Implement IMemberContainer.
14959         (TypeContainer.DefineMembers): Create the MemberCache.
14960         (TypeContainer.FindMembers): Do better BindingFlags checking; only
14961         return public members if BindingFlags.Public was given, check
14962         whether members are static.
14963
14964 2002-08-16  Martin Baulig  <martin@gnome.org>
14965
14966         * decl.cs (DeclSpace.Define): Splitted this in Define and
14967         DefineMembers.  DefineMembers is called first and initializes the
14968         MemberCache.
14969
14970         * rootcontext.cs (RootContext.DefineMembers): New function.  Calls
14971         DefineMembers() on all our DeclSpaces.
14972
14973         * class.cs (TypeContainer.Define): Moved all code to DefineMembers(),
14974         but call DefineMembers() on all nested interfaces.  We call their
14975         Define() in our new Define() function.
14976
14977         * interface.cs (Interface): Implement IMemberContainer.
14978         (Interface.Define): Moved all code except the attribute stuf to
14979         DefineMembers().
14980         (Interface.DefineMembers): Initialize the member cache.
14981
14982         * typemanager.cs (IMemberFinder): Removed this interface, we don't
14983         need this anymore since we can use MemberCache.FindMembers directly.
14984
14985 2002-08-19  Martin Baulig  <martin@gnome.org>
14986
14987         * typemanager.cs (MemberCache): When creating the cache for an
14988         interface type, add all inherited members.
14989         (TypeManager.MemberLookup_FindMembers): Changed `ref bool searching'
14990         to `out bool used_cache' and documented it.
14991         (TypeManager.MemberLookup): If we already used the cache in the first
14992         iteration, we don't need to do the interfaces check.
14993
14994 2002-08-19  Martin Baulig  <martin@gnome.org>
14995
14996         * decl.cs (DeclSpace.FindMembers): New abstract method.  Moved this
14997         here from IMemberFinder and don't implement this interface anymore.
14998         (DeclSpace.MemberCache): Moved here from IMemberFinder.
14999
15000         * typemanager.cs (IMemberFinder): This interface is now only used by
15001         classes which actually support the member cache.
15002         (TypeManager.builder_to_member_finder): Renamed to builder_to_declspace
15003         since we only put DeclSpaces into this Hashtable.
15004         (MemberLookup_FindMembers): Use `builder_to_declspace' if the type is
15005         a dynamic type and TypeHandle.GetTypeHandle() otherwise.
15006
15007 2002-08-16  Martin Baulig  <martin@gnome.org>
15008
15009         * typemanager.cs (ICachingMemberFinder): Removed.
15010         (IMemberFinder.MemberCache): New property.
15011         (TypeManager.FindMembers): Merged this with RealFindMembers().
15012         This function will never be called from TypeManager.MemberLookup()
15013         so we can't use the cache here, just the IMemberFinder.
15014         (TypeManager.MemberLookup_FindMembers): Check whether the
15015         IMemberFinder has a MemberCache and call the cache's FindMembers
15016         function.
15017         (MemberCache): Rewrote larger parts of this yet another time and
15018         cleaned it up a bit.
15019
15020 2002-08-15  Miguel de Icaza  <miguel@ximian.com>
15021
15022         * driver.cs (LoadArgs): Support quoting.
15023
15024         (Usage): Show the CSC-like command line arguments.
15025
15026         Improved a few error messages.
15027
15028 2002-08-15  Martin Baulig  <martin@gnome.org>
15029
15030         * typemanager.cs (IMemberContainer.Type): New property.
15031         (IMemberContainer.IsInterface): New property.
15032
15033         The following changes are conditional to BROKEN_RUNTIME, which is
15034         defined at the top of the file.
15035
15036         * typemanager.cs (MemberCache.MemberCache): Don't add the base
15037         class'es members, but add all members from TypeHandle.ObjectType
15038         if we're an interface.
15039         (MemberCache.AddMembers): Set the Declared flag if member.DeclaringType
15040         is the current type.
15041         (MemberCache.CacheEntry.Container): Removed this field.
15042         (TypeHandle.GetMembers): Include inherited members.
15043
15044 2002-08-14  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15045
15046         * typemanager.cs: fixed compilation and added a comment on a field that
15047         is never used.
15048
15049 2002-08-15  Martin Baulig  <martin@gnome.org>
15050
15051         * class.cs (ConstructorInitializer.Resolve): In the
15052         Expression.MemberLookup call, use the queried_type as
15053         invocation_type.
15054
15055         * typemanager.cs (IMemberContainer.GetMembers): Removed the `bool
15056         declared' attribute, it's always true.
15057         (IMemberContainer.Parent, IMemberContainer.Name): New properties.
15058         (TypeManager.MemberLookup_FindMembers): [FIXME FIXME FIXME] Added
15059         temporary wrapper for FindMembers which tells MemberLookup whether
15060         members from the base classes are included in the return value.
15061         This will go away soon.
15062         (TypeManager.MemberLookup): Use this temporary hack here; once the
15063         new MemberCache is completed, we don't need to do the DeclaredOnly
15064         looping here anymore since the MemberCache will take care of this.
15065         (TypeManager.IsSubclassOrNestedChildOf): Allow `type == parent'.
15066         (MemberCache): When creating the MemberCache for a class, get
15067         members from the current class and all its base classes.
15068         (MemberCache.CacheEntry.Container): New field.  This is a
15069         temporary hack until the Mono runtime is fixed to distinguish
15070         between ReflectedType and DeclaringType.  It allows us to use MCS
15071         with both the MS runtime and the unfixed Mono runtime without
15072         problems and without accecting performance.
15073         (MemberCache.SearchMembers): The DeclaredOnly looping from
15074         TypeManager.MemberLookup is now done here.      
15075
15076 2002-08-14  Martin Baulig  <martin@gnome.org>
15077
15078         * statement.cs (MyStructInfo.MyStructInfo): Don't call
15079         Type.GetFields on dynamic types but get the fields from the
15080         corresponding TypeContainer.
15081         (MyStructInfo.GetStructInfo): Added check for enum types.
15082
15083         * typemanager.cs (MemberList.IsSynchronized): Implemented.
15084         (MemberList.SyncRoot): Implemented.
15085         (TypeManager.FilterWithClosure): No need to check permissions if
15086         closure_start_type == closure_invocation_type, don't crash if
15087         closure_invocation_type is null.
15088
15089 2002-08-13  Martin Baulig  <martin@gnome.org>
15090
15091         Rewrote TypeContainer.FindMembers to use a member cache.  This
15092         gives us a speed increase of about 35% for the self-hosting MCS
15093         build and of about 15-20% for the class libs (both on GNU/Linux).
15094
15095         * report.cs (Timer): New class to get enhanced profiling.  This
15096         whole class is "TIMER" conditional since it remarkably slows down
15097         compilation speed.
15098
15099         * class.cs (MemberList): New class.  This is an IList wrapper
15100         which we're now using instead of passing MemberInfo[]'s around to
15101         avoid copying this array unnecessarily.
15102         (IMemberFinder.FindMember): Return a MemberList, not a MemberInfo [].
15103         (ICachingMemberFinder, IMemberContainer): New interface.
15104         (TypeManager.FilterWithClosure): If `criteria' is null, the name
15105         has already been checked, otherwise use it for the name comparision.
15106         (TypeManager.FindMembers): Renamed to RealMemberFinder and
15107         provided wrapper which tries to use ICachingMemberFinder.FindMembers
15108         if possible.  Returns a MemberList, not a MemberInfo [].
15109         (TypeHandle): New class, implements IMemberContainer.  We create
15110         one instance of this class per type, it contains a MemberCache
15111         which is used to do the member lookups.
15112         (MemberCache): New class.  Each instance of this class contains
15113         all members of a type and a name-based hash table.
15114         (MemberCache.FindMembers): This is our new member lookup
15115         function.  First, it looks up all members of the requested name in
15116         the hash table.  Then, it walks this list and sorts out all
15117         applicable members and returns them.
15118
15119 2002-08-13  Martin Baulig  <martin@gnome.org>
15120
15121         In addition to a nice code cleanup, this gives us a performance
15122         increase of about 1.4% on GNU/Linux - not much, but it's already
15123         half a second for the self-hosting MCS compilation.
15124
15125         * typemanager.cs (IMemberFinder): New interface.  It is used by
15126         TypeManager.FindMembers to call FindMembers on a TypeContainer,
15127         Enum, Delegate or Interface.
15128         (TypeManager.finder_to_member_finder): New PtrHashtable.
15129         (TypeManager.finder_to_container): Removed.
15130         (TypeManager.finder_to_delegate): Removed.
15131         (TypeManager.finder_to_interface): Removed.
15132         (TypeManager.finder_to_enum): Removed.
15133
15134         * interface.cs (Interface): Implement IMemberFinder.
15135
15136         * delegate.cs (Delegate): Implement IMemberFinder.
15137
15138         * enum.cs (Enum): Implement IMemberFinder.
15139
15140         * class.cs (TypeContainer): Implement IMemberFinder.
15141
15142 2002-08-12  Martin Baulig  <martin@gnome.org>
15143
15144         * ecore.cs (TypeExpr.DoResolveType): Mark this as virtual.
15145
15146 2002-08-12  Martin Baulig  <martin@gnome.org>
15147
15148         * ecore.cs (ITypeExpression): New interface for expressions which
15149         resolve to a type.
15150         (TypeExpression): Renamed to TypeLookupExpression.
15151         (Expression.DoResolve): If we're doing a types-only lookup, the
15152         expression must implement the ITypeExpression interface and we
15153         call DoResolveType() on it.
15154         (SimpleName): Implement the new ITypeExpression interface.
15155         (SimpleName.SimpleNameResolve): Removed the ec.OnlyLookupTypes
15156         hack, the situation that we're only looking up types can't happen
15157         anymore when this method is called.  Moved the type lookup code to
15158         DoResolveType() and call it.
15159         (SimpleName.DoResolveType): This ITypeExpression interface method
15160         is now doing the types-only lookup.
15161         (TypeExpr, TypeLookupExpression): Implement ITypeExpression.
15162         (ResolveFlags): Added MaskExprClass.
15163
15164         * expression.cs (MemberAccess): Implement the ITypeExpression
15165         interface.
15166         (MemberAccess.DoResolve): Added support for a types-only lookup
15167         when we're called via ITypeExpression.DoResolveType().
15168         (ComposedCast): Implement the ITypeExpression interface.
15169
15170         * codegen.cs (EmitContext.OnlyLookupTypes): Removed.  Call
15171         Expression.Resolve() with ResolveFlags.Type instead.
15172
15173 2002-08-12  Martin Baulig  <martin@gnome.org>
15174
15175         * interface.cs (Interface.Define): Apply attributes.
15176
15177         * attribute.cs (Attribute.ApplyAttributes): Added support for
15178         interface attributes.
15179
15180 2002-08-11  Martin Baulig  <martin@gnome.org>
15181
15182         * statement.cs (Block.Emit): Only check the "this" variable if we
15183         do not always throw an exception.
15184
15185         * ecore.cs (PropertyExpr.DoResolveLValue): Implemented, check
15186         whether the property has a set accessor.
15187
15188 2002-08-11  Martin Baulig  <martin@gnome.org>
15189
15190         Added control flow analysis support for structs.
15191
15192         * ecore.cs (ResolveFlags): Added `DisableFlowAnalysis' to resolve
15193         with control flow analysis turned off.
15194         (IVariable): New interface.
15195         (SimpleName.SimpleNameResolve): If MemberAccess.ResolveMemberAccess
15196         returns an IMemberExpr, call DoResolve/DoResolveLValue on it.
15197         (FieldExpr.DoResolve): Resolve the instance expression with flow
15198         analysis turned off and do the definite assignment check after the
15199         resolving when we know what the expression will resolve to.
15200
15201         * expression.cs (LocalVariableReference, ParameterReference):
15202         Implement the new IVariable interface, only call the flow analysis
15203         code if ec.DoFlowAnalysis is true.
15204         (This): Added constructor which takes a Block argument.  Implement
15205         the new IVariable interface.
15206         (MemberAccess.DoResolve, MemberAccess.DoResolveLValue): Call
15207         DoResolve/DoResolveLValue on the result of ResolveMemberLookup().
15208         This does the definite assignment checks for struct members.
15209
15210         * class.cs (Constructor.Emit): If this is a non-static `struct'
15211         constructor which doesn't have any initializer, call
15212         Block.AddThisVariable() to tell the flow analysis code that all
15213         struct elements must be initialized before control returns from
15214         the constructor.
15215
15216         * statement.cs (MyStructInfo): New public class.
15217         (UsageVector.this [VariableInfo vi]): Added `int field_idx'
15218         argument to this indexer.  If non-zero, check an individual struct
15219         member, not the whole struct.
15220         (FlowBranching.CheckOutParameters): Check struct members.
15221         (FlowBranching.IsVariableAssigned, SetVariableAssigned): Added
15222         overloaded versions of these methods which take an additional
15223         `int field_idx' argument to check struct members.
15224         (FlowBranching.IsParameterAssigned, SetParameterAssigned): Added
15225         overloaded versions of these methods which take an additional
15226         `string field_name' argument to check struct member.s
15227         (VariableInfo): Implement the IVariable interface.
15228         (VariableInfo.StructInfo): New public property.  Returns the
15229         MyStructInfo instance of the variable if it's a struct or null.
15230         (Block.AddThisVariable): New public method.  This is called from
15231         Constructor.Emit() for non-static `struct' constructor which do
15232         not have any initializer.  It creates a special variable for the
15233         "this" instance variable which will be checked by the flow
15234         analysis code to ensure that all of the struct's fields are
15235         initialized before control returns from the constructor.
15236         (UsageVector): Added support for struct members.  If a
15237         variable/parameter is a struct with N members, we reserve a slot
15238         in the usage vector for each member.  A struct is considered fully
15239         initialized if either the struct itself (slot 0) or all its
15240         members are initialized.
15241
15242 2002-08-08  Martin Baulig  <martin@gnome.org>
15243
15244         * driver.cs (Driver.MainDriver): Only report an error CS5001
15245         if there were no compilation errors.
15246
15247         * codegen.cs (EmitContext.EmitContext): Use the DeclSpace's
15248         `UnsafeContext' property to determine whether the parent is in
15249         unsafe context rather than checking the parent's ModFlags:
15250         classes nested in an unsafe class are unsafe as well.
15251
15252 2002-08-08  Martin Baulig  <martin@gnome.org>
15253
15254         * statement.cs (UsageVector.MergeChildren): Distinguish between
15255         `Breaks' and `Returns' everywhere, don't set `Breaks' anymore if
15256         we return.  Added test17() and test18() to test-154.cs.
15257
15258 2002-08-08  Martin Baulig  <martin@gnome.org>
15259
15260         * typemanager.cs (TypeManager.FilterWithClosure): If we have
15261         Family access, make sure the invoking type isn't a subclass of the
15262         queried type (that'd be a CS1540).
15263
15264         * ecore.cs (Expression.MemberLookup): Added overloaded version of
15265         this method which takes an additional `Type invocation_type'.
15266
15267         * expression.cs (BaseAccess.DoResolve): Use the base type as
15268         invocation and query type.
15269         (MemberAccess.DoResolve): If the lookup failed and we're about to
15270         report a CS0122, try a lookup with the ec.ContainerType - if this
15271         succeeds, we must report a CS1540.
15272
15273 2002-08-08  Martin Baulig  <martin@gnome.org>
15274
15275         * ecore.cs (IMemberExpr): Added `bool IsInstance' property.
15276         (MethodGroupExpr): Implement the IMemberExpr interface.
15277
15278         * expression (MemberAccess.ResolveMemberAccess): No need to have
15279         any special code for MethodGroupExprs anymore, they're now
15280         IMemberExprs.   
15281
15282 2002-08-08  Martin Baulig  <martin@gnome.org>
15283
15284         * typemanager.cs (TypeManager.FilterWithClosure): Check Assembly,
15285         Family, FamANDAssem and FamORAssem permissions.
15286         (TypeManager.IsSubclassOrNestedChildOf): New public method.
15287
15288 2002-08-08  Martin Baulig  <martin@gnome.org>
15289
15290         * statement.cs (FlowBranchingType): Added LOOP_BLOCK.
15291         (UsageVector.MergeChildren): `break' breaks unless we're in a switch
15292         or loop block.
15293
15294 Thu Aug 8 10:28:07 CEST 2002 Paolo Molaro <lupus@ximian.com>
15295
15296         * driver.cs: implemented /resource option to embed managed resources.
15297
15298 2002-08-07  Martin Baulig  <martin@gnome.org>
15299
15300         * class.cs (FieldBase.Initializer): Renamed to `init' and made private.
15301         (FieldBase.HasFieldInitializer): New public property.
15302         (FieldBase.GetInitializerExpression): New public method.  Resolves and
15303         returns the field initializer and makes sure it is only resolved once.
15304         (TypeContainer.EmitFieldInitializers): Call
15305         FieldBase.GetInitializerExpression to get the initializer, this ensures
15306         that it isn't resolved multiple times.
15307
15308         * codegen.cs (EmitContext): Added `bool IsFieldInitialier'.  This tells
15309         the resolving process (SimpleName/MemberLookup) that we're currently
15310         emitting a field initializer (which must not access any instance members,
15311         this is an error CS0236).
15312
15313         * ecore.cs (SimpleName.Error_ObjectRefRequired): Added EmitContext
15314         argument, if the `IsFieldInitializer' flag is set, we must report and
15315         error CS0236 and not an error CS0120.   
15316
15317 2002-08-07  Martin Baulig  <martin@gnome.org>
15318
15319         * ecore.cs (IMemberExpr): New public interface.
15320         (FieldExpr, PropertyExpr, EventExpr): Implement IMemberExpr.
15321         (SimpleName.SimpleNameResolve): Call MemberAccess.ResolveMemberAccess
15322         if the expression is an IMemberExpr.
15323
15324         * expression.cs (MemberAccess.ResolveMemberAccess): Allow `left'
15325         to be null, implicitly default to `this' if we're non-static in
15326         this case.  Simplified the code a lot by using the new IMemberExpr
15327         interface.  Also fixed bug #28176 here.
15328
15329 2002-08-06  Martin Baulig  <martin@gnome.org>
15330
15331         * cs-parser.jay (SimpleLookup): Removed.  We need to create
15332         ParameterReferences during semantic analysis so that we can do a
15333         type-only search when resolving Cast, TypeOf and SizeOf.
15334         (block): Pass the `current_local_parameters' to the Block's
15335         constructor.
15336
15337         * class.cs (ConstructorInitializer): Added `Parameters parameters'
15338         argument to the constructor.
15339         (ConstructorInitializer.Resolve): Create a temporary implicit
15340         block with the parameters.
15341
15342         * ecore.cs (SimpleName.SimpleNameResolve): Resolve parameter
15343         references here if we aren't doing a type-only search.
15344
15345         * statement.cs (Block): Added constructor which takes a
15346         `Parameters parameters' argument.
15347         (Block.Parameters): New public property.
15348
15349         * support.cs (InternalParameters.Parameters): Renamed `parameters'
15350         to `Parameters' and made it public readonly.
15351
15352 2002-08-06  Martin Baulig  <martin@gnome.org>
15353
15354         * ecore.cs (Expression.Warning): Made this public as well.
15355
15356         * report.cs (Report.Debug): Print the contents of collections.
15357
15358 2002-08-06  Martin Baulig  <martin@gnome.org>
15359
15360         * ecore.cs (Expression.ResolveFlags): New [Flags] enum.  This is
15361         used to tell Resolve() which kinds of expressions it may return.
15362         (Expression.Resolve): Added overloaded version of this method which
15363         takes a `ResolveFlags flags' argument.  This can be used to tell
15364         Resolve() which kinds of expressions it may return.  Reports a
15365         CS0118 on error.
15366         (Expression.ResolveWithSimpleName): Removed, use Resolve() with
15367         ResolveFlags.SimpleName.
15368         (Expression.Error118): Added overloaded version of this method which
15369         takes a `ResolveFlags flags' argument.  It uses the flags to determine
15370         which kinds of expressions are allowed.
15371
15372         * expression.cs (Argument.ResolveMethodGroup): New public method.
15373         Resolves an argument, but allows a MethodGroup to be returned.
15374         This is used when invoking a delegate.
15375
15376         * TODO: Updated a bit.
15377
15378 2002-08-06  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15379
15380         Fixed compilation with csc.
15381
15382         * ecore.cs: Expression.Error made public. Is this correct? Should
15383         Warning be made public too?
15384
15385         * expression.cs: use ea.Location instead of ea.loc.
15386         [FIXME:  Filed as bug #28607: MCS must report these errors.]
15387
15388 2002-08-06  Martin Baulig  <martin@gnome.org>
15389
15390         * ecore.cs (Expression.loc): Moved the location here instead of
15391         duplicating it in all derived classes.
15392         (Expression.Location): New public property.
15393         (Expression.Error, Expression.Warning): Made them non-static and
15394         removed the location argument.
15395         (Expression.Warning): Added overloaded version which takes an
15396         `int level' argument.
15397         (Expression.Error118): Make this non-static and removed the
15398         expression and location arguments.
15399         (TypeExpr): Added location argument to the constructor.
15400
15401         * expression.cs (StaticCallExpr): Added location argument to
15402         the constructor.
15403         (Indirection, PointerArithmetic): Likewise.
15404         (CheckedExpr, UnCheckedExpr): Likewise.
15405         (ArrayAccess, IndexerAccess, UserCast, ArrayPtr): Likewise.
15406         (StringPtr): Likewise.
15407
15408
15409 2002-08-05  Martin Baulig  <martin@gnome.org>
15410
15411         * expression.cs (BaseAccess.DoResolve): Actually report errors.
15412
15413         * assign.cs (Assign.DoResolve): Check whether the source
15414         expression is a value or variable.
15415
15416         * statement.cs (Try.Resolve): Set ec.InTry/InCatch/InFinally
15417         while resolving the corresponding blocks.
15418
15419         * interface.cs (Interface.GetInterfaceTypeByName): Actually report
15420         an error, don't silently return null.
15421
15422         * statement.cs (Block.AddVariable): Do the error reporting here
15423         and distinguish between CS0128 and CS0136.
15424         (Block.DoResolve): Report all unused labels (warning CS0164).
15425         (LabeledStatement): Pass the location to the constructor.
15426         (LabeledStatement.HasBeenReferenced): New property.
15427         (LabeledStatement.Resolve): Set it to true here.
15428
15429         * statement.cs (Return.Emit): Return success even after reporting
15430         a type mismatch error (CS0126 or CS0127), this is what csc does and
15431         it avoids confusing the users with any consecutive errors.
15432
15433 2002-08-05  Martin Baulig  <martin@gnome.org>
15434
15435         * enum.cs (Enum.LookupEnumValue): Catch circular definitions.
15436
15437         * const.cs (Const.LookupConstantValue): Catch circular definitions.
15438
15439         * expression.cs (MemberAccess.DoResolve): Silently return if an
15440         error has already been reported.
15441
15442         * ecore.cs (Expression.MemberLookupFinal): Silently return if an
15443         error has already been reported.
15444
15445 2002-08-05  Martin Baulig  <martin@gnome.org>
15446
15447         * statement.cs (UsageVector): Only initialize the `parameters'
15448         vector if we actually have any "out" parameters.
15449
15450 2002-08-05  Martin Baulig  <martin@gnome.org>
15451
15452         * expression.cs (Binary.ResolveOperator): When combining delegates,
15453         they must have the same type.
15454
15455 2002-08-05  Martin Baulig  <martin@gnome.org>
15456
15457         * typemanager.cs (TypeManager.GetArgumentTypes): Don't call
15458         PropertyInfo.GetIndexParameters() on dynamic types, this doesn't
15459         work with the ms runtime and we also don't need it: if we're a
15460         PropertyBuilder and not in the `indexer_arguments' hash, then we
15461         are a property and not an indexer.
15462
15463         * class.cs (TypeContainer.AsAccessible): Use Type.IsArray,
15464         Type.IsPointer and Type.IsByRef instead of Type.HasElementType
15465         since the latter one doesn't work with the ms runtime.
15466
15467 2002-08-03  Martin Baulig  <martin@gnome.org>
15468
15469         Fixed bugs #27998 and #22735.
15470
15471         * class.cs (Method.IsOperator): New public field.
15472         (Method.CheckBase): Report CS0111 if there's already a method
15473         with the same parameters in the current class.  Report CS0508 when
15474         attempting to change the return type of an inherited method.
15475         (MethodData.Emit): Report CS0179 if a method doesn't have a body
15476         and it's not marked abstract or extern.
15477         (PropertyBase): New abstract base class for Property and Indexer.
15478         (PropertyBase.CheckBase): Moved here from Property and made it work
15479         for indexers.
15480         (PropertyBase.Emit): Moved here from Property.Emit, Indexer.Emit is
15481         the same so we can reuse it there.
15482         (Property, Indexer): Derive from PropertyBase.
15483         (MethodSignature.inheritable_property_signature_filter): New delegate
15484         to find properties and indexers.
15485
15486         * decl.cs (MemberCore.CheckMethodAgainstBase): Added `string name'
15487         argument and improved error reporting.
15488
15489         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): Renamed to
15490         EmptyReadOnlyParameters and made it a property.
15491
15492         * typemanager.cs (TypeManager.GetArgumentTypes): Added overloaded
15493         version of this method which takes a `PropertyInfo indexer'.
15494         (TypeManager.RegisterIndexer): New method.
15495
15496         * class.cs: Added myself as author of this file :-)
15497
15498 2002-08-03  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15499
15500         * class.cs: fixed compilation on windoze.
15501
15502 2002-08-03  Martin Baulig  <martin@gnome.org>
15503
15504         * interface.cs (Interface.GetInterfaceBases): Check whether all
15505         base interfaces are at least as accessible than the current one.
15506
15507         * class.cs (TypeContainer.GetClassBases): Check whether base types
15508         are at least as accessible than the current type.
15509         (TypeContainer.AsAccessible): Implemented and made non-static.
15510         (MemberBase.CheckParameters): Report errors if the accessibility
15511         checks fail.
15512
15513         * delegate.cs (Delegate.Delegate): The default visibility is
15514         internal for top-level types and private for nested types.
15515         (Delegate.Define): Report errors if the accessibility checks fail.
15516
15517         * enum.cs (Enum.Enum): The default visibility is internal for
15518         top-level types and private for nested types.
15519         (Enum.DefineType): Compute the correct visibility.
15520
15521         * modifiers.cs (Modifiers.TypeAttr): Added a version of this
15522         function which takes a `bool is_toplevel' instead of a TypeContainer.
15523
15524         * typemanager.cs (TypeManager.IsBuiltinType): `void' is also a
15525         builtin type.
15526
15527 2002-08-02  Martin Baulig  <martin@gnome.org>
15528
15529         * expression.cs (LocalVariableReferenc): Added constructor which
15530         takes additional `VariableInfo vi' and `bool is_readonly' arguments.
15531         (LocalVariableReference.IsReadOnly): New property.
15532         (LocalVariableReference.DoResolveLValue): Report a CS1604 if the
15533         variable is readonly, use our own readonly flag to do this; you can
15534         use the new constructor to get a writable reference to a read-only
15535         variable.
15536
15537         * cs-parser.jay (foreach_statement, using_statement): Get a writable
15538         reference to the local variable.
15539
15540 2002-08-01  Miguel de Icaza  <miguel@ximian.com>
15541
15542         * rootcontext.cs (ResolveCore): Also include System.Exception
15543
15544         * statement.cs (Block.Emit): Do not emit the dead-code warnings if
15545         we reach an EmptyStatement.
15546
15547         (Catch.DoResolve, Throw.DoResolve): Throwing the System.Exception
15548         is also fine.
15549
15550         * expression.cs (Binary.ResolveOperator): Check error result in
15551         two places.
15552
15553         use brtrue/brfalse directly and avoid compares to null.
15554
15555 2002-08-02  Martin Baulig  <martin@gnome.org>
15556
15557         * class.cs (TypeContainer.Define): Define all nested interfaces here.
15558         Fixes bug #28407, added test-155.cs.
15559
15560 2002-08-01  Martin Baulig  <martin@gnome.org>
15561
15562         * class.cs (Event.EmitDefaultMethod): Make this work with static
15563         events.  Fixes #28311, added verify-3.cs.
15564
15565 2002-08-01  Martin Baulig  <martin@gnome.org>
15566
15567         * statement.cs (ForeachHelperMethods): Added `enumerator_type' and
15568         `is_disposable' fields.
15569         (Foreach.GetEnumeratorFilter): Set `hm.enumerator_type' and
15570         `hm.is_disposable' if we're using the collection pattern.
15571         (Foreach.EmitCollectionForeach): Use the correct type for the
15572         enumerator's local variable, only emit the try/finally block if
15573         necessary (fixes #27713).
15574
15575 2002-08-01  Martin Baulig  <martin@gnome.org>
15576
15577         * ecore.cs (Expression.report118): Renamed to Error118 and made
15578         it public static.
15579
15580         * statement.cs (Throw.Resolve): Check whether the expression is of
15581         the correct type (CS0118) and whether the type derives from
15582         System.Exception (CS0155).
15583         (Catch.Resolve): New method.  Do the type lookup here and check
15584         whether it derives from System.Exception (CS0155).
15585         (Catch.CatchType, Catch.IsGeneral): New public properties.
15586
15587         * typemanager.cs (TypeManager.exception_type): Added.
15588
15589 2002-07-31  Miguel de Icaza  <miguel@ximian.com>
15590
15591         * driver.cs: Updated About function.
15592
15593 2002-07-31  Martin Baulig  <martin@gnome.org>
15594
15595         Implemented Control Flow Analysis.
15596
15597         * codegen.cs (EmitContext.DoFlowAnalysis): New public variable.
15598         (EmitContext.CurrentBranching): Added.
15599         (EmitContext.StartFlowBranching): Added.
15600         (EmitContext.EndFlowBranching): Added.
15601         (EmitContext.KillFlowBranching): Added.
15602         (EmitContext.IsVariableAssigned): Added.
15603         (EmitContext.SetVariableAssigned): Added.
15604         (EmitContext.IsParameterAssigned): Added.
15605         (EmitContext.SetParameterAssigned): Added.
15606         (EmitContext.EmitTopBlock): Added `InternalParameters ip' argument.
15607         Added control flow analysis stuff here.
15608
15609         * expression.cs (Unary.DoResolve): If the operator is Oper.AddressOf,
15610         resolve the expression as lvalue.
15611         (LocalVariableReference.DoResolve): Check whether the variable has
15612         already been assigned.
15613         (ParameterReference.DoResolveLValue): Override lvalue resolve to mark
15614         the parameter as assigned here.
15615         (ParameterReference.DoResolve): Check whether the parameter has already
15616         been assigned.
15617         (Argument.Resolve): If it's a `ref' or `out' argument, resolve the
15618         expression as lvalue.
15619
15620         * statement.cs (FlowBranching): New class for the flow analysis code.
15621         (Goto): Resolve the label in Resolve, not in Emit; added flow analysis.
15622         (LabeledStatement.IsDefined): New public property.
15623         (LabeledStatement.AddUsageVector): New public method to tell flow
15624         analyis that the label may be reached via a forward jump.
15625         (GotoCase): Lookup and resolve the label in Resolve, not in Emit; added
15626         flow analysis.
15627         (VariableInfo.Number): New public field.  This is used by flow analysis
15628         to number all locals of a block.
15629         (Block.CountVariables): New public property.  This is the number of
15630         local variables in this block (including the locals from all parent
15631         blocks).
15632         (Block.EmitMeta): Number all the variables.
15633
15634         * statement.cs: Added flow analysis support to all classes.
15635
15636 2002-07-31  Martin Baulig  <martin@gnome.org>
15637
15638         * driver.cs: Added "--mcs-debug" argument if MCS_DEBUG is defined.
15639         To get debugging messages, compile mcs with /define:MCS_DEBUG and
15640         then use this argument.
15641
15642         * report.cs (Report.Debug): Renamed to conditional to "MCS_DEBUG".
15643
15644         * makefile.gnu (MCS_FLAGS): Include $(MCS_DEFINES), the user may
15645         use this to specify /define options.
15646
15647 2002-07-29  Martin Baulig  <martin@gnome.org>
15648
15649         * statement.cs (Fixed): Moved all code that does variable lookups
15650         and resolvings from Emit to Resolve.
15651
15652         * statement.cs (For): Moved all code that does variable lookups
15653         and resolvings from Emit to Resolve.
15654
15655         * statement.cs (Using): Moved all code that does variable lookups
15656         and resolvings from Emit to Resolve.
15657
15658 2002-07-29  Martin Baulig  <martin@gnome.org>
15659
15660         * attribute.cs (Attribute.Resolve): Explicitly catch a
15661         System.NullReferenceException when creating the
15662         CustromAttributeBuilder and report a different warning message.
15663
15664 2002-07-29  Martin Baulig  <martin@gnome.org>
15665
15666         * support.cs (ParameterData.ParameterName): Added method to
15667         get the name of a parameter.
15668
15669         * typemanager.cs (TypeManager.IsValueType): New public method.
15670
15671 2002-07-29  Martin Baulig  <martin@gnome.org>
15672
15673         * parameter.cs (Parameter.Modifier): Added `ISBYREF = 8'.  This
15674         is a flag which specifies that it's either ref or out.
15675         (Parameter.GetParameterInfo (DeclSpace, int, out bool)): Changed
15676         the out parameter to `out Parameter.Modifier mod', also set the
15677         Parameter.Modifier.ISBYREF flag on it if it's either ref or out.
15678
15679         * support.cs (InternalParameters.ParameterModifier): Distinguish
15680         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15681         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15682
15683         * expression.cs (Argument.GetParameterModifier): Distinguish
15684         between Parameter.Modifier.OUT and Parameter.Modifier.REF, set the
15685         Parameter.Modifier.ISBYREF flag if it's either ref or out.
15686
15687 2002-07-29  Martin Baulig  <martin@gnome.org>
15688
15689         * expression.cs (ParameterReference.ParameterReference): Added
15690         `Location loc' argument to the constructor.
15691
15692         * cs-parser.jay: Pass location to ParameterReference.
15693
15694 2002-07-28  Miguel de Icaza  <miguel@ximian.com>
15695
15696         * statement.cs (Try): Initialize the location.
15697
15698         * cs-parser.jay: pass location to Try.
15699
15700         * expression.cs (Unary.Reduce): Change the prototype to return
15701         whether a constant fold could be performed or not.  The result is
15702         returned in an out parameters.  In the case of Indirection and
15703         AddressOf, we want to perform the full tests.
15704
15705 2002-07-26  Miguel de Icaza  <miguel@ximian.com>
15706
15707         * statement.cs (Statement.Emit): Flag dead code.
15708
15709 2002-07-27  Andrew Birkett  <andy@nobugs.org>
15710
15711         * expression.cs (Unary.Reduce): Handle AddressOf and Indirection.
15712
15713 2002-07-27  Martin Baulig  <martin@gnome.org>
15714
15715         * class.cs (MethodData.Define): Put back call to
15716         TypeManager.AddMethod(), accidentally commented this out.
15717
15718         * report.cs (Debug): New public method to print debugging information,
15719         this is `[Conditional ("DEBUG")]'.
15720
15721 2002-07-26  Martin Baulig  <martin@gnome.org>
15722
15723         * cs-parser.jay (CSharpParser): Added `Stack switch_stack'.
15724         (switch_statement): Push the current_block to the switch_stack and
15725         pop it again when we're done with the switch.
15726         (switch_section): The new block is a child of the current_block.
15727         Fixes bug #24007, added test-152.cs.
15728
15729 2002-07-27  Martin Baulig  <martin@gnome.org>
15730
15731         * expression.cs (Invocation.EmitArguments): When calling a varargs
15732         function with only its fixed arguments, we need to pass an empty
15733         array.
15734
15735 2002-07-27  Martin Baulig  <martin@gnome.org>
15736
15737         Mono 0.13 has been released.
15738
15739 2002-07-25  Miguel de Icaza  <miguel@ximian.com>
15740
15741         * driver.cs: Rename --resource to --linkres, because that is what
15742         we do currently, we dont support --resource yet.
15743
15744         * cs-tokenizer.cs: Fix test for reporting endif mismatches.
15745
15746 2002-07-25  Martin Baulig  <martin@gnome.org>
15747
15748         * class.cs (MethodData): New public class.  This is a `method builder'
15749         class for a method or one accessor of a Property/Indexer/Event.
15750         (MethodData.GetMethodFlags): Moved here from MemberBase.
15751         (MethodData.ApplyAttributes): Likewise.
15752         (MethodData.ApplyObsoleteAttribute): Likewise.
15753         (MethodData.ApplyConditionalAttribute): Likewise.
15754         (MethodData.ApplyDllImportAttribute): Likewise.
15755         (MethodData.CheckAbstractAndExternal): Likewise.
15756         (MethodData.Define): Formerly knows as MemberBase.DefineMethod().
15757         (MethodData.Emit): Formerly known as Method.Emit().
15758         (MemberBase): Moved everything which was specific to a single
15759         accessor/method to MethodData.
15760         (Method): Create a new MethodData and call Define() and Emit() on it.
15761         (Property, Indexer, Event): Create a new MethodData objects for each
15762         accessor and call Define() and Emit() on them.
15763
15764 2002-07-25  Martin Baulig  <martin@gnome.org>
15765
15766         Made MethodCore derive from MemberBase to reuse the code from there.
15767         MemberBase now also checks for attributes.
15768
15769         * class.cs (MethodCore): Derive from MemberBase, not MemberCore.
15770         (MemberBase.GetMethodFlags): Moved here from class Method and marked
15771         as virtual.
15772         (MemberBase.DefineAccessor): Renamed to DefineMethod(), added
15773         `CallingConventions cc' and `Attributes opt_attrs' arguments.
15774         (MemberBase.ApplyAttributes): New virtual method; applies the
15775         attributes to a method or accessor.
15776         (MemberBase.ApplyObsoleteAttribute): New protected virtual method.
15777         (MemberBase.ApplyConditionalAttribute): Likewise.
15778         (MemberBase.ApplyDllImportAttribute): Likewise.
15779         (MemberBase.CheckAbstractAndExternal): Likewise.
15780         (MethodCore.ParameterTypes): This is now a property instead of a
15781         method, it's initialized from DoDefineParameters().
15782         (MethodCore.ParameterInfo): Removed the set accessor.
15783         (MethodCore.DoDefineParameters): New protected virtual method to
15784         initialize ParameterTypes and ParameterInfo.
15785         (Method.GetReturnType): We can now simply return the MemberType.
15786         (Method.GetMethodFlags): Override the MemberBase version and add
15787         the conditional flags.
15788         (Method.CheckBase): Moved some code from Define() here, call
15789         DoDefineParameters() here.
15790         (Method.Define): Use DoDefine() and DefineMethod() from MemberBase
15791         here to avoid some larger code duplication.
15792         (Property.Emit, Indexer.Emit): Call CheckAbstractAndExternal() to
15793         ensure that abstract and external accessors don't declare a body.
15794
15795         * attribute.cs (Attribute.GetValidPieces): Make this actually work:
15796         `System.Attribute.GetCustomAttributes (attr.Type)' does a recursive
15797         lookup in the attribute's parent classes, so we need to abort as soon
15798         as we found the first match.
15799         (Attribute.Obsolete_GetObsoleteMessage): Return the empty string if
15800         the attribute has no arguments.
15801
15802         * typemanager.cs (TypeManager.AddMethod): Now takes a MemberBase instead
15803         of a Method.
15804
15805 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15806
15807         * cs-parser.jay: reverted previous patch.
15808
15809 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15810
15811         * cs-parser.jay: fixed bug #22119.
15812
15813 2002-07-24  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15814
15815         * attribute.cs: fixed compilation. The error was:
15816         "attribute.cs(571,17): error CS0177: The out parameter 'is_error' must 
15817         be assigned to before control leaves the current method."
15818         [FIXME:  Filed as bug #28186: MCS must report this error.]
15819
15820 2002-07-25  Martin Baulig  <martin@gnome.org>
15821
15822         * attribute.cs (Attribute.Conditional_GetConditionName): New static
15823         method to pull the condition name ouf of a Conditional attribute.
15824         (Attribute.Obsolete_GetObsoleteMessage): New static method to pull
15825         the obsolete message and error flag out of an Obsolete attribute.
15826
15827         * class.cs (Method.GetMethodFlags): New public method to get the
15828         TypeManager.MethodFlags for this method.
15829         (Method.ApplyConditionalAttribute, Method.ApplyObsoleteAttribute): New
15830         private methods.
15831         (Method.Define): Get and apply the Obsolete and Conditional attributes;
15832         if we're overriding a virtual function, set the new private variable
15833         `parent_method'; call the new TypeManager.AddMethod().
15834
15835         * typemanager.cs (TypeManager.AddMethod): New static method.  Stores
15836         the MethodBuilder and the Method in a PtrHashtable.
15837         (TypeManager.builder_to_method): Added for this purpose.
15838         (TypeManager.MethodFlags): Added IsObsoleteError.
15839         (TypeManager.GetMethodFlags): Added `Location loc' argument.  Lookup
15840         Obsolete and Conditional arguments in MethodBuilders.  If we discover
15841         an Obsolete attribute, emit an appropriate warning 618 / error 619 with
15842         the message from the attribute.
15843
15844 2002-07-24  Martin Baulig  <martin@gnome.org>
15845
15846         * cs-tokenizer.cs: Eat up trailing whitespaces and one-line comments in
15847         preprocessor directives, ensure that the argument to #define/#undef is
15848         exactly one identifier and that it's actually an identifier.
15849
15850         Some weeks ago I did a `#define DEBUG 1' myself and wondered why this
15851         did not work ....
15852
15853 2002-07-24  Martin Baulig  <martin@gnome.org>
15854
15855         * statement.cs (Foreach.ForeachHelperMethods): Added `Type element_type',
15856         initialize it to TypeManager.object_type in the constructor.
15857         (Foreach.GetEnumeratorFilter): Set `hm.element_type' to the return type
15858         of the `hm.get_current' method if we're using the collection pattern.
15859         (Foreach.EmitCollectionForeach): Use `hm.element_type' as the source type
15860         for the explicit conversion to make it work when we're using the collection
15861         pattern and the `Current' property has a different return type than `object'.
15862         Fixes #27713.
15863
15864 2002-07-24  Martin Baulig  <martin@gnome.org>
15865
15866         * delegate.cs (Delegate.VerifyMethod): Simply return null if the method
15867         does not match, but don't report any errors.  This method is called in
15868         order for all methods in a MethodGroupExpr until a matching method is
15869         found, so we don't want to bail out if the first method doesn't match.
15870         (NewDelegate.DoResolve): If none of the methods in the MethodGroupExpr
15871         matches, report the 123.  Fixes #28070.
15872
15873 2002-07-24  Martin Baulig  <martin@gnome.org>
15874
15875         * expression.cs (ArrayAccess.EmitStoreOpcode): Moved the
15876         TypeManager.TypeToCoreType() to the top of the method so the
15877         following equality checks will work.  Fixes #28107.
15878
15879 2002-07-24  Martin Baulig  <martin@gnome.org>
15880
15881         * cfold.cs (ConstantFold.DoConstantNumericPromotions): "If either
15882         operand is of type uint, and the other operand is of type sbyte,
15883         short or int, the operands are converted to type long." -
15884         Actually do what this comment already told us.  Fixes bug #28106,
15885         added test-150.cs.
15886
15887 2002-07-24  Martin Baulig  <martin@gnome.org>
15888
15889         * class.cs (MethodBase): New abstract class.  This is now a base
15890         class for Property, Indexer and Event to avoid some code duplication
15891         in their Define() and DefineMethods() methods.
15892         (MethodBase.DoDefine, MethodBase.DefineAccessor): Provide virtual
15893         generic methods for Define() and DefineMethods().
15894         (FieldBase): Derive from MemberBase, not MemberCore.
15895         (Property): Derive from MemberBase, not MemberCore.
15896         (Property.DefineMethod): Moved all the code from this method to the
15897         new MethodBase.DefineAccessor(), just call it with appropriate
15898         argumetnts.
15899         (Property.Define): Call the new Property.DoDefine(), this does some
15900         sanity checks and we don't need to duplicate the code everywhere.
15901         (Event): Derive from MemberBase, not MemberCore.
15902         (Event.Define): Use the new MethodBase.DefineAccessor() to define the
15903         accessors, this will also make them work with interface events.
15904         (Indexer): Derive from MemberBase, not MemberCore.
15905         (Indexer.DefineMethod): Removed, call MethodBase.DefineAccessor() insstead.
15906         (Indexer.Define): Use the new MethodBase functions.
15907
15908         * interface.cs (InterfaceEvent.InterfaceEvent): Added `Location loc'
15909         argument to the constructor.
15910         (Interface.FindMembers): Added support for interface events.
15911         (Interface.PopluateEvent): Implemented.
15912
15913         Added test-149.cs for this.  This also fixes bugs #26067 and #24256.
15914
15915 2002-07-22  Miguel de Icaza  <miguel@ximian.com>
15916
15917         * class.cs (TypeContainer.AddMethod): Adding methods do not use IsValid,
15918         but this is required to check for a method name being the same as
15919         the containing class.  
15920
15921         Handle this now.
15922
15923 2002-07-22  Gonzalo Paniagua Javier <gonzalo@ximian.com>
15924
15925         * interface.cs: initialize variable.
15926
15927 2002-07-23  Martin Baulig  <martin@gnome.org>
15928
15929         Implemented the IndexerName attribute in interfaces.
15930
15931         * class.cs (TypeContainer.DefineIndexers): Don't set the indexer
15932         name if this is an explicit interface implementation.
15933         (Indexer.InterfaceIndexerName): New public variable.  If we're
15934         implementing an interface indexer, this is the IndexerName in that
15935         interface.  Otherwise, it's the IndexerName.
15936         (Indexer.DefineMethod): If we're implementing interface indexer,
15937         set InterfaceIndexerName.  Use the new Pending.IsInterfaceIndexer
15938         and Pending.ImplementIndexer methods.
15939         (Indexer.Define): Also define the PropertyBuilder if we're
15940         implementing an interface indexer and this is neither an explicit
15941         interface implementation nor do the IndexerName match the one in
15942         the interface.
15943
15944         * pending.cs (TypeAndMethods): Added `MethodInfo [] need_proxy'.
15945         If a method is defined here, then we always need to create a proxy
15946         for it.  This is used when implementing interface indexers.
15947         (Pending.IsInterfaceIndexer): New public method.
15948         (Pending.ImplementIndexer): New public method.
15949         (Pending.InterfaceMethod): Added `MethodInfo need_proxy' argument.
15950         This is used when implementing interface indexers to define a proxy
15951         if necessary.
15952         (Pending.VerifyPendingMethods): Look in the `need_proxy' array and
15953         define a proxy if necessary.
15954
15955         * interface.cs (Interface.IndexerName): New public variable.
15956         (Interface.PopulateIndexer): Set the IndexerName.
15957         (Interface.DefineIndexers): New private method.  Populate all the
15958         indexers and make sure their IndexerNames match.
15959
15960         * typemanager.cs (IndexerPropertyName): Added support for interface
15961         indexers.
15962
15963 2002-07-22  Martin Baulig  <martin@gnome.org>
15964
15965         * codegen.cs (EmitContext.HasReturnLabel): New public variable.
15966         (EmitContext.EmitTopBlock): Always mark the ReturnLabel and emit a
15967         ret if HasReturnLabel.
15968         (EmitContext.TryCatchLevel, LoopBeginTryCatchLevel): New public
15969         variables.
15970
15971         * statement.cs (Do.Emit, While.Emit, For.Emit, Foreach.Emit): Save
15972         and set the ec.LoopBeginTryCatchLevel.
15973         (Try.Emit): Increment the ec.TryCatchLevel while emitting the block.
15974         (Continue.Emit): If the ec.LoopBeginTryCatchLevel is smaller than
15975         the current ec.TryCatchLevel, the branch goes out of an exception
15976         block.  In this case, we need to use Leave and not Br.
15977
15978 2002-07-22  Martin Baulig  <martin@gnome.org>
15979
15980         * statement.cs (Try.Emit): Emit an explicit ret after the end of the
15981         block unless the block does not always return or it is contained in
15982         another try { ... } catch { ... } block.  Fixes bug #26506.
15983         Added verify-1.cs to the test suite.
15984
15985 2002-07-22  Martin Baulig  <martin@gnome.org>
15986
15987         * statement.cs (Switch.TableSwitchEmit): If we don't have a default,
15988         then we do not always return.  Fixes bug #24985.
15989
15990 2002-07-22  Martin Baulig  <martin@gnome.org>
15991
15992         * expression.cs (Invocation.OverloadedResolve): Do the BetterFunction()
15993         lookup on a per-class level; ie. walk up the class hierarchy until we
15994         found at least one applicable method, then choose the best among them.
15995         Fixes bug #24463 and test-29.cs.
15996
15997 2002-07-22  Martin Baulig  <martin@gnome.org>
15998
15999         * typemanager.cs (TypeManager.ArrayContainsMethod): Don't check the
16000         return types of the methods.  The return type is not part of the
16001         signature and we must not check it to make the `new' modifier work.
16002         Fixes bug #27999, also added test-147.cs.
16003         (TypeManager.TypeToCoreType): Added TypeManager.type_type.
16004
16005         * expression.cs (Invocation.DoResolve): Call TypeManager.TypeToCoreType()
16006         on the method's return type.
16007
16008 2002-07-21  Martin Baulig  <martin@gnome.org>
16009
16010         * assign.cs: Make this work if the rightmost source is a constant and
16011         we need to do an implicit type conversion.  Also adding a few more tests
16012         to test-38.cs which should have caught this.
16013
16014         * makefile.gnu: Disable debugging, there's already the mcs-mono2.exe
16015         target in the makefile for this.  The makefile.gnu is primarily intended
16016         for end-users who don't want to debug the compiler.
16017
16018 2002-07-21  Martin Baulig  <martin@gnome.org>
16019
16020         * assign.cs: Improved the Assign class so it can now handle embedded
16021         assignments (X = Y = Z = something).  As a side-effect this'll now also
16022         consume less local variables.  test-38.cs now passes with MCS, added
16023         a few new test cases to that test.
16024
16025 2002-07-20  Martin Baulig  <martin@gnome.org>
16026
16027         * expression.cs (Binary.EmitBranchable): Emit correct unsigned branch
16028         instructions.  Fixes bug #27977, also added test-146.cs.
16029
16030 2002-07-19  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16031
16032         * cs-tokenizer.cs: fixed getHex ().
16033
16034 2002-07-19  Martin Baulig  <martin@gnome.org>
16035
16036         * expression.cs (Invocation.EmitParams): Use TypeManager.LookupType(),
16037         not Type.GetType() to lookup the array type.  This is needed when
16038         we're constructing an array of a user-defined type.
16039         (ArrayAccess.EmitDynamicInitializers): Only emit the Ldelema for
16040         single-dimensional arrays, but also for single-dimensial arrays of
16041         type decimal.
16042
16043 2002-07-19  Martin Baulig  <martin@gnome.org>
16044
16045         * expression.cs (New.DoEmit): Create a new LocalTemporary each time
16046         this function is called, it's not allowed to share LocalBuilders
16047         among ILGenerators.
16048
16049 2002-07-19  Martin Baulig  <martin@gnome.org>
16050
16051         * expression.cs (Argument.Resolve): Report an error 118 when trying
16052         to pass a type as argument.
16053
16054 2002-07-18  Martin Baulig  <martin@gnome.org>
16055
16056         * ecore.cs (Expression.ImplicitNumericConversion): Don't emit a
16057         Conv_R_Un for the signed `long' type.
16058
16059 2002-07-15  Miguel de Icaza  <miguel@ximian.com>
16060
16061         * expression.cs (MemberAccess.DoResolve): Do not reuse the field
16062         `expr' for the temporary result, as that will fail if we do
16063         multiple resolves on the same expression.
16064
16065 2002-07-05  Miguel de Icaza  <miguel@ximian.com>
16066
16067         * ecore.cs (SimpleNameResolve): Use ec.DeclSpace instead of
16068         ec.TypeContainer for looking up aliases. 
16069
16070         * class.cs (TypeContainer): Remove LookupAlias from here.
16071
16072         * decl.cs (DeclSpace); Move here.
16073
16074 2002-07-01  Miguel de Icaza  <miguel@ximian.com>
16075
16076         * class.cs (FindMembers): Only call filter if the constructor
16077         bulider is not null.
16078
16079         Also handle delegates in `NestedTypes' now.  Now we will perform
16080         type lookups using the standard resolution process.  This also
16081         fixes a bug.
16082
16083         * decl.cs (DeclSpace.ResolveType): New type resolution routine.
16084         This uses Expressions (the limited kind that can be parsed by the
16085         tree) instead of strings.
16086
16087         * expression.cs (ComposedCast.ToString): Implement, used to flag
16088         errors since now we have to render expressions.
16089
16090         (ArrayCreation): Kill FormElementType.  Use ComposedCasts in
16091         FormArrayType. 
16092
16093         * ecore.cs (SimpleName.ToString): ditto.
16094
16095         * cs-parser.jay: Instead of using strings to assemble types, use
16096         Expressions to assemble the type (using SimpleName, ComposedCast,
16097         MemberAccess).  This should fix the type lookups in declarations,
16098         because we were using a different code path for this.
16099
16100         * statement.cs (Block.Resolve): Continue processing statements
16101         even when there is an error.
16102
16103 2002-07-17  Miguel de Icaza  <miguel@ximian.com>
16104
16105         * class.cs (Event.Define): Also remove the `remove' method from
16106         the list of pending items.
16107
16108         * expression.cs (ParameterReference): Use ldarg.N (0..3) to
16109         generate more compact code. 
16110
16111 2002-07-17  Martin Baulig  <martin@gnome.org>
16112
16113         * const.cs (Const.LookupConstantValue): Add support for constant
16114         `unchecked' and `checked' expressions.
16115         Also adding test case test-140.cs for this.
16116
16117 2002-07-17  Martin Baulig  <martin@gnome.org>
16118
16119         * statement.cs (Foreach.GetEnumeratorFilter): When compiling corlib,
16120         check whether mi.ReturnType implements the IEnumerator interface; the
16121         `==' and the IsAssignableFrom() will fail in this situation.
16122
16123 2002-07-16  Ravi Pratap  <ravi@ximian.com>
16124
16125         * ecore.cs (SimpleName.SimpleNameResolve) : Apply Gonzalo's fix 
16126         here too.
16127
16128 2002-07-16  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16129
16130         * expression.cs: fixed bug #27811.
16131
16132 2002-07-14  Miguel de Icaza  <miguel@ximian.com>
16133
16134         * expression.cs (ParameterReference.AddressOf): Patch from Paolo
16135         Molaro: when we are a ref, the value already contains a pointer
16136         value, do not take the address of it.
16137
16138 2002-07-14 Rafael Teixeira <rafaelteixeirabr@hotmail.com>
16139         * removed mb-parser.jay and mb-tokenizer.cs
16140
16141 Sat Jul 13 19:38:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16142
16143         * expression.cs: check against the building corlib void type.
16144
16145 Sat Jul 13 19:35:58 CEST 2002 Paolo Molaro <lupus@ximian.com>
16146
16147         * ecore.cs: fix for valuetype static readonly fields: when 
16148         initializing them, we need their address, not the address of a copy.
16149
16150 Sat Jul 13 17:32:53 CEST 2002 Paolo Molaro <lupus@ximian.com>
16151
16152         * typemanager.cs: register also enum_type in corlib.
16153
16154 Sat Jul 13 15:59:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16155
16156         * class.cs: allow calling this (but not base) initializers in structs.
16157
16158 Sat Jul 13 15:12:06 CEST 2002 Paolo Molaro <lupus@ximian.com>
16159
16160         * ecore.cs: make sure we compare against the building base types
16161         in GetTypeSize ().
16162
16163 Sat Jul 13 15:10:32 CEST 2002 Paolo Molaro <lupus@ximian.com>
16164
16165         * typemanager.cs: fix TypeToCoreType() to handle void and object
16166         (corlib gets no more typerefs after this change).
16167
16168 2002-07-12  Miguel de Icaza  <miguel@ximian.com>
16169
16170         * expression.cs (ArrayCreation.EmitArrayArguments): use
16171         Conv.Ovf.U4 for unsigned and Conv.Ovf.I4 for signed.
16172
16173         (ArrayAccess.LoadArrayAndArguments): Use Conv_Ovf_I and
16174         Conv_Ovf_I_Un for the array arguments.  Even if C# allows longs as
16175         array indexes, the runtime actually forbids them.
16176
16177         * ecore.cs (ExpressionToArrayArgument): Move the conversion code
16178         for array arguments here.
16179
16180         * expression.cs (EmitLoadOpcode): System.Char is a U2, use that
16181         instead of the default for ValueTypes.
16182
16183         (New.DoEmit): Use IsValueType instead of
16184         IsSubclassOf (value_type)
16185         (New.DoResolve): ditto.
16186         (Invocation.EmitCall): ditto.
16187
16188         * assign.cs (Assign): ditto.
16189
16190         * statement.cs (Unsafe): Ok, so I got the semantics wrong.
16191         Statements *are* currently doing part of their resolution during
16192         Emit.  
16193
16194         Expressions do always resolve during resolve, but statements are
16195         only required to propagate resolution to their children.
16196
16197 2002-07-11  Miguel de Icaza  <miguel@ximian.com>
16198
16199         * driver.cs (CSCParseOption): Finish the /r: and /lib: support.
16200
16201         (LoadAssembly): Do not add the dll if it is already specified
16202
16203         (MainDriver): Add the System directory to the link path at the end,
16204         after all the other -L arguments. 
16205
16206         * expression.cs (ArrayAccess.EmitLoadOpcode): I was using the
16207         wrong opcode for loading bytes and bools (ldelem.i1 instead of
16208         ldelem.u1) and using the opposite for sbytes.
16209
16210         This fixes Digger, and we can finally run it.
16211
16212         * driver.cs (UnixParseOption): Move the option parsing here.  
16213         (CSCParseOption): Implement CSC-like parsing of options.
16214
16215         We now support both modes of operation, the old Unix way, and the
16216         new CSC-like way.  This should help those who wanted to make cross
16217         platform makefiles.
16218
16219         The only thing broken is that /r:, /reference: and /lib: are not
16220         implemented, because I want to make those have the same semantics
16221         as the CSC compiler has, and kill once and for all the confussion
16222         around this.   Will be doing this tomorrow.
16223
16224         * statement.cs (Unsafe.Resolve): The state is checked during
16225         resolve, not emit, so we have to set the flags for IsUnsfe here.
16226
16227 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16228
16229         * expression.cs (MemberAccess.ResolveMemberAccess): Since we can
16230         not catch the Error_ObjectRefRequired in SimpleName (as it is
16231         possible to have a class/instance variable name that later gets
16232         deambiguated), we have to check this here.      
16233
16234 2002-07-10  Ravi Pratap  <ravi@ximian.com>
16235
16236         * class.cs (TypeContainer.GetFieldFromEvent): Move away from here,
16237         make static and put into Expression.
16238
16239         (Event.Define): Register the private field of the event with the 
16240         TypeManager so that GetFieldFromEvent can get at it.
16241
16242         (TypeManager.RegisterPrivateFieldOfEvent): Implement to
16243         keep track of the private field associated with an event which
16244         has no accessors.
16245
16246         (TypeManager.GetPrivateFieldOfEvent): Implement to get at the
16247         private field.
16248
16249         * ecore.cs (GetFieldFromEvent): RE-write to use the above methods.
16250
16251 2002-07-10  Miguel de Icaza  <miguel@ximian.com>
16252
16253         * expression.cs (Binary.EmitBranchable): this routine emits the
16254         Binary expression in a branchable context.  This basically means:
16255         we need to branch somewhere, not just get the value on the stack.
16256
16257         This works together with Statement.EmitBoolExpression.
16258
16259         * statement.cs (Statement.EmitBoolExpression): Use
16260         EmitBranchable. 
16261
16262 2002-07-09  Miguel de Icaza  <miguel@ximian.com>
16263
16264         * statement.cs (For): Reduce the number of jumps in loops.
16265
16266         (For): Implement loop inversion for the For statement.
16267
16268         (Break): We can be breaking out of a Try/Catch controlled section
16269         (foreach might have an implicit try/catch clause), so we need to
16270         use Leave instead of Br.
16271
16272         * ecore.cs (FieldExpr.AddressOf): Fix for test-139 (augmented
16273         now).  If the instace expression supports IMemoryLocation, we use
16274         the AddressOf method from the IMemoryLocation to extract the
16275         address instead of emitting the instance.
16276
16277         This showed up with `This', as we were emitting the instance
16278         always (Emit) instead of the Address of This.  Particularly
16279         interesting when This is a value type, as we dont want the Emit
16280         effect (which was to load the object).
16281
16282 2002-07-08  Miguel de Icaza  <miguel@ximian.com>
16283
16284         * attribute.cs: Pass the entry point to the DefinePInvokeMethod
16285
16286         * statement.cs (Checked): Set the CheckedState during the resolve
16287         process too, as the ConvCast operations track the checked state on
16288         the resolve process, and not emit.
16289
16290         * cs-parser.jay (namespace_member_declaration): Flag that we have
16291         found a declaration when we do.  This is used to flag error 1529
16292
16293         * driver.cs: Report ok when we display the help only.
16294
16295 2002-07-06  Andrew Birkett  <adb@tardis.ed.ac.uk>
16296
16297         * cs-tokenizer.cs (xtoken): Improve handling of string literals.
16298
16299 2002-07-04  Miguel de Icaza  <miguel@ximian.com>
16300
16301         * cs-tokenizer.cs (define): We also have to track locally the
16302         defines.  AllDefines is just used for the Conditional Attribute,
16303         but we also need the local defines for the current source code. 
16304
16305 2002-07-03  Miguel de Icaza  <miguel@ximian.com>
16306
16307         * statement.cs (While, For, Do): These loops can exit through a
16308         Break statement, use this information to tell whether the
16309         statement is the last piece of code.
16310
16311         (Break): Flag that we break.
16312
16313         * codegen.cs (EmitContexts): New `Breaks' state variable.
16314
16315 2002-07-03  Martin Baulig  <martin@gnome.org>
16316
16317         * class.cs (TypeContainer.MethodModifiersValid): Allow override
16318         modifiers in method declarations in structs.  Otherwise, you won't
16319         be able to override things like Object.Equals().
16320
16321 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16322
16323         * class.cs (Method, Property, Indexer): Do not allow the public
16324         modifier to be used in explicit interface implementations.
16325
16326         (TypeContainer.MethodModifiersValid): Catch virtual, abstract and
16327         override modifiers in method declarations in structs
16328
16329 2002-07-02   Andrew Birkett <adb@tardis.ed.ac.uk>
16330
16331         * cs-tokenizer.cs (adjust_int, adjust_real): Do not abort on
16332         integer or real overflow, report an error
16333
16334 2002-07-02  Martin Baulig  <martin@gnome.org>
16335
16336         * typemanager.cs (TypeManager.InitCoreTypes): When compiling
16337         corlib, dynamically call AssemblyBuilder.SetCorlibTypeBuilders()
16338         to tell the runtime about our newly created System.Object and
16339         System.ValueType types.
16340
16341 2002-07-02  Miguel de Icaza  <miguel@ximian.com>
16342
16343         * expression.cs (This): Use Stobj/Ldobj when we are a member of a
16344         struct instead of Ldarg/Starg.
16345
16346 2002-07-02  Martin Baulig  <martin@gnome.org>
16347
16348         * expression.cs (Indirection.Indirection): Call
16349         TypeManager.TypeToCoreType() on `expr.Type.GetElementType ()'.
16350
16351 2002-07-02  Martin Baulig  <martin@gnome.org>
16352
16353         * expression.cs (ArrayAccess.EmitStoreOpcode): If the type is a
16354         ValueType, call TypeManager.TypeToCoreType() on it.
16355         (Invocations.EmitParams): Call TypeManager.TypeToCoreType() on
16356         the OpCodes.Newarr argument.
16357
16358 2002-07-02  Martin Baulig  <martin@gnome.org>
16359
16360         * expression.cs (Invocation.EmitCall): When compiling corlib,
16361         replace all calls to the system's System.Array type to calls to
16362         the newly created one.
16363
16364         * typemanager.cs (TypeManager.InitCodeHelpers): Added a few more
16365         System.Array methods.
16366         (TypeManager.InitCoreTypes): When compiling corlib, get the methods
16367         from the system's System.Array type which must be replaced.
16368
16369 Tue Jul 2 19:05:05 CEST 2002 Paolo Molaro <lupus@ximian.com>
16370
16371         * typemanager.cs: load unverifiable_code_ctor so we can build
16372         corlib using the correct type. Avoid using GetTypeCode() with
16373         TypeBuilders.
16374         * rootcontext.cs: uses TypeManager.unverifiable_code_ctor and
16375         TypeManager.object_type to allow building corlib.
16376
16377 Tue Jul 2 19:03:19 CEST 2002 Paolo Molaro <lupus@ximian.com>
16378
16379         * ecore.cs: handle System.Enum separately in LoadFromPtr().
16380
16381 2002-07-01  Martin Baulig  <martin@gnome.org>
16382
16383         * class.cs: Make the last change actually work, we need to check
16384         whether `ifaces != null' to avoid a crash.
16385
16386 Mon Jul 1 16:15:03 CEST 2002 Paolo Molaro <lupus@ximian.com>
16387
16388         * class.cs: when we build structs without fields that implement
16389         interfaces, we need to add the interfaces separately, since there is
16390         no API to both set the size and add the interfaces at type creation
16391         time.
16392
16393 Mon Jul 1 14:50:47 CEST 2002 Paolo Molaro <lupus@ximian.com>
16394
16395         * expression.cs: the dimension arguments to the array constructors
16396         need to be converted if they are a long.
16397
16398 Mon Jul 1 12:26:12 CEST 2002 Paolo Molaro <lupus@ximian.com>
16399
16400         * class.cs: don't emit ldarg.0 if there is no parent constructor
16401         (fixes showstopper for corlib).
16402
16403 2002-06-29  Martin Baulig  <martin@gnome.org>
16404
16405         MCS now compiles corlib on GNU/Linux :-)
16406
16407         * attribute.cs (Attribute.ApplyAttributes): Treat Accessors like Method,
16408         ie. check for MethodImplOptions.InternalCall.
16409
16410         * class.cs (TypeContainer.DefineType): When compiling corlib, both parent
16411         and TypeManager.attribute_type are null, so we must explicitly check
16412         whether parent is not null to find out whether it's an attribute type.
16413         (Property.Emit): Always call Attribute.ApplyAttributes() on the GetBuilder
16414         and SetBuilder, not only if the property is neither abstract nor external.
16415         This is necessary to set the MethodImplOptions on the accessor methods.
16416         (Indexer.Emit): Call Attribute.ApplyAttributes() on the GetBuilder and
16417         SetBuilder, see Property.Emit().
16418
16419         * rootcontext.cs (RootContext.PopulateTypes): When compiling corlib, don't
16420         populate "System.Object", "System.ValueType" and "System.Attribute" since
16421         they've already been populated from BootCorlib_PopulateCoreTypes().
16422
16423 2002-06-29  Martin Baulig  <martin@gnome.org>
16424
16425         * ecore.cs (Expression.ImplicitReferenceConversionExists): If expr
16426         is the NullLiteral, we also need to make sure that target_type is not
16427         an enum type.   
16428
16429 2002-06-29  Martin Baulig  <martin@gnome.org>
16430
16431         * rootcontext.cs (RootContext.ResolveCore): We must initialize
16432         `TypeManager.multicast_delegate_type' and `TypeManager.delegate_type'
16433         before calling BootstrapCorlib_ResolveDelegate ().
16434
16435 2002-06-27  Gonzalo Paniagua Javier <gonzalo@ximian.com>
16436
16437         * statement.cs: fixed build-breaker. All tests passed ok.
16438
16439 2002-06-27  Martin Baulig  <martin@gnome.org>
16440
16441         * typemanager.cs (TypeManager.VerifyUnManaged): Added explicit check
16442         for System.Decimal when compiling corlib.
16443
16444 2002-06-27  Martin Baulig  <martin@gnome.org>
16445
16446         * statement.cs (Switch.TableSwitchEmit): Make this work with empty
16447         switch blocks which contain nothing but a default clause.
16448
16449 2002-06-26  Andrew  <adb@tardis.ed.ac.uk>
16450
16451        * ../errors/cs1501-3.cs: Added new test for struct ctr typechecks.
16452
16453 2002-06-27  Martin Baulig  <martin@gnome.org>
16454
16455         * ecore.cs (PropertyExpr.PropertyExpr): Call
16456         TypeManager.TypeToCoreType() on the `pi.PropertyType'.
16457
16458         * typemanager.cs (TypeManager.TypeToCoreType): Return if the type
16459         is already a TypeBuilder.
16460
16461 2002-06-27  Martin Baulig  <martin@gnome.org>
16462
16463         * ecore.cs (Expression.ImplicitReferenceConversionExists): Use
16464         `target_type == TypeManager.array_type', not IsAssignableFrom() in
16465         the "from an array-type to System.Array" case.  This makes it work
16466         when compiling corlib.
16467
16468 2002-06-27  Martin Baulig  <martin@gnome.org>
16469
16470         * ecore.cs (Expression.SimpleNameResolve): If the expression is a
16471         non-static PropertyExpr, set its InstanceExpression.  This makes
16472         the `ICollection.Count' property work in System/Array.cs.
16473
16474 2002-06-25  Andrew Birkett  <adb@tardis.ed.ac.uk>
16475
16476         * driver.cs: Made error handling more consistent.  Errors now
16477         tracked by Report class, so many methods which used to return int
16478         now return void.  Main() now prints success/failure and 
16479         errors/warnings message.
16480
16481         Renamed '--probe' compiler argument to '--expect-error'.  Removed
16482         the magic number return values (123 and 124).  Now, if the
16483         expected error occurs, the compiler exits with success (exit value
16484         0).  If the compilation completes without seeing that particular
16485         error, the compiler exits with failure (exit value 1).  The
16486         makefile in mcs/errors has been changed to handle the new behaviour.
16487
16488         * report.cs: Made 'expected error' number a property and renamed
16489         it from 'Probe' to 'ExpectedError'.
16490
16491         * genericparser.cs: Removed error handling support, since it is
16492         now all done by Report class.
16493
16494         * cs-parser.jay, mb-parser.jay: Errors are tracked by Report
16495         class, so parse() no longer returns an int.
16496
16497         * namespace.cs: Use Report.Error instead of GenericParser.error
16498
16499 2002-06-22  Miguel de Icaza  <miguel@ximian.com>
16500
16501         * class.cs (TypeContainer.AddMethod, TypeContainer.AddIndexer,
16502         TypeContainer.AddOperator): At the front of the list put the
16503         explicit implementations, so they get resolved/defined first. 
16504
16505 2002-06-21  Miguel de Icaza  <miguel@ximian.com>
16506
16507         * class.cs (TypeContainer.VerifyImplements): Verifies that a given
16508         interface type is implemented by this TypeContainer.  Used during
16509         explicit interface implementation.
16510
16511         (Property.Define, Indexer.Define, Method.Define): Validate that
16512         the given interface in the explicit implementation is one of the
16513         base classes for the containing type.
16514
16515         Also if we are explicitly implementing an interface, but there is
16516         no match in the pending implementation table, report an error.
16517
16518         (Property.Define): Only define the property if we are
16519         not explicitly implementing a property from an interface.  Use the
16520         correct name also for those properties (the same CSC uses,
16521         although that is really not needed).
16522
16523         (Property.Emit): Do not emit attributes for explicitly implemented
16524         properties, as there is no TypeBuilder.
16525
16526         (Indexer.Emit): ditto.
16527
16528         Hiding then means that we do not really *implement* a pending
16529         implementation, which makes code fail.
16530
16531 2002-06-22  Martin Baulig  <martin@gnome.org>
16532
16533         * ecore.cs (Expression.Constantify): Call TypeManager.TypeToCoreType() on
16534         the return value of Object.GetType().  [FIXME: we need to do this whenever
16535         we get a type back from the reflection library].
16536
16537 Fri Jun 21 13:37:57 CEST 2002 Paolo Molaro <lupus@ximian.com>
16538
16539         * typemanager.cs: make ExpandInterfaces() slip duplicated interfaces.
16540
16541 2002-06-20  Miguel de Icaza  <miguel@ximian.com>
16542
16543         * attribute.cs: Return null if we can not look up the type.
16544
16545         * class.cs (TypeContainer.GetClassBases): Use ExpandInterfaces on
16546         the interface types found.
16547
16548         * interface.cs (Interface.GetInterfaceBases): Use ExpandInterfaces on the
16549         interface types found.
16550
16551         * typemanager.cs (GetInterfaces): Make this routine returns alll
16552         the interfaces and work around the lame differences between
16553         System.Type and System.Reflection.Emit.TypeBuilder in the results
16554         result for GetInterfaces.
16555
16556         (ExpandInterfaces): Given an array of interface types, expand and
16557         eliminate repeated ocurrences of an interface.  This expands in
16558         context like: IA; IB : IA; IC : IA, IB; the interface "IC" to
16559         be IA, IB, IC.
16560
16561 2002-06-21  Martin Baulig  <martin@gnome.org>
16562
16563         * typemanager.cs (TypeManager.EnumToUnderlying): It's now safe to call this function
16564         on System.Enum.
16565
16566 2002-06-21  Martin Baulig  <martin@gnome.org>
16567
16568         * typemanager.cs (TypeManager.TypeToCoreType): New function.  When compiling corlib
16569         and called with one of the core types, return the corresponding typebuilder for
16570         that type.
16571
16572         * expression.cs (ArrayAccess.DoResolve): Call TypeManager.TypeToCoreType() on the
16573         element type.
16574
16575 2002-06-21  Martin Baulig  <martin@gnome.org>
16576
16577         * ecore.cs (Expression.ExplicitReferenceConversionExists): Use
16578         `target_type.IsArray' instead of `target_type.IsSubclassOf (TypeManager.array_type)'.
16579         (Expression.ConvertReferenceExplicit): Likewise.
16580
16581         * expression.cs (ElementAccess.DoResolve): Likewise.
16582         (ElementAccess.DoResolveLValue): Likewise.
16583
16584 2002-06-10  Martin Baulig  <martin@gnome.org>
16585
16586         * interface.cs (Interface.PopulateIndexer): When creating the setter, we need to
16587         add the "value" parameter to the parameter list.
16588
16589         * statement.cs (Fixed.Emit): Pass the return value of the child block's Emit()
16590         to our caller.
16591
16592 2002-06-19  Miguel de Icaza  <miguel@ximian.com>
16593
16594         * expression.cs (ArrayCreation.ExpressionToArrayArgument): Convert
16595         the argument to an int, uint, long or ulong, per the spec.  Also
16596         catch negative constants in array creation.
16597
16598 Thu Jun 20 17:56:48 CEST 2002 Paolo Molaro <lupus@ximian.com>
16599
16600         * class.cs: do not allow the same interface to appear twice in
16601         the definition list.
16602
16603 Wed Jun 19 22:33:37 CEST 2002 Paolo Molaro <lupus@ximian.com>
16604
16605         * ecore.cs: don't use ldlen with System.Array.
16606
16607 Wed Jun 19 20:57:40 CEST 2002 Paolo Molaro <lupus@ximian.com>
16608
16609         * ecore.cs: stobj requires a type argument. Handle indirect stores on enums.
16610
16611 Wed Jun 19 20:17:59 CEST 2002 Paolo Molaro <lupus@ximian.com>
16612
16613         * modifiers.cs: produce correct field attributes for protected
16614         internal. Easy fix so miguel can work on ther harder stuff:-)
16615
16616 2002-06-18  Miguel de Icaza  <miguel@ximian.com>
16617
16618         * pending.cs: New file.  Move the code from class.cs here.
16619         Support clearning the pending flag for all methods (when not doing
16620         explicit interface implementation).
16621
16622 Tue Jun 18 10:36:22 CEST 2002 Paolo Molaro <lupus@ximian.com>
16623
16624         * rootcontext.cs: added a couple more types needed to bootstrap.
16625
16626 2002-06-17  Miguel de Icaza  <miguel@ximian.com>
16627
16628         * typemanager.cs (GetConstructor): Use DeclaredOnly to look the
16629         constructor in the type, instead of any constructor in the type
16630         hierarchy.  Thanks to Paolo for finding this bug (it showed up as
16631         a bug in the Mono runtime when applying the params attribute). 
16632
16633 2002-06-16  Rafael Teixeira  <rafaelteixeirabr@hotmail.com>
16634         * changed namespace.cs to use "GenericParser.error(...)" instead of "CSharpParser.error(...)"
16635
16636 2002-06-14  Rachel Hestilow  <hestilow@ximian.com>
16637
16638         * expression.cs (Unary.ResolveOperator): Use TypeManager
16639         to resolve the type.
16640
16641 2002-06-13  Ravi Pratap  <ravi@ximian.com>
16642
16643         * cs-parser.jay (enum_member_declaration): Pass in the attributes
16644         attached.
16645
16646         * enum.cs (AddEnumMember): Add support to store the attributes associated 
16647         with each member too.
16648
16649         * attribute.cs (CheckAttribute, ApplyAttributes): Update to handle
16650         field builders too - this takes care of the enum member case.
16651
16652 2002-06-10  Rachel Hestilow  <hestilow@ximian.com>
16653
16654         * typemanager.cs (TypeManager.VerifyUnManaged): Allow
16655         address-of operator on both value types and pointers.
16656
16657 2002-06-10  Martin Baulig  <martin@gnome.org>
16658
16659         * interface.cs (Interface.PopulateIndexer): Add the indexer's
16660         PropertyBuilder to the `property_builders' list.
16661
16662         * expression.cs (Indexers.GetIndexersForTypeOrInterface): New private method.
16663         (Indexers.GetIndexersForType): Call GetIndexersForTypeOrInterface() on the
16664         `lookup_type' and all its interfaces.  Unfortunately, Type.FindMembers() won't
16665         find any indexers which are inherited from an interface.
16666
16667 2002-06-09  Martin Baulig  <martin@gnome.org>
16668
16669         * const.cs (Const.LookupConstantValue): Convert `Expr' to a literal of
16670         the same type as the constant if necessary.  There's also a test-130.cs
16671         for this.
16672
16673         * enum.cs (Enum.ChangeEnumType): Moved to typemanager.cs and made public.
16674
16675         * typemanager.cs (TypeManager.ChangeType): Previously known as
16676         Enum.ChangeEnumType().
16677
16678 2002-06-09  Martin Baulig  <martin@gnome.org>
16679
16680         * expression.cs (Cast.TryReduce): Added support for consts.
16681
16682 2002-06-08  Ravi Pratap  <ravi@ximian.com>
16683
16684         * class.cs (Accessor): Hold attributes information so we can pass
16685         it along.
16686
16687         * cs-parser.jay (get_accessor_declaration, set_accessor_declaration):
16688         Modify to pass in attributes attached to the methods.
16689
16690         (add_accessor_declaration, remove_accessor_declaration): Ditto.
16691
16692         * attribute.cs (ApplyAttributes, CheckAttribute): Update accordingly
16693         to handle the Accessor kind :-)
16694
16695         * class.cs (Property.Emit, Event.Emit): Apply attributes to the accessors
16696
16697 2002-06-08  Martin Baulig  <martin@gnome.org>
16698
16699         * expression.cs (Unary.TryReduceNegative): Added support for
16700         ULongConstants.
16701
16702 2002-06-08  Martin Baulig  <martin@gnome.org>
16703
16704         * enum.cs (Enum.LookupEnumValue): Don't report an error if the
16705         name can't be found in the `defined_names' - the caller will do a
16706         MemberLookup in this case and thus find methods in System.Enum
16707         such as Enum.IsDefined().
16708
16709 2002-06-08  Martin Baulig  <martin@gnome.org>
16710
16711         * enum.cs (Enum.ChangeEnumType): This is a custom version of
16712         Convert.ChangeType() which works with TypeBuilder created types.
16713         (Enum.LookupEnumValue, Enum.Define): Use it here.
16714
16715         * class.cs (TypeContainer.RegisterRequiredImplementations): Added
16716         `TypeBuilder.BaseType != null' check.
16717         (TypeContainer.FindMembers): Only lookup parent members if we
16718         actually have a parent.
16719         (Method.EmitDestructor): Added `ec.ContainerType.BaseType != null' check.
16720         (ConstructorInitializer.Resolve): Likewise.
16721
16722         * interface.cs (Interface.FindMembers): Added
16723         `TypeBuilder.BaseType != null' check.
16724
16725         * rootcontext.cs (RootContext.ResolveCore): Added
16726         "System.Runtime.CompilerServices.IndexerNameAttribute" to
16727         classes_second_stage.
16728
16729         * typemanager.cs (TypeManager.InitCoreTypes): Don't initialize
16730         debug_type and trace_type when compiling with --nostdlib.       
16731
16732 2002-06-07  Martin Baulig  <martin@gnome.org>
16733
16734         * class.cs (TypeContainer): Added `have_nonstatic_fields' field.
16735         (AddField): Set it to true when adding a non-static field.
16736         (DefineType): Use `have_nonstatic_fields' to find out whether we
16737         have non-static fields, not `Fields != null'.
16738
16739 2002-06-02  Miguel de Icaza  <miguel@ximian.com>
16740
16741         * ecore.cs (SimpleNameResolve): Removed simple bug (we were
16742         dereferencing a null on the static-field code path)
16743
16744 2002-05-30  Martin Baulig  <martin@gnome.org>
16745
16746         * codegen.cs (InitMonoSymbolWriter): Added `string[] args' argument
16747         to take command line arguments.  Use reflection to call the new
16748         custom `Initialize' function on the symbol writer and pass it the
16749         command line arguments.
16750
16751         * driver.cs (--debug-args): New command line argument to pass command
16752         line arguments to the symbol writer.
16753
16754 2002-05-28  Miguel de Icaza  <miguel@ximian.com>
16755
16756         * assign.cs (DoResolve): Forgot to do the implicit conversion to
16757         the target type for indexers and properties.  Thanks to Joe for
16758         catching this.
16759
16760 2002-05-27  Miguel de Icaza  <miguel@ximian.com>
16761
16762         * typemanager.cs (MethodFlags): returns the method flags
16763         (Obsolete/ShouldIgnore) that control warning emission and whether
16764         the invocation should be made, or ignored. 
16765
16766         * expression.cs (Invocation.Emit): Remove previous hack, we should
16767         not do this on matching a base type, we should do this based on an attribute
16768
16769         Only emit calls to System.Diagnostics.Debug and
16770         System.Diagnostics.Trace if the TRACE and DEBUG defines are passed
16771         on the command line.
16772
16773         * rootcontext.cs: Global settings for tracing and debugging.
16774
16775         * cs-tokenizer.cs (define): New utility function to track
16776         defines.   Set the global settings for TRACE and DEBUG if found.
16777
16778 2002-05-25  Ravi Pratap  <ravi@ximian.com>
16779
16780         * interface.cs (Populate*): Pass in the TypeContainer as well as
16781         the DeclSpace as parameters so that we can create EmitContexts and
16782         then use that to apply attributes etc.
16783
16784         (PopulateMethod, PopulateEvent, PopulateProperty)
16785         (PopulateIndexer): Apply attributes everywhere.
16786
16787         * attribute.cs (CheckAttribute): Include InterfaceMethod, InterfaceEvent
16788         etc.
16789
16790         (ApplyAttributes): Update accordingly.
16791
16792         We now apply interface attributes for all members too.
16793
16794 2002-05-26  Miguel de Icaza  <miguel@ximian.com>
16795
16796         * class.cs (Indexer.Define); Correctly check if we are explicit
16797         implementation (instead of checking the Name for a ".", we
16798         directly look up if the InterfaceType was specified).
16799
16800         Delay the creation of the PropertyBuilder.
16801
16802         Only create the PropertyBuilder if we are not an explicit
16803         interface implementation.   This means that explicit interface
16804         implementation members do not participate in regular function
16805         lookups, and hence fixes another major ambiguity problem in
16806         overload resolution (that was the visible effect).
16807
16808         (DefineMethod): Return whether we are doing an interface
16809         implementation. 
16810
16811         * typemanager.cs: Temporary hack until we get attributes in
16812         interfaces (Ravi is working on that) and we get IndexerName
16813         support in interfaces.
16814
16815         * interface.cs: Register the indexers as properties.
16816
16817         * attribute.cs (Attribute.Resolve): Catch the error, and emit a
16818         warning, I have verified that this is a bug in the .NET runtime
16819         (JavaScript suffers of the same problem).
16820
16821         * typemanager.cs (MemberLookup): When looking up members for
16822         interfaces, the parent of an interface is the implicit
16823         System.Object (so we succeed in searches of Object methods in an
16824         interface method invocation.  Example:  IEnumerable x;  x.ToString
16825         ()) 
16826
16827 2002-05-25  Miguel de Icaza  <miguel@ximian.com>
16828
16829         * class.cs (Event): Events should also register if they do
16830         implement the methods that an interface requires.
16831
16832         * typemanager.cs (MemberLookup); use the new GetInterfaces
16833         method. 
16834
16835         (GetInterfaces): The code used to lookup interfaces for a type is
16836         used in more than one place, factor it here. 
16837
16838         * driver.cs: Track the errors at the bottom of the file, we kept
16839         on going.
16840
16841         * delegate.cs (NewDelegate.Emit): We have to emit a null as the
16842         instance if the method we are calling is static!
16843
16844 2002-05-24  Miguel de Icaza  <miguel@ximian.com>
16845
16846         * attribute.cs (ApplyAttributes): Make this function filter out
16847         the IndexerName attribute (as that attribute in reality is never
16848         applied) and return the string constant for the IndexerName
16849         attribute. 
16850
16851         * class.cs (TypeContainer.Emit): Validate that all the indexers
16852         have the same IndexerName attribute, and if so, set the
16853         DefaultName attribute on the class. 
16854
16855         * typemanager.cs: The return value might contain other stuff (not
16856         only methods).  For instance, consider a method with an "Item"
16857         property and an Item method.
16858
16859         * class.cs: If there is a problem with the parameter types,
16860         return. 
16861
16862 2002-05-24  Ravi Pratap  <ravi@ximian.com>
16863
16864         * ecore.cs (ImplicitConversionExists): Wrapper function which also
16865         looks at user defined conversion after making a call to 
16866         StandardConversionExists - we need this for overload resolution.
16867
16868         * expression.cs : Update accordingly the various method calls.
16869
16870         This fixes 2 bugs filed against implicit user defined conversions 
16871
16872 2002-05-22  Miguel de Icaza  <miguel@ximian.com>
16873
16874         * statement.cs: Track the result of the assignment.
16875
16876 2002-05-21  Miguel de Icaza  <miguel@ximian.com>
16877
16878         * expression.cs (MemberAccess): Improved error reporting for
16879         inaccessible members.
16880
16881 2002-05-22  Martin Baulig  <martin@gnome.org>
16882
16883         * makefile (mcs-mono2.exe): New target.  This is mcs compiled with
16884         itself with debugging support.
16885
16886 2002-05-22  Martin Baulig  <martin@gnome.org>
16887
16888         * typemanager.cs ("System.Runtime.InteropServices.StructLayoutAttribute"):
16889         Removed, this isn't needed anymore.
16890
16891 2002-05-20  Martin Baulig  <martin@gnome.org>
16892
16893         * typemanager.cs (InitEnumUnderlyingTypes): "System.Char" can't
16894         be underlying type for an enum.
16895
16896 2002-05-20  Miguel de Icaza  <miguel@ximian.com>
16897
16898         * typemanager.cs (InitEnumUnderlyingTypes): New helper function
16899         that splits out the loading of just the core types.
16900
16901         * rootcontext.cs (ResolveCore): Split the struct resolution in
16902         two, so we can load the enumeration underlying types before any
16903         enums are used.
16904
16905         * expression.cs (Is): Bandaid until we fix properly Switch (see
16906         bug #24985 for details).
16907
16908         * typemanager.cs (ImplementsInterface): The hashtable will contain
16909         a null if there are no interfaces implemented.
16910
16911 2002-05-18  Miguel de Icaza  <miguel@ximian.com>
16912
16913         * cs-parser.jay (indexer_declarator): It is fine to have array
16914         parameters
16915
16916 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16917
16918         * typemanager.cs: (RegisterBuilder): New function used to register
16919         TypeBuilders that implement interfaces.  Since
16920         TypeBuilder.GetInterfaces (as usual) does not work with lame
16921         Reflection.Emit. 
16922         (AddUserType): register interfaces.
16923
16924         (ImplementsInterface): Use the builder_to_ifaces hash if we are
16925         dealing with TypeBuilder.  Also, arrays are showing up as
16926         SymbolTypes, which are not TypeBuilders, but whose GetInterfaces
16927         methods can not be invoked on them!
16928
16929         * ecore.cs (ExplicitReferenceConversionExists): Made public.
16930         (ImplicitReferenceConversionExists): Split out from
16931         StandardConversionExists. 
16932
16933         * expression.cs (As): We were only implementing one of the three
16934         cases for the as operator.  We now implement them all.
16935         (Is): Implement the various other cases for Is as well.
16936
16937         * typemanager.cs (CACHE): New define used to control if we want or
16938         not the FindMembers cache.  Seems to have a negative impact on
16939         performance currently
16940
16941         (MemberLookup): Nested types have full acess to
16942         enclosing type members
16943
16944         Remove code that coped with instance/static returns for events, we
16945         now catch this in RealFindMembers.
16946
16947         (RealFindMembers): only perform static lookup if the instance
16948         lookup did not return a type or an event.  
16949
16950 2002-05-17  Miguel de Icaza  <miguel@ximian.com>
16951
16952         * assign.cs (CompoundAssign): We pass more semantic information
16953         now to Compound Assignments than we did before: now we have all
16954         the information at hand, and now we resolve the target *before* we
16955         do the expression expansion, which allows the "CacheValue" method
16956         to have the effect we intended (before, a [x] += 1 would generate
16957         two differen ArrayAccess expressions from the ElementAccess,
16958         during the resolution process).
16959
16960         (CompoundAssign.DoResolve): Resolve target and original_source here.
16961
16962 2002-05-16  Miguel de Icaza  <miguel@ximian.com>
16963
16964         * expression.cs (ArrayAccess): dropped debugging information. 
16965
16966         * typemanager.cs: Small bug fix: I was always returning i_members,
16967         instead of one of i_members or s_members (depending on which had
16968         the content).
16969
16970         * assign.cs (IAssignMethod.CacheTemporaries): New method.  This
16971         method is invoked before any code generation takes place, and it
16972         is a mechanism to inform that the expression will be invoked more
16973         than once, and that the method should use temporary values to
16974         avoid having side effects
16975
16976         (Assign.Emit): Call CacheTemporaries in the IAssignMethod.
16977
16978         * ecore.cs (Expression.CacheTemporaries): Provide empty default
16979         implementation.
16980
16981         * expression.cs (Indirection, ArrayAccess): Add support for
16982         CacheTemporaries in these two bad boys. 
16983
16984         * ecore.cs (LoadFromPtr): figure out on our own if we need to use
16985         ldobj or ldind_ref.  
16986         (StoreFromPtr): Handle stobj as well.
16987
16988         * expression.cs (UnaryMutator): Share more code.
16989
16990         * typemanager.cs (FindMembers): Thanks to Paolo for tracking this
16991         down: I was not tracking the Filter function as well, which
16992         was affecting the results of the cache.
16993
16994 2002-05-15  Miguel de Icaza  <miguel@ximian.com>
16995
16996         * attribute.cs: Remove the hack to handle the CharSet property on
16997         StructLayouts. 
16998
16999 2002-05-14  Miguel de Icaza  <miguel@ximian.com>
17000
17001         * attribute.cs (DoResolve): More uglyness, we now only try to
17002         resolve the attribute partially, to extract the CharSet
17003         information (only if we are a StructLayout attribute).  Otherwise 
17004
17005         (GetExtraTypeInfo): Add some code to conditionally kill in the
17006         future this.   I am more and more convinced that the .NET
17007         framework has special code to handle the attribute setting on
17008         certain elements.
17009
17010         * expression.cs (IsParamsMethodApplicable): Revert my previous
17011         foreach change here, it was wrong.
17012
17013 2002-05-13  Miguel de Icaza  <miguel@ximian.com>
17014
17015         * cs-tokenizer.cs: (pp_primary): Eat the ')' at the end.
17016         (pp_expr): do not abort on unknown input, just return.
17017         (eval): abort if there are pending chars.
17018
17019         * attribute.cs (Attribute.Resolve): Positional parameters are
17020         optional.  Deal with that case.
17021
17022         * class.cs (DefineType): Call Attribute.GetExtraTypeInfo to fetch
17023         the Ansi/Unicode/Auto information for the type.
17024
17025         (TypeContainer.DefineType): instantiate the EmitContext here, as
17026         we will be using it during the type definition (to resolve
17027         attributes) and during the emit phase.
17028
17029         * attribute.cs (Attribute.GetExtraTypeInfo): This routine is used
17030         to pull type information out of the attributes
17031
17032         (Attribute.Resolve): track the constructor builder, and allow for
17033         multiple invocations (structs and classes will use this).
17034
17035         * ecore.cs (MemberLookupFinal): new version with all the
17036         parameters customizable.
17037
17038         * expression.cs (New.DoResolve): Use MemberLookupFinal to locate
17039         constructors.  Return if the result value is null (as the error
17040         would have been flagged already by MemberLookupFinal)
17041
17042         Do not allow instances of abstract classes or interfaces to be
17043         created.
17044
17045         * class.cs: (MethodSignature.InheritableMemberSignatureCompare):
17046         We have to compare the assembly property here when dealing with
17047         FamANDAssem and Assembly access modifiers, because we might be
17048         creating an assembly from *modules* (that means that we are not
17049         getting TypeBuilders for types defined in other modules that are
17050         part of this assembly).
17051
17052         (Method.Emit): If the method is marked abstract and has a body,
17053         emit an error. 
17054
17055         (TypeContainer.DefineMembers): If both the defined member and the
17056         parent name match are methods, then do not emit any warnings: let
17057         the Method.Define routine take care of flagging warnings.  But if
17058         there is a mismatch (method overrides something else, or method is
17059         overriwritten by something, then emit warning).
17060
17061         (MethodSignature.MemberSignatureCompare): If the sig.ret_type is
17062         set to null, this means `do not check for the return type on the
17063         signature'. 
17064
17065         (Method.Define): set the return type for the method signature to
17066         null, so that we get methods with the same name and parameters and
17067         different return types.  This is used to flag warning 114 (you are
17068         hiding a method, and you probably want to use the new/override
17069         keywords instead).
17070
17071         * typemanager.cs (MemberLookup): Implemented proper access
17072         control, closing a long standing set of bug reports.  The problem
17073         was that the Framework only has two bits: Public and NonPublic,
17074         and NonPublic includes private and protected methods, but we need
17075         to enforce the FamANDAssem, FamOrAssem and Family. 
17076
17077 2002-05-11  Miguel de Icaza  <miguel@ximian.com>
17078
17079         * statement.cs (GotoCase): Return true: Ammounts to giving up
17080         knowledge on whether we return or not, and letting the other case
17081         be responsible for it.
17082
17083 2002-05-10  Miguel de Icaza  <miguel@ximian.com>
17084
17085         * driver.cs: Do not load directories for each file processed, only
17086         do it if there is a pattern.
17087
17088         * ecore.cs: Report readonly assigns here as well, as we might have
17089         been resolved only by MemberAccess.
17090
17091         (SimpleName.SimpleNameResolve): Also be useful for LValue
17092         resolution.   We need this to propagate assign to local readonly variables
17093
17094         * typemanager.cs: Use a ptrhashtable for the criteria, because we
17095         do not want to reuse potential criteria memory.
17096
17097         * class.cs (MyEventBuilder): Set reflected_type;
17098
17099         * ecore.cs (Constantify): Added support for constifying bools.
17100
17101         (RootContext.LookupType): Added a cache for values looked up in
17102         the declaration space.
17103
17104         * typemanager.cs (FindMembers): Now is a front-end to
17105         RealFindMembers, and provides a two-level hashtable-based cache to
17106         the request.  
17107
17108         15% performance improvement: from 22.5 to 19.2 seconds.
17109
17110         * expression.cs (IsParamsMethodApplicable): use foreach.
17111         (Invocation.DoResolve): ditto.
17112         (New.DoResolve): ditto.
17113         (ArrayCreation.DoResolve): ditto.
17114
17115         * ecore.cs (FindMostEncompassingType): use foreach.
17116
17117         * delegate.cs (NewDelegate.DoResolve): Use foreach
17118
17119         * ecore.cs (Expression.FindMostSpecificSource): Use foreach.
17120         (RemoveMethods): use foreach.
17121
17122         * expression.cs (Invocation.MakeUnionSet): Optimization: Use two
17123         nested foreach statements instead of for, and also break out of
17124         the inner loop once a match is found.
17125
17126         (Invocation.OverloadResolve): Use foreach, simplify the code. 
17127
17128 2002-05-08  Miguel de Icaza  <miguel@ximian.com>
17129
17130         * cfold.cs (BinaryFold): During an enumeration evaluation context,
17131         we actually unwrap the expression to allow for extra information
17132         to be extracted. 
17133
17134         * expression.cs: Use Shr_Un on unsigned operations. 
17135
17136 2002-05-08  Ravi Pratap  <ravi@ximian.com>
17137
17138         * ecore.cs (FindMostEncompass*): Fix trivial bug where the set of 
17139         applicable operators was not being considered correctly. This closes
17140         the bug Miguel reported.
17141
17142 Wed May 8 16:40:50 CEST 2002 Paolo Molaro <lupus@ximian.com>
17143
17144         * attribute.cs: check that the type derives from System.Attribute
17145         and report the correct error in that case (moved the duplicate code to
17146         its own method, too).
17147
17148 Wed May 8 11:50:31 CEST 2002 Paolo Molaro <lupus@ximian.com>
17149
17150         * attribute.cs: lookup attribute type name as the spec says: first the
17151         bare attribute name and then name + "Attribute" (nant compiles with
17152         mcs after this fix).
17153
17154 2002-05-07  Miguel de Icaza  <miguel@ximian.com>
17155
17156         * expression.cs (Unary.TryReduceNegative): Ah!  Tricky!  Tricky!
17157         Because of the way we parse things, we should try to see if a
17158         UIntConstant can fit in an integer.
17159
17160 2002-05-07  Ravi Pratap  <ravi@ximian.com>
17161
17162         * ecore.cs (GetConversionOperators): Do not pick up op_True operators
17163         when we are in an explicit context.
17164
17165         (ConvertReferenceExplicit): When converting from Iface type S to Class
17166         T make sure the rules are implemented as an OR.
17167
17168         * parameter.cs (ParameterType): Make it a property for now although the
17169         purpose really isn't anything immediate.
17170
17171         * expression.cs (Is*Applicable): Do better checking on the parameter type
17172         of a ref/out parameter. The ones from the system assemblies are already 
17173         marked with the correct type so we don't need to do any correction.
17174
17175         * ecore.cs (StandardConversionExists): Conversion from Interface types to 
17176         the object type is standard too so include that.
17177
17178 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17179
17180         * ecore.cs (StandardConversionExists): Augment with missing code:
17181         deal with IntConstant, LongConstants and Enumerations.
17182
17183         * assign.cs: Report the error, instead of failing silently
17184
17185         * rootcontext.cs (AddGlobalAttributes): Track attributes on the
17186         typecontainer that they are declared, because the
17187         typecontainer/namespace will have the list of using clauses that
17188         need to be applied.
17189
17190         Assembly Attributes were escaping the normal registration
17191         mechanism. 
17192
17193         (EmitCode): Apply attributes within an EmitContext that represents
17194         the container they were declared on.
17195
17196         * cs-parser.jay: Track bases for structs.  How did I get this wrong?
17197
17198 2002-05-06  Ravi Pratap  <ravi@ximian.com>
17199
17200         * ecore.cs (FindMostEncompassingType, FindMostEncompassedType):
17201         Revamp completely - make much cleaner as we now operate only
17202         on a set of Types.
17203
17204         (FindMostSpecificSource, FindMostSpecificTarget): New methods
17205         to implement the logic detailed in the spec more correctly.
17206
17207         (UserDefinedConversion): Update accordingly.
17208
17209 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17210
17211         * statement.cs: Return flow analysis information up.
17212
17213         * cs-tokenizer.cs (adjust_real): Share code between LITERAL_DOUBLE
17214         and the default.
17215
17216         (token): Do not consume an extra character before calling
17217         decimal_digits.
17218
17219 2002-05-06  Piers Haken <piersh@friskit.com>
17220
17221         * cs-parser.jay: add 'override' attribute to System.Object.Finalize
17222
17223 2002-05-06  Miguel de Icaza  <miguel@ximian.com>
17224
17225         * class.cs (Constructor.Emit): Set the IsStatic flag in the
17226         EmitContext during the instance constructor initializer
17227         resolution, to stop access to instance variables.
17228
17229         This is mandated by the spec, last paragraph of the `constructor
17230         initializers' section. 
17231
17232 2002-05-05  Miguel de Icaza  <miguel@ximian.com>
17233
17234         * cs-parser.jay, class.cs (Accessor): new class used to represent
17235         an accessor (get or set).  In the past we used `null' to represent
17236         a missing accessor.  But this is ambiguous because there was no
17237         way to tell in abstract indexers/properties if one of them was
17238         specified.
17239
17240         Now there is a way of addressing that.
17241
17242         * expression.cs (Indexers.GetIndexersForType): Use TypeManager.MemberLookup
17243         instead of FindMembers.
17244
17245         * class.cs (TypeContainer.EmitFieldInitializer): Do not typecast
17246         the result of Assign.Resolve as Assign, but rather as ExpressionStatement.
17247
17248         * attribute.cs: Treat indexers and properties as the same in terms
17249         of applying attributes
17250
17251         * ecore.cs (FindMostEncompassedType): Use statically initialized
17252         EmptyExpressions()s like we do elsewhere to avoid creating useless
17253         objects (and we take this out of the tight loop).
17254
17255         (GetConversionOperators): Move the code to extract the actual
17256         operators to a separate routine to clean things up.
17257
17258 2002-05-04  Miguel de Icaza  <miguel@ximian.com>
17259
17260         * ecore.cs (FieldExpr): Remove un-needed tests for null, since now
17261         events are always registered FieldBuilders.
17262
17263         * class.cs (FieldBase): New class shared by Fields 
17264
17265         * delegate.cs: If we are a toplevel delegate, use our full name.
17266         If we are a nested delegate, then only use our tail name.
17267
17268 2002-05-02  Ravi Pratap  <ravi@ximian.com>
17269
17270         * expression.cs (IsApplicable): Ensure that we add the "&" to
17271         ref/out types before comparing it with the type of the argument.
17272
17273         (IsParamsMethodApplicable): Ditto.
17274
17275         (Argument.Type): Use TypeManager.LookupType instead of Type.GetType - 
17276         silly me ;-)
17277
17278         * delegate.cs : Handle the case when we have more than one applicable
17279         method. Flag an error only when we finish checking all.
17280
17281 2002-05-02  Miguel de Icaza  <miguel@ximian.com>
17282
17283         * expression.cs: Add support for boolean static initializers.
17284
17285 2002-05-01  Miguel de Icaza  <miguel@ximian.com>
17286
17287         * attribute.cs: Use proper cast for Events, since we use a MyEventBuilder.
17288
17289         * parameter.cs (ComputeParameterTypes,
17290         ComputeAndDefineParameterTypes): Better error handling: now we
17291         clear the `types' cache if we fail during any of the type lookups.
17292         We also return the status code correctly to our caller
17293
17294         * delegate.cs: If we fail to define a delegate, abort the extra
17295         steps. 
17296
17297         * expression.cs (Binary.ResolveOperator): for
17298         operator==(object,object) and operator !=(object, object) we also
17299         have to verify that there is an implicit conversion from one to
17300         the other.
17301
17302         (ArrayAccess.DoResolve): Array Access can operate on
17303         non-variables. 
17304
17305 2002-04-30  Miguel de Icaza  <miguel@ximian.com>
17306
17307         * assign.cs (CompoundAssign): A new class used as a "flag" that
17308         the assignment actually is happening as part of a compound
17309         assignment operator.
17310
17311         During compound assignment, a few new rules exist to enable things
17312         like:
17313
17314         byte b |= 1 + 2
17315
17316         From the spec:
17317
17318         x op= y can be evaluated as x = (T) (x op y) (ie, an explicit cast
17319         to the type of x) if y is implicitly convertible to the type of x,
17320         and the operator is a builtin operator and the return type of the
17321         operator is explicitly convertible to the type of x. 
17322
17323         * rootcontext.cs: Reset warning level to 2.  4 catches various
17324         "interesting" features in mcs, we must clean this up at some
17325         point, but currently am trying to kill other bugs ;-)
17326
17327         * ecore.cs (SimpleName.SimpleNameResolve): Perform member lookups
17328         in container classes as well.  
17329
17330         * expression.cs (Binary.ResolveOperator): Handle string case
17331         before anything else (as operator overloading does emit an error
17332         before doing anything else).
17333
17334         This code could go away when we move to a table driven model, but
17335         i could not come up with a good plan last night.
17336
17337 2002-04-30  Lawrence Pit <loz@cable.a2000.nl>
17338
17339         * typemanager.cs (CSharpName): reimplementation using regex.
17340         * class.cs: added null check for fields in Emit
17341         * rootcontext.cs: set warninglevel to 4
17342
17343 2002-04-29  Miguel de Icaza  <miguel@ximian.com>
17344
17345         * typemanager.cs (CSharpName): reimplemented with Lupus
17346         suggestion.
17347
17348 2002-04-28  Miguel de Icaza  <miguel@ximian.com>
17349
17350         * statement.cs (If): correclty implement Resolve, because we were
17351         not catching sem errors in there.  The same process is needed
17352         everywhere else. 
17353         (Return, StatementExpression, For, While, Do, Throw, Lock): Implement Resolve
17354
17355
17356         (Statement.Warning_DeadCodeFound): Factorize code.
17357         (While): Report dead code here too.
17358
17359         (Statement): Added Resolve virtual method to allow
17360         for resolution split from the emit code.
17361
17362 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17363
17364         * statement.cs (EmitBoolExpression): No longer try to resolve the
17365         expression here.    
17366         (MakeBoolean): New utility function that resolve, implicitly
17367         converts to boolean and tags the expression. 
17368
17369
17370         (If, Do): Implement dead code elimination.
17371         (While): Implement loop inversion
17372
17373         (Do, While, For, If): Resolve the expression prior to calling our
17374         code generation.
17375
17376 2002-04-22  Lawrence Pit <loz@cable.a2000.nl>
17377
17378         * class.cs:
17379           - added method Report28 (warning: program has more than one entry point)
17380           - added method IsEntryPoint, implements paragraph 10.1 of the spec
17381           - modified method Method.Define, the part at the end of the method
17382
17383         * rootcontext.cs: added static public Location EntryPointLocation;
17384           
17385         * ../errors/cs0028.cs : Add test case for the above warning.              
17386
17387         * typemanager.cs:
17388           - modified method CSharpName to allow arrays of primitive type to
17389             be printed nicely (e.g. instead of System.Int32[][] it now prints
17390             int[][])
17391           - added method CSharpSignature: returns the signature of a method
17392             in string format to be used in reporting errors, warnings, etc.
17393
17394         * support.cs: InternalParameters.ParameterDesc variable tmp initialized
17395         with String.Empty.
17396
17397 2002-04-26  Ravi Pratap  <ravi@ximian.com>
17398
17399         * delegate.cs (Define): Fix extremely silly bug where I was
17400         setting the type of the 'object' parameter of the BeginInvoke
17401         method to System.IAsyncResult instead of System.Object ;-)
17402
17403 2002-04-26  Miguel de Icaza  <miguel@ximian.com>
17404
17405         * class.cs (ConstructorInitializer.Resolve): Also use DeclaredOnly
17406         here. 
17407
17408         (Constructor.Emit): return if we fail to initialize the
17409         constructor.  Another door closed!  
17410
17411         * expression.cs (New.DoResolve): Improve error message (from -6 to
17412         1501).  Use DeclaredOnly lookup to find the exact constructor.
17413
17414         * typemanager.cs (MemberLookup): If DeclaredOnly is set, do not
17415         loop.  This is useful.
17416
17417         * cs-parser.jay: Adjust the default parameters so that destructors
17418         have the proper signature.
17419
17420 2002-04-26  Martin Baulig  <martin@gnome.org>
17421
17422         * driver.cs (LoadAssembly): If `assembly' contains any characters
17423         which are only valid in path names and not in assembly names
17424         (currently slash, backslash and point), use Assembly.LoadFrom ()
17425         instead of Assembly.Load () on the `assembly' (before iteration
17426         over the link_paths).
17427
17428 2002-04-26  Martin Baulig  <martin@gnome.org>
17429
17430         * cs-tokenizer.cs (is_hex): Correctly handle lowercase chars.
17431
17432 2002-04-25  Miguel de Icaza  <miguel@ximian.com>
17433
17434         * class.cs (Property): use the new typemanager.MemberLookup
17435
17436         (TypeContainer.MemberLookup): Implement using the
17437         TypeManager.MemberLookup now. 
17438
17439         * typemanager.cs: Make MemberLookup a function of the TypeManager,
17440         and return MemberInfos, so that these can be used without an
17441         EmitContext (what we had before).
17442
17443 2002-04-24  Miguel de Icaza  <miguel@ximian.com>
17444
17445         * expression.cs: Fix the case where the argument to params if the
17446         type of the params.  I omitted handling this before.   Fixed
17447
17448 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17449
17450         * driver.cs: Call BootCorlib_PopulateCoreType
17451
17452         * class.cs (Property.CheckBase): Check for properties only, not
17453         for all members. 
17454
17455         * interface.cs: Temporary hack: try/catch around the
17456         CustomAttributeBuilder, because I am getting an exception that I
17457         do not understand.
17458
17459         * rootcontext.cs (BootCorlib_PopulateCoreType): Populate some
17460         types whose definitions are required to be there (attributes are
17461         defined before standard types).
17462
17463         Compute definitions as we boot the various types, as they are used
17464         immediately (value_type class will need object_type, but if we do
17465         not initialize object_type, we will pass a null, which will let
17466         the runtime pick the System.Object from the existing corlib, which
17467         is not what we want).
17468
17469 2002-04-22  Patrik Torstensson <totte@labs2.com>
17470
17471         * cs-tokenizer.cs: fixed a number of trim() issues.
17472
17473 2002-04-22  Ravi Pratap  <ravi@ximian.com>
17474
17475         * expression.cs (Argument.Type): Ensure that we return the correct
17476         type when we have out or ref parameters [in which case we 
17477         append a "&"].
17478
17479 2002-04-22  Miguel de Icaza  <miguel@ximian.com>
17480
17481         * class.cs (Property, Indexer): Allow extern modifier in there. 
17482
17483         * typemanager.cs (InitBaseTypes): Initializes object_type and
17484         value_type, since those will be used early on during the bootstrap
17485         process to compile corlib.
17486
17487         (InitCoreTypes): Move code from here to InitBaseTypes.
17488
17489 2002-04-21  Miguel de Icaza  <miguel@ximian.com>
17490
17491         * ecore.cs (PropertyExpr): Optimize calls to Array::get_Length on
17492         single-dimension arrays as using the ldlen opcode.  
17493
17494         Daniel Lewis discovered this optimization.  
17495
17496         * typemanager.cs: Add signature for System.Array::get_Length
17497
17498 2002-04-20  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17499
17500         * statement.cs: report the error when the foreach does not apply to an
17501         array nor a collection.
17502
17503 2002-04-19  Miguel de Icaza  <miguel@ximian.com>
17504
17505         * expression.cs: Add implicit conversions to the operator ~.
17506
17507         * constant.cs (DecimalConstant.Emit): Emit decimal value.
17508
17509         * typemanager.cs: Locate the decimal constructor.
17510
17511 2002-04-17  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17512
17513         * attribute.cs: use the new property of TypeOf.
17514         * expression.cs: added 'get' property around typearg.
17515
17516         These changes fix a build breaker reported by NickD. Is this the
17517         correct way to fix?  If not, please, revert my changes and make it
17518         work :-).
17519
17520 2002-04-17  Miguel de Icaza  <miguel@ximian.com>
17521
17522         * attribute.cs: Add support for typeof in attribute invocations.
17523         I am not sure that this is right though.
17524
17525 2002-04-14  Duncan Mak  <duncan@ximian.com>
17526
17527         * cfold.cs (BinaryFold): Catch DivideByZeroException in the
17528         Binary.Operator.Division case.
17529
17530 2002-04-13  Ravi Pratap  <ravi@ximian.com>
17531
17532         * class.cs (DefineType): Ensure that we do a proper check on
17533         attribute types and also register it with the TypeManager.
17534
17535         (TypeContainer.Targets): The default for attribute types is
17536         AttributeTargets.All.
17537
17538         * attribute.cs (ApplyAttributes): Registering the attribute type
17539         is done elsewhere, not when we discover we have a Usage attribute.
17540
17541 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17542
17543         * expression.cs (VerifyArgumentsCompat): Implement Miguel's suggestion
17544         and get rid of is_delegate parameter.
17545
17546         * everywhere : update.
17547
17548 2002-04-12  Ravi Pratap  <ravi@ximian.com>
17549
17550         * cs-parser.jay (compilation_unit): Revamp completely to use
17551         some new ideas that I got from Rhys' grammar to solve the problems
17552         with assembly level attributes.
17553
17554         (outer_declaration): New grammar production.
17555
17556         (attribute_sections): Add.
17557
17558         (opt_attributes): Base on attribute_sections
17559
17560         (namespace_declaration): Allow opt_attributes to tackle the case
17561         when we have assembly level attributes - we are clever in this
17562         regard now ;-)
17563
17564         * attribute.cs (ApplyAttributes): Do not worry about assembly 
17565         attributes in the non-global context.
17566
17567         * rootcontext.cs (AddGlobalAttributes): Go back to using this
17568         instead of SetGlobalAttributes.
17569
17570         * class.cs, rootcontext.cs : Ensure we define and generate 
17571         attribute types before anything else.
17572
17573         * attribute.cs (CheckAttribute and GetValidPlaces): Handle the exception
17574         and flag the new error -20 for the case when the attribute type
17575         does not have valid targets specified. csc does not catch this.
17576
17577         * ../errors/errors.txt : update for error # -20
17578
17579 2002-04-11  Ravi Pratap  <ravi@ximian.com>
17580
17581         * support.cs (InternalParameters.ParameterModifier): Do some null
17582         checking and return sane values.
17583
17584         * class.cs (Method.Define): If we are a PInvoke method, ensure
17585         that we are static and extern. Report error # 601
17586
17587         * ../errors/cs0601.cs : Add test case for the above error.
17588
17589 2002-04-07  Ravi Pratap  <ravi@ximian.com>
17590
17591         * rootcontext.cs (attribute_types): We need to keep type of
17592         all attribute types separately and emit code for them first.
17593
17594         (RegisterAttribute) : Implement.
17595
17596         * class.cs (DefineType): Check if the current Type is a custom
17597         attribute type and register it accordingly.
17598
17599         * rootcontext.cs (AddGlobalAttributes): Fix silly bug where we were
17600         adding the first attribute twice and rename to
17601
17602         (SetGlobalAttributes): this.
17603
17604         * rootcontext.cs (NamespaceLookup): Run through the aliases too and perform
17605         lookups.
17606
17607         * attribute.cs (ApplyAttributes): Take an additional argument telling us
17608         if we are processing global arguments. Hmm, I am unsure of this.
17609
17610 2002-04-12  Gonzalo Paniagua Javier <gonzalo@ximian.com>
17611
17612         * expression.cs: added static array of strings to avoid calling
17613         Enum.ToString () for Operator in Binary. Significant recover of
17614         performance.
17615
17616 2002-04-10  Miguel de Icaza  <miguel@ximian.com>
17617
17618         * class.cs (FindMembers): Allow the Builders of the various
17619         members to be null.  If they are skip them.  This only happens
17620         during the PInvoke declaration.
17621
17622 2002-04-09  Miguel de Icaza  <miguel@ximian.com>
17623
17624         * parameter.cs (Parameters.ComputeParameterTypes): Flag the
17625         failure, so we do not keep going afterwards.
17626
17627         * expression.cs: (Invocation.OverloadResolve): I believe Ravi
17628         wanted to pass `false' as the `is_delegate' argument.  If this is
17629         the case, why not use delegate_type == null to mean `is_delegate =
17630         false' and anything else as is_delegate = true.
17631
17632 Tue Apr  9 05:40:12  2002 Piers Haken <piersh@friskit.com>
17633
17634         * statement.cs: fixed SimpleSwitchEmit to make 'goto case' goto the
17635         code for the section, not the beginning of the tests.
17636
17637 2002-04-08  Miguel de Icaza  <miguel@ximian.com>
17638
17639         * cfold.cs: Handle operator + (Enum x, Underlying x) 
17640
17641         * expression.cs (Binary): same.  Warn about errors where we have
17642         Enum/Enum in operator + as well.
17643
17644 Mon Apr  8 06:29:03  2002 Piers Haken <piersh@friskit.com>
17645
17646         * statement.cs:
17647                 - added support for switch(bool)
17648                 - optimize loading of I8/U8 constants (ldc.i4, iconv_i8)
17649                 - add TableSwitchEmit() to handle table-based switch statements
17650
17651 2002-04-05  Ravi Pratap  <ravi@ximian.com>
17652
17653         * expression.cs (Invocation.OverloadResolve): Factor out code which
17654         does parameter compatibility checking with arguments so that we can 
17655         re-use the code even from Delegate.VerifyApplicability
17656
17657         (VerifyArgumentsCompat): Move above code here.
17658
17659         * delegate.cs (VerifyApplicability): Get rid of duplicate code
17660         and instead make a call to the above method.
17661
17662 2002-03-31  Ravi Pratap  <ravi@ximian.com>
17663
17664         * typemanager.cs (attribute_type): Corresponds to System.Attribute.
17665         We use it to keep track of classes which are attribute types.
17666
17667 2002-04-02  Miguel de Icaza  <miguel@ximian.com>
17668
17669         * delegate.cs (Delegate.Define): Correctly define the types in the
17670         presence of fixed and array parameters.
17671
17672         * class.cs (TypeContainers.FindMembers): Use NonPublic flag while
17673         doing FindMembers.
17674
17675         * ecore.cs (Expression.MemberLookup): Reset binding flags to not
17676         include NonPublic after the first iteration.
17677
17678         * class.cs (Indexer.CheckBase): Only check if both parents are
17679         non-null. 
17680
17681         * cs-parser.jay (accessor_body): If empty, set to null.
17682
17683         * ecore.cs (SimpleName.SimpleNameResolve): We did not have the
17684         same code path here to resolve constants names that we did have in
17685         MemberAccess.DoResolve.  There is too much code duplicated here.
17686
17687 2002-04-01  Miguel de Icaza  <miguel@ximian.com>
17688
17689         * statement.cs, makefile: Drop Statementcollection and just use ArrayLists
17690
17691         * ecore.cs: Optimize UserDefinedConversion by minimizing the calls
17692         to MakeUnionSet.
17693
17694         * cs-tokenizer.cs: Reuse a single StringBuilder for assembling
17695         tokens, numbers and strings.
17696
17697         * ecore.cs (MethodGroupExpr): Make Emit warn about missing
17698         parenthesis.
17699
17700         * delegate.cs: Use ComputeAndDefineParameterTypes for both the
17701         asyncronous parameters and the regular parameters.  
17702
17703         * codegen.cs (CodeGen.Init): Use the constructor that allows us to
17704         specify the target directory.
17705
17706         * expression.cs: (This.DoResolve): Simplify
17707         (As.Emit): Optimize, do not generate IsInst if the expression is
17708         always of the given type.
17709
17710         (Is.DoResolve): Bug fix, we were reporting both always/never for
17711         the is expression.
17712
17713         * (Invocation.MakeUnionSet): Simplify vastly and optimize, we were
17714         creating too many unnecessary arrays.
17715
17716 2002-03-31  Miguel de Icaza  <miguel@ximian.com>
17717
17718         * class.cs (EmitFieldInitializer): Use Assign expression to assign
17719         fields instead of rolling our own initializer.   Takes care of all
17720         implicit conversions, and drops unnecessary static checks/argument.
17721
17722 2002-03-31  Dick Porter  <dick@ximian.com>
17723
17724         * driver.cs: use the GetDirectories() return values properly, and
17725         use "/" as path separator.
17726
17727 2002-03-30  Miguel de Icaza  <miguel@ximian.com>
17728
17729         * expression.cs (Unary): Optimize - - expr into expr.
17730         (Binary): Optimize a + (-b) into a -b.
17731
17732         * codegen.cs (CodeGen): Made all methods static.
17733
17734 2002-03-29  Miguel de Icaza  <miguel@ximian.com>
17735
17736         * rootcontext.cs: 
17737
17738         * decl.cs: Rename `definition' into `TypeBuilder' and drop the
17739         TypeBuilder property.
17740
17741         * cs-parser.jay: Drop the use of RecordXXX and use RecordDecl
17742         instead. 
17743
17744         * tree.cs: Removed the various RecordXXXX, and replaced with a
17745         single RecordDecl.  Removed all the accessor methods, and just
17746         left a single access point Type 
17747
17748         * enum.cs: Rename DefineEnum to DefineType.
17749
17750         * decl.cs: New abstract method `DefineType' used to unify the
17751         Defines for Enumerations, Interfaces, TypeContainers and
17752         Delegates.
17753
17754         (FindType): Moved LookupInterfaceOrClass here.  Moved the
17755         LookupBaseClasses method that used to live in class.cs and
17756         interface.cs here, and renamed to FindType.
17757
17758         * delegate.cs: Implement DefineType.  Take advantage of the
17759         refactored pattern for locating the parent builder without taking
17760         the parent_builder argument (which we know does not work if we are
17761         nested, and triggering a toplevel definition).
17762
17763 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17764
17765         * decl.cs (MemberCore.CheckMethodAgainstBase): Test if the
17766         accessibility of a member has changed during override and report
17767         an error if so.
17768
17769         * class.cs (Method.Define, Property.Define): Only complain on
17770         overrides if the method is private, any other accessibility is
17771         fine (and since we just checked the permission is the same, we are
17772         good to go).
17773
17774         * cs-tokenizer.cs: only line, region, endregion, if, endif, else
17775         and elif are processed always.  The other pre-processing
17776         directives are only processed if we are "taking" the path
17777
17778 2002-03-29  Martin Baulig  <martin@gnome.org>
17779
17780         * class.cs (Method.Emit): Only emit symbolic debugging info if the
17781         current location is not Null.
17782
17783         * codegen.cs (CodeGen.SaveSymbols): Split out symbol writing code into
17784         a separate method so we can profile it.
17785
17786         * driver.cs (ShowTime): We need to use `(int) span.TotalSeconds' since
17787         `span.Seconds' are just seconds, but no minutes or hours.
17788         (MainDriver): Profile the CodeGen.SaveSymbols calls.
17789
17790 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17791
17792         * class.cs (Method.Define), (Property.Define), (Indexer.Define):
17793         Remove the gratuitous set of Final:
17794
17795                                 // If an interface implementation, then we can set Final.
17796                                 if (((flags & MethodAttributes.Abstract) == 0) &&
17797                                     implementing.DeclaringType.IsInterface)
17798                                         flags |= MethodAttributes.Final;
17799
17800         I do not know what I was smoking when I used that.
17801
17802
17803         * cs-parser.jay, delegate.cs: Make Delegate be a DeclSpace, first
17804         step into fixing the name resolution issues for delegates and
17805         unifying the toplevel name resolution.
17806
17807 2002-03-28  Martin Baulig  <martin@gnome.org>
17808
17809         * class.cs (Method.Emit): If we have a symbol writer, call its
17810         OpenMethod(), CloseMethod() and SetMethodSourceRange() methods to
17811         tell it about the current method.
17812
17813         * codegen.cs (EmitContext.Mark): New public method. Tell the symbol
17814         writer that we're going to emit the first byte of IL code for a new
17815         statement (a new source line).
17816         (EmitContext.EmitTopBlock): If we have a symbol writer, call
17817         EmitContext.Mark() before emitting any code.
17818
17819         * location.cs (SymbolDocument): Return null when we're Null.
17820
17821         * statement.cs (Statement): Moved the `Location loc' variable here.
17822         (Statement.EmitBoolExpression): If we have a symbol writer, call
17823         ec.Mark() before emitting any code to tell it that we're at the
17824         beginning of a new statement.
17825         (StatementExpression): Added `Location' argument to the constructor.
17826         (Block): Added public readonly variable `StartLocation' and public
17827         variable `EndLocation'.  The latter is to be set using SetEndLocation().
17828         (Block): Added constructor which takes a start and end location.
17829         (Block.SetEndLocation): New method. This sets the end location.
17830         (Block.EmitMeta): If we have a symbol writer, tell it the names of the
17831         local variables we create.
17832         (Block.Emit): If we have a symbol writer, call ec.Mark() before emitting
17833         each statement and do also mark the begin and end of the block.
17834
17835         * cs-parser.jay (block : OPEN_BRACE): Use the new `Block' constructor to
17836         tell it the current lexer.Location, use Location.Null for the end of the
17837         block.
17838         (block : OPEN_BRACE opt_statement_list CLOSE_BRACE): When closing the
17839         current block, set its end location using SetEndLocation().
17840         (statement_expression): StatementExpression constructor now takes the
17841         lexer.Location as additional argument.
17842         (for_statement, declare_local_variables): Likewise.
17843         (declare_local_variables): When creating a new implicit block, use the
17844         new Block constructor and pass it the lexer.Location.
17845
17846 2002-03-28  Miguel de Icaza  <miguel@ximian.com>
17847
17848         * ecore.cs (Expression.MemberLookup): On interfaces, lookup
17849         members also on the parent interfaces recursively.
17850
17851 2002-03-27  Miguel de Icaza  <miguel@ximian.com>
17852
17853         * report.cs: Use new formats, since Gonzalo finished the missing
17854         bits. 
17855
17856         * expression.cs (Binary.ResolveOperator): added missing operator|
17857         operator& and operator^ for bool/bool.
17858
17859         * cs-parser.jay: CheckDef now takes a Location argument that is
17860         used to report errors more precisly (instead of reporting the end
17861         of a definition, we try to track something which is a lot closer
17862         to the source of the problem).
17863
17864         * cs-tokenizer.cs: Track global token use, so we can properly flag
17865         the use of #define/#undef after the first token has been seen.
17866
17867         Also, rename the reportXXXX to Error_DescriptiveName
17868
17869         * decl.cs (DeclSpace.IsTopLevel): Move property here from
17870         TypeContainer, so that Enum and Interface can use this too.
17871
17872         * class.cs (TypeContainer.LookupInterfaceOrClass,
17873         GetInterfaceOrClass, GetClassBases, DefineType): Drop the
17874         `builder' argument.  Typically this was used to pass the parent
17875         builder (a ModuleBuilder or a TypeBuilder from whoever triggered
17876         the definition).  
17877
17878         The problem is that a nested class could trigger the definition of
17879         a toplevel class, and the builder would be obviously wrong in that
17880         case. 
17881
17882         So we drop this argument, and we compute dynamically the
17883         TypeBuilder/ModuleBuilder (the correct information was available
17884         to us anyways from DeclSpace.Parent)
17885
17886         * interface.cs (Interface.DefineInterface): Drop builder
17887         parameter cleanup like class.cs
17888
17889         * enum.cs (Enum.DefineEnum): Drop builder parameter.  Clean up
17890         like class.cs
17891
17892         * statement.cs (Switch.EmitObjectInteger): Emit short/ushort
17893         values. 
17894
17895         (Try.Emit): Propagate the returns value from the statement.
17896
17897         (Return.Emit): Even if we are leavning 
17898
17899         * driver.cs: Catch IOExpcetion for Directory.GetFiles as well.
17900
17901         * modifiers.cs: Fix the computation of MethodAttributes flags.
17902
17903 Tue Mar 26 21:14:36 CET 2002 Paolo Molaro <lupus@ximian.com>
17904
17905         * driver.cs: allow compilation of files that start with '/'.
17906         Add a default case when checking the argument of --target.
17907
17908 2002-03-25  Miguel de Icaza  <miguel@ximian.com>
17909
17910         * interface.cs: Implement the same search algorithm for types in
17911         the interface code.
17912
17913         * delegate.cs: Do not allow multiple definition.
17914
17915         * Recovered ChangeLog that got accidentally amputated
17916
17917         * interface.cs (Interface.DefineInterface): Prevent from double definitions.
17918
17919         * rootcontext.cs: Load manually enum to allow core classes to
17920         contain enumerations.
17921
17922         * enum.cs, ecore.cs, driver.cs, attribute.cs, class.cs, expression.cs:
17923         Update to new static methods in TypeManager.
17924
17925         * typemanager.cs (GetMethod, GetConstructor): Use our
17926         implementation of FindMembers to find the members, since during
17927         corlib compilation, the types are TypeBuilders and GetMethod and
17928         GetConstructor do not work.
17929
17930         Make all methods in TypeManager static.
17931
17932         (InitCodeHelpers): Split the functionality from
17933         the InitCodeTypes function.
17934
17935         * driver.cs: Call InitCodeHelpers after we have populated the
17936         types. 
17937
17938         * cs-parser.jay (delegate_declaration): we did not used to compute
17939         the delegate name correctly for void delegates.
17940
17941 2002-03-24  Miguel de Icaza  <miguel@ximian.com>
17942
17943         * rootcontext.cs (RootContext): Init the interface_resolve_order
17944         and type_container_resolve_order always.
17945
17946         (ResolveCore, BootstrapCorlib_ResolveClass,
17947         BootstrapCorlib_ResolveStruct): New functions to bootstrap the
17948         compiler when compiling with --nostdlib
17949
17950         * class.cs (TypeContainer.DefineType): Check that our parent is
17951         not null.  This test is most important when we are bootstraping
17952         the core types.
17953
17954         * codegen.cs: Split out the symbol writing code.
17955
17956 2002-03-25  Martin Baulig  <martin@gnome.org>
17957
17958         * driver.cs (-g): Made -g an alias for --debug.
17959
17960 2002-03-24  Martin Baulig  <martin@gnome.org>
17961
17962         * codegen.cs (SymbolWriter): New public variable. Returns the
17963         current symbol writer.
17964         (CodeGen): Added `bool want_debugging_support' argument to the
17965          constructor. If true, tell the ModuleBuild that we want debugging
17966         support and ask it for the ISymbolWriter.
17967         (Save): If we have a symbol writer, call it's Close() method after
17968         saving the assembly.
17969
17970         * driver.c (--debug): New command line argument to create a
17971         debugger information file.
17972
17973         * location.cs (SymbolDocument): New public property. Returns an
17974         ISymbolDocumentWriter object for the current source file or null
17975         if we don't have a symbol writer.
17976
17977 2002-03-21  Miguel de Icaza  <miguel@ximian.com>
17978
17979         * driver.cs (LoadAssembly): Correctly return when all the paths
17980         have been tried and not before.
17981
17982         * statement.cs (Switch.Emit): return the actual coverage for this
17983         statement (returns/not-returns)
17984
17985         (Switch.SimpleSwitchEmit): Do not generate jumps to the end of the
17986         switch of the statement if we are the last switch section.  That
17987         kills two problems: try/catch problems (we used to emit an empty
17988         nop at the end) and switch statements where all branches would
17989         return. 
17990
17991 2002-03-19  Miguel de Icaza  <miguel@ximian.com>
17992
17993         * driver.cs: Add default assemblies (the equivalent to the
17994         Microsoft CSC.RSP file)
17995
17996         * cs-tokenizer.cs: When updating `cols and setting it to zero,
17997         also update tokens_seen and set it to false.
17998
17999         * driver.cs: Implement --recurse for Mike.
18000
18001         * driver.cs (SplitPathAndPattern): Small bug fix, I was not
18002         correctly splitting out the paths.
18003
18004 2002-03-18  Miguel de Icaza  <miguel@ximian.com>
18005
18006         * interface.cs (Interface.PopulateProperty): Instead of using
18007         `parent' as the declaration space for the set parameters, use
18008         `this' 
18009
18010         * support.cs (InternalParameters): InternalParameters constructor
18011         takes a DeclSpace instead of a TypeContainer.
18012
18013         * expression.cs (ArrayCreation.EmitDynamicInitializers): If value
18014         types are being initialized, load the address of it before calling
18015         the function.  
18016
18017         (New): Provide a mechanism to disable the generation of local
18018         value type temporaries when the caller will be providing us with
18019         an address to store it.
18020
18021         (ArrayCreation.EmitDynamicInitializers): Use it.
18022
18023 2002-03-17  Miguel de Icaza  <miguel@ximian.com>
18024
18025         * expression.cs (Invocation.EmitArguments): Only probe for array
18026         property if there is more than one argument.  Sorry about that.
18027
18028         * class.cs (Invocation.EmitArguments): Fix to emit arguments for
18029         empty param arrays.
18030
18031         * class.cs (Method.LabelParameters): Fix incorrect code path that
18032         prevented the `ParamArrayAttribute' from being applied to the
18033         params attribute.
18034
18035 2002-03-16  Miguel de Icaza  <miguel@ximian.com>
18036
18037         * support.cs (ReflectionParameters): Correctly compute whether the
18038         last argument is a params array.  Fixes the problem with
18039         string.Split ('a')
18040
18041         * typemanager.cs: Make the assemblies array always be non-null
18042         (empty, but non-null)
18043
18044         * tree.cs (RecordDecl): New function that abstracts the recording
18045         of names.  This reports error 101, and provides a pointer to the
18046         previous declaration.  Fixes a crash in the compiler.
18047
18048         * cs-parser.jay (constructor_declaration): Update to new grammar,
18049         and provide a constructor_body that can be empty.
18050
18051 2002-03-15  Miguel de Icaza  <miguel@ximian.com>
18052
18053         * driver.cs: Add support for --resources.
18054
18055         * expression.cs: (FetchGetMethod, FetchAddressMethod, EmitAssign):
18056         Make all types for the various array helper methods be integer.
18057
18058         * ecore.cs (Expression.ConvertNumericExplicit): Pass the
18059         CheckState to ConvCast.
18060
18061         (ConvCast): Now it takes a `checked' state argument, to avoid
18062         depending on the emit context for the conversion, and just using
18063         the resolve time setting.
18064
18065         * expression.cs (ArrayCreation.EmitArrayArguments): New function,
18066         instead of Invocation.EmitArguments.  We do not emit the original
18067         arguments, instead we emit those which have been converted to
18068         unsigned int expressions.
18069
18070         * statement.cs (Block.EmitMeta): Drop tracking of indexes.
18071
18072         * codegen.cs: ditto.
18073
18074         * expression.cs (LocalVariableReference): Drop the use of the
18075         Store function that depended on the variable index.
18076
18077         * statement.cs (VariableInfo): Drop the `Idx' property from this
18078         class, as this is not taking into account the indexes for
18079         temporaries tat we generate during the execution, getting the
18080         indexes wrong.
18081
18082         * class.cs: First emit class initializers, then call the parent
18083         constructor. 
18084
18085         * expression.cs (Binary): Fix opcode emision.
18086         (UnaryMutator.EmitCode): Support checked code generation
18087
18088         * ecore.cs (MemberLookup): TypeManager.FindMembers will return
18089         matches for events for both the Static and Instance scans,
18090         pointing to the same element.   Fix that.
18091
18092 2002-03-14  Miguel de Icaza  <miguel@ximian.com>
18093
18094         * rootcontext.cs (ResolveTree): Always set the
18095         interface_resolve_order, because nested interfaces will be calling
18096         into us.
18097
18098         * class.cs (GetInterfaceOrClass): Track the same resolution
18099         process used by TypeManager.LookupType.  This fixes the nested
18100         type lookups in class declarations (separate path from
18101         LookupType). 
18102
18103         (TypeContainer.DefineType): Also define nested interfaces.
18104         (TypeContainer.RegisterOrder): New public function used to
18105         register the order in which child interfaces need to be closed.
18106
18107         Nested interfaces need to be closed after their parents have been
18108         created. 
18109
18110         * interface.cs (InterfaceAttr): Put all the logic for computing
18111         the interface attribute here. 
18112
18113         (DefineInterface): Register our interface order with the
18114         RootContext or with the TypeContainer depending on the case.
18115
18116 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18117
18118         * cs-parser.jay: rework foreach statement to work with the new
18119         changes to the policy on SimpleNames.
18120
18121         * report.cs: support Stacktrace on warnings as well.
18122
18123         * makefile: drop --unsafe and /unsafe from the compile.
18124
18125 2002-03-13  Ravi Pratap  <ravi@ximian.com>
18126
18127         * ecore.cs (StandardConversionExists): Modify to take an Expression
18128         as the first parameter. Ensure we do null -> reference type conversion
18129         checking.
18130
18131         * Everywhere : update calls accordingly, making use of MyEmptyExpr to store
18132         temporary Expression objects.
18133
18134 Wed Mar 13 12:32:40 CET 2002 Paolo Molaro <lupus@ximian.com>
18135
18136         * interface.cs: workaround bug in method overloading resolution
18137         (there is already a bugzilla bug for it).
18138
18139 2002-03-12  Miguel de Icaza  <miguel@ximian.com>
18140
18141         We could also solve this problem by having a separate path for
18142         performing type lookups, instead of DoResolve, we could have a
18143         ResolveType entry point, and only participating pieces of the
18144         production (simplename, deref, array) would implement this. 
18145
18146         * codegen.cs (EmitContext): New field OnlyLookupTypes used to
18147         signal SimpleName to only resolve type names and not attempt to
18148         resolve anything else.
18149
18150         * expression.cs (Cast): Set the flag.
18151
18152         * ecore.cs (SimpleName): Use the OnlyLookupTypes flag
18153
18154         * class.cs: Only report 108 if there is no `new' modifier.
18155
18156         * cs-parser.jay: rework foreach statement to work with the new
18157         changes to the policy on SimpleNames.
18158
18159         * report.cs: support Stacktrace on warnings as well.
18160
18161         * makefile: drop --unsafe and /unsafe from the compile.
18162
18163 2002-03-11  Miguel de Icaza  <miguel@ximian.com>
18164
18165         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18166         lookups here, instead of doing that at parse time.  This means
18167         that our grammar will not introduce `LocalVariableReferences' as
18168         expressions at this point.  That solves the problem of code like
18169         this:
18170
18171         class X {
18172            static void Main ()
18173            { int X = 1;
18174             { X x = null }}}
18175
18176         This is only half the fix.  The full fix requires parameters to
18177         also be handled in this way.
18178
18179         * Everywhere: Use ec.DeclSpace on calls to LookupType, as this
18180         makes the use more obvious of the DeclSpace.  The
18181         ec.TypeContainer.TypeBuilder is now only used to pull the
18182         TypeBuilder for it.
18183
18184         My theory is that I can get rid of the TypeBuilder completely from
18185         the EmitContext, and have typecasts where it is used (from
18186         DeclSpace to where it matters).  
18187
18188         The only pending problem is that the code that implements Aliases
18189         is on TypeContainer, and probably should go in DeclSpace.
18190
18191         * ecore.cs (SimpleName.SimpleNameResolve): Perform local variable
18192         lookups here, instead of doing that at parse time.  This means
18193         that our grammar will not introduce `LocalVariableReferences' as
18194         expressions at this point.  That solves the problem of code like
18195         this:
18196
18197         class X {
18198            static void Main ()
18199            { int X = 1;
18200             { X x = null }}}
18201
18202         This is only half the fix.  The full fix requires parameters to
18203         also be handled in this way.
18204
18205         * class.cs (Property.DefineMethod): When implementing an interface
18206         method, set newslot, when implementing an abstract method, do not
18207         set the flag (before we tried never setting it, or always setting
18208         it, which is the difference).
18209         (Indexer.DefineMethod): same.
18210         (Method.DefineMethod): same.
18211
18212         * ecore.cs: Only set the status used flag if we get back a Field.
18213
18214         * attribute.cs: Temporary hack, so Paolo can keep working.
18215
18216 2002-03-08  Ravi Pratap  <ravi@ximian.com>
18217
18218         * attribute.cs (Attribute.UnmanagedType): This is to keep track of
18219         the unmanaged type in the case we have a MarshalAs attribute.
18220
18221         (Resolve): Handle the case when we are parsing the special MarshalAs
18222         attribute [we need to store the unmanaged type to use later]
18223
18224         * typemanager.cs (marshal_as_attr_type): Built in type for the 
18225         MarshalAs Attribute.
18226
18227         * attribute.cs (ApplyAttributes): Recognize the MarshalAs attribute 
18228         on parameters and accordingly set the marshalling info.
18229
18230 2002-03-09  Miguel de Icaza  <miguel@ximian.com>
18231
18232         * class.cs: Optimizing slightly by removing redundant code after
18233         we switched to the `NoTypes' return value.
18234         (Property.DefineMethod): use NoTypes here too.
18235
18236         This fixes the bug I introduced in my last batch of changes.
18237
18238 2002-03-05  Ravi Pratap  <ravi@ximian.com>
18239
18240         * tree.cs (RecordEnum): Add. We now keep track of enums too.
18241
18242         * class.cs (LookupInterfaceOrClass): Check against the list of recorded
18243         Enums since those are types too. 
18244
18245         * cs-parser.jay (enum_declaration): Record enums as we parse them.
18246
18247         * enum.cs (DefineEnum): Return if the TypeBuilder has already been defined 
18248         thanks to a call during the lookup process.
18249
18250 2002-03-07  Miguel de Icaza  <miguel@ximian.com>
18251
18252         * statement.cs (Foreach): Lots of work to accomodate a particular
18253         kind of foreach statement that I had not kept in mind.  It is
18254         possible to have foreachs on classes that provide a GetEnumerator
18255         method that return objects that implement the "pattern" for using
18256         a foreach, there is no need to support GetEnumerator
18257         specifically. 
18258
18259         This is needed to compile nant.
18260
18261         * decl.cs: Only report 114 if the member is not `Finalize' and if
18262         the warning level is at least 2.
18263
18264         * class.cs: Moved the compare function from Method to
18265         MethodSignature. 
18266
18267         (MethodSignature.InheritableMemberSignatureCompare): Add new
18268         filter function that is used to extract inheritable methods from a
18269         class. 
18270
18271         (Method.Define): Use the new `inheritable_method_signature_filter'
18272         delegate
18273
18274         * cs-tokenizer.cs (get_cmd_arg): Do not add white space to the
18275         command. 
18276
18277 2002-03-06  Miguel de Icaza  <miguel@ximian.com>
18278
18279         * ecore.cs (Expression.ConvertReferenceExplicit): Removed dead code.
18280
18281         * cs-parser.jay: Add opt_semicolon to the interface declaration.
18282
18283         * expression.cs: Pass location information to
18284         ConvertImplicitStandard. 
18285
18286         * class.cs: Added debugging code to track return values from
18287         interfaces. 
18288
18289 2002-03-05  Miguel de Icaza  <miguel@ximian.com>
18290
18291         * expression.cs (Is.DoResolve): If either side of the `is' is an
18292         interface, do not flag the warning.
18293
18294         * ecore.cs (ImplicitReferenceConversion): We need a separate test
18295         for interfaces
18296
18297         * report.cs: Allow for --fatal to be used with --probe.
18298
18299         * typemanager.cs (NoTypes): Move the definition for the empty Type
18300         array here. 
18301
18302         * class.cs (TypeContainer.FindMembers): Also look for methods defined by
18303         properties. 
18304         (TypeContainer.DefineProxy): New function used to proxy to parent
18305         implementations when implementing interfaces.
18306         (TypeContainer.ParentImplements): used to lookup if our parent
18307         implements a public function that is required by an interface.
18308         (TypeContainer.VerifyPendingMethods): Hook this up.
18309
18310         * typemanager.cs (TypeManager, AddModule, AddAssembly): Make the
18311         `modules' and `assemblies' arraylists into arrays.  We only grow
18312         these are the very early start up of the program, so this improves
18313         the speedof LookupType (nicely measured).
18314
18315         * expression.cs (MakeByteBlob): Replaced unsafe code with
18316         BitConverter, as suggested by Paolo.
18317
18318         * cfold.cs (ConstantFold.Binary): Special case: perform constant
18319         folding of string concatenation, but if either side is a string,
18320         and the other is not, then return null, and let the runtime use
18321         the concatenation on the string plus the object (using
18322         `Object.ToString'). 
18323
18324 2002-03-04  Miguel de Icaza  <miguel@ximian.com>
18325
18326         Constant Folding has been implemented now.
18327
18328         * expression.cs (Unary.Reduce): Do not throw an exception, catch
18329         the error instead on types that are not supported in one's
18330         complement. 
18331
18332         * constant.cs (Constant and all children): New set of functions to
18333         perform implict and explicit conversions.
18334
18335         * ecore.cs (EnumConstant): Implement the new functions to perform
18336         conversion by proxying to the child expression.
18337
18338         * codegen.cs: (ConstantCheckState): Constant evaluation has its
18339         own separate setting that can not be turned off from the command
18340         line using --unchecked or --checked and is only controlled using
18341         the checked/unchecked statements and expressions.  This setting is
18342         used by the constant folder to flag errors.
18343
18344         * expression.cs (CheckedExpr, UncheckedExpr): Set the
18345         ConstantCheckState as well.   
18346
18347         During Resolve, they also have to flag the state, because the
18348         constant folder runs completely in the Resolve phase.
18349
18350         * statement.cs (Checked, Unchecked): Set the ConstantCheckState as
18351         well.
18352
18353 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18354
18355         * cfold.cs: New file, this file contains the constant folder.
18356
18357         * ecore.cs (IMemoryLocation.AddressOf): Now takes an extra
18358         argument to track whether we are using the resulting address to
18359         load or store a value and provide better error messages. 
18360
18361         (FieldExpr.Emit, FieldExpr.EmitAssign, FieldExpr.AddressOf): Use
18362         new AddressOf arguments.
18363
18364         * statement.cs (Foreach.EmitCollectionForeach): Update
18365
18366         * expression.cs (Argument.Emit): Call AddressOf with proper
18367         arguments to track usage.
18368
18369         (New.DoEmit): Call AddressOf with new arguments.
18370
18371         (Unary.Emit): Adjust AddressOf call.
18372
18373 2002-03-01  Ravi Pratap  <ravi@ximian.com>
18374
18375         * cs-parser.jay (member_access): Change the case for pre-defined types
18376         to use a MemberAccess instead of a SimpleName. Thanks to Felix again for 
18377         this suggestion.
18378
18379         * class.cs (Operator::Emit): If we are abstract or extern, we don't have
18380         a method body.
18381
18382         * attribute.cs (CheckAttribute, ApplyAttribute): Ensure that we treat operators
18383         essentially like methods and apply attributes like MethodImplOptions to them too.
18384
18385         * ecore.cs (SimpleName.SimpleNameResolve): Perform a check on ec.TypeContainer.TypeBuilder
18386         not being null.
18387
18388         * codegen.cs (EmitContext): The constructor now takes in an extra argument specifying the
18389         DeclSpace as the distinction is important. We provide sane defaults as usually the TypeContainer
18390         is the DeclSpace.
18391
18392         * Update code everywhere accordingly.
18393
18394         * ecore.cs : Change references to ec.TypeContainer to ec.DeclSpace where appropriate.
18395
18396         * cs-parser.jay (enum_declaration): Set the current namespace of the enum.
18397
18398 2002-02-28  Ravi Pratap  <ravi@ximian.com>
18399
18400         * rootcontext.cs (LookupType): As we cycle through the chain of namespaces
18401         try performing lookups against those instead of jumping straight into using
18402         the 'using' clauses.
18403
18404         (ImplicitParent): Add. Thanks to Felix Arrese-Igor for this idea.
18405
18406         (LookupType): Perform lookups in implicit parents too.
18407
18408         * class.cs (GetInterfaceOrClass): Modify to perform the exact same lookup
18409         sequence as RootContext.LookupType. 
18410
18411         * rootcontext.cs (NamespaceLookup): Split out code from LookupType which tries 
18412         the various cases of namespace lookups into this method.
18413
18414 2002-03-01  Miguel de Icaza  <miguel@ximian.com>
18415
18416         * cs-parser.jay: Add support for [Attribute ()] (empty arguments
18417         in positional arguments)
18418
18419         * class.cs (Operator): Update the AllowedModifiers to contain
18420         extern. 
18421
18422         * cs-parser.jay: Update operator declaration to allow for the
18423         operator body to be empty.
18424
18425         * cs-tokenizer.cs: Added '\u' unicode support in strings and hex
18426         values. 
18427
18428 2002-02-27  Miguel de Icaza  <miguel@ximian.com>
18429
18430         * class.cs (Method.Emit): Label parameters.
18431
18432         * driver.cs: Return 1 or 0 as the program exit code.
18433
18434 2002-02-26  Miguel de Icaza  <miguel@ximian.com>
18435
18436         * expression.cs: Special case the `null' object when trying to
18437         auto-compute the type, as anything can be explicitly converted to
18438         that. 
18439
18440         * ecore.cs (Expression.ConvertExplicit): Bug fix, thanks for
18441         spotting this Paolo.
18442
18443         (Expression.ImplicitNumericConversion): Perform comparissions of
18444         the type using the underlying type in the case of an enumeration
18445         rather than using the enumeration type for the compare.
18446
18447         Cope with the underlying == type case, which is not possible to
18448         catch before. 
18449
18450         (Expression.ConvertNumericExplicit): Perform comparissions of
18451         the type using the underlying type in the case of an enumeration
18452         rather than using the enumeration type for the compare.
18453
18454         * driver.cs: If the user does not supply an extension, assume .exe
18455
18456         * cs-parser.jay (if_statement): Rewrote so that we can track the
18457         location for the if statement.
18458
18459         * expression.cs (Binary.ConstantFold): Only concat strings when
18460         the operation is "+", not everything ;-)
18461
18462         * statement.cs (Statement.EmitBoolExpression): Take a location
18463         argument. 
18464         (If, While, Do): Track location.
18465
18466         * expression.cs (Binary.ResolveOperator): In the object + string
18467         case, I was missing a call to ConvertImplicit
18468
18469 2002-02-25  Ravi Pratap  <ravi@ximian.com>
18470
18471         * parameter.cs (Parameter.ExternalType): Take in extra DeclSpace and
18472         Location arguments. Ensure we use RootContext.LookupType to do our work
18473         and not try to do a direct Type.GetType and ModuleBuilder.GetType
18474
18475         * interface.cs (PopulateMethod): Handle the type of the parameter being
18476         null gracefully.
18477
18478         * expression.cs (Invocation.BetterFunction): Handle the case when we 
18479         have a params method with no fixed arguments and a call is made with no
18480         arguments.
18481
18482 2002-02-25  Miguel de Icaza  <miguel@ximian.com>
18483
18484         * cs-tokenizer.cs: Add support for the quote-escape-sequence in
18485         the verbatim-string-literal
18486
18487         * support.cs (InternalParameters.ParameterModifier): handle null
18488         fixed parameters.
18489         (InternalParameters.ParameterType): ditto.
18490
18491         * parameter.cs (VerifyArgs): Also check if the fixed parameter is
18492         duplicating the name of the variable parameter.
18493         (GetParameterByName): Fix bug where we were not looking up array
18494         paramters if they were the only present (thanks Paolo!).
18495         (GetParameterInfo): We only have an empty set of types if both
18496         fixed and array are set to null.
18497         (GetParameterInfo-idx): Handle FixedParameter == null
18498
18499         * cs-parser.jay: Handle the case where there is no catch
18500         statements (missing null test).
18501
18502 2002-02-22  Miguel de Icaza  <miguel@ximian.com>
18503
18504         * driver.cs (MainDriver): Be conservative on our command line
18505         handling.
18506
18507         Catch DirectoryNotFoundException when calling GetFiles.
18508
18509         (SplitPathAndPattern): Used to split the input specification into
18510         a path and a pattern that we can feed to Directory.GetFiles.
18511
18512 2002-02-21  Miguel de Icaza  <miguel@ximian.com>
18513
18514         * statement.cs (Fixed): Implement the last case of the Fixed
18515         statement (string handling).
18516
18517         * expression.cs (StringPtr): New class used to return a char * to
18518         a string;  Used by the Fixed statement.
18519
18520         * typemanager.cs: Add char_ptr_type.  Add get_OffsetToStringData method.
18521
18522         * expression.cs (Binary.ResolveOperator): Remove redundant
18523         MemberLookup pn parent type.
18524         Optimize union call, we do not need a union if the types are the same.
18525         (Unary.ResolveOperator): REmove redundant MemberLookup on parent
18526         type.
18527
18528         Specialize the use of MemberLookup everywhere, instead of using
18529         the default settings. 
18530
18531         (StackAlloc): Implement stackalloc keyword.
18532
18533         * cs-parser.jay: Add rule to parse stackalloc.
18534
18535         * driver.cs: Handle /h, /help, /?
18536
18537         * expression.cs (MakeByteBlob): Removed the hacks we had in place
18538         before we supported unsafe code.
18539
18540         * makefile: add --unsafe to the self compilation of mcs.
18541
18542 2002-02-20  Miguel de Icaza  <miguel@ximian.com>
18543
18544         * expression.cs (PointerArithmetic): New class that is used to
18545         perform pointer arithmetic.
18546         (Binary.Resolve): Handle pointer arithmetic
18547         Handle pointer comparission.
18548         (ArrayPtr): Utility expression class that is used to take the
18549         address of an array.
18550
18551         (ElementAccess): Implement array access for pointers
18552
18553         * statement.cs (Fixed): Implement fixed statement for arrays, we
18554         are missing one more case before we are done.
18555
18556         * expression.cs (Indirection): Implement EmitAssign and set the
18557         ExprClass to Variable.  This allows pointer dereferences to be
18558         treated as variables, and to have values assigned to them.
18559
18560         * ecore.cs (Expression.StoreFromPtr): New utility function to
18561         store values dereferencing.
18562
18563 2002-02-20  Ravi Pratap  <ravi@ximian.com>
18564
18565         * expression.cs (Binary.ResolveOperator): Ensure that we are
18566         not trying to operate on a void type - this fixes the reported
18567         bug.
18568
18569         * decl.cs (CheckMethodAgainstBase): Do not allow overriding if
18570         the parent implementation is sealed.
18571
18572         * ../errors/cs0239.cs : Add.
18573
18574         * attribute.cs (ApplyAttributes): Handle Modulebuilders too.
18575
18576         * typemanager.cs (unverifiable_code_type): Corresponds to 
18577         System.Security.UnverifiableCodeAttribute. We need to emit this for modules
18578         which have unsafe code in them.
18579
18580         * rootcontext.cs (EmitCode): Emit the above attribute when we are in an 
18581         unsafe context.
18582
18583 2002-02-19  Miguel de Icaza  <miguel@ximian.com>
18584
18585         * cs-tokenizer.cs: Add support for @"litreal strings"
18586
18587         Make tokenizer accept pre-processor directives
18588         on any column (remove the old C-like limitation). 
18589
18590         * rootcontext.cs (EmitCode): Emit any global attributes.
18591         (AddGlobalAttributes): Used to keep track of assembly attributes. 
18592
18593         * attribute.cs (ApplyAttributes): Support AssemblyAttributes.
18594
18595         * cs-parser.jay: Add support for global attributes.  
18596
18597 2002-02-17  Miguel de Icaza  <miguel@ximian.com>
18598
18599         * expression.cs (Indirection): New helper class.  Unary will
18600         create Indirection classes to be able to implement the
18601         IMemoryLocation interface on it.
18602
18603 2002-02-16  Miguel de Icaza  <miguel@ximian.com>
18604
18605         * cs-parser.jay (fixed_statement): reference the right statement.
18606
18607         * statement.cs (Fixed.Emit): Finish implementing the fixed
18608         statement for the &x case.
18609
18610 2002-02-14  Miguel de Icaza  <miguel@ximian.com>
18611
18612         * class.cs (Property.Define, Method.Define): Remove newslot when
18613         `implementing'.  
18614
18615         * modifiers.cs: My use of NewSlot when `Abstract' was set was
18616         wrong.  NewSlot should only be used if the `new' keyword is present.
18617
18618         * driver.cs (GetSystemDir): Use CodeBase instead of FullName for
18619         locating our system dir.  Sorry about this.
18620
18621 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18622
18623         * driver.cs (GetSystemDir): Compute correctly the location of our
18624         system assemblies.  I was using the compiler directory instead of
18625         the library directory.
18626
18627 2002-02-13  Ravi Pratap  <ravi@ximian.com>
18628
18629         * expression.cs (BetterFunction): Put back in what Miguel commented out
18630         since it is the correct fix. The problem is elsewhere ;-)
18631
18632         (IsParamsMethodApplicable): Fix bug where we were not checking that the fixed
18633         parameters of the parms method are themselves compatible or not !
18634
18635         (StandardConversionExists): Fix very dangerous bug where we were forgetting
18636         to check that a class implements an interface before saying that an implicit
18637         conversion was allowed. Use ImplementsInterface to do the checking.
18638
18639 2002-02-13  Miguel de Icaza  <miguel@ximian.com>
18640
18641         * class.cs (Method.Define): Track whether we are an explicit
18642         implementation or not.  And only call DefineMethodOverride if we
18643         are an explicit implementation.
18644
18645         (Property.DefineMethod): Ditto.
18646
18647 2002-02-11  Ravi Pratap  <ravi@ximian.com>
18648
18649         * expression.cs (BetterFunction): Catch hideous bug which was
18650          preventing us from detecting ambiguous calls due to implicit casts i.e
18651         cs0121.
18652
18653 2002-01-29  Miguel de Icaza  <miguel@ximian.com>
18654
18655         * support.cs (Pair): Remove un-needed method.  I figured why I was
18656         getting the error in cs-parser.jay, the variable in a foreach loop
18657         is readonly, and the compiler does not really treat this as a variable.
18658
18659         * cs-parser.jay (fixed_statement): Fix grammar.  Use ASSIGN
18660         instead of EQUALS in grammar.  
18661
18662         * typemanager.cs (VerifyUnmanaged): Report correct error (208)
18663
18664         * expression.cs (Unary.DoResolve): Check whether the argument is
18665         managed or not.
18666
18667 2002-01-28  Miguel de Icaza  <miguel@ximian.com>
18668
18669         * support.cs: Api for Pair to set a value.  Despite the fact that
18670         the variables are public the MS C# compiler refuses to compile
18671         code that accesses the field if the variable is part of a foreach
18672         statement. 
18673
18674         * statement.cs (Fixed): Begin implementation of the fixed
18675         statement.
18676
18677         (Block.AddVariable): Return the VariableInfo on success and null
18678         on failure instead of true/false. 
18679
18680         * cs-parser.jay (foreach): Catch errors on variables already
18681         defined (we were ignoring this value before) and properly unwind
18682         the block hierarchy
18683
18684         (fixed_statement): grammar for the fixed statement.
18685
18686 2002-01-25  Miguel de Icaza  <miguel@ximian.com>
18687
18688         * expression.cs (UnaryMutator.IsIncrementableNumber): Allow also
18689         pointer types to be incretemented.
18690
18691         (SizeOf): Implement.
18692
18693         * cs-parser.jay (pointer_member_access): Implement
18694         expr->IDENTIFIER production.
18695
18696         * expression.cs (IndexerAccess.DoResolve, ArrayAccess.DoResolve,
18697         MemberAccess.DoResolve, Invocation.DoResolve): Check for pointers
18698         on safe contexts.
18699
18700         (Unary): Implement indirection.
18701
18702         * ecore.cs (Expression.UnsafeError): Reports error 214 (pointer
18703         use in non-unsafe context).
18704
18705         (SimpleName.DoResolve): Check for pointers in field access on safe
18706         contexts. 
18707
18708         (Expression.LoadFromPtr): Factor the load-indirect code in this
18709         function.  This was duplicated in UnboxCast and ParameterReference
18710
18711 2002-01-24  Miguel de Icaza  <miguel@ximian.com>
18712
18713         * expression.cs (ComposedCast): report an error if a pointer cast
18714         is used in a safe region.
18715
18716         * ecore.cs (Expression.ConvertExplicit): Add rules for implicit
18717         pointer type casts in unsafe context.
18718
18719         * codegen.cs (EmitContext): Set up IsUnsafe.
18720
18721         * cs-parser.jay (non_expression_type): Add productions for pointer
18722         casts. 
18723
18724         * expression.cs (Invocation.EmitCall): Remove chunk of buggy
18725         code.  We should not use force into static mode if the method is
18726         not virtual.  Fixes bug in MIS
18727
18728         * statement.cs (Do.Emit, While.Emit, For.Emit,
18729         Statement.EmitBoolExpression): Add support to Do and While to
18730         propagate infinite loop as `I do return' semantics.
18731
18732         Improve the For case to also test for boolean constants.
18733
18734         * attribute.cs (Attribute.ApplyAttributes): Add ParameterBuilder
18735         to the list of attributes we can add.
18736
18737         Remove `EmitContext' argument.
18738
18739         * class.cs (Method.Define): Apply parameter attributes.
18740         (Constructor.Define): Apply parameter attributes.
18741         (MethodCore.LabelParameters): Move here the core of labeling
18742         parameters. 
18743
18744         * support.cs (ReflectionParameters.ParameterModifier,
18745         InternalParameters.ParameterModifier): Use IsByRef on the type and
18746         only return the OUT bit for these parameters instead of in/out/ref
18747         flags.
18748
18749         This is because I miss-understood things.  The ParameterInfo.IsIn
18750         and IsOut represent whether the parameter has the [In] and [Out]
18751         attributes set.  
18752
18753 2002-01-22  Miguel de Icaza  <miguel@ximian.com>
18754
18755         * ecore.cs (FieldExpr.Emit): Release temporaries.
18756
18757         * assign.cs (LocalTemporary.Release): new function.
18758
18759         * codegen.cs (EmitContext.GetTemporaryStorage,
18760         EmitContext.FreeTemporaryStorage): Rework the way we deal with
18761         temporary storage.  Now we can "put back" localbuilders when we
18762         are done with them
18763
18764 2002-01-21  Miguel de Icaza  <miguel@ximian.com>
18765
18766         * ecore.cs (FieldExpr.Emit): Handle initonly fields specially: we
18767         need to make a copy of the variable to generate verifiable code.
18768
18769 2002-01-19  Miguel de Icaza  <miguel@ximian.com>
18770
18771         * driver.cs: Compute dynamically the system directory.
18772
18773         * ecore.cs (CopyNewMethods): reworked, exposed, made public.
18774         Slower, but more generally useful.  Used by the abstract
18775         registering implementation. 
18776
18777         * expression.cs (ResolveMemberAccess): Reorder the way we evaluate
18778         the rules for the special rule on Type/instances.  First check if
18779         we have the same name, and if so, try that special static path
18780         rather than the instance path.
18781
18782 2002-01-18  Miguel de Icaza  <miguel@ximian.com>
18783
18784         * cs-parser.jay: Emit 642 (warning: possible empty statement) for
18785         for, while and if.
18786
18787         * class.cs (TypeBuilder.DefineType): Do not allow inheritance from
18788         Enum, ValueType, Delegate or Array for non-corlib compiles.
18789
18790         * cs-tokenizer.cs: Catch long identifiers (645)
18791
18792         * typemanager.cs (IndexerPropetyName): Ravi never tested this
18793         piece of code.
18794
18795         * class.cs (TypeContainer.RegisterRequiredImplementations): Bug
18796         fix, we were returning too early, so we were not registering
18797         pending methods from abstract classes.
18798
18799         Do not register pending methods if the class is abstract.
18800
18801         * expression.cs (Conditional.DoResolve): Report circular implicit
18802         conversions when we neecd to compute it for conditional
18803         expressions. 
18804
18805         (Is.DoResolve): If the expression is always of the provided type,
18806         flag warning 183.  If the expression can not ever be of the
18807         provided type flag warning 184.
18808
18809         * class.cs: Catch 169 as well.
18810
18811         * ecore.cs (FieldExpr): For now in AddressOf mark as assigned and
18812         read. 
18813
18814 2002-01-18  Nick Drochak  <ndrochak@gol.com>
18815
18816         * makefile: remove path to beta2 csc.exe.  path to csc.exe must be in PATH instead.
18817
18818 2002-01-17  Miguel de Icaza  <miguel@ximian.com>
18819
18820         * interface.cs: (PopulateMethod): Check for pointers being defined
18821         only if the unsafe context is active.
18822         (PopulateProperty): ditto.
18823         (PopulateIndexer): ditto.
18824
18825         * class.cs (Method, Method.Define): Allow `unsafe' modifier to be
18826         specified.  If pointers are present, make sure that they are
18827         present in an unsafe context.
18828         (Constructor, Constructor.Define): ditto.
18829         (Field, Field.Define): ditto.
18830         (Property, Property.Define): ditto.
18831         (Event, Event.Define): ditto.
18832
18833         * interface.cs (Interface.GetInterfaceTypeByName): Only lookup the
18834         hashtable if there are classes or structs defined.
18835
18836         * expression.cs (LocalVariableReference.DoResolve): Simplify this
18837         code, as the constant resolution moved.
18838
18839         * statement.cs (Block.EmitMeta): Resolve all constants as we emit
18840         the metadata, so we can flag error 133. 
18841
18842         * decl.cs (MemberCore.UnsafeOK): New function to test that a
18843         pointer is being declared in an unsafe context.
18844
18845 2002-01-16  Miguel de Icaza  <miguel@ximian.com>
18846
18847         * modifiers.cs (Modifiers.Check): Require a Location argument.
18848         Report error 227 for Unsafe use.
18849
18850         * typemanager.cs: Remove IsPointerType, we should be using Type.IsPointer
18851
18852         * statement.cs (For.Emit): If the test is null, then report that
18853         we do `return', as we wont reach anything afterwards.
18854
18855         (Switch.SwitchGoverningType): Track the expression that matched
18856         the conversion.
18857
18858         * driver.cs: Allow negative numbers as an error code to flag.
18859
18860         * cs-parser.jay: Handle 1551.
18861
18862         * namespace.cs: Add 1537 checking (repeated using alias namespaces).
18863
18864 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18865
18866         * cs-parser.jay: Report 1518 (type declaration can only contain
18867         class, struct, interface, enum or delegate)
18868
18869         (switch_label): Report 1523 (keywords `case' or `default' must
18870         preced code)
18871
18872         (opt_switch_sections): Report 1522 (empty switch)
18873
18874         * driver.cs: Report 1515 (response file specified multiple times)
18875         Report 1516 (Source file specified multiple times).
18876
18877         * expression.cs (Argument.Resolve): Signal 1510
18878
18879         (BaseAccess.Resolve, BaseIndexer.Resolve): Signal 1511 (base
18880         access not allowed in static code)
18881
18882 2002-01-11  Ravi Pratap  <ravi@ximian.com>
18883
18884         * typemanager.cs (IsPointerType): Utility method which we are going
18885         to need a lot.
18886
18887         * ecore.cs (ImplicitReferenceConversion): A pointer type cannot be cast to
18888         the object type, so we take care of that.
18889
18890         * expression.cs (FullMethodDesc): Also include the return type in descriptions.
18891
18892         * support.cs (ParameterDesc): Fix minor bug which was causing params tags to be
18893         added to non-params parameters :-)
18894
18895         * typemanager.cs (CSharpName): Include 'void' type too. 
18896
18897         (void_ptr_type): Include in the set of core types.
18898
18899         * ecore.cs (ConvertImplicit): Make use of ConvertImplicitStandard instead of 
18900         duplicating code.
18901
18902         (ConvertImplicitStandard): Handle standard implicit pointer conversions when we have 
18903         an unsafe context.
18904
18905         * cs-parser.jay (local_variable_pointer_type): Add support for 'void *' as I had 
18906         completely forgotten about it.
18907
18908 2002-01-10  Ravi Pratap  <ravi@ximian.com>
18909
18910         * cs-parser.jay (pointer_type): Add. This begins our implementation
18911         of parsing rules for unsafe code.
18912
18913         (unsafe_statement): Implement.
18914
18915         (embedded_statement): Modify to include the above.
18916
18917         * statement.cs (Unsafe): Implement new class for unsafe blocks.
18918
18919         * codegen.cs (EmitContext.InUnsafe): Add. This determines
18920         if the current context is an unsafe one.
18921
18922         * cs-parser.jay (local_variable_pointer_type): Since local variable types
18923         are handled differently, we need separate rules for them.
18924
18925         (local_variable_declaration): Update to use local_variable_pointer_type
18926         to allow variable declarations of unmanaged pointer types.
18927
18928         * expression.cs (Unary.ResolveOperator): Ensure that the '&' operator is used only
18929         in unsafe contexts.
18930
18931         * ../errors/cs0214.cs : Add.
18932
18933 2002-01-16  Nick Drochak  <ndrochak@gol.com>
18934
18935         * makefile: remove 'response' file when cleaning.
18936
18937 2002-01-15  Miguel de Icaza  <miguel@ximian.com>
18938
18939         * cs-parser.jay: Report 1524.
18940
18941 2002-01-14  Miguel de Icaza  <miguel@ximian.com>
18942
18943         * typemanager.cs (RegisterMethod): drop checking if we have
18944         registered this from here
18945
18946 2002-01-12  Miguel de Icaza  <miguel@ximian.com>
18947
18948         * class.cs (Method.EmitDestructor): Implement calling our base
18949         destructor. 
18950
18951         * statement.cs (Try.Emit): Fix to reset the InFinally to the old
18952         value of InFinally.
18953
18954         * codegen.cs (EmitContext.EmitTopBlock): Destructors will call
18955         this routine and will wrap the call in a try/catch block.  Deal
18956         with the case.
18957
18958 2002-01-11  Miguel de Icaza  <miguel@ximian.com>
18959
18960         * ecore.cs (Expression.MemberLookup): instead of taking a
18961         parameter `same_type' that was used to tell whether we could
18962         access private members we compute our containing type from the
18963         EmitContext.
18964
18965         (FieldExpr): Added partial support for volatile fields.  This does
18966         not work for volatile fields exposed from assemblies, as I can not
18967         figure out how to extract the modreq from it.
18968
18969         Updated all the source files to use this.
18970
18971         * codegen.cs (EmitContext): Compute ContainerType ahead of time,
18972         because it is referenced by MemberLookup very often. 
18973
18974 2002-01-09  Ravi Pratap  <ravi@ximian.com>
18975
18976         * typemanager.cs (IndexerPropertyName): If we have a TypeBuilder, use
18977         TypeBuilder.GetCustomAttributes to retrieve what we need.
18978
18979         Get rid of redundant default_member_attr_type as this is the same as
18980         default_member_type which already exists.
18981
18982         * interface.cs, attribute.cs : Update accordingly.
18983
18984 2002-01-08  Miguel de Icaza  <miguel@ximian.com>
18985
18986         * typemanager.cs: Enable IndexerPropertyName again.  It does not
18987         work for TYpeBuilders though.  Ravi, can you please fix this?
18988
18989         * cs-tokenizer.cs: Accept _ as a name in pp-expressions.
18990
18991         * expression.cs (Argument.Emit): Handle the case of ref objects
18992         being passed to ref functions;  
18993
18994         (ParameterReference.EmitLoad): Loads the content of the pointer
18995         without dereferencing.
18996
18997 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
18998
18999         * cs-tokenizer.cs: Implemented the pre-processing expressions.
19000
19001 2002-01-08  Ravi Pratap  <ravi@ximian.com>
19002
19003         * class.cs (Indexer.DefineMethod): Incorporate the interface
19004         type in the name of the method if we are doing explicit interface
19005         implementation.
19006
19007         * expression.cs (ConversionExists): Remove as it is completely obsolete.
19008
19009         (BetterConversion): Fix extremely trivial bug where we were referring to
19010         ConversionExists instead of StandardConversionExists ! Hooray, things are fine
19011         again !
19012
19013         * ../errors/bug16.cs : Add although we have fixed it.
19014
19015 2002-01-07  Miguel de Icaza  <miguel@ximian.com>
19016
19017         * expression.cs (BaseIndexer): Begin implementation.
19018
19019         * class.cs (TypeContainer.IsInterfaceMethod): Bug fix.
19020
19021         * cs-parser.jay (indexer_declarator): Use qualified_identifier
19022         production directly to remove a shift/reduce, and implement
19023         explicit interface implementation.
19024
19025         * cs-tokenizer.cs: Fix tokenizer, it was consuming one extra char
19026         after a floating point suffix.
19027
19028         * expression.cs (DoNumericPromotions): Improved the conversion for
19029         uint/uint.  If we have a constant, we avoid doing a typecast to a
19030         larger type.
19031
19032         * class.cs (Indexer): Implement explicit interface implementation
19033         for indexers.
19034
19035 Sat Jan 5 16:08:23 CET 2002 Paolo Molaro <lupus@ximian.com>
19036
19037         * class.cs: make the default instance constructor public and hidebysig.
19038
19039 2001-01-03  Ravi Pratap  <ravi@ximian.com>
19040
19041         * interface.cs (EmitDefaultMemberAttr): Make this helper method static
19042         so we can call it from elsewhere.
19043
19044         * class.cs (TypeContainer.Emit): Emit the attribute here too. The rule is that
19045         we emit it internally if the class has a defined indexer; otherwise the user
19046         emits it by decorating the class definition with the DefaultMemberAttribute.
19047
19048         * attribute.cs (ApplyAttributes): Perform checks to see that the DefaultMember
19049         attribute is not used on a type which defines an indexer.
19050
19051         * cs-tokenizer.cs (get_cmd_arg): Ensure we trim whitespace and also include the tab
19052         character when we skip whitespace.
19053
19054         * ../errors/cs0646.cs : Add.
19055
19056 2002-01-03  Miguel de Icaza  <miguel@ximian.com>
19057
19058         * ecore.cs (SimpleName.ResolveSimpleName): Report error 120
19059         again. 
19060
19061         * makefile: Add practical target `mcs3.exe' which builds the third
19062         generation compiler. 
19063
19064         * expression.cs (New): Fix structures constructor calling.
19065
19066         * class.cs (Property, Method, Indexer): Emit Final flag on the
19067         method if we are an interface implementation and we are not
19068         abstract. 
19069
19070         * ecore.cs (PropertyExpr): New public field `IsBase', tells
19071         whether this property is referencing a `base' method.
19072
19073         * expression.cs (Invocation.EmitCall): take an extra argument:
19074         is_base, this is used to determine whether the `call' or
19075         `callvirt' opcode should be used.
19076
19077
19078         * delegate.cs: update EmitCall.
19079
19080         * class.cs (Method.Define): Set NewSlot for the cases where we are
19081         not implementing an interface method.
19082
19083         (Property.Define): ditto.
19084
19085 2002-01-02  Miguel de Icaza  <miguel@ximian.com>
19086
19087         * cs-tokenizer.cs: (Tokenizer.escape): Escape '\r' as '\r' not as
19088         'r'.  Allows mcs to parse itself fully.
19089
19090 2002-01-02  Ravi Pratap  <ravi@ximian.com>
19091
19092         * expression.cs (ArrayCreation.num_automatic_initializers): Keep track
19093         of the number of initializers that require the InitializeArray method.
19094
19095         (CheckIndices): Store the Expression in all cases - not the plain value. Also
19096         update the above field where necessary.
19097
19098         (MakeByteBlob): Update accordingly.
19099
19100         (DoEmit): Call EmitStaticInitializers only if the number of initializers is 
19101         greater than 2.
19102
19103         (EmitDynamicInitializers): Update in accordance with the new optimization.
19104
19105         (ArrayAccess.EmitStoreOpcode): Include char type along with short and ushort - the
19106         same OpCode applies.
19107
19108         * cs-parser.jay : Fix some glaring errors I introduced.
19109
19110 2002-01-01  Ravi Pratap  <ravi@ximian.com> 
19111
19112         * parameters.cs (AddVariable, AddConstant): Pass in current_local_parameters
19113         so that we can check for name clashes there too.
19114
19115         * typemanager.cs (default_member_attr_type): The attribute that we need to emit
19116         for interface indexers.
19117
19118         * interfaces.cs (Define): Emit the default member attribute.
19119
19120         * expression.cs (MakeByteBlob): Fix extremely trivial bug where the wrong
19121         variable was being referred to while setting the value ;-)
19122
19123 2002-01-01  Miguel de Icaza  <miguel@ximian.com>
19124
19125         * expression.cs (MakeByteBlob): Optimize: we do not need to fill
19126         byte-by-byte information when we know the data is zero.
19127
19128         Make the block always a multiple of 4, because
19129         DefineInitializedData has a bug.
19130
19131         * assign.cs: Fix, we should assign from the temporary, not from
19132         the source. 
19133
19134         * expression.cs (MakeByteBlob): Fix my incorrect code.
19135
19136 2001-12-31  Miguel de Icaza  <miguel@ximian.com>
19137
19138         * typemanager.cs (EnumToUnderlying): This function is used to get
19139         the underlying type from an enumeration, because it does not
19140         always work. 
19141
19142         * constant.cs: Use the I4_S form for values between -128 and 127.
19143
19144         * statement.cs (Block.LookupLabel): Looks up a label.
19145         (Block): Drop support for labeled blocks.
19146
19147         (LabeledStatement): New kind of statement that represents a label
19148         only.
19149
19150         (Goto): Finally implement this bad boy.
19151
19152         * cs-parser.jay: Update to reflect new mechanism to implement
19153         labels.
19154
19155 2001-12-30  Miguel de Icaza  <miguel@ximian.com>
19156
19157         * codegen.cs (EmitContext.This): a codegen property that keeps the
19158         a single instance of this instead of creating many different this
19159         instances. 
19160
19161         * delegate.cs (Delegate.DoResolve): Update to use the property;
19162
19163         * ecore.cs (SimpleName.SimpleNameResolve): Ditto
19164
19165         * expression.cs (BaseAccess.DoResolve): Ditto.
19166
19167 2001-12-29  Ravi Pratap  <ravi@ximian.com>
19168
19169         * typemanager.cs (methodimpl_attr_type): Add to hold the type
19170         corresponding to System.Runtime.CompilerServices.MethodImplAttribute.
19171
19172         (InitCoreTypes): Update accordingly.
19173
19174         * attribute.cs (Resolve): Remember if the attribute is a MethodImplAttribute
19175         so we can quickly store the state.
19176
19177         (ApplyAttributes): Set the correct implementation flags
19178         for InternalCall methods.
19179
19180 2001-12-29  Miguel de Icaza  <miguel@ximian.com>
19181
19182         * expression.cs (EmitCall): if a method is not virtual, then do
19183         not use callvirt on it.
19184
19185         (ArrayAccess.EmitAssign): storing non-builtin value types (ie,
19186         user defined stuff) requires the use of stobj, which takes an
19187         address on the stack instead of an array and an index.  So emit
19188         the Ldelema operation for it.
19189
19190         (EmitStoreOpcode): Use stobj for valuetypes.
19191
19192         (UnaryMutator.EmitCode): Use the right 1 value depending on
19193         whether we are dealing with int64/uint64, float or doubles.
19194
19195         * class.cs (TypeContainer.AddConstructor): Fix the logic to define
19196         constructors that I implemented last night.
19197
19198         (Constructor.IsDefault): Fix to work properly for static
19199         constructors.
19200
19201         * cs-parser.jay (CheckDef): report method signature errors.
19202         Update error number 103 to be 132.
19203
19204         * decl.cs: New AdditionResult enumeration value: MethodExists.
19205         Although we do this check for methods later on in the semantic
19206         analysis, catching repeated default constructors is so easy that
19207         we catch these here. 
19208
19209         * expression.cs (Binary.DoNumericPromotions): Fix the uint64 type
19210         promotions code.
19211
19212         (ParameterReference.EmitAssign, Emit): handle
19213         bools as bytes.
19214
19215         (ArrayAccess.EmitLoadOpcode): Handle bool type here.
19216         (ArrayAccess.EmitStoreOpcode): ditto.
19217
19218         * cs-tokenizer.cs (is_punct): Eliminated empty computation.
19219
19220         * expression.cs (MakeByteBlob): Complete all the missing types
19221         (uint, short, ushort, byte, sbyte)
19222
19223         * class.cs: Only init instance field initializers on instance
19224         constructors. 
19225
19226         Rename `constructors' to instance_constructors. 
19227
19228         (TypeContainer.AddConstructor): Only add constructors to the list
19229         if it is not static.
19230
19231         Make sure that we handle default_static_constructor independently
19232         everywhere where we handle instance_constructors
19233
19234 2001-12-28  Miguel de Icaza  <miguel@ximian.com>
19235
19236         * class.cs: Do not lookup or create a base initializer for a
19237         static constructor.
19238
19239         (ConstructorInitializer.Resolve): use the proper type to lookup
19240         for constructors.
19241
19242         * cs-parser.jay: Report error 1585 (modifiers between type and name).
19243
19244         * enum.cs, interface.cs: Remove CloseType, this is taken care by
19245         in DeclSpace. 
19246
19247         * decl.cs: CloseType is now an virtual method, the default
19248         implementation just closes this type.
19249
19250 2001-12-28  Ravi Pratap  <ravi@ximian.com>
19251
19252         * attribute.cs (DefinePInvokeMethod): Set the implementation flags
19253         to PreserveSig by default. Also emit HideBySig on such methods.
19254
19255         Basically, set the defaults to standard values.
19256
19257         * expression.cs (Invocation.BetterFunction): We need to make sure that for each
19258         argument, if candidate is better, it can't be worse than the best !
19259
19260         (Invocation): Re-write bits to differentiate between methods being
19261         applicable in their expanded form and their normal form - for params
19262         methods of course.
19263
19264         Get rid of use_standard everywhere as only standard conversions are allowed
19265         in overload resolution. 
19266
19267         More spec conformance.
19268
19269 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19270
19271         * driver.cs: Add --timestamp, to see where the compiler spends
19272         most of its time.
19273
19274         * ecore.cs (SimpleName.DoResolve): Do not create an implicit
19275         `this' in static code.
19276
19277         (SimpleName.DoResolve): Implement in terms of a helper function
19278         that allows static-references to be passed upstream to
19279         MemberAccess.
19280
19281         (Expression.ResolveWithSimpleName): Resolve specially simple
19282         names when called by MemberAccess to implement the special
19283         semantics. 
19284
19285         (Expression.ImplicitReferenceConversion): Handle conversions from
19286         Null to reference types before others, as Null's type is
19287         System.Object. 
19288
19289         * expression.cs (Invocation.EmitCall): Handle the special case of
19290         calling methods declared on a reference type from a ValueType
19291         (Base classes System.Object and System.Enum)
19292
19293         (MemberAccess.Resolve): Only perform lookups on Enumerations if
19294         the left hand side is a TypeExpr, not on every enumeration. 
19295
19296         (Binary.Resolve): If types are reference types, then do a cast to
19297         object on operators != and == of both arguments.
19298
19299         * typemanager.cs (FindMembers): Extract instance and static
19300         members if requested.
19301
19302         * interface.cs (PopulateProperty): Use void_type instead of null
19303         as the return type for the setter method.
19304
19305         (PopulateIndexer): ditto.
19306
19307 2001-12-27  Ravi Pratap  <ravi@ximian.com>
19308
19309         * support.cs (ReflectionParameters): Fix minor bug where we
19310         were examining the wrong parameter for the ParamArray attribute.
19311
19312         Cope with requests for the type of the parameter at position
19313         greater than the params parameter's. We now return the element
19314         type of the params array as that makes more sense.
19315
19316         * expression.cs (Invocation.IsParamsMethodApplicable): Update 
19317         accordingly as we no longer have to extract the element type
19318         ourselves.
19319
19320         (Invocation.OverloadResolve): Update.
19321
19322 2001-12-27  Miguel de Icaza  <miguel@ximian.com>
19323
19324         * statement.cs (Foreach.GetEnumeratorFilter): Do not compare
19325         against IEnumerator, test whether the return value is a descendant
19326         of the IEnumerator interface.
19327
19328         * class.cs (Indexer.Define): Use an auxiliary method to implement
19329         the other bits of the method definition.  Begin support for
19330         explicit interface implementation.
19331
19332         (Property.DefineMethod): Use TypeManager.void_type instead of null
19333         for an empty return value.
19334
19335 2001-12-26  Miguel de Icaza  <miguel@ximian.com>
19336
19337         * expression.cs (MemberAccess.ResolveMemberAccess): if we are
19338         dealing with a FieldExpr which is composed of a FieldBuilder, in
19339         the code path we did extract the constant, but we should have
19340         obtained the underlying value to be able to cast it (otherwise we
19341         end up in an infinite loop, this is what Ravi was running into).
19342
19343         (ArrayCreation.UpdateIndices): Arrays might be empty.
19344
19345         (MemberAccess.ResolveMemberAccess): Add support for section
19346         14.5.4.1 that deals with the special case of E.I when E is a type
19347         and something else, that I can be a reference to a static member.
19348
19349         (ArrayCreation.MakeByteBlob): It is not an error to not be able to
19350         handle a particular array type to create byte blobs, it is just
19351         something we dont generate byteblobs for.
19352
19353         * cs-tokenizer.cs (get_cmd_arg): Ignore \r in commands and
19354         arguments. 
19355
19356         * location.cs (Push): remove the key from the hashtable that we
19357         are about to add.   This happens for empty files.
19358
19359         * driver.cs: Dispose files after we have parsed them.
19360
19361         (tokenize): new function that only runs the tokenizer on its
19362         input, for speed testing.
19363
19364 2001-12-26  Ravi Pratap  <ravi@ximian.com>
19365
19366         * class.cs (Event.Define): Define the private field only if there
19367         are no accessors defined.
19368
19369         * expression.cs (ResolveMemberAccess): If there is no associated
19370         field with the event, that means we have an event defined with its
19371         own accessors and we should flag error cs0070 since transforming
19372         ourselves into a field is not valid in that case.
19373
19374         * ecore.cs (SimpleName.DoResolve): Same as above.
19375
19376         * attribute.cs (DefinePInvokeMethod): Set the default calling convention
19377         and charset to sane values.
19378
19379 2001-12-25  Ravi Pratap  <ravi@ximian.com>
19380
19381         * assign.cs (DoResolve): Perform check on events only if they 
19382         are being accessed outside the declaring type.
19383
19384         * cs-parser.jay (event_declarations): Update rules to correctly
19385         set the type of the implicit parameter etc.
19386
19387         (add_accessor, remove_accessor): Set current local parameters.
19388
19389         * expression.cs (Binary): For delegate addition and subtraction,
19390         cast the return value from the method into the appropriate delegate
19391         type.
19392
19393 2001-12-24  Ravi Pratap  <ravi@ximian.com>
19394
19395         * typemanager.cs (RegisterDelegateData, GetDelegateData): Get rid
19396         of these as the workaround is unnecessary.
19397
19398         * delegate.cs (NewDelegate.DoResolve): Get rid of bits which registered
19399         delegate data - none of that is needed at all.
19400
19401         Re-write bits to extract the instance expression and the delegate method
19402         correctly.
19403
19404         * expression.cs (Binary.ResolveOperator): Handle the '-' binary operator 
19405         on delegates too.
19406
19407         * attribute.cs (ApplyAttributes): New method to take care of common tasks
19408         of attaching attributes instead of duplicating code everywhere.
19409
19410         * everywhere : Update code to do attribute emission using the above method.
19411
19412 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19413
19414         * expression.cs (IsParamsMethodApplicable): if there are not
19415         parameters, return immediately.
19416
19417         * ecore.cs: The 0 literal can be implicity converted to an enum
19418         type. 
19419
19420         (SimpleName.DoResolve): First lookup the type, then lookup the
19421         members. 
19422
19423         (FieldExpr.Emit): If the InstanceExpression is a ValueType, we
19424         want to get its address.  If the InstanceExpression is not
19425         addressable, store the result in a temporary variable, then get
19426         the address of it.
19427
19428         * codegen.cs: Only display 219 errors on warning level or above. 
19429
19430         * expression.cs (ArrayAccess): Make it implement the
19431         IMemoryLocation interface.
19432
19433         (Binary.DoResolve): handle the operator == (object a, object b)
19434         and operator != (object a, object b) without incurring into a
19435         BoxedCast (because 5 != o should never be performed).
19436
19437         Handle binary enumerator operators.
19438
19439         (EmitLoadOpcode): Use Ldelema if the object we are loading is a
19440         value type, otherwise use Ldelem_ref.
19441
19442         Use precomputed names;
19443
19444         (AddressOf): Implement address of
19445
19446         * cs-parser.jay (labeled_statement): Fix recursive block
19447         addition by reworking the production.
19448
19449         * expression.cs (New.DoEmit): New has a special case:
19450                 
19451                  If we are dealing with a ValueType, we have a few
19452                  situations to deal with:
19453                 
19454                     * The target of New is a ValueType variable, that is
19455                       easy, we just pass this as the variable reference
19456                 
19457                     * The target of New is being passed as an argument,
19458                       to a boxing operation or a function that takes a
19459                       ValueType.
19460                 
19461                       In this case, we need to create a temporary variable
19462                       that is the argument of New.
19463
19464
19465 2001-12-23  Ravi Pratap  <ravi@ximian.com>
19466
19467         * rootcontext.cs (LookupType): Check that current_type is not null before
19468         going about looking at nested types.
19469
19470         * ecore.cs (EventExpr.EmitAddOrRemove): Rename from EmitAssign as we do
19471         not implement the IAssignMethod interface any more.
19472
19473         * expression.cs (MemberAccess.ResolveMemberAccess): Handle EventExprs specially
19474         where we tranform them into FieldExprs if they are being resolved from within
19475         the declaring type.
19476
19477         * ecore.cs (SimpleName.DoResolve): Do the same here.
19478
19479         * assign.cs (DoResolve, Emit): Clean up code considerably. 
19480
19481         * ../errors/bug10.cs : Add.
19482
19483         * ../errors/cs0070.cs : Add.
19484
19485         * typemanager.cs : Use PtrHashtable for Delegate data hashtable etc.
19486
19487         * assign.cs : Get rid of EventIsLocal everywhere.
19488
19489 2001-12-23  Miguel de Icaza  <miguel@ximian.com>
19490
19491         * ecore.cs (ConvertIntLiteral): finished the implementation.
19492
19493         * statement.cs (SwitchLabel): Convert the value we are using as a
19494         key before looking up the table.
19495
19496 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19497
19498         * codegen.cs (EmitTopBlock): Require a Location argument now.
19499
19500         * cs-parser.jay (constructor_declarator): We need to setup
19501         current_local_parameters before we parse the
19502         opt_constructor_initializer, to allow the variables to be bound
19503         to the constructor arguments.
19504
19505         * rootcontext.cs (LookupType): First lookup nested classes in our
19506         class and our parents before we go looking outside our class.
19507
19508         * expression.cs (ConstantFold): Extract/debox the values at the
19509         beginnning. 
19510
19511         * rootcontext.cs (EmitCode): Resolve the constants first before we
19512         resolve the types.  This is not really needed, but it helps debugging.
19513
19514         * statement.cs: report location.
19515
19516         * cs-parser.jay: pass location to throw statement.
19517
19518         * driver.cs: Small bug fix.
19519
19520         * report.cs: Updated format to be 4-zero filled digits.
19521
19522 2001-12-22  Ravi Pratap  <ravi@ximian.com>
19523
19524         * expression.cs (CheckIndices): Fix minor bug where the wrong
19525         variable was being referred to ;-)
19526
19527         (DoEmit): Do not call EmitStaticInitializers when the 
19528         underlying type is System.Object.
19529
19530 2001-12-21  Ravi Pratap  <ravi@ximian.com>
19531
19532         * ecore.cs (EventExpr.Resolve): Implement to correctly set the type
19533         and do the usual workaround for SRE.
19534
19535         * class.cs (MyEventBuilder.EventType): New member to get at the type
19536         of the event, quickly.
19537
19538         * expression.cs (Binary.ResolveOperator): Handle delegate addition.
19539
19540         * assign.cs (Assign.DoResolve): Handle the case when the target
19541         is an EventExpr and perform the necessary checks.
19542
19543         * ecore.cs (EventExpr.EmitAssign): Implement the IAssignMethod
19544         interface.
19545
19546         (SimpleName.MemberStaticCheck): Include check for EventExpr.
19547
19548         (EventExpr): Set the type in the constructor itself since we 
19549         are meant to be born fully resolved.
19550
19551         (EventExpr.Define): Revert code I wrote earlier.
19552                 
19553         * delegate.cs (NewDelegate.Resolve): Handle the case when the MethodGroup's
19554         instance expression is null. The instance expression is a This in that case
19555         or a null, depending on whether it is a static method or not.
19556
19557         Also flag an error if the reference to a method is ambiguous i.e the MethodGroupExpr
19558         refers to more than one method.
19559
19560         * assign.cs (DoResolve): Check whether the event belongs to the same Type container
19561         and accordingly flag errors.
19562
19563 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19564
19565         * statement.cs (Throw.Emit): Add support for re-throwing exceptions.
19566
19567 2001-12-22  Miguel de Icaza  <miguel@ximian.com>
19568
19569         * location.cs (ToString): Provide useful rutine.
19570
19571 2001-12-21  Miguel de Icaza  <miguel@ximian.com>
19572
19573         * ecore.cs (Expression.ConvertIntLiteral): Do not return Constant
19574         objects, return the actual integral boxed.
19575
19576         * statement.cs (SwitchLabel): define an ILLabel for each
19577         SwitchLabel. 
19578
19579         (Switch.CheckSwitch): If the value is a Literal, extract
19580         the underlying literal.
19581
19582         Also in the unused hashtable we had, add the SwitchLabel so we can
19583         quickly look this value up.
19584
19585         * constant.cs: Implement a bunch of new constants.  Rewrite
19586         Literal based on this.  Made changes everywhere to adapt to this.
19587
19588         * expression.cs (Expression.MakeByteBlob): Optimize routine by
19589         dereferencing array only once, and also copes with enumrations.
19590
19591         bytes are two bytes wide, not one.
19592
19593         (Cast): Perform constant conversions.
19594
19595         * ecore.cs (TryImplicitIntConversion): Return literals instead of
19596         wrappers to the literals here.
19597
19598         * expression.cs (DoNumericPromotions): long literals can converted
19599         to ulong implicity (this is taken care of elsewhere, but I was
19600         missing this spot).
19601
19602         * ecore.cs (Expression.Literalize): Make the return type Literal,
19603         to improve type checking.
19604
19605         * rootcontext.cs: Lookup for nested classes in our class hierarchy.
19606
19607 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19608
19609         * literal.cs: Revert code from ravi that checked the bounds.  The
19610         bounds are sane by the definition of the type itself. 
19611
19612         * typemanager.cs: Fix implementation of ImplementsInterface.  We
19613         need to actually look up in our parent hierarchy for interfaces
19614         implemented. 
19615
19616         * const.cs: Use the underlying type for enumerations
19617
19618         * delegate.cs: Compute the basename for the delegate creation,
19619         that should fix the delegate test case, and restore the correct
19620         Type Lookup semantics in rootcontext
19621
19622         * rootcontext.cs: Revert Ravi's last patch.  The correct way of
19623         referencing a nested type with the Reflection API is using the "+"
19624         sign. 
19625
19626         * cs-parser.jay: Do not require EOF token at the end.
19627
19628 2001-12-20  Ravi Pratap  <ravi@ximian.com>
19629
19630         * rootcontext.cs (LookupType): Concatenate type names with
19631         a '.' instead of a '+' The test suite passes again.
19632
19633         * enum.cs (Enum.DefineEnum): Set RTSpecialName on the 'value__'
19634         field of the enumeration.
19635
19636         * expression.cs (MemberAccess.ResolveMemberAccess): Add support for
19637         the case when the member is an EventExpr.
19638
19639         * ecore.cs (EventExpr.InstanceExpression): Every event which is not
19640         static has an associated instance expression.
19641
19642         * typemanager.cs (RegisterEvent): The usual workaround, now for events.
19643
19644         (GetAddMethod, GetRemoveMethod): Workarounds, as usual.
19645
19646         * class.cs (Event.Define): Register event and perform appropriate checks
19647         for error #111.
19648
19649         We define the Add and Remove methods even if the use provides none because
19650         in that case, we provide default implementations ourselves.
19651
19652         Define a private field of the type of the event. This is done by the CSC compiler
19653         and we should be doing it too ;-)
19654
19655         * typemanager.cs (delegate_combine_delegate_delegate, delegate_remove_delegate_delegate):
19656         More methods we use in code we generate.
19657
19658         (multicast_delegate_type, delegate_type): Two separate types since the distinction
19659         is important.
19660
19661         (InitCoreTypes): Update accordingly for the above.
19662
19663         * class.cs (Event.Emit): Generate code for default accessors that we provide
19664
19665         (EmitDefaultMethod): Do the job in the above.
19666
19667         * delegate.cs (DefineDelegate): Use TypeManager.multicast_delegate_type in the 
19668         appropriate place.
19669
19670 2001-12-20  Miguel de Icaza  <miguel@ximian.com>
19671
19672         * class.cs (Indexer.Define): Fix bug, we were setting both Get/Set
19673         builders even if we were missing one.
19674
19675         * interface.cs, class.cs, enum.cs: When calling DefineNestedType
19676         pass the Basename as our class name instead of the Name.  The
19677         basename will be correctly composed for us.
19678
19679         * parameter.cs (Paramters): Now takes a Location argument.
19680
19681         * decl.cs (DeclSpace.LookupType): Removed convenience function and
19682         make all the code call directly LookupType in RootContext and take
19683         this chance to pass the Location information everywhere.
19684
19685         * Everywhere: pass Location information.
19686
19687 2001-12-19  Miguel de Icaza  <miguel@ximian.com>
19688
19689         * class.cs (Constructor.Define): Updated way of detecting the
19690         length of the parameters.
19691
19692         (TypeContainer.DefineType): Use basename as the type name for
19693         nested types.
19694
19695         (TypeContainer.Define): Do not recursively define types here, as
19696         definition is taken care in order by the RootContext.
19697
19698         * tree.cs: Keep track of namespaces in a per-file basis.
19699
19700         * parameter.cs (Parameter.ComputeSignature): Update to use
19701         DeclSpace. 
19702
19703         (Parameters.GetSignature): ditto.
19704
19705         * interface.cs (InterfaceMethod.GetSignature): Take a DeclSpace
19706         instead of a TypeContainer.
19707
19708         (Interface.SemanticAnalysis): Use `this' instead of our parent to
19709         resolve names.  Because we need to be resolve in our context, not
19710         our parents.
19711
19712         * driver.cs: Implement response files.
19713
19714         * class.cs (TypeContainer.DefineType): If we are defined, do not
19715         redefine ourselves.
19716
19717         (Event.Emit): Emit the code for add/remove handlers.
19718         (Event.Define): Save the MethodBuilders for add/remove.
19719
19720         * typemanager.cs: Use pair here too.
19721
19722         * cs-parser.jay: Replaced use of DictionaryEntry for Pair because
19723         DictionaryEntry requires the first argument to be non-null.  
19724
19725         (enum_declaration): Compute full name for registering the
19726         enumeration.
19727
19728         (delegate_declaration): Instead of using
19729         formal_parameter_list, use opt_formal_parameter_list as the list
19730         can be empty.
19731
19732         * cs-tokenizer.cs (PropertyParsing): renamed from `properties'
19733         (EventParsing): New property that controls whether `add' and
19734         `remove' are returned as tokens or identifiers (for events);
19735
19736 2001-12-19  Ravi Pratap  <ravi@ximian.com>
19737
19738         * class.cs (Event.Define): Revamp use of EventBuilder completely. We now
19739         use MyEventBuilder only and let it wrap the real builder for us.
19740
19741         (MyEventBuilder): Revamp constructor etc.
19742
19743         Implement all operations that we perform on EventBuilder in precisely the same
19744         way here too.
19745
19746         (FindMembers): Update to use the EventBuilder member.
19747
19748         (Event.Emit): Update accordingly.
19749
19750 2001-12-18  Ravi Pratap  <ravi@ximian.com>
19751
19752         * class.cs (MyEventBuilder.Set*): Chain to the underlying builder
19753         by calling the appropriate methods.
19754
19755         (GetCustomAttributes): Make stubs as they cannot possibly do anything
19756         useful.
19757
19758         (Event.Emit): Use MyEventBuilder everywhere - even to set attributes.
19759
19760 2001-12-17  Ravi Pratap  <ravi@ximian.com>
19761
19762         * delegate.cs (Delegate.Populate): Check that the return type
19763         and various parameters types are indeed accessible.
19764
19765         * class.cs (Constructor.Define): Same here.
19766
19767         (Field.Define): Ditto.
19768
19769         (Event.Define): Ditto.
19770
19771         (Operator.Define): Check that the underlying Method defined itself
19772         correctly - so it's MethodBuilder should not be null.
19773
19774         * delegate.cs (DelegateInvocation.DoResolve): Bale out if the type of the Instance
19775         expression happens to be null.
19776
19777         * class.cs (MyEventBuilder): Workaround for SRE lameness. Implement various abstract
19778         members but as of now we don't seem to be able to do anything really useful with it.
19779
19780         (FindMembers): Handle events separately by returning the MyEventBuilder of the event,
19781         not the EventBuilder.
19782
19783 2001-12-18  Miguel de Icaza  <miguel@ximian.com>
19784
19785         * cs-tokenizer.cs: Add support for defines.
19786         Add support for #if, #elif, #else, #endif
19787
19788         (eval_var): evaluates a variable.
19789         (eval): stubbed for evaluating functions.
19790
19791         * cs-parser.jay: Pass the defines information
19792
19793         * driver.cs: Add --define command line option.
19794
19795         * decl.cs: Move MemberCore here.
19796
19797         Make it the base class for DeclSpace.  This allows us to catch and
19798         report 108 and 109 for everything now.
19799
19800         * class.cs (TypeContainer.Define): Extract all the members
19801         before populating and emit the warning 108 (new keyword required
19802         to override) instead of having each member implement this.
19803
19804         (MemberCore.Define): New abstract method, we will be using this in
19805         the warning reporting engine in Populate.
19806
19807         (Operator.Define): Adjust to new MemberCore protocol. 
19808
19809         * const.cs (Const): This does not derive from Expression, it is a
19810         temporary object we use to create fields, it is a MemberCore. 
19811
19812         * class.cs (Method.Define): Allow the entry point to be in a
19813         specific class.
19814
19815         * driver.cs: Rewrite the argument handler to clean it up a bit.
19816
19817         * rootcontext.cs: Made it just an auxiliary namespace feature by
19818         making everything static.
19819
19820         * driver.cs: Adapt code to use RootContext type name instead of
19821         instance variable.
19822
19823         * delegate.cs: Remove RootContext argument.
19824
19825         * class.cs: (Struct, TypeContainer, Class): Remove RootContext
19826         argument. 
19827
19828         * class.cs (Event.Define): The lookup can fail.
19829
19830         * cs-tokenizer.cs: Begin implementation of pre-procesor. 
19831
19832         * expression.cs: Resolve the this instance before invoking the code.
19833
19834 2001-12-17  Miguel de Icaza  <miguel@ximian.com>
19835
19836         * cs-parser.jay: Add a production in element_access that allows
19837         the thing to become a "type" reference.  This way we can parse
19838         things like "(string [])" as a type.
19839
19840         Note that this still does not handle the more complex rules of
19841         casts. 
19842
19843
19844         * delegate.cs (Delegate.Populate): Register the delegage constructor builder here. 
19845
19846         * ecore.cs: (CopyNewMethods): new utility function used to
19847         assemble the list of methods from running FindMembers.
19848
19849         (MemberLookup): Rework FindMembers so that 
19850
19851 2001-12-16  Miguel de Icaza  <miguel@ximian.com>
19852
19853         * class.cs (TypeContainer): Remove Delegates who fail to be
19854         defined.
19855
19856         * delegate.cs (Populate): Verify that we dont get null return
19857         values.   TODO: Check for AsAccessible.
19858
19859         * cs-parser.jay: Use basename to emit error 574 (destructor should
19860         have the same name as container class), not the full name.
19861
19862         * cs-tokenizer.cs (adjust_int): Fit the integer in the best
19863         possible representation.  
19864
19865         Also implements integer type suffixes U and L.
19866
19867 2001-12-15  Miguel de Icaza  <miguel@ximian.com>
19868
19869         * expression.cs (ArrayCreation.DoResolve): We need to do the
19870         argument resolution *always*.
19871
19872         * decl.cs: Make this hold the namespace.  Hold the root context as
19873         well.
19874         (LookupType): Move here.
19875
19876         * enum.cs, class.cs, interface.cs: Adapt to new hierarchy.
19877
19878         * location.cs (Row, Name): Fixed the code, it was always returning
19879         references to the first file.
19880
19881         * interface.cs: Register properties defined through interfaces.
19882
19883         * driver.cs: Add support for globbing on the command line
19884
19885         * class.cs (Field): Make it derive from MemberCore as well.
19886         (Event): ditto.
19887
19888 2001-12-15  Ravi Pratap  <ravi@ximian.com>
19889
19890         * class.cs (Event::Define): Check that the type of the event is a delegate
19891         type else flag error #66.
19892
19893         Also, re-use TypeContainer.MethodModifiersValid here too as the rules are the
19894         same.
19895
19896         * attribute.cs (DefinePInvokeMethod): Handle named arguments and process
19897         values of EntryPoint, CharSet etc etc.
19898
19899         Pass in the values to TypeBuilder.DefinePInvokeMethod; determine Type etc neatly.
19900
19901         * class.cs (FindMembers): If a method is in transit, its MethodBuilder will
19902         be null and we should ignore this. I am not sure if this is really clean. Apparently,
19903         there's no way of avoiding hitting this because the call is coming from SimpleName.DoResolve,
19904         which needs this to do its work.
19905
19906         * ../errors/cs0066.cs : Add.
19907
19908 2001-12-14  Miguel de Icaza  <miguel@ximian.com>
19909
19910         * typemanager.cs: (GetPropertyGetter, GetPropertyGetter): New
19911         helper functions.
19912
19913         * class.cs: (MethodSignature.MethodSignature): Removed hack that
19914         clears out the parameters field.
19915         (MemberSignatureCompare): Cleanup
19916
19917         (MemberCore): New base class used to share code between MethodCore
19918         and Property.
19919
19920         (RegisterRequiredImplementations) BindingFlags.Public requires
19921         either BindingFlags.Instace or Static.  Use instance here.
19922
19923         (Property): Refactored code to cope better with the full spec.
19924
19925         * parameter.cs (GetParameterInfo): Return an empty array instead
19926         of null on error.
19927
19928         * class.cs (Property): Abstract or extern properties have no bodies.
19929
19930         * parameter.cs (GetParameterInfo): return a zero-sized array.
19931
19932         * class.cs (TypeContainer.MethodModifiersValid): Move all the
19933         method modifier validation to the typecontainer so we can reuse
19934         this on properties.
19935
19936         (MethodCore.ParameterTypes): return an empty sized array of types.
19937
19938         (Property.Define): Test property modifier validity.
19939
19940         Add tests for sealed/override too.
19941
19942         (Method.Emit): abstract or extern methods have no bodies.
19943
19944 2001-12-14  Ravi Pratap  <ravi@ximian.com>
19945
19946         * class.cs (Method.IsPInvoke): Get rid of it as it is an expensive
19947         thing.
19948
19949         (Method::Define, ::Emit): Modify accordingly.
19950
19951         * expression.cs (Invocation::OverloadResolve): Handle error # 121.
19952
19953         (ArrayCreation::MakeByteBlob): Handle floats and doubles.
19954
19955         * makefile: Pass in /unsafe.
19956
19957 2001-12-13  Miguel de Icaza  <miguel@ximian.com>
19958
19959         * class.cs (MakeKey): Kill routine.
19960
19961         * class.cs (TypeContainer.Define): Correctly define explicit
19962         method implementations (they require the full interface name plus
19963         the method name).
19964
19965         * typemanager.cs: Deply the PtrHashtable here and stop using the
19966         lame keys.  Things work so much better.
19967
19968         This of course broke everyone who depended on `RegisterMethod' to
19969         do the `test for existance' test.  This has to be done elsewhere.
19970
19971         * support.cs (PtrHashtable): A hashtable that avoid comparing with
19972         the object stupid Equals method (because, that like fails all over
19973         the place).  We still do not use it.
19974
19975         * class.cs (TypeContainer.SetRequiredInterface,
19976         TypeContainer.RequireMethods): Killed these two routines and moved
19977         all the functionality to RegisterRequiredImplementations.
19978
19979         (TypeContainer.RegisterRequiredImplementations): This routine now
19980         registers all the implementations required in an array for the
19981         interfaces and abstract methods.  We use an array of structures
19982         which can be computed ahead of time to reduce memory usage and we
19983         also assume that lookups are cheap as most classes will not
19984         implement too many interfaces.
19985
19986         We also avoid creating too many MethodSignatures.
19987
19988         (TypeContainer.IsInterfaceMethod): Update and optionally does not
19989         clear the "pending" bit if we find that there are problems with
19990         the declaration.
19991
19992         (TypeContainer.VerifyPendingMethods): Update to report errors of
19993         methods that look like implementations but are not.
19994
19995         (TypeContainer.Define): Add support for explicit interface method
19996         implementation. 
19997
19998 2001-12-12  Miguel de Icaza  <miguel@ximian.com>
19999
20000         * typemanager.cs: Keep track of the parameters here instead of
20001         being a feature of the TypeContainer.
20002
20003         * class.cs: Drop the registration of parameters here, as
20004         InterfaceMethods are also interface declarations.
20005
20006         * delegate.cs: Register methods with the TypeManager not only with
20007         the TypeContainer.  This code was buggy.
20008
20009         * interface.cs: Full registation here.
20010
20011 2001-12-11  Miguel de Icaza  <miguel@ximian.com>
20012
20013         * expression.cs: Remove reducer for binary expressions, it can not
20014         be done this way.
20015
20016         * const.cs: Put here the code that used to go into constant.cs
20017
20018         * constant.cs: Put here the code for constants, this is a new base
20019         class for Literals.
20020
20021         * literal.cs: Make Literal derive from Constant.
20022
20023 2001-12-09  Miguel de Icaza  <miguel@ximian.com>
20024
20025         * statement.cs (Return.Emit): Report error 157 if the user
20026         attempts to return from a finally block.
20027
20028         (Return.Emit): Instead of emitting a return, jump to the end of
20029         the function.
20030
20031         * codegen.cs (EmitContext): ReturnValue, ReturnLabel: new
20032         LocalBuilder to store the result of the function.  ReturnLabel is
20033         the target where we jump.
20034
20035
20036 2001-12-09  Radek Doulik  <rodo@ximian.com>
20037
20038         * cs-parser.jay: remember alias in current namespace
20039
20040         * ecore.cs (SimpleName::DoResolve): use aliases for types or
20041         namespaces
20042
20043         * class.cs (LookupAlias): lookup alias in my_namespace
20044
20045         * namespace.cs (UsingAlias): add alias, namespace_or_type pair to
20046         aliases hashtable
20047         (LookupAlias): lookup alias in this and if needed in parent
20048         namespaces
20049
20050 2001-12-08  Miguel de Icaza  <miguel@ximian.com>
20051
20052         * support.cs: 
20053
20054         * rootcontext.cs: (ModuleBuilder) Made static, first step into
20055         making things static.  I need this to avoid passing the
20056         TypeContainer when calling ParameterType.
20057
20058         * support.cs (InternalParameters.ParameterType): Remove ugly hack
20059         that did string manipulation to compute the type and then call
20060         GetType.  Use Parameter.ParameterType instead.
20061
20062         * cs-tokenizer.cs: Consume the suffix for floating values.
20063
20064         * expression.cs (ParameterReference): figure out whether this is a
20065         reference parameter or not.  Kill an extra variable by computing
20066         the arg_idx during emission.
20067
20068         * parameter.cs (Parameters.GetParameterInfo): New overloaded
20069         function that returns whether a parameter is an out/ref value or not.
20070
20071         (Parameter.ParameterType): The type of the parameter (base,
20072         without ref/out applied).
20073
20074         (Parameter.Resolve): Perform resolution here.
20075         (Parameter.ExternalType): The full type (with ref/out applied).
20076
20077         * statement.cs (Using.Emit, Using.EmitExpression): Implement
20078         support for expressions on the using statement.
20079
20080 2001-12-07  Miguel de Icaza  <miguel@ximian.com>
20081
20082         * statement.cs (Using.EmitLocalVariableDecls): Split the
20083         localvariable handling of the using statement.
20084
20085         (Block.EmitMeta): Keep track of variable count across blocks.  We
20086         were reusing slots on separate branches of blocks.
20087
20088         (Try.Emit): Emit the general code block, we were not emitting it. 
20089
20090         Check the type of the declaration to be an IDisposable or
20091         something that can be implicity converted to it. 
20092
20093         Emit conversions if required.
20094
20095         * ecore.cs (EmptyExpression): New utility class.
20096         (Expression.ImplicitConversionExists): New utility function.
20097
20098 2001-12-06  Miguel de Icaza  <miguel@ximian.com>
20099
20100         * statement.cs (Using): Implement.
20101
20102         * expression.cs (LocalVariableReference): Support read only variables.
20103
20104         * statement.cs: Remove the explicit emit for the Leave opcode.
20105         (VariableInfo): Add a readonly field.
20106
20107 2001-12-05  Miguel de Icaza  <miguel@ximian.com>
20108
20109         * ecore.cs (ConvCast): new class used to encapsulate the various
20110         explicit integer conversions that works in both checked and
20111         unchecked contexts.
20112
20113         (Expression.ConvertNumericExplicit): Use new ConvCast class to
20114         properly generate the overflow opcodes.
20115
20116 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20117
20118         * statement.cs: The correct type for the EmptyExpression is the
20119         element_type, not the variable type.  Ravi pointed this out.
20120
20121 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20122
20123         * class.cs (Method::Define): Handle PInvoke methods specially
20124         by using DefinePInvokeMethod instead of the usual one.
20125
20126         * attribute.cs (DefinePInvokeMethod): Implement as this is what is called
20127         above to do the task of extracting information and defining the method.
20128
20129 2001-12-04  Ravi Pratap  <ravi@ximian.com>
20130
20131         * expression.cs (ArrayCreation::EmitStaticInitializers): Get rid
20132         of the condition for string type.
20133
20134         (Emit): Move that here. 
20135
20136         (ArrayCreation::CheckIndices): Keep string literals in their expression
20137         form.
20138
20139         (EmitDynamicInitializers): Handle strings appropriately.
20140
20141 2001-12-04  Miguel de Icaza  <miguel@ximian.com>
20142
20143         * codegen.cs (EmitContext): Replace multiple variables with a
20144         single pointer to the current Switch statement.
20145
20146         * statement.cs (GotoDefault, Switch): Adjust to cleaned up
20147         EmitContext.
20148
20149 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20150
20151         * statement.cs 
20152
20153         * statement.cs (GotoDefault), cs-parser.jay: Implement `goto
20154         default'.
20155
20156         (Foreach.Emit): Foreach on arrays was not setting
20157         up the loop variables (for break/continue).
20158
20159         (GotoCase): Semi-implented.
20160
20161 2001-12-03  Ravi Pratap  <ravi@ximian.com>
20162
20163         * attribute.cs (CheckAttribute): Handle system attributes by using
20164         Attribute.GetAttributes to examine information we need.
20165
20166         (GetValidPlaces): Same here.
20167
20168         * class.cs (Method::Define): Catch invalid use of extern and abstract together.
20169
20170         * typemanager.cs (dllimport_type): Core type for System.DllImportAttribute.
20171
20172         * class.cs (Method.IsPinvoke): Used to determine if we are a PInvoke method.
20173
20174         (Method::Define): Set appropriate flags if we have a DllImport attribute.
20175
20176         (Method::Emit): Handle the case when we are a PInvoke method.
20177
20178 2001-12-03  Miguel de Icaza  <miguel@ximian.com>
20179
20180         * expression.cs: Use ResolveWithSimpleName on compound names.
20181
20182 2001-12-02  Ravi Pratap  <ravi@ximian.com>
20183
20184         * constant.cs (EmitConstant): Make sure we resolve the associated expression
20185         before trying to reduce it.
20186
20187         * typemanager.cs (RegisterConstant, LookupConstant): Implement.
20188
20189         * constant.cs (LookupConstantValue): Implement.
20190
20191         (EmitConstant): Use the above in emitting the constant.
20192
20193         * expression.cs (MemberAccess::ResolveMemberAccess): Handle constants
20194         that are user-defined by doing a LookupConstantValue on them.
20195
20196         (SimpleName::DoResolve): When we have a FieldExpr, cope with constants
20197         too, like above.
20198
20199 2001-11-29  Miguel de Icaza  <miguel@ximian.com>
20200
20201         * expression.cs (BaseAccess, BaseIndexer): Also split this out.
20202
20203         (BaseAccess.DoResolve): Implement.
20204
20205         (MemberAccess.DoResolve): Split this routine into a
20206         ResolveMemberAccess routine that can be used independently
20207
20208 2001-11-28  Miguel de Icaza  <miguel@ximian.com>
20209
20210         * expression.cs (Probe, Is, As): Split Probe in two classes Is and
20211         As that share bits of the implementation.  Is returns a boolean,
20212         while As returns the Type that is being probed.
20213
20214 2001-12-01  Ravi Pratap  <ravi@ximian.com>
20215
20216         * enum.cs (LookupEnumValue): Re-write various bits, return an object value
20217         instead of a Literal - much easier.
20218
20219         (EnumInTransit): Remove - utterly useless :-)
20220
20221         (Populate): Re-write bits - remove duplicate code etc. The code is much neater now.
20222
20223         * expression.cs (MemberLookup): Cope with user-defined enums when they are in transit.
20224
20225         * enum.cs (LookupEnumValue): Auto-compute next values by going down the dependency
20226         chain when we have no associated expression.
20227
20228 2001-11-30  Ravi Pratap  <ravi@ximian.com>
20229
20230         * constant.cs (Define): Use Location while reporting the errror.
20231
20232         Also emit a warning when 'new' is used and there is no inherited
20233         member to hide.
20234
20235         * enum.cs (EnumInTransit): Used to tell if an enum type is in the process of being 
20236         populated.
20237
20238         (LookupEnumValue): Implement to lookup an enum member's value and define it
20239         if necessary.
20240
20241         (Populate): Re-write accordingly to use the above routine.
20242
20243 2001-11-27  Miguel de Icaza  <miguel@ximian.com>
20244
20245         * expression.cs (This): Fix prototype for DoResolveLValue to
20246         override the base class DoResolveLValue.
20247
20248         * cs-parser.cs: Report errors cs574 and cs575 (destructor
20249         declarations) 
20250
20251         * ecore.cs (FieldExpr.EmitAssign): Handle value types specially
20252         (we need to load the address of the field here).  This fixes
20253         test-22. 
20254
20255         (FieldExpr.DoResolveLValue): Call the DoResolve
20256         function to initialize the Instance expression.
20257
20258         * statement.cs (Foreach.Emit): Fix the bug where we did not invoke
20259         correctly the GetEnumerator operation on a value type.
20260
20261         * cs-parser.jay: Add more simple parsing error catches.
20262
20263         * statement.cs (Switch): Add support for string switches.
20264         Handle null specially.
20265
20266         * literal.cs (NullLiteral): Make NullLiteral objects singletons. 
20267
20268 2001-11-28  Ravi Pratap  <ravi@ximian.com>
20269
20270         * cs-parser.jay (local_constant_declaration): Use declare_local_constant.
20271
20272         (declare_local_constant): New helper function.
20273
20274         * statement.cs (AddConstant): Keep a separate record of constants
20275
20276         (IsConstant): Implement to determine if a variable is a constant.
20277
20278         (GetConstantExpression): Implement.
20279
20280         * expression.cs (LocalVariableReference): Handle the case when it is a constant.
20281
20282         * statement.cs (IsVariableDefined): Re-write.
20283
20284 2001-11-27  Ravi Pratap  <ravi@ximian.com>
20285
20286         * class.cs (TypeContainer::FindMembers): Look for constants
20287         in the case when we are looking for MemberTypes.Field
20288
20289         * expression.cs (MemberAccess::DoResolve): Check that in the
20290         case we are a FieldExpr and a Literal, we are not being accessed
20291         by an instance reference.
20292
20293         * cs-parser.jay (local_constant_declaration): Implement.
20294
20295         (declaration_statement): Implement for constant declarations.
20296
20297 2001-11-26  Miguel de Icaza  <miguel@ximian.com>
20298
20299         * statement.cs (Switch): Catch double defaults.
20300
20301         (Switch): More work on the switch() statement
20302         implementation.  It works for integral values now, need to finish
20303         string support.
20304
20305
20306 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20307
20308         * ecore.cs (Expression.ConvertIntLiteral): New function to convert
20309         integer literals into other integer literals.  To be used by
20310         switch. 
20311
20312 2001-11-24  Ravi Pratap  <ravi@ximian.com>
20313
20314         * expression.cs (ArrayCreation): Get rid of ArrayExprs : we save
20315         some memory.
20316
20317         (EmitDynamicInitializers): Cope with the above since we extract data
20318         directly from ArrayData now.
20319
20320         (ExpectInitializers): Keep track of whether initializers are mandatory
20321         or not.
20322
20323         (Bounds): Make it a hashtable to prevent the same dimension being 
20324         recorded for every element in that dimension.
20325
20326         (EmitDynamicInitializers): Fix bug which prevented the Set array method
20327         from being found.
20328
20329         Also fix bug which was causing the indices to be emitted in the reverse
20330         order.
20331
20332 2001-11-24  Miguel de Icaza  <miguel@ximian.com>
20333
20334         * expression.cs (ArrayCreation): Implement the bits that Ravi left
20335         unfinished.  They do not work, because the underlying code is
20336         sloppy.
20337
20338 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20339
20340         * cs-parser.jay: Remove bogus fixme.
20341
20342         * statement.cs (Switch, SwitchSection, SwithLabel): Started work
20343         on Switch statement.
20344
20345 2001-11-23  Ravi Pratap  <ravi@ximian.com>
20346
20347         * typemanager.cs (IsDelegateType, IsEnumType): Fix logic to determine
20348         the same. 
20349
20350         * expression.cs (ArrayCreation::CheckIndices): Get rid of the require_constant
20351         parameter. Apparently, any expression is allowed. 
20352
20353         (ValidateInitializers): Update accordingly.
20354
20355         (CheckIndices): Fix some tricky bugs thanks to recursion.
20356
20357         * delegate.cs (NewDelegate::DoResolve): Re-write large portions as 
20358         I was being completely brain-dead.
20359
20360         (VerifyMethod, VerifyApplicability, VerifyDelegate): Make static
20361         and re-write acordingly.
20362
20363         (DelegateInvocation): Re-write accordingly.
20364
20365         * expression.cs (ArrayCreation::Emit): Handle string initialization separately.
20366
20367         (MakeByteBlob): Handle types more correctly.
20368
20369         * expression.cs (ArrayCreation:Emit): Write preliminary code to do
20370         initialization from expressions but it is incomplete because I am a complete
20371         Dodo :-|
20372
20373 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20374
20375         * statement.cs (If.Emit): Fix a bug that generated incorrect code
20376         on If.  Basically, we have to return `true' (ie, we do return to
20377         our caller) only if both branches of the if return.
20378
20379         * expression.cs (Binary.Emit): LogicalOr and LogicalAnd are
20380         short-circuit operators, handle them as short circuit operators. 
20381
20382         (Cast.DoResolve): Resolve type.
20383         (Cast.Cast): Take an expression as the target type.
20384
20385         * cs-parser.jay (cast_expression): Remove old hack that only
20386         allowed a limited set of types to be handled.  Now we take a
20387         unary_expression and we resolve to a type during semantic
20388         analysis.
20389
20390         Use the grammar productions from Rhys to handle casts (this is
20391         not complete like Rhys syntax yet, we fail to handle that corner
20392         case that C# has regarding (-x), but we will get there.
20393
20394 2001-11-22  Ravi Pratap  <ravi@ximian.com>
20395
20396         * class.cs (EmitFieldInitializer): Take care of the case when we have a
20397         field which is an array type.
20398
20399         * cs-parser.jay (declare_local_variables): Support array initialization too.
20400
20401         * typemanager.cs (MakeKey): Implement.
20402
20403         (everywhere): Use the above appropriately.
20404
20405         * cs-parser.jay (for_statement): Update for array initialization while
20406         declaring variables.
20407
20408         * ecore.cs : The error message was correct, it's the variable's names that
20409         were misleading ;-) Make the code more readable.
20410
20411         (MemberAccess::DoResolve): Fix the code which handles Enum literals to set
20412         the correct type etc.
20413
20414         (ConvertExplicit): Handle Enum types by examining the underlying type.
20415
20416 2001-11-21  Ravi Pratap  <ravi@ximian.com>
20417
20418         * parameter.cs (GetCallingConvention): Always return
20419         CallingConventions.Standard for now.
20420
20421 2001-11-22  Miguel de Icaza  <miguel@ximian.com>
20422
20423         * expression.cs (Binary.ResolveOperator): Update the values of `l'
20424         and `r' after calling DoNumericPromotions.
20425
20426         * ecore.cs: Fix error message (the types were in the wrong order).
20427
20428         * statement.cs (Foreach.ProbeCollectionType): Need to pass
20429         BindingFlags.Instance as well 
20430
20431         * ecore.cs (Expression.TryImplicitIntConversion): Wrap the result
20432         implicit int literal conversion in an empty cast so that we
20433         propagate the right type upstream.
20434
20435         (UnboxCast): new class used to unbox value types.
20436         (Expression.ConvertExplicit): Add explicit type conversions done
20437         by unboxing.
20438
20439         (Expression.ImplicitNumericConversion): Oops, forgot to test for
20440         the target type before applying the implicit LongLiterals to ULong
20441         literal cast.
20442
20443 2001-11-21  Miguel de Icaza  <miguel@ximian.com>
20444
20445         * cs-parser.jay (for_statement): Reworked the way For works: now
20446         we declare manually any variables that are introduced in
20447         for_initializer to solve the problem of having out-of-band code
20448         emition (that is what got for broken).
20449
20450         (declaration_statement): Perform the actual variable declaration
20451         that used to be done in local_variable_declaration here.
20452
20453         (local_variable_declaration): Do not declare anything, just pass
20454         the information on a DictionaryEntry
20455
20456 2001-11-20  Ravi Pratap  <ravi@ximian.com>
20457
20458         * expression.cs (ArrayCreation::CheckIndices): The story continues :-) Complete
20459         re-write of the logic to now make it recursive.
20460
20461         (UpdateIndices): Re-write accordingly.
20462
20463         Store element data in a separate ArrayData list in the above methods.
20464
20465         (MakeByteBlob): Implement to dump the array data into a byte array.
20466
20467 2001-11-19  Ravi Pratap  <ravi@ximian.com>
20468
20469         * expression.cs (ArrayCreation): Factor out some code from ValidateInitializers
20470         into CheckIndices.
20471
20472         * constant.cs (Define): Implement.
20473
20474         (EmitConstant): Re-write fully.
20475
20476         Pass in location info.
20477
20478         * class.cs (Populate, Emit): Call Constant::Define and Constant::EmitConstant
20479         respectively.
20480
20481         * cs-parser.jay (constant_declarator): Use VariableDeclaration instead of
20482         DictionaryEntry since we need location info too.
20483
20484         (constant_declaration): Update accordingly.
20485
20486         * expression.cs (ArrayCreation): Make ValidateInitializers simpler by factoring
20487         code into another method : UpdateIndices.
20488
20489 2001-11-18  Ravi Pratap  <ravi@ximian.com>
20490
20491         * expression.cs (ArrayCreation::ValidateInitializers): Update to perform
20492         some type checking etc.
20493
20494 2001-11-17  Ravi Pratap  <ravi@ximian.com>
20495
20496         * expression.cs (ArrayCreation::ValidateInitializers): Implement
20497         bits to provide dimension info if the user skips doing that.
20498
20499         Update second constructor to store the rank correctly.
20500
20501 2001-11-16  Ravi Pratap  <ravi@ximian.com>
20502
20503         * expression.cs (ArrayCreation::ValidateInitializers): Poke around
20504         and try to implement.
20505
20506         * ../errors/cs0150.cs : Add.
20507
20508         * ../errors/cs0178.cs : Add.
20509
20510 2001-11-16  Miguel de Icaza  <miguel@ximian.com>
20511
20512         * statement.cs: Implement foreach on multi-dimensional arrays. 
20513
20514         * parameter.cs (Parameters.GetParameterByName): Also lookup the
20515         name of the params argument.
20516
20517         * expression.cs: Use EmitStoreOpcode to get the right opcode while
20518         initializing the array.
20519
20520         (ArrayAccess.EmitStoreOpcode): move the opcode generation here, so
20521         we can use this elsewhere.
20522
20523         * statement.cs: Finish implementation of foreach for single
20524         dimension arrays.
20525
20526         * cs-parser.jay: Use an out-of-band stack to pass information
20527         around, I wonder why I need this.
20528
20529         foreach_block: Make the new foreach_block the current_block.
20530
20531         * parameter.cs (Parameters.GetEmptyReadOnlyParameters): New
20532         function used to return a static Parameters structure.  Used for
20533         empty parameters, as those are created very frequently.
20534
20535         * cs-parser.jay, class.cs: Use GetEmptyReadOnlyParameters
20536
20537 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20538
20539         * interface.cs : Default modifier is private, not public. The
20540         make verify test passes again.
20541
20542 2001-11-15  Ravi Pratap  <ravi@ximian.com>
20543
20544         * support.cs (ReflectionParameters): Fix logic to determine
20545         whether the last parameter is a params one. Test 9 passes again.
20546
20547         * delegate.cs (Populate): Register the builders we define with
20548         RegisterParameterForBuilder. Test 19 passes again.
20549
20550         * cs-parser.jay (property_declaration): Reference $6 instead
20551         of $$ to get at the location.
20552
20553         (indexer_declaration): Similar stuff.
20554
20555         (attribute): Ditto.
20556
20557         * class.cs (Property): Register parameters for the Get and Set methods
20558         if they exist. Test 23 passes again.
20559
20560         * expression.cs (ArrayCreation::Emit): Pass null for the method in the
20561         call to EmitArguments as we are sure there aren't any params arguments. 
20562         Test 32 passes again.
20563
20564         * suppor.cs (ParameterDesc, ParameterModifier): Fix trivial bug causing
20565         IndexOutOfRangeException. 
20566
20567         * class.cs (Property::Define): Register property using TypeManager.RegisterProperty
20568         Test 33 now passes again.
20569
20570 2001-11-15  Miguel de Icaza  <miguel@ximian.com>
20571
20572         * cs-parser.jay: Kill horrendous hack ($??? = lexer.Location) that
20573         broke a bunch of things.  Will have to come up with a better way
20574         of tracking locations.
20575
20576         * statement.cs: Implemented foreach for single dimension arrays.
20577
20578 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20579
20580         * enum.cs (Enum.Emit): Delay the lookup of loc until we run into
20581         an error.  This removes the lookup from the critical path.
20582
20583         * cs-parser.jay: Removed use of temporary_loc, which is completely
20584         broken. 
20585
20586 2001-11-14  Miguel de Icaza  <miguel@ximian.com>
20587
20588         * support.cs (ReflectionParameters.ParameterModifier): Report
20589         whether the argument is a PARAMS argument or not.
20590
20591         * class.cs: Set the attribute `ParamArrayAttribute' on the
20592         parameter argument.
20593
20594         * typemanager.cs: Define param_array_type (ParamArrayAttribute)
20595         and cons_param_array_attribute (ConstructorInfo for
20596         ParamArrayAttribute)., 
20597
20598         * codegen.cs: Emit the return using the `Return' statement, that
20599         way we can report the error correctly for missing return values. 
20600
20601         * class.cs (Method.Emit): Clean up.
20602
20603         * expression.cs (Argument.Resolve): Take another argument: the
20604         location where this argument is used.  Notice that this is not
20605         part of the "Argument" class as to reduce the size of the
20606         structure (we know the approximate location anyways).
20607
20608         Test if the argument is a variable-reference, if not, then
20609         complain with a 206.
20610
20611         (Argument.Emit): Emit addresses of variables.
20612
20613         (Argument.FullDesc): Simplify.
20614
20615         (Invocation.DoResolve): Update for Argument.Resolve.
20616
20617         (ElementAccess.DoResolve): ditto.
20618
20619         * delegate.cs (DelegateInvocation.Emit): Invocation of Invoke
20620         method should be virtual, as this method is always virtual.
20621
20622         (NewDelegate.DoResolve): Update for Argument.Resolve.
20623
20624         * class.cs (ConstructorInitializer.DoResolve): ditto.
20625
20626         * attribute.cs (Attribute.Resolve): ditto.
20627
20628 2001-11-13  Miguel de Icaza  <miguel@ximian.com>
20629
20630         * statement.cs (Foreach.Emit): Use EmitAssign instead of Store.
20631
20632         * expression.cs (ParameterReference): Drop IStackStorage and implement
20633         IAssignMethod instead. 
20634
20635         (LocalVariableReference): ditto.
20636
20637         * ecore.cs (FieldExpr): Drop IStackStorage and implement
20638         IAssignMethod instead. 
20639
20640 2001-11-13  Miguel de Icaza <miguel@ximian.com>
20641
20642         * parameter.cs, expression.cs, class.cs, ecore.cs: Made all
20643         enumerations that are used in heavily used structures derive from
20644         byte in a laughable and pathetic attempt to reduce memory usage.
20645         This is the kind of pre-optimzations that you should not do at
20646         home without adult supervision.
20647
20648         * expression.cs (UnaryMutator): New class, used to handle ++ and
20649         -- separatedly from the other unary operators.  Cleans up the
20650         code, and kills the ExpressionStatement dependency in Unary.
20651
20652         (Unary): Removed `method' and `Arguments' from this class, making
20653         it smaller, and moving it all to SimpleCall, so I can reuse this
20654         code in other locations and avoid creating a lot of transient data
20655         strucutres when not required.
20656
20657         * cs-parser.jay: Adjust for new changes.
20658
20659 2001-11-11  Miguel de Icaza  <miguel@ximian.com>
20660
20661         * enum.cs (Enum.Populate): If there is a failure during
20662         definition, return
20663
20664         * cs-parser.jay (opt_enum_base): we used to catch type errors
20665         here, but this is really incorrect.  The type error should be
20666         catched during semantic analysis.
20667
20668 2001-12-11  Ravi Pratap  <ravi@ximian.com>
20669
20670         * cs-parser.jay (operator_declarator, conversion_operator_declarator): Set
20671         current_local_parameters as expected since I, in my stupidity, had forgotten
20672         to do this :-)
20673
20674         * attribute.cs (GetValidPlaces): Fix stupid bug.
20675
20676         * class.cs (Method::Emit): Perform check on applicability of attributes.
20677
20678         (Constructor::Emit): Ditto.
20679
20680         (Field::Emit): Ditto.
20681
20682         (Field.Location): Store location information.
20683
20684         (Property, Event, Indexer, Operator): Ditto.
20685
20686         * cs-parser.jay (field_declaration): Pass in location for each field.
20687
20688         * ../errors/cs0592.cs : Add.
20689
20690 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20691
20692         * typemanager.cs (attribute_usage_type): New static member for System.AttributeUsage.
20693
20694         (InitCoreTypes): Update accordingly.
20695
20696         (RegisterAttrType, LookupAttr): Implement.
20697
20698         * attribute.cs (Attribute.Targets, AllowMultiple, Inherited): New fields to hold
20699         info about the same.
20700
20701         (Resolve): Update to populate the above as necessary.
20702
20703         (Error592): Helper.
20704
20705         (GetValidPlaces): Helper to the above.
20706
20707         (CheckAttribute): Implement to perform validity of attributes on declarative elements.
20708
20709         * class.cs (TypeContainer::Emit): Update attribute emission code to perform checking etc.
20710
20711 2001-11-12  Ravi Pratap  <ravi@ximian.com>
20712
20713         * attribute.cs (Attribute::Resolve): Expand to handle named arguments too.
20714
20715         * ../errors/cs0617.cs : Add.
20716
20717 2001-11-11  Ravi Pratap  <ravi@ximian.com>
20718
20719         * enum.cs (Emit): Rename to Populate to be more consistent with what
20720         we expect it to do and when exactly it is called.
20721
20722         * class.cs, rootcontext.cs : Update accordingly.
20723
20724         * typemanager.cs (RegisterField, GetValue): Workarounds for the fact that
20725         FieldInfo.GetValue does not work on dynamic types ! S.R.E lameness strikes again !
20726
20727         * enum.cs (Populate): Register fields with TypeManager.RegisterField.
20728
20729         * expression.cs (MemberAccess.DoResolve): Adjust code to obtain the value
20730         of a fieldinfo using the above, when dealing with a FieldBuilder.
20731
20732 2001-11-10  Ravi Pratap  <ravi@ximian.com>
20733
20734         * ../errors/cs0031.cs : Add.
20735
20736         * ../errors/cs1008.cs : Add.
20737
20738         * ../errrors/cs0543.cs : Add.
20739
20740         * enum.cs (DefineEnum): Check the underlying type and report an error if not a valid
20741         enum type.
20742
20743         (FindMembers): Implement.
20744
20745         * typemanager.cs (FindMembers): Re-write to call the appropriate methods for
20746         enums and delegates too.
20747
20748         (enum_types): Rename to builder_to_enum.
20749
20750         (delegate_types): Rename to builder_to_delegate.
20751
20752         * delegate.cs (FindMembers): Implement.
20753
20754 2001-11-09  Ravi Pratap  <ravi@ximian.com>
20755
20756         * typemanager.cs (IsEnumType): Implement.
20757
20758         * enum.cs (Emit): Re-write parts to account for the underlying type
20759         better and perform checking etc.
20760
20761         (GetNextDefaultValue): Helper to ensure we don't overshoot max value
20762         of the underlying type.
20763
20764         * literal.cs (GetValue methods everywhere): Perform bounds checking and return
20765         value
20766
20767         * enum.cs (error31): Helper to report error #31.
20768
20769         * cs-parser.jay (enum_declaration): Store location of each member too.
20770
20771         * enum.cs (member_to_location): New hashtable. 
20772
20773         (AddEnumMember): Update location hashtable.
20774
20775         (Emit): Use the location of each member while reporting errors.
20776
20777 2001-11-09  Miguel de Icaza  <miguel@ximian.com>
20778
20779         * cs-parser.jay: A for_initializer if is a
20780         local_variable_declaration really ammount to have an implicit
20781         block with the variable declaration and no initializer for for.
20782
20783         * statement.cs (For.Emit): Cope with null initializers.
20784
20785         This fixes the infinite loop on for initializers.
20786
20787 2001-11-08  Miguel de Icaza  <miguel@ximian.com>
20788
20789         * enum.cs: More cleanup.
20790
20791         * ecore.cs: Remove dead code.
20792
20793         * class.cs (Property.Emit): More simplification.
20794         (Event.Emit): ditto.
20795
20796         Reworked to have less levels of indentation.
20797
20798 2001-11-08  Ravi Pratap  <ravi@ximian.com>
20799
20800         * class.cs (Property): Emit attributes.
20801
20802         (Field): Ditto.
20803
20804         (Event): Ditto.
20805
20806         (Indexer): Ditto.
20807
20808         (Operator): Ditto.
20809
20810         * enum.cs (Emit): Ditto.
20811
20812         * rootcontext.cs (ResolveTree, EmitCode, CloseTypes): Do the same for
20813         Enums too.
20814
20815         * class.cs (Field, Event, etc.): Move attribute generation into the
20816         Emit method everywhere.
20817
20818         * enum.cs (Enum): Revamp to use the same definition semantics as delegates so
20819         we have a DefineEnum, CloseEnum etc. The previous way of doing things was not right
20820         as we had no way of defining nested enums !
20821
20822         * rootcontext.cs : Adjust code accordingly.
20823
20824         * typemanager.cs (AddEnumType): To keep track of enum types separately.
20825
20826 2001-11-07  Ravi Pratap  <ravi@ximian.com>
20827
20828         * expression.cs (EvalConstantExpression): Move into ecore.cs
20829
20830         * enum.cs (Enum): Rename some members and make them public and readonly
20831         according to our convention.
20832
20833         * modifiers.cs (EnumAttr): Implement as we need to set only visibility flags,
20834         nothing else.
20835
20836         * enum.cs (Enum::Define): Use the above instead of TypeAttr.
20837
20838         (Enum::Emit): Write a simple version for now which doesn't try to compute
20839         expressions. I shall modify this to be more robust in just a while.
20840
20841         * class.cs (TypeContainer::Emit): Make sure we include Enums too.
20842
20843         (TypeContainer::CloseType): Create the Enum types too.
20844
20845         * attribute.cs (Resolve): Use the new Reduce method instead of EvalConstantExpression.
20846
20847         * expression.cs (EvalConstantExpression): Get rid of completely.
20848
20849         * enum.cs (Enum::Emit): Use the new expression reducer. Implement assigning
20850         user-defined values and other cases.
20851
20852         (IsValidEnumLiteral): Helper function.
20853
20854         * expression.cs (ExprClassfromMemberInfo): Modify to not do any literalizing 
20855         out there in the case we had a literal FieldExpr.
20856
20857         (MemberAccess:DoResolve): Do the literalizing of the FieldExpr here.
20858
20859         (Literalize): Revamp a bit to take two arguments.
20860
20861         (EnumLiteral): New class which derives from Literal to wrap enum literals.
20862
20863 2001-11-06  Ravi Pratap  <ravi@ximian.com>
20864
20865         * cs-parser.jay (compilation_unit): Remove extra opt_attributes for now.
20866
20867         * expression.cs (ArrayCreation::ValidateInitializers): Implement.
20868
20869         (Resolve): Use the above to ensure we have proper initializers.
20870
20871 2001-11-05  Ravi Pratap  <ravi@ximian.com>
20872
20873         * expression.cs (Expression::EvalConstantExpression): New method to 
20874         evaluate constant expressions.
20875
20876         * attribute.cs (Attribute::Resolve): Modify bits to use the above function.
20877
20878 2001-11-07  Miguel de Icaza  <miguel@ximian.com>
20879
20880         * expression.cs (ArrayCreation.Emit): Some bits to initialize data
20881         in an array.
20882
20883         (Binary.ResolveOperator): Handle operator != (object a, object b)
20884         and operator == (object a, object b);
20885
20886         (Binary.DoNumericPromotions): Indicate whether the numeric
20887         promotion was possible.
20888
20889         (ArrayAccess.DoResolve, ArrayAccess.Emit, ArrayAccess.EmitAssign):
20890         Implement.  
20891
20892         Made the ArrayAccess implement interface IAssignMethod instead of
20893         IStackStore as the order in which arguments are passed reflects
20894         this.
20895
20896         * assign.cs: Instead of using expr.ExprClass to select the way of
20897         assinging, probe for the IStackStore/IAssignMethod interfaces.
20898
20899         * typemanager.cs: Load InitializeArray definition.
20900
20901         * rootcontext.cs (RootContext.MakeStaticData): Used to define
20902         static data that can be used to initialize arrays. 
20903
20904 2001-11-05  Miguel de Icaza  <miguel@ximian.com>
20905
20906         * expression.cs: Handle operator== and operator!= for booleans.
20907
20908         (Conditioal.Reduce): Implement reducer for the ?: operator.
20909
20910         (Conditional.Resolve): Implement dead code elimination.
20911
20912         (Binary.Resolve): Catch string literals and return a new
20913         concatenated string.
20914
20915         (Unary.Reduce): Implement reduction of unary expressions.
20916
20917         * ecore.cs: Split out the expression core handling here.
20918
20919         (Expression.Reduce): New method used to perform constant folding
20920         and CSE.  This is needed to support constant-expressions. 
20921
20922         * statement.cs (Statement.EmitBoolExpression): Pass true and false
20923         targets, and optimize for !x.
20924
20925 2001-11-04  Ravi Pratap  <ravi@ximian.com>
20926
20927         * attribute.cs (Attribute::Resolve): Implement guts. Note that resolution
20928         of an attribute gives us a CustomAttributeBuilder which we use accordingly to
20929         set custom atttributes.
20930
20931         * literal.cs (Literal::GetValue): New abstract method to return the actual
20932         value of the literal, cast as an object.
20933
20934         (*Literal): Implement GetValue method.
20935
20936         * cs-parser.jay (positional_argument_list, named_argument_list): Add not just plain
20937         expressions to the arraylist but objects of type Argument.
20938
20939         * class.cs (TypeContainer::Emit): Emit our attributes too.
20940
20941         (Method::Emit, Constructor::Emit): Ditto.
20942
20943         * cs-parser.jay (constructor_declaration): Set attributes too, which we seemed
20944         to be ignoring earlier.
20945
20946 2001-11-03  Ravi Pratap  <ravi@ximian.com>
20947
20948         * attribute.cs (AttributeSection::Define): Implement to do the business
20949         of constructing a CustomAttributeBuilder.
20950
20951         (Attribute): New trivial class. Increases readability of code.  
20952
20953         * cs-parser.jay : Update accordingly.
20954
20955         (positional_argument_list, named_argument_list, named_argument): New rules
20956
20957         (attribute_arguments): Use the above so that we are more correct.
20958
20959 2001-11-02  Ravi Pratap  <ravi@ximian.com>
20960
20961         * expression.cs (Invocation::IsParamsMethodApplicable): Implement
20962         to perform all checks for a method with a params parameter.
20963
20964         (Invocation::OverloadResolve): Update to use the above method and therefore
20965         cope correctly with params method invocations.
20966
20967         * support.cs (InternalParameters::ParameterDesc): Provide a desc for 
20968         params too.
20969
20970         * class.cs (ConstructorInitializer::Resolve): Make sure we look for Non-public
20971         constructors in our parent too because we can't afford to miss out on 
20972         protected ones ;-)
20973
20974         * attribute.cs (AttributeSection): New name for the class Attribute
20975
20976         Other trivial changes to improve readability.
20977
20978         * cs-parser.jay (opt_attributes, attribute_section etc.): Modify to
20979         use the new class names.
20980
20981 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20982
20983         * class.cs (Method::Define): Complete definition for params types too
20984
20985         (Indexer::Define): Ditto.
20986
20987         * support.cs (InternalParameters::ParameterType, ParameterDesc, ParameterModifier):
20988         Cope everywhere with a request for info about the array parameter.
20989
20990 2001-11-01  Ravi Pratap  <ravi@ximian.com>
20991
20992         * tree.cs (RecordNamespace): Fix up to check for the correct key.
20993
20994         * cs-parser.jay (GetQualifiedIdentifier): New Helper method used in 
20995         local_variable_type to extract the string corresponding to the type.
20996
20997         (local_variable_type): Fixup the action to use the new helper method.
20998
20999         * codegen.cs : Get rid of RefOrOutParameter, it's not the right way to 
21000         go.
21001
21002         * expression.cs : Clean out code which uses the above.
21003
21004 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21005
21006         * typemanager.cs (RegisterMethod): Check if we already have an existing key
21007         and bale out if necessary by returning a false.
21008
21009         (RegisterProperty): Ditto.
21010
21011         * class.cs (everywhere): Check the return value from TypeManager.RegisterMethod
21012         and print out appropriate error messages.
21013
21014         * interface.cs (everywhere): Ditto.
21015
21016         * cs-parser.jay (property_declaration, event_declaration, indexer_declaration): Pass
21017         location to constructor.
21018
21019         * class.cs (Property, Event, Indexer): Update accordingly.
21020
21021         * ../errors/cs111.cs : Added.
21022
21023         * expression.cs (Invocation::IsApplicable): New static method to determine applicability
21024         of a method, as laid down by the spec.
21025
21026         (Invocation::OverloadResolve): Use the above method.
21027
21028 2001-10-31  Ravi Pratap  <ravi@ximian.com>
21029
21030         * support.cs (InternalParameters): Get rid of crap taking in duplicate info. We
21031         now take a TypeContainer and a Parameters object.
21032
21033         (ParameterData): Modify return type of ParameterModifier method to be 
21034         Parameter.Modifier and not a string.
21035
21036         (ReflectionParameters, InternalParameters): Update accordingly.
21037
21038         * expression.cs (Argument::GetParameterModifier): Same here.
21039
21040         * support.cs (InternalParameters::ParameterType): Find a better way of determining
21041         if we are a ref/out parameter. Actually, the type shouldn't be holding the '&'
21042         symbol in it at all so maybe this is only for now.
21043
21044 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21045
21046         * support.cs (InternalParameters): Constructor now takes an extra argument 
21047         which is the actual Parameters class.
21048
21049         (ParameterDesc): Update to provide info on ref/out modifiers.
21050
21051         * class.cs (everywhere): Update call to InternalParameters to pass in
21052         the second argument too.
21053
21054         * support.cs (ParameterData): Add ParameterModifier, which is a method 
21055         to return the modifier info [ref/out etc]
21056
21057         (InternalParameters, ReflectionParameters): Implement the above.
21058
21059         * expression.cs (Argument::ParameterModifier): Similar function to return
21060         info about the argument's modifiers.
21061
21062         (Invocation::OverloadResolve): Update to take into account matching modifiers 
21063         too.
21064
21065         * class.cs (Indexer::Define): Actually define a Parameter object and put it onto
21066         a new SetFormalParameters object which we pass to InternalParameters.
21067
21068 2001-10-30  Ravi Pratap  <ravi@ximian.com>
21069
21070         * expression.cs (NewArray): Merge into the ArrayCreation class.
21071
21072 2001-10-29  Ravi Pratap  <ravi@ximian.com>
21073
21074         * expression.cs (NewArray): Merge classes NewBuiltinArray and 
21075         NewUserdefinedArray into one as there wasn't much of a use in having
21076         two separate ones.
21077
21078         * expression.cs (Argument): Change field's name to ArgType from Type.
21079
21080         (Type): New readonly property which returns the proper type, taking into 
21081         account ref/out modifiers.
21082
21083         (everywhere): Adjust code accordingly for the above.
21084
21085         * codegen.cs (EmitContext.RefOrOutParameter): New field to determine
21086         whether we are emitting for a ref or out parameter.
21087
21088         * expression.cs (Argument::Emit): Use the above field to set the state.
21089
21090         (LocalVariableReference::Emit): Update to honour the flag and emit the
21091         right stuff.
21092
21093         * parameter.cs (Attributes): Set the correct flags for ref parameters.
21094
21095         * expression.cs (Argument::FullDesc): New function to provide a full desc.
21096
21097         * support.cs (ParameterData): Add method ParameterDesc to the interface.
21098
21099         (ReflectionParameters, InternalParameters): Implement the above method.
21100
21101         * expression.cs (Invocation::OverloadResolve): Use the new desc methods in
21102         reporting errors.
21103
21104         (Invocation::FullMethodDesc): Ditto. 
21105
21106 2001-10-29  Miguel de Icaza  <miguel@ximian.com>
21107
21108         * cs-parser.jay: Add extra production for the second form of array
21109         creation. 
21110
21111         * expression.cs (ArrayCreation): Update to reflect the above
21112         change. 
21113
21114         * Small changes to prepare for Array initialization.
21115
21116 2001-10-28  Miguel de Icaza  <miguel@ximian.com>
21117
21118         * typemanager.cs (ImplementsInterface): interface might be null;
21119         Deal with this problem;
21120
21121         Also, we do store negative hits on the cache (null values), so use
21122         this instead of calling t.GetInterfaces on the type everytime.
21123
21124 2001-10-28  Ravi Pratap  <ravi@ximian.com>
21125
21126         * typemanager.cs (IsBuiltinType): New method to help determine the same.
21127
21128         * expression.cs (New::DoResolve): Get rid of array creation code and instead
21129         split functionality out into different classes.
21130
21131         (New::FormArrayType): Move into NewBuiltinArray.
21132
21133         (Invocation::EmitArguments): Get rid of the MethodBase argument. Appears
21134         quite useless.
21135
21136         (NewBuiltinArray): New class to handle creation of built-in arrays.
21137
21138         (NewBuiltinArray::DoResolve): Implement guts of array creation. Also take into
21139         account creation of one-dimensional arrays.
21140
21141         (::Emit): Implement to use Newarr and Newobj opcodes accordingly.
21142
21143         (NewUserdefinedArray::DoResolve): Implement.
21144
21145         * cs-parser.jay (local_variable_type): Fix up to add the rank to the variable too.
21146
21147         * typemanager.cs (AddModule): Used to add a ModuleBuilder to the list of modules
21148         we maintain inside the TypeManager. This is necessary to perform lookups on the
21149         module builder.
21150
21151         (LookupType): Update to perform GetType on the module builders too.     
21152
21153         * driver.cs (Driver): Add the ModuleBuilder to the list maintained by the TypeManager.
21154
21155         * exprssion.cs (NewUserdefinedArray::Emit): Implement.
21156
21157 2001-10-23  Ravi Pratap  <ravi@ximian.com>
21158
21159         * expression.cs (New::DoResolve): Implement guts of array creation.
21160
21161         (New::FormLookupType): Rename to FormArrayType and modify ever so slightly.
21162
21163 2001-10-27  Miguel de Icaza  <miguel@ximian.com>
21164
21165         * expression.cs: Fix bug I introduced lsat night that broke
21166         Delegates. 
21167
21168         (Expression.Resolve): Report a 246 error (can not resolve name)
21169         if we find a SimpleName in the stream.
21170
21171         (Expression.ResolveLValue): Ditto.
21172
21173         (Expression.ResolveWithSimpleName): This function is a variant of
21174         ResolveName, this one allows SimpleNames to be returned without a
21175         warning.  The only consumer of SimpleNames is MemberAccess
21176
21177 2001-10-26  Miguel de Icaza  <miguel@ximian.com>
21178
21179         * expression.cs (Invocation::DoResolve): Catch SimpleNames that
21180         might arrive here.  I have my doubts that this is correct.
21181
21182         * statement.cs (Lock): Implement lock statement.
21183
21184         * cs-parser.jay: Small fixes to support `lock' and `using'
21185
21186         * cs-tokenizer.cs: Remove extra space
21187
21188         * driver.cs: New flag --checked, allows to turn on integer math
21189         checking. 
21190
21191         * typemanger.cs: Load methodinfos for Threading.Monitor.Enter and
21192         Threading.Monitor.Exit 
21193
21194 2001-10-23  Miguel de Icaza  <miguel@ximian.com>
21195
21196         * expression.cs (IndexerAccess::DoResolveLValue): Set the
21197         Expression Class to be IndexerAccess.
21198
21199         Notice that Indexer::DoResolve sets the eclass to Value.
21200
21201 2001-10-22  Miguel de Icaza  <miguel@ximian.com>
21202
21203         * class.cs (TypeContainer::Emit): Emit code for indexers.
21204
21205         * assign.cs (IAssignMethod): New interface implemented by Indexers
21206         and Properties for handling assignment.
21207
21208         (Assign::Emit): Simplify and reuse code. 
21209
21210         * expression.cs (IndexerAccess, PropertyExpr): Implement
21211         IAssignMethod, clean up old code. 
21212
21213 2001-10-22  Ravi Pratap  <ravi@ximian.com>
21214
21215         * typemanager.cs (ImplementsInterface): New method to determine if a type
21216         implements a given interface. Provides a nice cache too.
21217
21218         * expression.cs (ImplicitReferenceConversion): Update checks to use the above
21219         method.
21220
21221         (ConvertReferenceExplicit): Ditto.
21222
21223         * delegate.cs (Delegate::Populate): Update to define the parameters on the 
21224         various methods, with correct names etc.
21225
21226         * class.cs (Operator::OpType): New members Operator.UnaryPlus and 
21227         Operator.UnaryNegation.
21228
21229         * cs-parser.jay (operator_declarator): Be a little clever in the case where
21230         we have a unary plus or minus operator.
21231
21232         * expression.cs (Unary): Rename memebers of Operator enum to UnaryPlus and 
21233         UnaryMinus.
21234
21235         * everywhere : update accordingly.
21236
21237         * everywhere : Change Negate and BitComplement to LogicalNot and OnesComplement
21238         respectively.
21239
21240         * class.cs (Method::Define): For the case where we are implementing a method
21241         inherited from an interface, we need to set the MethodAttributes.Final flag too. 
21242         Also set MethodAttributes.NewSlot and MethodAttributes.HideBySig.
21243
21244 2001-10-21  Ravi Pratap  <ravi@ximian.com>
21245
21246         * interface.cs (FindMembers): Implement to work around S.R.E
21247         lameness.
21248
21249         * typemanager.cs (IsInterfaceType): Implement.
21250
21251         (FindMembers): Update to handle interface types too.
21252
21253         * expression.cs (ImplicitReferenceConversion): Re-write bits which
21254         use IsAssignableFrom as that is not correct - it doesn't work.
21255
21256         * delegate.cs (DelegateInvocation): Derive from ExpressionStatement
21257         and accordingly override EmitStatement.
21258
21259         * expression.cs (ConvertReferenceExplicit): Re-write similary, this time
21260         using the correct logic :-)
21261
21262 2001-10-19  Ravi Pratap  <ravi@ximian.com>
21263
21264         * ../errors/cs-11.cs : Add to demonstrate error -11 
21265
21266 2001-10-17  Miguel de Icaza  <miguel@ximian.com>
21267
21268         * assign.cs (Assign::Resolve): Resolve right hand side first, and
21269         then pass this as a hint to ResolveLValue.
21270
21271         * expression.cs (FieldExpr): Add Location information
21272
21273         (FieldExpr::LValueResolve): Report assignment to readonly
21274         variable. 
21275
21276         (Expression::ExprClassFromMemberInfo): Pass location information.
21277
21278         (Expression::ResolveLValue): Add new method that resolves an
21279         LValue. 
21280
21281         (Expression::DoResolveLValue): Default invocation calls
21282         DoResolve. 
21283
21284         (Indexers): New class used to keep track of indexers in a given
21285         Type. 
21286
21287         (IStackStore): Renamed from LValue, as it did not really describe
21288         what this did.  Also ResolveLValue is gone from this interface and
21289         now is part of Expression.
21290
21291         (ElementAccess): Depending on the element access type
21292
21293         * typemanager.cs: Add `indexer_name_type' as a Core type
21294         (System.Runtime.CompilerServices.IndexerNameAttribute)
21295
21296         * statement.cs (Goto): Take a location.
21297
21298 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21299
21300         * delegate.cs (Delegate::VerifyDelegate): New method to verify
21301         if two delegates are compatible.
21302
21303         (NewDelegate::DoResolve): Update to take care of the case when
21304         we instantiate a delegate from another delegate.
21305
21306         * typemanager.cs (FindMembers): Don't even try to look up members
21307         of Delegate types for now.
21308
21309 2001-10-18  Ravi Pratap  <ravi@ximian.com>
21310
21311         * delegate.cs (NewDelegate): New class to take care of delegate
21312         instantiation.
21313
21314         * expression.cs (New): Split the delegate related code out into 
21315         the NewDelegate class.
21316
21317         * delegate.cs (DelegateInvocation): New class to handle delegate 
21318         invocation.
21319
21320         * expression.cs (Invocation): Split out delegate related code into
21321         the DelegateInvocation class.
21322
21323 2001-10-17  Ravi Pratap  <ravi@ximian.com>
21324
21325         * expression.cs (New::DoResolve): Implement delegate creation fully
21326         and according to the spec.
21327
21328         (New::DoEmit): Update to handle delegates differently.
21329
21330         (Invocation::FullMethodDesc): Fix major stupid bug thanks to me
21331         because of which we were printing out arguments in reverse order !
21332
21333         * delegate.cs (VerifyMethod): Implement to check if the given method
21334         matches the delegate.
21335
21336         (FullDelegateDesc): Implement.
21337
21338         (VerifyApplicability): Implement.
21339
21340         * expression.cs (Invocation::DoResolve): Update to accordingly handle
21341         delegate invocations too.
21342
21343         (Invocation::Emit): Ditto.
21344
21345         * ../errors/cs1593.cs : Added.
21346
21347         * ../errors/cs1594.cs : Added.
21348
21349         * delegate.cs (InstanceExpression, TargetMethod): New properties.
21350
21351 2001-10-16  Ravi Pratap  <ravi@ximian.com>
21352
21353         * typemanager.cs (intptr_type): Core type for System.IntPtr
21354
21355         (InitCoreTypes): Update for the same.
21356
21357         (iasyncresult_type, asynccallback_type): Ditto.
21358
21359         * delegate.cs (Populate): Fix to use System.Intptr as it is indeed
21360         correct.
21361
21362         * typemanager.cs (AddDelegateType): Store a pointer to the Delegate class
21363         too.
21364
21365         * delegate.cs (ConstructorBuilder, InvokeBuilder, ...): New members to hold
21366         the builders for the 4 members of a delegate type :-)
21367
21368         (Populate): Define the BeginInvoke and EndInvoke methods on the delegate
21369         type.
21370
21371         * expression.cs (New::DoResolve): Implement guts for delegate creation.
21372
21373         * ../errors/errors.txt : Update for an error (-11) which only we catch :-)
21374
21375 2001-10-15  Miguel de Icaza  <miguel@ximian.com>
21376
21377         * statement.cs (Break::Emit): Implement.   
21378         (Continue::Emit): Implement.
21379
21380         (For::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21381         (While::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21382         (Do::Emit): Track old being/end loops;  Set Begin loop, ack end loop
21383         (Foreach::Emit): Track old being/end loops;  Set Begin loop, ack
21384         end loop
21385
21386         * codegen.cs (EmitContext::LoopEnd, EmitContext::LoopBegin): New
21387         properties that track the label for the current loop (begin of the
21388         loop and end of the loop).
21389
21390 2001-10-15  Ravi Pratap  <ravi@ximian.com>
21391
21392         * delegate.cs (Emit): Get rid of it as there doesn't seem to be any ostensible
21393         use of emitting anything at all.
21394
21395         * class.cs, rootcontext.cs : Get rid of calls to the same.
21396
21397         * delegate.cs (DefineDelegate): Make sure the class we define is also sealed.
21398
21399         (Populate): Define the constructor correctly and set the implementation
21400         attributes.
21401
21402         * typemanager.cs (delegate_types): New hashtable to hold delegates that
21403         have been defined.
21404
21405         (AddDelegateType): Implement.
21406
21407         (IsDelegateType): Implement helper method.
21408
21409         * delegate.cs (DefineDelegate): Use AddDelegateType instead of AddUserType.
21410
21411         * expression.cs (New::DoResolve): Check if we are trying to instantiate a delegate type
21412         and accordingly handle it.
21413
21414         * delegate.cs (Populate): Take TypeContainer argument.
21415         Implement bits to define the Invoke method. However, I still haven't figured out
21416         how to take care of the native int bit :-(
21417
21418         * cs-parser.jay (delegate_declaration): Fixed the bug that I had introduced :-) 
21419         Qualify the name of the delegate, not its return type !
21420
21421         * expression.cs (ImplicitReferenceConversion): Implement guts of implicit array
21422         conversion.
21423
21424         (StandardConversionExists): Checking for array types turns out to be recursive.
21425
21426         (ConvertReferenceExplicit): Implement array conversion.
21427
21428         (ExplicitReferenceConversionExists): New method to determine precisely that :-)
21429
21430 2001-10-12  Ravi Pratap  <ravi@ximian.com>
21431
21432         * cs-parser.jay (delegate_declaration): Store the fully qualified
21433         name as it is a type declaration.
21434
21435         * delegate.cs (ReturnType, Name): Rename members to these. Make them 
21436         readonly.
21437
21438         (DefineDelegate): Renamed from Define. Does the same thing essentially,
21439         as TypeContainer::DefineType.
21440
21441         (Populate): Method in which all the definition of the various methods (Invoke)
21442         etc is done.
21443
21444         (Emit): Emit any code, if necessary. I am not sure about this really, but let's
21445         see.
21446
21447         (CloseDelegate): Finally creates the delegate.
21448
21449         * class.cs (TypeContainer::DefineType): Update to define delegates.
21450         (Populate, Emit and CloseType): Do the same thing here too.
21451
21452         * rootcontext.cs (ResolveTree, PopulateTypes, EmitCode, CloseTypes): Include
21453         delegates in all these operations.
21454
21455 2001-10-14  Miguel de Icaza  <miguel@ximian.com>
21456
21457         * expression.cs: LocalTemporary: a new expression used to
21458         reference a temporary that has been created.
21459
21460         * assign.cs: Handle PropertyAccess back here, so that we can
21461         provide the proper semantic access to properties.
21462
21463         * expression.cs (Expression::ConvertReferenceExplicit): Implement
21464         a few more explicit conversions. 
21465
21466         * modifiers.cs: `NEW' modifier maps to HideBySig.
21467
21468         * expression.cs (PropertyExpr): Make this into an
21469         ExpressionStatement, and support the EmitStatement code path. 
21470
21471         Perform get/set error checking, clean up the interface.
21472
21473         * assign.cs: recognize PropertyExprs as targets, and if so, turn
21474         them into toplevel access objects.
21475
21476 2001-10-12  Miguel de Icaza  <miguel@ximian.com>
21477
21478         * expression.cs: PropertyExpr::PropertyExpr: use work around the
21479         SRE.
21480
21481         * typemanager.cs: Keep track here of our PropertyBuilders again to
21482         work around lameness in SRE.
21483
21484 2001-10-11  Miguel de Icaza  <miguel@ximian.com>
21485
21486         * expression.cs (LValue::LValueResolve): New method in the
21487         interface, used to perform a second resolution pass for LValues. 
21488
21489         (This::DoResolve): Catch the use of this in static methods.
21490
21491         (This::LValueResolve): Implement.
21492
21493         (This::Store): Remove warning, assigning to `this' in structures
21494         is 
21495
21496         (Invocation::Emit): Deal with invocation of
21497         methods on value types.  We need to pass the address to structure
21498         methods rather than the object itself.  (The equivalent code to
21499         emit "this" for structures leaves the entire structure on the
21500         stack instead of a pointer to it). 
21501
21502         (ParameterReference::DoResolve): Compute the real index for the
21503         argument based on whether the method takes or not a `this' pointer
21504         (ie, the method is static).
21505
21506         * codegen.cs (EmitContext::GetTemporaryStorage): Used to store
21507         value types returned from functions when we need to invoke a
21508         method on the sturcture.
21509
21510
21511 2001-10-11  Ravi Pratap  <ravi@ximian.com>
21512
21513         * class.cs (TypeContainer::DefineType): Method to actually do the business of
21514         defining the type in the Modulebuilder or Typebuilder. This is to take
21515         care of nested types which need to be defined on the TypeBuilder using
21516         DefineNestedMethod.
21517
21518         (TypeContainer::GetClassBases): Implement. Essentially the code from the 
21519         methods in RootContext, only ported to be part of TypeContainer.
21520
21521         (TypeContainer::GetInterfaceOrClass): Ditto.
21522
21523         (TypeContainer::LookupInterfaceOrClass, ::MakeFQN): Ditto.
21524
21525         * interface.cs (Interface::DefineInterface): New method. Does exactly
21526         what RootContext.CreateInterface did earlier, only it takes care of nested types 
21527         too.
21528
21529         (Interface::GetInterfaces): Move from RootContext here and port.
21530
21531         (Interface::GetInterfaceByName): Same here.
21532
21533         * rootcontext.cs (ResolveTree): Re-write.
21534
21535         (PopulateTypes): Re-write.
21536
21537         * class.cs (TypeContainer::Populate): Populate nested types too.
21538         (TypeContainer::Emit): Emit nested members too.
21539
21540         * typemanager.cs (AddUserType): Do not make use of the FullName property,
21541         instead just use the name argument passed in as it is already fully
21542         qualified.
21543
21544         (FindMembers): Check in the Builders to TypeContainer mapping instead of the name
21545         to TypeContainer mapping to see if a type is user-defined.
21546
21547         * class.cs (TypeContainer::CloseType): Implement. 
21548
21549         (TypeContainer::DefineDefaultConstructor): Use Basename, not Name while creating
21550         the default constructor.
21551
21552         (TypeContainer::Populate): Fix minor bug which led to creating default constructors
21553         twice.
21554
21555         (Constructor::IsDefault): Fix up logic to determine if it is the default constructor
21556
21557         * interface.cs (CloseType): Create the type here.
21558
21559         * rootcontext.cs (CloseTypes): Re-write to recursively close types by running through
21560         the hierarchy.
21561
21562         Remove all the methods which are now in TypeContainer.
21563
21564 2001-10-10  Ravi Pratap  <ravi@ximian.com>
21565
21566         * delegate.cs (Define): Re-write bits to define the delegate
21567         correctly.
21568
21569 2001-10-10  Miguel de Icaza  <miguel@ximian.com>
21570
21571         * makefile: Renamed the compiler to `mcs.exe' instead of compiler.exe
21572
21573         * expression.cs (ImplicitReferenceConversion): handle null as well
21574         as a source to convert to any reference type.
21575
21576         * statement.cs (Return): Perform any implicit conversions to
21577         expected return type.  
21578
21579         Validate use of return statement.  
21580
21581         * codegen.cs (EmitContext): Pass the expected return type here.
21582
21583         * class.cs (Method, Constructor, Property): Pass expected return
21584         type to EmitContext.
21585
21586 2001-10-09  Miguel de Icaza  <miguel@ximian.com>
21587
21588         * expression.cs: Make DoResolve take an EmitContext instead of a
21589         TypeContainer.
21590
21591         Replaced `l' and `location' for `loc', for consistency.
21592
21593         (Error, Warning): Remove unneeded Tc argument.
21594
21595         * assign.cs, literal.cs, constant.cs: Update to new calling
21596         convention. 
21597
21598         * codegen.cs: EmitContext now contains a flag indicating whether
21599         code is being generated in a static method or not.
21600
21601         * cs-parser.jay: DecomposeQI, new function that replaces the old
21602         QualifiedIdentifier.  Now we always decompose the assembled
21603         strings from qualified_identifier productions into a group of
21604         memberaccesses.
21605
21606 2001-10-08  Miguel de Icaza  <miguel@ximian.com>
21607
21608         * rootcontext.cs: Deal with field-less struct types correctly now
21609         by passing the size option to Define Type.
21610
21611         * class.cs: Removed hack that created one static field. 
21612
21613 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21614
21615         * statement.cs: Moved most of the code generation here. 
21616
21617 2001-10-09  Ravi Pratap  <ravi@ximian.com>
21618
21619         * expression.cs (New::DoResolve): Revert changes for array creation, doesn't
21620         seem very right.
21621
21622         (ElementAccess): Remove useless bits for now - keep checks as the spec
21623         says.
21624
21625 2001-10-08  Ravi Pratap  <ravi@ximian.com>
21626
21627         * expression.cs (ElementAccess::DoResolve): Remove my crap code
21628         and start performing checks according to the spec.
21629
21630 2001-10-07  Ravi Pratap  <ravi@ximian.com>
21631
21632         * cs-parser.jay (type_suffix*): Remove - they are redundant. Use
21633         rank_specifiers instead.
21634
21635         (rank_specifiers): Change the order in which the rank specifiers are stored
21636
21637         (local_variable_declaration): Use opt_rank_specifier instead of type_suffixes.
21638
21639         * expression.cs (ElementAccess): Implement the LValue interface too.
21640
21641 2001-10-06  Ravi Pratap  <ravi@ximian.com>
21642
21643         * expression.cs (ConvertExplicitStandard): Add. Same as ConvertExplicit
21644         except that user defined conversions are not included.
21645
21646         (UserDefinedConversion): Update to use the ConvertExplicitStandard to 
21647         perform the conversion of the return type, if necessary.
21648
21649         (New::DoResolve): Check whether we are creating an array or an object
21650         and accordingly do the needful.
21651
21652         (New::Emit): Same here.
21653
21654         (New::DoResolve): Implement guts of array creation.
21655
21656         (New::FormLookupType): Helper function.
21657
21658 2001-10-07  Miguel de Icaza  <miguel@ximian.com>
21659
21660         * codegen.cs: Removed most of the code generation here, and move the
21661         corresponding code generation bits to the statement classes. 
21662
21663         Added support for try/catch/finalize and throw.
21664
21665         * cs-parser.jay: Added support for try/catch/finalize.
21666
21667         * class.cs: Catch static methods having the flags override,
21668         virtual or abstract.
21669
21670         * expression.cs (UserCast): This user cast was not really doing
21671         what it was supposed to do.  Which is to be born in fully resolved
21672         state.  Parts of the resolution were being performed at Emit time! 
21673
21674         Fixed this code.
21675
21676 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21677
21678         * expression.cs: Implicity convert the result from UserCast.
21679
21680 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21681
21682         * expression.cs (Expression::FindMostEncompassingType): Fix bug which
21683         prevented it from working correctly. 
21684
21685         (ConvertExplicit): Make the first try, a call to ConvertImplicitStandard, not
21686         merely ConvertImplicit.
21687
21688 2001-10-05  Miguel de Icaza  <miguel@ximian.com>
21689
21690         * typemanager.cs: Make the LookupTypeContainer function static,
21691         and not per-instance.  
21692
21693         * class.cs: Make static FindMembers (the one that takes a Type
21694         argument). 
21695
21696         * codegen.cs: Add EmitForeach here.
21697
21698         * cs-parser.jay: Make foreach a toplevel object instead of the
21699         inline expansion, as we need to perform semantic analysis on it. 
21700
21701 2001-10-05  Ravi Pratap  <ravi@ximian.com>
21702
21703         * expression.cs (Expression::ImplicitUserConversion): Rename to
21704         UserDefinedConversion.
21705
21706         (Expression::UserDefinedConversion): Take an extra argument specifying 
21707         whether we look for explicit user conversions too.
21708
21709         (Expression::ImplicitUserConversion): Make it a call to UserDefinedConversion.
21710
21711         (UserDefinedConversion): Incorporate support for user defined explicit conversions.
21712
21713         (ExplicitUserConversion): Make it a call to UserDefinedConversion
21714         with the appropriate arguments.
21715
21716         * cs-parser.jay (cast_expression): Record location too.
21717
21718         * expression.cs (Cast): Record location info.
21719
21720         (Expression::ConvertExplicit): Take location argument.
21721
21722         (UserImplicitCast): Change name to UserCast. Take an extra constructor argument
21723         to determine if we are doing explicit conversions.
21724
21725         (UserCast::Emit): Update accordingly.
21726
21727         (Expression::ConvertExplicit): Report an error if everything fails.
21728
21729         * ../errors/cs0030.cs : Add.
21730
21731 2001-10-04  Miguel de Icaza  <miguel@ximian.com>
21732
21733         * modifiers.cs: If the ABSTRACT keyword is present, also set the
21734         virtual and newslot bits. 
21735
21736         * class.cs (TypeContainer::RegisterRequiredImplementations):
21737         Record methods we need.
21738
21739         (TypeContainer::MakeKey): Helper function to make keys for
21740         MethodBases, since the Methodbase key is useless.
21741
21742         (TypeContainer::Populate): Call RegisterRequiredImplementations
21743         before defining the methods.   
21744
21745         Create a mapping for method_builders_to_methods ahead of time
21746         instead of inside a tight loop.
21747
21748         (::RequireMethods):  Accept an object as the data to set into the
21749         hashtable so we can report interface vs abstract method mismatch.
21750
21751 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21752
21753         * report.cs: Make all of it static.
21754
21755         * rootcontext.cs: Drop object_type and value_type computations, as
21756         we have those in the TypeManager anyways.
21757
21758         Drop report instance variable too, now it is a global.
21759
21760         * driver.cs: Use try/catch on command line handling.
21761
21762         Add --probe option to debug the error reporting system with a test
21763         suite. 
21764
21765         * report.cs: Add support for exiting program when a probe
21766         condition is reached.
21767
21768 2001-10-03  Ravi Pratap  <ravi@ximian.com>
21769
21770         * expression.cs (Binary::DoNumericPromotions): Fix the case when
21771         we do a forcible conversion regardless of type, to check if 
21772         ForceConversion returns a null.
21773
21774         (Binary::error19): Use location to report error.
21775
21776         (Unary::error23): Use location here too.
21777
21778         * ../errors/cs0019.cs : Check in.
21779
21780         * ../errors/cs0023.cs : Check in.
21781
21782         * expression.cs (Expression.MemberLookup): Return null for a rather esoteric
21783         case of a non-null MethodInfo object with a length of 0 !
21784
21785         (Binary::ResolveOperator): Flag error if overload resolution fails to find
21786         an applicable member - according to the spec :-)
21787         Also fix logic to find members in base types.
21788
21789         (Unary::ResolveOperator): Same here.
21790
21791         (Unary::report23): Change name to error23 and make first argument a TypeContainer
21792         as I was getting thoroughly confused between this and error19 :-)
21793
21794         * expression.cs (Expression::ImplicitUserConversion): Re-write fully
21795         (::FindMostEncompassedType): Implement.
21796         (::FindMostEncompassingType): Implement.
21797         (::StandardConversionExists): Implement.
21798
21799         (UserImplicitCast): Re-vamp. We now need info about most specific
21800         source and target types so that we can do the necessary conversions.
21801
21802         (Invocation::MakeUnionSet): Completely re-write to make sure we form a proper
21803         mathematical union with no duplicates.
21804
21805 2001-10-03  Miguel de Icaza  <miguel@ximian.com>
21806
21807         * rootcontext.cs (RootContext::PopulateTypes): Populate containers
21808         in order from base classes to child classes, so that we can in
21809         child classes look up in our parent for method names and
21810         attributes (required for handling abstract, virtual, new, override
21811         constructs: we need to instrospect our base class, and if we dont
21812         populate the classes in order, the introspection might be
21813         incorrect.  For example, a method could query its parent before
21814         the parent has any methods and would determine that the parent has
21815         no abstract methods (while it could have had them)).
21816
21817         (RootContext::CreateType): Record the order in which we define the
21818         classes.
21819
21820 2001-10-02  Miguel de Icaza  <miguel@ximian.com>
21821
21822         * class.cs (TypeContainer::Populate): Also method definitions can
21823         fail now, keep track of this.
21824
21825         (TypeContainer::FindMembers): Implement support for
21826         DeclaredOnly/noDeclaredOnly flag.
21827
21828         (Constructor::Emit) Return the ConstructorBuilder.
21829
21830         (Method::Emit) Return the MethodBuilder. 
21831         Check for abstract or virtual methods to be public.
21832
21833         * rootcontext.cs (RootContext::CreateType): Register all the
21834         abstract methods required for the class to be complete and the
21835         interface methods that must be implemented. 
21836
21837         * cs-parser.jay: Report error 501 (method requires body if it is
21838         not marked abstract or extern).
21839
21840         * expression.cs (TypeOf::Emit): Implement.
21841
21842         * typemanager.cs: runtime_handle_type, new global type.
21843
21844         * class.cs (Property::Emit): Generate code for properties.
21845
21846 2001-10-02  Ravi Pratap  <ravi@ximian.com>
21847
21848         * expression.cs (Unary::ResolveOperator): Find operators on base type
21849         too - we now conform exactly to the spec.
21850
21851         (Binary::ResolveOperator): Same here.
21852
21853         * class.cs (Operator::Define): Fix minor quirk in the tests.
21854
21855         * ../errors/cs0215.cs : Added.
21856
21857         * ../errors/cs0556.cs : Added.
21858
21859         * ../errors/cs0555.cs : Added.
21860
21861 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21862
21863         * cs-tokenizer.cs: Reimplemented Location to be a struct with a
21864         single integer which is really efficient
21865
21866 2001-10-01  Ravi Pratap  <ravi@ximian.com>
21867
21868         *  expression.cs (Expression::ImplicitUserConversion): Use location
21869         even in the case when we are examining True operators.
21870  
21871         * class.cs (Operator::Define): Perform extensive checks to conform
21872         with the rules for operator overloading in the spec.
21873
21874         * expression.cs (Expression::ImplicitReferenceConversion): Implement
21875         some of the other conversions mentioned in the spec.
21876
21877         * typemanager.cs (array_type): New static member for the System.Array built-in
21878         type.
21879
21880         (cloneable_interface): For System.ICloneable interface.
21881
21882         * driver.cs (Driver::Driver): Initialize TypeManager's core types even before
21883         we start resolving the tree and populating types.
21884
21885         * ../errors/errors.txt : Update for error numbers -7, -8, -9, -10
21886  
21887 2001-10-01  Miguel de Icaza  <miguel@ximian.com>
21888
21889         * expression.cs (Expression::ExprClassFromMemberInfo,
21890         Expression::Literalize): Create literal expressions from
21891         FieldInfos which are literals.
21892
21893         (ConvertNumericExplicit, ImplicitNumericConversion): Fix a few
21894         type casts, because they were wrong.  The test suite in tests
21895         caught these ones.
21896
21897         (ImplicitNumericConversion): ushort to ulong requires a widening
21898         cast. 
21899
21900         Int32 constant to long requires widening cast as well.
21901
21902         * literal.cs (LongLiteral::EmitLong): Do not generate i4 constants
21903         for integers because the type on the stack is not i4.
21904
21905 2001-09-30  Miguel de Icaza  <miguel@ximian.com>
21906
21907         * expression.cs (report118): require location argument. 
21908
21909         * parameter.cs: Do not dereference potential null value.
21910
21911         * class.cs: Catch methods that lack the `new' keyword when
21912         overriding a name.  Report warnings when `new' is used without
21913         anything being there to override.
21914
21915         * modifiers.cs: Handle `NEW' as MethodAttributes.NewSlot.
21916
21917         * class.cs: Only add constructor to hashtable if it is non-null
21918         (as now constructors can fail on define).
21919
21920         (TypeManager, Class, Struct): Take location arguments.
21921
21922         Catch field instance initialization in structs as errors.
21923
21924         accepting_filter: a new filter for FindMembers that is static so
21925         that we dont create an instance per invocation.
21926
21927         (Constructor::Define): Catch errors where a struct constructor is
21928         parameterless 
21929
21930         * cs-parser.jay: Pass location information for various new
21931         constructs. 
21932
21933         * delegate.cs (Delegate): take a location argument.
21934
21935         * driver.cs: Do not call EmitCode if there were problesm in the
21936         Definition of the types, as many Builders wont be there. 
21937
21938         * decl.cs (Decl::Decl): Require a location argument.
21939
21940         * cs-tokenizer.cs: Handle properly hex constants that can not fit
21941         into integers, and find the most appropiate integer for it.
21942
21943         * literal.cs: Implement ULongLiteral.
21944
21945         * rootcontext.cs: Provide better information about the location of
21946         failure when CreateType fails.
21947
21948 2001-09-29  Miguel de Icaza  <miguel@ximian.com>
21949
21950         * rootcontext.cs (RootContext::PopulateTypes): Populates structs
21951         as well.
21952
21953         * expression.cs (Binary::CheckShiftArguments): Add missing type
21954         computation.
21955         (Binary::ResolveOperator): Add type to the logical and and logical
21956         or, Bitwise And/Or and Exclusive Or code paths, it was missing
21957         before.
21958
21959         (Binary::DoNumericPromotions): In the case where either argument
21960         is ulong (and most signed types combined with ulong cause an
21961         error) perform implicit integer constant conversions as well.
21962
21963 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
21964
21965         * expression.cs (UserImplicitCast): Method should always be
21966         non-null. 
21967         (Invocation::BetterConversion): Simplified test for IntLiteral.
21968
21969         (Expression::ImplicitNumericConversion): Split this routine out.
21970         Put the code that performs implicit constant integer conversions
21971         here. 
21972
21973         (Expression::Resolve): Become a wrapper around DoResolve so we can
21974         check eclass and type being set after resolve.
21975
21976         (Invocation::Badness): Remove this dead function
21977
21978         (Binary::ResolveOperator): Do not compute the expensive argumnets
21979         unless we have a union for it.
21980
21981         (Probe::Emit): Is needs to do an isinst and then
21982         compare against null.
21983
21984         (::CanConvert): Added Location argument.  If the Location argument
21985         is null (Location.Null), then we do not report errors.  This is
21986         used by the `probe' mechanism of the Explicit conversion.  We do
21987         not want to generate an error for something that the user
21988         explicitly requested to be casted.  But the pipeline for an
21989         explicit cast first tests for potential implicit casts.
21990
21991         So for now, if the Location is null, it means `Probe only' to
21992         avoid adding another argument.   Might have to revise this
21993         strategy later.
21994
21995         (ClassCast): New class used to type cast objects into arbitrary
21996         classes (used in Explicit Reference Conversions).
21997
21998         Implement `as' as well.
21999
22000         Reverted all the patches from Ravi below: they were broken:
22001
22002                 * The use of `level' as a mechanism to stop recursive
22003                   invocations is wrong.  That was there just to catch the
22004                   bug with a strack trace but not as a way of addressing
22005                   the problem.
22006
22007                   To fix the problem we have to *understand* what is going
22008                   on and the interactions and come up with a plan, not
22009                   just get things going.
22010
22011                 * The use of the type conversion cache that I proposed
22012                   last night had an open topic: How does this work across
22013                   protection domains.  A user defined conversion might not
22014                   be public in the location where we are applying the
22015                   conversion, a different conversion might be selected
22016                   (ie, private A->B (better) but public B->A (worse),
22017                   inside A, A->B applies, but outside it, B->A will
22018                   apply).
22019
22020                 * On top of that (ie, even if the above is solved),
22021                   conversions in a cache need to be abstract.  Ie, `To
22022                   convert from an Int to a Short use an OpcodeCast', not
22023                   `To convert from an Int to a Short use the OpcodeCast on
22024                   the variable 5' (which is what this patch was doing).
22025
22026 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22027
22028         * expression.cs (Invocation::ConversionExists): Re-write to use
22029         the conversion cache
22030
22031         (Expression::ConvertImplicit): Automatic bailing out if level != 0. Also
22032         cache all conversions done, not just user-defined ones.
22033
22034         (Invocation::BetterConversion): The real culprit. Use ConversionExists
22035         to determine if a conversion exists instead of acutually trying to 
22036         perform the conversion. It's faster too.
22037
22038         (Expression::ConvertExplicit): Modify to use ConversionExists to check
22039         and only then attempt the implicit conversion.
22040
22041 2001-09-28  Ravi Pratap  <ravi@ximian.com>
22042
22043         * expression.cs (ConvertImplicit): Use a cache for conversions
22044         already found. Check level of recursion and bail out if necessary.
22045
22046 2001-09-28  Miguel de Icaza  <miguel@ximian.com>
22047
22048         * typemanager.cs (string_concat_string_string, string_concat_object_object):
22049         Export standard methods that we expect for string operations.
22050
22051         * statement.cs (Block::UsageWarning): Track usage of variables and
22052         report the errors for not used variables.
22053
22054         * expression.cs (Conditional::Resolve, ::Emit): Implement ?:
22055         operator. 
22056
22057 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22058
22059         * codegen.cs: remove unnneded code 
22060
22061         * expression.cs: Removed BuiltinTypeAccess class
22062
22063         Fix the order in which implicit conversions are
22064         done.  
22065
22066         The previous fixed dropped support for boxed conversions (adding a
22067         test to the test suite now)
22068
22069         (UserImplicitCast::CanConvert): Remove test for source being null,
22070         that code is broken.  We should not feed a null to begin with, if
22071         we do, then we should track the bug where the problem originates
22072         and not try to cover it up here.
22073
22074         Return a resolved expression of type UserImplicitCast on success
22075         rather than true/false.  Ravi: this is what I was talking about,
22076         the pattern is to use a static method as a "constructor" for
22077         objects. 
22078
22079         Also, do not create arguments until the very last minute,
22080         otherwise we always create the arguments even for lookups that
22081         will never be performed. 
22082
22083         (UserImplicitCast::Resolve): Eliminate, objects of type
22084         UserImplicitCast are born in a fully resolved state. 
22085
22086         * typemanager.cs (InitCoreTypes): Init also value_type
22087         (System.ValueType). 
22088
22089         * expression.cs (Cast::Resolve): First resolve the child expression.
22090
22091         (LValue): Add new method AddressOf to be used by
22092         the `&' operator.  
22093
22094         Change the argument of Store to take an EmitContext instead of an
22095         ILGenerator, because things like FieldExpr need to be able to call
22096         their children expression to generate the instance code. 
22097
22098         (Expression::Error, Expression::Warning): Sugar functions for
22099         reporting errors.
22100
22101         (Expression::MemberLookup): Accept a TypeContainer instead of a
22102         Report as the first argument.
22103
22104         (Expression::ResolvePrimary): Killed.  I still want to improve
22105         this as currently the code is just not right.
22106
22107         (Expression::ResolveMemberAccess): Simplify, but it is still
22108         wrong. 
22109
22110         (Unary::Resolve): Catch errors in AddressOf operators.
22111
22112         (LocalVariableReference::Emit, ::Store, ::AddressOf): typecast
22113         index to a byte for the short-version, or the compiler will choose
22114         the wrong Emit call, which generates the wrong data.
22115
22116         (ParameterReference::Emit, ::Store): same.
22117
22118         (FieldExpr::AddressOf): Implement.
22119
22120         * typemanager.cs: TypeManager: made public variable instead of
22121         property.
22122
22123         * driver.cs: document --fatal.
22124
22125         * report.cs (ErrorMessage, WarningMessage): new names for the old
22126         Error and Warning classes.
22127
22128         * cs-parser.jay (member_access): Turn built-in access to types
22129         into a normal simplename
22130
22131 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22132
22133         * expression.cs (Invocation::BetterConversion): Fix to cope
22134         with q being null, since this was introducing a bug.
22135
22136         * expression.cs (ConvertImplicit): Do built-in conversions first.
22137
22138 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22139
22140         * expression.cs (UserImplicitCast::Resolve): Fix bug.
22141
22142 2001-09-27  Ravi Pratap  <ravi@ximian.com>
22143
22144         * class.cs (TypeContainer::AddConstructor): Fix a stupid bug
22145         I had introduced long ago (what's new ?).
22146
22147         * expression.cs (UserImplicitCast::CanConvert): Static method to do 
22148         the work of all the checking. 
22149         (ConvertImplicit): Call CanConvert and only then create object if necessary.
22150         (UserImplicitCast::CanConvert, ::Resolve): Re-write.
22151
22152         (Unary::Operator): Rename Add and Subtract to Addition and Subtraction because
22153         that is the right way. 
22154
22155         (Invocation::MakeUnionSet): Convenience function to make unions of sets for 
22156         overloading resolution. Use everywhere instead of cutting and pasting code.
22157
22158         (Binary::ResolveOperator): Use MakeUnionSet.
22159
22160         (UserImplicitCast::CanConvert, ::Resolve): Update to take care of the case when 
22161         we have to convert to bool types. Not complete yet.
22162
22163 2001-09-27  Miguel de Icaza  <miguel@ximian.com>
22164
22165         * typemanager.cs (TypeManager::CSharpName): support ushort.
22166
22167         * expression.cs (Expression::TryImplicitIntConversion): Attempts
22168         to provide an expression that performsn an implicit constant int
22169         conversion (section 6.1.6).
22170         (Expression::ConvertImplicitRequired): Reworked to include
22171         implicit constant expression conversions.
22172
22173         (Expression::ConvertNumericExplicit): Finished.
22174
22175         (Invocation::Emit): If InstanceExpression is null, then it means
22176         that we perform a call on this.
22177
22178 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22179
22180         * expression.cs (Unary::Emit): Remove some dead code.
22181         (Probe): Implement Resolve and Emit for `is'.
22182         (Expression::ConvertImplicitRequired): Attempt to do constant
22183         expression conversions here.  Maybe should be moved to
22184         ConvertImplicit, but I am not sure.
22185         (Expression::ImplicitLongConstantConversionPossible,
22186         Expression::ImplicitIntConstantConversionPossible): New functions
22187         that tell whether is it possible to apply an implicit constant
22188         expression conversion.
22189
22190         (ConvertNumericExplicit): Started work on explicit numeric
22191         conversions.
22192
22193         * cs-parser.jay: Update operator constants.
22194
22195         * parameter.cs (Parameters::GetParameterInfo): Hook up VerifyArgs
22196         (Parameters::GetSignature): Hook up VerifyArgs here.
22197         (Parameters::VerifyArgs): Verifies that no two arguments have the
22198         same name. 
22199
22200         * class.cs (Operator): Update the operator names to reflect the
22201         ones that the spec expects (as we are just stringizing the
22202         operator names).
22203
22204         * expression.cs (Unary::ResolveOperator): Fix bug: Use
22205         MethodInfo's ReturnType instead of LookupMethodByBuilder as the
22206         previous usage did only work for our methods.
22207         (Expression::ConvertImplicit): Handle decimal implicit numeric
22208         conversions as well.
22209         (Expression::InternalTypeConstructor): Used to invoke constructors
22210         on internal types for default promotions.
22211
22212         (Unary::Emit): Implement special handling for the pre/post
22213         increment/decrement for overloaded operators, as they need to have
22214         the same semantics as the other operators.
22215
22216         (Binary::ResolveOperator): ditto.
22217         (Invocation::ConversionExists): ditto.
22218         (UserImplicitCast::Resolve): ditto.
22219
22220 2001-09-26  Ravi Pratap  <ravi@ximian.com>
22221
22222         * expression.cs (Unary::Emit and Binary::Emit): If we have an overloaded
22223         operator, return after emitting body. Regression tests pass again !
22224
22225         * expression.cs (ConvertImplicit): Take TypeContainer as first argument
22226         (Unary::ForceConversion, Binary::ForceConversion): Ditto.
22227         (Invocation::OverloadResolve): Ditto.
22228         (Invocation::BetterFunction, BetterConversion, ConversionExists): Ditto.
22229
22230         * everywhere : update calls to the above methods accordingly.
22231
22232 2001-09-26  Miguel de Icaza  <miguel@ximian.com>
22233
22234         * assign.cs (Assign): Make it inherit from ExpressionStatement.
22235
22236         * expression.cs (ExpressionStatement): New base class used for
22237         expressions that can appear in statements, so that we can provide
22238         an alternate path to generate expression that do not leave a value
22239         on the stack.
22240
22241         (Expression::Emit, and all the derivatives): We no longer return
22242         whether a value is left on the stack or not.  Every expression
22243         after being emitted leaves a single value on the stack.
22244
22245         * codegen.cs (EmitContext::EmitStatementExpression): Use the
22246         facilties of ExpressionStatement if possible.
22247
22248         * cs-parser.jay: Update statement_expression.
22249
22250 2001-09-25  Miguel de Icaza  <miguel@ximian.com>
22251
22252         * driver.cs: Change the wording of message
22253
22254 2001-09-25  Ravi Pratap  <ravi@ximian.com>
22255
22256         * expression.cs (Binary::ResolveOperator): Had forgottten to set 
22257         the type of the expression to the return type of the method if
22258         we have an overloaded operator match ! The regression tests pass again !
22259         (Unary::ResolveOperator): Ditto.
22260
22261         * expression.cs (Invocation::ConversionExists): Correct the member lookup
22262         to find "op_Implicit", not "implicit" ;-)
22263         (UserImplicitCast): New class to take care of user-defined implicit conversions.
22264         (ConvertImplicit, ForceConversion): Take TypeContainer argument
22265
22266         * everywhere : Correct calls to the above accordingly.
22267
22268         * expression.cs (UserImplicitCast::Resolve, ::Emit): Implement.
22269         (ConvertImplicit): Do user-defined conversion if it exists.
22270
22271 2001-09-24  Miguel de Icaza  <miguel@ximian.com>
22272
22273         * assign.cs: track location.
22274         (Resolve): Use implicit conversions on assignment.
22275
22276         * literal.cs: Oops.  Not good, Emit of short access values should
22277         pass (Bytes) or the wrong argument will be selected.
22278
22279         * expression.cs (Unary::Emit): Emit code for -expr.
22280
22281         (Unary::ResolveOperator): Handle `Substract' for non-constants
22282         (substract from zero from the non-constants).
22283         Deal with Doubles as well. 
22284
22285         (Expression::ConvertImplicitRequired): New routine that reports an
22286         error if no implicit conversion exists. 
22287
22288         (Invocation::OverloadResolve): Store the converted implicit
22289         expressions if we make them
22290
22291 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22292
22293         * class.cs (ConstructorInitializer): Take a Location argument.
22294         (ConstructorBaseInitializer): Same here.
22295         (ConstructorThisInitializer): Same here.
22296
22297         * cs-parser.jay : Update all calls accordingly.
22298
22299         * expression.cs (Unary, Binary, New): Take location argument.
22300         Update accordingly everywhere.
22301
22302         * cs-parser.jay : Update all calls to the above to take a location
22303         argument.
22304
22305         * class.cs : Ditto.
22306
22307 2001-09-24  Ravi Pratap  <ravi@ximian.com>
22308
22309         * expression.cs (Invocation::BetterFunction): Take TypeContainer argument
22310         (Invocation::BetterConversion): Same here
22311         (Invocation::ConversionExists): Ditto.
22312
22313         (Invocation::ConversionExists): Implement.
22314
22315 2001-09-22  Ravi Pratap  <ravi@ximian.com>
22316
22317         * expression.cs (OverloadResolve): Improve some more to catch errors 1502 and 1503
22318         Also take an additional TypeContainer argument.
22319
22320         * All over : Pass in TypeContainer as argument to OverloadResolve.
22321
22322         * typemanager.cs (CSharpName): Update to check for the string type and return
22323         that too.
22324
22325         * expression.cs (Invocation::FullMethodDesc): New static method to return a string fully describing
22326         a given method.
22327
22328 2001-09-21  Ravi Pratap  <ravi@ximian.com>
22329
22330         * expression.cs (Invocation::OverloadResolve): Re-write to conform more to the spec.
22331         (Invocation::BetterFunction): Implement.
22332         (Invocation::BetterConversion): Implement.
22333         (Invocation::ConversionExists): Skeleton, no implementation yet.
22334
22335         Okay, things work fine !
22336
22337 2001-09-21  Miguel de Icaza  <miguel@ximian.com>
22338
22339         * typemanager.cs: declare and load enum_type, delegate_type and
22340         void_type. 
22341
22342         * expression.cs (Expression::Emit): Now emit returns a value that
22343         tells whether a value is left on the stack or not.  This strategy
22344         might be reveted tomorrow with a mechanism that would address
22345         multiple assignments.
22346         (Expression::report118): Utility routine to report mismatches on
22347         the ExprClass.
22348
22349         (Unary::Report23): Report impossible type/operator combination
22350         utility function.
22351
22352         (Unary::IsIncrementableNumber): Whether the type can be
22353         incremented or decremented with add.
22354         (Unary::ResolveOperator): Also allow enumerations to be bitwise
22355         complemented. 
22356         (Unary::ResolveOperator): Implement ++, !, ~,
22357
22358         (Invocation::Emit): Deal with new Emit convetion.
22359
22360         * All Expression derivatives: Updated their Emit method to return
22361         whether they leave values on the stack or not.
22362
22363         * codegen.cs (CodeGen::EmitStatement): Pop values left on the
22364         stack for expressions that are statements. 
22365
22366 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22367
22368         * expression.cs (LValue): New interface.  Must be implemented by
22369         LValue objects.
22370         (LocalVariableReference, ParameterReference, FieldExpr): Implement
22371         LValue interface.
22372
22373         * assign.cs (Assign::Emit, Assign::Resolve): Use new LValue
22374         interface for generating code, simplifies the code.
22375
22376 2001-09-20  Ravi Pratap  <ravi@ximian.com>
22377
22378         * expression.cs (everywhere): Comment out return statements in ::Resolve
22379         methods to avoid the warnings.
22380
22381 2001-09-20  Miguel de Icaza  <miguel@ximian.com>
22382
22383         * driver.cs (parse): Report error 2001 if we can not open the
22384         source file.
22385
22386         * expression.cs (SimpleName::ResolveSimpleName): Error if we can
22387         not resolve it.
22388
22389         * cs-parser.jay (QualifierIdentifier): Pass location to SimpleName
22390         object. 
22391
22392         * statement.cs (Block::EmitMeta): Reuse the count across all the variables,
22393         otherwise nested blocks end up with the same index.
22394
22395         * codegen.cs (CodeGen::EmitTopBlock): Pass initial sequence
22396
22397         * expression.cs:  Instead of having FIXMEs in the Resolve
22398         functions, throw exceptions so it is obvious that we are facing a
22399         bug. 
22400
22401         * cs-parser.jay (invocation_expression): Pass Location information.
22402
22403         * codegen.cs (CodeGen::Save, CodeGen::CodeGen, CodeGen::Basename):
22404         Use a basename for those routines because .NET does not like paths
22405         on them. 
22406
22407         * class.cs (TypeContainer::AddMethod): Do not call DefineName if the name was
22408         already defined.
22409
22410 2001-09-19  Miguel de Icaza  <miguel@ximian.com>
22411
22412         * typemanager.cs (TypeManager::CoreLookupType): A function to make sure that we
22413         are loading the correct data types (throws an exception if not).
22414         (TypeManager::InitCoreTypes): Use CoreLookupType
22415
22416         * expression.cs (Unary::ResolveOperator): return the child
22417         expression for expressions which are just +expr.
22418         (Unary::ResolveOperator): Return negative literals for -LITERAL
22419         expressions (otherwise they are Unary {Literal}).
22420         (Invocation::Badness): Take into account `Implicit constant
22421         expression conversions'.
22422
22423         * literal.cs (LongLiteral): Implement long literal class.
22424         (IntLiteral): export the `Value' of the intliteral. 
22425
22426 2001-09-19  Ravi Pratap  <ravi@ximian.com>
22427
22428         * expression.cs (Binary::Emit): Finally get the emission right ! Woo!
22429
22430         * class.cs (Operator::Define): Change the methodname prefix to 'op_' 
22431         instead of 'Operator'
22432
22433         * expression.cs (Binary::ResolveOperator): Update accordingly.
22434         (Unary::Operator): Change names to 'Add' and 'Subtract' instead 'Plus'
22435         and 'Minus'
22436
22437         * cs-parser.jay (unary_expression): Update to use the new names.
22438
22439         * gen-treedump.cs (GetUnary): Same here.
22440
22441         * expression.cs (Unary::Resolve): Implement.
22442         (Binary::ResolveOperator): Re-write bits to quietly continue if no overloaded 
22443         operators are found instead of making noise ;-)
22444         (Unary::ResolveOperator): New method to do precisely the same thing which
22445         Binary::ResolveOperator does for Binary expressions.
22446         (Unary.method, .Arguments): Add.
22447         (Unary::OperName): Implement.   
22448         (Unary::ForceConversion): Copy and Paste !
22449
22450         * class.cs (Operator::Define): Fix a small bug for the case when we have 
22451         a unary operator.
22452
22453         * expression.cs (Unary::Emit): Implement. Need to find the right Opcodes
22454         for the inbuilt operators. Only overloading works for now ;-)
22455
22456 2001-09-18  Miguel de Icaza  <miguel@ximian.com>
22457
22458         * expression.cs (CheckedExpr::Resolve, CheckedExpr::Emit,
22459         UnCheckedExpr::Resolve, UnCheckedExpr::Emit): Implement.
22460
22461         * expression.cs (This::Emit): Implement. 
22462         (This::Resolve): Implement.
22463         (TypeOf:Resolve): Implement.
22464         (Expression::ResolveSimpleName): Add an implicit this to instance
22465         field references. 
22466         (MemberAccess::Resolve): Deal with Parameters and Fields. 
22467         Bind instance variable to Field expressions.
22468         (FieldExpr::Instance): New field used to track the expression that
22469         represents the object instance.
22470         (FieldExpr::Resolve): Track potential errors from MemberLookup not
22471         binding 
22472         (FieldExpr::Emit): Implement.
22473
22474         * codegen.cs (EmitIf, EmitStatement, EmitBlock): Propagate whether
22475         the last instruction contains a return opcode to avoid generating
22476         the last `ret' instruction (this generates correct code, and it is
22477         nice to pass the peverify output).
22478
22479         * class.cs (TypeContainer::EmitFieldInitializers): Implement field
22480         initializer for static and instance variables.
22481         (Constructor::Emit): Allow initializer to be null in the case of
22482         static constructors.  Only emit initializer for instance
22483         constructors. 
22484
22485         (TypeContainer::FindMembers): Return a null array if there are no
22486         matches.
22487
22488         Also fix the code for the MemberTypes.Method branch, as it was not
22489         scanning that for operators (or tried to access null variables before).
22490
22491         * assign.cs (Assign::Emit): Handle instance and static fields. 
22492
22493         * TODO: Updated.
22494
22495         * driver.cs: Stop compilation if there are parse errors.
22496
22497         * cs-parser.jay (constructor_declaration): Provide default base
22498         initializer for non-static constructors.
22499         (constructor_declarator): Do not provide a default base
22500         initializers if none was specified.
22501         Catch the fact that constructors should not have parameters.
22502
22503         * class.cs: Do not emit parent class initializers for static
22504         constructors, that should be flagged as an error.
22505
22506 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22507
22508         * class.cs (RegisterMethodBuilder): Remove : it's unnecessary.
22509         Move back code into TypeContainer::Populate.
22510
22511 2001-09-18  Ravi Pratap  <ravi@ximian.com>
22512
22513         * class.cs (TypeContainer::AddConstructor): Fix the check to
22514         compare against Name, not Basename. 
22515         (Operator::OpType): Change Plus and Minus to Add and Subtract.
22516
22517         * cs-parser.jay : Update accordingly.
22518
22519         * class.cs (TypeContainer::FindMembers): For the case where we are searching
22520         for methods, don't forget to look into the operators too.
22521         (RegisterMethodBuilder): Helper method to take care of this for
22522         methods, constructors and operators.
22523         (Operator::Define): Completely revamp.
22524         (Operator.OperatorMethod, MethodName): New fields.
22525         (TypeContainer::Populate): Move the registering of builders into
22526         RegisterMethodBuilder.
22527         (Operator::Emit): Re-write.
22528
22529         * expression.cs (Binary::Emit): Comment out code path to emit method
22530         invocation stuff for the case when we have a user defined operator. I am
22531         just not able to get it right !
22532
22533 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22534
22535         * expression.cs (Expression::OverloadResolve): Drop TypeContainer
22536         argument. 
22537
22538         (Expression::MemberLookup): Provide a version that allows to
22539         specify the MemberTypes and BindingFlags. 
22540
22541         * statement.cs (Block::GetVariableInfo): Forgot to recurse here,
22542         so it was not fetching variable information from outer blocks.
22543
22544         * modifiers.cs: (Modifiers::TypeAttr): Invert condition on
22545         Beforefieldinit as it was buggy.
22546
22547         * rootcontext.cs (::LookupInterfaceOrClass): Removed an Error -200
22548         that Ravi put here.  
22549
22550         * class.cs (Constructor::Emit): Only emit if block is not null.
22551         (TypeContainer::EmitDefaultConstructor): Removed routine, now we
22552         deal with this by semantically definining it as if the user had
22553         done it.
22554
22555         (TypeContainer::FindMembers): Removed ad-hoc hack to deal with
22556         constructors as we now "emit" them at a higher level.
22557
22558         (TypeContainer::DefineDefaultConstructor): Used to define the
22559         default constructors if none was provided.
22560
22561         (ConstructorInitializer): Add methods Resolve and Emit. 
22562
22563         * expression.cs: Cast to ConstructorInfo instead of MethodInfo
22564
22565 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22566
22567         * class.cs (TypeContainer::EmitDefaultConstructor): Register
22568         the default constructor builder with our hashtable for methodbuilders
22569         to methodcores.
22570
22571         * expression.cs (Invocation::OverloadResolve): Add a check for pd == null
22572         and argument_count is 0 in which case we have a match.
22573         (Binary::ResolveOperator): More null checking and miscellaneous coding
22574         style cleanup.
22575
22576 2001-09-17  Ravi Pratap  <ravi@ximian.com>
22577
22578         * rootcontext.cs (IsNameSpace): Compare against null.
22579
22580         * everywhere : Correct spelling to 'Greater' and to 'Subtract'
22581
22582         * class.cs (Operator::OpType): Change names to match the ones in Binary::Operator
22583         and Unary::Operator.
22584
22585         * cs-parser.jay (operator_declaration, CheckBinaryOperator, CheckUnaryOperator): Update
22586         accordingly.
22587
22588         * expression.cs (Binary::method): New member to hold the MethodBase for the case when
22589         we have overloaded operators.
22590         (Binary::ResolveOperator): Implement the part which does the operator overload
22591         resolution.
22592
22593         * class.cs (Operator::Emit): Implement.
22594         (TypeContainer::Emit): Emit the operators we have too.
22595
22596         * expression.cs (Binary::Emit): Update to emit the appropriate code for
22597         the case when we have a user-defined operator.
22598
22599 2001-09-17  Miguel de Icaza  <miguel@ximian.com>
22600
22601         * rootcontext.cs: Fix bug: tree.Namespaces might be null.
22602
22603 2001-09-16  Ravi Pratap  <ravi@ximian.com>
22604
22605         * class.cs (EmitStaticFieldInitializers, EmitFieldInitializers): Make public.
22606         (TypeContainer::EmitConstructor): Remove and move code into Contructor::Emit.
22607         (Constructor::Emit): Implement.
22608         (EmitStaticFieldInitializers, EmitFieldInitializers): Ensure we return immediately
22609         if we have no work to do. 
22610         (TypeContainer::Emit): Pass in TypeContainer as argument to the constructor's 
22611         Emit method.
22612
22613         * interface.cs (Interface::InterfaceAttr): Re-write to be more correct and complete.
22614         (Interface::IsTopLevel): Add. Same as TypeContainer::IsTopLevel.
22615
22616         * class.cs (TypeContainer::IsTopLevel): Modify to use parent.Parent instead
22617         of parent.parent.
22618
22619 2001-09-15  Ravi Pratap  <ravi@ximian.com>
22620
22621         * tree.cs (Tree::namespaces): New hashtable to keep track of namespaces
22622         in the source.
22623         (Tree::RecordNamespace): Method to do what the name says ;-)
22624         (Tree::Namespaces): Property to get at the namespaces hashtable.
22625
22626         * cs-parser.jay (namespace_declaration): Call RecordNamespace to 
22627         keep track.
22628
22629         * rootcontext.cs (IsNamespace): Fixed it :-)
22630
22631 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22632
22633         * class.cs (TypeContainer::FindMembers): Add support for
22634         constructors. 
22635         (MethodCore): New class that encapsulates both the shared aspects
22636         of a Constructor and a Method.  
22637         (Method, Constructor): Factored pieces into MethodCore.
22638
22639         * driver.cs: Added --fatal which makes errors throw exceptions.
22640         Load System assembly as well as part of the standard library.
22641
22642         * report.cs: Allow throwing exceptions on errors for debugging.
22643
22644         * modifiers.cs: Do not use `parent', instead use the real type
22645         container to evaluate permission settings.
22646
22647         * class.cs: Put Ravi's patch back in.  He is right, and we will
22648         have to cope with the
22649
22650 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22651
22652         * modifiers.cs (TypeAttr, MethodAttr, FieldAttr): Map protected internal to
22653         FamORAssem, not FamANDAssem.
22654
22655 2001-09-14  Miguel de Icaza  <miguel@ximian.com>
22656
22657         * driver.cs: Added --parse option that only parses its input files
22658         and terminates.
22659
22660         * class.cs: Reverted last change from Ravi to IsTopLevel.  That is
22661         incorrect.  IsTopLevel is not used to tell whether an object is
22662         root_types or not (that can be achieved by testing this ==
22663         root_types).  But to see if this is a top-level *class* (not
22664         necessarly our "toplevel" container). 
22665
22666 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22667
22668         * enum.cs (Enum::Define): Modify to call the Lookup method on the
22669         parent instead of a direct call to GetType.
22670
22671 2001-09-14  Ravi Pratap  <ravi@ximian.com>
22672
22673         * class.cs (TypeContainer::TypeAttr): Remove property code and move it into
22674         Modifiers.TypeAttr. This should just be a call to that method.
22675
22676         * modifiers.cs (TypeAttr): Re-write and take an extra argument, the TypeContainer
22677         object so that we can determine if we are top-level or not.
22678
22679         * delegate.cs (Delegate::Define): Update call to TypeAttr method to pass in the 
22680         TypeContainer too.
22681
22682         * enum.cs (Enum::Define): Ditto.
22683
22684         * modifiers.cs (FieldAttr): Re-write.
22685
22686         * class.cs (TypeContainer::IsTopLevel): Change accessibility to public.
22687         (TypeContainer::HaveStaticConstructor): New property to provide access
22688         to precisely that info.
22689
22690         * modifiers.cs (MethodAttr): Re-write.
22691         (EventAttr): Remove altogether as there seems to be no ostensible use for it.
22692
22693         * class.cs (TypeContainer::IsTopLevel): Re-write. root_types doesn't seem to be the parent
22694         of top-level types as claimed.
22695
22696 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22697
22698         * expression.cs (MemberLookup): Fruitless attempt to lookup
22699         constructors.  Maybe I need to emit default constructors?  That
22700         might be it (currently .NET emits this for me automatically).
22701         (Invocation::OverloadResolve): Cope with Arguments == null.
22702         (Invocation::EmitArguments): new function, shared by the new
22703         constructor and us.
22704         (Invocation::Emit): Handle static and instance methods.  Emit
22705         proper call instruction for virtual or non-virtual invocations.
22706         (New::Emit): Implement.
22707         (New::Resolve): Implement.
22708         (MemberAccess:Resolve): Implement.
22709         (MethodGroupExpr::InstanceExpression): used conforming to the spec
22710         to track instances.
22711         (FieldExpr::Resolve): Set type.
22712
22713         * support.cs: Handle empty arguments.
22714                 
22715         * cs-parser.jay (CompositeLookup, QualifierIdentifier,
22716         SimpleLookup): Auxiliary routines to help parse a qualifier
22717         identifier.  
22718
22719         Update qualifier_identifier rule.
22720
22721         * codegen.cs: Removed debugging messages.
22722
22723         * class.cs: Make this a global thing, this acts just as a "key" to
22724         objects that we might have around.
22725
22726         (Populate): Only initialize method_builders_to_methods once.
22727
22728         * expression.cs (PropertyExpr): Initialize type from the
22729         PropertyType. 
22730
22731         * codegen.cs (EmitContext::EmitBoolExpression): Use propper
22732         Resolve pattern.  Attempt to implicitly convert value to boolean.
22733         Emit code.
22734
22735         * expression.cs: Set the type for the int32/int32 argument case.
22736         (Binary::ResolveOperator): Set the return type to boolean for
22737         comparission operators
22738
22739         * typemanager.cs: Remove debugging print code.
22740
22741         (Invocation::Resolve): resolve type.
22742
22743         * class.cs: Allocate a MemberInfo of the correct size, as the code
22744         elsewhere depends on the test to reflect the correct contents.
22745
22746         (Method::) Keep track of parameters, due to System.Reflection holes
22747
22748         (TypeContainer::Populate): Keep track of MethodBuilders to Method
22749         mapping here.
22750
22751         (TypeContainer::FindMembers): Use ArrayList and then copy an array
22752         of the exact size and return that.
22753
22754         (Class::LookupMethodByBuilder): New function that maps
22755         MethodBuilders to its methods.  Required to locate the information
22756         on methods because System.Reflection bit us again.
22757
22758         * support.cs: New file, contains an interface ParameterData and
22759         two implementations: ReflectionParameters and InternalParameters
22760         used to access Parameter information.  We will need to grow this
22761         as required.
22762
22763         * expression.cs (Invocation::GetParameterData): implement a cache
22764         and a wrapper around the ParameterData creation for methods. 
22765         (Invocation::OverloadResolve): Use new code.
22766
22767 2001-09-13  Ravi Pratap  <ravi@ximian.com>
22768
22769         * class.cs (TypeContainer::EmitField): Remove and move into 
22770         (Field::Define): here and modify accordingly.
22771         (Field.FieldBuilder): New member.
22772         (TypeContainer::Populate): Update accordingly.
22773         (TypeContainer::FindMembers): Implement.
22774
22775 2001-09-13  Miguel de Icaza  <miguel@ximian.com>
22776
22777         * statement.cs: (VariableInfo::VariableType): New field to be
22778         initialized with the full type once it is resolved. 
22779
22780 2001-09-12  Miguel de Icaza  <miguel@ximian.com>
22781
22782         * parameter.cs (GetParameterInfo): Use a type cache to compute
22783         things only once, and to reuse this information
22784
22785         * expression.cs (LocalVariableReference::Emit): Implement.
22786         (OpcodeCast::Emit): fix.
22787
22788         (ParameterReference::Resolve): Implement.
22789         (ParameterReference::Emit): Implement.
22790
22791         * cs-parser.jay: Fix bug introduced by Ravi, variable initializers
22792         that are expressions need to stay as Expressions.
22793
22794         * typemanager.cs (CSharpName): Returns the C# name of a type if
22795         possible. 
22796
22797         * expression.cs (Expression::ConvertImplicit): New function that
22798         implements implicit type conversions.
22799
22800         (Expression::ImplicitReferenceConversion): Implements implicit
22801         reference conversions.
22802
22803         (EmptyCast): New type for transparent casts.
22804
22805         (OpcodeCast): New type for casts of types that are performed with
22806         a sequence of bytecodes.
22807
22808         (BoxedCast): New type used for casting value types into reference
22809         types.  Emits a box opcode.
22810
22811         (Binary::DoNumericPromotions): Implements numeric promotions of
22812         and computation of the Binary::Type.
22813
22814         (Binary::EmitBranchable): Optimization.
22815
22816         (Binary::Emit): Implement code emission for expressions.
22817
22818         * typemanager.cs (TypeManager): Added two new core types: sbyte
22819         and byte.
22820
22821 2001-09-12  Ravi Pratap  <ravi@ximian.com>
22822
22823         * class.cs (TypeContainer::FindMembers): Method which does exactly
22824         what Type.FindMembers does, only we don't have to use reflection. No
22825         implementation yet.
22826
22827         * typemanager.cs (typecontainers): New hashtable to hold the corresponding
22828         typecontainer objects as we need to get at them.
22829         (TypeManager::AddUserType): Overload to take an extra argument, the TypeContainer.
22830
22831         * rootcontext.cs : Correspondingly modify called to AddUserType to pass the
22832         typecontainer object.
22833
22834         * expression.cs (MemberLookup): Modify signature to take a RootContext object instead
22835         of just a Report object.
22836
22837 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22838
22839         * class.cs (Event::Define): Go back to using the prefixes "add_" and
22840         "remove_"
22841         (TypeContainer::Populate): Now define the delegates of the type too.
22842         (TypeContainer.Delegates): Property to access the list of delegates defined
22843         in the type.
22844
22845         * delegates.cs (Delegate::Define): Implement partially.
22846
22847         * modifiers.cs (TypeAttr): Handle more flags.
22848
22849 2001-09-11  Ravi Pratap  <ravi@ximian.com>
22850
22851         * class.cs (Indexer::Define): Fix for loop iteration condition to be just <
22852         and not <=
22853         (Operator::Define): Re-write logic to get types by using the LookupType method
22854         instead of blindly doing a Type.GetType ! How stupid can I get ;-) ?
22855         (Indexer::Define): Ditto.
22856         (Event::Define): Ditto.
22857         (Property::Define): Ditto.
22858
22859 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22860
22861         * class.cs (TypeContainer::Populate): Now define operators too. 
22862         (TypeContainer.Operators): New property to access the list of operators
22863         in a type.
22864         (Operator.OperatorMethodBuilder): New member to hold the method builder
22865         for the operator we are defining.
22866         (Operator::Define): Implement.
22867
22868 2001-09-10  Ravi Pratap  <ravi@ximian.com>
22869
22870         * class.cs (Event::Define): Make the prefixes of the accessor methods
22871         addOn_ and removeOn_ 
22872
22873         * genericparser.cs (GenericParser::error): Overloaded method to handle the case
22874         of the location being passed in too. Ideally, this should go later since all
22875         error reporting should be done through the Report object.
22876
22877         * class.cs (TypeContainer.Indexers): New property to access the list of indexers.
22878         (Populate): Iterate thru the indexers we have and define them too.
22879         (Indexer.GetMethodBuilder, .SetMethodBuilder): New members to hold the method builders
22880         for the get and set accessors.
22881         (Indexer::Define): Implement.
22882
22883 2001-09-09  Miguel de Icaza  <miguel@ximian.com>
22884
22885         * expression.cs (Binary::Resolve): Beginning of it.  I scratched
22886         my previous implementation, did not work.
22887
22888         * typemanager.cs: Add a couple of missing types (the longs).
22889
22890         * literal.cs: Use TypeManager.bool_type instead of getting it.
22891
22892         * expression.cs (EventExpr): New kind of expressions.
22893         (Expressio::ExprClassFromMemberInfo): finish
22894
22895 2001-09-08  Miguel de Icaza  <miguel@ximian.com>
22896
22897         * assign.cs: Emit stores to static fields differently.
22898
22899 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22900
22901         * Merge in changes and adjust code to tackle conflicts. Backed out my
22902         code in Assign::Resolve ;-) 
22903
22904 2001-09-08  Ravi Pratap  <ravi@ximian.com>
22905
22906         * cs-parser.jay (CheckAttributeTarget): Modify call to error to use
22907         instead Report.Error and also pass in the location.
22908         (CSharpParser::Lexer): New readonly property to return the reference
22909         to the Tokenizer object.
22910         (declare_local_variables): Use Report.Error with location instead of plain 
22911         old error.
22912         (CheckDef): Ditto.
22913
22914         * class.cs (Operator::CheckUnaryOperator): Move into cs-parser.jay.
22915         (Operator.CheckBinaryOperator): Ditto.
22916
22917         * cs-parser.jay (operator_declarator): Update accordingly.
22918
22919         * cs-parser.jay (CheckUnaryOperator): Modify to use Report.Error
22920         (CheckBinaryOperator): Same here.
22921
22922         * rootcontext.cs (LookupType): Add an extra lookup which simply does a lookup
22923         on the name without any prefixes of namespace names etc. This is because we
22924         already might have something already fully qualified like 
22925         'System.Console.WriteLine'
22926
22927         * assign.cs (Resolve): Begin implementation. Stuck ;-)
22928
22929 2001-09-07  Ravi Pratap  <ravi@ximian.com>
22930
22931         * cs-tokenizer.cs (location): Return a string which also contains
22932         the file name.
22933
22934         * expression.cs (ElementAccess): New class for expressions of the
22935         type 'element access.'
22936         (BaseAccess): New class for expressions of the type 'base access.'
22937         (CheckedExpr, UnCheckedExpr): New classes for Checked and Unchecked expressions
22938         respectively.
22939
22940         * cs-parser.jay (element_access): Implement action.
22941         (base_access): Implement actions.
22942         (checked_expression, unchecked_expression): Implement.
22943
22944         * cs-parser.jay (local_variable_type): Correct and implement.
22945         (type_suffixes, type_suffix_list, type_suffix): Implement actions.
22946
22947         * cs-tokenizer.cs (real_type_suffix): Comment out the extra getchar.
22948
22949         * cs-parser.jay (rank_specifiers): Remove space while concatenating the type's
22950         name and the specifiers.
22951
22952         * interface.cs (InterfaceAttr): New property to return the corresponding TypeAttributes
22953
22954         * rootcontext.cs (CreateInterface): Use the InterfaceAttr property instead of 
22955         making them all public ;-)
22956
22957         * cs-parser.jay (error): Remove entirely as we have an implementation in the base
22958         class anyways.
22959
22960 2001-09-07  Miguel de Icaza  <miguel@ximian.com>
22961
22962         * expression.cs (ExprClassFromMemberInfo): Return FieldExpr and
22963         PropertyExprs.
22964         (FieldExpr, PropertyExprs): New resolved expressions.
22965         (SimpleName::MemberStaticCheck): Perform static checks for access
22966         to non-static fields on static methods. Maybe this should be
22967         generalized for MemberAccesses. 
22968         (SimpleName::ResolveSimpleName): More work on simple name
22969         resolution. 
22970
22971         * cs-parser.jay (primary_expression/qualified_identifier): track
22972         the parameter index.
22973
22974         * codegen.cs (CodeGen::Save): Catch save exception, report error.
22975         (EmitContext::EmitBoolExpression): Chain to expression generation
22976         instead of temporary hack.
22977         (::EmitStatementExpression): Put generic expression code generation.
22978
22979         * assign.cs (Assign::Emit): Implement variable assignments to
22980         local variables, parameters and fields.
22981
22982 2001-09-06  Miguel de Icaza  <miguel@ximian.com>
22983
22984         * statement.cs (Block::GetVariableInfo): New method, returns the
22985         VariableInfo for a variable name in a block.
22986         (Block::GetVariableType): Implement in terms of GetVariableInfo
22987
22988         * literal.cs (IntLiteral::Emit, FloatLiteral::Emit,
22989         DoubleLiteral::Emit, CharLiteral::Emit, BoolLiteral::Emit): Implement
22990
22991 2001-09-06  Ravi Pratap  <ravi@ximian.com>
22992
22993         * cs-parser.jay (operator_declaration): Continue on my quest : update
22994         to take attributes argument.
22995         (event_declaration): Ditto.
22996         (enum_declaration): Ditto.
22997         (indexer_declaration): Ditto.
22998
22999         * class.cs (Operator::Operator): Update constructor accordingly.
23000         (Event::Event): Ditto.
23001
23002         * delegate.cs (Delegate::Delegate): Same here.
23003
23004         * enum.cs (Enum::Enum): Same here.
23005
23006 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23007
23008         * cs-parser.jay (CheckAttributeTarget): Update to use the right error number.
23009
23010         * ../tests/cs0658.cs : New file to demonstrate error 0658.
23011
23012         * attribute.cs (Attributes): New class to encapsulate all attributes which were
23013         being passed around as an arraylist.
23014         (Attributes::AddAttribute): Method to add attribute sections.
23015
23016         * cs-parser.jay (opt_attributes): Modify actions to use the new Attributes class.
23017         (struct_declaration): Update accordingly.
23018         (constant_declaration): Update.
23019         (field_declaration): Update.
23020         (method_header): Update.
23021         (fixed_parameter): Update.
23022         (parameter_array): Ditto.
23023         (property_declaration): Ditto.
23024         (destructor_declaration): Ditto.
23025
23026         * class.cs (Struct::Struct): Update constructors accordingly.
23027         (Class::Class): Ditto.
23028         (Field::Field): Ditto.
23029         (Method::Method): Ditto.
23030         (Property::Property): Ditto.
23031         (TypeContainer::OptAttribute): update property's return type.
23032
23033         * interface.cs (Interface.opt_attributes): New member.
23034         (Interface::Interface): Update to take the extra Attributes argument.
23035
23036         * parameter.cs (Parameter::Parameter): Ditto.
23037
23038         * constant.cs (Constant::Constant): Ditto.
23039
23040         * interface.cs (InterfaceMemberBase): New OptAttributes field.
23041         (InterfaceMemberBase::InterfaceMemberBase): Update constructor to take 
23042         the attributes as a parameter.
23043         (InterfaceProperty): Update constructor call.
23044         (InterfaceEvent): Ditto.
23045         (InterfaceMethod): Ditto.
23046         (InterfaceIndexer): Ditto.
23047
23048         * cs-parser.jay (interface_indexer_declaration): Update call to constructor to 
23049         pass the attributes too.
23050         (interface_event_declaration): Ditto.
23051         (interface_property_declaration): Ditto.
23052         (interface_method_declaration): Ditto.
23053         (interface_declaration): Ditto.
23054
23055 2001-09-05  Miguel de Icaza  <miguel@ximian.com>
23056
23057         * class.cs (Method::Define): Track the "static Main" definition to
23058         create an entry point. 
23059
23060         * rootcontext.cs (RootContext::EntryPoint): MethodInfo that holds the
23061         EntryPoint if we find it. 
23062
23063         * codegen.cs (EmitContext::EmitInvocation): Emit invocations.
23064         (EmitContext::ig): Make this variable public.
23065
23066         * driver.cs: Make the default output file be the first file name
23067         with the .exe extension.  
23068
23069         Detect empty compilations
23070
23071         Handle various kinds of output targets.  Handle --target and
23072         rename -t to --dumper.
23073
23074         * expression.cs, literal.cs, assign.cs, constant.cs: All `Resolve'
23075         methods inherited from Expression return now an Expression.  This
23076         will is used during the tree rewriting as we resolve them during
23077         semantic analysis.
23078
23079         (Expression::MemberLookup): Implements the MemberLookup (7.3) from
23080         the spec.  Missing entirely is the information about
23081         accessability of elements of it.
23082
23083         (Expression::ExprClassFromMemberInfo): New constructor for
23084         Expressions that creates a fully initialized Expression based on
23085         a MemberInfo that is one of Eventinfo, FieldINfo, PropertyInfo or
23086         a Type.
23087
23088         (Invocation::Resolve): Begin implementing resolution of invocations.
23089
23090         * literal.cs (StringLiteral):  Implement Emit.
23091
23092 2001-09-05  Ravi Pratap  <ravi@ximian.com>
23093
23094         * cs-parser.jay (error): Add new modifier because we are hiding an inherited
23095         member.
23096
23097 2001-09-04  Ravi Pratap  <ravi@ximian.com>
23098
23099         * cs-parser.jay (attribute_arguments): Implement actions.
23100         (attribute): Fix bug in production. Implement action.
23101         (attribute_list): Implement.
23102         (attribute_target): Implement.
23103         (attribute_target_specifier, opt_target_specifier): Implement
23104         (CheckAttributeTarget): New method to check if the attribute target
23105         is valid.
23106         (attribute_section): Implement.
23107         (opt_attributes): Implement.
23108
23109         * attribute.cs : New file to handle attributes.
23110         (Attribute): Class to hold attribute info.
23111
23112         * cs-parser.jay (opt_attribute_target_specifier): Remove production
23113         (attribute_section): Modify production to use 2 different rules to 
23114         achieve the same thing. 1 s/r conflict down !
23115         Clean out commented, useless, non-reducing dimension_separator rules.
23116
23117         * class.cs (TypeContainer.attributes): New member to hold list
23118         of attributes for a type.
23119         (Struct::Struct): Modify to take one more argument, the attribute list.
23120         (Class::Class): Ditto.
23121         (Field::Field): Ditto.
23122         (Method::Method): Ditto.
23123         (Property::Property): Ditto.
23124
23125         * cs-parser.jay (struct_declaration): Update constructor call to
23126         pass in the attributes too.
23127         (class_declaration): Ditto.
23128         (constant_declaration): Ditto.
23129         (field_declaration): Ditto.
23130         (method_header): Ditto.
23131         (fixed_parameter): Ditto.
23132         (parameter_array): Ditto.
23133         (property_declaration): Ditto.
23134
23135         * constant.cs (Constant::Constant): Update constructor similarly.
23136         Use System.Collections.
23137
23138         * parameter.cs (Parameter::Parameter): Update as above.
23139
23140 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23141
23142         * class.cs (TypeContainer::AddDelegate): New method to add a delegate.
23143         (TypeContainer.delegates): New member to hold list of delegates.
23144
23145         * cs-parser.jay (delegate_declaration): Implement the action correctly 
23146         this time as I seem to be on crack ;-)
23147
23148 2001-09-02  Miguel de Icaza  <miguel@ximian.com>
23149
23150         * rootcontext.cs (RootContext::IsNamespace): new function, used to
23151         tell whether an identifier represents a namespace.
23152
23153         * expression.cs (NamespaceExpr): A namespace expression, used only
23154         temporarly during expression resolution.
23155         (Expression::ResolveSimpleName, ::ResolvePrimary, ::ResolveName):
23156         utility functions to resolve names on expressions.
23157
23158 2001-09-01  Miguel de Icaza  <miguel@ximian.com>
23159
23160         * codegen.cs: Add hook for StatementExpressions. 
23161
23162         * class.cs: Fix inverted test for static flag in methods.
23163
23164 2001-09-02  Ravi Pratap  <ravi@ximian.com>
23165
23166         * class.cs (Operator::CheckUnaryOperator): Correct error number used
23167         to make it coincide with MS' number.
23168         (Operator::CheckBinaryOperator): Ditto.
23169
23170         * ../errors/errors.txt : Remove error numbers added earlier.
23171
23172         * ../errors/cs1019.cs : Test case for error # 1019
23173
23174         * ../errros/cs1020.cs : Test case for error # 1020
23175
23176         * cs-parser.jay : Clean out commented cruft.
23177         (dimension_separators, dimension_separator): Comment out. Ostensibly not
23178         used anywhere - non-reducing rule.
23179         (namespace_declarations): Non-reducing rule - comment out.
23180
23181         * enum.cs (Enum::AddEnum): Rename to AddEnumMember as I was getting confused
23182         with TypeContainer::AddEnum.
23183
23184         * delegate.cs : New file for delegate handling classes.
23185         (Delegate): Class for declaring delegates.
23186
23187         * makefile : Update.
23188
23189         * cs-parser.jay (delegate_declaration): Implement.
23190
23191 2001-09-01  Ravi Pratap  <ravi@che.iitm.ac.in>
23192
23193         * class.cs (Event::Define): Implement.
23194         (Event.EventBuilder): New member.
23195
23196         * class.cs (TypeContainer::Populate): Update to define all enums and events
23197         we have.
23198         (Events): New property for the events arraylist we hold. Shouldn't we move to using
23199         readonly fields for all these cases ?
23200
23201 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23202
23203         * class.cs (Property): Revamp to use the convention of making fields readonly.
23204         Accordingly modify code elsewhere.
23205
23206         * class.cs : Apply patch from Mr. Mandar <go_mono@hotmail.com> for implementing
23207         the Define method of the Property class.
23208
23209         * class.cs : Clean up applied patch and update references to variables etc. Fix 
23210         trivial bug.
23211         (TypeContainer::Populate): Update to define all the properties we have. Also
23212         define all enumerations.
23213
23214         * enum.cs (Define): Implement.
23215
23216 2001-08-31  Ravi Pratap  <ravi@che.iitm.ac.in>
23217
23218         * cs-parser.jay (overloadable_operator): The semantic value is an
23219         enum of the Operator class.
23220         (operator_declarator): Implement actions.
23221         (operator_declaration): Implement.
23222
23223         * class.cs (Operator::CheckUnaryOperator): New static method to help in checking
23224         validity of definitions.
23225         (Operator::CheckBinaryOperator): Static method to check for binary operators
23226         (TypeContainer::AddOperator): New method to add an operator to a type.
23227
23228         * cs-parser.jay (indexer_declaration): Added line to actually call the
23229         AddIndexer method so it gets added ;-)
23230
23231         * ../errors/errors.txt : Update to include new error numbers. Are these numbers 
23232         already taken care of by the MS compiler ?  
23233
23234 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23235
23236         * class.cs (Operator): New class for operator declarations.
23237         (Operator::OpType): Enum for the various operators.
23238
23239 2001-08-29  Ravi Pratap  <ravi@che.iitm.ac.in>
23240
23241         * class.cs (TypeContainer::AddIndexer): Remove FIXME comment. We
23242         ostensibly handle this in semantic analysis.
23243
23244         * cs-parser.jay (general_catch_clause): Comment out
23245         (specific_catch_clauses, specific_catch_clause): Ditto.
23246         (opt_general_catch_clause, opt_specific_catch_clauses): Ditto
23247         (catch_args, opt_catch_args): New productions.
23248         (catch_clause): Rewrite to use the new productions above
23249         (catch_clauses): Modify accordingly.
23250         (opt_catch_clauses): New production to use in try_statement
23251         (try_statement): Revamp. Basically, we get rid of one unnecessary rule
23252         and re-write the code in the actions to extract the specific and
23253         general catch clauses by being a little smart ;-)
23254
23255         * ../tests/try.cs : Fix. It's not 'finalize' my friend, it's 'finally' !
23256         Hooray, try and catch statements parse fine !
23257
23258 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23259
23260         * statement.cs (Block::GetVariableType): Fix logic to extract the type
23261         string from the hashtable of variables.
23262
23263         * cs-parser.jay (event_accessor_declarations): Trivial fix. Man, how did
23264         I end up making that mistake ;-)
23265         (catch_clauses): Fixed gross error which made Key and Value of the 
23266         DictionaryEntry the same : $1 !!
23267
23268 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23269
23270         * cs-tokenizer.cs (initTokens): Add keywords 'add' and 'remove'
23271
23272         * cs-parser.jay (event_declaration): Correct to remove the semicolon
23273         when the add and remove accessors are specified. 
23274
23275 2001-08-28  Ravi Pratap  <ravi@che.iitm.ac.in>
23276
23277         * cs-parser.jay (IndexerDeclaration): New helper class to hold
23278         information about indexer_declarator.
23279         (indexer_declarator): Implement actions.
23280         (parsing_indexer): New local boolean used to keep track of whether
23281         we are parsing indexers or properties. This is necessary because 
23282         implicit_parameters come into picture even for the get accessor in the 
23283         case of an indexer.
23284         (get_accessor_declaration, set_accessor_declaration): Correspondingly modified.
23285
23286         * class.cs (Indexer): New class for indexer declarations.
23287         (TypeContainer::AddIndexer): New method to add an indexer to a type.
23288         (TypeContainer::indexers): New member to hold list of indexers for the
23289         type.
23290
23291 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23292
23293         * cs-parser.jay (add_accessor_declaration): Implement action.
23294         (remove_accessor_declaration): Implement action.
23295         (event_accessors_declaration): Implement
23296         (variable_declarators): swap statements for first rule - trivial.
23297
23298         * class.cs (Event): New class to hold information about event
23299         declarations.
23300         (TypeContainer::AddEvent): New method to add an event to a type
23301         (TypeContainer::events): New member to hold list of events.
23302
23303         * cs-parser.jay (event_declaration): Implement actions.
23304
23305 2001-08-27  Ravi Pratap  <ravi@che.iitm.ac.in>
23306
23307         * cs-parser.jay (dim_separators): Implement. Make it a string
23308         concatenating all the commas together, just as they appear.
23309         (opt_dim_separators): Modify accordingly
23310         (rank_specifiers): Update accordingly. Basically do the same
23311         thing - instead, collect the brackets here.
23312         (opt_rank_sepcifiers): Modify accordingly.
23313         (array_type): Modify to actually return the complete type string
23314         instead of ignoring the rank_specifiers.
23315         (expression_list): Implement to collect the expressions
23316         (variable_initializer): Implement. We make it a list of expressions
23317         essentially so that we can handle the array_initializer case neatly too.
23318         (variable_initializer_list): Implement.
23319         (array_initializer): Make it a list of variable_initializers
23320         (opt_array_initializer): Modify accordingly.
23321
23322         * expression.cs (New::NType): Add enumeration to help us
23323         keep track of whether we have an object/delegate creation
23324         or an array creation.
23325         (New:NewType, New::Rank, New::Indices, New::Initializers): New
23326         members to hold data about array creation.
23327         (New:New): Modify to update NewType
23328         (New:New): New Overloaded contructor for the array creation
23329         case.
23330
23331         * cs-parser.jay (array_creation_expression): Implement to call
23332         the overloaded New constructor.
23333
23334 2001-08-26  Ravi Pratap  <ravi@che.iitm.ac.in>
23335
23336         * class.cs (TypeContainer::Constructors): Return member
23337         constructors instead of returning null.
23338
23339 2001-08-26  Miguel de Icaza  <miguel@ximian.com>
23340
23341         * typemanager.cs (InitCoreTypes): Initialize the various core
23342         types after we have populated the type manager with the user
23343         defined types (this distinction will be important later while
23344         compiling corlib.dll)
23345
23346         * expression.cs, literal.cs, assign.cs, constant.cs: Started work
23347         on Expression Classification.  Now all expressions have a method
23348         `Resolve' and a method `Emit'.
23349
23350         * codegen.cs, cs-parser.jay: Fixed the bug that stopped code
23351         generation from working.     Also add some temporary debugging
23352         code. 
23353
23354 2001-08-24  Miguel de Icaza  <miguel@ximian.com>
23355
23356         * codegen.cs: Lots of code generation pieces.  This is only the
23357         beginning, will continue tomorrow with more touches of polish.  We
23358         handle the fundamentals of if, while, do, for, return.  Others are
23359         trickier and I need to start working on invocations soon.
23360
23361         * gen-treedump.cs: Bug fix, use s.Increment here instead of
23362         s.InitStatement. 
23363
23364         * codegen.cs (EmitContext): New struct, used during code
23365         emission to keep a context.   Most of the code generation will be
23366         here. 
23367
23368         * cs-parser.jay: Add embedded blocks to the list of statements of
23369         this block.  So code generation proceeds in a top down fashion.
23370
23371 2001-08-23  Miguel de Icaza  <miguel@ximian.com>
23372
23373         * statement.cs: Add support for multiple child blocks.
23374
23375 2001-08-22  Miguel de Icaza  <miguel@ximian.com>
23376
23377         * codegen.cs (EmitCode): New function, will emit the code for a
23378         Block of code given a TypeContainer and its ILGenerator. 
23379
23380         * statement.cs (Block): Standard public readonly optimization.
23381         (Block::Block constructors): Link children. 
23382         (Block::Child): Child Linker.
23383         (Block::EmitVariables): Emits IL variable declarations.
23384
23385         * class.cs: Drop support for MethodGroups here, delay until
23386         Semantic Analysis.
23387         (Method::): Applied the same simplification that I did before, and
23388         move from Properties to public readonly fields.
23389         (Method::ParameterTypes): Returns the parameter types for the
23390         function, and implements a cache that will be useful later when I
23391         do error checking and the semantic analysis on the methods is
23392         performed.
23393         (Constructor::GetCallingConvention): Renamed from CallingConvetion
23394         and made a method, optional argument tells whether this is a class
23395         or a structure to apply the `has-this' bit.
23396         (Method::GetCallingConvention): Implement, returns the calling
23397         convention. 
23398         (Method::Define): Defines the type, a second pass is performed
23399         later to populate the methods.
23400
23401         (Constructor::ParameterTypes): implement a cache similar to the
23402         one on Method::ParameterTypes, useful later when we do semantic
23403         analysis. 
23404
23405         (TypeContainer::EmitMethod):  New method.  Emits methods.
23406
23407         * expression.cs: Removed MethodGroup class from here.
23408
23409         * parameter.cs (Parameters::GetCallingConvention): new method.
23410
23411 2001-08-21  Miguel de Icaza  <miguel@ximian.com>
23412
23413         * class.cs (TypeContainer::Populate): Drop RootContext from the
23414         argument. 
23415
23416         (Constructor::CallingConvention): Returns the calling convention.
23417         (Constructor::ParameterTypes): Returns the constructor parameter
23418         types. 
23419
23420         (TypeContainer::AddConstructor): Keep track of default constructor
23421         and the default static constructor.
23422
23423         (Constructor::) Another class that starts using `public readonly'
23424         instead of properties. 
23425
23426         (Constructor::IsDefault): Whether this is a default constructor. 
23427
23428         (Field::) use readonly public fields instead of properties also.
23429
23430         (TypeContainer::TypeAttr, TypeContainer::AddConstructor): Keep
23431         track of static constructors;  If none is used, turn on
23432         BeforeFieldInit in the TypeAttributes. 
23433
23434         * cs-parser.jay (opt_argument_list): now the return can be null
23435         for the cases where there are no arguments. 
23436
23437         (constructor_declarator): If there is no implicit `base' or
23438         `this', then invoke the default parent constructor. 
23439
23440         * modifiers.cs (MethodAttr): New static function maps a set of
23441         modifiers flags into a MethodAttributes enum
23442         (FieldAttr): renamed from `Map'.  So now we have FieldAttr,
23443         MethodAttr, TypeAttr to represent the various mappings where the
23444         modifiers are used.
23445         (FieldAttr): Map also `readonly' to `FieldAttributes.InitOnly'  
23446
23447 2001-08-19  Miguel de Icaza  <miguel@ximian.com>
23448
23449         * parameter.cs (GetParameterInfo): Fix bug where there would be no
23450         method arguments.
23451
23452         * interface.cs (PopulateIndexer): Implemented the code generator
23453         for interface indexers.
23454
23455 2001-08-17  Miguel de Icaza  <miguel@ximian.com>
23456
23457         * interface.cs (InterfaceMemberBase): Now we track the new status
23458         here.  
23459
23460         (PopulateProperty): Implement property population.  Woohoo!  Got
23461         Methods and Properties going today. 
23462
23463         Removed all the properties for interfaces, and replaced them with
23464         `public readonly' fields. 
23465
23466 2001-08-16  Miguel de Icaza  <miguel@ximian.com>
23467
23468         * interface.cs (AddEvent, AddMethod, AddIndexer, AddProperty):
23469         initialize their hashtables/arraylists only when they are needed
23470         instead of doing this always.
23471
23472         * parameter.cs: Handle refs and out parameters.
23473
23474         * cs-parser.jay: Use an ArrayList to construct the arguments
23475         instead of the ParameterCollection, and then cast that to a
23476         Parameter[] array.
23477
23478         * parameter.cs: Drop the use of ParameterCollection and use
23479         instead arrays of Parameters.
23480
23481         (GetParameterInfo): Use the Type, not the Name when resolving
23482         types. 
23483
23484 2001-08-13  Miguel de Icaza  <miguel@ximian.com>
23485
23486         * parameter.cs: Eliminate the properties Name, Type and ModFlags,
23487         and instead use public readonly fields.
23488
23489         * class.cs: Put back walking code for type containers.
23490
23491 2001-08-11  Miguel de Icaza  <miguel@ximian.com>
23492
23493         * class.cs (MakeConstant): Code to define constants.
23494
23495         * rootcontext.cs (LookupType): New function.  Used to locate types 
23496
23497
23498 2001-08-08  Miguel de Icaza  <miguel@ximian.com>
23499
23500         * rootcontext.cs: OH MY!  My trick works!   It is amazing how nice
23501         this System.Reflection code is.  Kudos to Microsoft
23502
23503         * typemanager.cs: Implement a type cache and avoid loading all
23504         types at boot time.  Wrap in LookupType the internals.  This made
23505         the compiler so much faster.  Wow.  I rule!
23506
23507         * driver.cs: Make sure we always load mscorlib first (for
23508         debugging purposes, nothing really important).
23509
23510         * Renamespaced things that were on `CSC' to `CIR'.  Maybe I should
23511         have moved to `CSC' rather than `CIR'.  Oh man!  The confussion!  
23512
23513         * rootcontext.cs: Lookup types on their namespace;  Lookup types
23514         on namespaces that have been imported using the `using' keyword.
23515
23516         * class.cs (TypeContainer::TypeAttr): Virtualize.
23517         (Class::TypeAttr): Return attributes suitable for this bad boy.
23518         (Struct::TypeAttr): ditto.
23519         Handle nested classes.
23520         (TypeContainer::) Remove all the type visiting code, it is now
23521         replaced with the rootcontext.cs code
23522
23523         * rootcontext.cs (GetClassBases): Added support for structs. 
23524
23525 2001-08-06  Miguel de Icaza  <miguel@ximian.com>
23526
23527         * interface.cs, statement.cs, class.cs, parameter.cs,
23528         rootcontext.cs, gen-treedump.cs, enum.cs, cs-parse.jay:
23529         Drop use of TypeRefs, and use strings instead.
23530
23531 2001-08-04  Miguel de Icaza  <miguel@ximian.com>
23532
23533         * rootcontext.cs: 
23534
23535         * class.cs (Struct::Struct): set the SEALED flags after
23536         checking the modifiers.
23537         (TypeContainer::TypeAttr): new property, returns the
23538         TypeAttributes for a class.  
23539
23540         * cs-parser.jay (type_list): Oops, list production was creating a
23541         new list of base types.
23542
23543         * rootcontext.cs (StdLib): New property.
23544         (GetInterfaceTypeByName): returns an interface by type name, and
23545         encapsulates error handling here.
23546         (GetInterfaces): simplified.
23547         (ResolveTree): Encapsulated all the tree resolution here.
23548         (CreateClass, GetClassBases, GetInterfaceOrClass): Create class
23549         types. 
23550
23551         * driver.cs: Add support for --nostdlib, to avoid loading the
23552         default assemblies.
23553         (Main): Do not put tree resolution here. 
23554
23555         * rootcontext.cs: Beginning of the class resolution.
23556
23557 2001-08-03  Miguel de Icaza  <miguel@ximian.com>
23558
23559         * rootcontext.cs: Provide better error reporting. 
23560
23561         * cs-parser.jay (interface_base): set our $$ to be interfaces.
23562
23563         * rootcontext.cs (CreateInterface): Handle the case where there
23564         are no parent interfaces.
23565
23566         (CloseTypes): Routine to flush types at the end.
23567         (CreateInterface): Track types.
23568         (GetInterfaces): Returns an array of Types from the list of
23569         defined interfaces.
23570
23571         * typemanager.c (AddUserType): Mechanism to track user types (puts
23572         the type on the global type hash, and allows us to close it at the
23573         end). 
23574
23575 2001-08-02  Miguel de Icaza  <miguel@ximian.com>
23576
23577         * tree.cs: Removed RecordType, added RecordClass, RecordStruct and
23578         RecordInterface instead.
23579
23580         * cs-parser.jay: Updated to reflect changes above.
23581
23582         * decl.cs (Definition): Keep track of the TypeBuilder type that
23583         represents this type here.  Not sure we will use it in the long
23584         run, but wont hurt for now.
23585
23586         * driver.cs: Smaller changes to accomodate the new code.
23587
23588         Call ResolveInterfaceBases, Call ResolveClassBases, Save assembly
23589         when done. 
23590
23591         * rootcontext.cs (CreateInterface):  New method, used to create
23592         the System.TypeBuilder type for interfaces.
23593         (ResolveInterfaces): new entry point to resolve the interface
23594         hierarchy. 
23595         (CodeGen): Property, used to keep track of the code generator.
23596
23597 2001-07-26  Miguel de Icaza  <miguel@ximian.com>
23598
23599         * cs-parser.jay: Add a second production for delegate_declaration
23600         with `VOID'.
23601
23602         (enum_body): Put an opt_comma here instead of putting it on
23603         enum_body or enum_member_declarations so we can handle trailing
23604         commas on enumeration members.  Gets rid of a shift/reduce.
23605
23606         (type_list): Need a COMMA in the middle.
23607
23608         (indexer_declaration): Tell tokenizer to recognize get/set
23609
23610         * Remove old targets.
23611
23612         * Re-add the parser target.
23613
23614 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23615
23616         * cs-parser.jay: Add precendence rules for a number of operators
23617         ot reduce the number of shift/reduce conflicts in the grammar.
23618
23619 2001-07-17  Miguel de Icaza  <miguel@ximian.com>
23620
23621         * tree.cs: moved IGenerator interface and renamed it to ITreeDump
23622         and put it here.
23623
23624         Get rid of old crufty code.
23625
23626         * rootcontext.cs: Use this to keep track of the parsed
23627         representation and the defined types available to the program. 
23628
23629         * gen-treedump.cs: adjust for new convention.
23630
23631         * type.cs: Split out the type manager, and the assembly builder
23632         from here. 
23633
23634         * typemanager.cs: the type manager will live here now.
23635
23636         * cil-codegen.cs: And the code generator here. 
23637
23638 2001-07-14  Sean MacIsaac  <macisaac@ximian.com>
23639
23640         * makefile: Fixed up for easy making.
23641
23642 2001-07-13  Simon Cozens <simon@simon-cozens.org>
23643
23644         * cs-parser.jay (rank_specifier): Remove a conflict by reordering
23645         the 
23646
23647         (unary_expression): Expand pre_increment_expression and
23648         post_decrement_expression to reduce a shift/reduce.
23649
23650 2001-07-11  Simon Cozens
23651
23652         * cs-tokenizer.cs: Hex numbers should begin with a 0.
23653
23654         Improve allow_keyword_as_indent name.
23655
23656 2001-06-19  Miguel de Icaza  <miguel@ximian.com>
23657
23658         * Adjustments for Beta2. 
23659
23660 2001-06-13  Miguel de Icaza  <miguel@ximian.com>
23661
23662         * decl.cs: Added `Define' abstract method.
23663         (InTransit): new property, used to catch recursive definitions. 
23664
23665         * interface.cs: Implement `Define'. 
23666
23667         * modifiers.cs: Map Modifiers.constants to
23668         System.Reflection.TypeAttribute flags.
23669
23670         * class.cs: Keep track of types and user-defined types.
23671         (BuilderInit): New method for creating an assembly
23672         (ResolveType): New function to launch the resolution process, only
23673         used by interfaces for now.
23674
23675         * cs-parser.jay: Keep track of Classes, Structs and Interfaces
23676         that are inserted into the name space. 
23677
23678 2001-06-08  Miguel de Icaza  <miguel@ximian.com>
23679
23680         * ARGH.  I have screwed up my tree so many times due to the use of
23681         rsync rather than using CVS.  Going to fix this at once. 
23682
23683         * driver.cs: Objetify driver.  Load assemblies, use assemblies to
23684         load types.
23685
23686 2001-06-07  Miguel de Icaza  <miguel@ximian.com>
23687
23688         * Experiment successful: Use System.Type rather that our own
23689         version of Type.  
23690
23691 2001-05-25  Miguel de Icaza  <miguel@ximian.com>
23692
23693         * cs-parser.jay: Removed nsAliases from here.
23694
23695         Use new namespaces, handle `using XXX;' 
23696
23697         * namespace.cs: Reimplemented namespace handling, use a recursive
23698         definition of the class.  Now we can keep track of using clauses
23699         and catch invalid using clauses.
23700
23701 2001-05-24  Miguel de Icaza  <miguel@ximian.com>
23702
23703         * gen-treedump.cs: Adapted for all the renaming.
23704
23705         * expression.cs (Expression): this class now has a Type property
23706         which returns an expression Type.
23707
23708         (Probe::, New::, TypeOf::, SizeOf::, Constant::): renamed from
23709         `Type', as this has a different meaning now in the base
23710
23711 2001-05-22  Miguel de Icaza  <miguel@ximian.com>
23712
23713         * interface.cs, class.cs: Removed from all the sources the
23714         references to signature computation, as we can not do method
23715         signature computation during the parsing time, as we are not
23716         trying to solve at that point distinguishing:
23717
23718         class X {
23719                 void a (Blah x) {}
23720                 void a (NS.Blah x) {}
23721         }
23722
23723         Which depending on the context might be valid or not, as we do not
23724         know if Blah is the same thing as NS.Blah at that point.
23725
23726         * Redid everything so the code uses TypeRefs now instead of
23727         Types.  TypeRefs are just temporary type placeholders, that need
23728         to be resolved.  They initially have a pointer to a string and the
23729         current scope in which they are used.  This is used later by the
23730         compiler to resolve the reference to an actual Type. 
23731
23732         * DeclSpace is no longer a CIR.Type, and neither are
23733         TypeContainers (Class and Struct) nor Interfaces nor Enums.  They
23734         are all DeclSpaces, but no Types. 
23735
23736         * type.cs (TypeRefManager): This implements the TypeRef manager,
23737         which keeps track of all the types that need to be resolved after
23738         the parsing has finished. 
23739
23740 2001-05-13  Miguel de Icaza  <miguel@ximian.com>
23741
23742         * ARGH.  We are going to have to store `foreach' as a class rather
23743         than resolving it, as we need to verify error 1579 after name
23744         resolution.   *OR* we could keep a flag that says `This request to
23745         IEnumerator comes from a foreach statement' which we can then use
23746         to generate the error.
23747
23748 2001-05-10  Miguel de Icaza  <miguel@ximian.com>
23749
23750         * class.cs (TypeContainer.AddMethod): we now add methods to the
23751         MethodGroup instead of the method hashtable.  
23752
23753         * expression.cs: Add MethodGroup abstraction, which gets us one
23754         step closer to the specification in the way we handle method
23755         declarations.  
23756
23757         * cs-parser.jay (primary_expression): qualified_identifier now
23758         tried to match up an identifier to a local variable reference or
23759         to a parameter reference.
23760
23761         current_local_parameters is now a parser global variable that
23762         points to the current parameters for the block, used during name
23763         lookup.
23764
23765         (property_declaration): Now creates an implicit `value' argument to
23766         the set accessor.
23767
23768 2001-05-09  Miguel de Icaza  <miguel@ximian.com>
23769
23770         * parameter.cs: Do not use `param' arguments as part of the
23771         signature, per the spec.
23772
23773 2001-05-08  Miguel de Icaza  <miguel@ximian.com>
23774
23775         * decl.cs: Base class for classes, structs and interfaces.  This
23776         is the "Declaration Space" 
23777
23778         * cs-parser.jay: Use CheckDef for checking declaration errors
23779         instead of having one on each function.
23780
23781         * class.cs: Factor out some code for handling error handling in
23782         accordance to the "Declarations" section in the "Basic Concepts"
23783         chapter in the ECMA C# spec.
23784
23785         * interface.cs: Make all interface member classes derive from
23786         InterfaceMemberBase.
23787
23788 2001-05-07  Miguel de Icaza  <miguel@ximian.com>
23789
23790         * Many things: all interfaces are parsed and generated in
23791         gen-treedump.  Support for member variables, constructors,
23792         destructors, properties, constants is there.
23793
23794         Beginning of the IL backend, but very little done, just there for
23795         testing purposes. 
23796
23797 2001-04-29  Miguel de Icaza  <miguel@ximian.com>
23798
23799         * cs-parser.jay: Fix labeled statement.
23800
23801         * cs-tokenizer.cs (escape): Escape " and ' always.
23802         ref_line, ref_name: keep track of the line/filename as instructed
23803         by #line by the compiler.
23804         Parse #line.
23805
23806 2001-04-27  Miguel de Icaza  <miguel@ximian.com>
23807
23808         * System.CodeDOM/CodeBinaryOperatorExpression.cs: Rearrange enum
23809         to match the values in System.CodeDOM.
23810
23811         Divid renamed to Divide.
23812
23813         * System.CodeDOM/CodeForLoopStatement.cs: Always have valid
23814         statements. 
23815         (Statements.set): remove.
23816
23817         * System.CodeDOM/CodeCatchClause.cs: always have a valid
23818         statements. 
23819
23820         * System.CodeDOM/CodeIfStatement.cs: trueStatements and
23821         falseStatements always have valid values. 
23822
23823         * cs-parser.jay: Use System.CodeDOM now.
23824